Passes thrownthing to hitby (#41411)

* Passes thrownthing to hitby

* Items now also pass thrownthing

* No longer uses default arguments

Also fixes bananium shield

* Adds more arguments to hitby calls

* Standardises throw_impact

* Clears up some loose ends

* Adds back wacky comment

* Reinstates can_push=FALSE on bananium shield
This commit is contained in:
4dplanner
2018-11-15 09:25:04 +00:00
committed by yogstation13-bot
parent 8c530d1b19
commit 8d1be69d22
57 changed files with 114 additions and 114 deletions

View File

@@ -466,7 +466,7 @@
/atom/movable/proc/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) /atom/movable/proc/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
set waitfor = 0 set waitfor = 0
SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum) SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum)
return hit_atom.hitby(src) return hit_atom.hitby(src, throwingdatum=throwingdatum)
/atom/movable/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked, datum/thrownthing/throwingdatum) /atom/movable/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked, datum/thrownthing/throwingdatum)
if(!anchored && hitpush && (!throwingdatum || (throwingdatum.force >= (move_resist * MOVE_FORCE_PUSH_RATIO)))) if(!anchored && hitpush && (!throwingdatum || (throwingdatum.force >= (move_resist * MOVE_FORCE_PUSH_RATIO))))

View File

@@ -145,9 +145,9 @@
C.throw_mode_on() //so they can catch it on the return. C.throw_mode_on() //so they can catch it on the return.
return ..() return ..()
/obj/item/shield/energy/bananium/throw_impact(atom/hit_atom) /obj/item/shield/energy/bananium/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(active) if(active)
var/caught = hit_atom.hitby(src, 0, 0) var/caught = hit_atom.hitby(src, FALSE, FALSE, throwingdatum=throwingdatum)
if(iscarbon(hit_atom) && !caught)//if they are a carbon and they didn't catch it if(iscarbon(hit_atom) && !caught)//if they are a carbon and they didn't catch it
GET_COMPONENT(slipper, /datum/component/slippery) GET_COMPONENT(slipper, /datum/component/slippery)
slipper.Slip(src, hit_atom) slipper.Slip(src, hit_atom)

View File

@@ -424,7 +424,7 @@
throwforce = 35 throwforce = 35
icon_state = "punching_glove" icon_state = "punching_glove"
/obj/item/punching_glove/throw_impact(atom/hit_atom) /obj/item/punching_glove/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) if(!..())
if(ismovableatom(hit_atom)) if(ismovableatom(hit_atom))
var/atom/movable/AM = hit_atom var/atom/movable/AM = hit_atom

View File

@@ -107,8 +107,8 @@
/obj/mecha/attack_tk() /obj/mecha/attack_tk()
return return
/obj/mecha/hitby(atom/movable/A as mob|obj) //wrapper /obj/mecha/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) //wrapper
log_message("Hit by [A].", LOG_MECHA, color="red") log_message("Hit by [AM].", LOG_MECHA, color="red")
. = ..() . = ..()

View File

@@ -513,16 +513,16 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
else else
return return
/obj/item/throw_impact(atom/A, datum/thrownthing/throwingdatum) /obj/item/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(A && !QDELETED(A)) if(hit_atom && !QDELETED(hit_atom))
SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, A, throwingdatum) SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum)
if(is_hot() && isliving(A)) if(is_hot() && isliving(hit_atom))
var/mob/living/L = A var/mob/living/L = hit_atom
L.IgniteMob() L.IgniteMob()
var/itempush = 1 var/itempush = 1
if(w_class < 4) if(w_class < 4)
itempush = 0 //too light to push anything itempush = 0 //too light to push anything
return A.hitby(src, 0, itempush) return hit_atom.hitby(src, 0, itempush, throwingdatum=throwingdatum)
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force) /obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force)
thrownby = thrower thrownby = thrower
@@ -616,7 +616,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
/obj/item/proc/get_held_item_speechspans(mob/living/carbon/user) /obj/item/proc/get_held_item_speechspans(mob/living/carbon/user)
return return
/obj/item/hitby(atom/movable/AM) /obj/item/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
return return
/obj/item/attack_hulk(mob/living/carbon/human/user) /obj/item/attack_hulk(mob/living/carbon/human/user)

View File

@@ -160,7 +160,7 @@
/obj/item/dice/attack_self(mob/user) /obj/item/dice/attack_self(mob/user)
diceroll(user) diceroll(user)
/obj/item/dice/throw_impact(atom/target) /obj/item/dice/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
diceroll(thrownby) diceroll(thrownby)
. = ..() . = ..()

View File

@@ -329,7 +329,7 @@
return return
playsound(src.loc,'sound/weapons/bolathrow.ogg', 75, 1) playsound(src.loc,'sound/weapons/bolathrow.ogg', 75, 1)
/obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom) /obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(..() || !iscarbon(hit_atom))//if it gets caught or the target can't be cuffed, if(..() || !iscarbon(hit_atom))//if it gets caught or the target can't be cuffed,
return//abort return//abort
var/mob/living/carbon/C = hit_atom var/mob/living/carbon/C = hit_atom
@@ -357,7 +357,7 @@
w_class = WEIGHT_CLASS_SMALL w_class = WEIGHT_CLASS_SMALL
breakouttime = 60 breakouttime = 60
/obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom) /obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(iscarbon(hit_atom)) if(iscarbon(hit_atom))
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom)) var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom))
B.Crossed(hit_atom) B.Crossed(hit_atom)
@@ -372,7 +372,7 @@
slowdown = 0 slowdown = 0
var/datum/status_effect/gonbolaPacify/effectReference var/datum/status_effect/gonbolaPacify/effectReference
/obj/item/restraints/legcuffs/bola/gonbola/throw_impact(atom/hit_atom) /obj/item/restraints/legcuffs/bola/gonbola/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..() . = ..()
if(iscarbon(hit_atom)) if(iscarbon(hit_atom))
var/mob/living/carbon/C = hit_atom var/mob/living/carbon/C = hit_atom

View File

@@ -287,13 +287,13 @@
if(proximity_flag) if(proximity_flag)
consume_everything(target) consume_everything(target)
/obj/item/melee/supermatter_sword/throw_impact(target) /obj/item/melee/supermatter_sword/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..() ..()
if(ismob(target)) if(ismob(hit_atom))
var/mob/M var/mob/M = hit_atom
if(src.loc == M) if(src.loc == M)
M.dropItemToGround(src) M.dropItemToGround(src)
consume_everything(target) consume_everything(hit_atom)
/obj/item/melee/supermatter_sword/pickup(user) /obj/item/melee/supermatter_sword/pickup(user)
..() ..()

View File

@@ -103,10 +103,10 @@
playsound(src.loc, "sparks", 50, 1) playsound(src.loc, "sparks", 50, 1)
shock(M) shock(M)
/obj/item/twohanded/mjollnir/throw_impact(atom/target) /obj/item/twohanded/mjollnir/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..() . = ..()
if(isliving(target)) if(isliving(hit_atom))
shock(target) shock(hit_atom)
/obj/item/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons. /obj/item/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]" icon_state = "mjollnir[wielded]"

View File

@@ -35,7 +35,7 @@
/obj/item/stack/ore/bluespace_crystal/proc/blink_mob(mob/living/L) /obj/item/stack/ore/bluespace_crystal/proc/blink_mob(mob/living/L)
do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg') do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg')
/obj/item/stack/ore/bluespace_crystal/throw_impact(atom/hit_atom) /obj/item/stack/ore/bluespace_crystal/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) // not caught in mid-air if(!..()) // not caught in mid-air
visible_message("<span class='notice'>[src] fizzles and disappears upon impact!</span>") visible_message("<span class='notice'>[src] fizzles and disappears upon impact!</span>")
var/turf/T = get_turf(hit_atom) var/turf/T = get_turf(hit_atom)

View File

@@ -334,7 +334,7 @@
merge(o) merge(o)
. = ..() . = ..()
/obj/item/stack/hitby(atom/movable/AM, skip, hitpush) /obj/item/stack/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(istype(AM, merge_type)) if(istype(AM, merge_type))
merge(AM) merge(AM)
. = ..() . = ..()

View File

@@ -35,7 +35,7 @@
cell = new preload_cell_type(src) cell = new preload_cell_type(src)
update_icon() update_icon()
/obj/item/melee/baton/throw_impact(atom/hit_atom) /obj/item/melee/baton/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..() ..()
//Only mob/living types have stun handling //Only mob/living types have stun handling
if(status && prob(throw_hit_chance) && iscarbon(hit_atom)) if(status && prob(throw_hit_chance) && iscarbon(hit_atom))

View File

@@ -235,7 +235,7 @@
if(proximity && ismovableatom(O) && O != sliver) if(proximity && ismovableatom(O) && O != sliver)
Consume(O, user) Consume(O, user)
/obj/item/hemostat/supermatter/throw_impact(atom/hit_atom) // no instakill supermatter javelins /obj/item/hemostat/supermatter/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) // no instakill supermatter javelins
if(sliver) if(sliver)
sliver.forceMove(loc) sliver.forceMove(loc)
to_chat(usr, "<span class='notice'>\The [sliver] falls out of \the [src] as you throw them.</span>") to_chat(usr, "<span class='notice'>\The [sliver] falls out of \the [src] as you throw them.</span>")

View File

@@ -83,7 +83,7 @@
else else
return ..() return ..()
/obj/item/toy/balloon/throw_impact(atom/hit_atom) /obj/item/toy/balloon/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) //was it caught by a mob? if(!..()) //was it caught by a mob?
balloon_burst(hit_atom) balloon_burst(hit_atom)
@@ -393,7 +393,7 @@
/obj/item/toy/snappop/fire_act(exposed_temperature, exposed_volume) /obj/item/toy/snappop/fire_act(exposed_temperature, exposed_volume)
pop_burst() pop_burst()
/obj/item/toy/snappop/throw_impact(atom/hit_atom) /obj/item/toy/snappop/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) if(!..())
pop_burst() pop_burst()
@@ -1014,7 +1014,7 @@
icon_state = "minimeteor" icon_state = "minimeteor"
w_class = WEIGHT_CLASS_SMALL w_class = WEIGHT_CLASS_SMALL
/obj/item/toy/minimeteor/throw_impact(atom/hit_atom) /obj/item/toy/minimeteor/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) if(!..())
playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1) playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1)
for(var/mob/M in urange(10, src)) for(var/mob/M in urange(10, src))
@@ -1062,7 +1062,7 @@
if(user.dropItemToGround(src)) if(user.dropItemToGround(src))
throw_at(target, throw_range, throw_speed) throw_at(target, throw_range, throw_speed)
/obj/item/toy/snowball/throw_impact(atom/hit_atom) /obj/item/toy/snowball/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) if(!..())
playsound(src, 'sound/effects/pop.ogg', 20, 1) playsound(src, 'sound/effects/pop.ogg', 20, 1)
qdel(src) qdel(src)

View File

@@ -555,7 +555,7 @@
icon_state = "spearbomb[wielded]" icon_state = "spearbomb[wielded]"
//THIS MIGHT BE UNBALANCED SO I DUNNO // it totally is. //THIS MIGHT BE UNBALANCED SO I DUNNO // it totally is.
/obj/item/twohanded/spear/explosive/throw_impact(atom/target) /obj/item/twohanded/spear/explosive/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..() . = ..()
if(!.) //not caught if(!.) //not caught
explosive.prime() explosive.prime()

View File

@@ -46,7 +46,7 @@
if(BURN) if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, 1) playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
/obj/hitby(atom/movable/AM) /obj/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
..() ..()
take_damage(AM.throwforce, BRUTE, "melee", 1, get_dir(src, AM)) take_damage(AM.throwforce, BRUTE, "melee", 1, get_dir(src, AM))

View File

@@ -258,7 +258,7 @@
take_damage(1, BURN, 0, 0) take_damage(1, BURN, 0, 0)
..() ..()
/obj/structure/grille/hitby(AM as mob|obj) /obj/structure/grille/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(isobj(AM)) if(isobj(AM))
if(prob(50) && anchored && !broken) if(prob(50) && anchored && !broken)
var/obj/O = AM var/obj/O = AM

View File

@@ -43,7 +43,7 @@
if(!islava(newloc) && !L.on_fire) if(!islava(newloc) && !L.on_fire)
L.update_fire() L.update_fire()
/turf/open/lava/hitby(atom/movable/AM) /turf/open/lava/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(burn_stuff(AM)) if(burn_stuff(AM))
START_PROCESSING(SSobj, src) START_PROCESSING(SSobj, src)

View File

@@ -45,10 +45,10 @@
bonus_damage *= 3 //total 30 damage on cultists, 50 with ratvar bonus_damage *= 3 //total 30 damage on cultists, 50 with ratvar
GLOB.clockwork_vitality += target.adjustFireLoss(bonus_damage) //adds the damage done to existing vitality GLOB.clockwork_vitality += target.adjustFireLoss(bonus_damage) //adds the damage done to existing vitality
/obj/item/clockwork/weapon/ratvarian_spear/throw_impact(atom/target) /obj/item/clockwork/weapon/ratvarian_spear/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
var/turf/T = get_turf(target) var/turf/T = get_turf(hit_atom)
if(isliving(target)) if(isliving(hit_atom))
var/mob/living/L = target var/mob/living/L = hit_atom
if(is_servant_of_ratvar(L)) if(is_servant_of_ratvar(L))
if(L.put_in_active_hand(src)) if(L.put_in_active_hand(src))
L.visible_message("<span class='warning'>[L] catches [src] out of the air!</span>") L.visible_message("<span class='warning'>[L] catches [src] out of the air!</span>")

View File

@@ -262,7 +262,7 @@
to_chat(user, "<span class='warning'>The bola seems to take on a life of its own!</span>") to_chat(user, "<span class='warning'>The bola seems to take on a life of its own!</span>")
throw_impact(user) throw_impact(user)
/obj/item/restraints/legcuffs/bola/cult/throw_impact(atom/hit_atom) /obj/item/restraints/legcuffs/bola/cult/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(iscultist(hit_atom)) if(iscultist(hit_atom))
return return
. = ..() . = ..()
@@ -673,10 +673,10 @@
/obj/item/twohanded/cult_spear/update_icon() /obj/item/twohanded/cult_spear/update_icon()
icon_state = "bloodspear[wielded]" icon_state = "bloodspear[wielded]"
/obj/item/twohanded/cult_spear/throw_impact(atom/target) /obj/item/twohanded/cult_spear/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
var/turf/T = get_turf(target) var/turf/T = get_turf(hit_atom)
if(isliving(target)) if(isliving(hit_atom))
var/mob/living/L = target var/mob/living/L = hit_atom
if(iscultist(L)) if(iscultist(L))
playsound(src, 'sound/weapons/throwtap.ogg', 50) playsound(src, 'sound/weapons/throwtap.ogg', 50)
if(L.put_in_active_hand(src)) if(L.put_in_active_hand(src))
@@ -964,11 +964,11 @@
return TRUE return TRUE
return FALSE return FALSE
/obj/item/shield/mirror/throw_impact(atom/target, throwingdatum) /obj/item/shield/mirror/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
var/turf/T = get_turf(target) var/turf/T = get_turf(hit_atom)
var/datum/thrownthing/D = throwingdatum var/datum/thrownthing/D = throwingdatum
if(isliving(target)) if(isliving(hit_atom))
var/mob/living/L = target var/mob/living/L = hit_atom
if(iscultist(L)) if(iscultist(L))
playsound(src, 'sound/weapons/throwtap.ogg', 50) playsound(src, 'sound/weapons/throwtap.ogg', 50)
if(L.put_in_active_hand(src)) if(L.put_in_active_hand(src))

View File

@@ -380,7 +380,7 @@
user.dropItemToGround(src) user.dropItemToGround(src)
scatter() scatter()
/obj/item/ectoplasm/revenant/throw_impact(atom/hit_atom) /obj/item/ectoplasm/revenant/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..() ..()
if(inert) if(inert)
return return

View File

@@ -142,7 +142,7 @@
. = ..() . = ..()
olddir = dir olddir = dir
/obj/item/assembly/infra/throw_impact() /obj/item/assembly/infra/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..() . = ..()
if(!olddir) if(!olddir)
return return

View File

@@ -130,10 +130,10 @@
return FALSE return FALSE
/obj/item/assembly/mousetrap/hitby(A as mob|obj) /obj/item/assembly/mousetrap/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(!armed) if(!armed)
return ..() return ..()
visible_message("<span class='warning'>[src] is triggered by [A].</span>") visible_message("<span class='warning'>[src] is triggered by [AM].</span>")
triggered(null) triggered(null)

View File

@@ -213,9 +213,9 @@ GLOBAL_LIST_INIT(hallucination_list, list(
. = ..() . = ..()
name = "alien hunter ([rand(1, 1000)])" name = "alien hunter ([rand(1, 1000)])"
/obj/effect/hallucination/simple/xeno/throw_impact(A) /obj/effect/hallucination/simple/xeno/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
update_icon("alienh_pounce") update_icon("alienh_pounce")
if(A == target && target.stat!=DEAD) if(hit_atom == target && target.stat!=DEAD)
target.Paralyze(100) target.Paralyze(100)
target.visible_message("<span class='danger'>[target] flails around wildly.</span>","<span class ='userdanger'>[name] pounces on you!</span>") target.visible_message("<span class='danger'>[target] flails around wildly.</span>","<span class ='userdanger'>[name] pounces on you!</span>")
@@ -1291,4 +1291,4 @@ GLOBAL_LIST_INIT(hallucination_list, list(
H.hal_target = target H.hal_target = target
H.preparePixelProjectile(target, start) H.preparePixelProjectile(target, start)
H.fire() H.fire()
qdel(src) qdel(src)

View File

@@ -101,10 +101,10 @@
to_chat(user, "<span class='notice'>You heat [name] with [I]!</span>") to_chat(user, "<span class='notice'>You heat [name] with [I]!</span>")
..() ..()
/obj/item/reagent_containers/food/drinks/throw_impact(atom/target, datum/thrownthing/throwinfo) /obj/item/reagent_containers/food/drinks/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..() . = ..()
if(!.) //if the bottle wasn't caught if(!.) //if the bottle wasn't caught
smash(target, throwinfo?.thrower, TRUE) smash(hit_atom, throwingdatum?.thrower, TRUE)
/obj/item/reagent_containers/food/drinks/proc/smash(atom/target, mob/thrower, ranged = FALSE) /obj/item/reagent_containers/food/drinks/proc/smash(atom/target, mob/thrower, ranged = FALSE)
if(!isGlass) if(!isGlass)

View File

@@ -418,7 +418,7 @@
isGlass = FALSE isGlass = FALSE
return return
/obj/item/reagent_containers/food/drinks/bottle/molotov/throw_impact(atom/target,datum/thrownthing/throwdata) /obj/item/reagent_containers/food/drinks/bottle/molotov/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
var/firestarter = 0 var/firestarter = 0
for(var/datum/reagent/R in reagents.reagent_list) for(var/datum/reagent/R in reagents.reagent_list)
for(var/A in accelerants) for(var/A in accelerants)
@@ -426,8 +426,8 @@
firestarter = 1 firestarter = 1
break break
if(firestarter && active) if(firestarter && active)
target.fire_act() hit_atom.fire_act()
new /obj/effect/hotspot(get_turf(target)) new /obj/effect/hotspot(get_turf(hit_atom))
..() ..()
/obj/item/reagent_containers/food/drinks/bottle/molotov/attackby(obj/item/I, mob/user, params) /obj/item/reagent_containers/food/drinks/bottle/molotov/attackby(obj/item/I, mob/user, params)

View File

@@ -31,7 +31,7 @@
var/color = mix_color_from_reagents(reagents.reagent_list) var/color = mix_color_from_reagents(reagents.reagent_list)
add_atom_colour(color, FIXED_COLOUR_PRIORITY) add_atom_colour(color, FIXED_COLOUR_PRIORITY)
/obj/item/reagent_containers/food/snacks/egg/throw_impact(atom/hit_atom) /obj/item/reagent_containers/food/snacks/egg/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) //was it caught by a mob? if(!..()) //was it caught by a mob?
var/turf/T = get_turf(hit_atom) var/turf/T = get_turf(hit_atom)
new/obj/effect/decal/cleanable/egg_smudge(T) new/obj/effect/decal/cleanable/egg_smudge(T)

View File

@@ -467,8 +467,8 @@
head.color = C head.color = C
add_overlay(head) add_overlay(head)
/obj/item/reagent_containers/food/snacks/lollipop/throw_impact(atom/A) /obj/item/reagent_containers/food/snacks/lollipop/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..(A) ..(hit_atom)
throw_speed = 1 throw_speed = 1
throwforce = 0 throwforce = 0
@@ -576,4 +576,4 @@
list_reagents = list("nutriment" = 1, "sugar" = 1, "cocoa" = 1) list_reagents = list("nutriment" = 1, "sugar" = 1, "cocoa" = 1)
filling_color = "#A0522D" filling_color = "#A0522D"
tastes = list("chocolate" = 1) tastes = list("chocolate" = 1)
foodtype = JUNKFOOD | SUGAR foodtype = JUNKFOOD | SUGAR

View File

@@ -29,7 +29,7 @@
foodtype = GRAIN | DAIRY | SUGAR foodtype = GRAIN | DAIRY | SUGAR
var/stunning = TRUE var/stunning = TRUE
/obj/item/reagent_containers/food/snacks/pie/cream/throw_impact(atom/hit_atom) /obj/item/reagent_containers/food/snacks/pie/cream/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..() . = ..()
if(!.) //if we're not being caught if(!.) //if we're not being caught
splat(hit_atom) splat(hit_atom)

View File

@@ -228,7 +228,7 @@
if(boxes.len >= 3 && prob(25 * boxes.len)) if(boxes.len >= 3 && prob(25 * boxes.len))
disperse_pizzas() disperse_pizzas()
/obj/item/pizzabox/throw_impact(atom/movable/AM) /obj/item/pizzabox/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(boxes.len >= 2 && prob(20 * boxes.len)) if(boxes.len >= 2 && prob(20 * boxes.len))
disperse_pizzas() disperse_pizzas()

View File

@@ -80,7 +80,7 @@
item_state = "dodgeball" item_state = "dodgeball"
desc = "Used for playing the most violent and degrading of childhood games." desc = "Used for playing the most violent and degrading of childhood games."
/obj/item/toy/beach_ball/holoball/dodgeball/throw_impact(atom/hit_atom) /obj/item/toy/beach_ball/holoball/dodgeball/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..() ..()
if((ishuman(hit_atom))) if((ishuman(hit_atom)))
var/mob/living/carbon/M = hit_atom var/mob/living/carbon/M = hit_atom
@@ -123,7 +123,7 @@
else else
..() ..()
/obj/structure/holohoop/hitby(atom/movable/AM) /obj/structure/holohoop/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if (isitem(AM) && !istype(AM,/obj/item/projectile)) if (isitem(AM) && !istype(AM,/obj/item/projectile))
if(prob(50)) if(prob(50))
AM.forceMove(get_turf(src)) AM.forceMove(get_turf(src))

View File

@@ -91,7 +91,7 @@
squash(user) squash(user)
..() ..()
/obj/item/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom) /obj/item/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) //was it caught by a mob? if(!..()) //was it caught by a mob?
if(seed) if(seed)
for(var/datum/plant_gene/trait/T in seed.genes) for(var/datum/plant_gene/trait/T in seed.genes)

View File

@@ -47,7 +47,7 @@
return 1 return 1
return 0 return 0
/obj/item/grown/throw_impact(atom/hit_atom) /obj/item/grown/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) //was it caught by a mob? if(!..()) //was it caught by a mob?
if(seed) if(seed)
for(var/datum/plant_gene/trait/T in seed.genes) for(var/datum/plant_gene/trait/T in seed.genes)

View File

@@ -99,7 +99,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
recipes = GLOB.sand_recipes recipes = GLOB.sand_recipes
. = ..() . = ..()
/obj/item/stack/ore/glass/throw_impact(atom/hit_atom) /obj/item/stack/ore/glass/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(..() || !ishuman(hit_atom)) if(..() || !ishuman(hit_atom))
return return
var/mob/living/carbon/human/C = hit_atom var/mob/living/carbon/human/C = hit_atom

View File

@@ -5,7 +5,7 @@
/mob/living/carbon/alien/get_ear_protection() /mob/living/carbon/alien/get_ear_protection()
return 2 //no ears return 2 //no ears
/mob/living/carbon/alien/hitby(atom/movable/AM, skipcatch, hitpush) /mob/living/carbon/alien/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
..(AM, skipcatch = TRUE, hitpush = FALSE) ..(AM, skipcatch = TRUE, hitpush = FALSE)

View File

@@ -54,18 +54,18 @@
weather_immunities -= "lava" weather_immunities -= "lava"
update_icons() update_icons()
/mob/living/carbon/alien/humanoid/hunter/throw_impact(atom/A) /mob/living/carbon/alien/humanoid/hunter/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!leaping) if(!leaping)
return ..() return ..()
pounce_cooldown = world.time + pounce_cooldown_time pounce_cooldown = world.time + pounce_cooldown_time
if(A) if(hit_atom)
if(isliving(A)) if(isliving(hit_atom))
var/mob/living/L = A var/mob/living/L = hit_atom
var/blocked = FALSE var/blocked = FALSE
if(ishuman(A)) if(ishuman(hit_atom))
var/mob/living/carbon/human/H = A var/mob/living/carbon/human/H = hit_atom
if(H.check_shields(src, 0, "the [name]", attack_type = LEAP_ATTACK)) if(H.check_shields(src, 0, "the [name]", attack_type = LEAP_ATTACK))
blocked = TRUE blocked = TRUE
if(!blocked) if(!blocked)
@@ -77,8 +77,8 @@
Paralyze(40, 1, 1) Paralyze(40, 1, 1)
toggle_leap(0) toggle_leap(0)
else if(A.density && !A.CanPass(src)) else if(hit_atom.density && !hit_atom.CanPass(src))
visible_message("<span class ='danger'>[src] smashes into [A]!</span>", "<span class ='alertalien'>[src] smashes into [A]!</span>") visible_message("<span class ='danger'>[src] smashes into [hit_atom]!</span>", "<span class ='alertalien'>[src] smashes into [hit_atom]!</span>")
Paralyze(40, 1, 1) Paralyze(40, 1, 1)
if(leaping) if(leaping)

View File

@@ -112,7 +112,7 @@
if(icon_state == "[initial(icon_state)]_thrown") if(icon_state == "[initial(icon_state)]_thrown")
icon_state = "[initial(icon_state)]" icon_state = "[initial(icon_state)]"
/obj/item/clothing/mask/facehugger/throw_impact(atom/hit_atom) /obj/item/clothing/mask/facehugger/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..() ..()
if(stat == CONSCIOUS) if(stat == CONSCIOUS)
icon_state = "[initial(icon_state)]" icon_state = "[initial(icon_state)]"

View File

@@ -93,7 +93,7 @@
return 1 return 1
return ..() return ..()
/mob/living/carbon/throw_impact(atom/hit_atom, throwingdatum) /mob/living/carbon/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..() . = ..()
var/hurt = TRUE var/hurt = TRUE
if(istype(throwingdatum, /datum/thrownthing)) if(istype(throwingdatum, /datum/thrownthing))

View File

@@ -60,7 +60,7 @@
return return
return TRUE return TRUE
/mob/living/carbon/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE) /mob/living/carbon/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(!skipcatch) //ugly, but easy if(!skipcatch) //ugly, but easy
if(can_catch_item()) if(can_catch_item())
if(istype(AM, /obj/item)) if(istype(AM, /obj/item))

View File

@@ -117,7 +117,7 @@
return TRUE return TRUE
return FALSE return FALSE
/mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE) /mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(dna && dna.species) if(dna && dna.species)
var/spec_return = dna.species.spec_hitby(AM, src) var/spec_return = dna.species.spec_hitby(AM, src)
if(spec_return) if(spec_return)

View File

@@ -401,7 +401,7 @@
retaliate(Proj.firer) retaliate(Proj.firer)
..() ..()
/mob/living/carbon/monkey/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE) /mob/living/carbon/monkey/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(istype(AM, /obj/item)) if(istype(AM, /obj/item))
var/obj/item/I = AM var/obj/item/I = AM
if(I.throwforce < src.health && I.thrownby && ishuman(I.thrownby)) if(I.throwforce < src.health && I.thrownby && ishuman(I.thrownby))

View File

@@ -157,7 +157,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
bike_horn(A) bike_horn(A)
/mob/living/simple_animal/bot/honkbot/hitby(atom/movable/AM, skipcatch = 0, hitpush = 1, blocked = 0) /mob/living/simple_animal/bot/honkbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(istype(AM, /obj/item)) if(istype(AM, /obj/item))
playsound(src, honksound, 50, TRUE, -1) playsound(src, honksound, 50, TRUE, -1)
var/obj/item/I = AM var/obj/item/I = AM
@@ -368,4 +368,4 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
..() ..()
/obj/machinery/bot_core/honkbot /obj/machinery/bot_core/honkbot
req_one_access = list(ACCESS_THEATRE, ACCESS_ROBOTICS) req_one_access = list(ACCESS_THEATRE, ACCESS_ROBOTICS)

View File

@@ -220,7 +220,7 @@ Auto Patrol: []"},
..() ..()
/mob/living/simple_animal/bot/secbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE) /mob/living/simple_animal/bot/secbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(istype(AM, /obj/item)) if(istype(AM, /obj/item))
var/obj/item/I = AM var/obj/item/I = AM
if(I.throwforce < src.health && I.thrownby && ishuman(I.thrownby)) if(I.throwforce < src.health && I.thrownby && ishuman(I.thrownby))

View File

@@ -47,18 +47,18 @@
if(!charging) if(!charging)
..() ..()
/mob/living/simple_animal/hostile/guardian/charger/throw_impact(atom/A) /mob/living/simple_animal/hostile/guardian/charger/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!charging) if(!charging)
return ..() return ..()
else if(A) else if(hit_atom)
if(isliving(A) && A != summoner) if(isliving(hit_atom) && hit_atom != summoner)
var/mob/living/L = A var/mob/living/L = hit_atom
var/blocked = FALSE var/blocked = FALSE
if(hasmatchingsummoner(A)) //if the summoner matches don't hurt them if(hasmatchingsummoner(hit_atom)) //if the summoner matches don't hurt them
blocked = TRUE blocked = TRUE
if(ishuman(A)) if(ishuman(hit_atom))
var/mob/living/carbon/human/H = A var/mob/living/carbon/human/H = hit_atom
if(H.check_shields(src, 90, "[name]", attack_type = THROWN_PROJECTILE_ATTACK)) if(H.check_shields(src, 90, "[name]", attack_type = THROWN_PROJECTILE_ATTACK))
blocked = TRUE blocked = TRUE
if(!blocked) if(!blocked)

View File

@@ -249,7 +249,7 @@
/mob/living/simple_animal/hostile/jungle/leaper/Goto() /mob/living/simple_animal/hostile/jungle/leaper/Goto()
return return
/mob/living/simple_animal/hostile/jungle/leaper/throw_impact() /mob/living/simple_animal/hostile/jungle/leaper/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
return return
/mob/living/simple_animal/hostile/jungle/leaper/update_icons() /mob/living/simple_animal/hostile/jungle/leaper/update_icons()

View File

@@ -147,7 +147,7 @@
update_icons() update_icons()
Goto(target, move_to_delay, minimum_distance) Goto(target, move_to_delay, minimum_distance)
/mob/living/simple_animal/hostile/jungle/mook/throw_impact(atom/hit_atom, throwingdatum) /mob/living/simple_animal/hostile/jungle/mook/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..() . = ..()
if(isliving(hit_atom) && attack_state == MOOK_ATTACK_ACTIVE) if(isliving(hit_atom) && attack_state == MOOK_ATTACK_ACTIVE)
var/mob/living/L = hit_atom var/mob/living/L = hit_atom

View File

@@ -156,12 +156,12 @@ Difficulty: Hard
DestroySurroundings() DestroySurroundings()
..() ..()
/mob/living/simple_animal/hostile/megafauna/bubblegum/throw_impact(atom/A) /mob/living/simple_animal/hostile/megafauna/bubblegum/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!charging) if(!charging)
return ..() return ..()
else if(isliving(A)) else if(isliving(hit_atom))
var/mob/living/L = A var/mob/living/L = hit_atom
L.visible_message("<span class='danger'>[src] slams into [L]!</span>", "<span class='userdanger'>[src] slams into you!</span>") L.visible_message("<span class='danger'>[src] slams into [L]!</span>", "<span class='userdanger'>[src] slams into you!</span>")
L.apply_damage(40, BRUTE) L.apply_damage(40, BRUTE)
playsound(get_turf(L), 'sound/effects/meteorimpact.ogg', 100, 1) playsound(get_turf(L), 'sound/effects/meteorimpact.ogg', 100, 1)
@@ -235,4 +235,4 @@ Difficulty: Hard
return 1 return 1
return 0 return 0
#undef MEDAL_PREFIX #undef MEDAL_PREFIX

View File

@@ -45,7 +45,7 @@
visible_message("<span class='danger'>[P] has a reduced effect on [src]!</span>") visible_message("<span class='danger'>[P] has a reduced effect on [src]!</span>")
..() ..()
/mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/AM)//No floor tiling them to death, wiseguy /mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) //No floor tiling them to death, wiseguy
if(istype(AM, /obj/item)) if(istype(AM, /obj/item))
var/obj/item/T = AM var/obj/item/T = AM
if(!stat) if(!stat)

View File

@@ -170,7 +170,7 @@
if(M.a_intent == INTENT_HARM) if(M.a_intent == INTENT_HARM)
Bruise() Bruise()
/mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/AM) /mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
..() ..()
if(istype(AM, /obj/item)) if(istype(AM, /obj/item))
var/obj/item/T = AM var/obj/item/T = AM

View File

@@ -56,7 +56,7 @@
//If we hit the Ninja who owns this Katana, they catch it. //If we hit the Ninja who owns this Katana, they catch it.
//Works for if the Ninja throws it or it throws itself or someone tries //Works for if the Ninja throws it or it throws itself or someone tries
//To throw it at the ninja //To throw it at the ninja
/obj/item/energy_katana/throw_impact(atom/hit_atom) /obj/item/energy_katana/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(ishuman(hit_atom)) if(ishuman(hit_atom))
var/mob/living/carbon/human/H = hit_atom var/mob/living/carbon/human/H = hit_atom
if(istype(H.wear_suit, /obj/item/clothing/suit/space/space_ninja)) if(istype(H.wear_suit, /obj/item/clothing/suit/space/space_ninja))

View File

@@ -96,7 +96,7 @@
/obj/item/paperplane/throw_at(atom/target, range, speed, mob/thrower, spin=FALSE, diagonals_first = FALSE, datum/callback/callback) /obj/item/paperplane/throw_at(atom/target, range, speed, mob/thrower, spin=FALSE, diagonals_first = FALSE, datum/callback/callback)
. = ..(target, range, speed, thrower, FALSE, diagonals_first, callback) . = ..(target, range, speed, thrower, FALSE, diagonals_first, callback)
/obj/item/paperplane/throw_impact(atom/hit_atom) /obj/item/paperplane/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(iscarbon(hit_atom)) if(iscarbon(hit_atom))
var/mob/living/carbon/C = hit_atom var/mob/living/carbon/C = hit_atom
if(C.can_catch_item(TRUE)) if(C.can_catch_item(TRUE))

View File

@@ -759,7 +759,7 @@
/obj/item/light/bulb/broken /obj/item/light/bulb/broken
status = LIGHT_BROKEN status = LIGHT_BROKEN
/obj/item/light/throw_impact(atom/hit_atom) /obj/item/light/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) //not caught by a mob if(!..()) //not caught by a mob
shatter() shatter()

View File

@@ -65,7 +65,7 @@
else else
return ..() return ..()
/obj/item/ammo_casing/throw_impact(atom/A) /obj/item/ammo_casing/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(heavy_metal) if(heavy_metal)
bounce_away(FALSE, NONE) bounce_away(FALSE, NONE)
. = ..() . = ..()

View File

@@ -71,9 +71,9 @@
reagents.expose_temperature(exposed_temperature) reagents.expose_temperature(exposed_temperature)
..() ..()
/obj/item/reagent_containers/throw_impact(atom/target) /obj/item/reagent_containers/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..() . = ..()
SplashReagents(target, TRUE) SplashReagents(hit_atom, TRUE)
/obj/item/reagent_containers/proc/bartender_check(atom/target) /obj/item/reagent_containers/proc/bartender_check(atom/target)
. = FALSE . = FALSE
@@ -122,4 +122,4 @@
..() ..()
/obj/item/reagent_containers/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) /obj/item/reagent_containers/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
reagents.expose_temperature(exposed_temperature) reagents.expose_temperature(exposed_temperature)

View File

@@ -334,7 +334,7 @@
. = TRUE . = TRUE
/obj/machinery/disposal/bin/hitby(atom/movable/AM) /obj/machinery/disposal/bin/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(isitem(AM) && AM.CanEnterDisposals()) if(isitem(AM) && AM.CanEnterDisposals())
if(prob(75)) if(prob(75))
AM.forceMove(src) AM.forceMove(src)

View File

@@ -363,7 +363,7 @@
icon_state = "snappop" icon_state = "snappop"
w_class = WEIGHT_CLASS_TINY w_class = WEIGHT_CLASS_TINY
/obj/item/spellpacket/lightningbolt/throw_impact(atom/hit_atom) /obj/item/spellpacket/lightningbolt/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) if(!..())
if(isliving(hit_atom)) if(isliving(hit_atom))
var/mob/living/M = hit_atom var/mob/living/M = hit_atom

View File

@@ -112,7 +112,7 @@
else else
return ..() return ..()
/obj/item/bodypart/throw_impact(atom/hit_atom) /obj/item/bodypart/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..() ..()
if(status != BODYPART_ROBOTIC) if(status != BODYPART_ROBOTIC)
playsound(get_turf(src), 'sound/misc/splort.ogg', 50, 1, -1) playsound(get_turf(src), 'sound/misc/splort.ogg', 50, 1, -1)