Class Weapon.AttackData
This class will store damage done to a target CharacterData by a source CharacterData. The function to add damage will take care of applied all the strength/boost of the source and remove defense/resistance of the target.
The source can be null when its done by an non CharacterData source (elemental effect, environment etc.)
Inheritance
Namespace: CreatorKitCode
Assembly: Assembly-CSharp.dll
Syntax
public class AttackData
Constructors
AttackData(CharacterData, CharacterData)
Build a new AttackData. All AttackData need a target, but source is optional. If source is null, the damage is assume to be from a non CharacterData source (elemental effect, environment) and no boost will be applied to damage (target defense is still taken in account).
Declaration
public AttackData(CharacterData target, CharacterData source = null)
Parameters
Type | Name | Description |
---|---|---|
CharacterData | target | |
CharacterData | source |
Properties
Source
Declaration
public CharacterData Source { get; }
Property Value
Type | Description |
---|---|
CharacterData |
Target
Declaration
public CharacterData Target { get; }
Property Value
Type | Description |
---|---|
CharacterData |
Methods
AddDamage(StatSystem.DamageType, Int32)
Add an amount of damage given in the given type. The source (if non null, see class documentation for info) boost will be applied and the target defense will be removed from that amount.
Declaration
public int AddDamage(StatSystem.DamageType damageType, int amount)
Parameters
Type | Name | Description |
---|---|---|
StatSystem.DamageType | damageType | The type of damage |
System.Int32 | amount | The amount of damage |
Returns
Type | Description |
---|---|
System.Int32 |
GetDamage(StatSystem.DamageType)
Return the current amount of damage of the given type stored in that AttackData. This is the effective amount of damage, boost and defense have already been applied.
Declaration
public int GetDamage(StatSystem.DamageType damageType)
Parameters
Type | Name | Description |
---|---|---|
StatSystem.DamageType | damageType | The type of damage |
Returns
Type | Description |
---|---|
System.Int32 | How much damage of that type is stored in that AttackData |
GetFullDamage()
Return the total amount of damage across all type stored in that AttackData. This is effective damage, that mean all boost/defense was already applied.
Declaration
public int GetFullDamage()
Returns
Type | Description |
---|---|
System.Int32 | The total amount of damage across all type in that Attack Data |