-- Assigns claspects based on personality, attributes etc.
claspects = {
aspects={
"breath", --1
"light",
"time",
"space",
"life",
"hope",
"void",
"heart",
"blood",
"doom",
"mind",
"rage"},
classes={
"heir", --1
"seer",
"knight",
"witch",
"maid",
"page",
"rogue",
"prince",
"sylph",
"mage",
"thief",
"bard"}
}
personality_weights = {
{ --aspects
{ --breath
ANXIETY = -3,
ANGER = 0,
DEPRESSION = -2,
SELF_CONSCIOUSNESS = -5,
IMMODERATION = 2,
VULNERABILITY = 0,
FRIENDLINESS = 2,
GREGARIOUSNESS = 3,
ASSERTIVENESS = 3,
ACTIVITY_LEVEL = 2,
EXCITEMENT_SEEKING = 6,
CHEERFULNESS = 4,
IMAGINATION = 1,
ARTISTIC_INTEREST = 1,
EMOTIONALITY = 1,
ADVENTUROUSNESS = 6,
INTELLECTUAL_CURIOSITY = 1,
LIBERALISM = 0,
TRUST = 1,
STRAIGHTFORWARDNESS = 2,
ALTRUISM = 1,
COOPERATION = 2,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = 5,
ORDERLINESS = -2,
DUTIFULNESS = -3,
ACHIEVEMENT_STRIVING = 1,
SELF_DISCIPLINE = -1,
CAUTIOUSNESS = 1},
{ --light
ANXIETY = -1,
ANGER = 0,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 1,
IMMODERATION = 0,
VULNERABILITY = 0,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 1,
INTELLECTUAL_CURIOSITY = 10,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = 0,
ORDERLINESS = 1,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 1,
SELF_DISCIPLINE = 1,
CAUTIOUSNESS = 1},
{ --time
ANXIETY = 1,
ANGER = 0,
DEPRESSION = 1,
SELF_CONSCIOUSNESS = -1,
IMMODERATION = 0,
VULNERABILITY = -1,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 1,
EXCITEMENT_SEEKING = 1,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 1,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 1,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 2,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = 5,
ORDERLINESS = 10,
DUTIFULNESS = 1,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 5,
CAUTIOUSNESS = 2},
{ --space
ANXIETY = 0,
ANGER = 0,
DEPRESSION = -1,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = 0,
FRIENDLINESS = 2,
GREGARIOUSNESS = 2,
ASSERTIVENESS = 2,
ACTIVITY_LEVEL = 2,
EXCITEMENT_SEEKING = 1,
CHEERFULNESS = 1,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 1,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 1,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0},
{ --life
ANXIETY = -1,
ANGER = -2,
DEPRESSION = -2,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = -1,
VULNERABILITY = -2,
FRIENDLINESS = 5,
GREGARIOUSNESS = 3,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 5,
IMAGINATION = 2,
ARTISTIC_INTEREST = 1,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 1,
ALTRUISM = 10,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 1,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0},
{ --hope
ANXIETY = 1,
ANGER = 1,
DEPRESSION = 1,
SELF_CONSCIOUSNESS = 5,
IMMODERATION = 2,
VULNERABILITY = 5,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 2,
ACTIVITY_LEVEL = 0,
EXCITEMENT_SEEKING = 3,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 5,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = -1,
SYMPATHY = -4, --douchebags
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = -2},
{ --void
ANXIETY = 0,
ANGER = 0,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = 0,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ACTIVITY_LEVEL = 0,
ASSERTIVENESS = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 1,
ARTISTIC_INTEREST = 2,
EMOTIONALITY = 1,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = -2,
CAUTIOUSNESS = 0},
{ --heart
ANXIETY = 1,
ANGER = 0,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 2,
IMMODERATION = 0,
VULNERABILITY = 1,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ACTIVITY_LEVEL = 0,
ASSERTIVENESS = 1,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 2,
ARTISTIC_INTEREST = 2,
EMOTIONALITY = 20,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = -1,
SYMPATHY = 3,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = -1},
{ --blood
ANXIETY = 2,
ANGER = 2,
DEPRESSION = 1,
SELF_CONSCIOUSNESS = 2,
IMMODERATION = 1,
VULNERABILITY = 1,
FRIENDLINESS = -1,
GREGARIOUSNESS = 20,
ASSERTIVENESS = -2,
ACTIVITY_LEVEL = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = -1,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 1,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 1,
LIBERALISM = 30,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 1,
COOPERATION = 5,
MODESTY = -3,
SYMPATHY = 1,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0},
{ --doom
ANXIETY = 5,
ANGER = 5,
DEPRESSION = 5,
SELF_CONSCIOUSNESS = -1,
IMMODERATION = 1,
VULNERABILITY = -1,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = -1,
ASSERTIVENESS = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 1,
ARTISTIC_INTEREST = 3,
EMOTIONALITY = 1,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 8,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = -2,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 2,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 4,
ACHIEVEMENT_STRIVING = 1,
SELF_DISCIPLINE = 1,
CAUTIOUSNESS = -1},
{ --mind
ANXIETY = 0,
ANGER = 0,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = 0,
FRIENDLINESS = 5,
GREGARIOUSNESS = 3,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 0,
ASSERTIVENESS = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 5,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 15,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 10,
ALTRUISM = 0,
COOPERATION = 15,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0},
{ --rage
ANXIETY = 30,
ANGER = 50,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = 20,
FRIENDLINESS = -1,
GREGARIOUSNESS = -1,
ASSERTIVENESS = 8,
ACTIVITY_LEVEL = 0,
ASSERTIVENESS = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = -1,
IMAGINATION = 1,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 1,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 80,
TRUST = -5,
STRAIGHTFORWARDNESS = -1,
ALTRUISM = -2,
COOPERATION = -1,
MODESTY = -1,
SYMPATHY = -1,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 5}
},
{ --classes
{ --heir
ANXIETY = 0,
ANGER = 0,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = 1,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = -5,
ACTIVITY_LEVEL = 0,
ASSERTIVENESS = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 5,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 10,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0},
{ --seer
ANXIETY = 0,
ANGER = 0,
DEPRESSION = 2,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = 1,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 0,
ASSERTIVENESS = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = -1,
INTELLECTUAL_CURIOSITY = 10,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = -2,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = 0,
ORDERLINESS = 1,
DUTIFULNESS = 1,
ACHIEVEMENT_STRIVING = -1,
SELF_DISCIPLINE = 1,
CAUTIOUSNESS = 1},
{ --knight
ANXIETY = 1,
ANGER = 1,
DEPRESSION = 1,
SELF_CONSCIOUSNESS = 10,
IMMODERATION = -1,
VULNERABILITY = 2,
FRIENDLINESS = 3,
GREGARIOUSNESS = 4,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 0,
ASSERTIVENESS = 0,
EXCITEMENT_SEEKING = 2,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 4,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = -4,
SYMPATHY = 0,
SELF_EFFICACY = -1,
ORDERLINESS = 1,
DUTIFULNESS = 15,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = -1,
CAUTIOUSNESS = 0},
{ --witch
ANXIETY = 1,
ANGER = 1,
DEPRESSION = -1,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = 0,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 50,
IMAGINATION = 10,
ARTISTIC_INTEREST = 8,
EMOTIONALITY = 3,
ADVENTUROUSNESS = 5,
INTELLECTUAL_CURIOSITY = 2,
LIBERALISM = 1,
TRUST = 1,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 2,
COOPERATION = 1,
MODESTY = -1,
SYMPATHY = 0,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0},
{ --maid
ANXIETY = 1,
ANGER = 5,
DEPRESSION = 2,
SELF_CONSCIOUSNESS = 1,
IMMODERATION = 8,
VULNERABILITY = 8,
FRIENDLINESS = 5,
GREGARIOUSNESS = 5,
ASSERTIVENESS = 6,
ACTIVITY_LEVEL = 4,
EXCITEMENT_SEEKING = 3,
CHEERFULNESS = 2,
IMAGINATION = 2,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 1,
ADVENTUROUSNESS = 7,
INTELLECTUAL_CURIOSITY = 2,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = -1,
ORDERLINESS = 0,
DUTIFULNESS = -1,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = -5,
CAUTIOUSNESS = 0},
{ --page
ANXIETY = 5,
ANGER = 0,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 5,
IMMODERATION = 3,
VULNERABILITY = 1,
FRIENDLINESS = 5,
GREGARIOUSNESS = 10,
ASSERTIVENESS = 1,
ACTIVITY_LEVEL = 0,
EXCITEMENT_SEEKING = 1,
CHEERFULNESS = 2,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = -1,
ORDERLINESS = -1,
DUTIFULNESS = -1,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0},
{ --rogue
ANXIETY = 1,
ANGER = 0,
DEPRESSION = 1,
SELF_CONSCIOUSNESS = 1,
IMMODERATION = 0,
VULNERABILITY = 1,
FRIENDLINESS = 1,
GREGARIOUSNESS = 1,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = -1,
EXCITEMENT_SEEKING = -1,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = -1,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = 0,
ORDERLINESS = -1,
DUTIFULNESS = -1,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0},
{ --prince
ANXIETY = 1,
ANGER = 0,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 1,
IMMODERATION = 0,
VULNERABILITY = 0,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 2,
ACTIVITY_LEVEL = 2,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 1,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = -1,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = -2,
SELF_EFFICACY = -1,
ORDERLINESS = -1,
DUTIFULNESS = -1,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = -1,
CAUTIOUSNESS = -2},
{ --sylph
ANXIETY = 0,
ANGER = 0,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = -1,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 1,
LIBERALISM = 0,
TRUST = 1,
STRAIGHTFORWARDNESS = 5,
ALTRUISM = 5,
COOPERATION = 5,
MODESTY = 5,
SYMPATHY = 5,
SELF_EFFICACY = 5,
ORDERLINESS = 5,
DUTIFULNESS = 5,
ACHIEVEMENT_STRIVING = 5,
SELF_DISCIPLINE = 5,
CAUTIOUSNESS = 5},
{ --mage
ANXIETY = 0,
ANGER = 0,
DEPRESSION = 1,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = 0,
FRIENDLINESS = 0,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = -1,
EXCITEMENT_SEEKING = 1,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 1,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = -1,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = -1,
ORDERLINESS = 0,
DUTIFULNESS = 1,
ACHIEVEMENT_STRIVING = 0,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0,},
{ --thief
ANXIETY = 0,
ANGER = 2,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 1,
IMMODERATION = 0,
VULNERABILITY = 1,
FRIENDLINESS = -1,
GREGARIOUSNESS = -1,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 0,
EXCITEMENT_SEEKING = 5,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 2,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = -1,
STRAIGHTFORWARDNESS = 1,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = 0,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 0,
ACHIEVEMENT_STRIVING = 5,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0},
{ --bard
ANXIETY = 0,
ANGER = 0,
DEPRESSION = 0,
SELF_CONSCIOUSNESS = 0,
IMMODERATION = 0,
VULNERABILITY = 0,
FRIENDLINESS = -1,
GREGARIOUSNESS = 0,
ASSERTIVENESS = 0,
ACTIVITY_LEVEL = 0,
EXCITEMENT_SEEKING = 0,
CHEERFULNESS = 0,
IMAGINATION = 0,
ARTISTIC_INTEREST = 0,
EMOTIONALITY = 0,
ADVENTUROUSNESS = 0,
INTELLECTUAL_CURIOSITY = 0,
LIBERALISM = 0,
TRUST = 0,
STRAIGHTFORWARDNESS = 0,
ALTRUISM = 0,
COOPERATION = 0,
MODESTY = 0,
SYMPATHY = -5,
SELF_EFFICACY = 0,
ORDERLINESS = 0,
DUTIFULNESS = 1,
ACHIEVEMENT_STRIVING = 1,
SELF_DISCIPLINE = 0,
CAUTIOUSNESS = 0
}
}
}
local function getTotal(tbl)
local total = {0,0}
for k,v in pairs(tbl) do
if v>0
then
total[1]=v+total[1]
else
total[2]=v+total[2]
end
end
return total
end
function getSignlessTotal(tbl)
local total=0
for k,v in pairs(tbl) do
total=v+total
end
return total
end
local function getWeightAverages()
local weightAverages={{0,0},{0,0}}
for i=1,2 do
for k,claspect in ipairs(personality_weights[i]) do
local total = getTotal(claspect)
for ii=1,2 do
weightAverages[i][ii]=weightAverages[i][ii]+total[ii]
end
end
for ii=1,2 do
weightAverages[i][ii]=weightAverages[i][ii]/12
end
end
return weightAverages
end
function fixWeights() --this is here so I don't have to think about my weights meaning anything :D What's important is that they stay similar relative to one another, which this preserves.
local weightAverages=getWeightAverages()
for i=1,2 do
for k,claspect in ipairs(personality_weights[i]) do
local total=getTotal(claspect)
for kk,trait in pairs(claspect) do
if trait>0
then
trait=(weightAverages[i][1]/total[1])*trait
elseif trait<0 then
trait=(weightAverages[i][2]/total[2])*trait
else
trait=0 --:V
end
end
end
end
print("claspect assignment enabled.")
end
local function alreadyHasSyndrome(unit,syn_id)
for _,syndrome in ipairs(unit.syndromes.active) do
if syndrome.type == syn_id then return true end
end
return false
end
local function assignSyndrome(target,syn_id) --taken straight from here, but edited so I can understand it better: https://gist.github.com/warmist/4061959/. Also implemented expwnent's changes for compatibility with syndromeTrigger. I have used this so much ;_;
if df.isnull(target) then
return nil
end
if alreadyHasSyndrome(target,syn_id) then
return true --I can omit the reset because they aren't going to ever lose their claspect
end
local newSyndrome=df.unit_syndrome:new()
local target_syndrome=df.syndrome.find(syn_id)
newSyndrome.type=target_syndrome.id
newSyndrome.year=df.global.cur_year
newSyndrome.year_time=df.global.cur_year_tick
newSyndrome.ticks=1
newSyndrome.unk1=1
for k,v in ipairs(target_syndrome.ce) do
local sympt=df.unit_syndrome.T_symptoms:new()
sympt.ticks=1
sympt.flags=2
newSyndrome.symptoms:insert("#",sympt)
end
target.syndromes.active:insert("#",newSyndrome)
return true
end
function assignClaspect(unit,creatureClass,creatureAspect) --Putting all of the claspect combos into a single table would be... problematic.
for k,v in ipairs(df.global.world.raws.syndromes.all) do
if string.find(string.lower(v.syn_name),string.lower(creatureClass)) and string.find(string.lower(v.syn_name),string.lower(creatureAspect)) then
assignSyndrome(unit,k)
end
end
end
function unitAlreadyHasClaspect(unit)
for k,c_syn in ipairs(unit.syndromes.active) do
for _,ce in ipairs(df.global.world.raws.syndromes.all[c_syn.type].ce) do
if string.find(tostring(ce),"display_namest") and string.find(ce.name,"hero") then return true end
end
end
return false
end
local function getHighestClaspects(claspects)
local highest={}
for i=1,2 do --1 is aspect, 2 is class
local topValue=-1000000000 --meaning top value after weight calculations; "highest" refers to the highest claspect, which can be referred to by the table at the top
for claspect=1,12 do
if getSignlessTotal(claspects[i][claspect])>topValue then
topValue=getSignlessTotal(claspects[i][claspect])
highest[i]=claspect
end
end
end
return highest
end
function makeClaspect(unit)
if unitAlreadyHasClaspect(unit) then return nil end
local personality = unit.status.current_soul.traits
local creatureWeights= {{},{}}
for i=1,2 do
for k,claspect in ipairs(personality_weights[i]) do
for trait_name,trait in pairs(claspect) do
creatureWeights[i][k]={}
creatureWeights[i][k][trait_name]=(personality[trait_name]-50)*trait
end
end
end
local highestClaspect = getHighestClaspects(creatureWeights)
local creatureAspect = claspects.aspects[highestClaspect[1]]
local creatureClass = claspects.classes[highestClaspect[2]]
assignClaspect(unit,creatureClass,creatureAspect)
end
dfhack.onStateChange.claspect = function(code)
if code==SC_WORLD_LOADED then
dfhack.timeout(1,'ticks',monthlyClaspectAssign)
end
end
function monthlyClaspectAssign()
for _,unit in ipairs(df.global.world.units.active) do
makeClaspect(unit)
end
dfhack.timeout(200,'ticks',monthlyClaspectAssign) --okay so not monthly but still
end
dfhack.onStateChange.claspect()
fixWeights()
Why is? Two pairs, every time, class and aspect are independent, but my results, I have over 300 creatures, I run the script, only two pairs of class and aspect, different every time, heir of breath, knight of hope? This time same, both of them, no heart in sight, what changed? Why 1+1 and 3+6? Did I do something stupid with the weights? Looks like I did, and my laziness is my downfall, O, the folly of Putnam! God dang I'm dramatic today.