Skip to content

Commit

Permalink
sharpshooter
Browse files Browse the repository at this point in the history
  • Loading branch information
definitelynotspaghetti committed Dec 23, 2024
1 parent 1dcf8bb commit 537496d
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 88 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/movespeed_modification.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#define MOVESPEED_ID_HUNTER_DISGUISE "HUNTER_DISGUISE"
#define MOVESPEED_ID_SPIDER_VENOM "WIDOW_SPIDER_VENOM"

#define MOVESPEED_ID_SHARPSHOOTER_SLOWDOWN "SHARPSHOOTER_SLOWDOWN"

#define MOVESPEED_ID_MOB_WALK_RUN_CONFIG_SPEED "MOB_WALK_RUN"
#define MOVESPEED_ID_MOB_PARACETAMOL_SPEED "MOB_PARACETAMOL_RUN"
#define MOVESPEED_ID_MOB_NANITES_SPEED "MOB_NANITES_RUN"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
#define STATUS_EFFECT_SHATTER /datum/status_effect/shatter
//widow's ability
#define STATUS_EFFECT_SPIDER_VENOM /datum/status_effect/incapacitating/spider_venom
//ar-21 status effect
#define STATUS_EFFECT_SHARPSHOOTER /datum/status_effect/stacking/sharpshooter

/////////////
// NEUTRAL //
Expand Down
76 changes: 76 additions & 0 deletions code/datums/status_effects/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,82 @@
color = "#a7cc00"


// ***************************************
// *********** Sharpshooter
// ***************************************
///amount of slowdown done by the sharpshooter status effect
#define STATUS_EFFECT_SHARPSHOOTER_SLOWDOWN 1.5

/datum/status_effect/stacking/sharpshooter
id = "sharpshooter"
tick_interval = 1 SECONDS
max_stacks = 20
stack_threshold = 15
stack_decay = 2
consumed_on_threshold = FALSE
alert_type = /atom/movable/screen/alert/status_effect/sharpshooter
///Owner of the debuff is limited to carbons.
var/mob/living/carbon/debuff_owner
///Used for particles. Holds the particles instead of the mob. See particle_holder for documentation.
var/obj/effect/abstract/particle_holder/particle_holder

/datum/status_effect/stacking/sharpshooter/can_gain_stacks()
if(owner.status_flags & GODMODE)
return FALSE
return ..()

/datum/status_effect/stacking/sharpshooter/on_creation(mob/living/new_owner, stacks_to_apply)
if(new_owner.status_flags & GODMODE)
qdel(src)
return

. = ..()
debuff_owner = new_owner
particle_holder = new(debuff_owner, /particles/sharpshooter_status)
particle_holder.particles.spawning = 1 + round(stacks * 0.5)

/datum/status_effect/stacking/sharpshooter/on_remove()
debuff_owner = null
QDEL_NULL(particle_holder)
return ..()

/datum/status_effect/stacking/sharpshooter/tick()
. = ..()
if(!debuff_owner)
return

particle_holder.particles.spawning = 1 + round(stacks * 0.5)

/datum/status_effect/stacking/sharpshooter/threshold_cross_effect()
. = ..()
debuff_owner.add_movespeed_modifier(MOVESPEED_ID_SHARPSHOOTER_SLOWDOWN, TRUE, 0, NONE, TRUE, STATUS_EFFECT_SHARPSHOOTER_SLOWDOWN)
debuff_owner.balloon_alert_to_viewers("Slowed!")

/datum/status_effect/stacking/sharpshooter/on_threshold_drop()
debuff_owner.remove_movespeed_modifier(MOVESPEED_ID_SHARPSHOOTER_SLOWDOWN)

/atom/movable/screen/alert/status_effect/sharpshooter
name = "Sharpshooter"
desc = "You're slowed down and take additional damage!"
icon_state = "default"

/particles/sharpshooter_status
icon = 'icons/effects/particles/generic_particles.dmi'
icon_state = "down_arrow"
width = 100
height = 100
count = 1000
spawning = 4
lifespan = 10
fade = 8
velocity = list(0, 0)
position = generator(GEN_SPHERE, 16, 16, NORMAL_RAND)
drift = generator(GEN_VECTOR, list(-0.1, 0), list(0.1, 0))
gravity = list(0, -0.4)
scale = generator(GEN_VECTOR, list(0.3, 0.3), list(1, 1), NORMAL_RAND)
friction = -0.05
color = "#cdcdcd"

// ***************************************
// *********** Shatter
// ***************************************
Expand Down
15 changes: 1 addition & 14 deletions code/game/objects/machinery/vending/marine_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
/obj/item/ammo_magazine/rifle/type71/hp = -1,
/obj/item/weapon/gun/rifle/ar21 = -1,
/obj/item/ammo_magazine/rifle/ar21 = -1,
/obj/item/ammo_magazine/rifle/ar21/ap = -1,
/obj/item/ammo_magazine/rifle/ar21/hp = -1,
),
"Пистолеты-пулемёты" = list(
/obj/item/weapon/gun/smg/vector = -1,
Expand Down Expand Up @@ -197,12 +195,9 @@
/obj/item/ammo_magazine/packet/p10x24mm/ap = -1,
/obj/item/ammo_magazine/packet/p10x24mm/hp = -1,
/obj/item/ammo_magazine/packet/p10x25mm = -1,
/obj/item/ammo_magazine/packet/p10x25mm/ap = -1,
/obj/item/ammo_magazine/packet/p10x25mm/hp = -1,
/obj/item/ammo_magazine/packet/groza = -1,
/obj/item/ammo_magazine/packet/groza/ap = -1,
/obj/item/ammo_magazine/packet/groza/hp = -1,
/obj/item/ammo_magazine/packet/p10x25mm = -1,
/obj/item/ammo_magazine/packet/p10x26mm = -1,
/obj/item/ammo_magazine/packet/p10x27mm = -1,
/obj/item/ammo_magazine/packet/p86x70mm = -1,
Expand Down Expand Up @@ -268,8 +263,6 @@
/obj/item/ammo_magazine/rifle/type71/hp = -1,
/obj/item/weapon/gun/rifle/ar21 = -1,
/obj/item/ammo_magazine/rifle/ar21 = -1,
/obj/item/ammo_magazine/rifle/ar21/ap = -1,
/obj/item/ammo_magazine/rifle/ar21/hp = -1,
/obj/item/weapon/gun/revolver/r44/coltrifle = -1,
/obj/item/ammo_magazine/revolver/rifle = -1,

Expand Down Expand Up @@ -424,12 +417,9 @@
/obj/item/ammo_magazine/packet/p10x24mm/ap = -1,
/obj/item/ammo_magazine/packet/p10x24mm/hp = -1,
/obj/item/ammo_magazine/packet/p10x25mm = -1,
/obj/item/ammo_magazine/packet/p10x25mm/ap = -1,
/obj/item/ammo_magazine/packet/p10x25mm/hp = -1,
/obj/item/ammo_magazine/packet/groza = -1,
/obj/item/ammo_magazine/packet/groza/ap = -1,
/obj/item/ammo_magazine/packet/groza/hp = -1,
/obj/item/ammo_magazine/packet/p10x25mm = -1,
/obj/item/ammo_magazine/packet/p10x26mm = -1,
/obj/item/ammo_magazine/packet/p10x27mm = -1,
/obj/item/ammo_magazine/packet/p86x70mm = -1,
Expand Down Expand Up @@ -496,8 +486,7 @@
/obj/item/ammo_magazine/rifle/type71/hp = -1,
/obj/item/weapon/gun/rifle/ar21 = -1,
/obj/item/ammo_magazine/rifle/ar21 = -1,
/obj/item/ammo_magazine/rifle/ar21/ap = -1,
/obj/item/ammo_magazine/rifle/ar21/hp = -1,
/obj/item/ammo_magazine/rifle/ar21/extended = -1,
),
"Пистолеты-пулемёты" = list(
/obj/item/weapon/gun/smg/vector = -1,
Expand Down Expand Up @@ -688,8 +677,6 @@
/obj/item/ammo_magazine/packet/groza/ap = -1,
/obj/item/ammo_magazine/packet/groza/hp = -1,
/obj/item/ammo_magazine/packet/p10x25mm = -1,
/obj/item/ammo_magazine/packet/p10x25mm/ap = -1,
/obj/item/ammo_magazine/packet/p10x25mm/hp = -1,
/obj/item/ammo_magazine/packet/p10x26mm = -1,
/obj/item/ammo_magazine/packet/p10x27mm = -1,
/obj/item/ammo_magazine/packet/p86x70mm = -1,
Expand Down
37 changes: 16 additions & 21 deletions code/modules/projectiles/ammo_datums/bullet/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,23 @@
penetration = 10
additional_xeno_penetration = 15

/datum/ammo/bullet/rifle/heavy/hp
name = "hollow-point heavy rifle bullet"
hud_state = "rifle_heavy"
damage = 50
penetration = 0
additional_xeno_penetration = -10

/datum/ammo/bullet/rifle/heavy/ap
name = "armor-piercing heavy rifle bullet"
damage = 25
penetration = 25
additional_xeno_penetration = 20
/datum/ammo/bullet/rifle/heavy/sharpshooter
damage = 30
damage_falloff = 2
penetration = 10
additional_xeno_penetration = 10

/datum/ammo/bullet/rifle/heavy/incendiary
name = "incendiaryg heavy rifle bullet"
hud_state = "rifle_fire"
flags_ammo_behavior = AMMO_BALLISTIC|AMMO_INCENDIARY
incendiary_strength = 1
damage_type = BURN
damage = 20
penetration = 0
additional_xeno_penetration = 0
var/hit_stacks = 2

/datum/ammo/bullet/rifle/heavy/sharpshooter/on_hit_mob(mob/M, obj/projectile/proj)
if(istype(M,/mob/living/carbon))
var/mob/living/carbon/target = M
if(target.has_status_effect(STATUS_EFFECT_SHARPSHOOTER))
var/datum/status_effect/stacking/sharpshooter/debuff = target.has_status_effect(STATUS_EFFECT_SHARPSHOOTER)
target.apply_damage(debuff.stacks, BRUTE, blocked = BULLET, penetration = additional_xeno_penetration)
debuff.add_stacks(hit_stacks)
return
target.apply_status_effect(STATUS_EFFECT_SHARPSHOOTER, hit_stacks)

/datum/ammo/bullet/rifle/repeater
name = "heavy impact rifle bullet"
Expand Down
9 changes: 1 addition & 8 deletions code/modules/projectiles/guns/rifles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1760,14 +1760,7 @@
max_shells = 30 //codex
force = 20
default_ammo_type = /obj/item/ammo_magazine/rifle/ar21
allowed_ammo_types = list(/obj/item/ammo_magazine/rifle/ar21)
allowed_ammo_types = list(
/obj/item/ammo_magazine/rifle/ar21,
/obj/item/ammo_magazine/rifle/ar21/extended,
/obj/item/ammo_magazine/rifle/ar21/ap,
/obj/item/ammo_magazine/rifle/ar21/hp,
/obj/item/ammo_magazine/rifle/ar21/incendiary,
)
allowed_ammo_types = list(/obj/item/ammo_magazine/rifle/ar21, /obj/item/ammo_magazine/rifle/ar21/extended)
attachable_allowed = list(
/obj/item/attachable/reddot,
/obj/item/attachable/b7_scope,
Expand Down
22 changes: 2 additions & 20 deletions code/modules/projectiles/magazines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@
max_rounds = 100

/obj/item/ammo_magazine/packet/p10x25mm
name = "box of 10x25mm FMJ"
name = "box of 10x25mm"
desc = "A box containing 125 rounds of 10x25mm caseless."
caliber = CALIBER_10X25_CASELESS
icon_state = "box_10x25mm"
ammo_band_icon = "box_10x25mm_band"
default_ammo = /datum/ammo/bullet/rifle/heavy
default_ammo = /datum/ammo/bullet/rifle/heavy/sharpshooter
current_rounds = 125
max_rounds = 125

Expand Down Expand Up @@ -364,24 +364,6 @@
ammo_band_color = AMMO_BAND_COLOR_HOLLOWPOINT
default_ammo = /datum/ammo/bullet/rifle/hp

/obj/item/ammo_magazine/packet/p10x25mm/ap
name = "box of 10x25mm AP"
desc = "A box containing 125 armor piercing rounds of 10x25mm caseless."
ammo_band_color = AMMO_BAND_COLOR_AP
default_ammo = /datum/ammo/bullet/rifle/heavy/ap

/obj/item/ammo_magazine/packet/p10x25mm/hp
name = "box of 10x25mm HP"
desc = "A box containing 125 hollow-point rounds of 10x25mm caseless."
ammo_band_color = AMMO_BAND_COLOR_HOLLOWPOINT
default_ammo = /datum/ammo/bullet/rifle/heavy/hp

/obj/item/ammo_magazine/packet/p10x25mm/incendiary
name = "box of 10x25mm incendiary"
desc = "A box containing 125 incendiary rounds of 10x25mm caseless."
ammo_band_color = AMMO_BAND_COLOR_INCENDIARY
default_ammo = /datum/ammo/bullet/rifle/heavy/incendiary

/obj/item/ammo_magazine/packet/p10x265mm/ap
desc = "A box containing 100 armor piercing rounds of 10x26.5mm caseless."
icon_state = "box_10x265mm_ap"
Expand Down
20 changes: 1 addition & 19 deletions code/modules/projectiles/magazines/rifles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
icon_state = "t21"
icon_state_mini = "mag_rifle"
ammo_band_icon = "t21_band"
default_ammo = /datum/ammo/bullet/rifle/heavy
default_ammo = /datum/ammo/bullet/rifle/heavy/sharpshooter
max_rounds = 30

/obj/item/ammo_magazine/rifle/ar21/extended
Expand All @@ -493,24 +493,6 @@
ammo_band_color = AMMO_BAND_COLOR_EXTENDED
bonus_overlay = "t21_ext"

/obj/item/ammo_magazine/rifle/ar21/ap
name = "\improper AR-21 skirmish AP rifle magazine"
desc = "A magazine filled with 10x25mm armor piercing rifle rounds for the AR-21."
ammo_band_color = AMMO_BAND_COLOR_AP
default_ammo = /datum/ammo/bullet/rifle/heavy/ap

/obj/item/ammo_magazine/rifle/ar21/incendiary
name = "\improper AR-21 skirmish incendiary rifle magazine"
desc = "A magazine filled with 10x25mm incendiary rifle rounds for the AR-21."
ammo_band_color = AMMO_BAND_COLOR_INCENDIARY
default_ammo = /datum/ammo/bullet/rifle/heavy/incendiary

/obj/item/ammo_magazine/rifle/ar21/hp
name = "\improper AR-21 skirmish HP rifle magazine"
desc = "A magazine filled with 10x25mm armor-piercing rifle rounds for the AR-21."
ammo_band_color = AMMO_BAND_COLOR_HOLLOWPOINT
default_ammo = /datum/ammo/bullet/rifle/heavy/hp

//ALF-51B

/obj/item/ammo_magazine/rifle/alf_machinecarbine
Expand Down
13 changes: 7 additions & 6 deletions code/modules/reqs/supplypacks/weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,6 @@
cost = 45 //150 rounds
containertype = /obj/structure/closet/crate/ammo

/datum/supply_packs/weapons/box_10x25mm_incendiary
name = "10x25mm incendiary ammo box"
contains = list(/obj/item/ammo_magazine/packet/p10x25mm/incendiary)
cost = 50 //125 rounds
containertype = /obj/structure/closet/crate/ammo

/datum/supply_packs/weapons/p9mm_incendiary
name = "9mm incendiary packet"
contains = list(/obj/item/ammo_magazine/packet/p9mm/incendiary)
Expand All @@ -301,3 +295,10 @@
/datum/supply_packs/weapons/xray_gun
contains = list(/obj/item/weapon/gun/energy/lasgun/lasrifle/xray)
cost = 500

/datum/supply_packs/weapons/ar21_extended
name = "AR-21 extended skirmish rifle magazine"
contains = list(/obj/item/ammo_magazine/rifle/ar21/extended)
cost = 80


0 comments on commit 537496d

Please sign in to comment.