-
Notifications
You must be signed in to change notification settings - Fork 755
☢️ Nations send much better nukes now (Part 2) ☢️ #2779
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
Conversation
…vior` to `NationNukeBehavior` because it makes more sense. - `NationNukeBehavior`: Renamed `mg` to `game` (So its similar to the other nation .ts files) - 1 of 3 nations is now a hydro-nation. They cannot send atom bombs. They save up for hydros. This is to reduce atom-bomb-spam on the map.
…ost for nukes if they get heavily attacked. Reasoning: They should stop saving for MIRV, they should defend with all their gold!
…kes at places where another team member already has a nuke "in the flying process"
- Adjusted `maybeSendNuke()` to use 30 instead of 10 randomTiles on impossible difficulty to improve chances of finding a perfect SAM outranging spot
…y" if the crown has 50%+ of the map (Very big danger). Instead they are nuking the crown. - Added `isFriendly` check to `findStrongestTeamTarget()`
WalkthroughNuke targeting and timing moved from AiAttackBehavior into NationNukeBehavior. NationExecution now calls mirvBehavior.considerMIRV() earlier and invokes maybeSendNuke() with no target. NationNukeBehavior gained internal target selection, expanded validation, teammate-collision avoidance, recent-nuke tracking, and a hydro-nation preference. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant NationExecution
participant MirvBehavior
participant AiAttackBehavior
participant NationNukeBehavior
participant Game
Note right of NationExecution `#DDEBF7`: Tick start
NationExecution->>MirvBehavior: considerMIRV()
MirvBehavior-->>NationExecution: (decisions)
NationExecution->>AiAttackBehavior: maybeAttack()
AiAttackBehavior-->>NationExecution: (attack decision / incoming attacker)
NationExecution->>NationNukeBehavior: maybeSendNuke()
Note right of NationNukeBehavior `#F7E9D7`: internally:\nfindBestNukeTarget()\nvalidation, SAM checks,\nteammate-collision checks
NationNukeBehavior->>Game: assess config, units, distances
Game-->>NationNukeBehavior: game state info
alt valid nuke plan
NationNukeBehavior->>Game: addExecution(sendNuke)
Game-->>NationNukeBehavior: execution scheduled
else no valid target
NationNukeBehavior-->>NationExecution: no nuke
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks❌ Failed checks (3 inconclusive)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
evanpelle
left a comment
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.
thanks!
Description:
Refactor
findBestNukeTarget()(and child methods) fromAiAttackBehaviortoNationNukeBehaviorbecause it makes more sense.NationNukeBehavior: Renamedmgtogame(So its similar to the other nation .ts files)removeOldNukeEvents()method a bitNew features
lastNukeSenta bit (to respect nuke radius)maybeSendNuke()to use 30 instead of 10 randomTiles on impossible difficulty to improve chances of finding a perfect SAM outranging spotisFriendlycheck tofindStrongestTeamTarget()Media
SAM outranging:
2026-01-03.04-08-31.mp4
Team game nukes not hitting the same spot:
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
FloPinguin