refactors resist act to be on atom level (#53016)

This commit is contained in:
Qustinnus
2020-08-18 20:30:44 -03:00
committed by GitHub
parent 2bd536a241
commit f54de4a2b8
33 changed files with 45 additions and 45 deletions
+4
View File
@@ -1476,6 +1476,10 @@
/atom/proc/setClosed()
return
///Called when something resists while this atom is its loc
/atom/proc/container_resist_act(mob/living/user)
/**
* Used to attempt to charge an object with a payment component.
*
+1 -1
View File
@@ -776,7 +776,7 @@
. = dense_object_backup
///called when a mob resists while inside a container that is itself inside something.
/atom/movable/proc/relay_container_resist(mob/living/user, obj/O)
/atom/movable/proc/relay_container_resist_act(mob/living/user, obj/O)
return
+3 -3
View File
@@ -59,18 +59,18 @@
else
icon_state = initial(icon_state)
/obj/machinery/sleeper/container_resist(mob/living/user)
/obj/machinery/sleeper/container_resist_act(mob/living/user)
visible_message("<span class='notice'>[occupant] emerges from [src]!</span>",
"<span class='notice'>You climb out of [src]!</span>")
open_machine()
/obj/machinery/sleeper/Exited(atom/movable/user)
if (!state_open && user == occupant)
container_resist(user)
container_resist_act(user)
/obj/machinery/sleeper/relaymove(mob/user)
if (!state_open)
container_resist(user)
container_resist_act(user)
/obj/machinery/sleeper/open_machine()
if(!state_open && !panel_open)
+1 -1
View File
@@ -66,7 +66,7 @@
open_machine()
/obj/machinery/dna_scannernew/container_resist(mob/living/user)
/obj/machinery/dna_scannernew/container_resist_act(mob/living/user)
if(!locked)
open_machine()
return
+1 -1
View File
@@ -68,7 +68,7 @@
stop()
..()
/obj/machinery/fat_sucker/container_resist(mob/living/user)
/obj/machinery/fat_sucker/container_resist_act(mob/living/user)
if(!free_exit || state_open)
to_chat(user, "<span class='notice'>The emergency release is not responding! You start pushing against the hull!</span>")
user.changeNext_move(CLICK_CD_BREAKOUT)
+1 -1
View File
@@ -94,7 +94,7 @@ The console is located at computer/gulag_teleporter.dm
return
open_machine()
/obj/machinery/gulag_teleporter/container_resist(mob/living/user)
/obj/machinery/gulag_teleporter/container_resist_act(mob/living/user)
if(!locked)
open_machine()
return
+3 -3
View File
@@ -168,7 +168,7 @@
allow_living = TRUE
to_chat(user, "<span class='warning'>You overload [src]'s lifesign scanners.</span>")
/obj/machinery/harvester/container_resist(mob/living/user)
/obj/machinery/harvester/container_resist_act(mob/living/user)
if(!harvesting)
visible_message("<span class='notice'>[occupant] emerges from [src]!</span>",
"<span class='notice'>You climb out of [src]!</span>")
@@ -178,11 +178,11 @@
/obj/machinery/harvester/Exited(atom/movable/user)
if (!state_open && user == occupant)
container_resist(user)
container_resist_act(user)
/obj/machinery/harvester/relaymove(mob/user)
if (!state_open)
container_resist(user)
container_resist_act(user)
/obj/machinery/harvester/examine(mob/user)
. = ..()
+1 -1
View File
@@ -175,7 +175,7 @@
else
icon_state += "_occupied"
/obj/machinery/hypnochair/container_resist(mob/living/user)
/obj/machinery/hypnochair/container_resist_act(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
+1 -1
View File
@@ -332,7 +332,7 @@
open_machine()
dump_contents()
/obj/machinery/suit_storage_unit/container_resist(mob/living/user)
/obj/machinery/suit_storage_unit/container_resist_act(mob/living/user)
if(!locked)
open_machine()
dump_contents()
+2 -2
View File
@@ -270,9 +270,9 @@ GLOBAL_LIST_INIT(dye_registry, list(
..()
/obj/machinery/washing_machine/relaymove(mob/user)
container_resist(user)
container_resist_act(user)
/obj/machinery/washing_machine/container_resist(mob/living/user)
/obj/machinery/washing_machine/container_resist_act(mob/living/user)
if(!busy)
add_fingerprint(user)
open_machine()
@@ -210,7 +210,7 @@
return 1
return
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/container_resist(mob/living/user)
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/container_resist_act(mob/living/user)
go_out()
/obj/item/mecha_parts/mecha_equipment/medical/sleeper/process()
+1 -1
View File
@@ -1002,7 +1002,7 @@
log_game("[key_name(user)] has put the MMI/posibrain of [key_name(B)] into [src] at [AREACOORD(src)]")
return TRUE
/obj/mecha/container_resist(mob/living/user)
/obj/mecha/container_resist_act(mob/living/user)
is_currently_ejecting = TRUE
to_chat(occupant, "<span class='notice'>You begin the ejection procedure. Equipment is disabled during this process. Hold still to finish ejecting.</span>")
if(do_after(occupant, has_gravity() ? exit_delay : 0 , target = src))
+1 -1
View File
@@ -48,7 +48,7 @@
return
if(!chassis || chassis.occupant != owner)
return
chassis.container_resist(chassis.occupant)
chassis.container_resist_act(chassis.occupant)
/datum/action/innate/mecha/mech_toggle_internals
name = "Toggle Internal Airtank Usage"
+1 -1
View File
@@ -174,7 +174,7 @@
output += "</div>"
return output
/obj/mecha/working/ripley/relay_container_resist(mob/living/user, obj/O)
/obj/mecha/working/ripley/relay_container_resist_act(mob/living/user, obj/O)
to_chat(user, "<span class='notice'>You lean on the back of [O] and start pushing so it falls out of [src].</span>")
if(do_after(user, 300, target = O))
if(!user || user.stat != CONSCIOUS || user.loc != src || O.loc != src )
+1 -1
View File
@@ -243,7 +243,7 @@
icon_state = pick("cocoon1","cocoon2","cocoon3")
. = ..()
/obj/structure/spider/cocoon/container_resist(mob/living/user)
/obj/structure/spider/cocoon/container_resist_act(mob/living/user)
var/breakout_time = 600
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
+1 -1
View File
@@ -69,7 +69,7 @@
R.foldedbag_instance = src
moveToNullspace()
/obj/item/bodybag/bluespace/container_resist(mob/living/user)
/obj/item/bodybag/bluespace/container_resist_act(mob/living/user)
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't get out while you're restrained like this!</span>")
return
@@ -121,7 +121,7 @@
ready = TRUE
update_icon()
/obj/machinery/implantchair/container_resist(mob/living/user)
/obj/machinery/implantchair/container_resist_act(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
+2 -2
View File
@@ -115,9 +115,9 @@
update_icon()
return
else if(user.client)
container_resist(user)
container_resist_act(user)
/obj/item/pet_carrier/container_resist(mob/living/user)
/obj/item/pet_carrier/container_resist_act(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
if(user.mob_size <= MOB_SIZE_SMALL)
-3
View File
@@ -170,9 +170,6 @@
return
ui_interact(user)
/obj/proc/container_resist(mob/living/user)
return
/mob/proc/unset_machine()
if(machine)
machine.on_unset_machine(src)
@@ -351,7 +351,7 @@
message_cooldown = world.time + 50
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
return
container_resist(user)
container_resist_act(user)
/obj/structure/closet/attack_hand(mob/living/user)
. = ..()
@@ -396,14 +396,14 @@
return 0
return 1
/obj/structure/closet/container_resist(mob/living/user)
/obj/structure/closet/container_resist_act(mob/living/user)
if(opened)
return
if(ismovable(loc))
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
var/atom/movable/AM = loc
AM.relay_container_resist(user, src)
AM.relay_container_resist_act(user, src)
return
if(!welded && !locked)
open()
+1 -1
View File
@@ -105,7 +105,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
recursive_organ_check(src)
qdel(src)
/obj/structure/bodycontainer/container_resist(mob/living/user)
/obj/structure/bodycontainer/container_resist_act(mob/living/user)
if(!locked)
open()
return
@@ -72,7 +72,7 @@
if(current_size >= STAGE_FIVE)
deconstruct(FALSE)
/obj/structure/transit_tube_pod/container_resist(mob/living/user)
/obj/structure/transit_tube_pod/container_resist_act(mob/living/user)
if(!user.incapacitated())
empty_pod()
return
@@ -41,7 +41,7 @@
message_cooldown = world.time + 50
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
/obj/machinery/abductor/experiment/container_resist(mob/living/user)
/obj/machinery/abductor/experiment/container_resist_act(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
@@ -302,7 +302,7 @@
..(user)
return occupant
/obj/machinery/atmospherics/components/unary/cryo_cell/container_resist(mob/living/user)
/obj/machinery/atmospherics/components/unary/cryo_cell/container_resist_act(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the glass of [src]!</span>", \
+1 -1
View File
@@ -411,7 +411,7 @@
target.forceMove(src)
to_chat(user, "<span class='notice'>[target] slithers into [src].</span>")
/obj/item/clothing/shoes/cowboy/container_resist(mob/living/user)
/obj/item/clothing/shoes/cowboy/container_resist_act(mob/living/user)
if(!do_after(user, 10, target = user))
return
user.forceMove(user.drop_location())
@@ -54,7 +54,7 @@
/obj/machinery/gibber/attack_paw(mob/user)
return attack_hand(user)
/obj/machinery/gibber/container_resist(mob/living/user)
/obj/machinery/gibber/container_resist_act(mob/living/user)
go_out()
/obj/machinery/gibber/relaymove(mob/living/user)
@@ -140,7 +140,7 @@
empty()
add_fingerprint(usr)
/obj/machinery/processor/container_resist(mob/living/user)
/obj/machinery/processor/container_resist_act(mob/living/user)
user.forceMove(drop_location())
user.visible_message("<span class='notice'>[user] crawls free of the processor!</span>")
+1 -1
View File
@@ -69,7 +69,7 @@
/obj/item/clothing/head/mob_holder/relaymove(mob/user)
release()
/obj/item/clothing/head/mob_holder/container_resist()
/obj/item/clothing/head/mob_holder/container_resist_act()
release()
/obj/item/clothing/head/mob_holder/drone/deposit(mob/living/L)
+2 -3
View File
@@ -792,9 +792,8 @@
resist_buckle()
//Breaking out of a container (Locker, sleeper, cryo...)
else if(isobj(loc))
var/obj/C = loc
C.container_resist(src)
else if(loc)
loc.container_resist_act(src)
else if(mobility_flags & MOBILITY_MOVE)
if(on_fire)
+1 -1
View File
@@ -147,7 +147,7 @@
attempt_escape(user)
// resist to escape the bin
/obj/machinery/disposal/container_resist(mob/living/user)
/obj/machinery/disposal/container_resist_act(mob/living/user)
attempt_escape(user)
/obj/machinery/disposal/proc/attempt_escape(mob/user)
+2 -2
View File
@@ -140,10 +140,10 @@
else
return ..()
/obj/structure/big_delivery/relay_container_resist(mob/living/user, obj/O)
/obj/structure/big_delivery/relay_container_resist_act(mob/living/user, obj/O)
if(ismovable(loc))
var/atom/movable/AM = loc //can't unwrap the wrapped container if it's inside something.
AM.relay_container_resist(user, O)
AM.relay_container_resist_act(user, O)
return
to_chat(user, "<span class='notice'>You lean on the back of [O] and start pushing to rip the wrapping around it.</span>")
if(do_after(user, 50, target = O))
@@ -144,7 +144,7 @@
open_machine()
/obj/machinery/nanite_chamber/container_resist(mob/living/user)
/obj/machinery/nanite_chamber/container_resist_act(mob/living/user)
if(!locked)
open_machine()
return
@@ -124,7 +124,7 @@
open_machine()
/obj/machinery/public_nanite_chamber/container_resist(mob/living/user)
/obj/machinery/public_nanite_chamber/container_resist_act(mob/living/user)
if(!locked)
open_machine()
return