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

Ports over the tgstation changes to thermal pistols and cranked weapons. #666

Merged
merged 3 commits into from
Feb 21, 2025
Merged
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
3 changes: 1 addition & 2 deletions code/datums/components/crafting/ranged_weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,7 @@
/obj/item/stack/rods = 4,
/obj/item/stock_parts/micro_laser = 1,
/obj/item/stock_parts/capacitor = 1,
/obj/item/clothing/glasses/regular = 1,
/obj/item/reagent_containers/cup/glass/drinkingglass = 1,
/obj/item/reagent_containers/cup/glass/drinkingglass = 2,
)
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
time = 10 SECONDS
Expand Down
17 changes: 14 additions & 3 deletions code/datums/components/crank_recharge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/datum/component/crank_recharge
/// Our cell to charge
var/obj/item/stock_parts/cell/charging_cell
/// Whether we spin our gun to reload (and therefore need the relevant trait)
var/spin_to_win = FALSE
/// How much charge we give our cell on each crank
var/charge_amount
/// How long is the cooldown time between each charge
Expand All @@ -12,20 +14,23 @@
var/charge_sound_cooldown_time
/// Are we currently charging
var/is_charging = FALSE
/// Should you be able to move while charging, use IGNORE_USER_LOC_CHANGE if you want to move and crank
var/charge_move = NONE
COOLDOWN_DECLARE(charge_sound_cooldown)

/datum/component/crank_recharge/Initialize(charging_cell, charge_amount = 500, cooldown_time = 2 SECONDS, charge_sound = 'sound/weapons/laser_crank.ogg', charge_sound_cooldown_time = 1.8 SECONDS)
/datum/component/crank_recharge/Initialize(charging_cell, spin_to_win = FALSE, charge_amount = 500, cooldown_time = 2 SECONDS, charge_sound = 'sound/items/weapons/laser_crank.ogg', charge_sound_cooldown_time = 1.8 SECONDS, charge_move = NONE)
. = ..()
if(!isitem(parent))
return COMPONENT_INCOMPATIBLE
if(isnull(charging_cell) || !istype(charging_cell, /obj/item/stock_parts/cell))
return COMPONENT_INCOMPATIBLE
src.charging_cell = charging_cell
src.spin_to_win = spin_to_win
src.charge_amount = charge_amount
src.cooldown_time = cooldown_time
src.charge_sound = charge_sound
src.charge_sound_cooldown_time = charge_sound_cooldown_time

src.charge_move = charge_move
/datum/component/crank_recharge/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_ITEM_ATTACK_SELF, PROC_REF(on_attack_self))
Expand All @@ -45,15 +50,21 @@
return
if(is_charging)
return
if(spin_to_win && !HAS_TRAIT(user, TRAIT_GUNFLIP))
source.balloon_alert(user, "need holster to spin!")
return

is_charging = TRUE
if(COOLDOWN_FINISHED(src, charge_sound_cooldown))
COOLDOWN_START(src, charge_sound_cooldown, charge_sound_cooldown_time)
playsound(source, charge_sound, 40)
source.balloon_alert(user, "charging...")
if(!do_after(user, cooldown_time, source, interaction_key = DOAFTER_SOURCE_CHARGE_CRANKRECHARGE))
if(!do_after(user, cooldown_time, source, interaction_key = DOAFTER_SOURCE_CHARGE_CRANKRECHARGE, timed_action_flags = charge_move))
is_charging = FALSE
return
charging_cell.give(charge_amount)
source.update_appearance()
is_charging = FALSE
if(spin_to_win)
source.SpinAnimation(4, 2) //What a badass
source.balloon_alert(user, "charged")
4 changes: 2 additions & 2 deletions code/game/objects/items/storage/holsters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
/obj/item/storage/belt/holster/equipped(mob/user, slot)
. = ..()
if(slot & (ITEM_SLOT_BELT|ITEM_SLOT_SUITSTORE))
ADD_TRAIT(user, TRAIT_GUNFLIP, CLOTHING_TRAIT)
ADD_CLOTHING_TRAIT(user, TRAIT_GUNFLIP)

/obj/item/storage/belt/holster/dropped(mob/user)
. = ..()
REMOVE_TRAIT(user, TRAIT_GUNFLIP, CLOTHING_TRAIT)
REMOVE_CLOTHING_TRAIT(user, TRAIT_GUNFLIP)

/obj/item/storage/belt/holster/Initialize(mapload)
. = ..()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/cargo/packs/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@
/datum/supply_pack/security/armory/thermal
name = "Thermal Pistol Crate"
desc = "Contains a pair of holsters each with two experimental thermal pistols, \
using nanites as the basis for their ammo."
cost = CARGO_CRATE_VALUE * 7
using nanites as the basis for their ammo. Can be shaken to reload."
cost = CARGO_CRATE_VALUE * 10
contains = list(/obj/item/storage/belt/holster/energy/thermal = 2)
crate_name = "thermal pistol crate"

Expand Down
2 changes: 2 additions & 0 deletions code/modules/projectiles/ammunition/energy/laser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

/obj/item/ammo_casing/energy/laser/musket/prime
projectile_type = /obj/projectile/beam/laser/musket/prime
pellets = 3
variance = 10

/obj/item/ammo_casing/energy/laser/practice
projectile_type = /obj/projectile/beam/practice
Expand Down
60 changes: 57 additions & 3 deletions code/modules/projectiles/guns/energy/crank_guns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

/obj/item/gun/energy/laser/musket/Initialize(mapload)
. = ..()
AddComponent(/datum/component/two_handed, require_twohands = TRUE, force_wielded = 10)
AddComponent( \
/datum/component/crank_recharge, \
charging_cell = get_cell(), \
charge_amount = 500, \
cooldown_time = 2 SECONDS, \
charge_sound = 'sound/weapons/laser_crank.ogg', \
charge_sound = 'sound/items/weapons/laser_crank.ogg', \
charge_sound_cooldown_time = 1.8 SECONDS, \
charge_move = IGNORE_USER_LOC_CHANGE, \
)

/obj/item/gun/energy/laser/musket/update_icon_state()
Expand Down Expand Up @@ -52,8 +52,9 @@
charging_cell = get_cell(), \
charge_amount = 1000, \
cooldown_time = 2 SECONDS, \
charge_sound = 'sound/weapons/laser_crank.ogg', \
charge_sound = 'sound/items/weapons/laser_crank.ogg', \
charge_sound_cooldown_time = 1.8 SECONDS, \
charge_move = IGNORE_USER_LOC_CHANGE, \
)

/obj/item/gun/energy/disabler/smoothbore/add_seclight_point()
Expand All @@ -72,3 +73,56 @@
ammo_type = list(/obj/item/ammo_casing/energy/disabler/smoothbore/prime)
charge_sections = 2
spread = 0 //could be like 5, but having just very tiny spread kinda feels like bullshit

//Inferno and Cryo Pistols

/obj/item/gun/energy/laser/thermal //the common parent of these guns, it just shoots hard bullets, somoene might like that?
name = "nanite pistol"
desc = "A modified handcannon with a metamorphic reserve of decommissioned weaponized nanites. Spit globs of angry robots into the bad guys."
icon_state = "infernopistol"
inhand_icon_state = null
ammo_type = list(/obj/item/ammo_casing/energy/nanite)
shaded_charge = TRUE
ammo_x_offset = 1
obj_flags = UNIQUE_RENAME
can_bayonet = TRUE
knife_x_offset = 19
knife_y_offset = 13
w_class = WEIGHT_CLASS_NORMAL
dual_wield_spread = 5 //as intended by the coders

/obj/item/gun/energy/laser/thermal/Initialize(mapload)
. = ..()
AddElement(/datum/element/empprotection, EMP_PROTECT_SELF|EMP_PROTECT_CONTENTS)
AddComponent( \
/datum/component/crank_recharge, \
charging_cell = get_cell(), \
spin_to_win = TRUE, \
charge_amount = 125, \
cooldown_time = 0.8 SECONDS, \
charge_sound = 'sound/weapons/kinetic_reload.ogg', \
charge_sound_cooldown_time = 0.8 SECONDS, \
)

/obj/item/gun/energy/laser/thermal/add_seclight_point()
AddComponent(/datum/component/seclite_attachable, \
light_overlay_icon = 'icons/obj/weapons/guns/flashlights.dmi', \
light_overlay = "flight", \
overlay_x = 15, \
overlay_y = 9)

/obj/item/gun/energy/laser/thermal/inferno //the magma gun
name = "inferno pistol"
desc = "A modified handcannon with a metamorphic reserve of decommissioned weaponized nanites. Spit globs of molten angry robots into the bad guys. \
While it doesn't manipulate temperature in and of itself, it does cause an violent eruption in anyone who is severely cold. Able to generate \
ammunition by manually spinning the weapon's nanite canister."
icon_state = "infernopistol"
ammo_type = list(/obj/item/ammo_casing/energy/nanite/inferno)

/obj/item/gun/energy/laser/thermal/cryo //the ice gun
name = "cryo pistol"
desc = "A modified handcannon with a metamorphic reserve of decommissioned weaponized nanites. Spit shards of frozen angry robots into the bad guys. \
While it doesn't manipulate temperature in and of itself, it does cause an internal explosion in anyone who is severely hot. Able to generate \
ammunition by manually spinning the weapon's nanite canister."
icon_state = "cryopistol"
ammo_type = list(/obj/item/ammo_casing/energy/nanite/cryo)
42 changes: 0 additions & 42 deletions code/modules/projectiles/guns/energy/laser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,48 +187,6 @@
/obj/item/gun/energy/laser/redtag/hitscan
ammo_type = list(/obj/item/ammo_casing/energy/laser/redtag/hitscan)

//Inferno and Cryo Pistols

/obj/item/gun/energy/laser/thermal //the common parent of these guns, it just shoots hard bullets, somoene might like that?
name = "nanite pistol"
desc = "A modified handcannon with a metamorphic reserve of decommissioned weaponized nanites. Spit globs of angry robots into the bad guys."
icon_state = "infernopistol"
inhand_icon_state = null
ammo_type = list(/obj/item/ammo_casing/energy/nanite)
shaded_charge = TRUE
ammo_x_offset = 1
obj_flags = UNIQUE_RENAME
can_bayonet = TRUE
knife_x_offset = 19
knife_y_offset = 13
w_class = WEIGHT_CLASS_NORMAL
dual_wield_spread = 10 //as intended by the coders

/obj/item/gun/energy/laser/thermal/Initialize(mapload)
. = ..()
AddElement(/datum/element/empprotection, EMP_PROTECT_SELF|EMP_PROTECT_CONTENTS)

/obj/item/gun/energy/laser/thermal/add_seclight_point()
AddComponent(/datum/component/seclite_attachable, \
light_overlay_icon = 'icons/obj/weapons/guns/flashlights.dmi', \
light_overlay = "flight", \
overlay_x = 15, \
overlay_y = 9)

/obj/item/gun/energy/laser/thermal/inferno //the magma gun
name = "inferno pistol"
desc = "A modified handcannon with a metamorphic reserve of decommissioned weaponized nanites. Spit globs of molten angry robots into the bad guys. \
While it doesn't manipulate temperature in and of itself, it does cause an violent eruption in anyone who is severely cold."
icon_state = "infernopistol"
ammo_type = list(/obj/item/ammo_casing/energy/nanite/inferno)

/obj/item/gun/energy/laser/thermal/cryo //the ice gun
name = "cryo pistol"
desc = "A modified handcannon with a metamorphic reserve of decommissioned weaponized nanites. Spit shards of frozen angry robots into the bad guys. \
While it doesn't manipulate temperature in and of itself, it does cause an internal explosion in anyone who is severely hot."
icon_state = "cryopistol"
ammo_type = list(/obj/item/ammo_casing/energy/nanite/cryo)

// luxury shuttle funnies
/obj/item/firing_pin/paywall/luxury
multi_payment = TRUE
Expand Down
8 changes: 4 additions & 4 deletions code/modules/projectiles/projectile/beams.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
name = "low-power laser"
icon_state = "laser_musket"
impact_effect_type = /obj/effect/temp_visual/impact_effect/purple_laser
damage = 25
stamina = 40
damage = 28
stamina = 35
light_color = COLOR_STRONG_VIOLET
weak_against_armour = TRUE

/obj/projectile/beam/laser/musket/prime
name = "mid-power laser"
damage = 30
stamina = 45
damage = 25
stamina = 20
weak_against_armour = FALSE

/obj/projectile/beam/weak
Expand Down
File renamed without changes.
Loading