Attacks are used to deal damage to characters, structures and items. They can be defined in the weapon components of the items or the limb definitions of the characters. The limb attacks can also be used by the player, when they control a monster or have some appendage, like a husk stinger. More...
Public Member Functions | |
void | SetUser (Character user) |
List< Affliction > | GetMultipliedAfflictions (float multiplier) |
float | GetStructureDamage (float deltaTime) |
float | GetLevelWallDamage (float deltaTime) |
float | GetItemDamage (float deltaTime, float multiplier=1) |
float | GetTotalDamage (bool includeStructureDamage=false) |
Attack (float damage, float bleedingDamage, float burnDamage, float structureDamage, float itemDamage, float range=0.0f) | |
Attack (ContentXElement element, string parentDebugName, Item sourceItem) | |
Attack (ContentXElement element, string parentDebugName) | |
void | ReloadAfflictions (ContentXElement element, string parentDebugName) |
void | Serialize (ContentXElement element) |
void | Deserialize (ContentXElement element, string parentDebugName) |
AttackResult | DoDamage (Character attacker, IDamageable target, Vector2 worldPosition, float deltaTime, bool playSound=true, PhysicsBody sourceBody=null, Limb sourceLimb=null) |
AttackResult | DoDamageToLimb (Character attacker, Limb targetLimb, Vector2 worldPosition, float deltaTime, bool playSound=true, PhysicsBody sourceBody=null, Limb sourceLimb=null) |
void | UpdateCoolDown (float deltaTime) |
void | UpdateAttackTimer (float deltaTime, Character character) |
void | ResetAttackTimer () |
void | SetCoolDown (bool applyRandom) |
void | ResetCoolDown () |
bool | IsValidContext (AttackContext context) |
bool | IsValidContext (IEnumerable< AttackContext > contexts) |
bool | IsValidTarget (AttackTarget targetType) |
bool | IsValidTarget (Entity target) |
Vector2 | CalculateAttackPhase (TransitionMode easing=TransitionMode.Linear) |
Public Attributes | |
readonly List< int > | ForceOnLimbIndices = new List<int>() |
readonly Dictionary< Affliction, XElement > | Afflictions = new Dictionary<Affliction, XElement>() |
Properties | |
AttackContext | Context [get] |
AttackTarget | TargetType [get] |
LimbType | TargetLimbType [get] |
HitDetection | HitDetectionType [get] |
AIBehaviorAfterAttack | AfterAttack [get, set] |
float | AfterAttackDelay [get, set] |
AIBehaviorAfterAttack | AfterAttackSecondary [get, set] |
float | AfterAttackSecondaryDelay [get, set] |
bool | Reverse [get] |
bool | SnapRopeOnNewAttack [get] |
bool | Retreat [get] |
float | Range [get, set] |
float | DamageRange [get, set] |
float | MinRange [get] |
float | Duration [get] |
float | CoolDown = 5 [get, set] |
float | SecondaryCoolDown = 0 [get, set] |
float | CoolDownRandomFactor = 0 [get] |
bool | FullSpeedAfterAttack [get] |
float | StructureDamage [get, set] |
bool | CreateWallDamageProjectiles [get] |
bool | EmitStructureDamageParticles [get] |
float | ItemDamage [get, set] |
float | Penetration [get] |
float | DamageMultiplier = 1 [get, set] |
Used for multiplying all the damage. | |
float | RangeMultiplier = 1 [get, set] |
Used for multiplying all the ranges. | |
float | ImpactMultiplier = 1 [get, set] |
Used for multiplying the physics forces. | |
float | LevelWallDamage [get, set] |
bool | Ranged [get, set] |
bool | AvoidFriendlyFire [get, set] |
float | RequiredAngle [get, set] |
float | RequiredAngleToShoot [get, set] |
float | AimRotationTorque [get, set] |
int | RotationLimbIndex [get, set] |
float | SwayAmount [get, set] |
float | SwayFrequency [get, set] |
float | Stun [get, set] |
bool | OnlyHumans [get, set] |
string | ApplyForceOnLimbs [get, set] |
float | Force [get] |
Vector2 | RootForceWorldStart [get] |
Vector2 | RootForceWorldMiddle [get] |
Vector2 | RootForceWorldEnd [get] |
TransitionMode | RootTransitionEasing [get] |
float | Torque [get] |
bool | ApplyForcesOnlyOnce [get] |
float | TargetImpulse [get] |
Vector2 | TargetImpulseWorld [get] |
float | TargetForce [get] |
Vector2 | TargetForceWorld [get] |
float | SubmarineImpactMultiplier [get] |
float | SeverLimbsProbability [get, set] |
float | StickChance [get] |
float | Priority [get] |
bool | Blink [get] |
IEnumerable< StatusEffect > | StatusEffects [get] |
string | Name [get] |
Dictionary< Identifier, SerializableProperty > | SerializableProperties = new Dictionary<Identifier, SerializableProperty>() [get] |
List< PropertyConditional > | Conditionals = new List<PropertyConditional>() [get] |
Only affects ai decision making. All the conditionals has to be met in order to select the attack. TODO: allow to define conditionals using any (implemented in StatusEffect -> move from there to PropertyConditional?) | |
Item | SourceItem [get, set] |
float | AttackTimer [get] |
float | CoolDownTimer [get, set] |
float | CurrentRandomCoolDown [get] |
float | SecondaryCoolDownTimer [get, set] |
bool | IsRunning [get] |
float | AfterAttackTimer [get, set] |
![]() |
Attacks are used to deal damage to characters, structures and items. They can be defined in the weapon components of the items or the limb definitions of the characters. The limb attacks can also be used by the player, when they control a monster or have some appendage, like a husk stinger.
Barotrauma.Attack.Attack | ( | float | damage, |
float | bleedingDamage, | ||
float | burnDamage, | ||
float | structureDamage, | ||
float | itemDamage, | ||
float | range = 0::0f ) |
Barotrauma.Attack.Attack | ( | ContentXElement | element, |
string | parentDebugName, | ||
Item | sourceItem ) |
Barotrauma.Attack.Attack | ( | ContentXElement | element, |
string | parentDebugName ) |
Vector2 Barotrauma.Attack.CalculateAttackPhase | ( | TransitionMode | easing = TransitionMode::Linear | ) |
void Barotrauma.Attack.Deserialize | ( | ContentXElement | element, |
string | parentDebugName ) |
AttackResult Barotrauma.Attack.DoDamage | ( | Character | attacker, |
IDamageable | target, | ||
Vector2 | worldPosition, | ||
float | deltaTime, | ||
bool | playSound = true, | ||
PhysicsBody | sourceBody = null, | ||
Limb | sourceLimb = null ) |
AttackResult Barotrauma.Attack.DoDamageToLimb | ( | Character | attacker, |
Limb | targetLimb, | ||
Vector2 | worldPosition, | ||
float | deltaTime, | ||
bool | playSound = true, | ||
PhysicsBody | sourceBody = null, | ||
Limb | sourceLimb = null ) |
float Barotrauma.Attack.GetItemDamage | ( | float | deltaTime, |
float | multiplier = 1 ) |
float Barotrauma.Attack.GetLevelWallDamage | ( | float | deltaTime | ) |
List< Affliction > Barotrauma.Attack.GetMultipliedAfflictions | ( | float | multiplier | ) |
float Barotrauma.Attack.GetStructureDamage | ( | float | deltaTime | ) |
float Barotrauma.Attack.GetTotalDamage | ( | bool | includeStructureDamage = false | ) |
bool Barotrauma.Attack.IsValidContext | ( | AttackContext | context | ) |
bool Barotrauma.Attack.IsValidContext | ( | IEnumerable< AttackContext > | contexts | ) |
bool Barotrauma.Attack.IsValidTarget | ( | AttackTarget | targetType | ) |
bool Barotrauma.Attack.IsValidTarget | ( | Entity | target | ) |
void Barotrauma.Attack.ReloadAfflictions | ( | ContentXElement | element, |
string | parentDebugName ) |
void Barotrauma.Attack.ResetAttackTimer | ( | ) |
void Barotrauma.Attack.ResetCoolDown | ( | ) |
void Barotrauma.Attack.Serialize | ( | ContentXElement | element | ) |
void Barotrauma.Attack.SetCoolDown | ( | bool | applyRandom | ) |
void Barotrauma.Attack.SetUser | ( | Character | user | ) |
void Barotrauma.Attack.UpdateAttackTimer | ( | float | deltaTime, |
Character | character ) |
void Barotrauma.Attack.UpdateCoolDown | ( | float | deltaTime | ) |
readonly Dictionary<Affliction, XElement> Barotrauma.Attack.Afflictions = new Dictionary<Affliction, XElement>() |
readonly List<int> Barotrauma.Attack.ForceOnLimbIndices = new List<int>() |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
get |
|
get |
|
getset |
|
get |
|
get |
Only affects ai decision making. All the conditionals has to be met in order to select the attack. TODO: allow to define conditionals using any (implemented in StatusEffect -> move from there to PropertyConditional?)
|
get |
|
getset |
|
get |
|
getset |
|
get |
|
get |
|
getset |
Used for multiplying all the damage.
|
getset |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
Used for multiplying the physics forces.
|
get |
|
getset |
|
getset |
|
get |
|
get |
Implements Barotrauma.ISerializableEntity.
|
getset |
|
get |
|
get |
|
getset |
|
getset |
|
getset |
Used for multiplying all the ranges.
|
getset |
|
getset |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
getset |
|
getset |
|
getset |
|
get |
Implements Barotrauma.ISerializableEntity.
|
getset |
|
get |
|
getset |
|
get |
|
get |
|
getset |
|
getset |
|
get |
|
getset |
|
getset |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |
|
get |