From 0b0b80f1740683341cbdf46eae943f6c15d2af1e Mon Sep 17 00:00:00 2001 From: Seris02 Date: Sat, 11 Jan 2020 11:22:59 +0800 Subject: [PATCH] explosions --- code/__DEFINES/combat.dm | 1 + .../effects/effect_system/effects_other.dm | 13 +---- code/game/objects/items/devices/doorCharge.dm | 6 +-- code/game/objects/items/grenades/plastic.dm | 2 +- .../devil/true_devil/_true_devil.dm | 6 +-- .../mob/living/carbon/alien/alien_defense.dm | 6 +-- .../mob/living/carbon/human/human_defense.dm | 51 +++++++++++-------- .../living/carbon/monkey/monkey_defense.dm | 6 +-- .../living/simple_animal/animal_defense.dm | 6 +-- .../hostile/megafauna/megafauna.dm | 6 +-- 10 files changed, 52 insertions(+), 51 deletions(-) diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 2d40d91023..7b8c5ff6ae 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -159,6 +159,7 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list( #define EXPLODE_DEVASTATE 1 #define EXPLODE_HEAVY 2 #define EXPLODE_LIGHT 3 +#define EXPLODE_GIB_THRESHOLD 50 #define EMP_HEAVY 1 #define EMP_LIGHT 2 diff --git a/code/game/objects/effects/effect_system/effects_other.dm b/code/game/objects/effects/effect_system/effects_other.dm index 18c1ff5890..dbc9b35275 100644 --- a/code/game/objects/effects/effect_system/effects_other.dm +++ b/code/game/objects/effects/effect_system/effects_other.dm @@ -104,15 +104,4 @@ if(explosion_message) location.visible_message("The solution violently explodes!", \ "You hear an explosion!") - if (amount < 1) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(2, 1, location) - s.start() - - for(var/mob/living/L in viewers(1, location)) - if(prob(50 * amount)) - to_chat(L, "The explosion knocks you down.") - L.Knockdown(rand(20,100)) - return - else - dyn_explosion(location, amount, flashing_factor) \ No newline at end of file + dyn_explosion(location, amount, flashing_factor) \ No newline at end of file diff --git a/code/game/objects/items/devices/doorCharge.dm b/code/game/objects/items/devices/doorCharge.dm index 8def1d5ca3..e9ba9ea4a4 100644 --- a/code/game/objects/items/devices/doorCharge.dm +++ b/code/game/objects/items/devices/doorCharge.dm @@ -16,14 +16,14 @@ /obj/item/doorCharge/ex_act(severity, target) switch(severity) - if(1) + if(EXPLODE_DEVASTATE) visible_message("[src] detonates!") explosion(src.loc,0,2,1,flame_range = 4) qdel(src) - if(2) + if(EXPLODE_HEAVY) if(prob(50)) ex_act(EXPLODE_DEVASTATE) - if(3) + if(EXPLODE_LIGHT) if(prob(25)) ex_act(EXPLODE_DEVASTATE) diff --git a/code/game/objects/items/grenades/plastic.dm b/code/game/objects/items/grenades/plastic.dm index 1956a1f317..75e4e0b477 100644 --- a/code/game/objects/items/grenades/plastic.dm +++ b/code/game/objects/items/grenades/plastic.dm @@ -62,7 +62,7 @@ location = get_turf(target) target.cut_overlay(plastic_overlay, TRUE) if(!ismob(target) || full_damage_on_mobs) - target.ex_act(2, target) + target.ex_act(EXPLODE_HEAVY, target) else location = get_turf(src) if(location) diff --git a/code/modules/antagonists/devil/true_devil/_true_devil.dm b/code/modules/antagonists/devil/true_devil/_true_devil.dm index fc50a0ecf5..5725ac137b 100644 --- a/code/modules/antagonists/devil/true_devil/_true_devil.dm +++ b/code/modules/antagonists/devil/true_devil/_true_devil.dm @@ -197,11 +197,11 @@ if(!ascended) var/b_loss switch (severity) - if (1) + if (EXPLODE_DEVASTATE) b_loss = 500 - if (2) + if (EXPLODE_HEAVY) b_loss = 150 - if(3) + if(EXPLODE_LIGHT) b_loss = 30 if(has_bane(BANE_LIGHT)) b_loss *=2 diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index b9e27c0637..837e629ee5 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -106,15 +106,15 @@ In all, this is a lot like the monkey code. /N return ..() switch (severity) - if (1) + if (EXPLODE_DEVASTATE) gib() return - if (2) + if (EXPLODE_HEAVY) take_overall_damage(60, 60) adjustEarDamage(30,120) - if(3) + if(EXPLODE_LIGHT) take_overall_damage(30,0) if(prob(50)) Unconscious(20) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 93f33c3a3d..4565725544 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -398,38 +398,49 @@ ..() if (!severity) return - var/b_loss = 0 - var/f_loss = 0 - var/bomb_armor = max(0,(100-getarmor(null, "bomb"))/100) + var/brute_loss = 0 + var/burn_loss = 0 + var/bomb_armor = getarmor(null, "bomb") + + //200 max knockdown for EXPLODE_HEAVY + //160 max knockdown for EXPLODE_LIGHT switch (severity) - if (1) - if(bomb_armor) - b_loss = 500*bomb_armor - var/atom/throw_target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src))) - throw_at(throw_target, 200, 4) - damage_clothes(400*bomb_armor, BRUTE, "bomb") - else - damage_clothes(400,BRUTE,"bomb") + if (EXPLODE_DEVASTATE) + if(bomb_armor < EXPLODE_GIB_THRESHOLD) //gibs the mob if their bomb armor is lower than EXPLODE_GIB_THRESHOLD + for(var/I in contents) + var/atom/A = I + A.ex_act(severity) gib() return + else + brute_loss = 500 + var/atom/throw_target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src))) + throw_at(throw_target, 200, 4) + damage_clothes(400 - bomb_armor, BRUTE, "bomb") - if (2) - b_loss = 60*bomb_armor - f_loss = 60*bomb_armor - damage_clothes(200*bomb_armor, BRUTE, "bomb") + if (EXPLODE_HEAVY) + brute_loss = 60 + burn_loss = 60 + if(bomb_armor) + brute_loss = 30*(2 - round(bomb_armor*0.01, 0.05)) + burn_loss = brute_loss //damage gets reduced from 120 to up to 60 combined brute+burn + damage_clothes(200 - bomb_armor, BRUTE, "bomb") if (!istype(ears, /obj/item/clothing/ears/earmuffs)) adjustEarDamage(30, 120) - Unconscious(200*bomb_armor) + Unconscious(20) //short amount of time for follow up attacks against elusive enemies like wizards + Knockdown(200 - (bomb_armor * 1.6)) //between ~4 and ~20 seconds of knockdown depending on bomb armor - if(3) - b_loss = 30*bomb_armor + if(EXPLODE_LIGHT) + brute_loss = 30 + if(bomb_armor) + brute_loss = 15*(2 - round(bomb_armor*0.01, 0.05)) damage_clothes(max(50 - bomb_armor, 0), BRUTE, "bomb") if (!istype(ears, /obj/item/clothing/ears/earmuffs)) adjustEarDamage(15,60) - Unconscious(100*bomb_armor) + Knockdown(160 - (bomb_armor * 1.6)) //100 bomb armor will prevent knockdown altogether - take_overall_damage(b_loss,f_loss) + take_overall_damage(brute_loss,burn_loss) //attempt to dismember bodyparts if(severity <= 2 || !bomb_armor) diff --git a/code/modules/mob/living/carbon/monkey/monkey_defense.dm b/code/modules/mob/living/carbon/monkey/monkey_defense.dm index df90dd56fd..cbd0c4c251 100644 --- a/code/modules/mob/living/carbon/monkey/monkey_defense.dm +++ b/code/modules/mob/living/carbon/monkey/monkey_defense.dm @@ -168,18 +168,18 @@ ..() switch (severity) - if (1) + if (EXPLODE_DEVASTATE) gib() return - if (2) + if (EXPLODE_HEAVY) take_overall_damage(60, 60) damage_clothes(200, BRUTE, "bomb") adjustEarDamage(30, 120) if(prob(70)) Unconscious(200) - if(3) + if(EXPLODE_LIGHT) take_overall_damage(30, 0) damage_clothes(50, BRUTE, "bomb") adjustEarDamage(15,60) diff --git a/code/modules/mob/living/simple_animal/animal_defense.dm b/code/modules/mob/living/simple_animal/animal_defense.dm index 793df63c87..5b95c670d9 100644 --- a/code/modules/mob/living/simple_animal/animal_defense.dm +++ b/code/modules/mob/living/simple_animal/animal_defense.dm @@ -120,19 +120,19 @@ ..() var/bomb_armor = getarmor(null, "bomb") switch (severity) - if (1) + if (EXPLODE_DEVASTATE) if(prob(bomb_armor)) adjustBruteLoss(500) else gib() return - if (2) + if (EXPLODE_HEAVY) var/bloss = 60 if(prob(bomb_armor)) bloss = bloss / 1.5 adjustBruteLoss(bloss) - if(3) + if(EXPLODE_LIGHT) var/bloss = 30 if(prob(bomb_armor)) bloss = bloss / 1.5 diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index 8c2fbef15e..8475858cc9 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -103,13 +103,13 @@ /mob/living/simple_animal/hostile/megafauna/ex_act(severity, target) switch (severity) - if (1) + if (EXPLODE_DEVASTATE) adjustBruteLoss(250) - if (2) + if (EXPLODE_HEAVY) adjustBruteLoss(100) - if(3) + if(EXPLODE_LIGHT) adjustBruteLoss(50) /mob/living/simple_animal/hostile/megafauna/proc/SetRecoveryTime(buffer_time)