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
+10 -12
View File
@@ -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>")
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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