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
function find_race(name) | |
name = name:lower() | |
for i,v in ipairs(df.global.world.raws.creatures.all) do | |
if v.creature_id:lower() == name:lower() then | |
return i | |
end | |
end | |
end | |
--NOTE(warmist): named_civ changed to player_civ but does not make sense? |
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
TraitArrayBins = defclass(TraitArrayBins) | |
TraitArrayBins.ATTRS={ | |
name=DEFAULT_NIL, | |
traitMin=0, | |
traitMed=0, | |
traitMax=0, | |
} | |
function TraitArrayBins.init(args) --not sure if needed |
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
unit = dfhack.gui.getSelectedUnit() | |
PlusPlus = {700, 1200, 1400, 1500, 1600, 1800, 2500} | |
Plus = {450, 950, 1150, 1250, 1350, 1550, 2250} | |
Normal = {200, 700, 900, 1000, 1100, 1300, 2000} | |
Minus = {150, 600, 800, 900, 1000, 1100, 1500} | |
Mental_Attribute_Names = { | |
Mental_PlusPlus = {"FOCUS", "SPATIAL_SENSE"}, | |
Mental_Plus = {"ANALYTICAL_ABILITY", "FOCUS", "CREATIVITY", "PATIENCE", "MEMORY"}, |
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
unit = dfhack.gui.getSelectedUnit() | |
Physical = {STRENGTH=450, TOUGHNESS=950} | |
P_Attributes = unit.body.physical_attrs | |
M_Attributes = unit.status.current_sould.mental_attrs | |
for attrName, attrValue in pairs(Physical) do | |
P_Attributes[attrName].value = attrValue |