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-15 23:01:37 +02:00
committed by oranges
parent ca26b0ff5c
commit f6db08af2e
109 changed files with 1064 additions and 845 deletions
+1 -3
View File
@@ -605,9 +605,7 @@ var/global/list/g_fancy_list_of_types = null
return
feedback_add_details("admin_verb","SEQ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
for (var/obj/item/I in M)
if (istype(I, /obj/item/weapon/implant))
continue
for (var/obj/item/I in M.get_equipped_items())
qdel(I)
switch(dresscode)
if ("Naked")
@@ -30,7 +30,8 @@
var/obj/item/organ/I = X
organs["[I.name] ([I.type])"] = I
for(var/obj/item/weapon/implant/I in C)
for(var/X in C.implants)
var/obj/item/weapon/implant/I = X
organs["[I.name] ([I.type])"] = I
var/obj/item/organ = input("Select organ/implant:", "Organ Manipulation", null) in organs
+3 -3
View File
@@ -37,9 +37,9 @@ var/highlander = FALSE
mind.announce_objectives()
for(var/obj/item/I in src)
if(istype(I, /obj/item/weapon/implant))
continue
for(var/obj/item/I in get_equipped_items())
qdel(I)
for(var/obj/item/I in held_items)
qdel(I)
equip_to_slot_or_del(new /obj/item/clothing/under/kilt/highlander(src), slot_w_uniform)
equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(src), slot_ears)
+1 -1
View File
@@ -151,7 +151,7 @@
if(M.stat == CONSCIOUS)
M.mind_initialize() //give them a mind datum if they don't have one.
var/resisted
if(!isloyal(M))
if(!M.isloyal())
if(user.mind in ticker.mode.head_revolutionaries)
if(ticker.mode.add_revolutionary(M.mind))
M.Stun(3)
@@ -58,6 +58,17 @@
beaker = null
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/contents_explosion(severity, target)
..()
if(beaker)
beaker.ex_act(severity, target)
/obj/machinery/atmospherics/components/unary/cryo_cell/handle_atom_del(atom/A)
..()
if(A == beaker)
beaker = null
updateUsrDialog()
/obj/machinery/atmospherics/components/unary/cryo_cell/on_deconstruction()
if(beaker)
beaker.forceMove(loc)
-31
View File
@@ -1,34 +1,3 @@
//Exile implants will allow you to use the station gate, but not return home.
//This will allow security to exile badguys/for badguys to exile their kill targets
/obj/item/weapon/implant/exile
name = "exile implant"
desc = "Prevents you from returning from away missions"
origin_tech = "materials=2;biotech=3;magnets=2;bluespace=3"
activated = 0
/obj/item/weapon/implant/exile/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
<b>Name:</b> Nanotrasen Employee Exile Implant<BR>
<b>Implant Details:</b> The onboard gateway system has been modified to reject entry by individuals containing this implant<BR>"}
return dat
/obj/item/weapon/implanter/exile
name = "implanter (exile)"
/obj/item/weapon/implanter/exile/New()
imp = new /obj/item/weapon/implant/exile( src )
..()
/obj/item/weapon/implantcase/exile
name = "implant case - 'Exile'"
desc = "A glass case containing an exile implant."
/obj/item/weapon/implantcase/exile/New()
imp = new /obj/item/weapon/implant/exile(src)
..()
/obj/structure/closet/secure_closet/exile
name = "exile implants"
+4 -4
View File
@@ -253,10 +253,10 @@ var/obj/machinery/gateway/centerstation/the_gateway = null
if(!stationgate || qdeleted(stationgate))
return
if(istype(AM, /mob/living/carbon))
for(var/obj/item/weapon/implant/exile/E in AM)//Checking that there is an exile implant in the contents
if(E.imp_in == AM)//Checking that it's actually implanted vs just in their pocket
AM << "\black The station gate has detected your exile implant and is blocking your entry."
return
var/mob/living/carbon/C = AM
for(var/obj/item/weapon/implant/exile/E in C.implants)//Checking that there is an exile implant
AM << "\black The station gate has detected your exile implant and is blocking your entry."
return
AM.forceMove(get_step(stationgate.loc, SOUTH))
AM.setDir(SOUTH)
if (ismob(AM))
+1 -3
View File
@@ -11,9 +11,7 @@
return
var/obj/item/weapon/implant/mindshield/L = new/obj/item/weapon/implant/mindshield(H)
L.imp_in = H
L.implanted = 1
H.sec_hud_set_implants()
L.implant(H, null, 1)
var/obj/item/device/radio/R = H.ears
R.set_frequency(CENTCOM_FREQ)
+5 -6
View File
@@ -133,9 +133,10 @@
r_hand = /obj/item/weapon/twohanded/fireaxe
/datum/outfit/psycho/post_equip(mob/living/carbon/human/H)
for(var/obj/item/carried_item in H.contents)
if(!istype(carried_item, /obj/item/weapon/implant))//If it's not an implant.
carried_item.add_mob_blood(H)//Oh yes, there will be blood...
for(var/obj/item/carried_item in H.get_equipped_items())
carried_item.add_mob_blood(H)//Oh yes, there will be blood...
for(var/obj/item/I in H.held_items)
I.add_mob_blood(H)
H.regenerate_icons()
/datum/outfit/assassin
@@ -358,9 +359,7 @@
R.freqlock = 1
var/obj/item/weapon/implant/mindshield/L = new/obj/item/weapon/implant/mindshield(H)//Here you go Deuryn
L.imp_in = H
L.implanted = 1
H.sec_hud_set_implants()
L.implant(H, null, 1)
var/obj/item/weapon/card/id/W = H.wear_id
+1 -1
View File
@@ -64,7 +64,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
qdel(src)
return ..()
/obj/effect/immovablerod/ex_act(test)
/obj/effect/immovablerod/ex_act(severity, target)
return 0
/obj/effect/immovablerod/Bump(atom/clong)
+3 -2
View File
@@ -98,6 +98,7 @@
return
/turf/open/floor/vines/ex_act(severity, target)
..()
if(severity < 3 || target == src)
ChangeTurf(src.baseturf)
@@ -227,10 +228,10 @@
quality = NEGATIVE
/datum/spacevine_mutation/aggressive_spread/on_spread(obj/structure/spacevine/holder, turf/target)
target.ex_act(severity, src) // vine immunity handled at /mob/ex_act
target.ex_act(severity, null, src) // vine immunity handled at /mob/ex_act
/datum/spacevine_mutation/aggressive_spread/on_buckle(obj/structure/spacevine/holder, mob/living/buckled)
buckled.ex_act(severity, src)
buckled.ex_act(severity, null, src)
/datum/spacevine_mutation/transparency
name = "transparent"
+18
View File
@@ -25,6 +25,24 @@
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/biogenerator(null)
B.apply_default_parts(src)
/obj/machinery/biogenerator/Destroy()
if(beaker)
qdel(beaker)
beaker = null
return ..()
/obj/machinery/biogenerator/contents_explosion(severity, target)
..()
if(beaker)
beaker.ex_act(severity, target)
/obj/machinery/biogenerator/handle_atom_del(atom/A)
..()
if(A == beaker)
beaker = null
update_icon()
updateUsrDialog()
/obj/item/weapon/circuitboard/machine/biogenerator
name = "circuit board (Biogenerator)"
build_path = /obj/machinery/biogenerator
+1 -3
View File
@@ -51,9 +51,7 @@ Captain
return
var/obj/item/weapon/implant/mindshield/L = new/obj/item/weapon/implant/mindshield(H)
L.imp_in = H
L.implanted = 1
H.sec_hud_set_implants()
L.implant(H, null, 1)
minor_announce("Captain [H.real_name] on deck!")
+1 -2
View File
@@ -53,8 +53,7 @@ Clown
return
var/obj/item/weapon/implant/sad_trombone/S = new/obj/item/weapon/implant/sad_trombone(H)
S.imp_in = H
S.implanted = 1
S.implant(H, null, 1)
H.dna.add_mutation(CLOWNMUT)
H.rename_self("clown")
+4 -12
View File
@@ -60,9 +60,7 @@ Head of Security
return
var/obj/item/weapon/implant/mindshield/L = new/obj/item/weapon/implant/mindshield(H)
L.imp_in = H
L.implanted = 1
H.sec_hud_set_implants()
L.implant(H, null, 1)
announce_head(H, list("Security")) //tell underlings (security radio) they have a head
/*
@@ -119,9 +117,7 @@ Warden
return
var/obj/item/weapon/implant/mindshield/L = new/obj/item/weapon/implant/mindshield(H)
L.imp_in = H
L.implanted = 1
H.sec_hud_set_implants()
L.implant(H, null, 1)
/*
Detective
@@ -170,9 +166,7 @@ Detective
return
var/obj/item/weapon/implant/mindshield/L = new/obj/item/weapon/implant/mindshield(H)
L.imp_in = H
L.implanted = 1
H.sec_hud_set_implants()
L.implant(H, null, 1)
/*
Security Officer
@@ -271,9 +265,7 @@ var/list/sec_departments = list("engineering", "supply", "medical", "science")
return
var/obj/item/weapon/implant/mindshield/L = new/obj/item/weapon/implant/mindshield(H)
L.imp_in = H
L.implanted = 1
H.sec_hud_set_implants()
L.implant(H, null, 1)
var/obj/item/weapon/card/id/W = H.wear_id
W.access |= dep_access
+1 -8
View File
@@ -255,14 +255,7 @@
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(5, 1, src)
s.start()
if(severity == 1)
if(prob(50))
empty_content()
qdel(src)
else if(severity == 2)
if(prob(25))
empty_content()
qdel(src)
..()
//empty the redemption machine by stacks of at most max_amount (50 at this time) size
/obj/machinery/mineral/ore_redemption/proc/empty_content()
+13 -20
View File
@@ -13,7 +13,7 @@
if (istype(W, /obj/item/weapon/ore))
if(!user.drop_item())
return
W.loc = src
W.forceMove(src)
else if (istype(W, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = W
for(var/obj/item/weapon/ore/O in S.contents)
@@ -25,11 +25,7 @@
var/time = 50
if(do_after(user, time/C.toolspeed, target = src))
user.visible_message("[user] pries \the [src] apart.", "<span class='notice'>You pry apart \the [src].</span>", "<span class='italics'>You hear splitting wood.</span>")
// If you change the amount of wood returned, remember
// to change the construction costs
var/obj/item/stack/sheet/mineral/wood/wo = new (loc, 4)
wo.add_fingerprint(user)
deconstruct()
deconstruct(TRUE, user)
else
return ..()
@@ -52,10 +48,9 @@
dat += text("<br><br><A href='?src=\ref[src];removeall=1'>Empty box</A>")
user << browse("[dat]", "window=orebox")
/obj/structure/ore_box/proc/dump_contents()
for (var/obj/item/weapon/ore/O in contents)
contents -= O
O.loc = src.loc
/obj/structure/ore_box/proc/dump_box_contents()
for(var/obj/item/weapon/ore/O in contents)
O.forceMove(loc)
/obj/structure/ore_box/Topic(href, href_list)
if(..())
@@ -66,16 +61,14 @@
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["removeall"])
dump_contents()
dump_box_contents()
usr << "<span class='notice'>You empty the box.</span>"
src.updateUsrDialog()
return
updateUsrDialog()
/obj/structure/ore_box/ex_act(severity, target)
if(prob(100 / severity) && severity < 3)
qdel(src) //nothing but ores can get inside unless its a bug and ores just return nothing on ex_act, not point in calling it on them
/obj/structure/ore_box/Destroy()
dump_contents()
return ..()
/obj/structure/ore_box/deconstruct(disassembled = TRUE, mob/user)
var/obj/item/stack/sheet/mineral/wood/WD = new (loc, 4)
if(user)
WD.add_fingerprint(user)
dump_box_contents()
qdel(src)
@@ -104,7 +104,9 @@ In all, this is a lot like the monkey code. /N
add_logs(M, src, "attacked")
updatehealth()
/mob/living/carbon/alien/ex_act(severity, target)
/mob/living/carbon/alien/ex_act(severity, target, origin)
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
return
..()
switch (severity)
if (1)
@@ -125,4 +127,4 @@ In all, this is a lot like the monkey code. /N
return 0
/mob/living/carbon/alien/acid_act(acidpwr, acid_volume)
return 0//aliens are immune to acid.
return 0//aliens are immune to acid.
+2
View File
@@ -13,6 +13,8 @@
qdel(food)
for(var/BP in bodyparts)
qdel(BP)
for(var/imp in implants)
qdel(imp)
bodyparts = list()
remove_from_all_data_huds()
if(dna)
@@ -43,6 +43,7 @@ mob/living/carbon/bullet_act(obj/item/projectile/P, def_zone)
send_item_attack_message(I, user, affecting.name)
if(I.force)
apply_damage(I.force, I.damtype, affecting)
damage_clothes(I.force, I.damtype, "melee", affecting.body_zone)
if(I.damtype == BRUTE && affecting.status == BODYPART_ORGANIC)
if(prob(33))
I.add_mob_blood(src)
@@ -289,12 +290,16 @@ mob/living/carbon/bullet_act(obj/item/projectile/P, def_zone)
/mob/living/carbon/damage_clothes(damage_amount, damage_type = BRUTE, damage_flag = 0, def_zone)
if(damage_type != BRUTE && damage_type != BURN)
return
var/bodypart_bit = 0
if(damage_flag != "bomb")
damage_amount *= 0.5 //0.5 multiplier for balance reason, we don't want clothes to be too easily destroyed
if(def_zone)
bodypart_bit = body_zone2body_parts_covered(def_zone)
for(var/X in get_equipped_items())
var/obj/item/I = X
if(I.body_parts_covered & bodypart_bit)
I.take_damage(0.5*damage_amount, damage_type, damage_flag, 0)
//0.5 multiplier for balance reason, we don't want clothes to be too easily destroyed
if(!bodypart_bit || (I.body_parts_covered & bodypart_bit))
I.take_damage(damage_amount, damage_type, damage_flag, 0)
@@ -5,6 +5,8 @@
var/list/internal_organs = list() //List of /obj/item/organ in the mob. They don't go in the contents for some reason I don't want to know.
var/list/internal_organs_slot = list() //Same as above, but stores "slot ID" - "organ" pairs for easy access.
var/list/implants = list()
var/silent = 0 //Can't talk. Value goes down every life proc. //NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU.
var/obj/item/handcuffed = null //Whether or not the mob is handcuffed
@@ -13,9 +13,8 @@
var/muzzled = is_muzzled()
//var/m_type = 1
for (var/obj/item/weapon/implant/I in src)
if (I.implanted)
I.trigger(act, src)
for (var/obj/item/weapon/implant/I in implants)
I.trigger(act, src)
var/miming=0
if(mind)
@@ -298,13 +298,13 @@
msg += "<a href='?src=\ref[src];hud=1;photo_front=1'>\[Front photo\]</a> "
msg += "<a href='?src=\ref[src];hud=1;photo_side=1'>\[Side photo\]</a><br>"
if(istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(CIH,/obj/item/organ/cyberimp/eyes/hud/medical))
var/implant_detect
var/cyberimp_detect
for(var/obj/item/organ/cyberimp/CI in internal_organs)
if(CI.status == ORGAN_ROBOTIC)
implant_detect += "[name] is modified with a [CI.name].<br>"
if(implant_detect)
cyberimp_detect += "[name] is modified with a [CI.name].<br>"
if(cyberimp_detect)
msg += "Detected cybernetic modifications:<br>"
msg += implant_detect
msg += cyberimp_detect
if(R)
var/health_r = R.fields["p_stat"]
msg += "<a href='?src=\ref[src];hud=m;p_stat=1'>\[[health_r]\]</a>"
@@ -588,7 +588,7 @@
threatcount += 1
//mindshield implants imply trustworthyness
if(isloyal(src))
if(isloyal())
threatcount -= 1
//Agent cards lower threatlevel.
@@ -339,10 +339,11 @@
..()
/mob/living/carbon/human/ex_act(severity, ex_target)
/mob/living/carbon/human/ex_act(severity, target, origin)
if(istype(ex_target, /datum/spacevine_mutation) && isvineimmune(src))
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
return
..()
var/b_loss = 0
var/f_loss = 0
var/bomb_armor = getarmor(null, "bomb")
@@ -351,8 +352,9 @@
if (1)
if(prob(bomb_armor))
b_loss = 500
var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
throw_at(target, 200, 4)
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
gib()
return
@@ -363,7 +365,7 @@
if(bomb_armor)
b_loss = 30*(2 - round(bomb_armor*0.01, 0.05))
f_loss = b_loss
damage_clothes(200 - bomb_armor, BRUTE, "bomb")
if (!istype(ears, /obj/item/clothing/ears/earmuffs))
adjustEarDamage(30, 120)
if (prob(70))
@@ -373,16 +375,13 @@
b_loss = 30
if(bomb_armor)
b_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)
if (prob(50))
Paralyse(8)
take_overall_damage(b_loss,f_loss)
if(bomb_armor == 100) //full bomb armor set, we don't call contents_explosion
flash_act()
return
//attempt to dismember bodyparts
if(severity <= 2 || !bomb_armor)
@@ -395,7 +394,7 @@
max_limb_loss--
if(!max_limb_loss)
break
..()
/mob/living/carbon/human/blob_act(obj/structure/blob/B)
if(stat == DEAD)
@@ -1086,7 +1086,7 @@
var/weakness = H.check_weakness(I, user)
apply_damage(I.force * weakness, I.damtype, def_zone, armor_block, H)
H.damage_clothes(I.force, BRUTE, "melee", affecting.body_zone)
H.damage_clothes(I.force, I.damtype, "melee", affecting.body_zone)
H.send_item_attack_message(I, user, hit_area)
@@ -114,3 +114,4 @@
if(I.flags_inv & HIDEMASK || forced)
update_inv_wear_mask()
update_inv_head()
@@ -122,7 +122,7 @@
threatcount += 4
//mindshield implants imply trustworthyness
if(isloyal(src))
if(isloyal())
threatcount -= 1
return threatcount
@@ -179,7 +179,9 @@
take_bodypart_damage(acidpwr * min(0.6, acid_volume*0.1))
/mob/living/carbon/monkey/ex_act(severity, target)
/mob/living/carbon/monkey/ex_act(severity, target, origin)
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
return
..()
switch (severity)
@@ -189,12 +191,14 @@
if (2)
take_overall_damage(60, 60)
damage_clothes(200, BRUTE, "bomb")
adjustEarDamage(30, 120)
if(prob(70))
Paralyse(10)
if(3)
take_overall_damage(30, 0)
damage_clothes(50, BRUTE, "bomb")
adjustEarDamage(15,60)
if (prob(50))
Paralyse(8)
+2 -2
View File
@@ -268,8 +268,8 @@
M.do_attack_animation(src)
return 1
/mob/living/ex_act(severity, origin)
if(istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
/mob/living/ex_act(severity, target, origin)
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
return
..()
flash_act()
+1 -1
View File
@@ -376,7 +376,7 @@ var/list/ai_list = list()
src << browse(last_paper_seen, "window=show_paper")
//Carn: holopad requests
if(href_list["jumptoholopad"])
var/obj/machinery/hologram/holopad/H = locate(href_list["jumptoholopad"])
var/obj/machinery/holopad/H = locate(href_list["jumptoholopad"])
if(stat == CONSCIOUS)
if(H)
H.attack_ai(src) //may as well recycle
@@ -31,8 +31,6 @@
..()
/mob/living/silicon/ai/ex_act(severity, target)
..()
switch(severity)
if(1)
gib()
@@ -25,8 +25,8 @@
if(ai.client)
ai.client.eye = src
//Holopad
if(istype(ai.current, /obj/machinery/hologram/holopad))
var/obj/machinery/hologram/holopad/H = ai.current
if(istype(ai.current, /obj/machinery/holopad))
var/obj/machinery/holopad/H = ai.current
H.move_hologram(ai)
/mob/camera/aiEye/Move()
+1 -1
View File
@@ -47,7 +47,7 @@
if (!message)
return
var/obj/machinery/hologram/holopad/T = current
var/obj/machinery/holopad/T = current
if(istype(T) && T.masters[src])//If there is a hologram and its master is the user.
send_speech(message, 7, T, "robot", get_spans())
src << "<i><span class='game say'>Holopad transmitted, <span class='name'>[real_name]</span> <span class='message robot'>\"[message]\"</span></span></i>"//The AI can "hear" its own message.
@@ -33,7 +33,6 @@
src << "<span class='notice'>You feel an electric surge run through your circuitry and become acutely aware at how lucky you are that you can still feel at all.</span>"
/mob/living/silicon/pai/ex_act(severity, target)
..()
switch(severity)
if(1)
@@ -99,7 +99,9 @@
Proj.on_hit(src)
return 0
/mob/living/simple_animal/ex_act(severity, target)
/mob/living/simple_animal/ex_act(severity, target, origin)
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
return
..()
var/bomb_armor = getarmor(null, "bomb")
switch (severity)
+11 -11
View File
@@ -53,17 +53,17 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary
if(!client)
return
if(iscarbon(src) && contents.len && ventcrawler < 2)//It must have atleast been 1 to get this far
for(var/obj/item/I in contents)
var/failed = 0
if(istype(I, /obj/item/weapon/implant))
continue
else
failed++
if(failed)
src << "<span class='warning'>You can't crawl around in the ventilation ducts with items!</span>"
return
if(iscarbon(src) && ventcrawler < 2)//It must have atleast been 1 to get this far
var/failed = 0
var/list/items_list = get_equipped_items()
if(items_list.len)
failed = 1
for(var/obj/item/I in held_items)
failed = 1
break
if(failed)
src << "<span class='warning'>You can't crawl around in the ventilation ducts with items!</span>"
return
visible_message("<span class='notice'>[src] scrambles into the ventilation ducts!</span>","<span class='notice'>You climb into the ventilation ducts.</span>")
forceMove(vent_found)
+6 -4
View File
@@ -1,12 +1,14 @@
// see _DEFINES/is_helpers.dm for mob type checks
/proc/isloyal(A) //Checks to see if the person contains a mindshield implant, then checks that the implant is actually inside of them
for(var/obj/item/weapon/implant/mindshield/L in A)
if(L && L.implanted)
return 1
/mob/proc/isloyal() //Checks to see if the person contains a mindshield implant, then checks that the implant is actually inside of them
return 0
/mob/living/carbon/isloyal()
for(var/obj/item/weapon/implant/mindshield/L in implants)
return 1
/proc/check_zone(zone)
if(!zone)
return "chest"
+22 -18
View File
@@ -4,14 +4,14 @@
//Handle items on mob
//first implants & organs
var/list/implants = list()
var/list/stored_implants = list()
var/list/int_organs = list()
if (tr_flags & TR_KEEPIMPLANTS)
for(var/obj/item/weapon/implant/W in src)
implants += W
for(var/X in implants)
var/obj/item/weapon/implant/IMP = X
stored_implants += IMP
IMP.removed(src, 1, 1)
if (tr_flags & TR_KEEPORGANS)
for(var/X in internal_organs)
@@ -29,10 +29,11 @@
CH.cavity_item = null
if(tr_flags & TR_KEEPITEMS)
for(var/obj/item/W in (contents-implants-cavity_object))
var/Itemlist = get_equipped_items()
Itemlist += held_items
for(var/obj/item/W in Itemlist)
unEquip(W)
//Make mob invisible and spawn animation
notransform = 1
canmove = 0
@@ -84,9 +85,9 @@
//re-add implants to new mob
if (tr_flags & TR_KEEPIMPLANTS)
for(var/obj/item/weapon/implant/I in implants)
I.loc = O
I.implanted = O
for(var/Y in implants)
var/obj/item/weapon/implant/IMP = Y
IMP.implant(O, null, 1)
//re-add organs to new mob
if(tr_flags & TR_KEEPORGANS)
@@ -141,12 +142,14 @@
//Handle items on mob
//first implants & organs
var/list/implants = list()
var/list/stored_implants = list()
var/list/int_organs = list()
if (tr_flags & TR_KEEPIMPLANTS)
for(var/obj/item/weapon/implant/W in src)
implants += W
for(var/X in implants)
var/obj/item/weapon/implant/IMP = X
stored_implants += IMP
IMP.removed(src, 1, 1)
if (tr_flags & TR_KEEPORGANS)
for(var/X in internal_organs)
@@ -165,7 +168,9 @@
//now the rest
if (tr_flags & TR_KEEPITEMS)
for(var/obj/item/W in (contents-implants-cavity_object))
var/Itemlist = get_equipped_items()
Itemlist += held_items
for(var/obj/item/W in Itemlist)
unEquip(W)
if (client)
client.screen -= W
@@ -231,10 +236,9 @@
//re-add implants to new mob
if (tr_flags & TR_KEEPIMPLANTS)
for(var/obj/item/weapon/implant/I in implants)
I.loc = O
I.implanted = O
O.sec_hud_set_implants()
for(var/Y in implants)
var/obj/item/weapon/implant/IMP = Y
IMP.implant(O, null, 1)
if(tr_flags & TR_KEEPORGANS)
for(var/X in O.internal_organs)
+7
View File
@@ -155,6 +155,13 @@
disconnect_terminal()
. = ..()
/obj/machinery/power/apc/handle_atom_del(atom/A)
if(A == cell)
cell = null
update_icon()
update_icon()
updateUsrDialog()
/obj/machinery/power/apc/proc/make_terminal()
// create a terminal object at the same position as original turf loc
// wires will attach to this
+5 -3
View File
@@ -95,9 +95,11 @@
var/obj/item/weapon/implant/req_implant = null
/obj/item/device/firing_pin/implant/pin_auth(mob/living/user)
for(var/obj/item/weapon/implant/I in user)
if(req_implant && I.imp_in == user && I.type == req_implant)
return 1
if(iscarbon(user))
var/mob/living/carbon/C = user
for(var/obj/item/weapon/implant/I in C.implants)
if(req_implant && I.type == req_implant)
return 1
return 0
/obj/item/device/firing_pin/implant/mindshield
@@ -85,9 +85,16 @@
if(severity < 3)
..()
/obj/machinery/chem_dispenser/blob_act(obj/structure/blob/B)
if(prob(50))
qdel(src)
/obj/machinery/chem_dispenser/contents_explosion(severity, target)
..()
if(beaker)
beaker.ex_act(severity, target)
/obj/machinery/chem_dispenser/handle_atom_del(atom/A)
..()
if(A == beaker)
beaker = null
cut_overlays()
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
@@ -154,7 +161,7 @@
. = TRUE
if("eject")
if(beaker)
beaker.loc = loc
beaker.forceMove(loc)
beaker = null
cut_overlays()
. = TRUE
@@ -55,6 +55,23 @@
if(severity < 3)
..()
/obj/machinery/chem_master/contents_explosion(severity, target)
..()
if(beaker)
beaker.ex_act(severity, target)
if(bottle)
bottle.ex_act(severity, target)
/obj/machinery/chem_master/handle_atom_del(atom/A)
..()
if(A == beaker)
beaker = null
reagents.clear_reagents()
icon_state = "mixer0"
else if(A == bottle)
bottle = null
/obj/machinery/chem_master/blob_act(obj/structure/blob/B)
if (prob(50))
qdel(src)
@@ -82,14 +82,36 @@
var/list/holdingitems = list()
/obj/machinery/reagentgrinder/New()
..()
beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
return
..()
beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
return
/obj/machinery/reagentgrinder/Destroy()
if(beaker)
qdel(beaker)
beaker = null
return ..()
/obj/machinery/reagentgrinder/contents_explosion(severity, target)
if(beaker)
beaker.ex_act(severity, target)
/obj/machinery/reagentgrinder/handle_atom_del(atom/A)
..()
if(A == beaker)
beaker = null
update_icon()
updateUsrDialog()
/obj/machinery/reagentgrinder/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/metal (loc, 3)
qdel(src)
/obj/machinery/reagentgrinder/update_icon()
icon_state = "juicer"+num2text(!isnull(beaker))
return
if(beaker)
icon_state = "juicer1"
else
icon_state = "juicer0"
/obj/machinery/reagentgrinder/attackby(obj/item/I, mob/user, params)
if(default_unfasten_wrench(user, I))
+2 -1
View File
@@ -71,7 +71,8 @@
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
R.on_ex_act()
..()
if(!qdeleted(src))
..()
/obj/item/weapon/reagent_containers/fire_act(exposed_temperature, exposed_volume)
reagents.chem_temp += 30
@@ -124,7 +124,8 @@
/obj/structure/disposalholder/allow_drop()
return 1
/obj/structure/disposalholder/ex_act(severity, target)
return
// Disposal pipes
@@ -278,13 +279,10 @@
// pipe affected by explosion
/obj/structure/disposalpipe/ex_act(severity, target)
//pass on ex_act to our contents before calling it on ourself
/obj/structure/disposalpipe/contents_explosion(severity, target)
var/obj/structure/disposalholder/H = locate() in src
if(H)
H.contents_explosion(severity, target)
..()
/obj/structure/disposalpipe/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
+1 -1
View File
@@ -257,7 +257,7 @@
H.vent_gas(loc)
qdel(H)
/obj/machinery/disposal/deconstruct()
/obj/machinery/disposal/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
if(stored)
var/turf/T = loc
+8 -1
View File
@@ -15,9 +15,13 @@
/obj/structure/bigDelivery/Destroy()
var/turf/T = get_turf(src)
for(var/atom/movable/AM in contents)
AM.loc = T
AM.forceMove(T)
return ..()
/obj/structure/bigDelivery/contents_explosion(severity, target)
for(var/atom/movable/AM in contents)
AM.ex_act()
/obj/structure/bigDelivery/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W
@@ -74,6 +78,9 @@
var/giftwrapped = 0
var/sortTag = 0
/obj/item/smallDelivery/contents_explosion(severity, target)
for(var/atom/movable/AM in contents)
AM.ex_act()
/obj/item/smallDelivery/attack_self(mob/user)
user.unEquip(src)
@@ -61,7 +61,7 @@ Note: Must be placed within 3 tiles of the R&D Console
return
busy = 1
loaded_item = O
O.loc = src
O.forceMove(src)
user << "<span class='notice'>You add the [O.name] to the [src.name]!</span>"
flick("d_analyzer_la", src)
spawn(10)
+1 -1
View File
@@ -277,7 +277,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
usr << "<span class='danger'>The destructive analyzer is busy at the moment.</span>"
else if(linked_destroy.loaded_item)
linked_destroy.loaded_item.loc = linked_destroy.loc
linked_destroy.loaded_item.forceMove(linked_destroy.loc)
linked_destroy.loaded_item = null
linked_destroy.icon_state = "d_analyzer"
screen = 1.0
+3 -1
View File
@@ -14,7 +14,9 @@
var/obj/item/weapon/implant/I = null
/datum/surgery_step/extract_implant/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
I = locate(/obj/item/weapon/implant) in target
for(var/obj/item/O in target.implants)
I = O
break
if(I)
user.visible_message("[user] begins to extract [I] from [target]'s [target_zone].", "<span class='notice'>You begin to extract [I] from [target]'s [target_zone]...</span>")
else