Fix various runtimes (#48563)

The grille one could use a lower level solution eventually. As in 
separation of simple animal attack/visuals/aftereffects but that's 
bigger refactor.

* Fixes explosion dismemberment runtime.
* Fixes removing pen from PDA runtime.
* Mulebot bullet act runtime.
* Trying to refuel plasmacutter with fuel runtime.
* Fixes grille runtime.
* Teslium reaction runtime
* lavaland elite win runtime
This commit is contained in:
AnturK
2020-01-04 22:13:10 -08:00
committed by Tad Hardesty
parent 44618a4d85
commit e624cabe5d
7 changed files with 41 additions and 37 deletions
+8 -8
View File
@@ -605,10 +605,10 @@ GLOBAL_LIST_EMPTY(PDAs)
U << browse(null, "window=pda")
return
/obj/item/pda/proc/remove_id()
if(issilicon(usr) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
/obj/item/pda/proc/remove_id(mob/user)
if(issilicon(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
do_remove_id(usr)
do_remove_id(user)
/obj/item/pda/proc/do_remove_id(mob/user)
@@ -743,13 +743,13 @@ GLOBAL_LIST_EMPTY(PDAs)
/obj/item/pda/proc/create_message(mob/living/U, obj/item/pda/P)
send_message(U,list(P))
/obj/item/pda/AltClick()
/obj/item/pda/AltClick(mob/user)
..()
if(id)
remove_id()
remove_id(user)
else
remove_pen()
remove_pen(user)
/obj/item/pda/CtrlClick(mob/user)
..()
@@ -776,7 +776,7 @@ GLOBAL_LIST_EMPTY(PDAs)
set src in usr
if(id)
remove_id()
remove_id(usr)
else
to_chat(usr, "<span class='warning'>This PDA does not have an ID in it!</span>")
@@ -837,7 +837,7 @@ GLOBAL_LIST_EMPTY(PDAs)
/obj/item/pda/proc/id_check(mob/user, obj/item/card/id/I)
if(!I)
if(id && (src in user.contents))
remove_id()
remove_id(user)
return TRUE
else
var/obj/item/card/id/C = user.get_active_held_item()
+1 -1
View File
@@ -82,7 +82,7 @@
. = ..()
if(!.)
return
if(!shock(user, 70))
if(!shock(user, 70) && !QDELETED(src)) //Last hit still shocks but shouldn't deal damage to the grille
take_damage(rand(5,10), BRUTE, "melee", 1)
/obj/structure/grille/attack_paw(mob/user)
@@ -157,7 +157,7 @@
/mob/living/simple_animal/bot/mulebot/bullet_act(obj/projectile/Proj)
. = ..()
if(.)
if(. && !QDELETED(src)) //Got hit and not blown up yet.
if(prob(50) && !isnull(load))
unload(0)
if(prob(25))
@@ -233,7 +233,8 @@ While using this makes the system rely on OnFire, it still gives options for tim
INVOKE_ASYNC(src, .proc/fighters_check) //Checks to see if our fighters died.
INVOKE_ASYNC(src, .proc/arena_trap) //Gets another arena trap queued up for when this one runs out.
INVOKE_ASYNC(src, .proc/border_check) //Checks to see if our fighters got out of the arena somehow.
addtimer(CALLBACK(src, .proc/arena_checks), 50)
if(!QDELETED(src))
addtimer(CALLBACK(src, .proc/arena_checks), 50)
/obj/structure/elite_tumor/proc/fighters_check()
if(activator != null && activator.stat == DEAD || activity == TUMOR_ACTIVE && QDELETED(activator))
@@ -5,22 +5,24 @@
var/modifier = 0
/datum/chemical_reaction/reagent_explosion/on_reaction(datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
var/inside_msg
if(ismob(holder.my_atom))
var/mob/M = holder.my_atom
inside_msg = " inside [ADMIN_LOOKUPFLW(M)]"
var/lastkey = holder.my_atom.fingerprintslast
var/touch_msg = "N/A"
if(lastkey)
var/mob/toucher = get_mob_by_key(lastkey)
touch_msg = "[ADMIN_LOOKUPFLW(toucher)]"
if(!istype(holder.my_atom, /obj/machinery/plumbing)) //excludes standard plumbing equipment from spamming admins with this shit
message_admins("Reagent explosion reaction occurred at [ADMIN_VERBOSEJMP(T)][inside_msg]. Last Fingerprint: [touch_msg].")
log_game("Reagent explosion reaction occurred at [AREACOORD(T)]. Last Fingerprint: [lastkey ? lastkey : "N/A"]." )
var/datum/effect_system/reagents_explosion/e = new()
e.set_up(modifier + round(created_volume/strengthdiv, 1), T, 0, 0)
e.start()
var/power = modifier + round(created_volume/strengthdiv, 1)
if(power > 0)
var/turf/T = get_turf(holder.my_atom)
var/inside_msg
if(ismob(holder.my_atom))
var/mob/M = holder.my_atom
inside_msg = " inside [ADMIN_LOOKUPFLW(M)]"
var/lastkey = holder.my_atom.fingerprintslast
var/touch_msg = "N/A"
if(lastkey)
var/mob/toucher = get_mob_by_key(lastkey)
touch_msg = "[ADMIN_LOOKUPFLW(toucher)]"
if(!istype(holder.my_atom, /obj/machinery/plumbing)) //excludes standard plumbing equipment from spamming admins with this shit
message_admins("Reagent explosion reaction occurred at [ADMIN_VERBOSEJMP(T)][inside_msg]. Last Fingerprint: [touch_msg].")
log_game("Reagent explosion reaction occurred at [AREACOORD(T)]. Last Fingerprint: [lastkey ? lastkey : "N/A"]." )
var/datum/effect_system/reagents_explosion/e = new()
e.set_up(power , T, 0, 0)
e.start()
holder.clear_reagents()
+2 -4
View File
@@ -94,7 +94,7 @@
to_chat(user, "<span class='warning'>[src] is out of fuel!</span>")
return
var/obj/item/weldingtool/W = I
if(!W.welding)
if(istype(W) && !W.welding)
if(W.reagents.has_reagent(/datum/reagent/fuel, W.max_fuel))
to_chat(user, "<span class='warning'>Your [W.name] is already full!</span>")
return
@@ -103,10 +103,8 @@
playsound(src, 'sound/effects/refill.ogg', 50, TRUE)
W.update_icon()
else
user.visible_message("<span class='warning'>[user] catastrophically fails at refilling [user.p_their()] [W.name]!</span>", "<span class='userdanger'>That was stupid of you.</span>")
user.visible_message("<span class='warning'>[user] catastrophically fails at refilling [user.p_their()] [I.name]!</span>", "<span class='userdanger'>That was stupid of you.</span>")
log_bomber(user, "detonated a", src, "via welding tool")
boom()
return
return ..()
@@ -21,15 +21,18 @@
C.emote("scream")
SEND_SIGNAL(C, COMSIG_ADD_MOOD_EVENT, "dismembered", /datum/mood_event/dismembered)
drop_limb()
C.update_equipment_speed_mods() // Update in case speed affecting item unequipped by dismemberment
if(dam_type == BURN)
burn()
return 1
add_mob_blood(C)
var/turf/location = C.loc
if(istype(location))
C.add_splatter_floor(location)
if(QDELETED(src)) //Could have dropped into lava/explosion/chasm/whatever
return TRUE
if(dam_type == BURN)
burn()
return TRUE
add_mob_blood(C)
var/direction = pick(GLOB.cardinals)
var/t_range = rand(2,max(throw_range/2, 2))
var/turf/target_turf = get_turf(src)
@@ -41,7 +44,7 @@
if(new_turf.density)
break
throw_at(target_turf, throw_range, throw_speed)
return 1
return TRUE
/obj/item/bodypart/chest/dismember()