extended: scripts: hitUnit: - offset: -1 code: | var int unit_id; unit.getId unit_id; debug_log "*** Hit determination for the following unit ***"; debug_log "Unit id:" unit_id; debug_log "Attack power:" power; if eq part 0; debug_log "HEAD part will be hit"; end; if eq part 1; debug_log "TORSO part will be hit"; end; if eq part 2; debug_log "RIGHT ARM part will be hit"; end; if eq part 3; debug_log "LEFT ARM will be hit"; end; if eq part 4; debug_log "RIGHT LEG part will be hit"; end; if eq part 5; debug_log "LEFT LEG part will be hit"; end; if eq side 0; debug_log "FRONT side will be hit"; end; if eq side 1; debug_log "LEFT side will be hit"; end; if eq side 2; debug_log "REAR side will be hit"; end; if eq side 3; debug_log "RIGHT side will be hit"; end; if eq side 4; debug_log "UNDER side will be hit"; end; debug_log "*** END OF HIT DETERMINATION ***"; # power will become damage, damageUnit will only be called if damage is dealt # damage is reduced by armor on the hit side (with ArmorEffectiveness as a factor) return power part side; damageUnit: - offset: -1 code: | var int unit_health; var int unit_id; var int unit_armor; unit.getId unit_id; unit.getHealth unit_health; unit.getArmor unit_armor side; # NOTE: currPower is already reduced by the armor on the hit side here debug_log "*** DAMAGE was dealt to the following unit ***"; debug_log "Unit id:" unit_id; debug_log "Unit health:" unit_health; debug_log "Unit armor on hit side:" unit_armor; debug_log "Damage to health:" to_health; debug_log "Damage to armor:" to_armor; debug_log "Damage to stun:" to_stun; debug_log "Damage to time:" to_time; debug_log "Damage to energy:" to_energy; debug_log "Damage to morale:" to_morale; debug_log "Damage to wound:" to_wound; debug_log "Damage to transform (tile?):" to_transform; debug_log "Damage to mana:" to_mana; debug_log "Attack power:" currPower; if eq damaging_type 0; debug_log "DamageType None"; end; if eq damaging_type 1; debug_log "DamageType Armor Piercing"; end; if eq damaging_type 2; debug_log "DamageType Incendiary"; end; if eq damaging_type 3; debug_log "DamageType High Explosive"; end; if eq damaging_type 4; debug_log "DamageType Laser"; end; if eq damaging_type 5; debug_log "DamageType Plasma"; end; if eq damaging_type 6; debug_log "DamageType Stun"; end; if eq damaging_type 7; debug_log "DamageType Melee"; end; if eq damaging_type 8; debug_log "DamageType Acid"; end; if eq damaging_type 9; debug_log "DamageType Smoke"; end; if eq battle_action 2; debug_log "Action was WALK"; end; if eq battle_action 6; debug_log "Action was THROW"; end; if eq battle_action 7; debug_log "Action was AUTOSHOT"; end; if eq battle_action 8; debug_log "Action was SNAPSHOT"; end; if eq battle_action 9; debug_log "Action was AIMSHOT"; end; if eq battle_action 10; debug_log "Action was MELEE/HIT"; end; if eq part 0; debug_log "HEAD part hit"; end; if eq part 1; debug_log "TORSO part hit"; end; if eq part 2; debug_log "RIGHT ARM part hit"; end; if eq part 3; debug_log "LEFT ARM hit"; end; if eq part 4; debug_log "RIGHT LEG part hit"; end; if eq part 5; debug_log "LEFT LEG part hit"; end; if eq side 0; debug_log "FRONT side hit"; end; if eq side 1; debug_log "LEFT side hit"; end; if eq side 2; debug_log "REAR side hit"; end; if eq side 3; debug_log "RIGHT side hit"; end; if eq side 4; debug_log "UNDER side hit"; end; debug_log "*** END OF DAMAGE REPORT ***"; return;