Skip to content
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

Allow stat from battle uniques to also give stockpiles #12689

Merged
merged 3 commits into from
Dec 25, 2024

Conversation

SeventhM
Copy link
Collaborator

Also add some helpers to GameResource and SubStat to make it easier to work with

civ.addGameResource(resource, plunderedAmount)
val icon = if (resource is SubStat) resource.icon else "ResourceIcons/$resourceName"
civ.addNotification(
"Your [${plunderingUnit.getName()}] plundered [${plunderedAmount}] [${resourceName}] from [${plunderedUnit.getName()}]",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not notify for stat plundering?

Copy link
Collaborator Author

@SeventhM SeventhM Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notification is a bit lower (line 404). This is actually copy paste from there

Comment on lines 379 to 382
val resource = Stat.safeValueOf(resourceName) ?:
SubStat.safeValueOf(resourceName) ?:
plunderedUnit.getCivInfo().gameInfo.ruleset.tileResources[resourceName]
if (resource == null) continue
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add empty lines before and after this segment

core/src/com/unciv/logic/battle/Battle.kt Outdated Show resolved Hide resolved
core/src/com/unciv/logic/battle/Battle.kt Outdated Show resolved Hide resolved
@yairm210 yairm210 merged commit c7fb6fb into yairm210:master Dec 25, 2024
4 checks passed
@SeventhM SeventhM deleted the stockpile-battle branch December 26, 2024 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants