[MIRROR] Mop do_after multi use

(#11633)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-09-14 00:42:34 -07:00
committed by GitHub
parent 4f4098122b
commit 980ece6324
32 changed files with 216 additions and 364 deletions

View File

@@ -284,9 +284,9 @@
return
/atom/proc/hitby(atom/movable/AM as mob|obj)
/atom/proc/hitby(atom/movable/source)
if (density)
AM.throwing = 0
source.throwing = 0
return
//returns 1 if made bloody, returns 0 otherwise

View File

@@ -69,6 +69,7 @@
name = "Immovable Rod"
desc = "What the fuck is that?"
icon = 'icons/obj/objects.dmi'
w_class = 100 //Affects how much damage it does to stuff
icon_state = "immrod"
density = TRUE
anchored = TRUE

View File

@@ -121,13 +121,14 @@
return
destroy()
/obj/machinery/camera/hitby(AM as mob|obj)
/obj/machinery/camera/hitby(atom/movable/source)
..()
if (istype(AM, /obj))
var/obj/item/O = AM
if(O.throwforce >= src.toughness)
visible_message(span_boldwarning("[src] was hit by [O]."))
take_damage(O.throwforce)
if (!isobj(source))
return
var/obj/item/O = source
if(O.throwforce >= src.toughness)
visible_message(span_boldwarning("[src] was hit by [O]."))
take_damage(O.throwforce)
/obj/machinery/camera/proc/setViewRange(var/num = 7)
src.view_range = num

View File

@@ -197,18 +197,21 @@
/obj/machinery/door/hitby(AM as mob|obj, var/speed=5)
/obj/machinery/door/hitby(atom/movable/source, var/speed=5)
..()
visible_message(span_danger("[src.name] was hit by [AM]."))
visible_message(span_danger("[src.name] was hit by [source]."))
var/tforce = 0
if(ismob(AM))
tforce = 15 * (speed/5)
else
tforce = AM:throwforce * (speed/5)
if(ismob(source))
tforce = 15 * (speed/THROWFORCE_SPEED_DIVISOR)
else if(isobj(source))
var/obj/object = source
if(isitem(object))
var/obj/item/our_item = object
tforce = our_item.throwforce * (speed/THROWFORCE_SPEED_DIVISOR)
else
tforce = object.w_class * (speed/THROWFORCE_SPEED_DIVISOR)
playsound(src, hitsound, 100, 1)
take_damage(tforce)
return
/obj/machinery/door/attack_ai(mob/user as mob)
return src.attack_hand(user)

View File

@@ -1113,11 +1113,10 @@
src.log_append_to_last("Armor saved.")
return
/obj/mecha/hitby(atom/movable/A as mob|obj) //wrapper
/obj/mecha/hitby(atom/movable/source) //wrapper
..()
src.log_message("Hit by [A].",1)
call((proc_res["dynhitby"]||src), "dynhitby")(A)
return
src.log_message("Hit by [source].",1) //CHOMPEdit - Don't have JSON logging yet.
call((proc_res["dynhitby"]||src), "dynhitby")(source) //CHOMPEdit - Don't have JSON logging yet.
//I think this is relative to throws.
/obj/mecha/proc/dynhitby(atom/movable/A)

View File

@@ -1,96 +0,0 @@
#define MAX_PROGRESS 100
/obj/structure/alien/egg //CHOMPedit this entire file is a CHOMPedit
desc = "It looks like a weird egg."
name = "egg"
icon_state = "egg_growing"
density = 0
anchored = 1
var/progress = 0
/obj/structure/alien/egg/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
/obj/structure/alien/egg/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/structure/alien/egg/CanUseTopic(var/mob/user)
return isobserver(user) ? STATUS_INTERACTIVE : STATUS_CLOSE
/obj/structure/alien/egg/Topic(href, href_list)
if(..())
return 1
if(href_list["spawn"])
attack_ghost(usr)
/obj/structure/alien/egg/process()
progress++
if(progress >= MAX_PROGRESS)
for(var/mob/observer/dead/O) //CHOMPedit fixed the snowflake ghost_pod notification.
if(O.client)
to_chat(O, span_notice("An alien is ready to hatch! (<a href='byond://?src=\ref[src];spawn=1'>spawn</a>)"))
STOP_PROCESSING(SSobj, src)
update_icon()
/obj/structure/alien/egg/update_icon()
if(progress == -1)
icon_state = "egg_hatched"
else if(progress < MAX_PROGRESS)
icon_state = "egg_growing"
else
icon_state = "egg"
/obj/structure/alien/egg/attack_ghost(var/mob/observer/ghost/user)
if(progress == -1) //Egg has been hatched.
return
if(progress < MAX_PROGRESS)
to_chat(user, "\The [src] has not yet matured.")
return
if(!user.MayRespawn(1))
return
// Check for bans properly.
if(jobban_isbanned(user, MODE_XENOMORPH))
to_chat(user, span_danger("You are banned from playing a Genaprawn.")) //CHOMPedit
return
var/confirm = tgui_alert(user, "Are you sure you want to join as a Genaprawn larva?", "Become Larva", list("No", "Yes")) //CHOMPedit
if(!src || confirm != "Yes")
return
if(!user || !user.ckey)
return
if(progress == -1) //Egg has been hatched.
to_chat(user, "Too slow...")
return
flick("egg_opening",src)
progress = -1 // No harvesting pls.
sleep(5)
if(!src || !user)
visible_message(span_alium("\The [src] writhes with internal motion, but nothing comes out."))
progress = MAX_PROGRESS // Someone else can have a go.
return // What a pain.
// Create the mob, transfer over key.
var/mob/living/carbon/alien/larva/larva = new(get_turf(src))
larva.ckey = user.ckey
spawn(-1)
if(user) qdel(user) // Remove the keyless ghost if it exists.
visible_message(span_alium("\The [src] splits open with a wet slithering noise, and \the [larva] writhes free!"))
// Turn us into a hatched egg.
name = "hatched alien egg"
desc += " This one has hatched."
update_icon()
#undef MAX_PROGRESS

View File

@@ -1,62 +0,0 @@
/obj/structure/alien ////CHOMPedit This entire file is a CHOMPedit, for new eggs
name = "alien thing"
desc = "There's something alien about this."
icon = 'icons/mob/alien.dmi'
layer = ABOVE_JUNK_LAYER
var/health = 50
/obj/structure/alien/proc/healthcheck()
if(health <=0)
set_density(0)
qdel(src)
return
/obj/structure/alien/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
..()
healthcheck()
return
/obj/structure/alien/ex_act(severity)
switch(severity)
if(1.0)
health-=50
if(2.0)
health-=50
if(3.0)
if (prob(50))
health-=50
else
health-=25
healthcheck()
return
/obj/structure/alien/hitby(AM as mob|obj)
..()
visible_message(span_danger("\The [src] was hit by \the [AM]."))
var/tforce = 0
if(ismob(AM))
tforce = 10
else
tforce = AM:throwforce
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
health = max(0, health - tforce)
healthcheck()
..()
return
/obj/structure/alien/attack_generic()
attack_hand(usr)
/obj/structure/alien/attackby(var/obj/item/W, var/mob/user)
health = max(0, health - W.force)
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
healthcheck()
..()
return
/obj/structure/alien/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group) return 0
if(istype(mover) && mover.checkpass(PASSGLASS))
return !opacity
return !density

View File

@@ -15,8 +15,8 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop)
w_class = ITEMSIZE_NORMAL
flags = NOCONDUCT
attack_verb = list("mopped", "bashed", "bludgeoned", "whacked")
var/mopping = 0
var/mopcount = 0
///How long it takes to mop a tile.
var/mop_time = 4 SECONDS
/obj/item/mop/Initialize(mapload)
. = ..()
@@ -31,7 +31,7 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop)
user.visible_message(span_warning("[user] begins to clean \the [get_turf(A)]."))
if(do_after(user, 4 SECONDS, target = src))
if(do_after(user, mop_time, target = src, max_interact_count = 9))
var/turf/T = get_turf(A)
if(T)
T.wash(CLEAN_SCRUB)
@@ -59,23 +59,4 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop)
w_class = ITEMSIZE_NORMAL
flags = NOCONDUCT
attack_verb = list("mopped", "bashed", "bludgeoned", "whacked")
/obj/item/mop/advanced/Initialize(mapload)
. = ..()
create_reagents(30)
/obj/item/mop/advanced/afterattack(atom/A, mob/user, proximity)
if(!proximity) return
if(istype(A, /turf) || istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/overlay) || istype(A, /obj/effect/rune))
if(reagents.total_volume < 1)
to_chat(user, span_notice("Your mop is dry!"))
return
user.visible_message(span_warning("[user] begins to clean \the [get_turf(A)]."))
if(do_after(user, 2 SECONDS, target = src))
var/turf/T = get_turf(A)
if(T)
T.wash(CLEAN_SCRUB)
reagents.trans_to_turf(T, 1, 10)
to_chat(user, span_notice("You have finished mopping!"))
mop_time = 2 SECONDS

View File

@@ -33,14 +33,19 @@
healthcheck()
return
/obj/structure/alien/hitby(AM as mob|obj)
/obj/structure/alien/hitby(atom/movable/source)
..()
visible_message(span_danger("\The [src] was hit by \the [AM]."))
var/tforce = 0
if(ismob(AM))
tforce = 10
else
tforce = AM:throwforce
visible_message(span_danger("\The [src] was hit by \the [source]."))
var/tforce
if(ismob(source))
tforce = 15
else if(isobj(source))
var/obj/object = source
if(isitem(object))
var/obj/item/our_item = object
tforce = our_item.throwforce
else
tforce = object.w_class
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
health = max(0, health - tforce)
healthcheck()

View File

@@ -285,17 +285,17 @@
tail_image.layer = BODY_LAYER + ((dir in tail_lower_dirs) ? TAIL_LOWER_LAYER : tail_layering)
add_overlay(tail_image)
/obj/structure/gargoyle/hitby(atom/movable/AM as mob|obj,var/speed = THROWFORCE_SPEED_DIVISOR)
/obj/structure/gargoyle/hitby(atom/movable/source ,var/speed = THROWFORCE_SPEED_DIVISOR)
var/mob/living/carbon/human/gargoyle = WR_gargoyle.resolve()
if(!gargoyle)
return
if(istype(AM,/obj/item) && gargoyle.vore_selected && gargoyle.trash_catching)
var/obj/item/I = AM
if(isitem(source) && gargoyle.vore_selected && gargoyle.trash_catching)
var/obj/item/I = source
if(gargoyle.adminbus_trash || is_type_in_list(I, GLOB.edible_trash) && I.trash_eatable && !is_type_in_list(I, GLOB.item_vore_blacklist))
gargoyle.hitby(AM, speed)
gargoyle.hitby(source, speed)
return
else if(isliving(AM))
var/mob/living/L = AM
else if(isliving(source))
var/mob/living/L = source
if(gargoyle.throw_vore && L.throw_vore && gargoyle.can_be_drop_pred && L.can_be_drop_prey)
var/drop_prey_temp = FALSE
if(gargoyle.can_be_drop_prey)

View File

@@ -257,14 +257,14 @@
take_damage(damage)
return
/obj/structure/low_wall/hitby(AM as mob|obj, var/speed)
/obj/structure/low_wall/hitby(atom/movable/source, var/speed)
..()
var/tforce = 0
if(ismob(AM)) // All mobs have a multiplier and a size according to mob_defines.dm
var/mob/I = AM
if(ismob(source)) // All mobs have a multiplier and a size according to mob_defines.dm
var/mob/I = source
tforce = I.mob_size * (speed/THROWFORCE_SPEED_DIVISOR)
else if(isitem(AM))
var/obj/item/O = AM
else if(isitem(source))
var/obj/item/O = source
tforce = O.throwforce * (speed/THROWFORCE_SPEED_DIVISOR)
if (tforce < 15)
return

View File

@@ -162,21 +162,21 @@
return !anchored // If it's anchored, it'll block air.
return TRUE // Don't stop airflow from the other sides.
/obj/structure/window/hitby(AM as mob|obj)
/obj/structure/window/hitby(atom/movable/source)
..()
visible_message(span_danger("[src] was hit by [AM]."))
visible_message(span_danger("[src] was hit by [source]."))
var/tforce = 0
if(ismob(AM))
if(ismob(source))
tforce = 40
else if(isobj(AM))
var/obj/item/I = AM
else if(isobj(source))
var/obj/item/I = source
tforce = I.throwforce
if(reinf) tforce *= 0.25
if(health - tforce <= 7 && !reinf)
anchored = FALSE
update_verbs()
update_nearby_icons()
step(src, get_dir(AM, src))
step(src, get_dir(source, src))
take_damage(tforce)
/obj/structure/window/attack_tk(mob/user as mob)

View File

@@ -61,8 +61,8 @@
if(burn_stuff(AM))
START_PROCESSING(SSturfs, src)
/turf/simulated/floor/lava/hitby(atom/movable/AM)
if(burn_stuff(AM))
/turf/simulated/floor/lava/hitby(atom/movable/source)
if(burn_stuff(source))
START_PROCESSING(SSturfs, src)
/turf/simulated/floor/lava/process()

View File

@@ -96,13 +96,19 @@
take_damage(damage)
return
/turf/simulated/wall/hitby(AM as mob|obj, var/speed=THROWFORCE_SPEED_DIVISOR)
/turf/simulated/wall/hitby(atom/movable/source, var/speed=THROWFORCE_SPEED_DIVISOR)
..()
if(ismob(AM))
if(ismob(source))
return
var/tforce = AM:throwforce * (speed/THROWFORCE_SPEED_DIVISOR)
if (tforce < 15)
var/tforce = 0
if(isobj(source))
var/obj/object = source
if(isitem(object))
var/obj/item/our_item = object
tforce = our_item.throwforce * (speed/THROWFORCE_SPEED_DIVISOR)
else
tforce = object.w_class * (speed/THROWFORCE_SPEED_DIVISOR)
if(tforce < 15)
return
take_damage(tforce)

View File

@@ -347,14 +347,16 @@
return
// Called when turf is hit by a thrown object
/turf/hitby(atom/movable/AM as mob|obj, var/speed)
if(density)
if(!get_gravity(AM)) //Checked a different codebase for reference. Turns out it's only supposed to happen in no-gravity
spawn(2)
step(AM, turn(AM.last_move, 180)) //This makes it float away after hitting a wall in 0G
if(isliving(AM))
var/mob/living/M = AM
M.turf_collision(src, speed)
/turf/hitby(atom/movable/source, var/speed)
if(!density)
return
if(!get_gravity(source)) //Checked a different codebase for reference. Turns out it's only supposed to happen in no-gravity
spawn(2)
step(source, turn(source.last_move, 180)) //This makes it float away after hitting a wall in 0G
if(isliving(source))
var/mob/living/M = source
M.turf_collision(src, speed)
/turf/AllowDrop()
return TRUE

View File

@@ -41,15 +41,15 @@
do_fall(AM)
/turf/unsimulated/floor/sky/hitby(var/atom/movable/AM, var/speed)
/turf/unsimulated/floor/sky/hitby(var/atom/movable/source, var/speed)
. = ..()
if(!does_skyfall)
return //We don't do that
do_fall(AM)
do_fall(source)
/turf/unsimulated/floor/sky/proc/do_fall(atom/movable/AM)
/turf/unsimulated/floor/sky/proc/do_fall(atom/movable/source)
//Bye
var/attempts = 100
var/turf/simulated/T
@@ -65,8 +65,8 @@
if(!T)
return
AM.forceMove(T)
if(isliving(AM))
var/mob/living/L = AM
message_admins("\The [AM] fell out of the sky.")
source.forceMove(T)
if(isliving(source))
var/mob/living/L = source
message_admins("\The [source] fell out of the sky.")
L.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this.

View File

@@ -101,10 +101,10 @@
return 1 //end the search!
return 0
/obj/item/assembly/mousetrap/hitby(var/atom/movable/A)
/obj/item/assembly/mousetrap/hitby(var/atom/movable/source)
if(!armed)
return ..()
visible_message(span_warning("[src] is triggered by [A]."))
visible_message(span_warning("[src] is triggered by [source]."))
triggered(null)
/obj/item/assembly/mousetrap/armed

View File

@@ -1759,39 +1759,41 @@
ball.item_state = "[initial(ball.item_state)]"
ball.update_icon()
/obj/structure/hyperball_goal/hitby(obj/B as obj)
/obj/structure/hyperball_goal/hitby(atom/movable/source)
. = ..()
if(istype(B,/obj/item/laserdome_hyperball))
var/obj/item/laserdome_hyperball/ball = B
if(prob(range_dunk_chance))
if(ball.last_team != goal_team)
GLOB.global_announcer.autosay("[ball.last_holder] threw the HYPERball for [capitalize(ball.last_team)] team! [num2text(range_dunk_points)] points scored!","Laserdome Announcer","Entertainment")
score += range_dunk_points //increment our score!
if(score < score_limit) //announce the current score and how many more captures are needed
GLOB.global_announcer.autosay("[num2text(score_limit-score)] points remain until [capitalize(ball.last_team)] team wins.","Laserdome Announcer","Entertainment")
else if(score >= score_limit) //now, if score equals or exceeds the score limit, announce that our team won and reset the score for all flag bases nearby
GLOB.global_announcer.autosay("+|[uppertext(ball.last_team)] TEAM HAS WON THE MATCH!|+","Laserdome Announcer","Entertainment")
for(var/obj/structure/hyperball_goal/HB in src.loc.loc.contents) //this feels dirty, but it works
HB.score = 0
else if(ball.last_team == goal_team) //discourage people from dunking the ball into their own goal as a quick way to teleport it back to the midfield
switch(goal_team) //this gets a bit fiddly because we store our score on the target's goal, so we need to scan the map for the opposing team's goal and deduct points from it
if("blue")
for(var/obj/structure/hyperball_goal/red/HGR in src.loc.loc.contents)
HGR.score = max(0,HGR.score-range_dunk_points)
GLOB.global_announcer.autosay("[ball.last_holder] threw the HYPERball and scored an own goal! +Points |de-ducted!|+ [capitalize(goal_team)] team score is now: [HGR.score].","Laserdome Announcer","Entertainment")
if("red")
for(var/obj/structure/hyperball_goal/blue/HGB in src.loc.loc.contents)
HGB.score = max(0,HGB.score-range_dunk_points)
GLOB.global_announcer.autosay("[ball.last_holder] threw the HYPERball and scored an own goal! +Points |de-ducted!|+ [capitalize(goal_team)] team score is now: [HGB.score].","Laserdome Announcer","Entertainment")
if(!istype(source, /obj/item/laserdome_hyperball))
return
ball.loc = ball.start_pos //teleport the ball back to the midfield
ball.icon_state = "[initial(ball.icon_state)]"
ball.item_state = "[initial(ball.item_state)]"
ball.update_icon()
else
//todo; throw the ball in a random direction
src.visible_message("\The [ball] bounces off \the [src]'s rim!")
GLOB.global_announcer.autosay("[ball.last_holder] threw the HYPERball and +missed!+ |Oooh!|","Laserdome Announcer","Entertainment")
var/obj/item/laserdome_hyperball/ball = source
if(prob(range_dunk_chance))
if(ball.last_team != goal_team)
GLOB.global_announcer.autosay("[ball.last_holder] threw the HYPERball for [capitalize(ball.last_team)] team! [num2text(range_dunk_points)] points scored!","Laserdome Announcer","Entertainment")
score += range_dunk_points //increment our score!
if(score < score_limit) //announce the current score and how many more captures are needed
GLOB.global_announcer.autosay("[num2text(score_limit-score)] points remain until [capitalize(ball.last_team)] team wins.","Laserdome Announcer","Entertainment")
else if(score >= score_limit) //now, if score equals or exceeds the score limit, announce that our team won and reset the score for all flag bases nearby
GLOB.global_announcer.autosay("+|[uppertext(ball.last_team)] TEAM HAS WON THE MATCH!|+","Laserdome Announcer","Entertainment")
for(var/obj/structure/hyperball_goal/HB in src.loc.loc.contents) //this feels dirty, but it works
HB.score = 0
else if(ball.last_team == goal_team) //discourage people from dunking the ball into their own goal as a quick way to teleport it back to the midfield
switch(goal_team) //this gets a bit fiddly because we store our score on the target's goal, so we need to scan the map for the opposing team's goal and deduct points from it
if("blue")
for(var/obj/structure/hyperball_goal/red/HGR in src.loc.loc.contents)
HGR.score = max(0,HGR.score-range_dunk_points)
GLOB.global_announcer.autosay("[ball.last_holder] threw the HYPERball and scored an own goal! +Points |de-ducted!|+ [capitalize(goal_team)] team score is now: [HGR.score].","Laserdome Announcer","Entertainment")
if("red")
for(var/obj/structure/hyperball_goal/blue/HGB in src.loc.loc.contents)
HGB.score = max(0,HGB.score-range_dunk_points)
GLOB.global_announcer.autosay("[ball.last_holder] threw the HYPERball and scored an own goal! +Points |de-ducted!|+ [capitalize(goal_team)] team score is now: [HGB.score].","Laserdome Announcer","Entertainment")
ball.loc = ball.start_pos //teleport the ball back to the midfield
ball.icon_state = "[initial(ball.icon_state)]"
ball.item_state = "[initial(ball.item_state)]"
ball.update_icon()
else
//todo; throw the ball in a random direction
src.visible_message("\The [ball] bounces off \the [src]'s rim!")
GLOB.global_announcer.autosay("[ball.last_holder] threw the HYPERball and +missed!+ |Oooh!|","Laserdome Announcer","Entertainment")
/obj/structure/prop/machine/biosyphon/laserdome
name = "Laserdome Orientation Holo"

View File

@@ -19,22 +19,22 @@
/*
* Allow thrown items into smartfridges
*/
/obj/machinery/smartfridge/hitby(var/atom/movable/A, speed)
/obj/machinery/smartfridge/hitby(var/atom/movable/source, speed)
. = ..()
if(accept_check(A) && A.thrower)
if(accept_check(source) && source.thrower)
//Try to find what job they are via ID
var/obj/item/card/id/thrower_id
if(ismob(A.thrower))
var/mob/T = A.thrower
if(ismob(source.thrower))
var/mob/T = source.thrower
thrower_id = T.GetIdCard()
//98% chance the expert makes it
if(expert_job && thrower_id && thrower_id.rank == expert_job && prob(98))
stock(A)
stock(source)
//20% chance a non-expert makes it
else if(prob(20))
stock(A)
stock(source)
/*
* Chemistry 'chemavator' (multi-z chem storage)

View File

@@ -244,23 +244,25 @@
/obj/machinery/maint_recycler/hitby(atom/movable/AM)
/obj/machinery/maint_recycler/hitby(atom/movable/source)
. = ..()
if(istype(AM, /obj/item) && !istype(AM, /obj/item/projectile)) //no mob throwing.
if(prob(75))
if(get_item_whitelist(AM) == RECYCLER_ALLOWED)
if(inserted_item == null)
visible_message("\The [AM] lands in \the [src].",runemessage = "swish")
AM.forceMove(src)
inserted_item = AM
update_icon()
playsound(src, 'code/modules/maint_recycler/sfx/voice/a wonderful throw.ogg', 75)
set_screen_state("screen_happy",10)
return
else
deny_act(AM,null)
if(!isitem(source) || istype(source, /obj/item/projectile)) //no mob throwing.
return
visible_message("\The [AM] bounces off of the rim of \the [src]'s processing compartment!")
if(prob(75))
if(get_item_whitelist(source) == RECYCLER_ALLOWED)
if(inserted_item == null)
visible_message("\The [source] lands in \the [src].",runemessage = "swish")
source.forceMove(src)
inserted_item = source
update_icon()
playsound(src, 'code/modules/maint_recycler/sfx/voice/a wonderful throw.ogg', 75)
set_screen_state("screen_happy",10)
return
else
deny_act(source, null)
visible_message("\The [source] bounces off of the rim of \the [src]'s processing compartment!")
/obj/machinery/maint_recycler/proc/deny_act(var/obj/item/O,var/mob/user)
set_screen_state("screen_deny",10)

View File

@@ -389,7 +389,7 @@ emp_act
return 1
//this proc handles being hit by a thrown atom
/mob/living/carbon/human/hitby(atom/movable/AM as mob|obj,var/speed = THROWFORCE_SPEED_DIVISOR)
/mob/living/carbon/human/hitby(atom/movable/source, var/speed = THROWFORCE_SPEED_DIVISOR)
if(src.is_incorporeal())
return
// if(buckled && buckled == AM)
@@ -398,8 +398,8 @@ emp_act
//VORESTATION EDIT START - Allows for thrown vore!
//Throwing a prey into a pred takes priority. After that it checks to see if the person being thrown is a pred.
// I put more comments here for ease of reading.
if(isliving(AM))
var/mob/living/thrown_mob = AM
if(isliving(source))
var/mob/living/thrown_mob = source
if(isanimal(thrown_mob) && !allowmobvore && !thrown_mob.ckey) //Is the thrown_mob an animal and we don't allow mobvore?
return
// PERSON BEING HIT: CAN BE DROP PRED, ALLOWS THROW VORE.
@@ -423,8 +423,8 @@ emp_act
return
//VORESTATION EDIT END - Allows for thrown vore!
if(istype(AM,/obj/item))
var/obj/item/O = AM
if(isitem(source))
var/obj/item/O = source
if(stat != DEAD && trash_catching && vore_selected)
if(adminbus_trash || is_type_in_list(O, GLOB.edible_trash) && O.trash_eatable && !is_type_in_list(O, GLOB.item_vore_blacklist))
visible_message(span_vwarning("[O] is thrown directly into [src]'s [lowertext(vore_selected.name)]!"))

View File

@@ -268,11 +268,11 @@
return 1
//this proc handles being hit by a thrown atom
/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = THROWFORCE_SPEED_DIVISOR)//Standardization and logging -Sieve
/mob/living/hitby(atom/movable/source, var/speed = THROWFORCE_SPEED_DIVISOR)//Standardization and logging -Sieve
if(is_incorporeal())
return
if(istype(AM,/obj/item))
var/obj/item/O = AM
if(isitem(source))
var/obj/item/O = source
if(stat != DEAD && trash_catching && vore_selected)
if(adminbus_trash || is_type_in_list(O, GLOB.edible_trash) && O.trash_eatable && !is_type_in_list(O, GLOB.item_vore_blacklist))
visible_message(span_vwarning("[O] is thrown directly into [src]'s [lowertext(vore_selected.name)]!"))
@@ -337,8 +337,8 @@
//VORESTATION EDIT START - Allows for thrown vore! //CHOMPEdit Start
//Throwing a prey into a pred takes priority. After that it checks to see if the person being thrown is a pred.
if(isliving(AM))
var/mob/living/thrown_mob = AM
if(isliving(source))
var/mob/living/thrown_mob = source
// PERSON BEING HIT: CAN BE DROP PRED, ALLOWS THROW VORE.
// PERSON BEING THROWN: DEVOURABLE, ALLOWS THROW VORE, CAN BE DROP PREY.

View File

@@ -1439,13 +1439,13 @@
var/mobstuff = TRUE //if false, we don't care about dogs, and that's terrible
var/we_process = FALSE //don't start another process while you're processing, idiot
/turf/simulated/floor/water/digestive_enzymes/Entered(atom/movable/AM)
if(digest_stuff(AM) && !we_process)
/turf/simulated/floor/water/digestive_enzymes/Entered(atom/movable/source)
if(digest_stuff(source) && !we_process)
START_PROCESSING(SSturfs, src)
we_process = TRUE
/turf/simulated/floor/water/digestive_enzymes/hitby(atom/movable/AM)
if(digest_stuff(AM) && !we_process)
/turf/simulated/floor/water/digestive_enzymes/hitby(atom/movable/source)
if(digest_stuff(source) && !we_process)
START_PROCESSING(SSturfs, src)
we_process = TRUE
@@ -1454,12 +1454,12 @@
we_process = FALSE
return PROCESS_KILL
/turf/simulated/floor/water/digestive_enzymes/proc/can_digest(atom/movable/AM as mob|obj)
/turf/simulated/floor/water/digestive_enzymes/proc/can_digest(atom/movable/digest_target)
. = FALSE
if(AM.loc != src)
if(digest_target.loc != src)
return FALSE
if(isitem(AM))
var/obj/item/I = AM
if(isitem(digest_target))
var/obj/item/I = digest_target
if(I.unacidable || I.throwing || I.is_incorporeal())
return FALSE
var/food = FALSE
@@ -1476,8 +1476,8 @@
yum += 50
linked_mob.adjust_nutrition(yum)
return TRUE
if(isliving(AM))
var/mob/living/L = AM
if(isliving(digest_target))
var/mob/living/L = digest_target
if(L.unacidable || !L.digestable || L.buckled || L.hovering || L.throwing || L.is_incorporeal())
return FALSE
if(ishuman(L))
@@ -1488,7 +1488,7 @@
return TRUE
else return TRUE
/turf/simulated/floor/water/digestive_enzymes/proc/digest_stuff(atom/movable/AM) //I'm so sorry
/turf/simulated/floor/water/digestive_enzymes/proc/digest_stuff(atom/movable/digest_target) //I'm so sorry
. = FALSE
var/damage = 1
@@ -1574,7 +1574,7 @@
if(!we_process)
START_PROCESSING(SSturfs, src)
/turf/simulated/floor/flesh/mover/hitby(atom/movable/AM)
/turf/simulated/floor/flesh/mover/hitby(atom/movable/source)
if(!we_process)
START_PROCESSING(SSturfs, src)

View File

@@ -84,9 +84,9 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr
A.fall()
// Called when thrown object lands on this turf.
/turf/simulated/open/hitby(var/atom/movable/AM, var/speed)
/turf/simulated/open/hitby(var/atom/movable/source, var/speed)
. = ..()
AM.fall()
source.fall()
/turf/simulated/open/examine(mob/user, distance, infix, suffix)
. = ..()

View File

@@ -419,22 +419,22 @@
update() // update icon
return
/obj/machinery/disposal/hitby(atom/movable/AM)
/obj/machinery/disposal/hitby(atom/movable/source)
. = ..()
if(istype(AM, /obj/item) && !istype(AM, /obj/item/projectile))
if(isitem(source) && !istype(source, /obj/item/projectile))
if(prob(75))
AM.forceMove(src)
visible_message("\The [AM] lands in \the [src].")
source.forceMove(src)
visible_message("\The [source] lands in \the [src].")
else
visible_message("\The [AM] bounces off of \the [src]'s rim!")
visible_message("\The [source] bounces off of \the [src]'s rim!")
if(istype(AM,/mob/living))
if(isliving(source))
if(prob(75))
var/mob/living/to_be_dunked = AM
if(ishuman(AM) ||to_be_dunked.client)
log_and_message_admins("[AM] was thrown into \the [src]", null)
AM.forceMove(src)
visible_message("\The [AM] lands in \the [src].")
var/mob/living/to_be_dunked = source
if(ishuman(source) ||to_be_dunked.client)
log_and_message_admins("[source] was thrown into \the [src]", null)
source.forceMove(src)
visible_message("\The [source] lands in \the [src].")
/obj/machinery/disposal/wall
name = "inset disposal unit"

View File

@@ -28,18 +28,18 @@
AM.forceMove(src)
flush()
/obj/machinery/disposal/deliveryChute/hitby(atom/movable/AM)
if(!QDELETED(AM) || (istype(AM, /obj/item) || istype(AM, /mob/living)) && !istype(AM, /obj/item/projectile))
/obj/machinery/disposal/deliveryChute/hitby(atom/movable/source)
if(!QDELETED(source) || (isitem(source) || isliving(source)) && !istype(source, /obj/item/projectile))
switch(dir)
if(NORTH)
if(AM.loc.y != src.loc.y+1) return ..()
if(source.loc.y != src.loc.y+1) return ..()
if(EAST)
if(AM.loc.x != src.loc.x+1) return ..()
if(source.loc.x != src.loc.x+1) return ..()
if(SOUTH)
if(AM.loc.y != src.loc.y-1) return ..()
if(source.loc.y != src.loc.y-1) return ..()
if(WEST)
if(AM.loc.x != src.loc.x-1) return ..()
AM.forceMove(src)
if(source.loc.x != src.loc.x-1) return ..()
source.forceMove(src)
flush()
/obj/machinery/disposal/deliveryChute/attackby(var/obj/item/I, var/mob/user)

View File

@@ -91,16 +91,21 @@
qdel(src)
/obj/machinery/shield/hitby(AM as mob|obj)
/obj/machinery/shield/hitby(atom/movable/source)
//Let everyone know we've been hit!
visible_message(span_danger("\The [src] was hit by [AM]."))
visible_message(span_danger("\The [src] was hit by [source]."))
//Super realistic, resource-intensive, real-time damage calculations.
var/tforce = 0
if(ismob(AM))
if(ismob(source))
tforce = 40
else
tforce = AM:throwforce
if(isobj(source))
var/obj/object = source
if(isitem(object))
var/obj/item/our_item = object
tforce = our_item.throwforce
else
tforce = object.w_class
src.health -= tforce

View File

@@ -25,11 +25,11 @@
name = "sandy pebble"
density = FALSE
/obj/structure/prop/desert_rock/pebble/Crossed(atom/movable/AM as mob|obj)
if(AM.is_incorporeal())
/obj/structure/prop/desert_rock/pebble/Crossed(atom/movable/source)
if(source.is_incorporeal())
return
if(istype(AM, /mob/living))
var/mob/living/M = AM
if(istype(source, /mob/living))
var/mob/living/M = source
if(M.m_intent == I_RUN && prob(5))
M.Weaken(2)
to_chat(M, "You trip over the [src]!")

View File

@@ -90,12 +90,15 @@
take_damage(damage)
return
/turf/simulated/shuttlewalls/hitby(AM as mob|obj, var/speed=THROWFORCE_SPEED_DIVISOR)
/turf/simulated/shuttlewalls/hitby(atom/movable/source, var/speed=THROWFORCE_SPEED_DIVISOR)
..()
if(ismob(AM))
if(ismob(source))
return
var/tforce = AM:throwforce * (speed/THROWFORCE_SPEED_DIVISOR)
var/tforce = 0
if(isitem(source))
var/obj/item/O = source
tforce = O.throwforce * (speed/THROWFORCE_SPEED_DIVISOR)
if (tforce < 15)
return

View File

@@ -91,10 +91,10 @@
if(LAZYLEN(R.items))
var/i = 0
for(var/atom/movable/AM as anything in R.items) // Atom typepath
for(var/atom/movable/source in R.items) // Atom typepath
if(i)
text += ", "
text += "[capitalize(initial(AM.name))]"
text += "[capitalize(initial(source.name))]"
i++
D.data += span_bold("Material Objects") + ": [text ? text : "none"]<br>"
text = ""

View File

@@ -334,11 +334,11 @@ ANT STRUCTURES
name = "spore trap"
var/modifiertype = /datum/modifier/berserk
/obj/effect/ant_structure/trap/Crossed(atom/movable/AM as mob|obj)
if(AM.is_incorporeal())
/obj/effect/ant_structure/trap/Crossed(atom/movable/source)
if(source.is_incorporeal())
return
if(anchored && isliving(AM))
var/mob/living/L = AM
if(anchored && isliving(source))
var/mob/living/L = source
if(L == /mob/living/simple_mob/animal/tyr/mineral_ants)
return
else if(L.m_intent == I_RUN)

View File

@@ -544,10 +544,10 @@
var/health = 5
var/modifiertype = /datum/modifier/poisoned/weak
/obj/effect/slimeattack/Crossed(atom/movable/AM as mob|obj)
if(AM.is_incorporeal())
/obj/effect/slimeattack/Crossed(atom/movable/source)
if(source.is_incorporeal())
return
Bumped(AM)
Bumped(source)
/obj/effect/slimeattack/attackby(var/obj/item/W, var/mob/user)
user.setClickCooldown(user.get_attack_speed(W))