Skip to content

Commit 71a44ad

Browse files
authored
Modgun Fixes Port (#267)
* handyman's wild fix adventure * god why was that so hard to diagnose
1 parent a883953 commit 71a44ad

File tree

37 files changed

+229
-181
lines changed

37 files changed

+229
-181
lines changed

code/__DEFINES/is_helpers.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ GLOBAL_VAR_INIT(refid_filter, TYPEID(filter(type="angular_blur")))
107107

108108
#define isgun(A) istype(A, /obj/item/gun)
109109

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

112112
#define istool(A) istype(A, /obj/item/tool)
113113

code/__DEFINES/items.dm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,13 @@
101101
#define GUN_UPGRADE_DEFINE_GRIP "grip"
102102
#define GUN_UPGRADE_DEFINE_LOADER "loadtype"
103103
#define GUN_UPGRADE_DENY_MAG "no_mag"
104-
#define GUN_UPGRADE_DEFINE_WCLASS "add_wclass"
104+
#define GUN_UPGRADE_DEFINE_WCLASS "wclass"
105105
#define GUN_UPGRADE_SCOPE_POWER "scope_power"
106+
#define GUN_UPGRADE_SET_FIRESOUND "sound_fire"
107+
#define GUN_UPGRADE_SET_SILENT_FIRESOUND "sound_fire_silent"
108+
#define GUN_UPGRADE_SET_RELOADSOUND "sound_reload"
109+
#define GUN_UPGRADE_SET_COCKEDSOUND "sound_cocked"
110+
#define GUN_UPGRADE_SET_INSERTSOUND "sound_insert"
106111

107112
//Gun Interaction flags
108113
#define GI_ATTACKSELF 1

code/datums/autolathe/guns.dm

Lines changed: 16 additions & 16 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
@@ -129,7 +129,7 @@
129129

130130
/datum/design/autolathe/gun/drozd
131131
name = "Excelsior .40 \"Drozd\""
132-
build_path = /obj/item/gun/projectile/automatic/modular/drozd/finished
132+
build_path = /obj/item/gun/projectile/modular/drozd/finished
133133
minimum_quality = 1
134134

135135
/datum/design/autolathe/gun/slaught_o_matic //alledgedly a handgun, but practically an SMG
@@ -144,7 +144,7 @@
144144

145145
/datum/design/autolathe/gun/vintorez
146146
name = "Excelsior .20 \"Vintorez\""
147-
build_path = /obj/item/gun/projectile/automatic/modular/batrifle/vintorez
147+
build_path = /obj/item/gun/projectile/modular/batrifle/vintorez
148148
minimum_quality = 2
149149

150150
/datum/design/autolathe/gun/z8
@@ -154,16 +154,16 @@
154154

155155
/datum/design/autolathe/gun/wintermute
156156
name = "FS AR .20 \"Wintermute\""
157-
build_path = /obj/item/gun/projectile/automatic/modular/wintermute/finished
157+
build_path = /obj/item/gun/projectile/modular/wintermute/finished
158158
minimum_quality = 2
159159

160160
/datum/design/autolathe/gun/kovacs
161161
name = "SA BR .20 \"Kovacs\""
162-
build_path = /obj/item/gun/projectile/automatic/modular/batrifle/serbian
162+
build_path = /obj/item/gun/projectile/modular/batrifle/serbian
163163

164164
/datum/design/autolathe/gun/boltgun_fs
165165
name = "FS BR .20 \"Kadmin\""
166-
build_path = /obj/item/gun/projectile/automatic/modular/bolt/fs
166+
build_path = /obj/item/gun/projectile/modular/bolt/fs
167167

168168
/datum/design/autolathe/gun/boltgun_fs/ui_icon()
169169
var/obj/build_type = build_path
@@ -184,7 +184,7 @@
184184

185185
/datum/design/autolathe/gun/boltgun
186186
name = "Excelsior .30 \"Kardashev-Mosin\""
187-
build_path = /obj/item/gun/projectile/automatic/modular/bolt/excel
187+
build_path = /obj/item/gun/projectile/modular/bolt/excel
188188
minimum_quality = 2
189189

190190
/datum/design/autolathe/gun/boltgun/ui_icon()
@@ -193,39 +193,39 @@
193193

194194
/datum/design/autolathe/gun/boltgun_serbian
195195
name = "SA BR .30 \"Novakovic\""
196-
build_path = /obj/item/gun/projectile/automatic/modular/bolt/serbian/finished
196+
build_path = /obj/item/gun/projectile/modular/bolt/serbian/finished
197197

198198
/datum/design/autolathe/gun/boltgun_serbian/ui_icon()
199199
var/obj/build_type = build_path
200200
return icon(build_type::icon, "[build_type::icon_state]_closed")
201201

202202
/datum/design/autolathe/gun/ak47
203203
name = "Excelsior Car .30 Kalashnikov"
204-
build_path = /obj/item/gun/projectile/automatic/modular/ak/excelsior
204+
build_path = /obj/item/gun/projectile/modular/ak/excelsior
205205
minimum_quality = 2
206206

207207
/datum/design/autolathe/gun/ak47_fs
208208
name = "FS AR .30 \"Vipr\""
209-
build_path = /obj/item/gun/projectile/automatic/modular/ak/frozen_star
209+
build_path = /obj/item/gun/projectile/modular/ak/frozen_star
210210

211211
/datum/design/autolathe/gun/ak47_fs_ih
212212
name = "FS AR .30 \"Venger\""
213-
build_path = /obj/item/gun/projectile/automatic/modular/ak/ironhammer_securities
213+
build_path = /obj/item/gun/projectile/modular/ak/ironhammer_securities
214214

215215
/datum/design/autolathe/gun/ak47_sa
216216
name = "SA AR .30 \"Krinkov\""
217-
build_path = /obj/item/gun/projectile/automatic/modular/ak/serbian_arms/printed
217+
build_path = /obj/item/gun/projectile/modular/ak/serbian_arms/printed
218218

219219
/datum/design/autolathe/gun/sts35
220220
name = "OR SDF AR .30 \"STS-35\""
221-
build_path = /obj/item/gun/projectile/automatic/modular/batrifle/sts35
221+
build_path = /obj/item/gun/projectile/modular/batrifle/sts35
222222
minimum_quality = 2
223223

224224
// Heavy
225225

226226
/datum/design/autolathe/gun/heavysniper
227227
name = "SA AMR .60 \"Hristov\""
228-
build_path = /obj/item/gun/projectile/automatic/modular/bolt/sniper/finished
228+
build_path = /obj/item/gun/projectile/modular/bolt/sniper/finished
229229
minimum_quality = 2
230230

231231
/datum/design/autolathe/gun/heavysniper/ui_icon()

code/datums/craft/craft_designs.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ Based on /datum/design of \code\datums\autolathe\autolathe_datums.dm
383383
/datum/design/makeshift/sermak
384384
category = "firearm frames"
385385
name = "\"Sermak\" rifle frame"
386-
build_path = /obj/item/gun/projectile/automatic/modular/ak/makeshift
386+
build_path = /obj/item/gun/projectile/modular/ak/makeshift
387387
minimum_quality = 0
388388

389389
// misc

code/datums/craft/gun_parts.dm

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ semi accepts weird caliber - +1 points
314314
..(quality = quality)
315315
I.weapon_upgrades[GUN_UPGRADE_DEFINE_GRIP] = type_of_grip
316316
I.weapon_upgrades[GUN_UPGRADE_OFFSET] = -15 // Without a grip the gun shoots funny, players are legally allowed to not use a grip
317+
I.weapon_upgrades[GUN_UPGRADE_MELEEDAMAGE] = WEAPON_FORCE_WEAK - 1
317318
I.gun_loc_tag = PART_GRIP
318319

319320
/obj/item/part/gun/modular/grip/set_quality(quality = 0)
@@ -385,7 +386,7 @@ semi accepts weird caliber - +1 points
385386
rarity_value = 6
386387

387388
accepted_calibers = list(CAL_PISTOL, CAL_MAGNUM, CAL_SRIFLE, CAL_CLRIFLE, CAL_LRIFLE, CAL_SHOTGUN)
388-
var/loader = MAGAZINE
389+
var/loader = SINGLE_CASING
389390
var/mag_well = MAG_WELL_GENERIC
390391
var/divisor_bonus = 0
391392
var/recoil_bonus = 0
@@ -395,6 +396,9 @@ semi accepts weird caliber - +1 points
395396
var/list/bonus_firemodes = list()
396397
var/no_internal_mag = FALSE
397398

399+
var/sound_reload
400+
var/sound_cocked
401+
var/sound_insert
398402

399403
/obj/item/part/gun/modular/mechanism/New(location, quality = 0)
400404
..(quality = quality)
@@ -403,6 +407,15 @@ semi accepts weird caliber - +1 points
403407
I.weapon_upgrades[GUN_UPGRADE_DEFINE_OK_CALIBERS] = accepted_calibers
404408
I.weapon_upgrades[GUN_UPGRADE_DEFINE_LOADER] = loader
405409

410+
if(sound_reload)
411+
I.weapon_upgrades[GUN_UPGRADE_SET_RELOADSOUND] = sound_reload
412+
if(sound_cocked)
413+
I.weapon_upgrades[GUN_UPGRADE_SET_COCKEDSOUND] = sound_cocked
414+
if(sound_insert)
415+
I.weapon_upgrades[GUN_UPGRADE_SET_INSERTSOUND] = sound_insert
416+
if(damage_bonus)
417+
I.weapon_upgrades[GUN_UPGRADE_DAMAGEMOD_PLUS] = damage_bonus
418+
406419
if(divisor_bonus)
407420
I.weapon_upgrades[GUN_UPGRADE_PEN_MULT] = divisor_bonus
408421
if(recoil_bonus)
@@ -437,6 +450,7 @@ semi accepts weird caliber - +1 points
437450
mag_well = MAG_WELL_PISTOL|MAG_WELL_H_PISTOL
438451
accepted_calibers = list(CAL_PISTOL, CAL_MAGNUM, CAL_SRIFLE, CAL_CLRIFLE)
439452
part_overlay = "mechanism_pistol"
453+
loader = MAGAZINE
440454

441455
/obj/item/part/gun/modular/mechanism/revolver
442456
name = "revolver mechanism"
@@ -459,6 +473,8 @@ semi accepts weird caliber - +1 points
459473
desc = "All the bits that makes the bullet go bang, in a speedy package."
460474
icon_state = "mechanism_smg"
461475
mag_well = MAG_WELL_SMG
476+
loader = MAGAZINE
477+
sound_reload = 'sound/weapons/guns/interact/smg_magin.ogg'
462478

463479
//You'll need to define new parts for each 'unique' element of your gun
464480
//like, in this case, the drozd being an SMG gun which fires .40 rounds.
@@ -477,6 +493,8 @@ semi accepts weird caliber - +1 points
477493
icon_state = "mechanism_autorifle"
478494
matter = list(MATERIAL_PLASTEEL = 10)
479495
mag_well = MAG_WELL_RIFLE|MAG_WELL_RIFLE_L|MAG_WELL_RIFLE_D|MAG_WELL_IH
496+
sound_reload = 'sound/weapons/guns/interact/ltrifle_magin.ogg'
497+
loader = MAGAZINE
480498

481499
// Basic - semiauto with high damage. Total point value: +4
482500
/obj/item/part/gun/modular/mechanism/autorifle/basic
@@ -564,7 +582,7 @@ semi accepts weird caliber - +1 points
564582

565583
//A less-intense version of the commando mechanism.
566584
/obj/item/part/gun/modular/mechanism/autorifle/tactical/sustain
567-
name = "sustaining self-loading mechanism"
585+
name = "sustaining tactical mechanism"
568586
desc = "All the bits that makes the bullet go bang. Allows for automatic fire with decent handling, at the cost of barrel velocity."
569587
icon_state = "mechanism_machinegun"
570588
recoil_bonus = 0.9 // + 1
@@ -575,7 +593,7 @@ semi accepts weird caliber - +1 points
575593

576594
// Sharpshooter - Massively increased damage and moderately increased penetration at the cost of heavy recoil. Total point value: +4
577595
/obj/item/part/gun/modular/mechanism/autorifle/tactical/sharpshooter
578-
name = "sharpshooter self-loading mechanism"
596+
name = "sharpshooter tactical mechanism"
579597
desc = "All the bits that makes the bullet go bang, for all the military hardware you know and love. \
580598
Powerful semiauto mechanism, effective at maximizing the firepower of each bullet. Hard to control."
581599
icon_state = "mechanism_autorifle"
@@ -588,7 +606,7 @@ semi accepts weird caliber - +1 points
588606

589607
// Marksman - Allows dual fire, and has both improved damage at the cost of penetration. Total point value: +4
590608
/obj/item/part/gun/modular/mechanism/autorifle/tactical/marksman
591-
name = "marksman self-loading mechanism"
609+
name = "marksman tactical mechanism"
592610
desc = "All the bits that makes the bullet go bang, for all the military hardware you know and love. \
593611
Accurate mechanism with a 2-fire burst, for designated marksman rifles. Lacks penetration."
594612
icon_state = "mechanism_autorifle"
@@ -601,7 +619,7 @@ semi accepts weird caliber - +1 points
601619
// Commando - Enables high-rpm automatic fire with good handling, at the expense of damage and penetration.
602620
// Has somewhat mediocre performance outside of it's originally-intended frame (The STS-35).
603621
/obj/item/part/gun/modular/mechanism/autorifle/tactical/commando
604-
name = "commando self-loading mechanism"
622+
name = "commando tactical mechanism"
605623
desc = "All the bits that makes the bullet go bang, for all the military hardware you know and love. \
606624
An unusual mechanism that combines fully automatic fire with effective handling for longer ranges, \
607625
originally custom-made for a particular hybrid battle rifle, it suffers from very low exit pressure outside of its intended design."
@@ -620,6 +638,7 @@ semi accepts weird caliber - +1 points
620638
matter = list(MATERIAL_PLASTEEL = 16)
621639
rarity_value = 8
622640
mag_well = MAG_WELL_BOX
641+
loader = MAGAZINE
623642

624643
// steel mechanisms
625644
/obj/item/part/gun/modular/mechanism/pistol/steel
@@ -657,6 +676,7 @@ semi accepts weird caliber - +1 points
657676
max_shells = 10
658677
divisor_bonus = 0.3
659678
damage_bonus = 0.4
679+
sound_reload = 'sound/weapons/guns/interact/rifle_load.ogg'
660680

661681
/obj/item/part/gun/modular/mechanism/boltgun/power
662682
accepted_calibers = list(CAL_SRIFLE, CAL_MAGNUM)
@@ -674,6 +694,7 @@ semi accepts weird caliber - +1 points
674694
max_shells = 1
675695
divisor_bonus = 0
676696
damage_bonus = 1
697+
no_internal_mag = TRUE
677698

678699
/obj/item/part/gun/modular/mechanism/boltgun/junk
679700
name = "handmade manual-action mechanism"
@@ -711,6 +732,8 @@ semi accepts weird caliber - +1 points
711732
var/recoilbuildup
712733
var/pierce
713734
var/basemove
735+
var/fire_sound
736+
var/fire_silenced_sound
714737

715738
/obj/item/part/gun/modular/barrel/New(location, quality = 0)
716739
..(quality = quality)
@@ -725,6 +748,10 @@ semi accepts weird caliber - +1 points
725748
I.weapon_upgrades[GUN_UPGRADE_PIERC_MULT] = pierce
726749
if(basemove)
727750
I.weapon_upgrades[GUN_UPGRADE_BASESLOW] = basemove
751+
if(fire_sound)
752+
I.weapon_upgrades[GUN_UPGRADE_SET_FIRESOUND] = fire_sound
753+
if(fire_silenced_sound)
754+
I.weapon_upgrades[GUN_UPGRADE_SET_SILENT_FIRESOUND] = fire_silenced_sound
728755
I.gun_loc_tag = PART_BARREL
729756

730757

@@ -761,6 +788,7 @@ semi accepts weird caliber - +1 points
761788
price_tag = 100
762789
caliber = CAL_MAGNUM
763790
part_overlay = "well_magnum"
791+
fire_sound = 'sound/weapons/guns/fire/revolver_fire.ogg'
764792

765793
/obj/item/part/gun/modular/barrel/srifle
766794
name = ".20 barrel"
@@ -776,6 +804,7 @@ semi accepts weird caliber - +1 points
776804
onehandpenalty = 1.2
777805
recoilbuildup = 1.2
778806
speed = 0.8
807+
fire_sound = 'sound/weapons/guns/fire/sniper_fire.ogg'
779808

780809
/obj/item/part/gun/modular/barrel/clrifle
781810
name = ".25 barrel"
@@ -792,6 +821,7 @@ semi accepts weird caliber - +1 points
792821
matter = list(MATERIAL_PLASTEEL = 8)
793822
caliber = CAL_LRIFLE
794823
part_overlay = "well_lrifle"
824+
fire_sound = 'sound/weapons/guns/fire/lmg_fire.ogg'
795825

796826
/obj/item/part/gun/modular/barrel/lrifle/forged
797827
name = "forged .30 barrel"
@@ -811,6 +841,7 @@ semi accepts weird caliber - +1 points
811841
matter = list(MATERIAL_PLASTEEL = 8)
812842
caliber = CAL_SHOTGUN
813843
part_overlay = "well_shotgun"
844+
fire_sound = 'sound/weapons/guns/fire/shotgunp_fire.ogg'
814845

815846
/obj/item/part/gun/modular/barrel/antim
816847
name = ".60 barrel"
@@ -819,6 +850,8 @@ semi accepts weird caliber - +1 points
819850
matter = list(MATERIAL_PLASTEEL = 10)
820851
caliber = CAL_ANTIM
821852
part_overlay = "well_amr"
853+
fire_sound = 'sound/weapons/guns/fire/sniper_fire.ogg'
854+
fire_silenced_sound = 'sound/weapons/guns/fire/smg_fire.ogg'
822855

823856
/obj/item/part/gun/modular/barrel/antim/long
824857
name = "long .60 barrel"
@@ -881,6 +914,7 @@ semi accepts weird caliber - +1 points
881914
var/movementcost
882915
var/onehandpenalty
883916
var/wclassmod = 1
917+
var/damagedone = 8
884918

885919
/obj/item/part/gun/modular/stock/New(location, quality = 0)
886920
..() // No stat change, so no need for price change either
@@ -894,6 +928,7 @@ semi accepts weird caliber - +1 points
894928
if(onehandpenalty)
895929
I.weapon_upgrades[GUN_UPGRADE_ONEHANDPENALTY] = onehandpenalty
896930
I.weapon_upgrades[GUN_UPGRADE_DEFINE_WCLASS] = wclassmod
931+
I.weapon_upgrades[GUN_UPGRADE_MELEEDAMAGE] = damagedone
897932

898933
/obj/item/part/gun/modular/stock/heavy
899934
recoilbuildup = 0.7
@@ -904,6 +939,7 @@ semi accepts weird caliber - +1 points
904939
recoilbuildup = 0.8
905940
movementcost = 5
906941
onehandpenalty = 2.4
942+
damagedone = 13
907943

908944
/obj/item/part/gun/modular/sights
909945
name = "iron sights"
@@ -989,7 +1025,8 @@ semi accepts weird caliber - +1 points
9891025
GUN_UPGRADE_BAYONET = TRUE,
9901026
GUN_UPGRADE_MELEEDAMAGE = damagedone,
9911027
GUN_UPGRADE_MELEEPENETRATION = ARMOR_PEN_MODERATE,
992-
GUN_UPGRADE_OFFSET = 4
1028+
GUN_UPGRADE_OFFSET = 4,
1029+
GUN_UPGRADE_MELEEPENETRATION = (ARMOR_PEN_MODERATE-1),
9931030
)
9941031

9951032
/obj/item/part/gun/modular/bayonet/steel

code/datums/craft/recipes/guns.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
/datum/craft_recipe/gun/handmaderifle
2727
name = "HM BR \"Riose\""
28-
result = /obj/item/gun/projectile/automatic/modular/bolt/handmade/finished
28+
result = /obj/item/gun/projectile/modular/bolt/handmade/finished
2929
steps = list(
3030
list(CRAFT_MATERIAL, 13, MATERIAL_STEEL),
3131
list(CRAFT_MATERIAL, 5, MATERIAL_WOOD),
@@ -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),
@@ -120,7 +120,7 @@
120120

121121
/datum/craft_recipe/gun/ballpoint
122122
name = "MS BR \"Ballpoint\""
123-
result = /obj/item/gun/projectile/automatic/modular/batrifle/makeshift
123+
result = /obj/item/gun/projectile/modular/batrifle/makeshift
124124
steps = list(
125125
list(CRAFT_MATERIAL, 10, MATERIAL_STEEL),
126126
list(CRAFT_MATERIAL, 5, MATERIAL_WOOD),

0 commit comments

Comments
 (0)