Skip to content

Commit

Permalink
Ports in #86867 from tgstation
Browse files Browse the repository at this point in the history
  • Loading branch information
CRITAWAKETS committed Feb 15, 2025
1 parent 3152ee1 commit cb5c0d9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
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
8 changes: 5 additions & 3 deletions code/datums/components/crank_recharge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
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, spin_to_win = FALSE, 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
Expand All @@ -28,7 +30,7 @@
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 Down Expand Up @@ -57,7 +59,7 @@
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)
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
7 changes: 4 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 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.

0 comments on commit cb5c0d9

Please sign in to comment.