-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated CityStateFunction.tk so that city states, will get angry at you, if you steal their lands #12725
Conversation
…of running away Settler unit will now settle on best tile in dangerous Tiles without escort instead of running away.
|
||
// If citystate gets tile stolen from another civ, then the civ gets a diplomacy Influence debuffer. | ||
if (diplomacy.hasModifier(DiplomaticModifiers.StealingTerritory) && diplomacy.isRelationshipLevelLT(RelationshipLevel.Friend)) { | ||
diplomacy.addInfluence(-25f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in UniqueTriggerActivation:1107 (UniqueType.OneTimeTakeOverTilesInRadius)
This should happen when the tile is being stolen
Also, even if you have a good relationship with a CS, stealing tiles is a Bad Action, and should have consequences
I think 15 influence per tile stolen sounds around right
otherCiv.popupAlerts.add(PopupAlert(AlertType.BorderOccupation, civInfo.civName)) | ||
|
||
// to only show popup once. | ||
diplomacy.setFlag(DiplomacyFlags.BorderOccupation, -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flag name is not indicative of what it's actually remembering - should be "TilesStolen" or similar, this sounds like you have units on tiles on their borders
I have changed the BorderOccupation name to TilesStolen. |
// check if civ has steal a tile from a citystate | ||
if (otherCiv != null && otherCiv.isCityState) { | ||
// create this varibale diplomacyCityState for more readability | ||
val diplomacyCityState = otherCiv.getDiplomacyManager(civInfo)!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about getDiplomacyManagerOrMeet, that way we don't run into weird problems if we manage to steal tiles from a civ we haven't met yet
addGoodSizedLabel("You stole some of our territory!") | ||
addCloseButton("Yes.", KeyboardBinding.Confirm) | ||
addCloseButton("No.", KeyboardBinding.Cancel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this about? Let the player know this was unacceptable, but there's no choice here,
Something like "Those lands were not yours to take. This has not gone unnoticed."
And then just addCloseButton()
Also, this text needs to go in template.properties so it's translatable
Done |
addGoodSizedLabel("You stole some of our territory!") | ||
addCloseButton("Yes.", KeyboardBinding.Confirm) | ||
addCloseButton("No.", KeyboardBinding.Cancel) | ||
addGoodSizedLabel("Those lands were not yours to take. This has not gone unnoticed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a period on the end :)
Also in the properties file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
val diplomacyCityState = otherCiv.getDiplomacyManagerOrMeet(civInfo) | ||
diplomacyCityState.addInfluence(-15f) | ||
|
||
if (!diplomacyCityState.hasFlag(DiplomacyFlags.TilesStolen)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you need to add the flag, because currently it will pop up every time
I'm not sure this is a bad thing tbh 🤔 Maybe we want to pop up every time?Currently this line just will never be true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I am going to update it to add the flag.
And that explained why I was getting 1 popup per Tile stolen, Now after adding the flag i only get one popup 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make so that you don't get declare war option, when you are already at war with that civ
Small side note "after the fact": Nudge nudge white-space. This PR introduced several lines consisting only of blanks, and there's a block of 3 empty lines in the middle of a function. Some recent @SeventhM PR's too. White-space changes are still changes to git, so inconsistent handling can lead to unnecessarily increased merge troubles. I thought the policy was no trailing white-space except where needed (templates) - "Do as you wont but never change another's insignificant white-space" could work too, but it needs consensus. |
I'm not entirely sure what you're trying to say here. My general rule of thumb has been:
The only time I delete lines between statements/functions is if there's two lines instead of one accidentally |
Uh, sorry, this here is not the diff I had in mind with that comment1... Curious - now which one did I mean? That was #12817, so not even the same author, and most are by now fixed. PrevIdleButton still has one blank less than NextIdleButton. Footnotes
|
Before the city state Ai, didn't care if you steal their lands.
But now with this update to the code, they will hate you now.
Except if you are friends with them.
Also modified other files, to have the popup when you steal their lands.