jrutila / pocketciv-js

Javascript library for PocketCiv game
Other
3 stars 0 forks source link

PocketCiv Acquire Advance #34

Open dukenathan opened 8 years ago

dukenathan commented 8 years ago

First off, thank you so much for putting together PocketCiv online. I love playing it, and it's taught me so much about the game that I felt comfortable printing my own paper version to play on airplane trips. Now to the bug I encountered. I was playing the second scenario (can't wait for the demo on gold if you're still planning to do it!) and I encountered a bug where I couldn't buy an advance once the cost in tribes was 0, even if I had room for more advances, hadn't bought an advance that turn, and had a city with the requisite resources available. It never let me buy Basic Tools, and once I got simple tools and engineering, and reduced the cost of buying Mining to 0 tribes, it wouldn't let me buy that advance either. Here's the attached log file. I wasn't sure how to attach it, so I just copy and pasted. Hope that's ok. Let me know if I'm just not seeing something, or if it's a bug. Thanks again for your help!

{ "scenario": { "name": "scenario2", "title": "2. The Gilded Land", "description": "This is another simple scenario. You will be required now to create some gold at some point, in order to acquire Architecture. This can be done through various ways, through other Advances (such as Mining and Black Market) or through Expeditions", "goal": "Acquire Architecture before the end of Era 3.", "map": { "areas": { "3": { "id": 3, "tribes": 1, "farm": true, "neighbours": [ 4, 5, 6, 8, "sea" ] }, "4": { "id": 4, "tribes": 1, "mountain": true, "forest": true, "farm": true, "neighbours": [ 3, 8, "sea", "frontier" ] }, "5": { "id": 5, "tribes": 1, "mountain": true, "forest": true, "neighbours": [ 3, 6, 8, "sea", "frontier" ] }, "6": { "id": 6, "tribes": 1, "neighbours": [ 3, 5, 8 ], "forest": true }, "8": { "id": 8, "neighbours": [ 3, 4, 5, 6, "frontier" ], "desert": true } }, "width": 11, "height": 11, "grid": [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 5, 5, 8, 8, 0, 0, 0, 0, 0 ], [ -1, -1, 5, 6, 6, 8, 0, 0, 0, 0 ], [ -1, -1, -1, 5, 6, 6, 8, 0, 0, 0 ], [ -1, -1, -1, -1, 3, 3, 3, 4, 4, 0 ], [ -1, -1, -1, -1, -1, 3, -1, 4, 4, 0 ], [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ], [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ], [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ], [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ], [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ], [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ] ] } }, "move": [ { "3": 1, "4": 3, "5": 2, "6": 1, "8": 1 }, { "3": 1, "4": 6, "5": 2, "6": 1, "8": 1 }, { "3": 1, "4": 5, "5": 1, "6": 1, "8": 2 }, { "3": 1, "4": 2, "5": 1, "6": 1, "8": 1 }, { "3": 1, "4": 1, "5": 1, "6": 1, "8": 0 }, { "3": 1, "4": 1, "5": 2, "6": 3, "8": 1 }, { "3": 5, "4": 2, "5": 2, "6": 1, "8": 1 }, { "3": 1, "4": 2, "5": 1, "6": 1, "8": 1 }, { "3": 2, "4": 6, "5": 1, "6": 1, "8": 1 }, { "3": 2, "4": 3, "5": 1, "6": 2, "8": 1 }, { "3": 2, "4": 3, "5": 5, "6": 1, "8": 1 }, { "3": 1, "4": 3, "5": 3, "6": 0, "8": 1 }, { "3": 2, "4": 2, "5": 3, "6": 1, "8": 1 }, { "3": 1, "4": 5, "5": 3, "6": 1, "8": 1 }, { "3": 1, "4": 1, "5": 1, "6": 1, "8": 0 }, { "3": 1, "4": 2, "5": 1, "6": 1, "8": 1 } ], "deck": [ 13, 9, 4, 3, 16, 5, 6, 15, 2, 14, 11, 8, 1, 13, 5, 7, 1, 15, 10, 12, 4, 2, 9, 8, 14, 6, 7 ], "reduce": [ [], [], [ 8, 4 ], [], [], [], [], [], [], [], [], [], [], [ 8 ], [], [], [] ], "advance": [ [], [ "city" ], [ "acquire", "farm" ], [], [], [], [ "city", "acquire" ], [ "acquire" ], [ "acquire" ], [ "acquire" ], [ "city" ], [ "farm" ], [ "farm" ], [ "city", "acquire" ], [], [ "acquire", "acquire" ] ], "acquires": [ { "4": { "name": "agriculture", "title": "Agriculture", "description": "Farms can be created in any Region, and you do NOT decimate Forests to create Farms once per turn. You still must Decimate 2 Tribes to create a Farm.", "points": 5, "cost": { "tribes": 4 }, "resources": [ "stone" ], "requires": [], "required_by": [ "irrigation", "equestrian" ], "events": {}, "actions": { "farm": {} } } }, { "4": { "name": "masonry", "title": "Masonry", "description": "During Upkeep, you can increase one City AV by 1. The maximum AV of a City is 2, unless otherwise noted.", "points": 3, "cost": { "tribes": 2 }, "resources": [ "stone" ], "requires": [], "required_by": [ "engineering" ], "events": {}, "phases": {}, "actions": {} } }, {}, { "4": { "name": "simple_tools", "title": "Simple Tools", "description": "Reduce the cost of Decimating Tribes when increasing a City AV by 1. Reduce one less Tribe when Acquiring the following Advances: Masonry, Engineering, Architecture, Cartage, Irrigation, Mining, Roadbuilding, Metal Working.", "points": 4, "cost": { "tribes": 4 }, "resources": [ "stone", "wood" ], "requires": [], "required_by": [], "events": {}, "phases": {}, "actions": {} } }, { "4": { "name": "coinage", "title": "Coinage", "description": "Do not Decimate Gold during upkeep. Effectively,you can now store Gold for the entire game.", "points": 3, "cost": { "tribes": 2, "gold": 3 }, "resources": [ "stone" ], "requires": [], "required_by": [ "banking" ], "events": {}, "phases": {}, "actions": {} } }, { "5": { "name": "engineering", "title": "Engineering", "description": "The maximum AV of a City is 3, unless otherwise noted.", "points": 5, "cost": { "tribes": 2 }, "resources": [ "stone", "wood" ], "requires": [ "masonry" ], "required_by": [ "architecture", "machining" ], "events": { "volcano": { "steps": { "2.3.1": "+ If you have {{ adv:engineering }}, Cities cannot be Reduced below 1 AV. Decimated Cities are instead reduced to 1 AV. {% saveCities() %}" } }, "earthquake": { "steps": { "f4.1": "+ If you have {{ adv:engineering }}, Cities cannot be Reduced below 1 AV. Decimated Cities are instead reduced to 1 AV. {% saveCities() %}" } }, "flood": { "steps": { "3.2.1": "+ If you have {{ adv:engineering }}, 1 Wonder = 10 Damage.{% dmgWn = 10 %}" } } }, "phases": {}, "actions": {} } }, {}, {} ], "builds": [], "log": [ "No event happened", "No event happened", "Built a city to 4", "Earthquake happened in region 3", "Acquired: ", "Created a farm to 8", "Epidemic happened in region 5", "No event happened", "Volcano happened in region 6", "No event happened", "Built a city to 3", "Acquired: ", "Sandstorm happened", "Acquired: ", "Earthquake happened in region 5", "Acquired: ", "Visitation: %(visitor)s happened", "Acquired: ", "Famine happened in region 4", "Built a city to 5", "No event happened", "Created a farm to 4", "Tribal War happened", "Created a farm to 5", "Tribal War happened in region 6", "Built a city to 4", "Acquired: ", "No event happened", "Anarchy happened in region ", "Acquired: ", "Acquired: " ] }

jrutila commented 8 years ago

Thanks for reporting this. I will look into it.

jrutila commented 8 years ago

I checked this. Is the "Acquire" button greyed out? Have you selected the area from the right side list? It guesses the correct are if it is the only one available. Otherwise you have to select the desired area from the list. Click the are number. I should add some kind of hint near the button.