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
| 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 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
| 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
| 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
| local gui=require('gui') | |
| local widgets=require('gui.widgets') | |
| local ClickableLabel=defclass(ClickableLabel,widgets.Label) | |
| ClickableLabel.ATTRS.on_click=DEFAULT_NIL | |
| ClickableLabel.ATTRS.on_rclick=DEFAULT_NIL |
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 df_date={} --lol I really should put this in its own file | |
| df_date.__eq=function(date1,date2) | |
| return date1.year==date2.year and date1.year_tick==date2.year_tick | |
| end | |
| df_date.__lt=function(date1,date2) | |
| if date1.year<date2.year then return true end | |
| if date1.year>date2.year then return false end | |
| if date1.year==date2.year 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
| -- Makes it so that the world will always have certain artifacts in certain sites when world loads. | |
| --@ module = true | |
| --Author Putnam | |
| local usage = [===[ | |
| modtools/custom-artifact | |
| ===================== | |
| This tool, when run, checks if the specific item has an artifact record somewhere in the world | |
| and places the artifact at a valid site (which can be constrained by arguments) if it is not found. |
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
| -- Autoassigns all beds which do not have assigned rooms to rooms. | |
| -- Will flood fill up to -size size. | |
| --[====[ | |
| bedassign | |
| ====== | |
| Sets all beds with no rooms set to have rooms. | |
| bedassign -size will set all rooms to press the + key -size times. Setting -size to a negative value will press the - key instead. | |
| ]====] |
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
| -- https://twitter.com/dril/status/235218148800991233 | |
| local eventful=require('plugins.eventful') | |
| eventful.enableEvent(eventful.eventType.INVENTORY_CHANGE,5) | |
| local function unitIsLesbian(unit) | |
| if (unit and unit.status and unit.status.current_soul) then | |
| local soul=unit.status.current_soul | |
| local orientation=soul.personality.orientation_flags |