Fixes up a few Destroys

This commit is contained in:
Fox-McCloud
2015-09-18 04:20:02 -04:00
parent 6a79ff83a1
commit 74565c101b
16 changed files with 127 additions and 21 deletions
+5
View File
@@ -127,6 +127,11 @@
var/attacher = "UNKNOWN"
var/datum/wires/explosive/gibtonite/wires
/obj/item/weapon/twohanded/required/gibtonite/Destroy()
qdel(wires)
wires = null
return ..()
/obj/item/weapon/twohanded/required/gibtonite/attackby(obj/item/I, mob/user, params)
if(!wires && istype(I, /obj/item/device/assembly/igniter))
user.visible_message("[user] attaches [I] to [src].", "<span class='notice'>You attach [I] to [src].</span>")
@@ -202,6 +202,8 @@ var/list/robot_verbs_default = list(
mmi = null
if(connected_ai)
connected_ai.connected_robots -= src
qdel(wires)
wires = null
return ..()
/mob/living/silicon/robot/proc/pick_module()
+16 -4
View File
@@ -424,17 +424,29 @@
return EAT_TIME_FAT //if it doesn't fit into the above, it's probably a fat guy, take EAT_TIME_FAT to do it
/obj/item/weapon/grab/dropped()
qdel(src)
loc = null
if(!destroying)
qdel(src)
/obj/item/weapon/grab
var/destroying = 0
/obj/item/weapon/grab/Destroy()
animate(affecting, pixel_x = 0, pixel_y = 0, 4, 1, LINEAR_EASING)
affecting.layer = 4
if(affecting)
affecting.pixel_x = 0
affecting.pixel_y = 0 //used to be an animate, not quick enough for del'ing
affecting.layer = initial(affecting.layer)
affecting.grabbed_by -= src
affecting = null
if(assailant)
if(assailant.client)
assailant.client.screen -= hud
assailant = null
qdel(hud)
hud = null
destroying = 1 // stops us calling qdel(src) on dropped()
return ..()
#undef EAT_TIME_XENO
#undef EAT_TIME_FAT
+20
View File
@@ -22,6 +22,26 @@ var/list/organ_cache = list()
// links chemical IDs to number of ticks for which they'll stay in the blood
germ_level = 0
/obj/item/organ/Destroy()
if(!owner)
return ..()
if(istype(owner, /mob/living/carbon))
if((owner.internal_organs) && (src in owner.internal_organs))
owner.internal_organs -= src
if(istype(owner, /mob/living/carbon/human))
if((owner.internal_organs_by_name) && (src in owner.internal_organs_by_name))
owner.internal_organs_by_name -= src
if((owner.organs) && (src in owner.organs))
owner.organs -= src
if((owner.organs_by_name) && (src in owner.organs_by_name))
owner.organs_by_name -= src
if(src in owner.contents)
owner.contents -= src
return ..()
/obj/item/organ/attack_self(mob/user as mob)
// Convert it to an edible form, yum yum.
+23 -10
View File
@@ -7,10 +7,10 @@
max_damage = 0
dir = SOUTH
organ_tag = "limb"
var/brute_mod = 1
var/burn_mod = 1
var/icon_name = null
var/body_part = null
var/icon_position = 0
@@ -61,6 +61,19 @@
var/can_grasp
var/can_stand
/obj/item/organ/external/Destroy()
if(parent && parent.children)
parent.children -= src
if(children)
for(var/obj/item/organ/external/C in children)
qdel(C)
if(internal_organs)
for(var/obj/item/organ/O in internal_organs)
qdel(O)
return ..()
/obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/user as mob)
switch(stage)
@@ -120,7 +133,7 @@
if(!parent.children)
parent.children = list()
parent.children.Add(src)
/obj/item/organ/external/robotize()
..()
//robot limbs take reduced damage
@@ -137,7 +150,7 @@
if(status & ORGAN_DESTROYED)
return 0
brute *= brute_mod
burn *= burn_mod
@@ -311,7 +324,7 @@ This function completely restores a damaged organ to perfect condition.
"<span class='alert'>The wound on your [name] widens with a nasty ripping noise.</span>",\
"You hear a nasty ripping noise, as if flesh is being torn apart.")
return
//Creating wound
var/wound_type = get_wound_type(type, damage)
@@ -536,8 +549,8 @@ Note that amputating the affected organ does in fact remove the infection from t
var/mob/living/carbon/human/H
if(istype(owner,/mob/living/carbon/human))
H = owner
H = owner
for(var/datum/wound/W in wounds)
if(W.damage_type == CUT || W.damage_type == BRUISE)
brute_dam += W.damage
@@ -554,7 +567,7 @@ Note that amputating the affected organ does in fact remove the infection from t
if (open && !clamped && (H && !(H.species.flags & NO_BLOOD)))
status |= ORGAN_BLEEDING
//Bone fractures
if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT))
src.fracture()
@@ -723,7 +736,7 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/proc/fracture()
if(status & ORGAN_ROBOT)
return //ORGAN_BROKEN doesn't have the same meaning for robot limbs
if((status & ORGAN_BROKEN) || cannot_break)
return
if(owner)
@@ -787,7 +800,7 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/proc/is_usable()
if((status & ORGAN_ROBOT) && get_damage() >= max_damage) //robot limbs just become inoperable at max damage
return
return
return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD))
/obj/item/organ/external/proc/is_malfunctioning()
+1
View File
@@ -157,6 +157,7 @@
if(occupier)
malfvacate(1)
qdel(wires)
wires = null
if(cell)
qdel(cell) // qdel
if(terminal)
@@ -29,8 +29,10 @@
/obj/machinery/particle_accelerator/control_box/Destroy()
if(active)
toggle_power()
qdel(wires)
wires = null
return ..()
/obj/machinery/particle_accelerator/control_box/attack_ghost(user as mob)
return src.attack_hand(user)
@@ -126,7 +128,7 @@
log_game("PA Control Computer increased to [strength] by [key_name(usr)] in ([x],[y],[z])")
investigate_log("increased to <font color='red'>[strength]</font> by [key_name(usr)]","singulo")
use_log += text("\[[time_stamp()]\] <font color='red'>[usr.name] ([key_name(usr)]) has increased the PA Control Computer to [strength].</font>")
investigate_log("increased to <font color='red'>[strength]</font> by [usr.key]","singulo")
strength_change()
@@ -139,7 +141,7 @@
message_admins("PA Control Computer decreased to [strength] by [key_name_admin(usr)] in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("PA Control Computer decreased to [strength] by [key_name(usr)] in ([x],[y],[z])")
investigate_log("decreased to <font color='green'>[strength]</font> by [key_name(usr)]","singulo")
use_log += text("\[[time_stamp()]\] <font color='orange'>[usr.name] ([key_name(usr)]) has decreased the PA Control Computer to [strength].</font>")
use_log += text("\[[time_stamp()]\] <font color='orange'>[usr.name] ([key_name(usr)]) has decreased the PA Control Computer to [strength].</font>")
strength_change()