mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
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:
@@ -86,7 +86,7 @@ GLOBAL_LIST_EMPTY(splatter_cache)
|
||||
user.blood_DNA |= blood_DNA.Copy()
|
||||
user.bloody_hands += taken
|
||||
user.hand_blood_color = basecolor
|
||||
user.update_inv_gloves(1)
|
||||
user.update_inv_gloves()
|
||||
user.verbs += /mob/living/carbon/human/proc/bloody_doodle
|
||||
|
||||
/obj/effect/decal/cleanable/blood/can_bloodcrawl_in()
|
||||
|
||||
@@ -54,21 +54,21 @@
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/item/camera_bug/check_eye(var/mob/user as mob)
|
||||
if(user.stat || loc != user || !user.canmove || !user.has_vision() || !current)
|
||||
user.reset_perspective(null)
|
||||
/obj/item/camera_bug/check_eye(mob/user)
|
||||
if(loc != user || user.incapacitated() || !user.has_vision() || !current)
|
||||
user.unset_machine()
|
||||
return null
|
||||
|
||||
var/turf/T = get_turf(user.loc)
|
||||
if(T.z != current.z || !current.can_use())
|
||||
return FALSE
|
||||
var/turf/T_user = get_turf(user.loc)
|
||||
var/turf/T_current = get_turf(current)
|
||||
if(!atoms_share_level(T_user, T_current) || !current.can_use())
|
||||
to_chat(user, "<span class='danger'>[src] has lost the signal.</span>")
|
||||
current = null
|
||||
user.reset_perspective(null)
|
||||
user.unset_machine()
|
||||
return null
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
return 1
|
||||
/obj/item/camera_bug/on_unset_machine(mob/user)
|
||||
user.reset_perspective(null)
|
||||
|
||||
/obj/item/camera_bug/proc/get_cameras()
|
||||
if(world.time > (last_net_update + 100))
|
||||
@@ -182,7 +182,6 @@
|
||||
/obj/item/camera_bug/Topic(var/href,var/list/href_list)
|
||||
if(usr != loc)
|
||||
usr.unset_machine()
|
||||
usr.reset_perspective(null)
|
||||
usr << browse(null, "window=camerabug")
|
||||
return
|
||||
usr.set_machine(src)
|
||||
@@ -233,7 +232,6 @@
|
||||
interact()
|
||||
else
|
||||
usr.unset_machine()
|
||||
usr.reset_perspective(null)
|
||||
usr << browse(null, "window=camerabug")
|
||||
return
|
||||
else
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
new G(T) //Spawns the switch-selected engine on the chosen beacon's turf
|
||||
|
||||
var/ailist[] = list()
|
||||
for(var/mob/living/silicon/ai/A in GLOB.living_mob_list)
|
||||
for(var/mob/living/silicon/ai/A in GLOB.alive_mob_list)
|
||||
ailist += A
|
||||
if(ailist.len)
|
||||
var/mob/living/silicon/ai/announcer = pick(ailist)
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
if(istype(H)) //robots and aliens are unaffected
|
||||
var/obj/item/organ/internal/eyes/eyes = H.get_int_organ(/obj/item/organ/internal/eyes)
|
||||
if(M.stat == DEAD || !eyes || M.disabilities & BLIND) //mob is dead or fully blind
|
||||
if(M.stat == DEAD || !eyes || (BLINDNESS in M.mutations)) //mob is dead or fully blind
|
||||
to_chat(user, "<span class='notice'>[M]'s pupils are unresponsive to the light!</span>")
|
||||
else if((XRAY in M.mutations) || eyes.see_in_dark >= 8) //The mob's either got the X-RAY vision or has a tapetum lucidum (extreme nightvision, i.e. Vulp/Tajara with COLOURBLIND & their monkey forms).
|
||||
to_chat(user, "<span class='notice'>[M]'s pupils glow eerily!</span>")
|
||||
|
||||
@@ -859,11 +859,11 @@ REAGENT SCANNER
|
||||
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>[infection]:[mech]</td><td></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
if(target.disabilities & BLIND)
|
||||
if(BLINDNESS in target.mutations)
|
||||
dat += "<font color='red'>Cataracts detected.</font><BR>"
|
||||
if(target.disabilities & COLOURBLIND)
|
||||
if(COLOURBLIND in target.mutations)
|
||||
dat += "<font color='red'>Photoreceptor abnormalities detected.</font><BR>"
|
||||
if(target.disabilities & NEARSIGHTED)
|
||||
if(NEARSIGHTED in target.mutations)
|
||||
dat += "<font color='red'>Retinal misalignment detected.</font><BR>"
|
||||
|
||||
return dat
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
R.stat = CONSCIOUS
|
||||
GLOB.dead_mob_list -= R //please never forget this ever kthx
|
||||
GLOB.living_mob_list += R
|
||||
GLOB.alive_mob_list += R
|
||||
R.notify_ai(1)
|
||||
|
||||
return 1
|
||||
|
||||
@@ -360,7 +360,7 @@ LIGHTERS ARE IN LIGHTERS.DM
|
||||
lit = FALSE
|
||||
icon_state = icon_off
|
||||
item_state = icon_off
|
||||
M.update_inv_wear_mask(0)
|
||||
M.update_inv_wear_mask()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return
|
||||
smoke()
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
scramble(1, H, 100)
|
||||
H.real_name = random_name(H.gender, H.dna.species.name) //Give them a name that makes sense for their species.
|
||||
H.sync_organ_dna(assimilate = 1)
|
||||
H.update_body(0)
|
||||
H.update_body()
|
||||
H.reset_hair() //No more winding up with hairstyles you're not supposed to have, and blowing your cover.
|
||||
H.reset_markings() //...Or markings.
|
||||
H.dna.ResetUIFrom(H)
|
||||
|
||||
@@ -49,8 +49,7 @@
|
||||
to_chat(user, "<span class='notice'>You cut open the present.</span>")
|
||||
|
||||
for(var/mob/M in src) //Should only be one but whatever.
|
||||
M.loc = src.loc
|
||||
M.reset_perspective(null)
|
||||
M.forceMove(loc)
|
||||
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
return BRUTELOSS|FIRELOSS
|
||||
|
||||
/obj/item/melee/energy/attack_self(mob/living/carbon/user)
|
||||
if(user.disabilities & CLUMSY && prob(50))
|
||||
if((CLUMSY in user.mutations) && prob(50))
|
||||
to_chat(user, "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>")
|
||||
user.take_organ_damage(5,5)
|
||||
active = !active
|
||||
@@ -290,7 +290,7 @@
|
||||
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.disabilities & CLUMSY && prob(50))
|
||||
if((CLUMSY in H.mutations) && prob(50))
|
||||
to_chat(H, "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>")
|
||||
H.take_organ_damage(10,10)
|
||||
active = !active
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
return (active)
|
||||
|
||||
/obj/item/shield/energy/attack_self(mob/living/carbon/human/user)
|
||||
if(user.disabilities & CLUMSY && prob(50))
|
||||
if((CLUMSY in user.mutations) && prob(50))
|
||||
to_chat(user, "<span class='warning'>You beat yourself in the head with [src].</span>")
|
||||
user.take_organ_damage(5)
|
||||
active = !active
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
L.buckled = 0
|
||||
L.anchored = 0
|
||||
L.forceMove(src)
|
||||
L.disabilities += MUTE
|
||||
L.mutations |= MUTE
|
||||
max_integrity = L.health + 100 //stoning damaged mobs will result in easier to shatter statues
|
||||
intialTox = L.getToxLoss()
|
||||
intialFire = L.getFireLoss()
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
for(var/mob/living/M in src)
|
||||
M.forceMove(loc)
|
||||
M.disabilities -= MUTE
|
||||
M.mutations -= MUTE
|
||||
M.take_overall_damage((M.health - obj_integrity - 100),0) //any new damage the statue incurred is transfered to the mob
|
||||
|
||||
..()
|
||||
|
||||
@@ -144,9 +144,7 @@
|
||||
if(istype(mob, /mob) && mob.client)
|
||||
// If the pod is not in a tube at all, you can get out at any time.
|
||||
if(!(locate(/obj/structure/transit_tube) in loc))
|
||||
mob.loc = loc
|
||||
mob.client.Move(get_step(loc, direction), direction)
|
||||
mob.reset_perspective(null)
|
||||
mob.forceMove(loc)
|
||||
|
||||
//if(moving && istype(loc, /turf/space))
|
||||
// Todo: If you get out of a moving pod in space, you should move as well.
|
||||
@@ -158,9 +156,7 @@
|
||||
if(!station.pod_moving)
|
||||
if(direction == station.dir)
|
||||
if(station.icon_state == "open")
|
||||
mob.loc = loc
|
||||
mob.client.Move(get_step(loc, direction), direction)
|
||||
mob.reset_perspective(null)
|
||||
mob.forceMove(loc)
|
||||
|
||||
else
|
||||
station.open_animation()
|
||||
|
||||
@@ -411,7 +411,7 @@
|
||||
M.l_hand.clean_blood()
|
||||
if(M.back)
|
||||
if(M.back.clean_blood())
|
||||
M.update_inv_back(0)
|
||||
M.update_inv_back()
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/washgloves = 1
|
||||
@@ -437,38 +437,38 @@
|
||||
|
||||
if(H.head)
|
||||
if(H.head.clean_blood())
|
||||
H.update_inv_head(0,0)
|
||||
H.update_inv_head()
|
||||
if(H.wear_suit)
|
||||
if(H.wear_suit.clean_blood())
|
||||
H.update_inv_wear_suit(0,0)
|
||||
H.update_inv_wear_suit()
|
||||
else if(H.w_uniform)
|
||||
if(H.w_uniform.clean_blood())
|
||||
H.update_inv_w_uniform(0,0)
|
||||
H.update_inv_w_uniform()
|
||||
if(H.gloves && washgloves)
|
||||
if(H.gloves.clean_blood())
|
||||
H.update_inv_gloves(0,0)
|
||||
H.update_inv_gloves()
|
||||
if(H.shoes && washshoes)
|
||||
if(H.shoes.clean_blood())
|
||||
H.update_inv_shoes(0,0)
|
||||
H.update_inv_shoes()
|
||||
if(H.wear_mask && washmask)
|
||||
if(H.wear_mask.clean_blood())
|
||||
H.update_inv_wear_mask(0)
|
||||
H.update_inv_wear_mask()
|
||||
if(H.glasses && washglasses)
|
||||
if(H.glasses.clean_blood())
|
||||
H.update_inv_glasses(0)
|
||||
H.update_inv_glasses()
|
||||
if(H.l_ear && washears)
|
||||
if(H.l_ear.clean_blood())
|
||||
H.update_inv_ears(0)
|
||||
H.update_inv_ears()
|
||||
if(H.r_ear && washears)
|
||||
if(H.r_ear.clean_blood())
|
||||
H.update_inv_ears(0)
|
||||
H.update_inv_ears()
|
||||
if(H.belt)
|
||||
if(H.belt.clean_blood())
|
||||
H.update_inv_belt(0)
|
||||
H.update_inv_belt()
|
||||
else
|
||||
if(M.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags
|
||||
if(M.wear_mask.clean_blood())
|
||||
M.update_inv_wear_mask(0)
|
||||
M.update_inv_wear_mask()
|
||||
|
||||
else
|
||||
O.clean_blood()
|
||||
|
||||
Reference in New Issue
Block a user