Skip to content

Commit

Permalink
[MIRROR] Scatter laser shells now use the scatter laser beam, and mak…
Browse files Browse the repository at this point in the history
…es them significantly easier to make. Projectiles can now have damage falloff. [MDB IGNORE] (#291)

* Scatter laser shells now use the scatter laser beam, and makes them significantly easier to make. Projectiles can now have damage falloff. (#78927)

* Modular

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: necromanceranne <[email protected]>
Co-authored-by: Jacquerel <hnevard@ gmail.com>
Co-authored-by: Giz <[email protected]>
  • Loading branch information
5 people authored Oct 25, 2023
1 parent dfef668 commit 4816248
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 33 deletions.
12 changes: 0 additions & 12 deletions code/datums/components/crafting/weapon_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,6 @@
time = 1.2 SECONDS
category = CAT_WEAPON_AMMO

/datum/crafting_recipe/laserslug
name = "Scatter Laser Shell"
result = /obj/item/ammo_casing/shotgun/laserslug
reqs = list(
/obj/item/ammo_casing/shotgun/techshell = 1,
/obj/item/stock_parts/capacitor/adv = 1,
/obj/item/stock_parts/micro_laser/high = 1,
)
tool_behaviors = list(TOOL_SCREWDRIVER)
time = 0.5 SECONDS
category = CAT_WEAPON_AMMO

/datum/crafting_recipe/trashball
name = "Trashball"
always_available = FALSE
Expand Down
15 changes: 12 additions & 3 deletions code/modules/projectiles/ammunition/ballistic/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,23 @@
pellets = 4
variance = 35

/obj/item/ammo_casing/shotgun/laserslug
/obj/item/ammo_casing/shotgun/scatterlaser
name = "scatter laser shell"
desc = "An advanced shotgun shell that uses a micro laser to replicate the effects of a scatter laser weapon in a ballistic package."
icon_state = "lshell"
projectile_type = /obj/projectile/beam/weak
projectile_type = /obj/projectile/beam/scatter
pellets = 6
variance = 35

/obj/item/ammo_casing/shotgun/scatterlaser/emp_act(severity)
. = ..()
if(isnull(loaded_projectile) || !prob(40/severity))
return
name = "malfunctioning laser shell"
desc = "An advanced shotgun shell that uses a micro laser to replicate the effects of a scatter laser weapon in a ballistic package. The capacitor powering this assembly appears to be smoking."
projectile_type = /obj/projectile/beam/scatter/pathetic
loaded_projectile = new projectile_type(src)

/obj/item/ammo_casing/shotgun/techshell
name = "unloaded technological shell"
desc = "A high-tech shotgun shell which can be loaded with materials to produce unique effects."
Expand All @@ -139,7 +148,7 @@
/obj/item/ammo_casing/shotgun/techshell/Initialize(mapload)
. = ..()

var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/meteorslug, /datum/crafting_recipe/pulseslug, /datum/crafting_recipe/dragonsbreath, /datum/crafting_recipe/ionslug, /datum/crafting_recipe/laserslug)
var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/meteorslug, /datum/crafting_recipe/pulseslug, /datum/crafting_recipe/dragonsbreath, /datum/crafting_recipe/ionslug)

AddComponent(
/datum/component/slapcrafting,\
Expand Down
12 changes: 12 additions & 0 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@
var/hit_prone_targets = FALSE
///For what kind of brute wounds we're rolling for, if we're doing such a thing. Lasers obviously don't care since they do burn instead.
var/sharpness = NONE
///How much we want to drop damage per tile as it travels through the air
var/damage_falloff_tile
///How much we want to drop stamina damage (defined by the stamina variable) per tile as it travels through the air
var/stamina_falloff_tile
///How much we want to drop both wound_bonus and bare_wound_bonus (to a minimum of 0 for the latter) per tile, for falloff purposes
var/wound_falloff_tile
///How much we want to drop the embed_chance value, if we can embed, per tile, for falloff purposes
Expand Down Expand Up @@ -225,10 +229,18 @@
bare_wound_bonus = max(0, bare_wound_bonus + wound_falloff_tile)
if(embedding)
embedding["embed_chance"] += embed_falloff_tile
if(damage_falloff_tile && damage >= 0)
damage += damage_falloff_tile
if(stamina_falloff_tile && stamina >= 0)
stamina += stamina_falloff_tile

SEND_SIGNAL(src, COMSIG_PROJECTILE_RANGE)
if(range <= 0 && loc)
on_range()

if(damage_falloff_tile && damage <= 0 || stamina_falloff_tile && stamina <= 0)
on_range()

/obj/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range
SEND_SIGNAL(src, COMSIG_PROJECTILE_RANGE_OUT)
qdel(src)
Expand Down
15 changes: 14 additions & 1 deletion code/modules/projectiles/projectile/beams.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,20 @@
/obj/projectile/beam/scatter
name = "laser pellet"
icon_state = "scatterlaser"
damage = 5
damage = 7.5
wound_bonus = 5
bare_wound_bonus = 5
damage_falloff_tile = -0.45
wound_falloff_tile = -2.5

/obj/projectile/beam/scatter/pathetic
name = "extremely weak laser pellet"
damage = 1
wound_bonus = 0
damage_falloff_tile = -0.1
color = "#dbc11d"
hitsound = 'sound/items/bikehorn.ogg' //honk
hitsound_wall = 'sound/items/bikehorn.ogg'

/obj/projectile/beam/xray
name = "\improper X-ray beam"
Expand Down
13 changes: 2 additions & 11 deletions code/modules/projectiles/projectile/bullets/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,8 @@

/obj/projectile/bullet/pellet
icon_state = "pellet"
var/tile_dropoff = 0.45
var/tile_dropoff_s = 0.25

/obj/projectile/bullet/pellet/Range()
..()
if(damage > 0)
damage -= tile_dropoff
if(stamina > 0)
stamina -= tile_dropoff_s
if(damage < 0 && stamina < 0)
qdel(src)
damage_falloff_tile = -0.45
stamina_falloff_tile = -0.25

/obj/projectile/bullet/pellet/shotgun_buckshot
name = "buckshot pellet"
Expand Down
14 changes: 14 additions & 0 deletions code/modules/research/designs/weapon_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,20 @@
)
departmental_flags = DEPARTMENT_BITFLAG_SECURITY

/datum/design/lasershell
name = "Scatter Laser Shotgun Shell (Lethal)"
desc = "A high-tech shotgun shell which houses an internal capacitor and laser focusing crystal inside of a shell casing. \
Able to be fired from conventional ballistic shotguns with minimal rifling degradation. Also leaves most targets covered \
in grotesque burns."
id = "lasershell"
build_type = PROTOLATHE | AWAY_LATHE
materials = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 2, /datum/material/gold = HALF_SHEET_MATERIAL_AMOUNT)
build_path = /obj/item/ammo_casing/shotgun/scatterlaser
category = list(
RND_CATEGORY_WEAPONS + RND_SUBCATEGORY_WEAPONS_AMMO
)
departmental_flags = DEPARTMENT_BITFLAG_SECURITY

/datum/design/techshell
name = "Unloaded Technological Shotshell"
desc = "A high-tech shotgun shell which can be crafted into more advanced shells to produce unique effects. \
Expand Down
1 change: 1 addition & 0 deletions code/modules/research/techweb/all_nodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,7 @@
design_ids = list(
"pin_testing",
"tele_shield",
"lasershell",
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 20000)
discount_experiments = list(/datum/experiment/ordnance/explosive/pressurebomb = 10000)
Expand Down
12 changes: 6 additions & 6 deletions modular_skyrat/modules/shotgunrebalance/code/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@
name = "beehive pellet"
damage = 4
stamina = 10
tile_dropoff = 0.1
tile_dropoff_s = 0.1
damage_falloff_tile = 0.1
stamina_falloff_tile = 0.1
wound_bonus = -5
bare_wound_bonus = 5
wound_falloff_tile = 0
Expand Down Expand Up @@ -253,8 +253,8 @@
name = "electrode"
damage = 4
stamina = 6
tile_dropoff = 0.2
tile_dropoff_s = 0.3
damage_falloff_tile = 0.2
stamina_falloff_tile = 0.3
wound_bonus = 0
bare_wound_bonus = 0
stutter = 3 SECONDS
Expand Down Expand Up @@ -287,7 +287,7 @@

/obj/projectile/bullet/pellet/shotgun_buckshot/iceblox //see /obj/projectile/temp for the original code
name = "iceblox pellet"
tile_dropoff = 0.35
damage_falloff_tile = 0.35
damage = 5
weak_against_armour = TRUE
var/temperature = 30
Expand Down Expand Up @@ -338,7 +338,7 @@
name = "confetti"
damage = 0
stamina = 1
tile_dropoff_s = 0
stamina_falloff_tile = 0
wound_bonus = 0
bare_wound_bonus = 0
jitter = 1 SECONDS
Expand Down

0 comments on commit 4816248

Please sign in to comment.