Skip to content

Instantly share code, notes, and snippets.

@warmist
Forked from thistleknot/gist:6146236
Created August 3, 2013 12:25
Show Gist options
  • Save warmist/6146277 to your computer and use it in GitHub Desktop.
Save warmist/6146277 to your computer and use it in GitHub Desktop.
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"},
Mental_Normal = {"WILLPOWER", "INTUITION", "LINGUISTIC_ABILITY", "MUSICALITY", "KINESTHETIC_SENSE", "EMPATHY", "SOCIAL_AWARENESS"},
}
Physical_Attribute_Names = {
Physical_Plus = {"STRENGTH", "TOUGHNESS"},
Physical_Normal = {"ENDURANCE", "RECUPERATION", "DISEASE_RESISTANCE"},
Physical_Minus = {"AGILITY"}
}
P_Attributes = unit.body.physical_attrs
M_Attributes = unit.status.current_sould.mental_attrs
-- old
--[[
for i, v in ipairs(Physical_Plus) do
P_Attributes[v].value = Plus[7]
P_Attributes[v].max_value = Plus[7]*2
end
]]
-- new anUnusedId, nameTable in pairs(AtributeNames) do
for anUnusedId, P_Range_Name in pairs(Physical_Attributes_Names) do
for anUnusedId, v in ipairs(Value_Holder) do
if P_Range_Name = Physical_Plus
P_Attributes[v].value = Plus[#Plus]
elseif P_Range_Name = Physical_Normal
P_Attributes[v].value = Normal[#Normal]
elseif P_Range_Name = Physical_Minus
P_Attributes[v].value = Minus[#Minus]
if P_Attributes[v].value*2 > 5000
P_Atributes[v].max_value = 5000
else
P_Attributes[v].max_value = Plus[#Plus]*2
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment