Skip to content

Commit 8990435

Browse files
committed
modular type based on projectile
melee force based on parts bayonet AP made consistent between integrated and modifier modular upgrades to set fire, silenced fire, reload, insert, and cock sounds added barrel defines firesound and silencefire mechanism defines reloadsound, insertsound, and cocksound single casing guns without speedloader has max ammo data default quality now allows damage change load method modular scope initialized after being set removed mk58 slot override mk58 regains pistol melee-force
1 parent b19c359 commit 8990435

28 files changed

Lines changed: 181 additions & 130 deletions

File tree

code/__DEFINES/is_helpers.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
#define isgun(A) istype(A, /obj/item/gun)
8888

89-
#define ismodulargun(A) istype(A, /obj/item/gun/projectile/automatic/modular)
89+
#define ismodulargun(A) istype(A, /obj/item/gun/projectile/modular)
9090

9191
#define istool(A) istype(A, /obj/item/tool)
9292

code/__DEFINES/items.dm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,13 @@
9898
#define GUN_UPGRADE_DEFINE_GRIP "grip"
9999
#define GUN_UPGRADE_DEFINE_LOADER "loadtype"
100100
#define GUN_UPGRADE_DENY_MAG "no_mag"
101-
#define GUN_UPGRADE_DEFINE_WCLASS "add_wclass"
101+
#define GUN_UPGRADE_DEFINE_WCLASS "wclass"
102102
#define GUN_UPGRADE_SCOPE_POWER "scope_power"
103+
#define GUN_UPGRADE_SET_FIRESOUND "sound_fire"
104+
#define GUN_UPGRADE_SET_SILENT_FIRESOUND "sound_fire_silent"
105+
#define GUN_UPGRADE_SET_RELOADSOUND "sound_reload"
106+
#define GUN_UPGRADE_SET_COCKEDSOUND "sound_cocked"
107+
#define GUN_UPGRADE_SET_INSERTSOUND "sound_insert"
103108

104109
//Gun Interaction flags
105110
#define GI_ATTACKSELF 1

code/datums/autolathe/guns.dm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929

3030
/datum/design/autolathe/gun/mk58
3131
name = "NT HG .35 \"Mk-58 B\""
32-
build_path = /obj/item/gun/projectile/automatic/modular/mk58/gray/stock
32+
build_path = /obj/item/gun/projectile/modular/mk58/gray/stock
3333
factions = list(FACTION_NEOTHEOLOGY)
3434

3535
/datum/design/autolathe/gun/mk58_wood
3636
name = "NT HG .35 \"Mk-58 C\""
37-
build_path = /obj/item/gun/projectile/automatic/modular/mk58/gray/wood
37+
build_path = /obj/item/gun/projectile/modular/mk58/gray/wood
3838
factions = list(FACTION_NEOTHEOLOGY)
3939

4040
/datum/design/autolathe/gun/mk58_army
4141
name = "NT HG .35 \"Mk-58 e\""
42-
build_path = /obj/item/gun/projectile/automatic/modular/mk58/black/army
42+
build_path = /obj/item/gun/projectile/modular/mk58/black/army
4343
factions = list(FACTION_NEOTHEOLOGY)
4444

4545
/datum/design/autolathe/gun/colt
@@ -150,7 +150,7 @@
150150

151151
/datum/design/autolathe/gun/wintermute
152152
name = "FS AR .20 \"Wintermute\""
153-
build_path = /obj/item/gun/projectile/automatic/modular/wintermute/finished
153+
build_path = /obj/item/gun/projectile/modular/wintermute/finished
154154
minimum_quality = 2
155155

156156
/datum/design/autolathe/gun/kovacs
@@ -184,20 +184,20 @@
184184

185185
/datum/design/autolathe/gun/ak47
186186
name = "Excelsior Car .30 Kalashnikov"
187-
build_path = /obj/item/gun/projectile/automatic/modular/ak/excelsior
187+
build_path = /obj/item/gun/projectile/modular/ak/excelsior
188188
minimum_quality = 2
189189

190190
/datum/design/autolathe/gun/ak47_fs
191191
name = "FS AR .30 \"Vipr\""
192-
build_path = /obj/item/gun/projectile/automatic/modular/ak/frozen_star
192+
build_path = /obj/item/gun/projectile/modular/ak/frozen_star
193193

194194
/datum/design/autolathe/gun/ak47_fs_ih
195195
name = "FS AR .30 \"Venger\""
196-
build_path = /obj/item/gun/projectile/automatic/modular/ak/ironhammer_securities
196+
build_path = /obj/item/gun/projectile/modular/ak/ironhammer_securities
197197

198198
/datum/design/autolathe/gun/ak47_sa
199199
name = "SA AR .30 \"Krinkov\""
200-
build_path = /obj/item/gun/projectile/automatic/modular/ak/serbian_arms/printed
200+
build_path = /obj/item/gun/projectile/modular/ak/serbian_arms/printed
201201

202202
/datum/design/autolathe/gun/sts35
203203
name = "OR SDF AR .30 \"STS-35\""

code/datums/craft/craft_designs.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ Based on /datum/design of \code\datums\autolathe\autolathe_datums.dm
348348
/datum/design/makeshift/sermak
349349
category = "firearm frames"
350350
name = "\"Sermak\" rifle frame"
351-
build_path = /obj/item/gun/projectile/automatic/modular/ak/makeshift
351+
build_path = /obj/item/gun/projectile/modular/ak/makeshift
352352
minimum_quality = 0
353353

354354
// misc

code/datums/craft/gun_parts.dm

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ semi accepts weird caliber - +1 points
309309
..(quality)
310310
I.weapon_upgrades[GUN_UPGRADE_DEFINE_GRIP] = type_of_grip
311311
I.weapon_upgrades[GUN_UPGRADE_OFFSET] = -15 // Without a grip the gun shoots funny, players are legally allowed to not use a grip
312+
I.weapon_upgrades[GUN_UPGRADE_MELEEDAMAGE] = WEAPON_FORCE_WEAK - 1
312313
I.gun_loc_tag = PART_GRIP
313314

314315
/obj/item/part/gun/modular/grip/set_quality(var/quality = 0)
@@ -378,7 +379,7 @@ semi accepts weird caliber - +1 points
378379
price_tag = 100
379380
rarity_value = 6
380381
var/list/accepted_calibers = list(CAL_PISTOL, CAL_MAGNUM, CAL_SRIFLE, CAL_CLRIFLE, CAL_LRIFLE, CAL_SHOTGUN)
381-
var/loader = MAGAZINE
382+
var/loader = SINGLE_CASING
382383
var/mag_well = MAG_WELL_GENERIC
383384
var/divisor_bonus = 0
384385
var/recoil_bonus = 0
@@ -387,7 +388,9 @@ semi accepts weird caliber - +1 points
387388
var/max_shells = 0
388389
var/list/bonus_firemodes = list()
389390
var/no_internal_mag = FALSE
390-
391+
var/sound_reload
392+
var/sound_cocked
393+
var/sound_insert
391394

392395

393396
/obj/item/part/gun/modular/mechanism/New(location, var/quality = 0)
@@ -405,7 +408,14 @@ semi accepts weird caliber - +1 points
405408
I.weapon_upgrades[GUN_UPGRADE_MAGUP] = max_shells
406409
if(no_internal_mag)
407410
I.weapon_upgrades[GUN_UPGRADE_DENY_MAG] = TRUE
408-
411+
if(damage_bonus)
412+
I.weapon_upgrades[GUN_UPGRADE_DAMAGEMOD_PLUS] = damage_bonus
413+
if(sound_reload)
414+
I.weapon_upgrades[GUN_UPGRADE_SET_RELOADSOUND] = sound_reload
415+
if(sound_cocked)
416+
I.weapon_upgrades[GUN_UPGRADE_SET_COCKEDSOUND] = sound_cocked
417+
if(sound_insert)
418+
I.weapon_upgrades[GUN_UPGRADE_SET_INSERTSOUND] = sound_insert
409419
I.gun_loc_tag = PART_MECHANISM
410420

411421
/obj/item/part/gun/modular/mechanism/set_quality(var/quality = 0)
@@ -431,6 +441,7 @@ semi accepts weird caliber - +1 points
431441
mag_well = MAG_WELL_PISTOL|MAG_WELL_H_PISTOL
432442
accepted_calibers = list(CAL_PISTOL, CAL_MAGNUM, CAL_SRIFLE, CAL_CLRIFLE)
433443
part_overlay = "mechanism_pistol"
444+
loader = MAGAZINE
434445

435446
/obj/item/part/gun/modular/mechanism/revolver
436447
name = "revolver mechanism"
@@ -453,13 +464,17 @@ semi accepts weird caliber - +1 points
453464
desc = "All the bits that makes the bullet go bang, in a speedy package."
454465
icon_state = "mechanism_smg"
455466
mag_well = MAG_WELL_SMG
467+
loader = MAGAZINE
468+
sound_reload = 'sound/weapons/guns/interact/smg_magin.ogg'
456469

457470
/obj/item/part/gun/modular/mechanism/autorifle
458471
name = "generic self-loading mechanism"
459472
desc = "All the bits that makes the bullet go bang, for all the military hardware you know and love."
460473
icon_state = "mechanism_autorifle"
461474
matter = list(MATERIAL_PLASTEEL = 10)
462475
mag_well = MAG_WELL_RIFLE|MAG_WELL_RIFLE_L|MAG_WELL_RIFLE_D|MAG_WELL_IH
476+
sound_reload = 'sound/weapons/guns/interact/ltrifle_magin.ogg'
477+
loader = MAGAZINE
463478

464479
// Basic - semiauto with high damage. Total point value: +4
465480
/obj/item/part/gun/modular/mechanism/autorifle/basic
@@ -555,6 +570,7 @@ semi accepts weird caliber - +1 points
555570
matter = list(MATERIAL_PLASTEEL = 16)
556571
rarity_value = 8
557572
mag_well = MAG_WELL_BOX
573+
loader = MAGAZINE
558574

559575
// steel mechanisms
560576
/obj/item/part/gun/modular/mechanism/pistol/steel
@@ -592,6 +608,7 @@ semi accepts weird caliber - +1 points
592608
max_shells = 10
593609
divisor_bonus = 0.3
594610
damage_bonus = 0.4
611+
sound_reload = 'sound/weapons/guns/interact/rifle_load.ogg'
595612

596613
/obj/item/part/gun/modular/mechanism/boltgun/power
597614
accepted_calibers = list(CAL_SRIFLE, CAL_MAGNUM)
@@ -607,6 +624,7 @@ semi accepts weird caliber - +1 points
607624
part_overlay = "big_" // the full entry is handled by the guninteraction
608625
loader = SINGLE_CASING
609626
max_shells = 1
627+
no_internal_mag = TRUE
610628
divisor_bonus = 0
611629
damage_bonus = 1
612630

@@ -646,9 +664,11 @@ semi accepts weird caliber - +1 points
646664
var/recoilbuildup
647665
var/pierce
648666
var/basemove
667+
var/fire_sound
668+
var/fire_silenced_sound
649669

650670
/obj/item/part/gun/modular/barrel/New(location, var/quality = 0)
651-
..(quality)
671+
..()
652672
I.weapon_upgrades[GUN_UPGRADE_DEFINE_CALIBER] = caliber
653673
if(!isnull(speed))
654674
I.weapon_upgrades[GUN_UPGRADE_STEPDELAY_MULT] = speed
@@ -660,6 +680,10 @@ semi accepts weird caliber - +1 points
660680
I.weapon_upgrades[GUN_UPGRADE_PIERC_MULT] = pierce
661681
if(basemove)
662682
I.weapon_upgrades[GUN_UPGRADE_BASESLOW] = basemove
683+
if(fire_sound)
684+
I.weapon_upgrades[GUN_UPGRADE_SET_FIRESOUND] = fire_sound
685+
if(fire_silenced_sound)
686+
I.weapon_upgrades[GUN_UPGRADE_SET_SILENT_FIRESOUND] = fire_silenced_sound
663687
I.gun_loc_tag = PART_BARREL
664688

665689

@@ -696,6 +720,7 @@ semi accepts weird caliber - +1 points
696720
price_tag = 100
697721
caliber = CAL_MAGNUM
698722
part_overlay = "well_magnum"
723+
fire_sound = 'sound/weapons/guns/fire/revolver_fire.ogg'
699724

700725
/obj/item/part/gun/modular/barrel/srifle
701726
name = ".20 barrel"
@@ -711,6 +736,7 @@ semi accepts weird caliber - +1 points
711736
onehandpenalty = 1.2
712737
recoilbuildup = 1.2
713738
speed = 0.8
739+
fire_sound = 'sound/weapons/guns/fire/sniper_fire.ogg'
714740

715741
/obj/item/part/gun/modular/barrel/clrifle
716742
name = ".25 barrel"
@@ -727,6 +753,7 @@ semi accepts weird caliber - +1 points
727753
matter = list(MATERIAL_PLASTEEL = 8)
728754
caliber = CAL_LRIFLE
729755
part_overlay = "well_lrifle"
756+
fire_sound = 'sound/weapons/guns/fire/lmg_fire.ogg'
730757

731758
/obj/item/part/gun/modular/barrel/lrifle/forged
732759
name = "forged .30 barrel"
@@ -746,6 +773,7 @@ semi accepts weird caliber - +1 points
746773
matter = list(MATERIAL_PLASTEEL = 8)
747774
caliber = CAL_SHOTGUN
748775
part_overlay = "well_shotgun"
776+
fire_sound = 'sound/weapons/guns/fire/shotgunp_fire.ogg'
749777

750778
/obj/item/part/gun/modular/barrel/antim
751779
name = ".60 barrel"
@@ -754,6 +782,8 @@ semi accepts weird caliber - +1 points
754782
matter = list(MATERIAL_PLASTEEL = 10)
755783
caliber = CAL_ANTIM
756784
part_overlay = "well_amr"
785+
fire_sound = 'sound/weapons/guns/fire/sniper_fire.ogg'
786+
fire_silenced_sound = 'sound/weapons/guns/fire/smg_fire.ogg'
757787

758788
/obj/item/part/gun/modular/barrel/antim/long
759789
name = "long .60 barrel"
@@ -816,6 +846,7 @@ semi accepts weird caliber - +1 points
816846
var/movementcost
817847
var/onehandpenalty
818848
var/wclassmod = 1
849+
var/damagedone = 8
819850

820851
/obj/item/part/gun/modular/stock/New(location, var/quality = 0)
821852
..() // No stat change, so no need for price change either
@@ -829,6 +860,7 @@ semi accepts weird caliber - +1 points
829860
if(onehandpenalty)
830861
I.weapon_upgrades[GUN_UPGRADE_ONEHANDPENALTY] = onehandpenalty
831862
I.weapon_upgrades[GUN_UPGRADE_DEFINE_WCLASS] = wclassmod
863+
I.weapon_upgrades[GUN_UPGRADE_MELEEDAMAGE] = damagedone
832864

833865
/obj/item/part/gun/modular/stock/heavy
834866
recoilbuildup = 0.7
@@ -839,6 +871,7 @@ semi accepts weird caliber - +1 points
839871
recoilbuildup = 0.8
840872
movementcost = 5
841873
onehandpenalty = 2.4
874+
damagedone = 13 // total goal of 20, frame 1, grip 6
842875

843876
/obj/item/part/gun/modular/sights
844877
name = "ironsights"
@@ -923,7 +956,7 @@ semi accepts weird caliber - +1 points
923956
I.weapon_upgrades = list(
924957
GUN_UPGRADE_BAYONET = TRUE,
925958
GUN_UPGRADE_MELEEDAMAGE = damagedone,
926-
GUN_UPGRADE_MELEEPENETRATION = ARMOR_PEN_MODERATE,
959+
GUN_UPGRADE_MELEEPENETRATION = (ARMOR_PEN_MODERATE-1),
927960
GUN_UPGRADE_OFFSET = 4
928961
)
929962

code/datums/craft/recipes/guns.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109

110110
/datum/craft_recipe/gun/kalash
111111
name = "HM AR \"Sermak\""
112-
result = /obj/item/gun/projectile/automatic/modular/ak/makeshift/preset
112+
result = /obj/item/gun/projectile/modular/ak/makeshift/preset
113113
steps = list(
114114
list(CRAFT_MATERIAL, 20, MATERIAL_STEEL),
115115
list(QUALITY_WELDING, 10, 20),

code/game/machinery/vending.dm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,11 +1662,11 @@
16621662
/obj/item/part/gun = 30,
16631663
/obj/item/gun/energy/retro = 4,
16641664
/obj/item/gun/projectile/shotgun/doublebarrel = 4,
1665-
/obj/item/gun/projectile/automatic/modular/mk58/gray/stock = 2,
1666-
/obj/item/gun/projectile/automatic/modular/mk58/gray/wood = 2,
1667-
/obj/item/gun/projectile/automatic/modular/mk58/black/army = 1,
1665+
/obj/item/gun/projectile/modular/mk58/gray/stock = 2,
1666+
/obj/item/gun/projectile/modular/mk58/gray/wood = 2,
1667+
/obj/item/gun/projectile/modular/mk58/black/army = 1,
16681668
/obj/item/gun/projectile/revolver/deckard = 2,
1669-
/obj/item/gun/projectile/automatic/modular/ak/frozen_star = 4,
1669+
/obj/item/gun/projectile/modular/ak/frozen_star = 4,
16701670
/obj/item/gun/projectile/automatic/z8 = 4,
16711671
/obj/item/gun/projectile/shotgun/pump/regulator = 4,
16721672
/obj/item/gun/projectile/boltgun/fs/civilian = 4,
@@ -1690,12 +1690,12 @@
16901690
/obj/item/part/gun = 700,
16911691
/obj/item/gun/energy/retro = 1200,
16921692
/obj/item/gun/projectile/shotgun/doublebarrel = 1400,
1693-
/obj/item/gun/projectile/automatic/modular/mk58/gray/stock = 900,
1694-
/obj/item/gun/projectile/automatic/modular/mk58/gray/wood = 900,
1695-
/obj/item/gun/projectile/automatic/modular/mk58/black/army = 950,
1693+
/obj/item/gun/projectile/modular/mk58/gray/stock = 900,
1694+
/obj/item/gun/projectile/modular/mk58/gray/wood = 900,
1695+
/obj/item/gun/projectile/modular/mk58/black/army = 950,
16961696
/obj/item/gun/projectile/mandella = 1800,
16971697
/obj/item/gun/projectile/revolver/deckard = 3600,
1698-
/obj/item/gun/projectile/automatic/modular/ak/frozen_star = 3200,
1698+
/obj/item/gun/projectile/modular/ak/frozen_star = 3200,
16991699
/obj/item/gun/projectile/automatic/z8 = 3500,
17001700
/obj/item/gun/projectile/shotgun/pump/regulator = 2400,
17011701
/obj/item/gun/projectile/boltgun/fs/civilian = 2000,

code/game/objects/items/weapons/storage/deferred.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
name = "rifleman crate"
175175
desc = "A crate containing six SA AK-47 rifles, and plenty of magazines."
176176
icon_state = "serbcrate_deferred_green"
177-
initial_contents = list(/obj/item/gun/projectile/automatic/modular/ak/serbian_arms = 6,
177+
initial_contents = list(/obj/item/gun/projectile/modular/ak/serbian_arms = 6,
178178
/obj/item/ammo_magazine/lrifle = 12, /obj/item/ammo_magazine/lrifle/drum = 6)
179179

180180
/obj/item/storage/deferred/crate/kovacs
@@ -383,7 +383,7 @@
383383
desc = "The start of a revolutionary career in Haven's space corps."
384384
icon_state = "Excel_crate"
385385
initial_contents = list(
386-
/obj/item/gun/projectile/automatic/modular/ak/excelsior = 1,
386+
/obj/item/gun/projectile/modular/ak/excelsior = 1,
387387
/obj/item/clothing/under/excelsior = 1,
388388
/obj/item/clothing/gloves/thick = 1,
389389
/obj/item/ammo_magazine/lrifle = 4,

code/game/objects/items/weapons/storage/holster.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/obj/item/gun/projectile/mandella,
2929
/obj/item/gun/projectile/type_62,
3030
/obj/item/gun/projectile/type_90,
31-
/obj/item/gun/projectile/automatic/modular/mk58,
31+
/obj/item/gun/projectile/modular/mk58,
3232
/obj/item/gun/projectile/shotgun/type_21,
3333
/obj/item/gun/energy/gun,
3434
/obj/item/gun/energy/chameleon,
@@ -181,7 +181,7 @@
181181
/obj/item/gun/projectile/handmade_pistol,
182182
/obj/item/gun/projectile/flare_gun,
183183
/obj/item/gun/projectile/lamia,
184-
/obj/item/gun/projectile/automatic/modular/mk58,
184+
/obj/item/gun/projectile/modular/mk58,
185185
/obj/item/gun/projectile/olivaw,
186186
/obj/item/gun/projectile/mandella,
187187
/obj/item/gun/projectile/type_90,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245

246246
/obj/item/storage/briefcase/antimaterial_rifle/populate_contents()
247247
new /obj/item/ammo_casing/antim(src)
248-
new /obj/item/gun/projectile/automatic/modular/bolt/sniper(src)
248+
new /obj/item/gun/projectile/modular/bolt/sniper(src)
249249
new /obj/item/part/gun/modular/grip/serb(src)
250250
new /obj/item/part/gun/modular/mechanism/boltgun/heavy(src)
251251
new /obj/item/part/gun/modular/barrel/antim/long(src)

0 commit comments

Comments
 (0)