Skip to content

Commit

Permalink
Allow arbitrary syndromes for add-thought
Browse files Browse the repository at this point in the history
  • Loading branch information
Putnam3145 authored and lethosor committed Jul 7, 2016
1 parent f0c6419 commit b9f2236
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions add-thought.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,22 @@ local utils=require('utils')

function addEmotionToUnit(unit,thought,emotion,severity,strength,subthought)
local emotions=unit.status.current_soul.personality.emotions
if not (type(emotion)=='number') then emotion=df.emotion_type[emotion] end
if not (type(thought)=='number') then thought=df.unit_thought_type[thought] end
if not (type(emotion)=='number') then
emotion=df.emotion_type[emotion]
end
local properThought=nil
if not (type(thought)=='number') then
properThought=df.unit_thought_type[thought]
if not properThought then
for k,syn in ipairs(df.global.world.raws.syndromes.all) do
if syn.syn_name==thought then
properThought=df.unit_thought_type['Syndrome']
subthought=syn.id
break
end
end
end
end
emotions:insert('#',{new=df.unit_personality.T_emotions,
type=emotion,
unk2=1,
Expand Down

0 comments on commit b9f2236

Please sign in to comment.