From 80cca9d66577e65715926d4a1ed64fe661369154 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 12 Oct 2020 00:46:10 -0300 Subject: Town actions should be unique-per-town, not unique-per-player. i.e. If you control multiple towns, actions should not merge togheter in a meatball. --- npc/functions/politics.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/npc/functions/politics.txt b/npc/functions/politics.txt index b6a9e0d5e..a0cc09856 100644 --- a/npc/functions/politics.txt +++ b/npc/functions/politics.txt @@ -356,16 +356,17 @@ function script POL_TownInfo { function script POL_Manage { .@town$="$"+getarg(0); .@MAYOR$=getd("$"+getarg(0)+"_MAYOR$"); + .@TP=POL_LocToTP(getarg(0)); 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; + .@left=(gettimeparam(GETTIME_HOUR)/4)-TOWN_ACTIONS[.@TP]; if (.@left > 6) { .@left=6; - TOWN_ACTIONS=(gettimeparam(GETTIME_HOUR)/4)-6; + TOWN_ACTIONS[.@TP]=(gettimeparam(GETTIME_HOUR)/4)-6; } do @@ -415,7 +416,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; + TOWN_ACTIONS[.@TP]+=1; mesc l("Investment executed"), 2; next; } @@ -437,7 +438,7 @@ function script POL_Manage { .@GP=getd("$"+getarg(0)+"_MONEY"); setd(.@town$+"_MONEY", .@GP-.@cost); setd(.@town$+"_REPUTATION", .@RP+1); - TOWN_ACTIONS+=1; + TOWN_ACTIONS[.@TP]+=1; mesc l("Investment executed"), 2; next; } @@ -454,7 +455,7 @@ function script POL_Manage { if (askyesno() == ASK_YES) { setd(.@town$+"_REPUTATION", .@RP-.@cost); setd(.@town$+"_TAX", .@TX+rand2(2,5)); - TOWN_ACTIONS+=1; + TOWN_ACTIONS[.@TP]+=1; mesc l("Taxes raised"), 1; next; } @@ -470,7 +471,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; + TOWN_ACTIONS[.@TP]+=1; mesc l("Taxes lowered"), 1; next; } -- cgit v1.2.3-60-g2f50