Life refactor (#13471)

* Life Refactor WIP

* part 2

* part 3

* runtime fix

* newlines

* tweaks

* perspective checks

* fixes

* remote view tweaks

* more fixes

* robot fixes

* better updating

* cleaned up icon procs

* less proc call overhead

* performance gains

* more optimization

* shorter lists, removal of unecesary code

* gene OOP and dna styling cleanup

* oops

* axe disabilities

* typeless loop

* various tweaks and fixes

* brain checks

* runtime fixes

* cryo vision fixes
This commit is contained in:
Fox McCloud
2020-06-03 19:43:30 -06:00
committed by GitHub
parent 5d824a9c62
commit 70b46d8aea
183 changed files with 1943 additions and 2286 deletions
+1 -1
View File
@@ -396,7 +396,7 @@ GLOBAL_LIST_INIT(advance_cures, list(
for(var/datum/disease/advance/AD in GLOB.active_diseases)
AD.Refresh()
for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list))
for(var/mob/living/carbon/human/H in shuffle(GLOB.alive_mob_list))
if(!is_station_level(H.z))
continue
if(!H.HasDisease(D))
@@ -33,7 +33,7 @@ Bonus
if(3, 4)
to_chat(M, "<span class='warning'>[pick("You hear a ringing in your ear.", "Your ears pop.")]</span>")
if(5)
if(!(M.disabilities & DEAF))
if(!(DEAF in M.mutations))
to_chat(M, "<span class='userdanger'>Your ears pop and begin ringing loudly!</span>")
M.BecomeDeaf()
spawn(200)
@@ -35,7 +35,7 @@ BONUS
switch(A.stage)
if(5)
H.s_tone = -85
H.update_body(0)
H.update_body()
else
H.visible_message("<span class='warning'>[H] looks a bit pale...</span>", "<span class='notice'>Your skin suddenly appears lighter...</span>")
@@ -79,7 +79,7 @@ BONUS
switch(A.stage)
if(5)
H.s_tone = 85
H.update_body(0)
H.update_body()
else
H.visible_message("<span class='warning'>[H] looks a bit dark...</span>", "<span class='notice'>Your skin suddenly appears darker...</span>")
-1
View File
@@ -148,7 +148,6 @@
eye.eye_user = user
eye.name = "Camera Eye ([user.name])"
user.remote_control = eye
user.remote_view = 1
user.reset_perspective(eye)
eye.setLoc(get_turf(H))
+2 -2
View File
@@ -1688,7 +1688,7 @@
if(H.w_uniform)
jumpsuit = H.w_uniform
jumpsuit.color = team_color
H.update_inv_w_uniform(0,0)
H.update_inv_w_uniform()
add_attack_logs(missionary, current, "Converted to a zealot for [convert_duration/600] minutes")
addtimer(CALLBACK(src, .proc/remove_zealot, jumpsuit), convert_duration) //deconverts after the timer expires
@@ -1705,7 +1705,7 @@
jumpsuit.color = initial(jumpsuit.color) //reset the jumpsuit no matter where our mind is
if(ishuman(current)) //but only try updating us if we are still a human type since it is a human proc
var/mob/living/carbon/human/H = current
H.update_inv_w_uniform(0,0)
H.update_inv_w_uniform()
to_chat(current, "<span class='warning'><b>You seem to have forgotten the events of the past 10 minutes or so, and your head aches a bit as if someone beat it savagely with a stick.</b></span>")
to_chat(current, "<span class='warning'><b>This means you don't remember who you were working for or what you were doing.</b></span>")
+6 -6
View File
@@ -36,10 +36,10 @@
unEquip(gloves, 1)
if(!istype(wear_mask, /obj/item/clothing/mask/cursedclown)) //Infinite loops otherwise
unEquip(wear_mask, 1)
equip_to_slot_if_possible(new /obj/item/clothing/under/cursedclown, slot_w_uniform, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/gloves/cursedclown, slot_gloves, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/mask/cursedclown, slot_wear_mask, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/shoes/cursedclown, slot_shoes, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/under/cursedclown, slot_w_uniform, TRUE, TRUE)
equip_to_slot_if_possible(new /obj/item/clothing/gloves/cursedclown, slot_gloves, TRUE, TRUE)
equip_to_slot_if_possible(new /obj/item/clothing/mask/cursedclown, slot_wear_mask, TRUE, TRUE)
equip_to_slot_if_possible(new /obj/item/clothing/shoes/cursedclown, slot_shoes, TRUE, TRUE)
/mob/living/carbon/human/proc/makeAntiCluwne()
to_chat(src, "<span class='danger'>You don't feel very funny.</span>")
@@ -83,5 +83,5 @@
unEquip(gloves, 1)
qdel(G)
equip_to_slot_if_possible(new /obj/item/clothing/under/lawyer/black, slot_w_uniform, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/shoes/black, slot_shoes, 1, 1, 1)
equip_to_slot_if_possible(new /obj/item/clothing/under/lawyer/black, slot_w_uniform, TRUE, TRUE)
equip_to_slot_if_possible(new /obj/item/clothing/shoes/black, slot_shoes, TRUE, TRUE)
-1
View File
@@ -142,7 +142,6 @@
return 0
fakefire()
forceMove(get_turf(src))
reset_perspective()
visible_message("<span class='warning'><B>[src] appears in a firey blaze!</B></span>")
playsound(get_turf(src), 'sound/misc/exit_blood.ogg', 100, 1, -1)
spawn(15)
-5
View File
@@ -2,7 +2,6 @@
name = "Genetic"
desc = "This spell inflicts a set of mutations and disabilities upon the target."
var/disabilities = 0 //bits
var/list/mutations = list() //mutation strings
var/duration = 100 //deciseconds
/*
@@ -20,16 +19,12 @@
for(var/mob/living/target in targets)
for(var/x in mutations)
target.mutations.Add(x)
/* if(x == HULK && ishuman(target))
target:hulk_time=world.time + duration */
target.disabilities |= disabilities
target.update_mutations() //update target's mutation overlays
var/mob/living/carbon/human/H = target
if(ishuman(target))
H.update_body()
spawn(duration)
target.mutations.Remove(mutations)
target.disabilities &= ~disabilities
target.update_mutations()
if(ishuman(target))
H.update_body()
+1 -1
View File
@@ -43,6 +43,6 @@
"<span class='danger'>Your face burns up, and shortly after the fire you realise you have the face of a horse!</span>")
if(!target.unEquip(target.wear_mask))
qdel(target.wear_mask)
target.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1)
target.equip_to_slot_if_possible(magichead, slot_wear_mask, TRUE, TRUE)
target.flash_eyes()
+4 -4
View File
@@ -104,12 +104,12 @@
if(target.hand) //left active hand
if(!target.equip_to_slot_if_possible(item_to_retrieve, slot_l_hand, 0, 1, 1))
if(!target.equip_to_slot_if_possible(item_to_retrieve, slot_r_hand, 0, 1, 1))
if(!target.equip_to_slot_if_possible(item_to_retrieve, slot_l_hand, FALSE, TRUE))
if(!target.equip_to_slot_if_possible(item_to_retrieve, slot_r_hand, FALSE, TRUE))
butterfingers = 1
else //right active hand
if(!target.equip_to_slot_if_possible(item_to_retrieve, slot_r_hand, 0, 1, 1))
if(!target.equip_to_slot_if_possible(item_to_retrieve, slot_l_hand, 0, 1, 1))
if(!target.equip_to_slot_if_possible(item_to_retrieve, slot_r_hand, FALSE, TRUE))
if(!target.equip_to_slot_if_possible(item_to_retrieve, slot_l_hand, FALSE, TRUE))
butterfingers = 1
if(butterfingers)
item_to_retrieve.loc = target.loc
+4 -4
View File
@@ -27,12 +27,12 @@
var/hand_handled = 1
attached_hand = new hand_path(src)
if(user.hand) //left active hand
if(!user.equip_to_slot_if_possible(attached_hand, slot_l_hand, 0, 1, 1))
if(!user.equip_to_slot_if_possible(attached_hand, slot_r_hand, 0, 1, 1))
if(!user.equip_to_slot_if_possible(attached_hand, slot_l_hand, FALSE, TRUE))
if(!user.equip_to_slot_if_possible(attached_hand, slot_r_hand, FALSE, TRUE))
hand_handled = 0
else //right active hand
if(!user.equip_to_slot_if_possible(attached_hand, slot_r_hand, 0, 1, 1))
if(!user.equip_to_slot_if_possible(attached_hand, slot_l_hand, 0, 1, 1))
if(!user.equip_to_slot_if_possible(attached_hand, slot_r_hand, FALSE, TRUE))
if(!user.equip_to_slot_if_possible(attached_hand, slot_l_hand, FALSE, TRUE))
hand_handled = 0
if(!hand_handled)
qdel(attached_hand)
+1 -1
View File
@@ -304,7 +304,7 @@
sound = 'sound/magic/blind.ogg'
/obj/effect/proc_holder/spell/targeted/genetic/blind
disabilities = BLIND
mutations = list(BLINDNESS)
duration = 300
sound = 'sound/magic/blind.ogg'
+1 -1
View File
@@ -87,7 +87,7 @@ GLOBAL_LIST_INIT(wireColours, list("red", "blue", "green", "black", "orange", "b
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes)
if(eyes && H.disabilities & COLOURBLIND)
if(eyes && (COLOURBLIND in H.mutations))
replace_colours = eyes.replace_colours