Skip to content

Commit

Permalink
feat(content): 3D printers (cataclysmbnteam#4801)
Browse files Browse the repository at this point in the history
* 3D Printer

Added in 3D printer, carbon fiber items. Recipes pending.

* Basic 3D printer can no longer repair steel

* style(autofix.ci): automated formatting

* Carbon fiber armor recipes

Made carbon fiber armor have recipes.

* Added carbon fiber shields

* Crafting time, skill changes

Made different recipes require different skill levels and have different crafting times.

* Spear correction

* Recipes, arrows

Added recipe for plastic bottle, plastic jug, plastic jerrycan, and carbon fiber arrows and bolts. Changed carbon fiber arrows to be made of carbon fiber instead of rigid kevlar.

* Fix recipe magazines

* Carbon fiber crossbow, recipes

Added carbon fiber crossbow and recipes for it, the pistol, and the rifle.

* Added looks-like for guns

* Changed recipe book, add some autolearn

* Recipe correction

* Textbook changes

* style(autofix.ci): automated formatting

* Gave 3d printer charges per use

* Fixed shield weights

* Added construction

Added a construction and construction group for the grid 3D printer

* Gun adjustments

Made the carbon fiber rifle use any STANAG magazine, and made the carbon fiber magazine able to be used with any STANAG rifle. Removed the carbon fiber pistol magazine and made the carbon fiber machine pistol use glock magazines instead, which I added recipes for.

* Update data/json/items/melee/unarmed_weapons.json

Co-authored-by: Chaosvolt <[email protected]>

* Update data/json/items/ranged/crossbows.json

* Update data/json/items/tool/science.json

* Added itemgroups

Added the various new carbon fiber items to itemgroups.

* style(autofix.ci): automated formatting

* Apply suggestions from code review

* Fixes

* Fix fix

* Fix??

* Fix carbon pistol issue

* Update iteminfo_test.cpp

* Update iteminfo_test.cpp

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Chaosvolt <[email protected]>
  • Loading branch information
3 people authored Jun 25, 2024
1 parent 902302b commit 66ab489
Show file tree
Hide file tree
Showing 56 changed files with 895 additions and 8 deletions.
14 changes: 14 additions & 0 deletions data/json/construction.json
Original file line number Diff line number Diff line change
Expand Up @@ -5079,5 +5079,19 @@
"pre_note": "Will only work if constructed in/on a building that has an electric grid with a mounted battery.",
"pre_furniture": "f_street_light",
"post_furniture": "f_street_light_rewired_off"
},
{
"type": "construction",
"id": "constr_grid3dprinter_basic",
"group": "place_3d_printer_basic",
"category": "WORKSHOP",
"required_skills": [ [ "electronics", 1 ] ],
"time": "30 m",
"qualities": [ [ { "id": "SCREW", "level": 1 } ] ],
"using": [ [ "soldering_standard", 20 ] ],
"components": [ [ [ "3d_printer_basic", 1 ] ], [ [ "cable", 5 ] ], [ [ "power_supply", 1 ] ] ],
"pre_note": "Will only work if constructed in/on a building that has an electric grid with a mounted battery.",
"pre_special": "check_empty",
"post_furniture": "f_3d_printer"
}
]
5 changes: 5 additions & 0 deletions data/json/construction_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,11 @@
"id": "install_plut_generator",
"name": "Install Plutonium Generator"
},
{
"type": "construction_group",
"id": "place_3d_printer_basic",
"name": "Place 3D Printer"
},
{
"type": "construction_group",
"id": "place_ac_unit",
Expand Down
66 changes: 66 additions & 0 deletions data/json/furniture_and_terrain/furniture-appliances.json
Original file line number Diff line number Diff line change
Expand Up @@ -2414,5 +2414,71 @@
]
},
"active": [ "steady_consumer", { "power": -1, "consume_every": "3 s" } ]
},
{
"type": "furniture",
"id": "f_3d_printer",
"looks_like": "3d_printer_basic",
"name": "grid 3D printer",
"symbol": "=",
"description": "A 3D printer connected to a electrical grid.",
"color": "blue",
"move_cost_mod": -1,
"coverage": 10,
"required_str": -1,
"crafting_pseudo_item": [ "fake_3d_printer" ],
"flags": [ "TRANSPARENT", "MOUNTABLE", "EASY_DECONSTRUCT" ],
"deconstruct": {
"items": [
{ "item": "solder_wire", "charges": 20 },
{ "item": "3d_printer_basic", "count": 1 },
{ "item": "cable", "charges": 5 },
{ "item": "power_supply", "count": 1 }
]
},
"bash": {
"str_min": 8,
"str_max": 30,
"sound": "metal screeching!",
"sound_fail": "clang!",
"items": [
{ "item": "solder_wire", "charges": [ 10, 20 ] },
{ "item": "scrap", "count": [ 0, 2 ] },
{ "item": "cable", "charges": [ 1, 4 ] }
]
}
},
{
"type": "furniture",
"id": "f_3d_printer_advanced",
"looks_like": "3d_printer_advanced",
"name": "grid 3D printer (advanced)",
"symbol": "=",
"description": "An advanced 3D printer connected to a electrical grid.",
"color": "blue",
"move_cost_mod": -1,
"coverage": 10,
"required_str": -1,
"crafting_pseudo_item": [ "fake_3d_printer_advanced" ],
"flags": [ "TRANSPARENT", "MOUNTABLE", "EASY_DECONSTRUCT" ],
"deconstruct": {
"items": [
{ "item": "solder_wire", "charges": 20 },
{ "item": "3d_printer_advanced", "count": 1 },
{ "item": "cable", "charges": 5 },
{ "item": "power_supply", "count": 1 }
]
},
"bash": {
"str_min": 8,
"str_max": 30,
"sound": "metal screeching!",
"sound_fail": "clang!",
"items": [
{ "item": "solder_wire", "charges": [ 10, 20 ] },
{ "item": "scrap", "count": [ 0, 2 ] },
{ "item": "cable", "charges": [ 1, 4 ] }
]
}
}
]
1 change: 1 addition & 0 deletions data/json/itemgroups/Clothing_Gear/gear.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
[ "torso_bandolier_shotgun", 8 ],
[ "kevlar", 20 ],
[ "knife_combat", 10 ],
[ "knife_carbon", 10 ],
[ "legpouch_large", 5 ],
[ "mask_bal", 10 ],
[ "mask_gas", 10 ],
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/Locations_MapExtras/locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,7 @@
{ "item": "brewing_cookbook", "prob": 3 },
{ "item": "recipe_bullets", "prob": 1 },
{ "item": "knife_combat", "prob": 14 },
{ "item": "knife_carbon", "prob": 14 },
{ "item": "knife_rm42", "prob": 2 },
{ "item": "kukri", "prob": 2 },
{ "item": "knife_hunting", "prob": 4 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
[ "bullwhip", 3 ],
[ "bowhat", 10 ],
[ "cowboy_hat", 10 ],
[ "3d_printer_basic", 5 ],
[ "10gal_hat", 5 ],
[ "hat_chef", 5 ],
[ "jacket_chef", 5 ],
Expand Down Expand Up @@ -289,6 +290,7 @@
[ "ax", 8 ],
[ "knife_butcher", 10 ],
[ "knife_combat", 14 ],
[ "knife_carbon", 14 ],
[ "knife_rm42", 1 ],
[ "kukri", 2 ],
[ "knife_hunting", 8 ],
Expand Down Expand Up @@ -1575,6 +1577,7 @@
[ "multi_cooker", 15 ],
[ "coffeemaker", 45 ],
[ "water_purifier", 15 ],
[ "3d_printer_basic", 25 ],
[ "dehydrator", 30 ],
[ "vac_sealer", 45 ],
[ "forge", 5 ],
Expand Down Expand Up @@ -1684,6 +1687,7 @@
{ "group": "ammo_pocket_batteries_full", "prob": 20 },
[ "radio", 20 ],
[ "television", 20 ],
[ "3d_printer_basic", 10 ],
[ "two_way_radio", 20 ],
[ "noise_emitter", 20 ],
[ "eyedrops", 20 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
[ "nailboard", 5 ],
[ "caltrops", 3 ],
[ "knife_combat", 14 ],
[ "knife_carbon", 14 ],
[ "kukri", 2 ],
[ "knife_hunting", 4 ],
[ "knife_heat", 4 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
"items": [
[ "knife_butcher", 20 ],
[ "knife_combat", 35 ],
[ "knife_carbon", 35 ],
[ "throwing_knife", 10 ],
[ "pockknife", 50 ],
[ "punch_dagger", 10 ],
Expand Down
22 changes: 22 additions & 0 deletions data/json/itemgroups/Weapons_Mods_Ammo/everydaycarry_guns.json
Original file line number Diff line number Diff line change
Expand Up @@ -2317,5 +2317,27 @@
"//": "this is a distribution for the gun, reasonable number of backup mags, and some ammo to repack",
"subtype": "collection",
"entries": [ { "item": "mgl", "ammo-group": "on_hand_40x46mm", "charges": [ 0, 6 ] }, { "group": "on_hand_40x46mm" } ]
},
{
"id": "everyday_carbon_pistol",
"type": "item_group",
"//": "this is a distribution for the gun, reasonable number of backup mags, and some ammo to repack",
"subtype": "collection",
"entries": [
{ "item": "carbon_pistol", "charges-min": 0, "charges-max": 15 },
{ "group": "nested_glock17_mag", "charges-min": 0 },
{ "group": "nested_glock17_mag", "charges-min": 0, "prob": 50 }
]
},
{
"id": "everyday_carbon_rifle",
"type": "item_group",
"//": "this is a distribution for the gun, reasonable number of backup mags, and some ammo to repack",
"subtype": "collection",
"entries": [
{ "item": "carbon_rifle", "ammo-item": "556_incendiary", "charges": [ 0, 30 ] },
{ "group": "nested_stanag_mag", "charges-min": 0 },
{ "group": "nested_stanag_mag", "charges-min": 0, "prob": 50 }
]
}
]
10 changes: 10 additions & 0 deletions data/json/itemgroups/Weapons_Mods_Ammo/guns.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
{ "group": "nested_hptjhp", "prob": 1 },
{ "group": "nested_cz75", "prob": 18 },
{ "group": "nested_walther_ccp", "prob": 8 },
{ "group": "nested_carbon_pistol", "prob": 3 },
{ "group": "nested_walther_p22", "prob": 13 }
]
},
Expand Down Expand Up @@ -139,6 +140,7 @@
{ "group": "nested_deagle_44", "prob": 35 },
{ "group": "nested_m1911a1_38super", "prob": 25 },
{ "group": "nested_fn57", "prob": 80 },
{ "group": "nested_carbon_pistol", "prob": 25 },
{ "group": "nested_ruger_lcr_22", "prob": 35 },
{ "group": "nested_ruger_redhawk", "prob": 25 },
{ "group": "nested_sig_40", "prob": 35 },
Expand All @@ -161,6 +163,7 @@
{ "group": "everyday_deagle_44", "prob": 35 },
{ "group": "everyday_m1911a1_38super", "prob": 25 },
{ "group": "everyday_fn57", "prob": 80 },
{ "group": "everyday_carbon_pistol", "prob": 25 },
{ "group": "everyday_ruger_lcr_22", "prob": 35 },
{ "group": "everyday_ruger_redhawk", "prob": 25 },
{ "group": "everyday_sig_40", "prob": 35 },
Expand Down Expand Up @@ -203,6 +206,7 @@
{ "group": "nested_usp_45", "prob": 15 },
{ "group": "nested_m1911_MEU", "prob": 5 },
{ "group": "nested_glock_19", "prob": 20 },
{ "group": "nested_carbon_pistol", "prob": 15 },
{ "group": "nested_needlepistol", "prob": 45 },
{ "group": "nested_rm103a_pistol", "prob": 35 }
]
Expand All @@ -218,6 +222,7 @@
{ "group": "everyday_usp_45", "prob": 15 },
{ "group": "everyday_m1911_MEU", "prob": 5 },
{ "group": "everyday_glock_19", "prob": 20 },
{ "group": "everyday_carbon_pistol", "prob": 15 },
{ "group": "everyday_needlepistol", "prob": 45 },
{ "group": "everyday_rm103a_pistol", "prob": 35 }
]
Expand Down Expand Up @@ -520,6 +525,7 @@
{ "group": "nested_hk_g36", "prob": 30 },
{ "group": "nested_henry_big_boy", "prob": 10 },
{ "group": "nested_m14ebr", "prob": 15 },
{ "group": "nested_carbon_rifle", "prob": 25 },
{ "group": "nested_M24", "prob": 15 },
{ "group": "nested_m4a1", "prob": 45 },
{ "group": "nested_m1903", "prob": 15 },
Expand Down Expand Up @@ -547,6 +553,7 @@
{ "group": "everyday_hk_g36", "prob": 30 },
{ "group": "everyday_henry_big_boy", "prob": 10 },
{ "group": "everyday_m14ebr", "prob": 15 },
{ "group": "everyday_carbon_rifle", "prob": 25 },
{ "group": "everyday_M24", "prob": 15 },
{ "group": "everyday_m4a1", "prob": 45 },
{ "group": "everyday_m1903", "prob": 15 },
Expand All @@ -570,6 +577,7 @@
{ "item": "acr", "prob": 25, "charges-min": 0, "charges-max": 0 },
{ "item": "colt_lightning", "prob": 15, "charges-min": 0, "charges-max": 0 },
{ "item": "fn_fal", "prob": 40, "charges-min": 0, "charges-max": 0 },
{ "item": "carbon_rifle", "prob": 20, "charges-min": 0, "charges-max": 0 },
{ "item": "hk_g3", "prob": 40, "charges-min": 0, "charges-max": 0 },
{ "item": "hk_g36", "prob": 30, "charges-min": 0, "charges-max": 0 },
{ "item": "henry_big_boy", "prob": 10, "charges-min": 0, "charges-max": 0 },
Expand Down Expand Up @@ -1165,6 +1173,8 @@
"items": [
{ "group": "guns_improvised", "prob": 200 },
{ "group": "everyday_ar15", "prob": 5 },
{ "group": "everyday_carbon_rifle", "prob": 5 },
{ "group": "everyday_carbon_pistol", "prob": 5 },
{ "group": "everyday_ar_pistol", "prob": 3 },
{ "group": "everyday_mossberg_500", "prob": 5 },
{ "group": "everyday_remington_870", "prob": 5 },
Expand Down
26 changes: 26 additions & 0 deletions data/json/itemgroups/Weapons_Mods_Ammo/nested_guns.json
Original file line number Diff line number Diff line change
Expand Up @@ -2373,5 +2373,31 @@
{ "item": "as50mag", "ammo-group": "on_hand_50", "prob": 50 },
{ "group": "on_hand_50" }
]
},
{
"id": "nested_carbon_pistol",
"type": "item_group",
"//": "this is a distribution for the gun, reasonable number of backup mags, and some ammo to repack",
"subtype": "collection",
"ammo": 100,
"entries": [
{ "item": "carbon_pistol", "charges-min": 0, "charges-max": 15 },
{ "item": "glockmag" },
{ "item": "glockmag", "prob": 50 },
{ "group": "on_hand_9mm" }
]
},
{
"id": "nested_carbon_rifle",
"type": "item_group",
"//": "this is a distribution for the gun, reasonable number of backup mags, and some ammo to repack",
"subtype": "collection",
"ammo": 100,
"entries": [
{ "item": "carbon_rifle", "charges-min": 0, "charges-max": 30 },
{ "item": "carbonmag_223" },
{ "item": "carbonmag_223", "prob": 50 },
{ "group": "on_hand_223" }
]
}
]
3 changes: 3 additions & 0 deletions data/json/itemgroups/Weapons_Mods_Ammo/weapons_misc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
[ "hatchet", 10 ],
[ "ax", 8 ],
[ "knife_combat", 14 ],
[ "knife_carbon", 14 ],
[ "kukri", 2 ],
[ "knife_hunting", 4 ],
[ "knife_carbon", 4 ],
[ "knife_heat", 2 ],
[ "knife_rambo", 8 ],
[ "knife_rm42", 2 ],
Expand All @@ -40,6 +42,7 @@
[ "wakizashi", 3 ],
[ "nodachi", 1 ],
[ "katana", 2 ],
[ "sword_carbon", 2 ],
[ "survnote", 1 ]
]
},
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/collections_domestic.json
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,7 @@
[ "cavalry_sabre", 1 ],
[ "cavalry_sabre_fake", 20 ],
[ "katana", 1 ],
[ "sword_carbon", 20 ],
[ "katana_fake", 20 ],
[ "katana_inferior", 2 ],
[ "cutlass", 1 ],
Expand Down
4 changes: 4 additions & 0 deletions data/json/itemgroups/defense_mode.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
{ "item": "hammer_sledge" },
{ "item": "hatchet" },
{ "item": "knife_combat" },
{ "item": "knife_carbon" },
{ "item": "rapier" },
{ "item": "machete" },
{ "item": "katana" },
{ "item": "sword_carbon" },
{ "item": "spear_carbon" },
{ "item": "spear_knife" },
{ "item": "pike" },
{ "item": "chainsaw_off" }
Expand All @@ -25,6 +28,7 @@
"subtype": "collection",
"items": [
{ "item": "crossbow" },
{ "item": "crossbow_carbon" },
{ "item": "marlin_9a" },
{ "item": "hk_mp5" },
{ "item": "taurus_spectrum" },
Expand Down
2 changes: 2 additions & 0 deletions data/json/itemgroups/electronics.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
[ "solar_cell", 5 ],
[ "screwdriver", 40 ],
[ "screwdriver_set", 40 ],
[ "3d_printer_basic", 10 ],
[ "mask_dust", 65 ],
[ "glasses_safety", 40 ],
[ "goggles_welding", 70 ],
Expand Down Expand Up @@ -69,6 +70,7 @@
[ "screwdriver_set", 40 ],
[ "processor", 15 ],
[ "RAM", 22 ],
[ "3d_printer_basic", 10 ],
[ "mp3", 18 ],
[ "portable_game", 12 ],
[ "game_watch", 3 ],
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
"entries": [
{ "item": "crossbow", "prob": 70 },
{ "item": "compcrossbow", "prob": 10 },
{ "item": "crossbow_carbon", "prob": 10 },
{ "item": "bullet_crossbow", "prob": 10 },
{ "item": "hand_crossbow", "prob": 10 },
{ "item": "longbow", "prob": 40 },
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@
[ "hygrometer", 3 ],
[ "barometer", 3 ],
[ "camera", 3 ],
[ "3d_printer_basic", 3 ],
[ "flask_glass", 10 ],
[ "bottle_glass", 10 ],
[ "thermos", 5 ],
Expand Down
9 changes: 9 additions & 0 deletions data/json/items/armor/arms_armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,14 @@
"environmental_protection": 1,
"valid_mods": [ "steel_padded", "alloy_padded", "resized_large" ],
"flags": [ "STURDY", "BELTED", "WATER_FRIENDLY" ]
},
{
"id": "carbon_armguard",
"type": "ARMOR",
"name": { "str": "carbon fiber arm guards" },
"description": "Custom armguards of layered carbon fiber armor made using a 3D printer. Its rigid plates are more comparable to a suit of armor than kevlar, but it's very protective and lightweight.",
"copy-from": "armguard_lightplate",
"material": [ "carbon_fiber" ],
"proportional": { "weight": 0.6, "price": 2, "price_postapoc": 2 }
}
]
Loading

0 comments on commit 66ab489

Please sign in to comment.