diff --git a/code/datums/ammo/bullet/rifle.dm b/code/datums/ammo/bullet/rifle.dm index ab30599eeb12..279a828ed786 100644 --- a/code/datums/ammo/bullet/rifle.dm +++ b/code/datums/ammo/bullet/rifle.dm @@ -21,11 +21,16 @@ /datum/ammo/bullet/rifle/holo_target name = "holo-targeting rifle bullet" damage = 30 + /// inflicts this many holo stacks per bullet hit var/holo_stacks = 10 + /// modifies the default cap limit of 100 by this amount + var/bonus_damage_cap_increase = 0 + /// multiplies the default drain of 5 holo stacks per second by this amount + var/stack_loss_multiplier = 1 -/datum/ammo/bullet/rifle/holo_target/on_hit_mob(mob/M, obj/projectile/P) +/datum/ammo/bullet/rifle/holo_target/on_hit_mob(mob/hit_mob, obj/projectile/bullet) . = ..() - M.AddComponent(/datum/component/bonus_damage_stack, holo_stacks, world.time) + hit_mob.AddComponent(/datum/component/bonus_damage_stack, holo_stacks, world.time, bonus_damage_cap_increase, stack_loss_multiplier) /datum/ammo/bullet/rifle/holo_target/hunting name = "holo-targeting hunting bullet" diff --git a/code/datums/ammo/bullet/sniper.dm b/code/datums/ammo/bullet/sniper.dm index a82f00631608..22371972e623 100644 --- a/code/datums/ammo/bullet/sniper.dm +++ b/code/datums/ammo/bullet/sniper.dm @@ -139,6 +139,28 @@ BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_penetrating/heavy) )) +/datum/ammo/bullet/sniper/anti_materiel/vulture/holo_target + name = "holo-targeting anti-materiel sniper bullet" + damage = 60 // it's a big bullet but its purpose is to support marines, not to kill enemies by itself + /// inflicts this many holo stacks per bullet hit + var/holo_stacks = 333 + /// modifies the default cap limit of 100 by this amount + var/bonus_damage_cap_increase = 233 + /// multiplies the default drain of 5 holo stacks per second by this amount + var/stack_loss_multiplier = 2 + +/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', 40) + 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, with IFF to compensate how hard it will be to hit these shots +/datum/ammo/bullet/sniper/anti_materiel/vulture/holo_target/set_bullet_traits() + LAZYADD(traits_to_give, list( + BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_iff) + )) + /datum/ammo/bullet/sniper/elite name = "supersonic sniper bullet" diff --git a/code/datums/ammo/bullet/special_ammo.dm b/code/datums/ammo/bullet/special_ammo.dm index 3d53c6b0c0d0..97c1bf5735f9 100644 --- a/code/datums/ammo/bullet/special_ammo.dm +++ b/code/datums/ammo/bullet/special_ammo.dm @@ -46,12 +46,16 @@ /datum/ammo/bullet/smartgun/holo_target //Royal marines smartgun bullet has only diff between regular ammo is this one does holostacks name = "holo-targeting smartgun bullet" damage = 30 - ///Stuff for the HRP holotargetting stacks + /// inflicts this many holo stacks per bullet hit var/holo_stacks = 15 + /// modifies the default cap limit of 100 by this amount + var/bonus_damage_cap_increase = 0 + /// multiplies the default drain of 5 holo stacks per second by this amount + var/stack_loss_multiplier = 1 -/datum/ammo/bullet/smartgun/holo_target/on_hit_mob(mob/M, obj/projectile/P) +/datum/ammo/bullet/smartgun/holo_target/on_hit_mob(mob/hit_mob, obj/projectile/bullet) . = ..() - M.AddComponent(/datum/component/bonus_damage_stack, holo_stacks, world.time) + hit_mob.AddComponent(/datum/component/bonus_damage_stack, holo_stacks, world.time, bonus_damage_cap_increase, stack_loss_multiplier) /datum/ammo/bullet/smartgun/holo_target/ap name = "armor-piercing smartgun bullet" diff --git a/code/datums/ammo/shrapnel.dm b/code/datums/ammo/shrapnel.dm index e27caa4b277d..39b0813fad25 100644 --- a/code/datums/ammo/shrapnel.dm +++ b/code/datums/ammo/shrapnel.dm @@ -43,10 +43,17 @@ shrapnel_chance = 0 shell_speed = AMMO_SPEED_TIER_3//she fast af boi penetration = ARMOR_PENETRATION_TIER_5 - -/datum/ammo/bullet/shrapnel/hornet_rounds/on_hit_mob(mob/M, obj/projectile/P) + /// inflicts this many holo stacks per bullet hit + var/holo_stacks = 10 + /// modifies the default cap limit of 100 by this amount + var/bonus_damage_cap_increase = 0 + /// multiplies the default drain of 5 holo stacks per second by this amount + var/stack_loss_multiplier = 1 + +/datum/ammo/bullet/shrapnel/hornet_rounds/on_hit_mob(mob/hit_mob, obj/projectile/bullet) . = ..() - M.AddComponent(/datum/component/bonus_damage_stack, 10, world.time) + hit_mob.AddComponent(/datum/component/bonus_damage_stack, holo_stacks, world.time, bonus_damage_cap_increase, stack_loss_multiplier) + /datum/ammo/bullet/shrapnel/incendiary name = "flaming shrapnel" diff --git a/code/datums/components/bonus_damage_stack.dm b/code/datums/components/bonus_damage_stack.dm index faf4813541b8..78da5e036ce4 100644 --- a/code/datums/components/bonus_damage_stack.dm +++ b/code/datums/components/bonus_damage_stack.dm @@ -15,15 +15,21 @@ 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 + /// multiplies the BONUS_DAMAGE_STACK_LOSS_PER_SECOND calculation, modifying how fast we lose holo stacks + var/stack_loss_multiplier = 1 -/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) . = ..() 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 -/datum/component/bonus_damage_stack/InheritComponent(datum/component/bonus_damage_stack/BDS, i_am_original, bonus_damage_stacks, time) +/datum/component/bonus_damage_stack/InheritComponent(datum/component/bonus_damage_stack/BDS, i_am_original, bonus_damage_stacks, time, bonus_damage_cap_increase, stack_loss_multiplier) . = ..() if(!BDS) src.bonus_damage_stacks += bonus_damage_stacks @@ -32,22 +38,32 @@ src.bonus_damage_stacks += BDS.bonus_damage_stacks src.last_stack = BDS.last_stack - src.bonus_damage_stacks = min(src.bonus_damage_stacks, bonus_damage_cap) + // if a different type of holo targetting bullet hits a mob and has a bigger bonus cap, it will get applied. + if(src.bonus_damage_cap_increase < bonus_damage_cap_increase) + src.bonus_damage_cap_increase = bonus_damage_cap_increase + src.bonus_damage_cap = initial(bonus_damage_cap) + src.bonus_damage_cap_increase + + // however, if it has a worse stack_loss_multiplier, it will get applied instead. + // this way, if a weapon is meant to have a big bonus cap but holo stacks that rapidly deplete, it will not be messed up by a weapon that a low stack_loss_multiplier. + if(src.stack_loss_multiplier < stack_loss_multiplier) + src.stack_loss_multiplier = stack_loss_multiplier + + src.bonus_damage_stacks = min(src.bonus_damage_stacks, src.bonus_damage_cap) /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) @@ -67,7 +83,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) diff --git a/code/modules/cm_marines/equipment/guncases.dm b/code/modules/cm_marines/equipment/guncases.dm index 0cf097cb9b4c..22999e97fda2 100644 --- a/code/modules/cm_marines/equipment/guncases.dm +++ b/code/modules/cm_marines/equipment/guncases.dm @@ -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 IFF-CAPABLE holo-targeting 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." diff --git a/code/modules/projectiles/guns/boltaction.dm b/code/modules/projectiles/guns/boltaction.dm index a06131f98ce0..16ccb3438e23 100644 --- a/code/modules/projectiles/guns/boltaction.dm +++ b/code/modules/projectiles/guns/boltaction.dm @@ -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 diff --git a/code/modules/projectiles/magazines/rifles.dm b/code/modules/projectiles/magazines/rifles.dm index bfc411a2ea63..d12f390ccd95 100644 --- a/code/modules/projectiles/magazines/rifles.dm +++ b/code/modules/projectiles/magazines/rifles.dm @@ -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 IFF-CAPABLE holo-targeting rounds, which excel at marking heavy targets to be attacked by allied ground forces. The logistical requirements for such capabilities heavily hinder the performance and stopping power of this round." + default_ammo = /datum/ammo/bullet/sniper/anti_materiel/vulture/holo_target + ammo_band_color = AMMO_BAND_COLOR_HOLOTARGETING //=ROYAL MARINES=\\ diff --git a/icons/obj/items/weapons/guns/ammo_by_faction/uscm.dmi b/icons/obj/items/weapons/guns/ammo_by_faction/uscm.dmi index e177d85dc726..8b3b5e0f1c80 100644 Binary files a/icons/obj/items/weapons/guns/ammo_by_faction/uscm.dmi and b/icons/obj/items/weapons/guns/ammo_by_faction/uscm.dmi differ diff --git a/sound/weapons/gun_vulture_mark.ogg b/sound/weapons/gun_vulture_mark.ogg new file mode 100644 index 000000000000..6c7ae7b27797 Binary files /dev/null and b/sound/weapons/gun_vulture_mark.ogg differ