Merge pull request #10518 from Seris02/explosionport

ports the explosion rework thingamajig
This commit is contained in:
kevinz000
2020-01-12 00:38:43 -08:00
committed by GitHub
10 changed files with 52 additions and 51 deletions
+1
View File
@@ -159,6 +159,7 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define EXPLODE_DEVASTATE 1 #define EXPLODE_DEVASTATE 1
#define EXPLODE_HEAVY 2 #define EXPLODE_HEAVY 2
#define EXPLODE_LIGHT 3 #define EXPLODE_LIGHT 3
#define EXPLODE_GIB_THRESHOLD 50
#define EMP_HEAVY 1 #define EMP_HEAVY 1
#define EMP_LIGHT 2 #define EMP_LIGHT 2
@@ -104,15 +104,4 @@
if(explosion_message) if(explosion_message)
location.visible_message("<span class='danger'>The solution violently explodes!</span>", \ location.visible_message("<span class='danger'>The solution violently explodes!</span>", \
"<span class='italics'>You hear an explosion!</span>") "<span class='italics'>You hear an explosion!</span>")
if (amount < 1) dyn_explosion(location, amount, flashing_factor)
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, "<span class='danger'>The explosion knocks you down.</span>")
L.Knockdown(rand(20,100))
return
else
dyn_explosion(location, amount, flashing_factor)
@@ -16,14 +16,14 @@
/obj/item/doorCharge/ex_act(severity, target) /obj/item/doorCharge/ex_act(severity, target)
switch(severity) switch(severity)
if(1) if(EXPLODE_DEVASTATE)
visible_message("<span class='warning'>[src] detonates!</span>") visible_message("<span class='warning'>[src] detonates!</span>")
explosion(src.loc,0,2,1,flame_range = 4) explosion(src.loc,0,2,1,flame_range = 4)
qdel(src) qdel(src)
if(2) if(EXPLODE_HEAVY)
if(prob(50)) if(prob(50))
ex_act(EXPLODE_DEVASTATE) ex_act(EXPLODE_DEVASTATE)
if(3) if(EXPLODE_LIGHT)
if(prob(25)) if(prob(25))
ex_act(EXPLODE_DEVASTATE) ex_act(EXPLODE_DEVASTATE)
+1 -1
View File
@@ -62,7 +62,7 @@
location = get_turf(target) location = get_turf(target)
target.cut_overlay(plastic_overlay, TRUE) target.cut_overlay(plastic_overlay, TRUE)
if(!ismob(target) || full_damage_on_mobs) if(!ismob(target) || full_damage_on_mobs)
target.ex_act(2, target) target.ex_act(EXPLODE_HEAVY, target)
else else
location = get_turf(src) location = get_turf(src)
if(location) if(location)
@@ -197,11 +197,11 @@
if(!ascended) if(!ascended)
var/b_loss var/b_loss
switch (severity) switch (severity)
if (1) if (EXPLODE_DEVASTATE)
b_loss = 500 b_loss = 500
if (2) if (EXPLODE_HEAVY)
b_loss = 150 b_loss = 150
if(3) if(EXPLODE_LIGHT)
b_loss = 30 b_loss = 30
if(has_bane(BANE_LIGHT)) if(has_bane(BANE_LIGHT))
b_loss *=2 b_loss *=2
@@ -107,15 +107,15 @@ In all, this is a lot like the monkey code. /N
return return
..() ..()
switch (severity) switch (severity)
if (1) if (EXPLODE_DEVASTATE)
gib() gib()
return return
if (2) if (EXPLODE_HEAVY)
take_overall_damage(60, 60) take_overall_damage(60, 60)
adjustEarDamage(30,120) adjustEarDamage(30,120)
if(3) if(EXPLODE_LIGHT)
take_overall_damage(30,0) take_overall_damage(30,0)
if(prob(50)) if(prob(50))
Unconscious(20) Unconscious(20)
@@ -326,38 +326,49 @@
..() ..()
if (!severity) if (!severity)
return return
var/b_loss = 0 var/brute_loss = 0
var/f_loss = 0 var/burn_loss = 0
var/bomb_armor = max(0,(100-getarmor(null, "bomb"))/100) var/bomb_armor = getarmor(null, "bomb")
//200 max knockdown for EXPLODE_HEAVY
//160 max knockdown for EXPLODE_LIGHT
switch (severity) switch (severity)
if (1) if (EXPLODE_DEVASTATE)
if(bomb_armor) if(bomb_armor < EXPLODE_GIB_THRESHOLD) //gibs the mob if their bomb armor is lower than EXPLODE_GIB_THRESHOLD
b_loss = (350*bomb_armor)+150 for(var/I in contents)
var/atom/throw_target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src))) var/atom/A = I
throw_at(throw_target, 200, 4) A.ex_act(severity)
damage_clothes(400*bomb_armor, BRUTE, "bomb")
else
damage_clothes(400,BRUTE,"bomb")
gib() gib()
return 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) if (EXPLODE_HEAVY)
b_loss = 60*bomb_armor brute_loss = 60
f_loss = 60*bomb_armor burn_loss = 60
damage_clothes(200*bomb_armor, BRUTE, "bomb") 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)) if (!istype(ears, /obj/item/clothing/ears/earmuffs))
adjustEarDamage(30, 120) 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) if(EXPLODE_LIGHT)
b_loss = 30*bomb_armor 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") damage_clothes(max(50 - bomb_armor, 0), BRUTE, "bomb")
if (!istype(ears, /obj/item/clothing/ears/earmuffs)) if (!istype(ears, /obj/item/clothing/ears/earmuffs))
adjustEarDamage(15,60) 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 //attempt to dismember bodyparts
if(severity <= 2 || !bomb_armor) if(severity <= 2 || !bomb_armor)
@@ -189,18 +189,18 @@
..() ..()
switch (severity) switch (severity)
if (1) if (EXPLODE_DEVASTATE)
gib() gib()
return return
if (2) if (EXPLODE_HEAVY)
take_overall_damage(60, 60) take_overall_damage(60, 60)
damage_clothes(200, BRUTE, "bomb") damage_clothes(200, BRUTE, "bomb")
adjustEarDamage(30, 120) adjustEarDamage(30, 120)
if(prob(70)) if(prob(70))
Unconscious(200) Unconscious(200)
if(3) if(EXPLODE_LIGHT)
take_overall_damage(30, 0) take_overall_damage(30, 0)
damage_clothes(50, BRUTE, "bomb") damage_clothes(50, BRUTE, "bomb")
adjustEarDamage(15,60) adjustEarDamage(15,60)
@@ -122,19 +122,19 @@
..() ..()
var/bomb_armor = getarmor(null, "bomb") var/bomb_armor = getarmor(null, "bomb")
switch (severity) switch (severity)
if (1) if (EXPLODE_DEVASTATE)
if(prob(bomb_armor)) if(prob(bomb_armor))
adjustBruteLoss(500) adjustBruteLoss(500)
else else
gib() gib()
return return
if (2) if (EXPLODE_HEAVY)
var/bloss = 60 var/bloss = 60
if(prob(bomb_armor)) if(prob(bomb_armor))
bloss = bloss / 1.5 bloss = bloss / 1.5
adjustBruteLoss(bloss) adjustBruteLoss(bloss)
if(3) if(EXPLODE_LIGHT)
var/bloss = 30 var/bloss = 30
if(prob(bomb_armor)) if(prob(bomb_armor))
bloss = bloss / 1.5 bloss = bloss / 1.5
@@ -103,13 +103,13 @@
/mob/living/simple_animal/hostile/megafauna/ex_act(severity, target) /mob/living/simple_animal/hostile/megafauna/ex_act(severity, target)
switch (severity) switch (severity)
if (1) if (EXPLODE_DEVASTATE)
adjustBruteLoss(250) adjustBruteLoss(250)
if (2) if (EXPLODE_HEAVY)
adjustBruteLoss(100) adjustBruteLoss(100)
if(3) if(EXPLODE_LIGHT)
adjustBruteLoss(50) adjustBruteLoss(50)
/mob/living/simple_animal/hostile/megafauna/proc/SetRecoveryTime(buffer_time) /mob/living/simple_animal/hostile/megafauna/proc/SetRecoveryTime(buffer_time)