-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5253 from Kilmented/master
Hunt : Showdown-ification | CMLS | New Skill Floor!! | Modernized our Contemporary Weapons Modernly
- Loading branch information
Showing
146 changed files
with
5,981 additions
and
1,871 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# HOW TO CMLS | ||
|
||
There are only two things to worry about: The Gun and the Ammo Kind | ||
|
||
### AmmoKind | ||
This defines all the settings for the casing, projectile, magazine, and ammobox. This datum, depending on the vars you set, will automatically: | ||
- Generate a box and/or a crate that'll be added to the CMLS vendor | ||
- Generate a projectile, casing, and magazine | ||
- Load all the sprites from the associated icon file | ||
|
||
Lets say you want to add in 4.92x14mm Scrungy. This'll be a basic Medium AmmoKind. It would look something like this: | ||
```C | ||
/datum/ammo_kind/medium/q_4_92x14mm_scrungy | ||
name = "4.92x14mm Scrungy" | ||
bullet_flavor = "A very scrungy bullet." // You can paste in somme bullshit AI algovomit here, the longer the better, it will show up on the casing (but not the magazine!)." | ||
casing_kind = "cartridge" // 'you load a 4.92x14mm Scrungy cartridge into the gun' | ||
projectile_kind = "bullet" // 'you are hit by a 4.92x14mm Scrungy bullet!' | ||
box_name = "box of 4.92x14mm Scrungy bullets" // name of the associated box of bullets | ||
box_flavor = "Algovomit goes here" // desc of the box | ||
crate_name = "crate of 4.92x14mm Scrungy bullets" // name of the associated crate | ||
crate_flavor = "More algovomit" // desc of the crate | ||
magazine_name = "compact magazine" // if your gun can eject a magazine, it makes a magazine with this name when you eject it | ||
magazine_flavor = "Its a magazine!" // desc of that magazine | ||
caliber = CALIBER_COMPACT // the caliber of the casing, boxes, crates, and magazines | ||
sound_properties = CSP_PISTOL_LIGHT // the sounds this bullet makes (look up [code\modules\projectiles\ammo_casing_gun_sound_properties.dm]) | ||
ammo_icon = 'icons/obj/ammo/compact.dmi' // the icon that the datum pulls all its sprites from (it does this automatically!) | ||
damage_list = list( | ||
"30" = 30, | ||
"35" = 10, | ||
"40" = 1, | ||
"200" = 1, | ||
) // the list of damages this bullet will do. All statistical things are calculated by the datum from this list. If you have a really high value in there somewhere, the datum will interpret that as a crit, and generate a statblock accordingly. | ||
damage_type = BRUTE // Damage type of the projectile, look up [code\__DEFINES\combat.dm] around line 6ish | ||
damage_armor = "bullet" // the armor type the projectile checks against | ||
pellet_count = 1 // number of pellets, used for shotguns | ||
caseless = FALSE // Deletes the casing on shooting, not sure if it works | ||
``` | ||
|
||
For any children of this AmmoKind, all you really need are the names and flavors. If any of the names or flavors are not set, the AmmoKind will automatically generate somewhat fitting names and flavors for whatever's missing. For instance, this is a perfectly valid AmmoKind: | ||
|
||
```C | ||
/datum/ammo_kind/medium/q_4_92x14mm_scrungy | ||
name = "4.92x14mm Scrungy" | ||
``` | ||
|
||
It will inherit all the vars from ammo_kind/medium! | ||
|
||
If your AmmoKind doesn't have any special sprites (as in, the projectile, casing, box, crate, and magazine don't need to look any different from the parent AmmoKind), you're done for the AmmoKind section! Yay! We'll get into how to make it look different later. | ||
|
||
### Gun | ||
Ballistic guns can be CMLSed! | ||
Say you want to make a gun for that Scrungy round. A basic one would look like this: | ||
|
||
```C | ||
/obj/item/gun/ballistic/scrungy_classic | ||
name = "Superduper Scrungy Classic" | ||
desc = "This gun sucks (and swallows)" | ||
|
||
use_cmls = TRUE // Forces the gun to use the CMLS system | ||
var/damage_list = list( | ||
"10" = 50, | ||
"1" = 2, | ||
"40" = 2, | ||
) // If set, these values will be used instead of the damages in AmmoKind | ||
damage_type = BRUTE // Overrides the damage type of the projectile. Can be null to use the AmmoKind's value | ||
damage_armor_type = "bullet" // Overrides the armor check of the projectile. Can be null to use the AmmoKind's value | ||
ammo_kind = /datum/ammo_kind/medium/q_4_92x14mm_scrungy // the AmmoKind that this gun will use. It will set up everything on the gun, nice and easy | ||
ammo_magazine_name = "%MAXAMMO% round clipazine" // Name of the magazine inside the gun, for the text used when you 'eject' the magazine | ||
ammo_capacity = 10 // How many bullets can go in the gun | ||
ammo_single_load = FALSE // Whether or not you can only load one bullet at a time | ||
is_revolver = FALSE // when you go to eject the magazine, it instead just dumps out the casings, like a revolver | ||
sound_magazine_eject = "gun_remove_empty_magazine" // sound it makes when you eject the magazine, if applicable | ||
var/sound_magazine_insert = "gun_insert_full_magazine" // sound it makes when you insert a magazine, if applicable | ||
``` | ||
|
||
And that's it! Your gun (should) be fully functional at this point! Do note that the AmmoKind sprite cataloguer does *not* handle the gun's sprites, those are still handled in the same way as before, so be sure your gun isn't invisible after your changes! | ||
|
||
### Sprites | ||
AmmoKinds automatically read the icon states in their ammo_icon and catalogue all the sprites associated with the kind of ammo it is, handling all that mess on its end! The way it does this is that it runs through the names of each icon_state, reads certain keywords, and categorizes them accordingly. | ||
|
||
These names are made up of one of two sets of tokens: | ||
|
||
"CORB-suffix" for states with no variation (full boxes, empty boxes, etc) | ||
|
||
"CORB-suffix-partial-key" for states that vary based on the number of bullets in the associated box | ||
|
||
CORB can be one of four things: | ||
- bullet | ||
- box | ||
- crate | ||
- magazine | ||
|
||
Suffix can be one of four things: | ||
- projectile | ||
- full | ||
- empty | ||
- partial | ||
|
||
Partial can be one of three things: | ||
- broad | ||
- percent | ||
- count | ||
|
||
Key depends on if Partial is percent or count | ||
- For percent, it will display this sprite if the ammobox is less than this percent full of bullets | ||
- For count, it will display this sprite if the ammobox contains this amount or less of bullets inside | ||
|
||
I'll expand on this later, but the attached images should explain at least some of it! | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.