diff --git a/scripts/scr_flavor2/scr_flavor2.gml b/scripts/scr_flavor2/scr_flavor2.gml index 9e145af1ae..67a2751876 100644 --- a/scripts/scr_flavor2/scr_flavor2.gml +++ b/scripts/scr_flavor2/scr_flavor2.gml @@ -273,13 +273,13 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo flavor = true; if (_hostile_shots == 1) { if (lost_units_count == 0) { - m1 += $"{_hostile_weapon} strikes, but fails to inflict any casualties."; + m1 += $"{_hostile_weapon} strikes, but fails to inflict any damage."; } else { m1 += $"{_hostile_weapon} strikes. "; } } else { if (lost_units_count == 0) { - m1 += $"{_hostile_shots} {_hostile_weapon}s strike, but fail to inflict any casualties."; + m1 += $"{_hostile_shots} {_hostile_weapon}s strike, but fail to inflict any damage."; } else { m1 += $"{_hostile_shots} {_hostile_weapon}s strike. "; } @@ -291,12 +291,18 @@ function scr_flavor2(lost_units_count, target_type, hostile_range, hostile_weapo // m2="Blah blah blah"; if (target_type = "wall") { - mes = m1 + m2 + m3; + var _wall_destroyed = obj_nfort.hp[1] <= 0 ? true : false; + + if (_wall_destroyed) { + mes = m1 + " Destroying the fortifications."; + } else { + mes = m1 + " Fortifications stand strong."; + } if (string_length(mes) > 3) { obj_ncombat.messages += 1; obj_ncombat.message[obj_ncombat.messages] = mes; - obj_ncombat.message_sz[obj_ncombat.messages] = obj_nfort.hostile_damage; + obj_ncombat.message_sz[obj_ncombat.messages] = 100 obj_ncombat.message_priority[obj_ncombat.messages] = 0; obj_ncombat.alarm[3] = 2; } diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index 9caeb11a7c..f9d961276e 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -139,37 +139,32 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat if (damage_per_weapon = 0) then damage_per_weapon = shots_fired * doom; - if (hit_number > 0) and(melee_or_ranged != "wall") and(instance_exists(target_object)) { - if (wep_owner[weapon_index_position] = "assorted") { - target_object.hostile_shooters = 999; - } else { - target_object.hostile_shooters = 1; - } - hostile_damage = damage_per_weapon / hit_number; + if (hit_number > 0 && instance_exists(target_object)) { hostile_weapon = wep[weapon_index_position]; - hostile_type = 0; hostile_range = range[weapon_index_position]; hostile_splash = attack_count_mod; - if (hostile_splash = 1) then hostile_damage += attack_count_mod * 3; - - scr_clean(target_object, hostile_type, hit_number, hostile_damage, hostile_weapon, hostile_range, hostile_splash); - } - - if (hit_number > 0) and(melee_or_ranged = "wall") and(instance_exists(target_object)) { - var dam2, totes_dam, dest; - dest = 0; - dam2 = (damage_per_weapon / hit_number) - target_object.ac[1]; - if (dam2 < 0) then dam2 = 0; - totes_dam = round(dam2) * hit_number; - target_object.hp[1] -= dam2; - hostile_weapon = wep[weapon_index_position]; - hostile_range = range[weapon_index_position]; - hostile_damage = dam2; + hostile_damage = (hostile_splash == 1) ? attack_count_mod * 3 : 0; + hostile_damage += damage_per_weapon / hit_number; + if (melee_or_ranged == "wall") { + var dest = 0; + + hostile_damage -= target_object.ac[1]; + hostile_damage = max(0, hostile_damage); + hostile_damage = round(hostile_damage) * hit_number; + target_object.hp[1] -= hostile_damage; + if (target_object.hp[1] <= 0) dest = 1; + obj_nfort.hostile_weapons = hostile_weapon; + obj_nfort.hostile_shots = hit_number; + obj_nfort.hostile_damage = hostile_damage; + + scr_flavor2(dest, "wall", hostile_range, hostile_weapon, hit_number, hostile_splash); + } else { + target_object.hostile_shooters = (wep_owner[weapon_index_position] == "assorted") ? 999 : 1; + hostile_type = 0; - if (target_object.hp[1] <= 0) then dest = 1; - scr_flavor2(dest, "wall", hostile_range, hostile_weapon, hit_number, hostile_splash); + scr_clean(target_object, hostile_type, hit_number, hostile_damage, hostile_weapon, hostile_range, hostile_splash); + } } - } }