Attack - Object Information

Sections in this file:


The following variables apply to Attack objects, for example those returned by the Cr.ChooseOneAttack function, or by looking at the members of the Cr.Attack() array.


Go back to top


Name As String 'Name of the weapon only
Kind As Integer '0 = melee, 1 = ranged, 2 = thrown
Touch As Boolean 'True = melee or ranged TOUCH attack
CrRef As Creature 'Creature that "owns" this attacks
CrRefId As Long 'ID of Creature that "owns" this attacks

'----- Misc. Data ------
Size As Integer 'As number, unused
SizeStr As String '"S", "M", "L"
DamageType As String 'Slashing/Piercing/Bludgeon as string "S/P/B"
Weight As Single 'New v.1.12.168
Cost As Single 'in gp
Reach As Integer 'In feat
Material As Integer
SpecialNote As Integer 'Mostly used to set something as "lycanthrope attack"
Hidden As Boolean 'Set to true to hide that attack
Category As Integer '0: N/A, 1: Unarmed, 2: Light, 3: One-handed, 4:Two-handed, 5:Ranged
'As in, light/2-handed, etc. Used for what handedness is allowed. And for weapon sizes.
'(New v.2.11)

'From the feats
Finesse As Boolean 'dex instead of str
PowerAttack As Integer
Expertise As Integer

'Natural attacks
NoOfAttacks As Integer 'max no of attacks
IsNatural As Boolean 'all attacks are at BAB(1)


Sub IncreaseSize(NumSteps As Integer)
'Increases the size of the attack by NumSted (>0 means bigger)
'Damage, etc. is adjusted.


Go back to top


'Hand used to fight:
' 0=Primary,
' 1=Off-Hand with two weapons
' 2=Primary hand with 2 weapons
' 3=Two-handed
' 4=Off-Hand, but only one weapon.
' 5=Secondary natural weapon
HandUsed As Integer

'These are calculated from HandUsed
PrimaryHand As Boolean 'if true, in the primary hand, fighting two-weapons
OffHand As Boolean 'if true, in the second hand

'Calculated automatically:
HandAllowed(0 To 7) As Boolean 'Which handedness are allowed

'Used to evaluate what penalties to give:
OffhandWeaponIsLight As Boolean 'Not saved but re-calculated

'Attack Bonuses
'Sum of attack bonuses for weapon only: this is a permanent value.
WeaponAttackBonus As Integer
MagicBonus As Integer 'Magical enhancement - basically used for DR ONLY
'Sum of attack bonuses, less the base attack bonus. This is calculated.
AttackBonus As Integer
AB(1 To MAX_BAB) As Integer 'Attack bonuses for the first and following attacks.

RangePenalty As Integer 'Calculated current range penalty (New v.2.00)
Range As Long 'Range increment in feet

'New, v.2.20
IsNotProficient As Boolean 'Set to true to apply non-proficiency penalty to attack.


Sub CalcRangePenalty()
'Calculates the penalty based on the holding creature's Range


Go back to top


Subdual As Boolean 'true = is dealing subdual damage now.
NormalSubdual As Boolean 'true = a regular attack is subdual
TempSubdual As Boolean 'true = switched from normal to subdual (or vice-versa)

'First (main) Dice of Damage
'Intrinsic weapon damage bonus: this is a permanent value, coming from masterwork or magic.
WeaponDamageBonus As Integer 'Intrinsic weapon damage
DamageBonus As Integer 'CALCULATED sum of damage bonuses
NoDice As Integer 'Number of dice to throw
Dice As Integer 'Value of dice
DamageStr As String 'damage dice (2d6+3)
DamageNote As String '" and poison" for example
DamageType1 As String 'Like slashing, fire

CriticalStr As String 'String (19-20/x2)
CritRange As Byte 'Range of critical hit. 2 = 19-20 for example
CritMult As Byte 'Multiplier of damage

'Second Dice of Damage (New v.2.00)
GiveSecondDamage As Boolean 'Is the checkbox to give the 2nd dice of damage checked?

WeaponDamageBonus2 As Integer 'Intrinsic bonus to 2nd dice of damage
DamageBonus2 As Integer 'Calculated, Specific to the 2nd dice
NoDice2 As Integer 'Number of dice to throw (2nd dice)
Dice2 As Integer
DamageStr2 As String 'damage dice (2d6+3)
DamageNote2 As String '"plus poison"
DamageType2 As String 'Like slashing, fire

CriticalStr2 As String 'String (19-20/x2)
CritRange2 As Byte 'Range of critical hit. 2 = 19-20 for example
CritMult2 As Byte 'Multiplier of damage


Function RollDamage(NumberToRoll As Integer, DetailedRoll As String) As Integer
'Roll the damage for dice # NumberToRoll (1 is the main, 2 is the second dice)
'Returns DetailedRoll, a string with details
'Also returns an integer, the total roll.

Sub ReadDamageStr(DamageDiceNumber As Integer, Optional StrMod As Integer = 0)
'Interprets the damage string .DamageStr or .DamageStr2, for the dice #DamageDiceNumber
'StrMod is unused.

Sub MakeCriticalStr()
'Makes the string from the values entered.

Sub ReadCriticalStr()
'Takes the values in CriticalStr and calculates range/multiplier
'Call this if you change CriticalStr

Documentation for DM Genie and Player Genie, page Attack. Copyright © Mad Scientist Studios, 2006.
Help Contents   |   DM Genie home page
Click here if you cannot see the table of contents on the left