diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-10-12 00:46:10 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-10-12 00:46:10 -0300 |
commit | 80cca9d66577e65715926d4a1ed64fe661369154 (patch) | |
tree | dd1acb8b9dc666a1eb4b7e9e11df99767646007e /npc/functions | |
parent | ed686db23e0db271932049b0072dce2edd8d0975 (diff) | |
download | serverdata-80cca9d66577e65715926d4a1ed64fe661369154.tar.gz serverdata-80cca9d66577e65715926d4a1ed64fe661369154.tar.bz2 serverdata-80cca9d66577e65715926d4a1ed64fe661369154.tar.xz serverdata-80cca9d66577e65715926d4a1ed64fe661369154.zip |
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.
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/politics.txt | 13 |
1 files 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; } |