summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/status.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-04-02 12:42:40 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2014-05-07 18:23:20 -0600
commitb9ac4c953e9d5fae3bc23dde3f999218d396f804 (patch)
tree8548ca2b3ea15399b239c2fa493c6cd1c9908019 /crawl-ref/source/status.cc
parent35db536519c705528e4f8bf41851e58502ceb4f5 (diff)
downloadcrawl-ref-b9ac4c953e9d5fae3bc23dde3f999218d396f804.tar.gz
crawl-ref-b9ac4c953e9d5fae3bc23dde3f999218d396f804.zip
Gozag: prelimiary implementation of Bribe Branch.
Spend 3000 gold for a chance of temporarily turning some of the inhabitants of a branch good neutral, or possibly even friendly. Bribes are only effective against newly generated monsters (i.e. on level creation or monsters that spawn afterwards); the fund times out over time and more quickly with the number of enemies affected, upon which neutral enemies turn hostile again; friendly followers will continue to follow the player subject to occasional follow-up payments.
Diffstat (limited to 'crawl-ref/source/status.cc')
-rw-r--r--crawl-ref/source/status.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/crawl-ref/source/status.cc b/crawl-ref/source/status.cc
index 982a3e5266..5bf4bbb009 100644
--- a/crawl-ref/source/status.cc
+++ b/crawl-ref/source/status.cc
@@ -3,6 +3,7 @@
#include "status.h"
#include "areas.h"
+#include "branch.h"
#include "env.h"
#include "evoke.h"
#include "godabil.h"
@@ -707,6 +708,39 @@ bool fill_status_info(int status, status_info* inf)
break;
}
+ case STATUS_BRIBE:
+ {
+ int bribe = 0;
+ vector<string> places;
+ for (int i = 0; i < NUM_BRANCHES; i++)
+ {
+ if (bribe < branch_bribe[i])
+ bribe = branch_bribe[i];
+ if (branch_bribe[i] > 0)
+ {
+ places.push_back(branches[static_cast<branch_type>(i)]
+ .longname);
+ }
+ }
+
+ if (bribe == 0)
+ break;
+
+ inf->light_colour = (bribe >= 2000) ? WHITE :
+ (bribe >= 1000) ? LIGHTBLUE
+ : BLUE;
+
+ inf->light_text = "Bribe";
+ inf->short_text = make_stringf("bribing [%s]",
+ comma_separated_line(places.begin(),
+ places.end(),
+ ", ", ", ")
+ .c_str());
+ inf->long_text = "You are bribing "
+ + comma_separated_line(places.begin(), places.end());
+ break;
+ }
+
default:
if (!found)
{