mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-08 22:43:33 +00:00
Bomb Direction (#2435)
Resolves #2434 ## Description: Allows bomb direction to be inverted by pressing a hotkey - currently "U". **Check the issue for screenshots / videos.** ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: w.o.n --------- Co-authored-by: Evan <evanpelle@gmail.com> Co-authored-by: iamlewis <lewismmmm@gmail.com>
This commit is contained in:
@@ -21,6 +21,7 @@ export class ConstructionExecution implements Execution {
|
||||
private player: Player,
|
||||
private constructionType: UnitType,
|
||||
private tile: TileRef,
|
||||
private rocketDirectionUp?: boolean,
|
||||
) {}
|
||||
|
||||
init(mg: Game, ticks: number): void {
|
||||
@@ -104,7 +105,15 @@ export class ConstructionExecution implements Execution {
|
||||
case UnitType.AtomBomb:
|
||||
case UnitType.HydrogenBomb:
|
||||
this.mg.addExecution(
|
||||
new NukeExecution(this.constructionType, player, this.tile),
|
||||
new NukeExecution(
|
||||
this.constructionType,
|
||||
player,
|
||||
this.tile,
|
||||
null,
|
||||
-1,
|
||||
0,
|
||||
this.rocketDirectionUp,
|
||||
),
|
||||
);
|
||||
break;
|
||||
case UnitType.MIRV:
|
||||
|
||||
@@ -106,7 +106,12 @@ export class Executor {
|
||||
case "embargo_all":
|
||||
return new EmbargoAllExecution(player, intent.action);
|
||||
case "build_unit":
|
||||
return new ConstructionExecution(player, intent.unit, intent.tile);
|
||||
return new ConstructionExecution(
|
||||
player,
|
||||
intent.unit,
|
||||
intent.tile,
|
||||
intent.rocketDirectionUp,
|
||||
);
|
||||
case "allianceExtension": {
|
||||
return new AllianceExtensionExecution(player, intent.recipient);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ export class NukeExecution implements Execution {
|
||||
private src?: TileRef | null,
|
||||
private speed: number = -1,
|
||||
private waitTicks = 0,
|
||||
private rocketDirectionUp: boolean = true,
|
||||
) {}
|
||||
|
||||
init(mg: Game, ticks: number): void {
|
||||
@@ -137,6 +138,7 @@ export class NukeExecution implements Execution {
|
||||
this.dst,
|
||||
this.speed,
|
||||
this.nukeType !== UnitType.MIRVWarhead,
|
||||
this.rocketDirectionUp,
|
||||
);
|
||||
this.nuke = this.player.buildUnit(this.nukeType, spawn, {
|
||||
targetTile: this.dst,
|
||||
|
||||
Reference in New Issue
Block a user