Skip to content

Commit 45823e7

Browse files
committed
update to canonicalized field names
1 parent e9c943f commit 45823e7

10 files changed

+19
-20
lines changed

assign-preferences.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ local preference_functions = {
305305
item_type = df.item_type.POWDER_MISC
306306
elseif food_mat_index.CookableSeed > -1 then
307307
item_type = df.item_type.SEEDS
308-
elseif food_mat_index.CookableLeaf > -1 then
308+
elseif food_mat_index.CookablePlantGrowth > -1 then
309309
--[[
310310
In case of plant growths, "mat_info" stores the item type as a specific subtype ("FLOWER", or "FRUIT",
311311
etc.) instead of the generic "PLANT_GROWTH" item type. Also, the IDs of the different types of growths

ban-cooking.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ funcs.fruit = function()
268268
for k, g in ipairs(p.growths) do
269269
local matinfo = dfhack.matinfo.decode(g)
270270
local m = matinfo.material
271-
if m.id == "FRUIT" and m.flags.EDIBLE_COOKED and m.flags.LEAF_MAT then
271+
if m.id == "FRUIT" and m.flags.EDIBLE_COOKED and m.flags.STOCKPILE_PLANT_GROWTH then
272272
for _, s in ipairs(m.reaction_product.id) do
273273
if s.value == "DRINK_MAT" then
274274
ban_cooking(p.name .. ' ' .. m.id, matinfo.type, matinfo.index, df.item_type.PLANT_GROWTH, k)

combine.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ local function stacks_add_item(stockpile, stacks, stack_type, item, container)
192192
else
193193
comp_key = ('%s+%s+%s+%s+%s'):format(stack_type.type_id, item.race, item.caste, item:getActualMaterial(), item:getActualMaterialIndex())
194194
end
195-
elseif item:isAmmo() then
195+
elseif item:isCrafted() then
196196
if item:getQuality() == df.item_quality.Masterful then
197197
comp_key = ('%s+%s+%s+%s+%s'):format(stack_type.type_id, item.mat_type, item.mat_index, item:getQuality(), item:getMaker())
198198
else
@@ -446,7 +446,7 @@ local function stacks_add_items(stockpile, stacks, items, container, ind)
446446
local casteRaw = raceRaw.caste[item.caste]
447447
log(4, (' %sitem:%40s <%6d> is incl, type:%d, race:%s, caste:%s'):format(
448448
ind, utils.getItemDescription(item), item.id, type_id, raceRaw.creature_id, casteRaw.caste_id))
449-
elseif item:isAmmo() then
449+
elseif item:isCrafted() then
450450
local mat_info = dfhack.matinfo.decode(item.mat_type, item.mat_index)
451451
log(4, (' %sitem:%40s <%6d> is incl, type:%d, info:%s, quality:%d, maker:%d'):format(
452452
ind, utils.getItemDescription(item), item.id, type_id, mat_info:toString(), item:getQuality(), item:getMaker()))

deteriorate.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ local function keep_usable(opts, item)
4141
item.corpse_flags.bone or
4242
item.corpse_flags.horn or
4343
item.corpse_flags.leather or
44-
item.corpse_flags.skull2 or
44+
item.corpse_flags.skull or
4545
item.corpse_flags.tooth) or (
4646
item.corpse_flags.hair_wool or
4747
item.corpse_flags.pearl or

devel/tree-info.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function printTreeTile(bits)
5353
dfhack.print(' ')
5454
end
5555

56-
if bits.twigs then
56+
if bits.leaves then
5757
chars = chars-1
5858
exists = true
5959
print_color(';', COLOR_GREEN)

extinguish.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ end
5050
function extinguishContaminant(spatter)
5151
-- reset temperature of any contaminants to prevent them from causing reignition
5252
-- (just in case anyone decides to play around with molten gold or whatnot)
53-
spatter.temperature.whole = 10050
54-
spatter.temperature.fraction = 0
53+
spatter.base.temperature.whole = 10050
54+
spatter.base.temperature.fraction = 0
5555
end
5656

5757
---@param item df.item

gui/create-item.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ local function getMatFilter(itemtype, opts)
130130
return mat.flags.STRUCTURAL_PLANT_MAT
131131
end,
132132
LEAVES = function(mat, parent, typ, idx)
133-
return mat.flags.LEAF_MAT
133+
return mat.flags.STOCKPILE_PLANT_GROWTH
134134
end,
135135
MEAT = function(mat, parent, typ, idx)
136136
return mat.flags.MEAT

internal/quickfort/build.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,7 @@ local building_db_raw = {
802802
Mrsssqq=make_roller_entry(df.screw_pump_direction.FromWest, 30000),
803803
Mrsssqqq=make_roller_entry(df.screw_pump_direction.FromWest, 20000),
804804
Mrsssqqqq=make_roller_entry(df.screw_pump_direction.FromWest, 10000),
805-
-- Instruments are not yet supported by DFHack
806-
-- I={label='Instrument', type=df.building_type.Instrument},
805+
I={label='Instrument', type=df.building_type.Instrument},
807806
S={label='Support', type=df.building_type.Support,
808807
is_valid_tile_fn=is_valid_tile_has_space},
809808
m={label='Animal Trap', type=df.building_type.AnimalTrap},

modtools/create-item.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ local function createCorpsePiece(creator, bodypart, partlayer, creatureID, caste
141141
item.corpse_flags.tooth = true
142142
item.material_amount.Tooth = 1
143143
elseif layerName == 'NERVE' then -- check if nervous tissue
144-
item.corpse_flags.skull1 = true -- apparently "skull1" is supposed to be named "rots/can_rot"
145-
item.corpse_flags.separated_part = true
144+
item.corpse_flags.rottable = true
145+
item.corpse_flags.use_blood_color = true
146146
-- elseif layerName == "NAIL" then -- check if nail (NO SPECIAL FLAGS)
147147
elseif layerName == 'HORN' or layerName == 'HOOF' then -- check if nail
148148
item.corpse_flags.horn = true
@@ -153,7 +153,7 @@ local function createCorpsePiece(creator, bodypart, partlayer, creatureID, caste
153153
end
154154
-- checking for skull
155155
if not generic and not isCorpse and creatorBody.body_parts[bodypart].token == 'SKULL' then
156-
item.corpse_flags.skull2 = true
156+
item.corpse_flags.skull = true
157157
end
158158
end
159159
local matType
@@ -176,10 +176,10 @@ local function createCorpsePiece(creator, bodypart, partlayer, creatureID, caste
176176
end
177177
-- on a dwarf tissue index 3 (bone) is 22, but this is not always the case for all creatures, so we get the mat_type of index 3 instead
178178
-- here we also set the actual referenced creature material of the corpsepiece
179-
item.bone1.mat_type = matType
180-
item.bone1.mat_index = creatureID
181-
item.bone2.mat_type = matType
182-
item.bone2.mat_index = creatureID
179+
item.largest_tissue.mat_type = matType
180+
item.largest_tissue.mat_index = creatureID
181+
item.largest_unrottable_tissue.mat_type = matType
182+
item.largest_unrottable_tissue.mat_index = creatureID
183183
-- skin (and presumably other parts) use body part modifiers for size or amount
184184
for i = 0,200 do -- fuck it this works
185185
-- inserts
@@ -226,7 +226,7 @@ local function createCorpsePiece(creator, bodypart, partlayer, creatureID, caste
226226
if wholePart then
227227
for i in pairs(creatorBody.body_parts[bodypart].layers) do
228228
item.body.components.layer_status[creatorBody.body_parts[bodypart].layers[i].layer_id].gone = false
229-
item.corpse_flags.separated_part = true
229+
item.corpse_flags.use_blood_color = true
230230
item.corpse_flags.unbutchered = true
231231
end
232232
end

modtools/reaction-trigger-transition.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ for _,reaction in ipairs(df.global.world.raws.reactions.reactions) do
3636
end
3737
local inorganic = df.global.world.raws.inorganics[product.mat_index]
3838
local didInorganicName
39-
for _,syndrome in ipairs(inorganic.material.syndrome) do
39+
for _,syndrome in ipairs(inorganic.material.syndrome.syndrome) do
4040
local workerOnly = true
4141
local allowMultipleTargets = false;
4242
local command

0 commit comments

Comments
 (0)