Contents_explosion() tweaks (#20934)

* When any object is hit by an explosion, we no longer always call ex_act() on all its contents indiscriminately.
The default contents_explosion() does nothing and it's overriden for certain objects only like storage items, machines with occupants, mechs.

I've also overriden handle_atom_del() for many objects so that any sudden deletion of an object referenced in an object var of its container properly nullifies such references, avoiding potential runtime and updating the container's icon_state (e.g. admin-delete a mixer's beaker and the mixer's sprite updates immediately).

I've tweaked bomb effect on worn clothes, having some armor but not 100% now still protects your clothes somewhat.

Fixes some arguments of ex_act in living/ex_act() and other mobs.

* derp and map fixes.

* dem map fixes, man.

* More work on code that use implants, simplified now that we can use the "implants" carbon var.

* some fixes

* more typos and fixes.
This commit is contained in:
phil235
2016-10-16 10:01:37 +13:00
committed by oranges
parent ca26b0ff5c
commit f6db08af2e
109 changed files with 1064 additions and 845 deletions
@@ -418,3 +418,9 @@
req_access = list()
req_access += pick(get_all_accesses())
..()
/obj/structure/closet/contents_explosion(severity, target)
for(var/atom/A in contents)
A.ex_act(severity, target)
CHECK_TICK
+10 -1
View File
@@ -22,6 +22,15 @@
showpiece = new start_showpiece_type (src)
update_icon()
/obj/structure/displaycase/Destroy()
if(electronics)
qdel(electronics)
electronics = null
if(showpiece)
qdel(showpiece)
showpiece = null
return ..()
/obj/structure/displaycase/examine(mob/user)
..()
if(showpiece)
@@ -32,7 +41,7 @@
/obj/structure/displaycase/proc/dump()
if (showpiece)
showpiece.loc = src.loc
showpiece.forceMove(loc)
showpiece = null
/obj/structure/displaycase/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
@@ -28,6 +28,15 @@
stored_extinguisher = null
return ..()
/obj/structure/extinguisher_cabinet/contents_explosion(severity, target)
if(stored_extinguisher)
stored_extinguisher.ex_act(severity, target)
/obj/structure/extinguisher_cabinet/handle_atom_del(atom/A)
if(A == stored_extinguisher)
stored_extinguisher = null
update_icon()
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/wrench) && !stored_extinguisher)
user << "<span class='notice'>You start unsecuring [name]...</span>"
@@ -47,6 +56,7 @@
return
contents += I
stored_extinguisher = I
update_icon()
user << "<span class='notice'>You place [I] in [src].</span>"
else
toggle_cabinet(user)
+8
View File
@@ -86,6 +86,14 @@
O.forceMove(get_turf(src))
update_icon()
/obj/structure/guncase/handle_atom_del(atom/A)
update_icon()
/obj/structure/guncase/contents_explosion(severity, target)
for(var/atom/A in contents)
A.ex_act(severity++, target)
CHECK_TICK
/obj/structure/guncase/shotgun
name = "shotgun locker"
desc = "A locker that holds shotguns."
@@ -45,18 +45,6 @@
return 0
return ..()
/obj/structure/plasticflaps/ex_act(severity)
..()
switch(severity)
if (1)
qdel(src)
if (2)
if (prob(50))
qdel(src)
if (3)
if (prob(5))
qdel(src)
/obj/structure/plasticflaps/mining //A specific type for mining that doesn't allow airflow because of them damn crates
name = "airtight plastic flaps"
desc = "Heavy duty, airtight, plastic flaps."
+6 -3
View File
@@ -151,7 +151,7 @@ FLOOR SAFES
if(!user.drop_item())
user << "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the safe!</span>"
return
I.loc = src
I.forceMove(src)
user << "<span class='notice'>You put [I] in [src].</span>"
updateUsrDialog()
return
@@ -164,10 +164,13 @@ FLOOR SAFES
return ..()
obj/structure/safe/blob_act(obj/structure/blob/B)
/obj/structure/safe/handle_atom_del(atom/A)
updateUsrDialog()
/obj/structure/safe/blob_act(obj/structure/blob/B)
return
obj/structure/safe/ex_act(severity, target)
/obj/structure/safe/ex_act(severity, target)
return
@@ -25,12 +25,15 @@
return !density
// When destroyed by explosions, properly handle contents.
obj/structure/transit_tube/ex_act(severity, target)
if(3 - severity >= 0)
var/oldloc = loc
..(severity + 1)
/obj/structure/transit_tube/ex_act(severity, target)
..()
if(!qdeleted(src))
for(var/atom/movable/AM in contents)
AM.loc = oldloc
AM.forceMove(loc)
/obj/structure/transit_tube/contents_explosion(severity, target)
for(var/atom/movable/AM in contents)
AM.ex_act(severity, target)
/obj/structure/transit_tube/New(loc)
..(loc)
@@ -38,6 +41,11 @@ obj/structure/transit_tube/ex_act(severity, target)
if(tube_dirs == null)
init_dirs()
/obj/structure/transit_tube/Destroy()
for(var/atom/movable/AM in contents)
AM.forceMove(loc)
return ..()
/obj/structure/transit_tube/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weapon/wrench))
if(copytext(icon_state, 1, 3) != "D-") //decorative diagonals cannot be unwrenched directly
@@ -21,9 +21,7 @@
follow_tube()
/obj/structure/transit_tube_pod/Destroy()
for(var/atom/movable/AM in contents)
AM.loc = loc
empty()
return ..()
/obj/structure/transit_tube_pod/attackby(obj/item/I, mob/user, params)
@@ -31,9 +29,9 @@
if(!moving)
for(var/obj/structure/transit_tube/station/T in loc)
return
if(src.contents.len)
if(contents.len)
user.visible_message("[user] empties \the [src].", "<span class='notice'>You empty \the [src].</span>")
src.empty()
empty()
return
else
user << "<span class='notice'>You free \the [src].</span>"
@@ -44,6 +42,16 @@
else
return ..()
/obj/structure/transit_tube_pod/ex_act(severity, target)
..()
if(!qdeleted(src))
for(var/atom/movable/AM in contents)
AM.forceMove(loc)
/obj/structure/transit_tube_pod/contents_explosion(severity, target)
for(var/atom/movable/AM in contents)
AM.ex_act(severity, target)
/obj/structure/transit_tube_pod/container_resist()
var/mob/living/user = usr
if(!moving)
@@ -56,7 +64,7 @@
/obj/structure/transit_tube_pod/proc/empty()
for(var/atom/movable/M in src.contents)
M.loc = src.loc
M.forceMove(loc)
/obj/structure/transit_tube_pod/Process_Spacemove()
if(moving) //No drifting while moving in the tubes