From ed686db23e0db271932049b0072dce2edd8d0975 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 12 Oct 2020 00:44:07 -0300 Subject: Town actions: One action every 4 hours, maximum 6 actions every day. Actions are only used on investments and tax control. Paperwork, exiling, changing policies etc takes no actions. --- npc/functions/politics.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'npc') diff --git a/npc/functions/politics.txt b/npc/functions/politics.txt index f74c9c6fc..b6a9e0d5e 100644 --- a/npc/functions/politics.txt +++ b/npc/functions/politics.txt @@ -360,6 +360,14 @@ function script POL_Manage { if (strcharinfo(0) != .@MAYOR$) return; + // How many actions do you have? + // You get 1 action/4-hour, capped to 6 + .@left=(gettimeparam(GETTIME_HOUR)/4)-TOWN_ACTIONS; + if (.@left > 6) { + .@left=6; + TOWN_ACTIONS=(gettimeparam(GETTIME_HOUR)/4)-6; + } + do { .@GP=getd("$"+getarg(0)+"_MONEY"); @@ -372,6 +380,7 @@ function script POL_Manage { mesc l("Town Money: @@", .@GP), 2; mesc l("Town Reputation: %d | %d.%02d %% Tax", .@RP, .@TX/100, .@TX%100), 2; mesc l("Town Weekly Exports: @@", .@EX), 2; + mesc l("Total actions left: %d", .@left), (.@left > 1 ? 9 : 1); next; menuint l("Nothing"), 0, @@ -406,6 +415,7 @@ function script POL_Manage { .@GP=getd("$"+getarg(0)+"_MONEY"); setd(.@town$+"_MONEY", .@GP-.@cost); setd(.@town$+"_EXPORT", .@EX+rand2(4,6)); + TOWN_ACTIONS+=1; mesc l("Investment executed"), 2; next; } @@ -427,6 +437,7 @@ function script POL_Manage { .@GP=getd("$"+getarg(0)+"_MONEY"); setd(.@town$+"_MONEY", .@GP-.@cost); setd(.@town$+"_REPUTATION", .@RP+1); + TOWN_ACTIONS+=1; mesc l("Investment executed"), 2; next; } @@ -443,6 +454,7 @@ function script POL_Manage { if (askyesno() == ASK_YES) { setd(.@town$+"_REPUTATION", .@RP-.@cost); setd(.@town$+"_TAX", .@TX+rand2(2,5)); + TOWN_ACTIONS+=1; mesc l("Taxes raised"), 1; next; } @@ -458,6 +470,7 @@ function script POL_Manage { if (askyesno() == ASK_YES) { setd(.@town$+"_TAX", max(0, .@TX-.@cost)); setd(.@town$+"_REPUTATION", min(100, .@RP+.@cost)); + TOWN_ACTIONS+=1; mesc l("Taxes lowered"), 1; next; } -- cgit v1.2.3-60-g2f50