Attack Types

Attack Types post thumbnail image

In OpenBOR, each attack is assigned a type. Attack types are then used to handle how the target will react when struck by a given attack. In the simplest example, a standard attack might cause the target to buckle in pain, whereas another would light them on fire, and a third would freeze them in place for a time. More sophisticated attributes allow differing animations when recovering, making a target more (or less) resistant to specific attack types, and so on.

Attack types are identified by a 0 indexed integer, and the default type is 0. There are also a few predefined attack types identified by name, but ultimately all attack types behave exactly the same.

Attack Type Relationships

When an attack hits its target, the target will play a corresponding reaction animation depending on several factors. As an example, when an non-knockdown attack type of 1 hits the target, the target will play the PAIN2 animation. If the attack does knock the target down, then the target will play its FALL2 animation, and then RISE2 to get back up. If the attack KO’s the target and you have enabled death animations, the target will play DEATH2.

If the target does not have a corresponding reaction animation, then OpenBOR will always default to attack 0 reactions. So in the above example, if the target doesn’t have a FALL2, it will still play PAIN2 on a standing hit from attack type 2, but then revert to FALL when knocked down.

Note: The above description of attack type 1 triggering PAIN2/FALL2/etc. is not a typo. This is because legacy text commands are not 0 indexed.

TypeTextLegacy TextPain AnimationFall AnimationRise AnimationRise Attack AnimationConstant
0 (default)attack.damage.type 0 or no type defined.attack {args}, attack1 {args}, blast {args}, freeze {args}, steal {args}PainFallRiseRiseattackopenborconstant("ATK_NORMAL")
1attack.damage.type 1attack2 {args}pain2fall2rise2riseattack2openborconstant("ATK_NORMAL2")
2+ (3, 4, …)attack.damage.type 2…attack3 {args}…pain3…fall3…rise3…riseattack3…openborconstant("ATK_NORMAL3")...
Blast
Burn (Numeric value assigned internally by engine)
attack.damage.type blastblast {args}…PainFallRiseRiseattack openborconstant("ATK_BLAST")
Burn (Numeric value assigned internally by engine)attack.damage.type burnburn {args}bpainburnrisebriseattackbopenborconstant("ATK_BURN")
Shock (Numeric value assigned internally by engine)attack.damage.type shockshock {args}spainshockrisesriseattacksopenborconstant("ATK_SHOCK")
TypeTextLegacy TextPain AnimationFall AnimationRise AnimationRise Attack AnimationConstant

Defining Attack Types

Named Attack Types

OpenBOR has a small set of predefined attack types identified by name.

Blast

On its own, the blast type has no special effects or reaction animations. The “blasted” effect is provided by setting various other attack properties to produce a knockdown effect that throws the target considerable distance while potentially hitting other opponents along the way. As of OpenBOR version 4183 the command is depreciated. Instead, include the following attributes with any attack type to add a blast effect:

attack.damage.type blast # Optional. The blast type itself does nothing and causes type 1 reactions. Use any type you prefer for the attack.
attack.damage.land.mode 1 # Allows the target to hit others during fall.
attack.reaction.fall.force 1 # Knockdown. Adjust as needed to overcome target's resistance to knockdown.
attack.reaction.fall.velocity.x 5 # Adjust for more or less horizontal distance. 
attack.reaction.fall.velocity.y 3 # Adjust for more or less vertical lift.

Burn

Burn attacks induce the following reaction animations. They otherwise operate identically to indexed attack types.

  • BPAIN – Standing hit.
  • BURN – Knockdown hit.
  • BDEATH – KO from hit.
  • BRISE – Rising from knockdown.
  • BRISEATTACK – Attacking from fall position.

Freeze

Freeze is not really a unique attack type. Instead, it is actually an attack type of 0 with several attributes defined to produce a freeze effect.

Shock

Shock attacks induce the following reaction animations. They otherwise operate identically to indexed attack types.

  • SPAIN – Standing hit.
  • SHOCK – Knockdown hit.
  • SDEATH – KO from hit.
  • SRISE – Rising from knockdown.
  • SRISEATTACK – Attacking from fall position.

Steal

Steal defines an attack 0 type with attributes to add the damage to attacker’s hit point total.

Special Types

OpenBOR applies special damage types to handle various events, such as time running out or falling into holes. Note that prior to 4.0, these events generally applied damage using Normal 1, or the last attack type available. Unless noted these damage types do not have associated reaction animations, but since the constants are exposed to script you can add custom reactions if desired.

You can also set offense/defense for special types individually (they are not affected by the “ALL” option). Of course you’ll want to be careful – it might seem funny to be immune to pit damage, until you find yourself stuck in the bottom of said pit with no way of getting out! In case it matters, the amount of damage applied is typically = target entity’s maximum hitpoints.

  • ATK_BOSS_DEATH – Used to KO leftover enemies when boss is defeated.
  • ATK_ITEM– Scripting item logic. Item “attacks” entity that collects it.
  • ATK_LAND – Damage applied when landing from thrown/blasted (damage on landing).
  • ATK_LIFESPAN – Lifespan timer expires.
  • ATK_LOSE – Players (with lose and or fall lose animation) take this damage when level time expires.
  • ATK_PIT – Entity falls into a pit and reaches pit level depth.
  • ATK_SUB_ENTITY_PARENT_KILL – Used to KO a summon when parent is killed (note, killed as in fully removed from play – i.e. after flashing out).
  • ATK_SUB_ENTITY_UNSUMMON – Used to KO a summon on unsummon frame.
  • ATK_TIMEOVER – Applied to players (without lose animation) when level time expires.

Related Post