VS: Refactor move code

This commit is contained in:
Aronai Sieyes
2020-04-26 16:44:08 -04:00
parent d3da6ae4a5
commit 36022c95f1
4 changed files with 49 additions and 53 deletions

View File

@@ -33,6 +33,7 @@
touching.clear_reagents() touching.clear_reagents()
..() ..()
/* VOREStation Edit - Duplicated in our code
/mob/living/carbon/Moved(atom/old_loc, direction, forced = FALSE) /mob/living/carbon/Moved(atom/old_loc, direction, forced = FALSE)
. = ..() . = ..()
if(src.nutrition && src.stat != 2) if(src.nutrition && src.stat != 2)
@@ -42,10 +43,10 @@
if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360) if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360)
src.bodytemperature += 2 src.bodytemperature += 2
// Moving around increases germ_level faster // Moving around increases germ_level faster
if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8)) if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8))
germ_level++ germ_level++
/* VOREStation Removal - Needless duplicate feature
/mob/living/carbon/relaymove(var/mob/living/user, direction) /mob/living/carbon/relaymove(var/mob/living/user, direction)
if((user in src.stomach_contents) && istype(user)) if((user in src.stomach_contents) && istype(user))
if(user.last_special <= world.time) if(user.last_special <= world.time)

View File

@@ -58,22 +58,21 @@
nif.life() nif.life()
//Overriding carbon move proc that forces default hunger factor //Overriding carbon move proc that forces default hunger factor
/mob/living/carbon/Move(NewLoc, direct) /mob/living/carbon/Moved(atom/old_loc, direction, forced = FALSE)
. = ..() . = ..()
if(.) if(src.nutrition && src.stat != 2)
if(src.nutrition && src.stat != 2) if(ishuman(src))
if(ishuman(src)) var/mob/living/carbon/human/M = src
var/mob/living/carbon/human/M = src if(M.stat != 2 && M.nutrition > 0)
if(M.stat != 2 && M.nutrition > 0) M.nutrition -= M.species.hunger_factor/10
if(M.m_intent == "run")
M.nutrition -= M.species.hunger_factor/10 M.nutrition -= M.species.hunger_factor/10
if(M.m_intent == "run") if(M.nutrition < 0)
M.nutrition -= M.species.hunger_factor/10 M.nutrition = 0
if(M.nutrition < 0) else
M.nutrition = 0 src.nutrition -= DEFAULT_HUNGER_FACTOR/10
else if(src.m_intent == "run")
src.nutrition -= DEFAULT_HUNGER_FACTOR/10 src.nutrition -= DEFAULT_HUNGER_FACTOR/10
if(src.m_intent == "run") // Moving around increases germ_level faster
src.nutrition -= DEFAULT_HUNGER_FACTOR/10 if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8))
// Moving around increases germ_level faster germ_level++
if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8))
germ_level++

View File

@@ -109,39 +109,35 @@
icon_state = "[module_sprites[icontype]]-wreck" icon_state = "[module_sprites[icontype]]-wreck"
add_overlay("wreck-overlay") add_overlay("wreck-overlay")
/mob/living/silicon/robot/Move(a, b, flag) /mob/living/silicon/robot/Moved(atom/old_loc, direction, forced = FALSE)
. = ..() . = ..()
if(scrubbing) if(scrubbing && isturf(loc) && water_res?.energy >= 1)
var/datum/matter_synth/water = water_res var/turf/tile = loc
if(water && water.energy >= 1) water_res.use_charge(1)
var/turf/tile = loc tile.clean_blood()
if(isturf(tile)) if(istype(tile, /turf/simulated))
water.use_charge(1) var/turf/simulated/T = tile
tile.clean_blood() T.dirt = 0
if(istype(tile, /turf/simulated)) for(var/A in tile)
var/turf/simulated/T = tile if(istype(A,/obj/effect/rune) || istype(A,/obj/effect/decal/cleanable) || istype(A,/obj/effect/overlay))
T.dirt = 0 qdel(A)
for(var/A in tile) else if(istype(A, /mob/living/carbon/human))
if(istype(A,/obj/effect/rune) || istype(A,/obj/effect/decal/cleanable) || istype(A,/obj/effect/overlay)) var/mob/living/carbon/human/cleaned_human = A
qdel(A) if(cleaned_human.lying)
else if(istype(A, /mob/living/carbon/human)) if(cleaned_human.head)
var/mob/living/carbon/human/cleaned_human = A cleaned_human.head.clean_blood()
if(cleaned_human.lying) cleaned_human.update_inv_head(0)
if(cleaned_human.head) if(cleaned_human.wear_suit)
cleaned_human.head.clean_blood() cleaned_human.wear_suit.clean_blood()
cleaned_human.update_inv_head(0) cleaned_human.update_inv_wear_suit(0)
if(cleaned_human.wear_suit) else if(cleaned_human.w_uniform)
cleaned_human.wear_suit.clean_blood() cleaned_human.w_uniform.clean_blood()
cleaned_human.update_inv_wear_suit(0) cleaned_human.update_inv_w_uniform(0)
else if(cleaned_human.w_uniform) if(cleaned_human.shoes)
cleaned_human.w_uniform.clean_blood() cleaned_human.shoes.clean_blood()
cleaned_human.update_inv_w_uniform(0) cleaned_human.update_inv_shoes(0)
if(cleaned_human.shoes) cleaned_human.clean_blood(1)
cleaned_human.shoes.clean_blood() to_chat(cleaned_human, "<span class='warning'>[src] cleans your face!</span>")
cleaned_human.update_inv_shoes(0)
cleaned_human.clean_blood(1)
to_chat(cleaned_human, "<span class='warning'>[src] cleans your face!</span>")
return
/mob/living/silicon/robot/proc/vr_sprite_check() /mob/living/silicon/robot/proc/vr_sprite_check()
if(wideborg == TRUE) if(wideborg == TRUE)

View File

@@ -48,7 +48,7 @@ GLOBAL_LIST_EMPTY(gravity_generators)
return "off" return "off"
// You aren't allowed to move. // You aren't allowed to move.
/obj/machinery/gravity_generator/Move() /obj/machinery/gravity_generator/Moved(atom/old_loc, direction, forced = FALSE)
. = ..() . = ..()
qdel(src) qdel(src)