Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FaNshot shells #37260

Open
wants to merge 20 commits into
base: Bleeding-Edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions code/datums/gamemode/factions/bloodcult/bloodcult_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -981,18 +981,18 @@ var/list/arcane_tomes = list()
overlays += I


/obj/item/weapon/melee/soulblade/throw_at(var/atom/targ, var/range, var/speed, var/override = 1, var/fly_speed = 0)
/obj/item/weapon/melee/soulblade/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
var/turf/starting = get_turf(src)
var/turf/target = get_turf(targ)
var/turf/second_target = target
var/turf/targ = get_turf(target)
var/turf/second_target = targ
var/obj/item/projectile/soulbullet/SB = new (starting)
SB.original = target
SB.target = target
SB.original = targ
SB.target = targ
SB.current = starting
SB.starting = starting
SB.secondary_target = second_target
SB.yo = target.y - starting.y
SB.xo = target.x - starting.x
SB.yo = targ.y - starting.y
SB.xo = targ.x - starting.x
SB.shade = shade
SB.blade = src
src.forceMove(SB)
Expand Down Expand Up @@ -1172,16 +1172,16 @@ var/list/arcane_tomes = list()
/obj/item/weapon/melee/blood_dagger/pre_throw(atom/movable/target)
absorbed = 1

/obj/item/weapon/melee/blood_dagger/throw_at(var/atom/targ, var/range, var/speed, var/override = 1, var/fly_speed = 0)
/obj/item/weapon/melee/blood_dagger/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
var/turf/starting = get_turf(src)
var/turf/target = get_turf(targ)
var/turf/targ = get_turf(target)
var/obj/item/projectile/blooddagger/BD = new (starting)
BD.original = target
BD.target = target
BD.original = targ
BD.target = targ
BD.current = starting
BD.starting = starting
BD.yo = target.y - starting.y
BD.xo = target.x - starting.x
BD.yo = targ.y - starting.y
BD.xo = targ.x - starting.x
BD.stacks = stacks
BD.damage = 5 + stacks * 5
BD.icon_state = icon_state
Expand Down
4 changes: 2 additions & 2 deletions code/datums/gamemode/role/ninja.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ var/list/valid_ninja_suits = list(
L.throw_item(target)
return 1

/obj/item/stack/shuriken/throw_at(var/atom/A, throw_range, throw_speed)
/obj/item/stack/shuriken/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
var/datum/role/ninja/N = H.mind.GetRole(NINJA)
Expand All @@ -147,7 +147,7 @@ var/list/valid_ninja_suits = list(
if(amount>1)
use(1)
var/obj/item/stack/shuriken/S = new(loc)
S.throw_at(A, throw_range, throw_speed)
S.throw_at(target, range, speed, override, fly_speed, whitelist, superthrow)
H.put_in_hands(src)
//statistics collection: ninja shuriken thrown
if(istype(N.stat_datum, /datum/stat/role/ninja))
Expand Down
8 changes: 8 additions & 0 deletions code/datums/uplink_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,14 @@ var/list/discounted_items_of_the_round = list()
discounted_cost = 12
jobs_with_discount = list("Warden", "Head of Security")

/datum/uplink_item/jobspecific/command_security/superfanshot
name = "12 Gauge High Force FaNshot Shells"
desc = "The true force of nature, this box contains six modified syndicate FaNshots compress the knockback power within these shells further via reverse-engineered bluespace technology to deliver double the punch of an ordinary FaNshot. For further knockback, stand nearer to your target."
item = /obj/item/weapon/storage/box/syndie_kit/fan
cost = 12
discounted_cost = 8
jobs_with_discount = list("Warden", "Head of Security", "Bartender")

/datum/uplink_item/jobspecific/command_security/evidenceforger
name = "Evidence Forger"
desc = "A hacked evidence scanner that allows you to forge evidence by setting a specific output that will apply on the next item scan only. Keep Security Records handy to input all requested data. Concealed as long as the evidence forger itself is not interacted with."
Expand Down
14 changes: 7 additions & 7 deletions code/defines/obj/weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ var/list/available_redphone_names3 = list("1","2","3","4","5","6","7","8","9")
to_chat(viewers(user), "<span class='danger'>[user] is wrapping the [src.name] around \his neck! It looks like \he's trying to commit suicide.</span>")
return(SUICIDE_ACT_OXYLOSS)

/obj/item/weapon/legcuffs/bolas/throw_at(var/atom/A, throw_range, throw_speed)
/obj/item/weapon/legcuffs/bolas/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
if(!throw_range)
return //divide by zero, also you throw like a girl
if(istype(usr, /mob/living/carbon/human)) //if the user is human
Expand All @@ -241,16 +241,16 @@ var/list/available_redphone_names3 = list("1","2","3","4","5","6","7","8","9")
H.Stun(2)
H.drop_item(src)
return
var/turf/target = get_turf(A)
var/turf/targ = get_turf(target)
var/new_x = src.x
var/new_y = src.y
var/scaler //used to changed the normalised vector to the proper size
scaler = throw_range / max(abs(target.x - src.x), abs(target.y - src.y),1) //whichever is larger magnitude is what we normalise to
if (target.x - src.x != 0) //just to avoid fucking with math for no reason
var/xadjust = round((target.x - src.x) * scaler) //normalised vector is now scaled up to throw_range
scaler = throw_range / max(abs(targ.x - src.x), abs(targ.y - src.y),1) //whichever is larger magnitude is what we normalise to
if (targ.x - src.x != 0) //just to avoid fucking with math for no reason
var/xadjust = round((targ.x - src.x) * scaler) //normalised vector is now scaled up to throw_range
new_x = src.x + xadjust //the new target at max range
if (target.y - src.y != 0)
var/yadjust = round((target.y - src.y) * scaler)
if (targ.y - src.y != 0)
var/yadjust = round((targ.y - src.y) * scaler)
new_y = src.y + yadjust
// log_admin("Adjusted target of [adjtarget.x] and [adjtarget.y], adjusted with [xadjust] and [yadjust] from [scaler]")
..(locate(new_x, new_y, src.z), throw_range, throw_speed)
Expand Down
7 changes: 5 additions & 2 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
var/obj/effect/afterimage/richter_tackle/RT = new (loc,src)
RT.overlays += image('icons/effects/effects.dmi', src, "castlevania_tackle", dir = turn(SOUTH, 90 * afterimage_step))

/atom/movable/proc/throw_at(atom/target, range, speed, override = TRUE, var/fly_speed = 0, var/list/whitelist) //fly_speed parameter: if 0, does nothing. Otherwise, changes how fast the object flies WITHOUT affecting damage!
/atom/movable/proc/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE) //fly_speed parameter: if 0, does nothing. Otherwise, changes how fast the object flies WITHOUT affecting damage!
set waitfor = FALSE
if(!target || !src)
return 0
Expand All @@ -614,6 +614,9 @@
var/afterimage = get_afterimage()
var/afterimage_step = 0

if(superthrow)
src.throwing = 2

var/dist_x = abs(target.x - src.x)
var/dist_y = abs(target.y - src.y)

Expand Down Expand Up @@ -1288,7 +1291,7 @@
CRASH("border_dummy was collision checked while not locked to anything! ([x], [y], [z])")
return (mover == locked_to) || locked_to.border_dummy_Cross(mover) //An object will hit its own border_dummy if the (mover == locked_to) isn't included.

/atom/movable/border_dummy/throw_at(atom/target, range, speed, override = 1, var/fly_speed = 0)
/atom/movable/border_dummy/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
return //It wouldn't actually move even without this override, but it would still hit things on its own tile.

/atom/movable/border_dummy/get_bump_target()
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/blob/overmind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
else
to_chat(src, "<span class='warning'>Unable to make the jump. Looks like all the blobs in a large radius around the target have been destroyed.</span>")

/mob/camera/blob/throw_at(var/atom/targ, var/range, var/speed, var/override = 1, var/fly_speed = 0)
/mob/camera/blob/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
return

/mob/camera/blob/proc/update_health()
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/endgame/xmas/snow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ var/list/snowsound = list('sound/misc/snow1.ogg', 'sound/misc/snow2.ogg', 'sound
TS.wet(100)
qdel(src)

/obj/item/stack/sheet/snow/throw_at(atom/target, range, speed)
/obj/item/stack/sheet/snow/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
playsound(src.loc, 'sound/weapons/punchmiss.ogg', 50, 1)
..()

Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/meteor/meteors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ var/list/meteor_warnings = list()
if(end)
throw_at(end)

/obj/item/projectile/meteor/throw_at(atom/end)
original = end
/obj/item/projectile/meteor/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
original = target
starting = loc
current = loc
OnFired()
Expand Down
2 changes: 2 additions & 0 deletions code/game/machinery/ammolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
new /obj/item/ammo_storage/box/a75(), \
new /obj/item/ammo_casing/shotgun/dragonsbreath(), \
new /obj/item/weapon/storage/box/dragonsbreathshells(), \
new /obj/item/ammo_casing/shotgun/fanshot(), \
new /obj/item/weapon/storage/box/fanshotshells(), \
)
)

Expand Down
2 changes: 1 addition & 1 deletion code/game/mecha/combat/marauder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
else
icon_state = initial_icon

/obj/mecha/combat/marauder/throw_at(var/atom/obstacle)
/obj/mecha/combat/marauder/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
if (!throwing)
icon_state = initial_icon + "-dash"
overlays |= rockets
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/trader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
if(loc != myvac)
retract()

/obj/item/vachandle/throw_at()
/obj/item/vachandle/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
retract()

/obj/item/vachandle/proc/mob_moved(atom/movable/mover)
Expand Down
14 changes: 7 additions & 7 deletions code/game/objects/items/weapons/boomerang.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@
throw_mult += (H.get_strength()-1)/2 //For each level of strength above 1, add 0.5
return ..()

/obj/item/weapon/boomerang/throw_at(var/atom/targ, var/range, var/speed, var/override = 1, var/fly_speed = 0)
/obj/item/weapon/boomerang/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
var/turf/starting = get_turf(src)
var/turf/target = get_turf(targ)
var/turf/targ = get_turf(target)
var/obj/item/projectile/boomerang/B = new (starting)
B.name = name
B.desc = desc
B.original = target
B.target = target
B.original = targ
B.target = targ
B.current = starting
B.starting = starting
B.yo = target.y - starting.y
B.xo = target.x - starting.x
B.yo = targ.y - starting.y
B.xo = targ.x - starting.x
//B.damage = throwforce //Actual damage is down by calls to throw_impact(). The projectile damage should remain at zero unless you want to break open crates with it
B.projectile_speed = 0.66/throw_mult
B.icon_state = "[icon_state]-spin"
Expand Down Expand Up @@ -326,7 +326,7 @@
..()
update_moody_light(icon, "[icon_state]-moody")

/obj/item/weapon/boomerang/throw_at(var/atom/targ, var/range, var/speed, var/override = 1, var/fly_speed = 0)
/obj/item/weapon/boomerang/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
plane = ABOVE_LIGHTING_PLANE
..()

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/melee/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
/obj/item/weapon/melee/energy/hfmachete/dropped(mob/user)
user.unregister_event(/event/moved, src, nameof(src::mob_moved()))

/obj/item/weapon/melee/energy/hfmachete/throw_at(atom/target, range, speed, override = 1)
/obj/item/weapon/melee/energy/hfmachete/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
if(!usr)
return ..()
spawn()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/bible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
actions_types = list(/datum/action/item_action/convert)
rustle_sound = "pageturn"

/obj/item/weapon/storage/bible/throw_at(var/atom/targ, var/range, var/speed, var/override = 1, var/fly_speed = 0)
/obj/item/weapon/storage/bible/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
var/mob/living/user = usr
if (istype(user) && istype(my_rel, /datum/religion/belmont) && user?.mind && istype(user.mind.faith, /datum/religion/belmont))
new /obj/effect/bible_spin(get_turf(src),usr,src)
Expand Down
10 changes: 10 additions & 0 deletions code/game/objects/items/weapons/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,16 @@
can_add_storageslots = TRUE
items_to_spawn = list(/obj/item/ammo_casing/shotgun/buckshot = 16)

/obj/item/weapon/storage/box/fanshotshells
name = "12-gauge FaNshot shells"
icon_state = "stun_shells"
can_add_storageslots = TRUE
items_to_spawn = list(/obj/item/ammo_casing/shotgun/fanshot = 16)

/obj/item/weapon/storage/box/fanshotshells/super
name = "12-gauge high force FaNshot shells"
items_to_spawn = list(/obj/item/ammo_casing/shotgun/fanshot/super = 16)

/obj/item/weapon/storage/box/dragonsbreathshells
name = "12-gauge dragon's breath shells"
icon_state = "dragonsbreath_shells"
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@
/obj/item/weapon/storage/attack_paw(mob/user as mob)
return attack_hand(user)

/obj/item/weapon/storage/throw_at()
/obj/item/weapon/storage/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
close_all() //How are you going to see whats inside this thing while throwing it
..()

Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/weapons/storage/uplink_kits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@
name = "Shotgun shells"
items_to_spawn = list(/obj/item/ammo_casing/shotgun/fakebeanbag = 6)

/obj/item/weapon/storage/box/syndie_kit/fan
name = "Shotgun shells"
items_to_spawn = list(/obj/item/ammo_casing/shotgun/fanshot/super/syndie = 6)

/obj/item/weapon/storage/box/syndie_kit/ammo
name = "box (spare ammo)"
items_to_spawn = list(/obj/item/ammo_storage/speedloader/a357)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/events/immovablerod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ var/list/all_rods = list()
I.plane = relative_plane(PLATING_PLANE-1)
overlays += I

/obj/item/projectile/immovablerod/throw_at(atom/end)
/obj/item/projectile/immovablerod/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
for(var/mob/dead/observer/people in observers)
to_chat(people, "<span class = 'notice'>\A [src] has been thrown at the station, [formatFollow(src,"Follow it")]</span>")
original = end
original = target
starting = loc
current = loc
OnFired()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/alien/larva/facehugger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
return Attach(H)
return FALSE

/obj/item/clothing/mask/facehugger/throw_at(atom/target, range, speed)
/obj/item/clothing/mask/facehugger/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
..()
if(stat == CONSCIOUS)
icon_state = "[initial(icon_state)]_thrown"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/painting/paint_bucket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var/global/list/paint_types = subtypesof(/datum/reagent/paint)
if (prob(10))
add_spots()

/obj/item/weapon/reagent_containers/glass/metal_bucket/throw_at(atom/target, range, speed)
/obj/item/weapon/reagent_containers/glass/metal_bucket/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
..()
add_spots(2)

Expand Down
6 changes: 3 additions & 3 deletions code/modules/paperwork/paper_folded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
return
return ..()

/obj/item/weapon/p_folded/throw_at(var/atom/A, throw_range, throw_speed)
/obj/item/weapon/p_folded/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
pixel_y = rand(-7, 7) * PIXEL_MULTIPLIER
pixel_x = rand(-8, 8) * PIXEL_MULTIPLIER
..()
Expand Down Expand Up @@ -126,8 +126,8 @@
H.eye_blurry = max(H.eye_blurry, rand(3,6))
H.eye_blind = max(H.eye_blind, src.nano)
//at last, my block at a rest, bereft of all mortal doubts, I have been enlightened, touched by the sage wisdom, my undying gratitude goes to Comic in this emotional moment
/obj/item/weapon/p_folded/plane/throw_at(var/atom/A, throw_range, throw_speed)
if (A.x > src.x)
/obj/item/weapon/p_folded/plane/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
if (target.x > src.x)
src.icon_state = "plane_east"
else
src.icon_state = "plane_west"
Expand Down
18 changes: 18 additions & 0 deletions code/modules/projectiles/ammunition/bullets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,24 @@
projectile_type = /obj/item/projectile/bullet/weakbullet/booze
starting_materials = list(MAT_IRON = 250)

/obj/item/ammo_casing/shotgun/fanshot
name = "FaNshot shell"
desc = "A shell capable of knockback force."
icon_state = "fsshell"
projectile_type = /obj/item/projectile/bullet/weakbullet/fanshot
starting_materials = list(MAT_IRON = 250)

/obj/item/ammo_casing/shotgun/fanshot/super
name = "high force FaNshot shell"
desc = "A shell capable of more powerful knockback force."
projectile_type = /obj/item/projectile/bullet/weakbullet/fanshot/super
mech_flags = MECH_SCAN_ILLEGAL

/obj/item/ammo_casing/shotgun/fanshot/super/syndie
name = "beanbag shell"
desc = "A weak beanbag shell."
icon_state = "bshell"

/obj/item/ammo_casing/shotgun/stunshell
name = "stun shell"
desc = "A stunning shell."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
var/isBouncing = FALSE //Prevents it bouncing infinitely due to some dark curse of throw_at()
var/lastBounceCount = 0

/obj/item/cannonball/bananium/throw_at(atom/target, range, speed, override = 1)
/obj/item/cannonball/bananium/throw_at(atom/target, range, speed, override = TRUE, fly_speed = 0, list/whitelist, superthrow = FALSE)
if(!cannonFired)
..()
else if(!isBouncing)
Expand Down
Loading
Loading