Skip to content

Conversation

@ikiris
Copy link

@ikiris ikiris commented Jun 4, 2020

Pull request summary

Code I'm running modified to handle nuke responses "better".

Description:

Nuke Responses already handle multiple nukes, so consolidate. Also don't just true up fortifications from highest to lowest priority as they could be woefully behind. First upgrade them to minimum survival value + critical barrier value, then fortify them as a subset using the normal proportional rules.

This was a pretty quick throw together, so I expect there will be things to clean up.

Testing checklist:

  • Changes are backward-compatible OR version migration code is included
  • Codebase compiles with current tsconfig configuration
  • Tested changes on PUBLIC server OR changes are trivial (e.g. typos)

ikiris added 2 commits June 3, 2020 18:56
…hen balance fortifications instead of full true up of barriers in order of priority which could be a massive jump if behind
Copy link
Collaborator

@MatthewARoy MatthewARoy left a comment

Choose a reason for hiding this comment

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

The current behavior fortifies critical structures (spawn, storage) that would be destroyed until they are protected, then worries about all the other ramparts. Is this behavior maintained?

@ikiris
Copy link
Author

ikiris commented Jun 4, 2020

Yes. The difference is before if the current level of fort is 2m and expected to be 20m, and a nuke lands:

prior) each priority structure will be brought up to the full expected 20m + nuke hits level before moving on to the next one, even if there are multiple priority structures
this patch) each priority structure will be brought up to the expected damage of nuke hits + critical minimum from settings similar to before, then the priority structures as a group will all be raised together in lock step until they cap out.

the main difference is this prevents only raising one structure far beyond the rest when there are still priority structures that will die to the nuke and could be saved as well.


private lowBarriers(fortifyStructures = this.fortifyBarriers,
hitsCallback: hitsCallback
= function(structure: StructureWall|StructureRampart): number {return structure.hits;}
Copy link
Contributor

Choose a reason for hiding this comment

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

The default is always used, so why have it be a callback?

@tiennou tiennou mentioned this pull request Feb 2, 2024
3 tasks
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.

3 participants