Skip to content

Instantly share code, notes, and snippets.

View warmist's full-sized avatar
💭
Making a game or sth

Warmist warmist

💭
Making a game or sth
View GitHub Profile
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?
@warmist
warmist / temp.lua
Last active December 21, 2015 01:49 — forked from thistleknot/temp.lua
TraitArrayBins = defclass(TraitArrayBins)
TraitArrayBins.ATTRS={
name=DEFAULT_NIL,
traitMin=0,
traitMed=0,
traitMax=0,
}
function TraitArrayBins.init(args) --not sure if needed
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"},
@warmist
warmist / gist:6146095
Last active December 20, 2015 14:19 — forked from thistleknot/gist:6146077
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