NT-USP - American Security - How I Learned to Stop Worrying and Love the Gun (#16414)
* gun * vendor * remove disablers from jobs * poop * maybe spell it right * asteroid + gax * armory * bye to all your ammo if you get heavy EMP'd * bald * sprite adjustment from orca feedback * ammo change + vending change * pixel perfect * Update ArmamentsDispenser.js * if this works you owe me an antag token * maps * Update rechargable.dm Co-authored-by: ynot01 <ynot000001@gmail.com> Co-authored-by: Chubbygummibear <kullen.ds@gmail.com>
@@ -9307,6 +9307,14 @@
|
|||||||
},
|
},
|
||||||
/turf/open/floor/plasteel,
|
/turf/open/floor/plasteel,
|
||||||
/area/crew_quarters/fitness)
|
/area/crew_quarters/fitness)
|
||||||
|
"cdC" = (
|
||||||
|
/obj/structure/closet/secure_closet/security/sec,
|
||||||
|
/obj/effect/turf_decal/trimline/red/filled/line{
|
||||||
|
dir = 4
|
||||||
|
},
|
||||||
|
/obj/machinery/armaments_dispenser,
|
||||||
|
/turf/open/floor/plasteel/showroomfloor,
|
||||||
|
/area/security/main)
|
||||||
"cdG" = (
|
"cdG" = (
|
||||||
/obj/machinery/door/airlock/highsecurity{
|
/obj/machinery/door/airlock/highsecurity{
|
||||||
name = "Gravity Generator and SMES";
|
name = "Gravity Generator and SMES";
|
||||||
@@ -30965,6 +30973,14 @@
|
|||||||
},
|
},
|
||||||
/turf/open/floor/plasteel,
|
/turf/open/floor/plasteel,
|
||||||
/area/engine/atmos_distro)
|
/area/engine/atmos_distro)
|
||||||
|
"jBf" = (
|
||||||
|
/obj/item/gun/energy/disabler,
|
||||||
|
/obj/item/gun/energy/disabler{
|
||||||
|
pixel_x = -3;
|
||||||
|
pixel_y = 3
|
||||||
|
},
|
||||||
|
/turf/open/floor/plasteel/dark,
|
||||||
|
/area/ai_monitored/security/armory)
|
||||||
"jBm" = (
|
"jBm" = (
|
||||||
/obj/structure/table/wood,
|
/obj/structure/table/wood,
|
||||||
/obj/item/paper_bin{
|
/obj/item/paper_bin{
|
||||||
@@ -45686,10 +45702,14 @@
|
|||||||
dir = 8
|
dir = 8
|
||||||
},
|
},
|
||||||
/obj/structure/rack,
|
/obj/structure/rack,
|
||||||
/obj/item/gun/energy/disabler{
|
/obj/item/gun/ballistic/automatic/pistol/ntusp{
|
||||||
pixel_x = 3;
|
pixel_x = 3;
|
||||||
pixel_y = -3
|
pixel_y = -3
|
||||||
},
|
},
|
||||||
|
/obj/item/ammo_box/magazine/recharge/ntusp{
|
||||||
|
pixel_x = 9;
|
||||||
|
pixel_y = -7
|
||||||
|
},
|
||||||
/obj/item/gun/energy/disabler,
|
/obj/item/gun/energy/disabler,
|
||||||
/obj/item/gun/energy/disabler{
|
/obj/item/gun/energy/disabler{
|
||||||
pixel_x = -3;
|
pixel_x = -3;
|
||||||
@@ -59786,6 +59806,13 @@
|
|||||||
},
|
},
|
||||||
/turf/open/floor/plasteel/white,
|
/turf/open/floor/plasteel/white,
|
||||||
/area/science/research)
|
/area/science/research)
|
||||||
|
"tgz" = (
|
||||||
|
/obj/effect/turf_decal/trimline/red/filled/line{
|
||||||
|
dir = 4
|
||||||
|
},
|
||||||
|
/obj/structure/closet/secure_closet/security/sec,
|
||||||
|
/turf/open/floor/plasteel/showroomfloor,
|
||||||
|
/area/security/main)
|
||||||
"tgD" = (
|
"tgD" = (
|
||||||
/obj/effect/landmark/start/atmospheric_technician,
|
/obj/effect/landmark/start/atmospheric_technician,
|
||||||
/obj/structure/chair/office/dark{
|
/obj/structure/chair/office/dark{
|
||||||
@@ -104939,7 +104966,7 @@ msb
|
|||||||
aHC
|
aHC
|
||||||
cQp
|
cQp
|
||||||
dSW
|
dSW
|
||||||
aJG
|
jBf
|
||||||
oIh
|
oIh
|
||||||
aJG
|
aJG
|
||||||
uaZ
|
uaZ
|
||||||
@@ -106735,10 +106762,10 @@ adj
|
|||||||
fdg
|
fdg
|
||||||
hFT
|
hFT
|
||||||
hFT
|
hFT
|
||||||
hFT
|
tgz
|
||||||
wIf
|
wIf
|
||||||
tPH
|
tPH
|
||||||
tPH
|
cdC
|
||||||
xnl
|
xnl
|
||||||
lkG
|
lkG
|
||||||
qya
|
qya
|
||||||
|
|||||||
@@ -13287,7 +13287,8 @@
|
|||||||
/turf/open/floor/plasteel,
|
/turf/open/floor/plasteel,
|
||||||
/area/quartermaster/storage)
|
/area/quartermaster/storage)
|
||||||
"guX" = (
|
"guX" = (
|
||||||
/obj/machinery/atmospherics/pipe/simple/supply/hidden/layer2{
|
/obj/effect/landmark/xeno_spawn,
|
||||||
|
/obj/machinery/atmospherics/components/unary/vent_pump/on/layer2{
|
||||||
dir = 4
|
dir = 4
|
||||||
},
|
},
|
||||||
/turf/open/floor/plasteel/showroomfloor,
|
/turf/open/floor/plasteel/showroomfloor,
|
||||||
@@ -20899,10 +20900,14 @@
|
|||||||
pixel_y = 3
|
pixel_y = 3
|
||||||
},
|
},
|
||||||
/obj/item/gun/energy/disabler,
|
/obj/item/gun/energy/disabler,
|
||||||
/obj/item/gun/energy/disabler{
|
/obj/item/gun/ballistic/automatic/pistol/ntusp{
|
||||||
pixel_x = 3;
|
pixel_x = 3;
|
||||||
pixel_y = -3
|
pixel_y = -3
|
||||||
},
|
},
|
||||||
|
/obj/item/ammo_box/magazine/recharge/ntusp{
|
||||||
|
pixel_x = 9;
|
||||||
|
pixel_y = -7
|
||||||
|
},
|
||||||
/turf/open/floor/plasteel/dark,
|
/turf/open/floor/plasteel/dark,
|
||||||
/area/ai_monitored/security/armory)
|
/area/ai_monitored/security/armory)
|
||||||
"kBk" = (
|
"kBk" = (
|
||||||
@@ -28702,9 +28707,6 @@
|
|||||||
/turf/open/floor/plating,
|
/turf/open/floor/plating,
|
||||||
/area/crew_quarters/heads/cmo)
|
/area/crew_quarters/heads/cmo)
|
||||||
"oqA" = (
|
"oqA" = (
|
||||||
/obj/machinery/atmospherics/components/unary/vent_pump/on/layer2{
|
|
||||||
dir = 4
|
|
||||||
},
|
|
||||||
/obj/machinery/light{
|
/obj/machinery/light{
|
||||||
dir = 8
|
dir = 8
|
||||||
},
|
},
|
||||||
@@ -28712,7 +28714,7 @@
|
|||||||
name = "Station Intercom (General)";
|
name = "Station Intercom (General)";
|
||||||
pixel_x = -29
|
pixel_x = -29
|
||||||
},
|
},
|
||||||
/obj/effect/landmark/xeno_spawn,
|
/obj/machinery/armaments_dispenser,
|
||||||
/turf/open/floor/plasteel/showroomfloor,
|
/turf/open/floor/plasteel/showroomfloor,
|
||||||
/area/security/main)
|
/area/security/main)
|
||||||
"oqF" = (
|
"oqF" = (
|
||||||
|
|||||||
@@ -602,6 +602,7 @@
|
|||||||
/obj/structure/reagent_dispensers/peppertank{
|
/obj/structure/reagent_dispensers/peppertank{
|
||||||
pixel_x = 30
|
pixel_x = 30
|
||||||
},
|
},
|
||||||
|
/obj/machinery/armaments_dispenser,
|
||||||
/turf/open/floor/plasteel/showroomfloor,
|
/turf/open/floor/plasteel/showroomfloor,
|
||||||
/area/security/main)
|
/area/security/main)
|
||||||
"acV" = (
|
"acV" = (
|
||||||
@@ -56358,12 +56359,10 @@
|
|||||||
/turf/open/floor/plasteel,
|
/turf/open/floor/plasteel,
|
||||||
/area/engine/atmos_distro)
|
/area/engine/atmos_distro)
|
||||||
"tin" = (
|
"tin" = (
|
||||||
/obj/item/radio/off,
|
|
||||||
/obj/structure/table,
|
|
||||||
/obj/structure/table,
|
|
||||||
/obj/effect/turf_decal/trimline/red/filled/line{
|
/obj/effect/turf_decal/trimline/red/filled/line{
|
||||||
dir = 6
|
dir = 6
|
||||||
},
|
},
|
||||||
|
/obj/machinery/armaments_dispenser,
|
||||||
/turf/open/floor/plasteel,
|
/turf/open/floor/plasteel,
|
||||||
/area/security/checkpoint/auxiliary)
|
/area/security/checkpoint/auxiliary)
|
||||||
"tit" = (
|
"tit" = (
|
||||||
@@ -60818,6 +60817,10 @@
|
|||||||
/obj/item/crowbar,
|
/obj/item/crowbar,
|
||||||
/obj/item/assembly/flash/handheld,
|
/obj/item/assembly/flash/handheld,
|
||||||
/obj/effect/turf_decal/trimline/red/filled/line,
|
/obj/effect/turf_decal/trimline/red/filled/line,
|
||||||
|
/obj/item/radio/off{
|
||||||
|
pixel_x = 9;
|
||||||
|
pixel_y = 1
|
||||||
|
},
|
||||||
/turf/open/floor/plasteel,
|
/turf/open/floor/plasteel,
|
||||||
/area/security/checkpoint/auxiliary)
|
/area/security/checkpoint/auxiliary)
|
||||||
"vdm" = (
|
"vdm" = (
|
||||||
|
|||||||
@@ -5270,10 +5270,7 @@
|
|||||||
/turf/open/floor/plasteel/showroomfloor,
|
/turf/open/floor/plasteel/showroomfloor,
|
||||||
/area/security/main)
|
/area/security/main)
|
||||||
"anu" = (
|
"anu" = (
|
||||||
/obj/structure/table,
|
/obj/machinery/armaments_dispenser,
|
||||||
/obj/machinery/recharger{
|
|
||||||
pixel_y = 4
|
|
||||||
},
|
|
||||||
/turf/open/floor/plasteel/showroomfloor,
|
/turf/open/floor/plasteel/showroomfloor,
|
||||||
/area/security/main)
|
/area/security/main)
|
||||||
"anw" = (
|
"anw" = (
|
||||||
@@ -5714,6 +5711,14 @@
|
|||||||
/obj/effect/landmark/event_spawn,
|
/obj/effect/landmark/event_spawn,
|
||||||
/obj/machinery/atmospherics/pipe/simple/supply/hidden/layer2,
|
/obj/machinery/atmospherics/pipe/simple/supply/hidden/layer2,
|
||||||
/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden/layer4,
|
/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden/layer4,
|
||||||
|
/obj/machinery/recharger/wallrecharger{
|
||||||
|
pixel_x = -22;
|
||||||
|
pixel_y = -8
|
||||||
|
},
|
||||||
|
/obj/machinery/recharger/wallrecharger{
|
||||||
|
pixel_x = -22;
|
||||||
|
pixel_y = 2
|
||||||
|
},
|
||||||
/turf/open/floor/plasteel/showroomfloor,
|
/turf/open/floor/plasteel/showroomfloor,
|
||||||
/area/security/main)
|
/area/security/main)
|
||||||
"aoH" = (
|
"aoH" = (
|
||||||
@@ -16726,6 +16731,8 @@
|
|||||||
/obj/effect/turf_decal/tile/red{
|
/obj/effect/turf_decal/tile/red{
|
||||||
dir = 8
|
dir = 8
|
||||||
},
|
},
|
||||||
|
/obj/item/folder/red,
|
||||||
|
/obj/item/folder/red,
|
||||||
/turf/open/floor/plasteel,
|
/turf/open/floor/plasteel,
|
||||||
/area/security/checkpoint/customs)
|
/area/security/checkpoint/customs)
|
||||||
"aOm" = (
|
"aOm" = (
|
||||||
@@ -17316,9 +17323,6 @@
|
|||||||
/turf/open/floor/plasteel,
|
/turf/open/floor/plasteel,
|
||||||
/area/quartermaster/storage)
|
/area/quartermaster/storage)
|
||||||
"aPD" = (
|
"aPD" = (
|
||||||
/obj/structure/table/reinforced,
|
|
||||||
/obj/item/folder/red,
|
|
||||||
/obj/item/folder/red,
|
|
||||||
/obj/structure/cable/yellow{
|
/obj/structure/cable/yellow{
|
||||||
icon_state = "4-8"
|
icon_state = "4-8"
|
||||||
},
|
},
|
||||||
@@ -17328,6 +17332,7 @@
|
|||||||
/obj/effect/turf_decal/tile/red{
|
/obj/effect/turf_decal/tile/red{
|
||||||
dir = 8
|
dir = 8
|
||||||
},
|
},
|
||||||
|
/obj/machinery/armaments_dispenser,
|
||||||
/turf/open/floor/plasteel,
|
/turf/open/floor/plasteel,
|
||||||
/area/security/checkpoint/customs)
|
/area/security/checkpoint/customs)
|
||||||
"aPE" = (
|
"aPE" = (
|
||||||
|
|||||||
@@ -293,6 +293,12 @@
|
|||||||
InsertAll("", each, GLOB.alldirs)
|
InsertAll("", each, GLOB.alldirs)
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
/datum/asset/simple/security_armaments
|
||||||
|
assets = list(
|
||||||
|
"disablerbig.png" = 'icons/vending_icons/disablerbig.png',
|
||||||
|
"ntuspbig.png" = 'icons/vending_icons/ntuspbig.png',
|
||||||
|
)
|
||||||
|
|
||||||
// Representative icons for each research design
|
// Representative icons for each research design
|
||||||
/datum/asset/spritesheet/research_designs
|
/datum/asset/spritesheet/research_designs
|
||||||
name = "design"
|
name = "design"
|
||||||
|
|||||||
@@ -308,6 +308,19 @@
|
|||||||
/obj/item/gun/energy/disabler)
|
/obj/item/gun/energy/disabler)
|
||||||
crate_name = "disabler crate"
|
crate_name = "disabler crate"
|
||||||
|
|
||||||
|
/datum/supply_pack/security/ntusp
|
||||||
|
name = "NT-USP Crate"
|
||||||
|
desc = "Three stamina-draining ballistic weapons, along with 3 extra clips. Requires Security access to open."
|
||||||
|
cost = 2000
|
||||||
|
access_view = ACCESS_SECURITY
|
||||||
|
contains = list(/obj/item/gun/ballistic/automatic/pistol/ntusp,
|
||||||
|
/obj/item/gun/ballistic/automatic/pistol/ntusp,
|
||||||
|
/obj/item/gun/ballistic/automatic/pistol/ntusp,
|
||||||
|
/obj/item/ammo_box/magazine/recharge/ntusp,
|
||||||
|
/obj/item/ammo_box/magazine/recharge/ntusp,
|
||||||
|
/obj/item/ammo_box/magazine/recharge/ntusp)
|
||||||
|
crate_name = "nt-usp crate"
|
||||||
|
|
||||||
/datum/supply_pack/security/forensics
|
/datum/supply_pack/security/forensics
|
||||||
name = "Forensics Crate"
|
name = "Forensics Crate"
|
||||||
desc = "Stay hot on the criminal's heels with Nanotrasen's Detective Essentials(tm). Contains a forensics scanner, six evidence bags, camera, tape recorder, white crayon, and of course, a fedora. Requires Security access to open."
|
desc = "Stay hot on the criminal's heels with Nanotrasen's Detective Essentials(tm). Contains a forensics scanner, six evidence bags, camera, tape recorder, white crayon, and of course, a fedora. Requires Security access to open."
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
var/withdrawDelay = 0
|
var/withdrawDelay = 0
|
||||||
var/is_bourgeois = FALSE // Marks whether we've tried giving them the achievement already, this round.
|
var/is_bourgeois = FALSE // Marks whether we've tried giving them the achievement already, this round.
|
||||||
var/bounties_claimed = 0 // Marks how many bounties this person has successfully claimed
|
var/bounties_claimed = 0 // Marks how many bounties this person has successfully claimed
|
||||||
|
var/sec_weapon_claimed = FALSE // If this account has claimed a weapon \code\modules\vending\security_armaments.dm
|
||||||
|
|
||||||
/datum/bank_account/New(newname, job, modifier = 1)
|
/datum/bank_account/New(newname, job, modifier = 1)
|
||||||
var/limiter = 0
|
var/limiter = 0
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ GLOBAL_LIST_INIT(available_depts_sec, list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICA
|
|||||||
digitigrade_shoes = /obj/item/clothing/shoes/xeno_wraps/jackboots
|
digitigrade_shoes = /obj/item/clothing/shoes/xeno_wraps/jackboots
|
||||||
l_pocket = /obj/item/restraints/handcuffs
|
l_pocket = /obj/item/restraints/handcuffs
|
||||||
r_pocket = /obj/item/assembly/flash/handheld
|
r_pocket = /obj/item/assembly/flash/handheld
|
||||||
suit_store = /obj/item/gun/energy/disabler
|
|
||||||
backpack_contents = list(/obj/item/melee/baton/loaded=1)
|
backpack_contents = list(/obj/item/melee/baton/loaded=1)
|
||||||
|
|
||||||
backpack = /obj/item/storage/backpack/security
|
backpack = /obj/item/storage/backpack/security
|
||||||
|
|||||||
@@ -73,7 +73,6 @@
|
|||||||
glasses = /obj/item/clothing/glasses/hud/security/sunglasses
|
glasses = /obj/item/clothing/glasses/hud/security/sunglasses
|
||||||
r_pocket = /obj/item/assembly/flash/handheld
|
r_pocket = /obj/item/assembly/flash/handheld
|
||||||
l_pocket = /obj/item/restraints/handcuffs
|
l_pocket = /obj/item/restraints/handcuffs
|
||||||
suit_store = /obj/item/gun/energy/disabler
|
|
||||||
backpack_contents = list(/obj/item/melee/baton/loaded=1) //yogs - ~~added departmental budget ID~~ removes sec budget
|
backpack_contents = list(/obj/item/melee/baton/loaded=1) //yogs - ~~added departmental budget ID~~ removes sec budget
|
||||||
|
|
||||||
backpack = /obj/item/storage/backpack/security
|
backpack = /obj/item/storage/backpack/security
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/obj/item/ammo_box/magazine/recharge
|
/obj/item/ammo_box/magazine/recharge
|
||||||
name = "power pack"
|
name = "power pack"
|
||||||
desc = "A rechargeable, detachable battery that serves as a magazine for laser rifles."
|
desc = "A rechargeable, detachable battery that serves as a magazine for laser rifles."
|
||||||
icon_state = "oldrifle"
|
icon_state = "powerpack"
|
||||||
ammo_type = /obj/item/ammo_casing/caseless/laser
|
ammo_type = /obj/item/ammo_casing/caseless/laser
|
||||||
caliber = LASER
|
caliber = LASER
|
||||||
max_ammo = 20
|
max_ammo = 20
|
||||||
@@ -11,10 +11,63 @@
|
|||||||
/obj/item/ammo_box/magazine/recharge/update_icon()
|
/obj/item/ammo_box/magazine/recharge/update_icon()
|
||||||
..()
|
..()
|
||||||
desc = "[initial(desc)] It has [stored_ammo.len] shot\s left."
|
desc = "[initial(desc)] It has [stored_ammo.len] shot\s left."
|
||||||
if(ammo_count())
|
cut_overlays()
|
||||||
icon_state = "oldrifle"
|
var/cur_ammo = ammo_count()
|
||||||
else
|
if(cur_ammo)
|
||||||
icon_state = "oldrifle_empty"
|
if(cur_ammo >= max_ammo)
|
||||||
|
add_overlay("[icon_state]_o_full")
|
||||||
|
else
|
||||||
|
add_overlay("[icon_state]_o_mid")
|
||||||
|
|
||||||
|
|
||||||
/obj/item/ammo_box/magazine/recharge/attack_self() //No popping out the "bullets"
|
/obj/item/ammo_box/magazine/recharge/attack_self() //No popping out the "bullets"
|
||||||
return
|
return
|
||||||
|
|
||||||
|
/obj/item/gun/ballistic/automatic/pistol/ntusp
|
||||||
|
name = "NT-USP pistol"
|
||||||
|
desc = "A small pistol that uses hardlight technology to synthesize bullets. Due to its low power, it doesn't have much use besides tiring out criminals."
|
||||||
|
icon_state = "ntusp"
|
||||||
|
w_class = WEIGHT_CLASS_SMALL
|
||||||
|
mag_type = /obj/item/ammo_box/magazine/recharge/ntusp
|
||||||
|
can_suppress = FALSE
|
||||||
|
can_flashlight = TRUE
|
||||||
|
bolt_type = BOLT_TYPE_LOCKING
|
||||||
|
fire_sound = "sound/weapons/gunshot.ogg"
|
||||||
|
vary_fire_sound = FALSE
|
||||||
|
fire_sound_volume = 80
|
||||||
|
rack_sound = "sound/weapons/pistolrack.ogg"
|
||||||
|
bolt_drop_sound = "sound/weapons/pistolslidedrop.ogg"
|
||||||
|
bolt_wording = "slide"
|
||||||
|
feedback_types = list(
|
||||||
|
"fire" = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
//NT-USP Clip
|
||||||
|
/obj/item/ammo_box/magazine/recharge/ntusp
|
||||||
|
name = "small power pack"
|
||||||
|
desc = "A small rechargable power pack that synthesizes .22HL bullets, used in the NT-USP."
|
||||||
|
icon_state = "powerpack_small"
|
||||||
|
ammo_type = /obj/item/ammo_casing/caseless/c22hl
|
||||||
|
max_ammo = 9
|
||||||
|
|
||||||
|
/obj/item/ammo_box/magazine/recharge/ntusp/emp_act(severity) //shooting physical bullets wont stop you dying to an EMP
|
||||||
|
. = ..()
|
||||||
|
if(!(. & EMP_PROTECT_CONTENTS))
|
||||||
|
var/bullet_count = ammo_count()
|
||||||
|
var/bullets_to_remove = round(bullet_count / severity)
|
||||||
|
for(var/i = 0; i < bullets_to_remove, i++)
|
||||||
|
qdel(get_round())
|
||||||
|
update_icon()
|
||||||
|
|
||||||
|
/obj/item/ammo_casing/caseless/c22hl
|
||||||
|
caliber = ENERGY
|
||||||
|
projectile_type = /obj/item/projectile/bullet/c22hl
|
||||||
|
|
||||||
|
/obj/item/projectile/bullet/c22hl //.22 HL
|
||||||
|
name = "NT-USP beam"
|
||||||
|
icon_state = "disabler_bullet"
|
||||||
|
flag = ENERGY
|
||||||
|
damage = 2 //ouch ouch my skin ouchie
|
||||||
|
damage_type = BURN
|
||||||
|
stamina = 25
|
||||||
|
|
||||||
|
|||||||
120
code/modules/vending/security_armaments.dm
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
// An armaments dispenser that gives security officers their roundstart weapon
|
||||||
|
/obj/machinery/armaments_dispenser
|
||||||
|
name = "armaments dispenser"
|
||||||
|
desc = "A standard issue security armaments dispenser."
|
||||||
|
icon = 'icons/obj/vending.dmi'
|
||||||
|
icon_state = "armament" // BAIOMU REPLACE THIS WITH YOUR SPRITE
|
||||||
|
layer = 2.9
|
||||||
|
density = TRUE
|
||||||
|
var/list/inventory = list()
|
||||||
|
|
||||||
|
contents = newlist(/obj/item/gun/energy/disabler,
|
||||||
|
/obj/item/gun/ballistic/automatic/pistol/ntusp)
|
||||||
|
|
||||||
|
|
||||||
|
/obj/machinery/armaments_dispenser/Initialize()
|
||||||
|
. = ..()
|
||||||
|
inventory = contents.Copy()
|
||||||
|
|
||||||
|
/obj/machinery/armaments_dispenser/ui_assets(mob/user)
|
||||||
|
return list(
|
||||||
|
get_asset_datum(/datum/asset/simple/security_armaments),
|
||||||
|
)
|
||||||
|
|
||||||
|
/obj/machinery/armaments_dispenser/ui_act(action, params)
|
||||||
|
if(..())
|
||||||
|
return TRUE
|
||||||
|
|
||||||
|
var/allowed = FALSE
|
||||||
|
var/can_claim = FALSE
|
||||||
|
var/obj/item/card/id/C = usr?.get_idcard()
|
||||||
|
// Security officers and wardens
|
||||||
|
if(istype(C) && (ACCESS_SECURITY in C.access) && (ACCESS_WEAPONS in C.access) && !(ACCESS_HOS in C.access))
|
||||||
|
allowed = TRUE
|
||||||
|
// Hasn't claimed a weapon yet
|
||||||
|
if(!C?.registered_account?.sec_weapon_claimed)
|
||||||
|
can_claim = TRUE
|
||||||
|
|
||||||
|
if(!allowed)
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
if(!can_claim)
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
switch(action)
|
||||||
|
if("dispense_weapon")
|
||||||
|
if(params["weapon"] && ispath(text2path(params["weapon"])))
|
||||||
|
var/wep = text2path(params["weapon"])
|
||||||
|
new wep(loc)
|
||||||
|
if(params["magazine"] && ispath(text2path(params["magazine"])))
|
||||||
|
var/mag = text2path(params["magazine"])
|
||||||
|
new mag(loc)
|
||||||
|
else
|
||||||
|
return FALSE
|
||||||
|
C.registered_account.sec_weapon_claimed = TRUE
|
||||||
|
return TRUE
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
/obj/machinery/armaments_dispenser/ui_interact(mob/user, datum/tgui/ui)
|
||||||
|
if(stat & (BROKEN | NOPOWER | MAINT))
|
||||||
|
if(ui)
|
||||||
|
ui.close()
|
||||||
|
return 0
|
||||||
|
|
||||||
|
ui = SStgui.try_update_ui(user, src, ui)
|
||||||
|
if (!ui)
|
||||||
|
ui = new(user, src, "ArmamentsDispenser")
|
||||||
|
ui.open()
|
||||||
|
|
||||||
|
/obj/machinery/armaments_dispenser/ui_static_data(mob/user)
|
||||||
|
var/list/data = ..()
|
||||||
|
var/list/items = list()
|
||||||
|
for(var/obj/item/wep in inventory)
|
||||||
|
var/obj/item/gun/weapon = wep
|
||||||
|
weapon.update_icon(TRUE)
|
||||||
|
var/icon/gun_icon = getFlatIcon(wep)
|
||||||
|
|
||||||
|
var/list/details = list()
|
||||||
|
details["name"] = weapon.name
|
||||||
|
details["description"] = weapon.desc
|
||||||
|
details["path"] = weapon.type
|
||||||
|
|
||||||
|
var/md5 = md5(fcopy_rsc(gun_icon))
|
||||||
|
|
||||||
|
if(!SSassets.cache["photo_[md5]_icon.png"])
|
||||||
|
SSassets.transport.register_asset("photo_[md5]_icon.png", gun_icon)
|
||||||
|
|
||||||
|
SSassets.transport.send_assets(user, list("photo_[md5]_icon.png" = gun_icon))
|
||||||
|
details["gun_icon"] = SSassets.transport.get_asset_url("photo_[md5]_icon.png")
|
||||||
|
if(istype(weapon, /obj/item/gun/ballistic))
|
||||||
|
var/obj/item/gun/ballistic/gun = wep
|
||||||
|
var/icon/mag_icon = getFlatIcon(gun.magazine)
|
||||||
|
md5 = md5(fcopy_rsc(mag_icon))
|
||||||
|
|
||||||
|
if(!SSassets.cache["photo_[md5]_icon.png"])
|
||||||
|
SSassets.transport.register_asset("photo_[md5]_icon.png", mag_icon)
|
||||||
|
SSassets.transport.send_assets(user, list("photo_[md5]_icon.png" = mag_icon))
|
||||||
|
details["mag_icon"] = SSassets.transport.get_asset_url("photo_[md5]_icon.png")
|
||||||
|
details["mag_path"] = gun.mag_type
|
||||||
|
items += list(details)
|
||||||
|
|
||||||
|
data["inventory"] = items
|
||||||
|
return data
|
||||||
|
|
||||||
|
/obj/machinery/armaments_dispenser/ui_data(mob/user)
|
||||||
|
var/list/data = ..()
|
||||||
|
|
||||||
|
var/allowed = FALSE
|
||||||
|
var/can_claim = FALSE
|
||||||
|
var/obj/item/card/id/C = user?.get_idcard()
|
||||||
|
// Security officers and wardens
|
||||||
|
if(istype(C) && (ACCESS_SECURITY in C.access) && (ACCESS_WEAPONS in C.access) && !(ACCESS_HOS in C.access))
|
||||||
|
allowed = TRUE
|
||||||
|
// Hasn't claimed a weapon yet
|
||||||
|
if(!C?.registered_account?.sec_weapon_claimed)
|
||||||
|
can_claim = TRUE
|
||||||
|
|
||||||
|
data["allowed"] = allowed
|
||||||
|
data["can_claim"] = can_claim
|
||||||
|
|
||||||
|
return data
|
||||||
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 104 KiB |
BIN
icons/vending_icons/disablerbig.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
icons/vending_icons/ntuspbig.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
81
tgui/packages/tgui/interfaces/ArmamentsDispenser.js
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
import { resolveAsset } from '../assets';
|
||||||
|
import { useBackend } from '../backend';
|
||||||
|
import { NoticeBox, Button, Flex, Box } from '../components';
|
||||||
|
import { Window } from '../layouts';
|
||||||
|
|
||||||
|
export const ArmamentsDispenser = (props, context) => {
|
||||||
|
const { act, data } = useBackend(context);
|
||||||
|
const { inventory = [] } = data;
|
||||||
|
return (
|
||||||
|
<Window
|
||||||
|
title="Armaments Dispenser"
|
||||||
|
width={540}
|
||||||
|
height={335}
|
||||||
|
resizable>
|
||||||
|
<Window.Content>
|
||||||
|
{(data.allowed === 1 && data.can_claim === 1) && (
|
||||||
|
<NoticeBox textAlign="center" info>
|
||||||
|
Please select your preferred weapon.
|
||||||
|
</NoticeBox>
|
||||||
|
)}
|
||||||
|
{data.allowed !== 1 && (
|
||||||
|
<NoticeBox textAlign="center" danger>
|
||||||
|
You are not a security officer or warden!
|
||||||
|
</NoticeBox>
|
||||||
|
)}
|
||||||
|
{(data.can_claim !== 1 && data.allowed === 1) && (
|
||||||
|
<NoticeBox textAlign="center" danger>
|
||||||
|
You have already claimed a weapon or do not have a registered account!
|
||||||
|
</NoticeBox>
|
||||||
|
)}
|
||||||
|
<Flex
|
||||||
|
justify="space-between"
|
||||||
|
spacing={1}>
|
||||||
|
{inventory.map(weapon => (
|
||||||
|
<Flex.Item
|
||||||
|
key={weapon}>
|
||||||
|
<Button
|
||||||
|
key={weapon}
|
||||||
|
fluid
|
||||||
|
disabled={!data.allowed || !data.can_claim}
|
||||||
|
width="260px"
|
||||||
|
height="260px"
|
||||||
|
textAlign="center"
|
||||||
|
onClick={() => act('dispense_weapon', {
|
||||||
|
weapon: weapon.path,
|
||||||
|
magazine: weapon.mag_path,
|
||||||
|
})} >
|
||||||
|
<Flex
|
||||||
|
height="100%"
|
||||||
|
direction="column">
|
||||||
|
<Box
|
||||||
|
as="img"
|
||||||
|
class="gun_icon"
|
||||||
|
position="relative"
|
||||||
|
src={resolveAsset(weapon.gun_icon)}
|
||||||
|
height="100%"
|
||||||
|
width="100%"
|
||||||
|
style={{
|
||||||
|
'-ms-interpolation-mode': 'nearest-neighbor' }} />
|
||||||
|
{!!(weapon.mag_icon) && (
|
||||||
|
<Box
|
||||||
|
as="img"
|
||||||
|
class="gun_icon"
|
||||||
|
position="absolute"
|
||||||
|
left="40%"
|
||||||
|
bottom="10%"
|
||||||
|
src={resolveAsset(weapon.mag_icon)}
|
||||||
|
height="50%"
|
||||||
|
width="50%"
|
||||||
|
style={{
|
||||||
|
'-ms-interpolation-mode': 'nearest-neighbor' }} />)}
|
||||||
|
</Flex>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</Flex.Item>))}
|
||||||
|
</Flex>
|
||||||
|
|
||||||
|
</Window.Content>
|
||||||
|
</Window>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -3416,6 +3416,7 @@
|
|||||||
#include "code\modules\vending\plasmaresearch.dm"
|
#include "code\modules\vending\plasmaresearch.dm"
|
||||||
#include "code\modules\vending\robotics.dm"
|
#include "code\modules\vending\robotics.dm"
|
||||||
#include "code\modules\vending\security.dm"
|
#include "code\modules\vending\security.dm"
|
||||||
|
#include "code\modules\vending\security_armaments.dm"
|
||||||
#include "code\modules\vending\snack.dm"
|
#include "code\modules\vending\snack.dm"
|
||||||
#include "code\modules\vending\sovietsoda.dm"
|
#include "code\modules\vending\sovietsoda.dm"
|
||||||
#include "code\modules\vending\sustenance.dm"
|
#include "code\modules\vending\sustenance.dm"
|
||||||
|
|||||||