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

Adds holo-targetting Vulture rounds #5719

Merged
merged 10 commits into from
Feb 20, 2024
16 changes: 16 additions & 0 deletions code/datums/ammo/bullet/sniper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@
BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_penetrating/heavy)
))

/datum/ammo/bullet/sniper/anti_materiel/vulture/holo_target
name = "holo-targetting anti-materiel sniper bullet"
damage = 60 // it's a big bullet but its purpose is to support marines, not kill enemies by itself
var/bonus_damage_cap_increase = 233 // the result will be a 1.33 damage multiplier
var/holo_stacks = 333 // inflicts max holo stacks in one hit
var/stack_loss_multiplier = 2 // instead of taking 1 minute to wear off, it will now take 30 seconds
VileBeggar marked this conversation as resolved.
Show resolved Hide resolved

/datum/ammo/bullet/sniper/anti_materiel/vulture/holo_target/on_hit_mob(mob/hit_mob, obj/projectile/bullet)
hit_mob.AddComponent(/datum/component/bonus_damage_stack, holo_stacks, world.time, bonus_damage_cap_increase, stack_loss_multiplier)
playsound(hit_mob, 'sound/weapons/gun_vulture_mark.ogg', 75)
to_chat(hit_mob, isxeno(hit_mob) ? SPAN_XENOHIGHDANGER("It feels as if we were MARKED FOR DEATH!") : SPAN_HIGHDANGER("It feels as if you were MARKED FOR DEATH!"))
hit_mob.balloon_alert_to_viewers("marked for death!")

// the effect should be limited to one target
/datum/ammo/bullet/sniper/anti_materiel/vulture/holo_target/set_bullet_traits()
VileBeggar marked this conversation as resolved.
Show resolved Hide resolved

/datum/ammo/bullet/sniper/elite
name = "supersonic sniper bullet"

Expand Down
19 changes: 12 additions & 7 deletions code/datums/components/bonus_damage_stack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
var/bonus_damage_cap = 100
/// Last world.time that the afflicted was hit by a holo-targeting round.
var/last_stack
/// extra cap limit added by more powerful bullets
var/bonus_damage_cap_increase = 0
var/stack_loss_multiplier = 1
VileBeggar marked this conversation as resolved.
Show resolved Hide resolved

/datum/component/bonus_damage_stack/Initialize(bonus_damage_stacks, time)
/datum/component/bonus_damage_stack/Initialize(bonus_damage_stacks, time, bonus_damage_cap_increase, stack_loss_multiplier)
VileBeggar marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
src.bonus_damage_stacks = bonus_damage_stacks
src.stack_loss_multiplier = stack_loss_multiplier
src.bonus_damage_cap = initial(bonus_damage_cap) + bonus_damage_cap_increase // this way it will never increase over the intended limit
if(!time)
time = world.time
src.last_stack = time
Expand All @@ -36,18 +41,18 @@

/datum/component/bonus_damage_stack/process(delta_time)
if(last_stack + 5 SECONDS < world.time)
bonus_damage_stacks = bonus_damage_stacks - BONUS_DAMAGE_STACK_LOSS_PER_SECOND * delta_time
bonus_damage_stacks = bonus_damage_stacks - BONUS_DAMAGE_STACK_LOSS_PER_SECOND * stack_loss_multiplier * delta_time

if(bonus_damage_stacks <= 0)
qdel(src)

var/color = COLOR_BONUS_DAMAGE
var/intensity = bonus_damage_stacks / (bonus_damage_cap * 2)
color += num2text(BONUS_DAMAGE_MAX_ALPHA * intensity, 2, 16)

var/intensity = bonus_damage_stacks / (initial(bonus_damage_cap) * 2)
//if intensity is too high of a value, the hex code will become invalid
color += num2text(BONUS_DAMAGE_MAX_ALPHA * clamp(intensity, 0, 0.5), 1, 16)
if(parent)
var/atom/A = parent
A.add_filter("bonus_damage_stacks", 2, list("type" = "outline", "color" = color, "size" = 1))
A.add_filter("bonus_damage_stacks", 2, list("type" = "outline", "color" = color, "size" = 1 + clamp(intensity, 0, 1)))

/datum/component/bonus_damage_stack/RegisterWithParent()
START_PROCESSING(SSdcs, src)
Expand All @@ -67,7 +72,7 @@
SIGNAL_HANDLER
L += "Bonus Damage Taken: [bonus_damage_stacks * 0.1]%"

/datum/component/bonus_damage_stack/proc/get_bonus_damage(mob/M, list/damage_data) // 10% damage bonus at most
/datum/component/bonus_damage_stack/proc/get_bonus_damage(mob/M, list/damage_data) // 10% damage bonus in most instances
SIGNAL_HANDLER
damage_data["bonus_damage"] = damage_data["damage"] * (min(bonus_damage_stacks, bonus_damage_cap) / 1000)

Expand Down
24 changes: 24 additions & 0 deletions code/modules/cm_marines/equipment/guncases.dm
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,30 @@
new /obj/item/device/vulture_spotter_scope/skillless(src, WEAKREF(rifle))
new /obj/item/tool/screwdriver(src) // Spotter scope needs a screwdriver to disassemble

/obj/item/storage/box/guncase/vulture/holo_target
name = "\improper M707 holo-targetting anti-materiel rifle case"
desc = "A gun case containing the M707 \"Vulture\" anti-materiel rifle and its requisite spotting tools. This variant is pre-loaded with holo-targetting rounds."

/obj/item/storage/box/guncase/vulture/holo_target/fill_preset_inventory()
var/obj/item/weapon/gun/boltaction/vulture/holo_target/rifle = new(src)
new /obj/item/ammo_magazine/rifle/boltaction/vulture/holo_target(src)
new /obj/item/device/vulture_spotter_tripod(src)
new /obj/item/device/vulture_spotter_scope(src, WEAKREF(rifle))
new /obj/item/tool/screwdriver(src)
new /obj/item/pamphlet/trait/vulture(src)
new /obj/item/pamphlet/trait/vulture(src)

/obj/item/storage/box/guncase/vulture/holo_target/skillless
storage_slots = 5

/obj/item/storage/box/guncase/vulture/holo_target/skillless/fill_preset_inventory()
var/obj/item/weapon/gun/boltaction/vulture/holo_target/skillless/rifle = new(src)
new /obj/item/ammo_magazine/rifle/boltaction/vulture/holo_target(src)
new /obj/item/device/vulture_spotter_tripod(src)
new /obj/item/device/vulture_spotter_scope/skillless(src, WEAKREF(rifle))
new /obj/item/tool/screwdriver(src)


/obj/item/storage/box/guncase/xm51
name = "\improper XM51 breaching scattergun case"
desc = "A gun case containing the XM51 Breaching Scattergun. Comes with two spare magazines, two spare shell boxes, an optional stock and a belt to holster the weapon."
Expand Down
6 changes: 6 additions & 0 deletions code/modules/projectiles/guns/boltaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,9 @@

/obj/item/weapon/gun/boltaction/vulture/skillless
bypass_trait = TRUE

/obj/item/weapon/gun/boltaction/vulture/holo_target
current_mag = /obj/item/ammo_magazine/rifle/boltaction/vulture/holo_target

/obj/item/weapon/gun/boltaction/vulture/holo_target/skillless
bypass_trait = TRUE
8 changes: 8 additions & 0 deletions code/modules/projectiles/magazines/rifles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,14 @@
max_rounds = 4
gun_type = /obj/item/weapon/gun/boltaction/vulture
w_class = SIZE_MEDIUM // maybe small? This shit's >4 inches long mind you
ammo_band_icon = "+vulture_band"
ammo_band_icon_empty = "+vulture_band_e"

/obj/item/ammo_magazine/rifle/boltaction/vulture/holo_target
name = "\improper M707 \"Vulture\" holo-target magazine (20x102mm)"
desc = "A magazine for the M707 \"Vulture\" anti-matieriel rifle. Contains up to 4 massively oversized holo-target rounds which excel at marking heavy targets for ground troops. The logistical requirements for such a capability have severely hampered the bullet's ballistic performance."
default_ammo = /datum/ammo/bullet/sniper/anti_materiel/vulture/holo_target
ammo_band_color = AMMO_BAND_COLOR_HOLOTARGETING

//=ROYAL MARINES=\\

Expand Down
Binary file modified icons/obj/items/weapons/guns/ammo_by_faction/uscm.dmi
Binary file not shown.
Binary file added sound/weapons/gun_vulture_mark.ogg
Binary file not shown.
Loading