From 05e812c325e9fbc8bca497652f5cf77b8ab947e9 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 22 Apr 2023 22:08:42 +0200 Subject: Combine resources from Cities and Depts in Shaded 64. --- events.txt | 6 ++++-- rules.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/events.txt b/events.txt index ff33878..cad6ad1 100644 --- a/events.txt +++ b/events.txt @@ -1094,12 +1094,14 @@ EVENT 64 SHADED 64 if AUTOMATIC + asm game.vm.total = 0 count_pieces is_cartels_base(p) && is_city(s) log `${game.vm.count} Cartels Bases in Cities.` - resources CARTELS (2*game.vm.count) + asm game.vm.total += 2 * game.vm.count count_pieces is_cartels_base(p) && is_dept(s) log `${game.vm.count} Cartels Bases in Departments.` - resources CARTELS (game.vm.count) + asm game.vm.total += game.vm.count + resources CARTELS (game.vm.total) else prompt "Cartels Resources +2 for each Cartels Base in a City." piece all is_cartels_base(p) && is_city(s) diff --git a/rules.js b/rules.js index b1eafe7..6cbbf08 100644 --- a/rules.js +++ b/rules.js @@ -9389,12 +9389,14 @@ CODE[64 * 2 + 0] = [ // SHADED 64 CODE[64 * 2 + 1] = [ [ vm_if, ()=>AUTOMATIC ], + [ vm_asm, ()=>game.vm.total = 0 ], [ vm_count_pieces, (p,s)=>is_cartels_base(p) && is_city(s) ], [ vm_log, ()=>`${game.vm.count} Cartels Bases in Cities.` ], - [ vm_resources, CARTELS, ()=>(2*game.vm.count) ], + [ vm_asm, ()=>game.vm.total += 2 * game.vm.count ], [ vm_count_pieces, (p,s)=>is_cartels_base(p) && is_dept(s) ], [ vm_log, ()=>`${game.vm.count} Cartels Bases in Departments.` ], - [ vm_resources, CARTELS, ()=>(game.vm.count) ], + [ vm_asm, ()=>game.vm.total += game.vm.count ], + [ vm_resources, CARTELS, ()=>(game.vm.total) ], [ vm_else ], [ vm_prompt, "Cartels Resources +2 for each Cartels Base in a City." ], [ vm_piece, false, 999, 999, (p,s)=>is_cartels_base(p) && is_city(s) ], -- cgit v1.2.3