bunch of code optimizations

This commit is contained in:
SandPoot
2022-09-08 03:02:06 -03:00
parent 2f92e8e4ca
commit 2ed861f2d7
8 changed files with 23 additions and 51 deletions
@@ -31,27 +31,23 @@
/mob/living/proc/pregoodbye(C)
if(isanimal(C))
var/mob/living/simple_animal/D = C
D.AIStatus = AI_OFF
Immobilize(1000, TRUE, TRUE)// currently the only ways of
next_action_immediate = 10000000000 // completely freezing someone as i know
D.toggle_ai(AI_OFF)
AllImmobility(900, TRUE, TRUE) // Complete 15 minutes of stun, hopefully they shouldn't take that long
playsound(C, "modular_sand/sound/effects/admin_punish/changetheworld.ogg", 100, FALSE)
say("Change the world")
sleep(20)
stoplag(20)
playsound(C, "modular_sand/sound/effects/admin_punish/myfinalmessage.ogg", 100, FALSE)
say("My final message")
sleep(20)
stoplag(20)
playsound(C, "modular_sand/sound/effects/admin_punish/goodbye.ogg", 100, FALSE)
say("Goodbye.")
sleep(20)
stoplag(20)
playsound(C, "modular_sand/sound/effects/admin_punish/endjingle.ogg", 100, FALSE)
goodbye()
/mob/living/proc/goodbye() //this must be separate because it's a loop!
if(alpha <= 10)
sleep(2)
ghostize()
Destroy()
else
while(alpha >= 10)
alpha = alpha - 7
sleep(1)
goodbye()
stoplag(1)
stoplag(2)
Destroy()
@@ -1,11 +1,7 @@
var/static/mutable_appearance/combat_indicator
/mob/living/proc/set_combat_indicator(var/state)
if(!combat_indicator)
combat_indicator = mutable_appearance('modular_sand/icons/mob/combat_indicator.dmi', "combat", FLY_LAYER)
combat_indicator.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA | KEEP_APART
GLOBAL_DATUM_INIT(combat_indicator, /mutable_appearance, mutable_appearance('modular_sand/icons/mob/combat_indicator.dmi', "combat", FLY_LAYER, appearance_flags = APPEARANCE_UI_IGNORE_ALPHA | KEEP_APART))
/mob/living/proc/set_combat_indicator(state)
if(state && stat != DEAD)
add_overlay(combat_indicator)
add_overlay(GLOB.combat_indicator)
else
cut_overlay(combat_indicator)
cut_overlay(GLOB.combat_indicator)
@@ -1,4 +1,5 @@
/mob/living
var/lastclienttime = 0
var/size_multiplier = RESIZE_NORMAL
/// Returns false on failure
@@ -4,12 +4,12 @@
pull_cursor_icon = null
throw_cursor_icon = null
/mob/living/silicon/verb/robot_nom(var/mob/living/T in oview(1))
/mob/living/silicon/verb/robot_nom(mob/living/T in oview(1))
set name = "Eat Mob"
set category = "Vore"
set desc = "Allows you to eat someone."
if(!CHECK_BITFIELD(T.vore_flags,DEVOURABLE))
if(!CHECK_BITFIELD(T.vore_flags, DEVOURABLE))
to_chat(src, "<span class='warning'>System error: Unauthorized operation.</span>")
return
return feed_grabbed_to_self(src,T)
@@ -1,17 +1,13 @@
/mob/living/var/lastclienttime = 0
var/static/mutable_appearance/ssd_indicator
/mob/living/proc/set_ssd_indicator(var/state)
if(!ssd_indicator)
ssd_indicator = mutable_appearance('modular_sand/icons/mob/ssd_indicator.dmi', "default0", FLY_LAYER)
GLOBAL_DATUM_INIT(ssd_indicator, /mutable_appearance, mutable_appearance('modular_sand/icons/mob/ssd_indicator.dmi', "default0", FLY_LAYER))
/mob/living/proc/set_ssd_indicator(state)
if(state && stat != DEAD)
add_overlay(ssd_indicator)
add_overlay(GLOB.ssd_indicator)
else
cut_overlay(ssd_indicator)
cut_overlay(GLOB.ssd_indicator)
return state
//This proc should stop mobs from having the overlay when someone keeps jumping control of mobs, unfortunately it causes Aghosts to have their character without the SSD overlay, I wasn't able to find a better proc unfortunately
/mob/living/transfer_ckey(mob/new_mob, send_signal = TRUE)
..()
/mob/living/transfer_ckey(mob/new_mob, send_signal)
. = ..()
set_ssd_indicator(FALSE)
@@ -1,4 +1,4 @@
/mob/living/silicon/
/mob/living/silicon
typing_indicator_state = /obj/effect/overlay/typing_indicator/machine
/obj/effect/overlay/typing_indicator/machine
-16
View File
@@ -1,16 +0,0 @@
/proc/animate_speechbubble(image/I, list/show_to, duration)
var/matrix/M = matrix()
M.Scale(0,0)
I.transform = M
I.alpha = 0
for(var/client/C in show_to)
C.images += I
animate(I, transform = 0, alpha = 255, time = 5, easing = ELASTIC_EASING)
spawn(duration-5)
animate(I, alpha = 0, time = 5, easing = EASE_IN)
spawn(20)
for(var/client/C in show_to)
C.images -= I
/mob/proc/terror_spider_check()
return FALSE
-1
View File
@@ -4081,7 +4081,6 @@
#include "modular_sand\code\modules\mob\emote.dm"
#include "modular_sand\code\modules\mob\mob.dm"
#include "modular_sand\code\modules\mob\mob_defines.dm"
#include "modular_sand\code\modules\mob\say.dm"
#include "modular_sand\code\modules\mob\dead\new_player\sprite_accessories\antenna.dm"
#include "modular_sand\code\modules\mob\dead\new_player\sprite_accessories\body_markings.dm"
#include "modular_sand\code\modules\mob\dead\new_player\sprite_accessories\ears.dm"