deterministic explosion system (#13392)

* wae explosions

* okay

* changes

* fixes

* fix

* ok

* ok

* kills more dead code

* okay

* fix

* ok

* tiles

* ok

* okay

* woops

* ok

* fix

* okay

* mob damage

* fixes

* insanity

* more

* more

* fixes

* more

* woot

* don't commit that

* YES

* fix
This commit is contained in:
silicons
2021-05-12 04:44:53 -06:00
committed by GitHub
parent 5eb1f38f5e
commit 5601badbff
35 changed files with 822 additions and 2 deletions
@@ -50,6 +50,10 @@
/obj/effect/decal/cleanable/glass/ex_act()
qdel(src)
/obj/effect/decal/cleanable/glass/wave_ex_act(power, datum/wave_explosion/explosion, dir)
qdel(src)
return power
/obj/effect/decal/cleanable/glass/plasma
icon_state = "plasmatiny"
@@ -131,6 +135,9 @@
/obj/effect/decal/cleanable/greenglow/ex_act()
return
/obj/effect/decal/cleanable/greenglow/wave_ex_act(power, datum/wave_explosion/explosion, dir)
return power
/obj/effect/decal/cleanable/cobweb
name = "cobweb"
desc = "Somebody should remove that."
@@ -253,6 +260,11 @@
if(severity == 1) //so shreds created during an explosion aren't deleted by the explosion.
qdel(src)
/obj/effect/decal/cleanable/shreds/wave_ex_act(power, datum/wave_explosion/explosion, dir)
if(power > EXPLOSION_POWER_ERASE_SHREDS)
qdel(src)
return power // no block
/obj/effect/decal/cleanable/shreds/Initialize()
pixel_x = rand(-10, 10)
pixel_y = rand(-10, 10)
+8
View File
@@ -248,6 +248,14 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
loc = null
loc = T
/obj/item/wave_ex_act(power, datum/wave_explosion/explosion, dir)
. = ..()
if(!anchored)
var/throw_dist = round(rand(3, max(3, 2.5 * sqrt(power))), 1)
throw_speed = EXPLOSION_THROW_SPEED
var/turf/target = get_ranged_target_turf(src, dir, throw_dist)
throw_at(target, throw_dist, EXPLOSION_THROW_SPEED)
/obj/item/examine(mob/user) //This might be spammy. Remove?
. = ..()
+13
View File
@@ -71,6 +71,19 @@
if(3)
take_damage(rand(10, 90), BRUTE, "bomb", 0)
/obj/wave_ex_act(power, datum/wave_explosion/explosion, dir)
if(resistance_flags & INDESTRUCTIBLE)
return power
. = ..()
if(explosion.source == src)
obj_integrity = 0
qdel(src)
return
take_damage(wave_explosion_damage(power, explosion), BRUTE, "bomb", 0)
/obj/proc/wave_explosion_damage(power, datum/wave_explosion/explosion)
return (explosion_flags & EXPLOSION_FLAG_HARD_OBSTACLE)? EXPLOSION_POWER_STANDARD_SCALE_HARD_OBSTACLE_DAMAGE(power, explosion.hard_obstacle_mod) : EXPLOSION_POWER_STANDARD_SCALE_OBJECT_DAMAGE(power, explosion.object_damage_mod)
/obj/bullet_act(obj/item/projectile/P)
. = ..()
playsound(src, P.hitsound, 50, 1)
+15
View File
@@ -43,6 +43,10 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
attack_hand_speed = CLICK_CD_MELEE
attack_hand_is_action = TRUE
explosion_flags = EXPLOSION_FLAG_HARD_OBSTACLE
wave_explosion_block = EXPLOSION_BLOCK_WINDOW
wave_explosion_multiply = EXPLOSION_DAMPEN_WINDOW
/// Electrochromatic status
var/electrochromatic_status = NOT_ELECTROCHROMATIC
/// Electrochromatic ID. Set the first character to ! to replace with a SSmapping generated pseudorandom obfuscated ID for mapping purposes.
@@ -111,6 +115,9 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
return TRUE
return FALSE
/obj/structure/window/wave_explosion_damage(power, datum/wave_explosion/explosion)
return EXPLOSION_POWER_STANDARD_SCALE_WINDOW_DAMAGE(power, explosion.window_shatter_mod)
/obj/structure/window/narsie_act()
add_atom_colour(NARSIE_WINDOW_COLOUR, FIXED_COLOUR_PRIORITY)
@@ -520,6 +527,8 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
max_integrity = 50
explosion_block = 1
wave_explosion_block = EXPLOSION_BLOCK_REINFORCED_WINDOW
wave_explosion_multiply = EXPLOSION_DAMPEN_REINFORCED_WINDOW
glass_type = /obj/item/stack/sheet/rglass
rad_insulation = RAD_HEAVY_INSULATION
ricochet_chance_mod = 0.8
@@ -545,6 +554,8 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
armor = list("melee" = 75, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
max_integrity = 150
explosion_block = 1
wave_explosion_block = EXPLOSION_BLOCK_BOROSILICATE_WINDOW
wave_explosion_multiply = EXPLOSION_DAMPEN_BOROSILICATE_WINDOW
glass_type = /obj/item/stack/sheet/plasmaglass
cleanable_type = /obj/effect/decal/cleanable/glass/plasma
rad_insulation = RAD_NO_INSULATION
@@ -570,6 +581,8 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
armor = list("melee" = 85, "bullet" = 20, "laser" = 0, "energy" = 0, "bomb" = 60, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
max_integrity = 500
explosion_block = 2
wave_explosion_block = EXPLOSION_BLOCK_EXTREME
wave_explosion_multiply = EXPLOSION_BLOCK_EXTREME
glass_type = /obj/item/stack/sheet/plasmarglass
/obj/structure/window/plasma/reinforced/spawner/east
@@ -742,6 +755,8 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
max_integrity = 80
armor = list("melee" = 60, "bullet" = 25, "laser" = 0, "energy" = 0, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
explosion_block = 2 //fancy AND hard to destroy. the most useful combination.
wave_explosion_block = EXPLOSION_BLOCK_BOROSILICATE_WINDOW
wave_explosion_multiply = EXPLOSION_DAMPEN_BOROSILICATE_WINDOW
decon_speed = 40
glass_type = /obj/item/stack/tile/brass
glass_amount = 1