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

Feature/misc improvements #460

Merged
merged 5 commits into from
Jul 9, 2024
Merged

Feature/misc improvements #460

merged 5 commits into from
Jul 9, 2024

Conversation

tonihele
Copy link
Owner

@tonihele tonihele commented Jul 8, 2024

  • Imps drop the excess gold when digging at their feet if there is no place to store it currently. Prevents imps from coming millionaires
  • Creature fleeing is a bit nicer now, always annoyed me the they could not decide what to do, now at least they are a bit more decisive and stay fleeing a minimum time

@tonihele
Copy link
Owner Author

tonihele commented Jul 8, 2024

I don't actually have now the original game at hand (Linux...) so I can't check whether the gold clumped up to bigger piles (the max pile size) on the same tiles or just like this. A lot of small clumps. This has an actual effect on the game as the imp tasks are not grouped. The smaller the piles, the less effective your imps are collecting it...


// Drop excess gold, we can only carry so much
boolean hasMaxGold = gold.maxGold > 0;
int maxGoldCanAdd = hasMaxGold ? gold.maxGold - gold.gold : Integer.MAX_VALUE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why isn't MAX_VALUE used to designate no limit in the first place?

Copy link
Owner Author

Choose a reason for hiding this comment

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

That is a question I ask myself every night I go to sleep... :D Yeah, I'll change it. The logic is still a bit iffy here anyway, I didn't even check that do normal creatures have a max value they can carry? Essentially dropping all bribes and pay they are given if they didn't have a chance to blow it all in the rigged casino...

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ok, I checked. Creatures always have some max gold set, everybody. 0 is not used to indicate max gold. That was my half assed assumption. So removed all assumptions from here.

Also normal creatures do have max gold. I guess it makes sense in the real world. But I don't know how the normal creatures deal with their possessions...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah makes sense that they can't have more money than they can carry. But I guess it'd reduce their happiness if they basically have to throw it away.

@tonihele tonihele merged commit 4751e51 into master Jul 9, 2024
2 of 3 checks passed
@tonihele tonihele deleted the feature/misc-improvements branch July 9, 2024 10:50
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