From d9ae3cc6125bff72d07f237bbdf157e2b49c4046 Mon Sep 17 00:00:00 2001 From: expwnent Date: Sun, 30 Nov 2014 09:26:04 -0500 Subject: [PATCH] Removed removebadthoughts and updated Readme.rst and NEWS. --- NEWS | 7 +++--- Readme.rst | 20 +---------------- scripts/removebadthoughts.rb | 43 ------------------------------------ 3 files changed, 5 insertions(+), 65 deletions(-) delete mode 100644 scripts/removebadthoughts.rb diff --git a/NEWS b/NEWS index c84421599..53fa81d25 100644 --- a/NEWS +++ b/NEWS @@ -4,13 +4,14 @@ DFHack Future typo fix in modtools/reaction-trigger modtools/item-trigger should now work with item types New plugins: - - savestock and loadstock: two commands for saving and loading + savestock and loadstock: two commands for saving and loading stockpile settings to a file. They can be used to migrate stockpile settings between worlds and saves. New scripts: - - remove-stress [all]: set selected or all units unit to -1,000,000 stress + remove-stress [all]: set selected or all units unit to -1,000,000 stress + this script replaces removebadthoughts.rb Misc improvements: - - cmd-prompt can now access selected items, units, and buildings + cmd-prompt can now access selected items, units, and buildings DFHack 0.40.16-r1 Internals: diff --git a/Readme.rst b/Readme.rst index e2456d7d3..4c7ecbb0f 100644 --- a/Readme.rst +++ b/Readme.rst @@ -2404,27 +2404,9 @@ quicksave If called in dwarf mode, makes DF immediately auto-save the game by setting a flag normally used in seasonal auto-save. -removebadthoughts -================= -This script remove negative thoughts from your dwarves. Very useful against -tantrum spirals. - -The script can target a single creature, when used with the ``him`` argument, -or the whole fort population, with ``all``. - -To show every bad thought present without actually removing them, run the -script with the ``-n`` or ``--dry-run`` argument. This can give a quick -hint on what bothers your dwarves the most. - -Individual dwarf happiness may not increase right after this command is run, -but in the short term your dwarves will get much more joyful. - -Internals: the thoughts are set to be very old, so that the game remove them -quickly after you unpause. - remove-stress ============= -Sets stress to -1,000,000; the normal range is 0 to 500,000 with very stable or very stressed dwarves taking on negative or greater values respectively. Applies to the selected unit, or use "remove-stress all" to apply to all units. +Sets stress to -1,000,000; the normal range is 0 to 500,000 with very stable or very stressed dwarves taking on negative or greater values respectively. Applies to the selected unit, or use "remove-stress -all" to apply to all units. setfps ====== diff --git a/scripts/removebadthoughts.rb b/scripts/removebadthoughts.rb deleted file mode 100644 index 76aa903fe..000000000 --- a/scripts/removebadthoughts.rb +++ /dev/null @@ -1,43 +0,0 @@ -# remove bad thoughts for the selected unit or the whole fort - -dry_run = $script_args.delete('--dry-run') || $script_args.delete('-n') - -$script_args << 'all' if dry_run and $script_args.empty? - -seenbad = Hash.new(0) - -clear_mind = lambda { |u| - u.status.recent_events.each { |e| - next if DFHack::UnitThoughtType::Value[e.type].to_s[0, 1] != '-' - seenbad[e.type] += 1 - e.age = 0x1000_0000 unless dry_run - } -} - -summary = lambda { - seenbad.sort_by { |thought, cnt| cnt }.each { |thought, cnt| - puts " #{thought} #{cnt}" - } - count = seenbad.values.inject(0) { |sum, cnt| sum+cnt } - puts "Removed #{count} bad thought#{'s' if count != 1}." if count > 0 and not dry_run -} - -case $script_args[0] -when 'him' - if u = df.unit_find - clear_mind[u] - summary[] - else - puts 'Please select a dwarf ingame' - end - -when 'all' - df.unit_citizens.each { |uu| - clear_mind[uu] - } - summary[] - -else - puts "Usage: removebadthoughts [--dry-run] " - -end