Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/core/execution/SAMLauncherExecution.ts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I thought we were planning on making mirv warheads have the same logic as regular nukes anyways?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It wasn't working, unless do you mean that we change there movement speed? (I would advise not unless we want them to be launched directly from the silo)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yeah we can change their movement stpeed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if we change the movement speed then we need to have the MIRV warheads launch directly from the silo

Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ export class SAMLauncherExecution implements Execution {
// As MIRV go very fast we have to detect them very early but we only
// shoot the one targeting very close (MIRVWarheadProtectionRadius)
private MIRVWarheadSearchRadius = 400;
private MIRVWarheadProtectionRadius = 50;
private targetingSystem: SAMTargetingSystem;

private pseudoRandom: PseudoRandom | undefined;
Expand Down Expand Up @@ -295,11 +294,10 @@ export class SAMLauncherExecution implements Execution {
this.sam !== null &&
dst !== undefined &&
this.mg.manhattanDist(dst, this.sam.tile()) <
this.MIRVWarheadProtectionRadius
this.mg.config().samRange(this.sam.level())
);
},
);

let target: Target | null = null;
if (mirvWarheadTargets.length === 0) {
target = this.targetingSystem.getSingleTarget(ticks);
Expand All @@ -325,7 +323,14 @@ export class SAMLauncherExecution implements Execution {
{ count: mirvWarheadTargets.length },
);

mirvWarheadTargets.forEach(({ unit: u }) => {
mirvWarheadTargets.forEach(({ unit: u }, i) => {
if (this.sam !== null && i > 0) {
if (this.sam.isInCooldown()) {
return;
}
this.sam.launch();
}

// Delete warheads
u.delete();
});
Expand Down
Loading