OpenBOR includes a native system of damage control and mitigation. These settings allow you to adjust how entities deliver and respond to damage from different sources. As an example, you could make a character in your game partially resistant, totally immune, or even able to absorb damage from fire attacks. At the same time, you could make them more vulnerable to certain other attack types like water or ice.
Model
Model properties override their global counterparts for entities spawned from a given model. See individual properties for details.
Pain Configuration
Basic reaction behavior to hits.
pain_config <flags>
# Default
pain_config none
Accepts the following flags:
none
– No pain configuration. No effect if used with other flags.back_pain
– Enables back pain animations when hit from behind (and not ignoring pain).fall_disable
– Entity does not fall if hit with knockdown attack when at its base height.fall_disable_air
– Entity does not fall from hits when in the air. Normally any midair hit causes knockdown.pain_disable
– Entity does not enter pain animation.
Script
Pain config is an integer property with the following bitmasks:
openborconstant("PAIN_CONFIG_BACK_PAIN")
openborconstant("PAIN_CONFIG_FALL_DISABLE")
openborconstant("PAIN_CONFIG_FALL_DISABLE_AIR")
openborconstant("PAIN_CONFIG_NONE")
openborconstant("PAIN_CONFIG_PAIN_DISABLE")
Offense
Modifies damage output. Use one of the following commands followed by attack type and the property value. Offense accepts the following types:
all
– All non special types.normal#
– Numbered attack types. Substitute # for the attack type number. Example:normal5
for attack type 5.blast
– Blast type.burn
– Burn type.shock
– Shock type.steal
– Steal type.boss_death
– Special.item
– Special.land
– Special.lifespan
– Special.lose
– Special.pit
–Special.sub_entity_parent_kill
– Special.timeover
– Special.
Name | Default | Description |
---|---|---|
offense.damage.adjust | 0 | Direct adjustment to damage output. |
offense.damage.max | MAX_INT | Maximum damage output. |
offense.damage.min | MIN_INT | Minimum damage output. |
offense.damage.factor | 1.0 | Multiplier for damage output. OpenBOR multiplies damage output for the type by this value. If the result is a fraction, the engine will round it. Example: If the attack damage is 10 and factor is 1.5 , final damage output is 15. |
Name | Default | Description |
This model outputs 50% extra damage when it hits with burn attacks.
offense.damage.factor burn 1.5
Defense
Defense is a set of model and (coming soon) body box properties that adjusts incoming damage and reactions. To add defense, use one of the following commands followed by attack type and the property value. Attack type entry is identical to offense.
Name | Default | Description |
---|---|---|
defense.block.damage.adjust | 0 | Direct adjustment to damage when blocking attack. |
defense.block.damage.max | MAX_INT | Maximum damage taken when blocking attack. |
defense.block.damage.max | MIN_INT | Minimum damage taken when blocking attack. |
defense.block.power | 0 | Works with attack.block.penetrate. If this value exceeds attack.block.penetrate, the target is able to block attack. |
defense.block.ratio | Special | Damage multiplier when blocking an attack. For example, a value of 0.25 means blocked attacks cause 25% of their normal damage. For legacy compatibility and to allow setting 0.0 , the default value is a special constant: openborconstant("DEFENSE_BLOCKRATIO_COMPATABILITY_DEFAULT") . If this value is in place when an attack hits, a value of 0.0 is used for the calculation. |
defense.block.threshold | 0 | Added to entity’s thold setting. If the combined result is any value other than 0 and less than final damage (after attacker’s offense and target’s defense factors apply), target cannot block attack. |
defense.block.type | Series | How any blocking damage applies. * HP – Directly from hit points.* Global – Use global MPonly setting.* Series – Use MP until exhausted, then use HP. * Both – Use MP and HP at once. |
defense.damage.adjust | 0 | Direct adjustment to damage when hit by attack. |
defense.damage.max | MAX_INT | Maximum damage taken when hit by attack. |
defense.damage.min | MIN_INT | Minimum damage taken when hit by attack. |
defense.death.config | Special | Death behavior when killed by attack type. Otherwise identical to model Death Config. |
defense.factor | 1.0 | Damage multiplier when hit by attack. |
defense.knockdown | 1.0 | Knockdown multiplier when hit by attack. |
defense.pain | 0.0 | If any value other than 0.0 , final damage (after attacker’s offense and target’s defense factors apply) must meet or exceed this value to trigger a pain animation. |
Name | Default | Description |
This model is more resistant to Attack Type 5. It takes 50% damage, doesn’t go into pain unless the attack does more than 20 points after all damage calculations, and effectively ignores knockdowns. We’ve also made it weak against fire attacks. It takes 150% damage when hit by Burn Type, and still takes 50% even if it successfully blocks. Finally, it can’t block burns at all if the final damage of a hit would cause 20 or more damage.
defense.factor normal5 0.5
defense.pain normal5 20
defense.knockdown normal5 0.0
defense.factor burn 1.5
defense.block.ratio burn 0.50
defense.block.threshold burn 20
Note OpenBOR calculates damage mitigation in the following order:
- damage = damage * offense.factor
- damage = damage + offense.adjustment
- damage = damage ≥ offense.damage_min
- damage = damage ≤ offense.damage_max
- damage = damage * defense.factor
- damage = damage + defense.adjustment
- damage = damage ≥ defense.damage_min
- damage = damage ≤ defense.damage_max
Tip: Multipliers and adjustments are exactly what they say: Multipliers and adjustments. Try using negative values to reverse their effects. For example, a negative defense.factor
will cause the target to gain hit points.