mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Various runtimes (#7873)
This commit is contained in:
@@ -78,12 +78,11 @@ var/list/runechat_image_cache = list()
|
||||
if(timer_delete)
|
||||
deltimer(timer_delete)
|
||||
timer_delete = null
|
||||
if(!QDELETED(owned_by))
|
||||
if(istype(owned_by, /client)) // hopefully the PARENT_QDELETING on client should beat this if it's a disconnect
|
||||
UnregisterSignal(owned_by, COMSIG_PARENT_QDELETING)
|
||||
if(owned_by.seen_messages)
|
||||
LAZYREMOVEASSOC(owned_by.seen_messages, message_loc, src)
|
||||
owned_by.images.Remove(message)
|
||||
if(!QDELETED(message_loc))
|
||||
UnregisterSignal(message_loc, COMSIG_PARENT_QDELETING)
|
||||
owned_by = null
|
||||
message_loc = null
|
||||
message = null
|
||||
@@ -108,7 +107,7 @@ var/list/runechat_image_cache = list()
|
||||
|
||||
// Register client who owns this message
|
||||
owned_by = owner.client
|
||||
RegisterSignal(owned_by, COMSIG_PARENT_QDELETING, PROC_REF(qdel_self))
|
||||
RegisterSignal(owned_by, COMSIG_PARENT_QDELETING, PROC_REF(unregister_qdel_self)) // this should only call owned_by if the client is destroyed
|
||||
|
||||
var/extra_length = owned_by.is_preference_enabled(/datum/client_preference/runechat_long_messages)
|
||||
var/maxlen = extra_length ? CHAT_MESSAGE_EXT_LENGTH : CHAT_MESSAGE_LENGTH
|
||||
@@ -217,6 +216,10 @@ var/list/runechat_image_cache = list()
|
||||
spawn(lifespan - CHAT_MESSAGE_EOL_FADE)
|
||||
end_of_life()
|
||||
|
||||
/datum/chatmessage/proc/unregister_qdel_self() // this should only call owned_by if the client is destroyed
|
||||
UnregisterSignal(owned_by, COMSIG_PARENT_QDELETING)
|
||||
owned_by = null
|
||||
qdel_self()
|
||||
/**
|
||||
* Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion
|
||||
*/
|
||||
|
||||
@@ -424,6 +424,7 @@
|
||||
for(var/obj/item/W in items)
|
||||
if(islist(W.possessed_voice)) //CHOMPAdd
|
||||
W.forceMove(get_turf(src)) //CHOMPAdd - this crashes the MC, so now they get spat back out.
|
||||
items -= W
|
||||
continue //CHOMPAdd
|
||||
//VOREStation Addition Start
|
||||
if(istype(W, /obj/item/device/pda))
|
||||
@@ -477,6 +478,9 @@
|
||||
SStranscore.leave_round(to_despawn)
|
||||
//VOREStation Edit End - Resleeving.
|
||||
|
||||
// Everything below should only be applicable to a cliented living/carbon/human.
|
||||
// All living/carbon/humans should have minds.
|
||||
|
||||
//Handle job slot/tater cleanup.
|
||||
var/job = to_despawn.mind.assigned_role
|
||||
job_master.FreeRole(job)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
if(message)
|
||||
audible_message("[icon2html(src, user.client)] \The [src.name] states, \"[message]\"", runemessage = "synthesized speech")
|
||||
if(ismob(loc))
|
||||
loc.audible_message("", runemessage = "\[TTS Voice\] [message]")
|
||||
loc.runechat_message("\[TTS Voice\] [message]")
|
||||
|
||||
/obj/item/device/text_to_speech/AltClick(mob/user) // QOL Change
|
||||
attack_self(user)
|
||||
|
||||
@@ -273,6 +273,18 @@
|
||||
//DISCONNECT//
|
||||
//////////////
|
||||
/client/Del()
|
||||
if(!gc_destroyed)
|
||||
gc_destroyed = world.time
|
||||
if (!QDELING(src))
|
||||
stack_trace("Client does not purport to be QDELING, this is going to cause bugs in other places!")
|
||||
|
||||
// Yes this is the same as what's found in qdel(). Yes it does need to be here
|
||||
// Get off my back
|
||||
SEND_SIGNAL(src, COMSIG_PARENT_QDELETING, TRUE)
|
||||
Destroy() //Clean up signals and timers.
|
||||
return ..()
|
||||
|
||||
/client/Destroy()
|
||||
if(holder)
|
||||
holder.owner = null
|
||||
GLOB.admins -= src
|
||||
@@ -282,9 +294,7 @@
|
||||
GLOB.tickets.ClientLogout(src) // CHOMPedit - Tickets System
|
||||
GLOB.directory -= ckey
|
||||
GLOB.clients -= src
|
||||
return ..()
|
||||
|
||||
/client/Destroy()
|
||||
..()
|
||||
return QDEL_HINT_HARDDEL_NOW
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
|
||||
for(var/BP in mark_datum.body_parts)
|
||||
var/obj/item/organ/external/O = character.organs_by_name[BP]
|
||||
if(O)
|
||||
if(O && islist(O.markings) && islist(pref.body_markings[M]))
|
||||
O.markings[M] = list("color" = pref.body_markings[M][BP]["color"], "datum" = mark_datum, "priority" = priority, "on" = pref.body_markings[M][BP]["on"])
|
||||
character.markings_len = priority
|
||||
|
||||
|
||||
@@ -122,6 +122,8 @@ I think I covered everything.
|
||||
var/small_icon = 'icons/mob/bigdragon_small.dmi'
|
||||
var/small_icon_state = "dragon_small"
|
||||
var/flames
|
||||
var/firebreathtimer
|
||||
var/chargetimer
|
||||
|
||||
tame_items = list(
|
||||
/obj/item/weapon/coin/gold = 100,
|
||||
@@ -262,6 +264,10 @@ I think I covered everything.
|
||||
/mob/living/simple_mob/vore/bigdragon/runechat_y_offset(width, height)
|
||||
return (..()*size_multiplier) + 40
|
||||
|
||||
/mob/living/simple_mob/vore/bigdragon/death()
|
||||
. = ..()
|
||||
canceltimers()
|
||||
|
||||
///
|
||||
/// Verbs
|
||||
///
|
||||
@@ -776,10 +782,14 @@ I think I covered everything.
|
||||
|
||||
do_windup_animation(A, charge_warmup)
|
||||
//callbacks are more reliable than byond's process scheduler
|
||||
addtimer(CALLBACK(src, PROC_REF(chargeend), A), charge_warmup)
|
||||
chargetimer = addtimer(CALLBACK(src, PROC_REF(chargeend), A), charge_warmup, TIMER_STOPPABLE)
|
||||
|
||||
|
||||
/mob/living/simple_mob/vore/bigdragon/proc/chargeend(var/atom/A, var/explicit = 0, var/gentle = 0)
|
||||
//make sure our target still exists and is on a turf
|
||||
if(QDELETED(A) || !isturf(get_turf(A)))
|
||||
set_AI_busy(FALSE)
|
||||
return
|
||||
status_flags |= LEAPING
|
||||
flying = 1 //So we can thunk into things
|
||||
hovering = 1 // So we don't hurt ourselves running off cliffs
|
||||
@@ -814,10 +824,14 @@ I think I covered everything.
|
||||
set_AI_busy(TRUE)
|
||||
flames = 1
|
||||
build_icons()
|
||||
addtimer(CALLBACK(src, PROC_REF(firebreathend), A), charge_warmup)
|
||||
firebreathtimer = addtimer(CALLBACK(src, PROC_REF(firebreathend), A), charge_warmup, TIMER_STOPPABLE)
|
||||
playsound(src, "sound/magic/Fireball.ogg", 50, 1)
|
||||
|
||||
/mob/living/simple_mob/vore/bigdragon/proc/firebreathend(var/atom/A)
|
||||
//make sure our target still exists and is on a turf
|
||||
if(QDELETED(A) || !isturf(get_turf(A)))
|
||||
set_AI_busy(FALSE)
|
||||
return
|
||||
var/obj/item/projectile/P = new /obj/item/projectile/bullet/dragon(get_turf(src))
|
||||
src.visible_message("<span class='danger'>\The [src] spews fire at \the [A]!</span>")
|
||||
playsound(src, "sound/weapons/Flamer.ogg", 50, 1)
|
||||
@@ -901,6 +915,9 @@ I think I covered everything.
|
||||
vore_selected = gut2 //Just incase it eats someone right after being tamed
|
||||
ai_holder = new /datum/ai_holder/simple_mob/healbelly/retaliate/dragon(src)
|
||||
|
||||
//Cancel any charges or firebreaths winding up
|
||||
canceltimers()
|
||||
|
||||
/datum/ai_holder/simple_mob/healbelly
|
||||
intelligence_level = 3
|
||||
can_breakthrough = 0
|
||||
@@ -1043,6 +1060,17 @@ I think I covered everything.
|
||||
vore_selected = gut1
|
||||
D.give_target(attacker)
|
||||
|
||||
/mob/living/simple_mob/vore/bigdragon/proc/canceltimers()
|
||||
//Cancel any charges or firebreaths winding up
|
||||
if(firebreathtimer)
|
||||
deltimer(firebreathtimer)
|
||||
firebreathtimer = null
|
||||
if(chargetimer)
|
||||
deltimer(chargetimer)
|
||||
chargetimer = null
|
||||
//re-enable the AI
|
||||
set_AI_busy(FALSE)
|
||||
|
||||
//Smack people it warns
|
||||
/datum/ai_holder/simple_mob/healbelly/retaliate/dragon/proc/dissuade(var/chump)
|
||||
if(chump in check_trajectory(chump, holder, pass_flags = PASSTABLE))
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
previewing_belly = null // from code/modules/vore/eating/mob_ch.dm
|
||||
vore_selected = null // from code/modules/vore/eating/mob_vr
|
||||
|
||||
focus = null
|
||||
|
||||
if(mind)
|
||||
if(mind.current == src)
|
||||
@@ -1224,19 +1224,22 @@
|
||||
return 0
|
||||
|
||||
//Exploitable Info Update
|
||||
/obj
|
||||
var/datum/weakref/exploit_for //if this obj is an exploit for somebody, this points to them
|
||||
|
||||
/mob/proc/amend_exploitable(var/obj/item/I)
|
||||
if(istype(I))
|
||||
exploit_addons |= I
|
||||
var/exploitmsg = html_decode("\n" + "Has " + I.name + ".")
|
||||
exploit_record += exploitmsg
|
||||
I.exploit_for = WEAKREF(src)
|
||||
|
||||
|
||||
/obj/Destroy()
|
||||
if(istype(src.loc, /mob))
|
||||
var/mob/holder = src.loc
|
||||
if(src in holder.exploit_addons)
|
||||
holder.exploit_addons -= src
|
||||
if(exploit_for)
|
||||
var/mob/exploited = exploit_for.resolve()
|
||||
exploited?.exploit_addons -= src
|
||||
exploit_for = null
|
||||
. = ..()
|
||||
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@
|
||||
/datum/reagent/acid/touch_obj(var/obj/O, var/amount) //CHOMPEdit Start
|
||||
if(istype(O, /obj/item) && O.loc)
|
||||
if(isbelly(O.loc) || isbelly(O.loc.loc))
|
||||
var/obj/belly/B = O.loc
|
||||
var/obj/belly/B = (isbelly(O.loc) ? O.loc : O.loc.loc)
|
||||
if(B.item_digest_mode == IM_HOLD)
|
||||
return
|
||||
var/obj/item/I = O
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
* return bool - TRUE if a new pooled window is opened, FALSE in all other situations including if a new pooled window didn't open because one already exists.
|
||||
*/
|
||||
/datum/tgui/proc/open()
|
||||
if(!user.client)
|
||||
if(!user?.client)
|
||||
return FALSE
|
||||
if(window)
|
||||
return FALSE
|
||||
@@ -214,7 +214,7 @@
|
||||
* optional force bool Send an update even if UI is not interactive.
|
||||
*/
|
||||
/datum/tgui/proc/send_full_update(custom_data, force)
|
||||
if(!user.client || !initialized || closing)
|
||||
if(!user?.client || !initialized || closing)
|
||||
return
|
||||
//if(!COOLDOWN_FINISHED(src, refresh_cooldown))
|
||||
//refreshing = TRUE
|
||||
|
||||
@@ -596,6 +596,8 @@
|
||||
// Called whenever an atom leaves this belly
|
||||
/obj/belly/Exited(atom/movable/thing, atom/OldLoc)
|
||||
. = ..()
|
||||
if(QDELETED(owner))
|
||||
return
|
||||
thing.exit_belly(src) // CHOMPEdit - atom movable proc, does nothing by default. Overridden in children for special behavior.
|
||||
if(isbelly(thing.loc)) //CHOMPEdit Start
|
||||
var/obj/belly/NB = thing.loc
|
||||
|
||||
Reference in New Issue
Block a user