Documented invasion-now, moved it from devel scripts, and documented digSmart in readme.

develop
expwnent 2013-06-25 19:06:15 -04:00
parent ba73de5e35
commit 56e25bfa12
3 changed files with 59 additions and 18 deletions

@ -1026,6 +1026,23 @@ Options:
:down: down stairs
:clear: clear designation
digSmart
--------
Automatically digs out specified veins as they are discovered. It runs once every time a dwarf finishes a dig job. It will only dig out appropriate tiles that are adjacent to the finished dig job. To add a vein type, use `digSmart 1 [type]`. This will also enable the plugin. To remove a vein type, use `digSmart 0 [type] 1` to disable, then remove, then re-enable.
`digSmart 0` disable
`digSmart 1` enable
`digSmart 0 MICROCLINE COAL_BITUMINOUS 1` disable plugin, remove microcline and bituminous coal from monitoring, then re-enable the plugin
`digSmart CLEAR` remove all inorganics from monitoring
`digSmart digAll1` ignore the monitor list and dig any vein
`digSmart digAll0` disable digAll mode
See `help digSmart` for details.
filltraffic
-----------
@ -2089,6 +2106,19 @@ To skip a row in your design, use a single ``;``.
The script takes the plan filename, starting from the root df folder.
invasion-now
============
Triggers an invasion, or several in the near future.
`invasion-now civName` trigger an invasion from the civilization with the id civName, starting in about ten ticks
`invasion-now civName start` trigger an invasion from civName in a number of ticks between 10*start and 11*start-1 (inclusive)
`invasion-now civName start end` trigger an invasion from civName in about 10*start ticks, and continue triggering invasions every ten ticks afterward until about 10*end ticks have passed
Probably fails if the start time of a triggered invasion is later than the start of the next year.
superdwarf
==========
Similar to fastdwarf, per-creature.

@ -1,18 +0,0 @@
-- invasion-now civ_id delay : schedules an invasion in the near future
args = {...}
num = tonumber(args[1])
if ( num ~= nil ) then
time = tonumber(args[2]) or 1
time2 = tonumber(args[3]) or time
for i = time,time2 do
df.global.timed_events:insert('#',{
new = df.timed_event,
type = df.timed_event_type.CivAttack,
season = df.global.cur_season,
season_ticks = df.global.cur_season_tick+i,
entity = df.historical_entity.find(num)
})
end
end

@ -0,0 +1,29 @@
-- invasion-now civName start end : schedules an invasion in the near future, or several
args = {...}
civName = args[1]
if ( civName ~= nil ) then
--find the civ with that name
evilEntity = nil;
for _,candidate in ipairs(df.global.world.entities.all) do
if candidate.entity_raw.code == civName then
evilEntity = candidate
break
end
end
if ( evilEntity == nil ) then
do return end
end
time = tonumber(args[2]) or 1
time2 = tonumber(args[3]) or time
for i = time,time2 do
df.global.timed_events:insert('#',{
new = df.timed_event,
type = df.timed_event_type.CivAttack,
season = df.global.cur_season,
season_ticks = df.global.cur_season_tick+i,
entity = evilEntity
})
end
end