2015-09-04 00:51:28 -06:00
|
|
|
-- This script will brainwash a dwarf, modifying their personality
|
|
|
|
-- usage is: target a unit in DF, and execute this script in dfhack
|
2015-09-04 01:13:21 -06:00
|
|
|
-- by vjek
|
2015-10-23 22:10:15 -06:00
|
|
|
--[[=begin
|
|
|
|
|
|
|
|
brainwash
|
|
|
|
=========
|
|
|
|
Modify the personality traits of the selected dwarf to match an 'ideal'
|
|
|
|
personality - as stable and reliable as possible. This makes dwarves very
|
|
|
|
stable, preventing tantrums even after months of misery.
|
|
|
|
|
|
|
|
=end]]
|
2015-09-04 00:51:28 -06:00
|
|
|
|
|
|
|
function brainwash_unit(profile)
|
2015-09-21 16:18:48 -06:00
|
|
|
local i,unit_name
|
2015-09-04 00:51:28 -06:00
|
|
|
|
2015-09-21 16:18:48 -06:00
|
|
|
unit=dfhack.gui.getSelectedUnit()
|
|
|
|
if unit==nil then
|
|
|
|
print ("No unit under cursor! Aborting with extreme prejudice.")
|
|
|
|
return
|
2015-09-04 00:51:28 -06:00
|
|
|
end
|
|
|
|
|
2015-09-21 16:18:48 -06:00
|
|
|
unit_name=dfhack.TranslateName(dfhack.units.getVisibleName(unit))
|
2015-09-04 00:51:28 -06:00
|
|
|
|
2015-09-21 16:18:48 -06:00
|
|
|
print("Previous personality values for "..unit_name)
|
|
|
|
printall(unit.status.current_soul.personality.traits)
|
2015-09-04 00:51:28 -06:00
|
|
|
|
2015-09-21 16:18:48 -06:00
|
|
|
--now set new personality
|
|
|
|
for i=1, #profile do
|
|
|
|
unit.status.current_soul.personality.traits[i-1]=profile[i]
|
|
|
|
end
|
2015-09-04 00:51:28 -06:00
|
|
|
|
2015-09-21 16:18:48 -06:00
|
|
|
print("New personality values for "..unit_name)
|
|
|
|
printall(unit.status.current_soul.personality.traits)
|
|
|
|
print(unit_name.." has been brainwashed, praise Armok!")
|
2015-09-04 00:51:28 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
-- main script starts here
|
|
|
|
-- profiles are listed here and passed to the brainwash function
|
|
|
|
--
|
|
|
|
local baseline={50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50}
|
|
|
|
local ideal={75,25,25,75,25,25,25,99,25,25,25,50,75,50,25,75,75,50,75,75,25,75,75,50,75,25,50,25,75,75,75,25,75,75,25,75,25,25,75,75,25,75,75,75,25,75,75,25,25,50}
|
|
|
|
local stepford={99,1,1,99,1,1,1,99,1,1,1,1,50,50,1,99,99,50,50,50,1,1,99,50,50,50,50,50,50,99,50,1,1,99,1,99,1,1,99,99,1,99,99,99,1,50,50,1,1,1}
|
|
|
|
local wrecked={1,99,99,1,99,99,99,1,99,99,99,1,1,99,99,1,1,1,1,1,99,1,1,99,1,99,99,99,1,1,1,99,1,1,99,1,99,99,1,1,99,1,1,1,99,1,1,99,99,99}
|
|
|
|
local opt = ...
|
|
|
|
|
|
|
|
if opt then
|
|
|
|
if opt=="ideal" then
|
|
|
|
brainwash_unit(ideal)
|
|
|
|
return
|
2015-09-21 16:18:48 -06:00
|
|
|
end
|
2015-09-04 00:51:28 -06:00
|
|
|
if opt=="baseline" then
|
|
|
|
brainwash_unit(baseline)
|
|
|
|
return
|
2015-09-21 16:18:48 -06:00
|
|
|
end
|
2015-09-04 00:51:28 -06:00
|
|
|
if opt=="stepford" then
|
|
|
|
brainwash_unit(stepford)
|
|
|
|
return
|
2015-09-21 16:18:48 -06:00
|
|
|
end
|
2015-09-04 00:51:28 -06:00
|
|
|
if opt=="wrecked" then
|
|
|
|
brainwash_unit(wrecked)
|
|
|
|
return
|
2015-09-21 16:18:48 -06:00
|
|
|
end
|
2015-09-04 00:51:28 -06:00
|
|
|
else
|
|
|
|
print ("Invalid or missing personality argument.\nValid choices are ideal , baseline , stepford, and wrecked.")
|
|
|
|
print ("ideal will create a reliable dwarf with generally positive personality traits.")
|
|
|
|
print ("baseline will reset all personality traits to a default / the average.")
|
|
|
|
print ("stepford amplifies all good qualities to an excessive degree.")
|
|
|
|
print ("wrecked amplifies all bad qualities to an excessive degree.")
|
2015-09-04 01:13:21 -06:00
|
|
|
end
|