Skip to content

Commit

Permalink
Disposable energy weapons
Browse files Browse the repository at this point in the history
Adds a variable to energy weapons allowing them to be marked as "disposable" guns. Energy guns with disposable set to true are not able to be charged or used with an inducer.
  • Loading branch information
BurpleBineapple committed Jul 27, 2024
1 parent c49ad70 commit 729cf8d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
13 changes: 10 additions & 3 deletions code/datums/supplypacks/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,16 @@
name = "Weapons - Security basic"
contains = list(/obj/item/device/flash = 4,
/obj/item/reagent_containers/spray/pepper = 4,
/obj/item/melee/baton/loaded = 4,
/obj/item/gun/energy/taser = 4)
cost = 50
/obj/item/melee/baton/loaded = 4)
cost = 30
containertype = /obj/structure/closet/crate/secure/weapon
containername = "weapons crate"
access = access_security

/singleton/hierarchy/supply_pack/security/weapons
name = "Weapons - Disposable tasers"
contains = list(/obj/item/gun/energy/taser/disposable = 4)
cost = 30
containertype = /obj/structure/closet/crate/secure/weapon
containername = "weapons crate"
access = access_security
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/recharger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
return TRUE
if (istype(G, /obj/item/gun/energy))
var/obj/item/gun/energy/E = G
if(E.self_recharge)
if(E.self_recharge || E.disposable)
to_chat(user, SPAN_NOTICE("You can't find a charging port on \the [E]."))
return TRUE
if(!G.get_cell())
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/devices/inducer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@
SPAN_NOTICE("You start recharging \the [A] with \the [src].")
)
if (istype(A, /obj/item/gun/energy))
var/obj/item/gun/energy/gun = A
if(gun.disposable)
to_chat(user, SPAN_WARNING("There is no charging port on \the [gun]!"))
return TRUE
length = 3 SECONDS
if (user.get_skill_value(SKILL_WEAPONS) <= SKILL_TRAINED)
length += rand(1, 3) SECONDS
Expand Down
1 change: 1 addition & 0 deletions code/modules/projectiles/guns/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
var/projectile_type = /obj/item/projectile/beam/practice
var/modifystate
var/charge_meter = 1 //if set, the icon state will be chosen based on the current charge
var/disposable = FALSE //If set, this weapon cannot be recharged

//self-recharging
var/self_recharge = 0 //if set, the weapon will recharge itself
Expand Down
5 changes: 5 additions & 0 deletions code/modules/projectiles/guns/energy/stun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
list(mode_name="shock", projectile_type=/obj/item/projectile/beam/stun/shock),
)

/obj/item/gun/energy/taser/disposable
name = "disposable electrolaser"
desc = "The NT Mk30 NL is a small, low capacity gun used for non-lethal takedowns. This is a cheap, disposable model commonly issued to police forces to supplement their service weapons. It can switch between high and low intensity stun shots."
disposable = TRUE

/obj/item/gun/energy/taser/carbine
name = "electrolaser carbine"
desc = "The NT Mk44 NL is a high capacity gun used for non-lethal takedowns. It can switch between high and low intensity stun shots."
Expand Down

0 comments on commit 729cf8d

Please sign in to comment.