Skip to content

Commit 150b3ba

Browse files
authored
Modular Gun conversion tutorial: Drozd (#236)
* modular drozd template bottom text * visual stuff I missed * oops * oops 2 * drozd twohanding * fixes inhands * man. * man 2 * makeshift drozd touchups * adds drozd mechanism to crafting bench * deprecates old drozd frame * Update modular_drozd.dm
1 parent c4f1098 commit 150b3ba

File tree

8 files changed

+122
-2
lines changed

8 files changed

+122
-2
lines changed

cev_eris.dme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,6 +2632,7 @@
26322632
#include "code\modules\projectiles\guns\projectile\modular\interactions.dm"
26332633
#include "code\modules\projectiles\guns\projectile\modular\modular_AK.dm"
26342634
#include "code\modules\projectiles\guns\projectile\modular\modular_bolt.dm"
2635+
#include "code\modules\projectiles\guns\projectile\modular\modular_drozd.dm"
26352636
#include "code\modules\projectiles\guns\projectile\modular\modular_MK58.dm"
26362637
#include "code\modules\projectiles\guns\projectile\modular\modular_wintermute.dm"
26372638
#include "code\modules\projectiles\guns\projectile\other\RPG.dm"

code/datums/autolathe/guns.dm

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

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

135135
/datum/design/autolathe/gun/slaught_o_matic //alledgedly a handgun, but practically an SMG

code/datums/craft/craft_designs.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ Based on /datum/design of \code\datums\autolathe\autolathe_datums.dm
124124
category = "SMG mechanisms"
125125
build_path = /obj/item/part/gun/modular/mechanism/smg
126126

127+
/datum/design/makeshift/mechanism/smg
128+
name = "high-caliber SMG mechanism"
129+
category = "SMG mechanisms"
130+
build_path = /obj/item/part/gun/modular/mechanism/smg/highcaliber
131+
127132
// cheap mechanisms
128133

129134
/datum/design/makeshift/mechanism/pistol/steel

code/datums/craft/gun_parts.dm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,17 @@ semi accepts weird caliber - +1 points
454454
icon_state = "mechanism_smg"
455455
mag_well = MAG_WELL_SMG
456456

457+
//You'll need to define new parts for each 'unique' element of your gun
458+
//like, in this case, the drozd being an SMG gun which fires .40 rounds.
459+
//these parts can also be used to handle part of the unique statlines of weapons.
460+
/obj/item/part/gun/modular/mechanism/smg/highcaliber
461+
name = "High-Caliber SMG mechanism"
462+
desc = "All the bits that makes the bullet go bang, in a speedy package. \
463+
This large-bore version is designed to fire higher caliber bullets, at a cost to penetrative power."
464+
accepted_calibers = list(CAL_MAGNUM)
465+
divisor_bonus = -0.5//this is where the drozd's pen mod has gone
466+
bonus_firemodes = list(FULL_AUTO_300)//ditto for specific firemodes
467+
457468
/obj/item/part/gun/modular/mechanism/autorifle
458469
name = "generic self-loading mechanism"
459470
desc = "All the bits that makes the bullet go bang, for all the military hardware you know and love."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@
372372
/obj/item/ammo_magazine/msmg = 4,
373373
/obj/item/ammo_magazine/ammobox/magnum = 1,
374374
/obj/item/clothing/mask/gas = 1,
375-
/obj/item/gun/projectile/automatic/drozd = 1,
375+
/obj/item/gun/projectile/automatic/modular/drozd/finished = 1,
376376
/obj/item/clothing/suit/armor/gzhel = 1,
377377
/obj/item/clothing/shoes/workboots/proletariat = 1
378378
)

code/modules/projectiles/guns/projectile/automatic/drozd.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@
5151
gripvars = list(/obj/item/part/gun/modular/grip/excel)
5252
mechanismvar = /obj/item/part/gun/modular/mechanism/smg
5353
barrelvars = list(/obj/item/part/gun/modular/barrel/magnum)
54+
spawn_blacklisted = TRUE
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
//This is being used as a tutorial piece for how to convert guns to modguns, hence the extremely gratutious comments
2+
//comments can be removed later/when it's merged
3+
4+
/obj/item/gun/projectile/automatic/modular/drozd // Frame
5+
//only put the base name of the gun here. Other info will be filled in by parts.
6+
name = "\"Drozd\""
7+
//remove any information about the specific caliber of the gun. Stat qualities (like dmg, recoil mod) are fine.
8+
desc = "An excellent fully automatic Heavy SMG. Rifled to take a larger caliber than a typical submachine gun, but unlike \
9+
other heavy SMGs makes use of increased caliber to achieve excellent damage capabilities. \
10+
Suffers a bit less from poor recoil control and ineffective armor penetration."
11+
//new .dmi location, inside the projectile/modular file.
12+
icon = 'icons/obj/guns/projectile/modular/drozd.dmi'
13+
14+
//copy these stats from base gun
15+
w_class = ITEM_SIZE_NORMAL
16+
force = WEAPON_FORCE_PAINFUL
17+
18+
slot_flags = SLOT_BELT
19+
load_method = MAGAZINE
20+
21+
magazine_type = /obj/item/ammo_magazine/msmg
22+
gun_tags = list(GUN_SILENCABLE)
23+
24+
serial_type = "Excelsior"
25+
26+
//need this if the og gun has it, in this case, do not add.
27+
//auto_eject_sound = 'sound/weapons/smg_empty_alarm.ogg'
28+
//auto_eject = TRUE
29+
30+
// Spawns in gun part loot
31+
spawn_blacklisted = FALSE
32+
spawn_tags = SPAWN_TAG_GUN_PART
33+
34+
//nerf from base gun. Since this is only a frame.
35+
origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 1)
36+
matter = list(MATERIAL_PLASTEEL = 5)
37+
price_tag = 1200
38+
39+
//take from gun type. Though, since this is a high caliber smg, it could also use heavier ones.
40+
//somewhat up to your discretion imo
41+
fire_sound = 'sound/weapons/guns/fire/smg_fire.ogg'
42+
unload_sound = 'sound/weapons/guns/interact/smg_magout.ogg'
43+
reload_sound = 'sound/weapons/guns/interact/smg_magin.ogg'
44+
cocked_sound = 'sound/weapons/guns/interact/smg_cock.ogg'
45+
46+
//these vars contains information about the gun's sprite
47+
spriteTags = PARTMOD_SLIDE //this gun has a slide, meaning that sprites have a "-e" variant with the slide pulled back
48+
spriteTagBans = PARTMOD_FOLDING_STOCK // Folding stock does not modify handheld sprite
49+
50+
//special stats associated with the gun. copy from base firearm, within reason
51+
//also see the parts of the gun
52+
init_recoil = SMG_RECOIL(0.7)
53+
54+
//The required parts of a firearm are as follows:
55+
56+
//ESSENTIAL PARTS: All guns MUST have these
57+
//-Grip: determines the base skin of the firearm, and its name. Largely cosmetic.
58+
//-Mechanism: Determines which calibers a gun can fire. often effects stats.
59+
//-Barrel: Determines which specific caliber this gun can -currently- fire. sometimes effects stats.
60+
61+
//OPTIONAL PARTS: Guns MAY support these depending on type/size (eventually, most guns larger than a pistol should support them)
62+
//-Stock: When extended, increases the stability/handling of the gun when two-handed.
63+
//-Sights: Allows the gun to scope in.
64+
//-Bayonet: Increases the melee damage guns do.
65+
required_parts = list(/obj/item/part/gun/modular/mechanism/smg/highcaliber = 0, /obj/item/part/gun/modular/barrel/magnum = 0, /obj/item/part/gun/modular/grip/excel = 0)
66+
67+
68+
//Each gun will eventually need grip sprite variants (changes overall gun skin) For EACH grip type.
69+
//This is not currently your problem, unless you want it to be...
70+
//Just pick the 'default' correct grip for that weapon in required_parts (in this case, the excel version)
71+
72+
//for each new name, try to follow the theme of the existing gun name.
73+
//the Drozd is named after a russian songbird. (and an anti-missile armor system, but let's not mix metaphors)
74+
/obj/item/gun/projectile/automatic/modular/drozd/get_initial_name()
75+
if(grip_type)
76+
switch(grip_type)
77+
if("wood")
78+
return "Excelsior SMG [caliber] \"Robin\""
79+
if("black")
80+
return "BM SMG [caliber] \"Sokol\""
81+
if("rubber")
82+
return "FS SMG [caliber] \"Sparrow\""
83+
if("excelsior")
84+
return "Excelsior SMG [caliber] \"Drozd\""
85+
if("serbian")
86+
return "SA SMG [caliber] \"Sova\""
87+
if("makeshift")
88+
return "MS SMG [caliber] \"Cage\""
89+
else
90+
//for unfinished weapon. Up to your interpretation, should be simpler than normal
91+
return "SMG [caliber] \"Droz\""
92+
93+
//This is the finished version of your gun, with all modifications installed.
94+
95+
//for any parts which are generic in the main required_parts definiton, you must instead put a specific one here
96+
//the number beside each gun part is that part's default quality.
97+
//This can be used as an additional layer of gun balancing
98+
//(though I wouldn't reccomend messing with it too much for 1-1 conversions)
99+
/obj/item/gun/projectile/automatic/modular/drozd/finished
100+
gun_parts = list(/obj/item/part/gun/modular/mechanism/smg/highcaliber = 0, /obj/item/part/gun/modular/barrel/magnum = 0, /obj/item/part/gun/modular/grip/excel = 0)
101+
magazine_type = /obj/item/ammo_magazine/msmg // For the rare case the blacklist is ignored
102+
spawn_tags = SPAWN_TAG_GUN_PROJECTILE //remember to change from frame
3.02 KB
Binary file not shown.

0 commit comments

Comments
 (0)