Option Explicit

 

Private sName As String

Private sType As String

Private sDesc As String

Private bMagical As Boolean

'Special off/def bonuses

Private objDefBonus() As udtBonus

Private objOffBonus() As udtBonus

 

Private colSpells As Collection

'Defense offered by armor piece

Private iBaseDefense As Integer

Private iCurDefense As Integer

Private iHP As Integer

Private iBaseHP As Integer

Private iPiece As ArmorLocation

Private byteStrReq As Byte

Private iWeight As Integer

 

Public Property Get Name() As String

    Name = sName

End Property

 

Public Property Let Name(ByVal sData As String)

    sName = sData

End Property

 

Public Property Let Spells(ByVal colData As Collection)

    Set colSpells = colData

End Property

 

Public Property Get Spells() As Collection

    Set Spells = colSpells

End Property

 

Public Property Get ArmorType() As String

    ArmorType = sType

End Property

 

Public Property Get Description() As String

    Description = sDesc

End Property

 

Public Property Let ArmorType(ArmorType As String)

    sType = ArmorType

End Property

 

Public Property Let Description(Description As String)

    sDesc = Description

End Property

 

Public Property Let HP(iData As Integer)

    iHP = iData

End Property

 

Public Property Let Magical(Magical As Boolean)

    bMagical = Magical

End Property

 

Public Property Get Magical() As Boolean

    Magical = bMagical

End Property

 

Public Property Get Piece() As Integer

    Piece = iPiece

End Property

 

Public Property Let Piece(iData As Integer)

    iPiece = iData

End Property

 

Private Sub Class_Terminate()

    Set colSpells = Nothing

End Sub

 

Public Property Get HP() As Integer

    HP = iHP

End Property

 

Public Property Get BaseHP() As Integer

    BaseHP = iBaseHP

End Property

 

Public Property Let BaseHP(iData As Integer)

    iBaseHP = iData

End Property

 

Public Property Get Defense() As Integer

    Defense = iCurDefense

End Property

 

Public Property Let Defense(iData As Integer)

    iBaseDefense = iData

End Property

 

Public Function GetDefBonus() As Integer

   

    Dim iLp As Integer

    Dim iTotal As Integer

   

    iTotal = 0

   

    For iLp = 0 To UBound(objDefBonus)

        iTotal = iTotal + objDefBonus(iLp).iAmount

    Next iLp

   

    GetDefBonus = iTotal

   

End Function

 

Public Sub SetDefBonus(ByVal iAmount As Integer, ByVal iTimeStarted As Integer, ByVal iDuration As Integer)

 

    Dim iIndex As Integer

   

    On Error Resume Next

   

    iIndex = -1

   

    iIndex = UBound(objDefBonus)

   

    If iIndex = -1 Then

        iIndex = 0

        ReDim objDefBonus(iIndex)

    Else

        iIndex = iIndex + 1

        ReDim Preserve objDefBonus(iIndex)

    End If

   

    With objDefBonus(iIndex)

        .iAmount = iAmount

        .iDuration = iDuration

        .iTimeStarted = iTimeStarted

    End With

   

End Sub

 

Public Function GetOffBonus() As Integer

 

    Dim iLp As Integer

    Dim iTotal As Integer

   

    iTotal = 0

   

    For iLp = 0 To UBound(objOffBonus)

        iTotal = iTotal + objOffBonus(iLp).iAmount

    Next iLp

   

    GetOffBonus = iTotal

End Function

 

Public Sub SetOffBonus(ByVal iAmount As Integer, ByVal iTimeStarted As Integer, ByVal iDuration As Integer)

 

    Dim iIndex As Integer

   

    On Error Resume Next

   

    iIndex = -1

   

    iIndex = UBound(objOffBonus)

   

    If iIndex = -1 Then

        iIndex = 0

        ReDim objOffBonus(iIndex)

    Else

        iIndex = iIndex + 1

        ReDim Preserve objOffBonus(iIndex)

    End If

   

    With objOffBonus(iIndex)

        .iAmount = iAmount

        .iDuration = iDuration

        .iTimeStarted = iTimeStarted

    End With

 

End Sub

 

Public Property Get Weight() As Integer

    Weight = iWeight

End Property

 

Public Property Let Weight(ByVal iData As Integer)

    iWeight = iData

End Property

 

Public Property Get StrReq() As Byte

    StrReq = byteStrReq

End Property

 

Public Property Let StrReq(ByVal byteData As Byte)

    byteStrReq = byteData

End Property

 

Public Sub Damage(ByVal iAmount As Integer)

 

    iHP = iHP - iAmount

   

    If iHP < 1 Then

       

    End If

 

End Sub

 

Public Sub Repair(ByVal iAmount As Integer)

 

    If iHP + iAmount <= iBaseHP Then

        iHP = iHP + iAmount

    End If

 

End Sub