Comments (7)
Check #11701 middle commit (Edit: in a hurry, thus this terse)
from unciv.
Check #11701 middle commit (Edit: in a hurry, thus this terse)
I looked at the middle commit, and it doesn't look like it changes the code behind the unique. Am I missing something?
from unciv.
It shows there are two Uniques only differing in the case of the first letter... The commit only leaves a doc comment, because I noticed in passing. Confusing, so maybe the implementation got mixed up as well? ... Looking for code usages doesn't seem so at first glance. The one with capital C is CostsResources and has references around what the UniqueTargets say... I just mentioned that because I came across that Unique just lately and you now telling it doesn't work is a fishy coincidence.
from unciv.
Hmmm... First, ResourcesOverviewTab is more selective than WorldScreenTopBarResources in which resources to display. That should be unified. And EmpireOverviewCategories.Resources.showDisabled has still a slightly different selectivity - not good.
- getConstructionButton gets a DTO for that Building "Check 2" without rejectionReason, even though there's 0 available 'Stuff' .
- The breakpoint in INonPerpetualConstruction.requiredResources never hit before seeing that buy button enabled
- The boolean functions in RejectionReason based on Collection.contains - did I not get rid of them? I distinctly remember moving them into flags on the RejectionReasonType... Even if done this way, they should be EnumSets not Set or even List. 'Cuz EnumSet.contains is a bitmask test and way faster than any other contains. Uh, but I only wanted to find the function producing them...
- No, that's over my head. Can't find how that is even supposed to work. Seems all of the getResourceRequirements things don't apply...
from unciv.
For what it's worth, "<costs [amount] [stockpiledResource]>" works exactly as advertised, consuming the stockpiled resource when available and not allowing the action when there aren't enough resources. I've also been able to approximate the effect that I want by combining "Instantly consumes [positiveAmount] [stockpiledResource]" and "Only available <when above [amount] [stockpiledResource]>". The trouble remains that "Costs [amount] [stockpiledResource]" is still a dead letter.
from unciv.
@yairm210 The unique still appears to be a dead letter. It doesn't cause the amount of stockpiled resources to go down and it doesn't prevent the construction of units or buildings when there aren't enough stockpiled resources to go around.
from unciv.
I did a little more tinkering and found that the unique does work occasionally. Specifically, it kicks in when you try to build a unit without buying it. The cost will get subtracted as the unit is build, but not right when it's finished being built. It gets subtracted in the middle of the process, apparently one turn after the unit starts being built.
The cost can also prevent the unit from being built if you haven't got enough of the stockpiled resource, but it doesn't apply right away. Instead, what happens is that the game will let you start building the unit, and then will cancel the build after one turn. The possible unit will still appear on the menu, of course, but it never lets you finish constructing it.
All of this, unfortunately, can be circumvented by buying the unit or building. Purchase it with gold instead of production and the cost never gets subtracted at all.
It gets more interesting when you look at how this affects tile improvements. If a unit has the ability to instantly create a tile improvement that costs a stockpiled resource, it can't do so if there isn't enough resource to pay for it, but if it gets built, it doesn't cost anything. If you construct the tile improvement using a normal worker instead of a unit that makes the improvement instantly, the cost has no effect; the improvement can be constructed with or without the resource.
I don't know what's going on behind the scenes, but that's what I can tell you about what happens on the front end.
from unciv.
Related Issues (20)
- Crash HOT 1
- Escort formation+Automation bug HOT 1
- Unciv on OpenAPK HOT 8
- AI joins war with ally AI against a dead civilisation HOT 1
- 4.12.10 boom all mods that include Atlases.json HOT 1
- New capital renamed New Babylon/Carthage/Rome, only affects these 3 nations HOT 2
- Nation/City State icon before city name in Wonders and Notifications Overview HOT 6
- Auto production on Work Boats
- Movement of Air units goes wrong.
- retracted
- AI: Balancing of accepting "unfavorable" trades (reason in this example related to gifted gold) HOT 5
- Unique stopped working, +1 HOT 2
- AutoEndturn bypassed Disabled Auto Build roads Option HOT 2
- Cannot enter Game in 4.12.12 in Android HOT 3
- Barbarian encampments appearing on map, even without Honor selected HOT 3
- Mod checker objecting to acceptable mapUnitFilter combinations
- Выдает ошибку HOT 1
- Feature request: option to disable animations
- Instant crash after update to 4.12.12 - SOLVED with 4.12.12-patch1 HOT 1
- Cannot buy buildings with other stats
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unciv.