Skip to content

Commit 5664df1

Browse files
feat: add procgen sandwich stew and sword crafting
Assisted-by: openai/gpt-5.4 on opencode Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
1 parent ac66581 commit 5664df1

33 files changed

+1577
-197
lines changed

data/json/items/comestibles/soup.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
[
2+
{
3+
"type": "COMESTIBLE",
4+
"id": "stew_generic",
5+
"copy-from": "soup_veggy",
6+
"name": { "str": "GENERIC STEW", "str_pl": "GENERIC STEWS" },
7+
"description": "If you can see this, a procedural stew recipe did not finish correctly.",
8+
"calories": 120,
9+
"flags": [ "EATEN_HOT", "USE_EAT_VERB" ]
10+
},
211
{
312
"type": "COMESTIBLE",
413
"id": "broth",

data/json/items/melee/swords_and_blades.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
[
2+
{
3+
"id": "proc_sword_generic",
4+
"type": "GENERIC",
5+
"copy-from": "sword_metal",
6+
"name": { "str": "GENERIC SWORD" },
7+
"description": "If you can see this, a procedural sword recipe did not finish correctly.",
8+
"weight": "1000 g",
9+
"volume": "1750 ml",
10+
"bashing": 4,
11+
"cutting": 4,
12+
"to_hit": 0
13+
},
214
{
315
"id": "sword_wood",
416
"type": "GENERIC",

data/json/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ local voltmeter = require("./voltmeter")
22
local slimepit = require("./slimepit")
33
local artifact_analyzer = require("./artifact_analyzer")
44
local lua_traits = require("./lua_traits")
5-
local procgen = require("./proc")
5+
local procgen = require("./procgen")
66

77
local mod = game.mod_runtime[game.current_mod]
88
local storage = game.mod_storage[game.current_mod]

data/json/proc.lua

Lines changed: 0 additions & 65 deletions
This file was deleted.

data/json/proc/sandwich.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"id": "sandwich",
55
"cat": "food",
66
"res": "sandwich_generic",
7-
"hist": { "def": "none", "ok": [ "none", "compact", "full" ] },
7+
"hist": { "def": "full", "ok": [ "full", "compact" ] },
88
"slot": [
99
{ "id": "top", "role": "bread", "min": 1, "max": 1, "ok": [ "itype:bread", "itype:bread_garlic" ] },
1010
{ "id": "bot", "role": "bread", "min": 1, "max": 1, "ok": [ "itype:bread", "itype:bread_garlic" ] },
@@ -27,6 +27,6 @@
2727
"ok": [ "itype:meat_cooked", "itype:meat_cooked_seasoned" ]
2828
}
2929
],
30-
"lua": { "full": "proc.food.full", "make": "proc.food.make" }
30+
"lua": { "full": "procgen.food.full", "make": "procgen.food.make" }
3131
}
3232
]

data/json/proc/stew.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[
2+
{
3+
"type": "PROC",
4+
"id": "stew",
5+
"cat": "food",
6+
"res": "stew_generic",
7+
"hist": { "def": "full", "ok": [ "full", "compact" ] },
8+
"slot": [
9+
{ "id": "base", "role": "base", "min": 1, "max": 1, "ok": [ "itype:broth", "itype:broth_bone", "itype:water_clean" ] },
10+
{ "id": "veg", "role": "veg", "min": 1, "max": 4, "rep": true, "ok": [ "mat:veggy" ] },
11+
{ "id": "meat", "role": "meat", "min": 0, "max": 3, "rep": true, "ok": [ "mat:flesh", "mat:fish" ] }
12+
],
13+
"lua": { "full": "procgen.food.full", "make": "procgen.food.make" }
14+
}
15+
]

data/json/proc/sword.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[
2+
{
3+
"type": "PROC",
4+
"id": "sword",
5+
"cat": "weapon",
6+
"res": "proc_sword_generic",
7+
"hist": { "def": "compact", "ok": [ "compact", "full" ] },
8+
"slot": [
9+
{
10+
"id": "blade",
11+
"role": "blade",
12+
"min": 1,
13+
"max": 1,
14+
"ok": [ "itype:steel_chunk", "itype:scrap", "itype:bone", "itype:stick_long" ]
15+
},
16+
{
17+
"id": "guard",
18+
"role": "guard",
19+
"min": 0,
20+
"max": 1,
21+
"ok": [ "itype:scrap", "itype:steel_chunk", "itype:bone" ]
22+
},
23+
{ "id": "handle", "role": "handle", "min": 1, "max": 1, "ok": [ "itype:stick_long", "itype:bone" ] },
24+
{ "id": "grip", "role": "grip", "min": 1, "max": 2, "rep": true, "ok": [ "itype:leather", "itype:rag" ] }
25+
],
26+
"lua": { "make": "procgen.gear.make" }
27+
}
28+
]

data/json/procgen.lua

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
local procgen = {}
2+
procgen.food = {}
3+
procgen.gear = {}
4+
5+
function procgen.food.full(params) return params.blob or {} end
6+
7+
function procgen.food.make(params)
8+
local blob = params.blob or {}
9+
local result = "sandwich_generic"
10+
if params.schema_id == "stew" then result = "stew_generic" end
11+
return {
12+
result = result,
13+
name = blob.name,
14+
kcal = blob.kcal,
15+
mass_g = blob.mass_g,
16+
volume_ml = blob.volume_ml,
17+
vit = blob.vit,
18+
mode = "full",
19+
}
20+
end
21+
22+
function procgen.gear.make(params)
23+
local blob = params.blob or {}
24+
return {
25+
result = "proc_sword_generic",
26+
name = blob.name,
27+
mass_g = blob.mass_g,
28+
volume_ml = blob.volume_ml,
29+
melee = blob.melee,
30+
mode = "compact",
31+
}
32+
end
33+
34+
return procgen
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"type": "recipe",
4+
"result": "stew_generic",
5+
"category": "CC_FOOD",
6+
"subcategory": "CSC_FOOD_MEAT",
7+
"skill_used": "cooking",
8+
"difficulty": 1,
9+
"time": 200,
10+
"proc": true,
11+
"proc_id": "stew",
12+
"builder_name": { "str": "Stew" },
13+
"builder_desc": { "str": "Pick a broth and hearty ingredients." },
14+
"qualities": [ ],
15+
"tools": [ ],
16+
"components": [ ]
17+
}
18+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"type": "recipe",
4+
"result": "proc_sword_generic",
5+
"category": "CC_WEAPON",
6+
"subcategory": "CSC_WEAPON_CUTTING",
7+
"skill_used": "fabrication",
8+
"difficulty": 2,
9+
"time": 1500,
10+
"proc": true,
11+
"proc_id": "sword",
12+
"builder_name": { "str": "Sword" },
13+
"builder_desc": { "str": "Assemble a blade, hilt, and grip." },
14+
"qualities": [ ],
15+
"tools": [ ],
16+
"components": [ ]
17+
}
18+
]

0 commit comments

Comments
 (0)