|
1 | 1 | -- Brainwash a dwarf, modifying their personality
|
2 | 2 | -- usage is: target a unit in DF, and execute this script in dfhack
|
3 |
| --- by vjek |
4 |
| ---[[=begin |
| 3 | +-- by vjek, edited by PeridexisErrant |
| 4 | +local help = [====[ |
5 | 5 |
|
6 | 6 | brainwash
|
7 | 7 | =========
|
8 |
| -Modify the personality traits of the selected dwarf to match an 'ideal' |
9 |
| -personality - as stable and reliable as possible. This makes dwarves very |
10 |
| -stable, preventing tantrums even after months of misery. |
| 8 | +Modify the personality traits of the selected dwarf to match an idealised |
| 9 | +personality - for example, as stable and reliable as possible to prevent |
| 10 | +tantrums even after months of misery. |
11 | 11 |
|
12 |
| -=end]] |
| 12 | +Usage: ``brainwash <type>``, with one of the following types: |
| 13 | +
|
| 14 | +:ideal: reliable, with generally positive personality traits |
| 15 | +:baseline: reset all personality traits to the average |
| 16 | +:stepford: amplifies all good qualities to an excessive degree |
| 17 | +:wrecked: amplifies all bad qualities to an excessive degree |
| 18 | +
|
| 19 | +]====] |
13 | 20 |
|
14 | 21 | function brainwash_unit(profile)
|
15 | 22 | local i,unit_name
|
16 | 23 |
|
17 | 24 | unit=dfhack.gui.getSelectedUnit()
|
18 | 25 | if unit==nil then
|
19 |
| - print ("No unit under cursor! Aborting with extreme prejudice.") |
| 26 | + print ("No unit under cursor! Aborting.") |
20 | 27 | return
|
21 | 28 | end
|
22 | 29 |
|
|
37 | 44 |
|
38 | 45 | -- main script starts here
|
39 | 46 | -- profiles are listed here and passed to the brainwash function
|
40 |
| --- |
41 |
| -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} |
42 |
| -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} |
43 |
| -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} |
44 |
| -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} |
45 |
| -local opt = ... |
| 47 | +local baseline={ |
| 48 | + 50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50, |
| 49 | + 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} |
| 51 | +local ideal={ |
| 52 | + 75,25,25,75,25,25,25,99,25,25,25,50,75,50,25,75,75,50,75,75, |
| 53 | + 25,75,75,50,75,25,50,25,75,75,75,25,75,75,25,75,25,25,75,75, |
| 54 | + 25,75,75,75,25,75,75,25,25,50} |
| 55 | +local stepford={ |
| 56 | + 99,1,1,99,1,1,1,99,1,1,1,1,50,50,1,99,99,50,50,50, |
| 57 | + 1,1,99,50,50,50,50,50,50,99,50,1,1,99,1,99,1,1,99,99, |
| 58 | + 1,99,99,99,1,50,50,1,1,1} |
| 59 | +local wrecked={ |
| 60 | + 1,99,99,1,99,99,99,1,99,99,99,1,1,99,99,1,1,1,1,1, |
| 61 | + 99,1,1,99,1,99,99,99,1,1,1,99,1,1,99,1,99,99,1,1, |
| 62 | + 99,1,1,1,99,1,1,99,99,99} |
46 | 63 |
|
47 |
| -if opt then |
48 |
| - if opt=="ideal" then |
49 |
| - brainwash_unit(ideal) |
50 |
| - return |
51 |
| - end |
52 |
| - if opt=="baseline" then |
53 |
| - brainwash_unit(baseline) |
54 |
| - return |
55 |
| - end |
56 |
| - if opt=="stepford" then |
57 |
| - brainwash_unit(stepford) |
58 |
| - return |
59 |
| - end |
60 |
| - if opt=="wrecked" then |
61 |
| - brainwash_unit(wrecked) |
62 |
| - return |
63 |
| - end |
| 64 | +local opt = ... |
| 65 | +if opt=="ideal" then |
| 66 | + brainwash_unit(ideal) |
| 67 | +elseif opt=="baseline" then |
| 68 | + brainwash_unit(baseline) |
| 69 | +elseif opt=="stepford" then |
| 70 | + brainwash_unit(stepford) |
| 71 | +elseif opt=="wrecked" then |
| 72 | + brainwash_unit(wrecked) |
64 | 73 | else
|
65 |
| - print ("Invalid or missing personality argument.\nValid choices are ideal , baseline , stepford, and wrecked.") |
66 |
| - print ("ideal will create a reliable dwarf with generally positive personality traits.") |
67 |
| - print ("baseline will reset all personality traits to a default / the average.") |
68 |
| - print ("stepford amplifies all good qualities to an excessive degree.") |
69 |
| - print ("wrecked amplifies all bad qualities to an excessive degree.") |
| 74 | + print(help) |
70 | 75 | end
|
0 commit comments