This file contains 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 teleport(unit,pos) | |
local unitoccupancy = dfhack.maps.getTileBlock(unit.pos).occupancy[unit.pos.x%16][unit.pos.y%16] | |
unit.pos.x = pos.x | |
unit.pos.y = pos.y | |
unit.pos.z = pos.z | |
if not unit.flags1.on_ground then unitoccupancy.unit = false else unitoccupancy.unit_grounded = false end | |
end | |
local function getArgsTogether(args) | |
local settings={ |
This file contains 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 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 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 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
--create unit at pointer or given location. Usage e.g. "spawnunit DWARF 0 Dwarfy" | |
--Made by warmist, but edited by Putnam for the dragon ball mod to be used in reactions | |
--note that it's extensible to any autosyndrome reaction to spawn anything due to this; to use in autosyndrome, you want \COMMAND spawnunit CREATURE caste_number name \LOCATION | |
args={...} | |
function getCaste(race_id,caste_id) | |
local cr=df.creature_raw.find(race_id) | |
return cr.caste[caste_id] |
This file contains 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 |
This file contains 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
private struct LifeLikeRule | |
{ | |
ubyte notZero; | |
bool zero; | |
this(ushort initializer) | |
{ | |
notZero=cast(ubyte)(initializer>>1); | |
zero=initializer&1; | |
} | |
pure ushort fullRule() |
This file contains 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 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
import std.stdio; | |
import std.traits : isOrderingComparable; | |
import std.range; | |
import std.algorithm.sorting; | |
import std.algorithm.mutation; |
This file contains 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
[gd_scene load_steps=2 format=2] | |
[sub_resource type="GDScript" id=1] | |
script/source = "extends PopupPanel | |
\"\"\" | |
The run function expects an array, containing a series of strings or modifiers. | |
A string will be displayed one letter at a time, with the current delay, | |
using the current talk sound. |