This file contains hidden or 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
FamilyNode=defclass(FamilyNode) | |
FamilyNode.ATTRS { | |
histfig_id = DEFAULT_NIL, | |
mother = DEFAULT_NIL, | |
father = DEFAULT_NIL, | |
spouse = DEFAULT_NIL, | |
progenitor = false, | |
children = {} | |
} |
This file contains hidden or 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
autoShineActivated=false | |
autoFireActivated=false | |
autoDamageBoostActivated=false | |
assistantUI = forms.newform(200, 120, "SMAssist") | |
autoShineActivated = forms.checkbox(assistantUI,'Auto Shinespark Crouch',1,1) | |
autoFireActivated = nil --not in there yet | |
autoDamageBoostActivated = forms.checkbox(assistantUI,'Auto Damage Boost',1,23) | |
homingMissileActivated = forms.checkbox(assistantUI,'Homing Missile',1,45) |
This file contains hidden or 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
local function getRaceName() | |
return df.creature_raw.find(df.global.ui.race_id).name[1] | |
end | |
local function emotionIsNegative(thought) | |
return thought.type~=-1 and df.emotion_type.attrs[thought.type].divider>0 | |
end | |
local function write_gamelog_and_announce(msg,color) | |
dfhack.gui.showAnnouncement(msg,color) | |
dfhack.gui.writeToGamelog(msg) | |
end |
This file contains hidden or 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
local creatures = assert(io.open(dfhack.getDFPath()..'/generated_creatures.txt', 'w')) | |
local items = assert(io.open(dfhack.getDFPath()..'/generated_items.txt', 'w')) | |
local materials = assert(io.open(dfhack.getDFPath()..'/generated_materials.txt', 'w')) | |
local entities = assert(io.open(dfhack.getDFPath()..'/generated_entities.txt', 'w')) | |
local interactions = assert(io.open(dfhack.getDFPath()..'/generated_interactions.txt', 'w')) |
This file contains hidden or 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
local utils=require('utils') | |
validArgs = validArgs or utils.invert({ | |
'pets' | |
}) | |
local args = utils.processArgs({...}, validArgs) | |
for k,v in ipairs(df.global.world.buildings.other.COFFIN) do | |
if v.owner_id==-1 then |
This file contains hidden or 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
-- lets babies be adopted by couples with no infants. | |
local function getSpouseOrLover(unit) | |
local lover_unit=df.unit.find(unit.relations.lover_id) or df.unit.find(unit.relations.spouse_id) | |
if lover_unit then | |
return lover_unit.hist_figure_id | |
else | |
local hist_fig=df.historical_figure.find(unit.hist_figure_id) | |
for k,v in ipairs(hist_fig.histfig_links) do | |
if df.histfig_hf_link_spousest:is_instance(v) or df.histfig_hf_link_loverst:is_instance(v) then |
This file contains hidden or 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
-- Adds emotions to creatures. | |
local utils=require('utils') | |
local function addEmotionToUnit(emotions,thought,emotion,subthought,severity) | |
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 | |
emotions:insert('#',{new=df.unit_personality.T_emotions, | |
type=emotion, | |
unk2=1, |
This file contains hidden or 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
local utils = require('utils') | |
validArgs = utils.invert({ | |
'all', | |
'citizens', | |
'named', | |
'notStraight', | |
'gayOnly', | |
'biOnly', | |
'straightOnly', |
This file contains hidden or 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
do | |
local function thoughtIsNegative(thought) | |
return df.unit_thought_type.attrs[thought.type].value:sub(1,1)=='-' and df.unit_thought_type[thought.type]~='LackChairs' | |
end | |
local function write_gamelog_and_announce(msg,color) | |
dfhack.gui.showAnnouncement(msg,color) | |
local log = io.open('gamelog.txt', 'a') | |
log:write(msg.."\n") | |
log:close() | |
end |
This file contains hidden or 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
-- Allows skills to be changed with DFHack. | |
--[[ | |
Args are arranged like this: | |
unitID SKILL level ADD/SUBTRACT/SET | |
SKILL being anything such as DETAILSTONE, level being a number that it will be set to (15 is legendary, 0 is dabbling). | |
Add will add skill levels, subtract will subtract, set will place it at exactly the level you put in. | |
]] |