Skip to content

Commit 6c3bf71

Browse files
committed
gun content
1 parent 9e79c82 commit 6c3bf71

File tree

30 files changed

+238
-389
lines changed

30 files changed

+238
-389
lines changed

_maps/RandomRuins/SpaceRuins/caravanambush.dmm

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@
383383
"gt" = (
384384
/obj/effect/turf_decal/bot_white,
385385
/obj/structure/closet/crate/secure/weapon,
386-
/obj/item/gun/ballistic/revolver/grenadelauncher/unrestricted,
386+
/obj/item/gun/ballistic/revolver/grenadelauncher,
387387
/turf/open/floor/iron/dark/airless,
388388
/area/shuttle/caravan/freighter3)
389389
"gv" = (

_maps/map_files/generic/CentCom.dmm

+1-1
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@
968968
/turf/open/floor/iron/dark,
969969
/area/centcom/central_command_areas/briefing)
970970
"cL" = (
971-
/obj/item/gun/energy/pulse/carbine/loyalpin,
971+
/obj/item/gun/energy/pulse/carbine,
972972
/obj/item/flashlight/seclite,
973973
/obj/structure/table/reinforced,
974974
/obj/machinery/airalarm/directional/south,

code/_compile_options.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
/////////////////////// MISC PERFORMANCE
149149

150150
//uncomment this to load centcom and runtime station and thats it.
151-
// #define LOWMEMORYMODE
151+
#define LOWMEMORYMODE
152152

153153
//uncomment to enable the spatial grid debug proc.
154154
// #define SPATIAL_GRID_ZLEVEL_STATS

code/game/objects/items/storage/uplink_kits.dm

+1-8
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145

146146
if(KIT_NUKEOPS_METAGAME)
147147
new /obj/item/mod/control/pre_equipped/nuclear(src) // 8 tc
148-
new /obj/item/gun/ballistic/shotgun/bulldog/unrestricted(src) // 8 tc
148+
new /obj/item/gun/ballistic/shotgun/bulldog(src) // 8 tc
149149
new /obj/item/implanter/explosive(src) // 2 tc
150150
new /obj/item/ammo_box/magazine/m12g(src) // 2 tc
151151
new /obj/item/ammo_box/magazine/m12g(src) // 2 tc
@@ -300,13 +300,6 @@
300300
for(var/i in 1 to 7)
301301
new /obj/item/reagent_containers/syringe/bioterror(src)
302302

303-
/obj/item/storage/box/syndie_kit/clownpins
304-
name = "ultra hilarious firing pin box"
305-
306-
/obj/item/storage/box/syndie_kit/clownpins/PopulateContents()
307-
for(var/i in 1 to 7)
308-
new /obj/item/firing_pin/clown/ultra(src)
309-
310303
/obj/item/storage/box/syndie_kit/imp_storage
311304
name = "storage implant box"
312305

code/modules/antagonists/clown_ops/outfits.dm

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
backpack_contents = list(/obj/item/storage/box/survival/syndie=1,\
1313
/obj/item/knife/combat/survival,
1414
/obj/item/dnainjector/clumsymut, //in case you want to be clumsy for the memes
15-
/obj/item/storage/box/syndie_kit/clownpins, //for any guns that you get your grubby little clown op mitts on
1615
/obj/item/reagent_containers/spray/waterflower/lube,
1716
/obj/item/mod/skin_applier/honkerative,
1817
)

code/modules/antagonists/gang/outfits.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
name = "Families: Space FBI Officer"
6767
suit = /obj/item/clothing/suit/armor/laserproof
6868
head = /obj/item/clothing/head/helmet/riot
69-
belt = /obj/item/gun/ballistic/automatic/proto/unrestricted
69+
belt = /obj/item/gun/ballistic/automatic/proto
7070
gloves = /obj/item/clothing/gloves/combat
7171
backpack_contents = list(/obj/item/storage/box/handcuffs = 1,
7272
/obj/item/storage/box/teargas = 1,

code/modules/antagonists/heretic/items/hunter_rifle.dm

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
ammo_type = /obj/item/ammo_casing/a762/lionhunter
2121
caliber = CALIBER_A762
2222
max_ammo = 3
23-
multiload = TRUE
2423

2524
/obj/item/ammo_casing/a762/lionhunter
2625
projectile_type = /obj/projectile/bullet/a762/lionhunter

code/modules/capture_the_flag/ctf_equipment.dm

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
fire_sound = 'sound/weapons/gun/shotgun/shot_alt.ogg'
7676
semi_auto = TRUE
7777
internal_magazine = FALSE
78-
tac_reloads = TRUE
7978

8079
/obj/item/gun/ballistic/shotgun/ctf/Initialize(mapload)
8180
. = ..()

code/modules/cargo/packs.dm

-9
Original file line numberDiff line numberDiff line change
@@ -2427,15 +2427,6 @@
24272427
crate_name = "formalwear crate"
24282428
crate_type = /obj/structure/closet/crate/wooden
24292429

2430-
/datum/supply_pack/costumes_toys/clownpin
2431-
name = "Hilarious Firing Pin Crate"
2432-
desc = "I uh... I'm not really sure what this does. Wanna buy it?"
2433-
cost = CARGO_CRATE_VALUE * 10
2434-
contraband = TRUE
2435-
contains = list(/obj/item/firing_pin/clown)
2436-
crate_name = "toy crate" // It's /technically/ a toy. For the clown, at least.
2437-
crate_type = /obj/structure/closet/crate/wooden
2438-
24392430
/datum/supply_pack/costumes_toys/lasertag
24402431
name = "Laser Tag Crate"
24412432
desc = "Foam Force is for boys. Laser Tag is for men. Contains three sets of red suits, blue suits, matching helmets, and matching laser tag guns."

code/modules/clothing/outfits/ert.dm

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
name = "ERT Commander - High Alert"
5858

5959
backpack_contents = list(
60-
/obj/item/gun/energy/pulse/pistol/loyalpin = 1,
60+
/obj/item/gun/energy/pulse/pistol = 1,
6161
/obj/item/melee/baton/security/loaded = 1,
6262
/obj/item/storage/box/survival/engineer = 1,
6363
)
@@ -93,7 +93,7 @@
9393
/datum/outfit/centcom/ert/security/alert
9494
name = "ERT Security - High Alert"
9595

96-
l_hand = /obj/item/gun/energy/pulse/carbine/loyalpin
96+
l_hand = /obj/item/gun/energy/pulse/carbine
9797
backpack_contents = list(
9898
/obj/item/melee/baton/security/loaded = 1,
9999
/obj/item/storage/belt/security/full = 1,
@@ -133,7 +133,7 @@
133133
name = "ERT Medic - High Alert"
134134

135135
backpack_contents = list(
136-
/obj/item/gun/energy/pulse/pistol/loyalpin = 1,
136+
/obj/item/gun/energy/pulse/pistol = 1,
137137
/obj/item/gun/medbeam = 1,
138138
/obj/item/melee/baton/security/loaded = 1,
139139
/obj/item/reagent_containers/hypospray/combat/nanites = 1,
@@ -174,7 +174,7 @@
174174

175175
backpack_contents = list(
176176
/obj/item/construction/rcd/combat = 1,
177-
/obj/item/gun/energy/pulse/pistol/loyalpin = 1,
177+
/obj/item/gun/energy/pulse/pistol = 1,
178178
/obj/item/melee/baton/security/loaded = 1,
179179
/obj/item/pipe_dispenser = 1,
180180
/obj/item/storage/box/survival/engineer = 1,
@@ -519,7 +519,7 @@
519519
shoes = /obj/item/clothing/shoes/combat/swat
520520
l_pocket = /obj/item/melee/energy/sword/saber
521521
r_pocket = /obj/item/shield/energy
522-
l_hand = /obj/item/gun/energy/pulse/loyalpin
522+
l_hand = /obj/item/gun/energy/pulse
523523

524524
skillchips = list(
525525
/obj/item/skillchip/disk_verifier,

code/modules/projectiles/boxes_magazines/_box_magazine.dm

+78-37
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,27 @@
1515
throw_speed = 3
1616
throw_range = 7
1717
override_notes = TRUE
18+
19+
///String, used for checking if ammo of different types but still fits can fit inside it; generally used for magazines
20+
var/caliber
21+
1822
///list containing the actual ammo within the magazine
1923
var/list/stored_ammo = list()
2024
///type that the magazine will be searching for, rejects if not a subtype of
2125
var/ammo_type = /obj/item/ammo_casing
2226
///maximum amount of ammo in the magazine
2327
var/max_ammo = 7
28+
2429
///Controls how sprites are updated for the ammo box; see defines in combat.dm: AMMO_BOX_ONE_SPRITE; AMMO_BOX_PER_BULLET; AMMO_BOX_FULL_EMPTY
2530
var/multiple_sprites = AMMO_BOX_ONE_SPRITE
2631
///For sprite updating, do we use initial(icon_state) or base_icon_state?
2732
var/multiple_sprite_use_base = FALSE
28-
///String, used for checking if ammo of different types but still fits can fit inside it; generally used for magazines
29-
var/caliber
30-
///Allows multiple bullets to be loaded in from one click of another box/magazine
31-
var/multiload = TRUE
33+
34+
///Delay for loading bullets in.
35+
var/load_delay = 0.5 SECONDS
3236
///Whether the magazine should start with nothing in it
3337
var/start_empty = FALSE
38+
3439
///cost of all the bullets in the magazine/box
3540
var/list/bullet_cost
3641
///cost of the materials in the magazine/box itself
@@ -41,6 +46,7 @@
4146
if(!bullet_cost)
4247
base_cost = SSmaterials.FindOrCreateMaterialCombo(custom_materials, 0.1)
4348
bullet_cost = SSmaterials.FindOrCreateMaterialCombo(custom_materials, 0.9 / max_ammo)
49+
4450
if(!start_empty)
4551
top_off(starting=TRUE)
4652

@@ -102,35 +108,8 @@
102108
/obj/item/ammo_box/proc/can_load(mob/user)
103109
return TRUE
104110

105-
/obj/item/ammo_box/attackby(obj/item/A, mob/user, params, silent = FALSE, replace_spent = 0)
106-
var/num_loaded = 0
107-
if(!can_load(user))
108-
return
109-
if(istype(A, /obj/item/ammo_box))
110-
var/obj/item/ammo_box/AM = A
111-
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
112-
var/did_load = give_round(AC, replace_spent)
113-
if(did_load)
114-
AM.stored_ammo -= AC
115-
num_loaded++
116-
if(!did_load || !multiload)
117-
break
118-
if(num_loaded)
119-
AM.update_ammo_count()
120-
if(isammocasing(A))
121-
var/obj/item/ammo_casing/AC = A
122-
if(give_round(AC, replace_spent))
123-
user.transferItemToLoc(AC, src, TRUE)
124-
num_loaded++
125-
AC.update_appearance()
126-
127-
if(num_loaded)
128-
if(!silent)
129-
to_chat(user, span_notice("You load [num_loaded] shell\s into \the [src]!"))
130-
playsound(src, 'sound/weapons/gun/general/mag_bullet_insert.ogg', 60, TRUE)
131-
update_ammo_count()
132-
133-
return num_loaded
111+
/obj/item/ammo_box/attackby(obj/item/A, mob/user, params)
112+
return attempt_load_round(A, user)
134113

135114
/obj/item/ammo_box/attack_self(mob/user)
136115
var/obj/item/ammo_casing/A = get_round()
@@ -144,15 +123,52 @@
144123
to_chat(user, span_notice("You remove a round from [src]!"))
145124
update_ammo_count()
146125

126+
/// Attempts to load a given item into this ammo box
127+
/obj/item/ammo_box/proc/attempt_load_round(obj/item/I, mob/user, silent = FALSE, replace_spent = FALSE)
128+
var/num_loaded = 0
129+
if(!can_load(user))
130+
return FALSE
131+
132+
if(istype(I, /obj/item/ammo_box))
133+
var/obj/item/ammo_box/AM = I
134+
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
135+
if(user && load_delay && !do_after(user, src, load_delay, IGNORE_USER_LOC_CHANGE, FALSE, interaction_key = "load_round"))
136+
break
137+
138+
var/did_load = give_round(AC, replace_spent)
139+
if(!did_load)
140+
break
141+
142+
AM.stored_ammo -= AC
143+
num_loaded++
144+
if(!silent)
145+
user?.visible_message(
146+
span_notice("[user] loads a round into [src]."),
147+
vision_distance = COMBAT_MESSAGE_RANGE,
148+
)
149+
playsound(src, 'sound/weapons/gun/general/mag_bullet_insert.ogg', 60, TRUE)
150+
update_ammo_count()
151+
AM.update_ammo_count()
152+
153+
if(isammocasing(I))
154+
var/obj/item/ammo_casing/AC = I
155+
if(give_round(AC, replace_spent))
156+
user.transferItemToLoc(AC, src, TRUE)
157+
num_loaded++
158+
if(!silent)
159+
playsound(src, 'sound/weapons/gun/general/mag_bullet_insert.ogg', 60, TRUE)
160+
update_ammo_count()
161+
162+
return num_loaded
163+
147164
/// Updates the materials and appearance of this ammo box
148165
/obj/item/ammo_box/proc/update_ammo_count()
149166
update_custom_materials()
150167
update_appearance()
151168

152-
/obj/item/ammo_box/update_desc(updates)
169+
/obj/item/ammo_box/examine(mob/user)
153170
. = ..()
154-
var/shells_left = LAZYLEN(stored_ammo)
155-
desc = "[initial(desc)] There [(shells_left == 1) ? "is" : "are"] [shells_left] shell\s left!"
171+
. += span_notice(get_ammo_desc())
156172

157173
/obj/item/ammo_box/update_icon_state()
158174
var/shells_left = LAZYLEN(stored_ammo)
@@ -170,8 +186,33 @@
170186
temp_materials[material] = (bullet_cost[material] * stored_ammo.len) + base_cost[material]
171187
set_custom_materials(temp_materials)
172188

189+
/// Returns a string that describes the amount of ammo in the magazine.
190+
/obj/item/ammo_box/proc/get_ammo_desc(exact)
191+
if(exact)
192+
return "There are [ammo_count(TRUE)] rounds in [src]."
193+
194+
var/ammo_count = ammo_count(TRUE)
195+
if(ammo_count == 1)
196+
return "There is one round left."
197+
198+
var/ammo_percent = ceil(((ammo_count / max_ammo) * 100))
199+
200+
switch(ammo_percent)
201+
if(0)
202+
return "It is empty."
203+
if(1 to 20)
204+
return "It rattles when you shake it."
205+
if(21 to 40)
206+
return "It is running low on rounds."
207+
if(41 to 69)
208+
return "It is about half full."
209+
if(70 to 99)
210+
return "It is mostly full."
211+
if(100)
212+
return "It is fully loaded."
213+
173214
///Count of number of bullets in the magazine
174-
/obj/item/ammo_box/magazine/proc/ammo_count(countempties = TRUE)
215+
/obj/item/ammo_box/proc/ammo_count(countempties = TRUE)
175216
var/boolets = 0
176217
for(var/obj/item/ammo_casing/bullet in stored_ammo)
177218
if(bullet && (bullet.loaded_projectile || countempties))

code/modules/projectiles/boxes_magazines/internal/revolver.dm

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
ammo_type = /obj/item/ammo_casing/a357
1616
caliber = CALIBER_357
1717
max_ammo = 6
18-
multiload = FALSE
1918

2019
/obj/item/ammo_box/magazine/internal/rus357/Initialize(mapload)
2120
stored_ammo += new ammo_type(src)

code/modules/projectiles/boxes_magazines/internal/rifle.dm

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
ammo_type = /obj/item/ammo_casing/a762
55
caliber = CALIBER_A762
66
max_ammo = 5
7-
multiload = TRUE
87

98
/obj/item/ammo_box/magazine/internal/boltaction/pipegun
109
name = "pipegun internal magazine"

code/modules/projectiles/boxes_magazines/internal/shotgun.dm

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
ammo_type = /obj/item/ammo_casing/shotgun/beanbag
44
caliber = CALIBER_SHOTGUN
55
max_ammo = 4
6-
multiload = FALSE
76

87
/obj/item/ammo_box/magazine/internal/shot/tube
98
name = "dual feed shotgun internal tube"

code/modules/projectiles/gun.dm

+22-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
/* Suppression */
4949
/// whether or not a message is displayed when fired
50-
var/suppressed = null
50+
var/obj/item/suppressed = null
5151
var/can_suppress = FALSE
5252
var/can_unsuppress = TRUE
5353

@@ -111,12 +111,12 @@
111111
/obj/item/gun/Initialize(mapload)
112112
. = ..()
113113
if(pin)
114-
pin = new pin(src)
114+
pin = new pin(src, src)
115115

116116
add_seclight_point()
117117

118118
/obj/item/gun/Destroy()
119-
if(isobj(pin)) //Can still be the initial path, then we skip
119+
if(!ispath(pin)) //Can still be the initial path, then we skip
120120
QDEL_NULL(pin)
121121

122122
QDEL_NULL(bayonet)
@@ -153,6 +153,7 @@
153153

154154
suppressed = null
155155
update_appearance()
156+
verbs -= /obj/item/gun/proc/user_remove_suppressor
156157

157158
/obj/item/gun/examine(mob/user)
158159
. = ..()
@@ -440,9 +441,25 @@
440441
if(!fired && chambered?.loaded_projectile)
441442
chambered.loaded_projectile.damage /= 5
442443

443-
/obj/item/gun/proc/unlock() //used in summon guns and as a convience for admins
444+
/obj/item/gun/proc/unlock()
444445
if(pin)
445446
qdel(pin)
446-
pin = new /obj/item/firing_pin
447+
pin = new /obj/item/firing_pin(src, src)
448+
449+
/obj/item/gun/proc/user_remove_suppressor()
450+
set name = "Remove Suppressor"
451+
set category = "Object"
452+
set src in oview(1)
453+
454+
if(!isliving(usr))
455+
return
456+
457+
if(!usr.canUseTopic(src, USE_CLOSE|USE_DEXTERITY|USE_NEED_HANDS))
458+
return
459+
460+
to_chat(usr, span_notice("You unscrew [suppressed] from [src]."))
461+
if(!usr.put_in_hands(suppressed))
462+
suppressed.forceMove(drop_location())
463+
clear_suppressor()
447464

448465
#undef FIRING_PIN_REMOVAL_DELAY

0 commit comments

Comments
 (0)