Skip to content

Commit

Permalink
Merge pull request #5253 from Kilmented/master
Browse files Browse the repository at this point in the history
Hunt : Showdown-ification | CMLS | New Skill Floor!! | Modernized our Contemporary Weapons Modernly
  • Loading branch information
Kilmented authored Jun 28, 2024
2 parents baeae41 + f094e6a commit cec4576
Show file tree
Hide file tree
Showing 146 changed files with 5,981 additions and 1,871 deletions.
118 changes: 118 additions & 0 deletions CMLS.txt
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!










2 changes: 1 addition & 1 deletion _maps/map_files/CB-WIP/Bowie_County.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,7 @@
/area/f13/building)
"jU" = (
/obj/effect/decal/cleanable/dirt/dust,
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/obj/item/stack/rods/fifty,
/turf/open/floor/wood_common,
/area/f13/wasteland)
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/CB-WIP/Dekalb.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@
},
/area/f13/wasteland)
"LS" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/f13{
icon_state = "purpledirtyfull"
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/CB-WIP/deerpinepass-alpha.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@
/turf/closed/wall/r_wall/rust,
/area/f13/wasteland)
"kF" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/f13{
icon_state = "purpledirtyfull"
},
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/Fortress Nash/FortNash1.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2759,7 +2759,7 @@
/turf/open/floor/f13/wood,
/area/f13/building)
"akS" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/indestructible/ground/inside/mountain,
/area/f13/caves)
"akT" = (
Expand Down Expand Up @@ -59651,7 +59651,7 @@
/area/f13/building/church)
"qPw" = (
/obj/effect/spawner/lootdrop/f13/weapon/gun/ammo/tier3,
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/f13{
icon_state = "bluerustysolid"
},
Expand Down Expand Up @@ -71526,7 +71526,7 @@
/turf/open/floor/plasteel/f13/vault_floor/misc/cafeteria,
/area/f13/building/hospital)
"vqq" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/f13/wood,
/area/f13/building/abandoned)
"vqy" = (
Expand Down
12 changes: 6 additions & 6 deletions _maps/map_files/Fortress Nash/FortNashLower.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
},
/area/f13/building/sewers)
"aij" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/obj/effect/decal/cleanable/dirt,
/obj/item/book/granter/crafting_recipe/gunsmith_four,
/turf/open/floor/f13{
Expand Down Expand Up @@ -762,7 +762,7 @@
/turf/open/floor/plasteel/f13/vault_floor/dark/darksolid,
/area/f13/tunnel)
"aDN" = (
/obj/machinery/autolathe/ammo/unlocked_basic,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/indestructible/ground/inside/subway,
/area/f13/tunnel)
"aEe" = (
Expand Down Expand Up @@ -8932,7 +8932,7 @@
/obj/effect/turf_decal/stripes/line{
dir = 1
},
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/obj/effect/decal/cleanable/dirt{
color = "#363636"
},
Expand Down Expand Up @@ -19394,7 +19394,7 @@
},
/area/f13/building/sewers)
"nND" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/obj/effect/spawner/lootdrop/f13/blueprintLowPartsWeighted,
/obj/effect/spawner/lootdrop/f13/weapon/gun/ballistic/highmid,
/turf/open/floor/plasteel/f13/vault_floor/misc/vaultrust,
Expand Down Expand Up @@ -20155,7 +20155,7 @@
/turf/open/indestructible/ground/inside/subway,
/area/f13/building/sewers)
"otS" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/indestructible/ground/inside/subway,
/area/f13/caves)
"oud" = (
Expand Down Expand Up @@ -26964,7 +26964,7 @@
},
/area/f13/caves)
"tSC" = (
/obj/machinery/autolathe/ammo/unlocked,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/plasteel/f13/vault_floor/dark{
icon_state = "darkrusty"
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/Fortress Nash/FortNashUpper1.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -6087,7 +6087,7 @@
/turf/open/floor/f13/wood,
/area/f13/building/mall)
"idL" = (
/obj/machinery/autolathe/ammo/unlocked,
/obj/structure/CMLS_ammo_vending_machine,
/obj/item/book/granter/crafting_recipe/gunsmith_one,
/obj/item/book/granter/crafting_recipe/gunsmith_three,
/obj/item/book/granter/crafting_recipe/gunsmith_two,
Expand Down
12 changes: 6 additions & 6 deletions _maps/map_files/Pahrump-Old/Pahrump-Sunset-Lower.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
},
/area/f13/building/sewers)
"aij" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/obj/effect/decal/cleanable/dirt,
/obj/item/book/granter/crafting_recipe/gunsmith_four,
/turf/open/floor/f13{
Expand Down Expand Up @@ -848,7 +848,7 @@
/turf/open/floor/plasteel/f13/vault_floor/dark/darksolid,
/area/f13/tunnel)
"aDN" = (
/obj/machinery/autolathe/ammo/unlocked_basic,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/indestructible/ground/inside/subway,
/area/f13/tunnel)
"aEe" = (
Expand Down Expand Up @@ -10034,7 +10034,7 @@
/obj/effect/turf_decal/stripes/line{
dir = 1
},
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/obj/effect/decal/cleanable/dirt{
color = "#363636"
},
Expand Down Expand Up @@ -22024,7 +22024,7 @@
},
/area/f13/building/sewers)
"nND" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/plasteel/f13/vault_floor/misc/vaultrust,
/area/f13/caves)
"nNP" = (
Expand Down Expand Up @@ -22817,7 +22817,7 @@
/turf/open/floor/carpet/black,
/area/f13/building)
"otS" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/indestructible/ground/inside/subway,
/area/f13/caves)
"oul" = (
Expand Down Expand Up @@ -30857,7 +30857,7 @@
},
/area/f13/caves)
"tSC" = (
/obj/machinery/autolathe/ammo/unlocked,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/plasteel/f13/vault_floor/dark{
icon_state = "darkrusty"
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/Pahrump-Old/Pahrump-Sunset-Upper.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -8847,7 +8847,7 @@
/turf/open/floor/f13/wood,
/area/f13/building/mall)
"idL" = (
/obj/machinery/autolathe/ammo/unlocked,
/obj/structure/CMLS_ammo_vending_machine,
/obj/item/book/granter/crafting_recipe/gunsmith_one,
/obj/item/book/granter/crafting_recipe/gunsmith_three,
/obj/item/book/granter/crafting_recipe/gunsmith_two,
Expand Down
20 changes: 10 additions & 10 deletions _maps/map_files/Pahrump-Old/Pahrump-Sunset.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -7430,7 +7430,7 @@
/area/f13/caves)
"dgD" = (
/obj/effect/spawner/lootdrop/f13/weapon/gun/ammo/tier3,
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/f13{
icon_state = "bluerustysolid"
},
Expand Down Expand Up @@ -9176,7 +9176,7 @@
/turf/open/floor/plasteel/f13/vault_floor/misc/vault1,
/area/f13/building)
"dRT" = (
/obj/machinery/autolathe/ammo/unlocked,
/obj/structure/CMLS_ammo_vending_machine,
/obj/item/book/granter/crafting_recipe/gunsmith_one,
/obj/item/book/granter/crafting_recipe/gunsmith_two,
/obj/item/book/granter/crafting_recipe/gunsmith_three,
Expand Down Expand Up @@ -12638,7 +12638,7 @@
/obj/machinery/light{
dir = 4
},
/obj/machinery/autolathe/ammo/unlocked_basic,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/plasteel/f13/vault_floor/misc/vaultrust,
/area/f13/building)
"fnE" = (
Expand Down Expand Up @@ -16264,7 +16264,7 @@
/turf/open/floor/plasteel/f13/vault_floor/misc/vaultrust,
/area/f13/village)
"gLG" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/obj/machinery/light/small{
dir = 8
},
Expand Down Expand Up @@ -16579,7 +16579,7 @@
},
/area/f13/wasteland)
"gSx" = (
/obj/machinery/autolathe/ammo/unlocked_basic,
/obj/structure/CMLS_ammo_vending_machine,
/obj/effect/decal/cleanable/dirt{
color = "#363636"
},
Expand Down Expand Up @@ -22128,7 +22128,7 @@
dir = 8
},
/obj/effect/decal/cleanable/dirt/dust,
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/f13/wood{
icon_state = "housewood2"
},
Expand Down Expand Up @@ -34415,7 +34415,7 @@
/turf/open/indestructible/ground/outside/dirt,
/area/f13/building)
"ovg" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/obj/item/stack/sheet/metal,
/turf/open/floor/f13/wood,
/area/f13/building)
Expand Down Expand Up @@ -42189,7 +42189,7 @@
/turf/open/floor/f13/wood,
/area/f13/building)
"rWL" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/f13/wood,
/area/f13/building)
"rWN" = (
Expand Down Expand Up @@ -47093,7 +47093,7 @@
/turf/open/floor/f13,
/area/f13/building)
"udt" = (
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/turf/open/floor/f13/wood,
/area/f13/village)
"udx" = (
Expand Down Expand Up @@ -49222,7 +49222,7 @@
/area/f13/brotherhood/surface)
"uZd" = (
/obj/effect/decal/cleanable/dirt/dust,
/obj/machinery/autolathe/ammo,
/obj/structure/CMLS_ammo_vending_machine,
/obj/item/stack/rods/fifty,
/turf/open/floor/f13/wood,
/area/f13/village)
Expand Down
Loading

0 comments on commit cec4576

Please sign in to comment.