fix(nukewars): Refine bot behavior and fix prep timer visibility

This commit addresses further issues and clarifications for the Nuke Wars game mode.

Key fixes include:
- Bot Behavior in Nuke Wars: Modified `FakeHumanExecution.ts` to ensure bots in Nuke Wars can target and launch nuclear weapons against other bots, treating Nuke Wars consistently as a 2-team game. This resolves the previous ambiguity regarding bot interactions in this game mode.
- Preparation Timer Visibility: Fixed the "NukeWarsPrepTimer not found" console error by ensuring the `NukeWarsPrepTimer` custom element is correctly imported and defined in `src/client/Main.ts` before it is queried by `GameRenderer.ts`. This should make the preparation timer visible at the top of the screen.
This commit is contained in:
Restart2008
2025-10-25 15:55:16 -07:00
parent 2ec999f67c
commit dca9c8152b
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -42,8 +42,9 @@ import "./components/NewsButton";
import { NewsButton } from "./components/NewsButton";
import "./components/baseComponents/Button";
import "./components/baseComponents/Modal";
import "./graphics/layers/NukeWarsPrepTimer";
import "./graphics/layers/PlayerInfoOverlay";
import { getUserMe, isLoggedIn } from "./jwt";
import "./styles.css";
declare global {
interface Window {
+3 -1
View File
@@ -2,6 +2,7 @@ import {
Cell,
Execution,
Game,
GameMode,
Gold,
Nation,
Player,
@@ -262,7 +263,8 @@ export class FakeHumanExecution implements Execution {
if (
silos.length === 0 ||
this.player.gold() < this.cost(UnitType.AtomBomb) ||
other.type() === PlayerType.Bot ||
(this.mg.config().gameConfig().gameMode !== GameMode.NukeWars &&
other.type() === PlayerType.Bot) ||
this.player.isOnSameTeam(other)
) {
return;
+1 -1
View File
@@ -133,7 +133,7 @@
gtag("config", "G-WQGQQ8RDN4");
</script>
<script defer src="/js/runtime.34d8e1fc7a6b79e35718.js"></script><script defer src="/js/vendors.c93599253f4f666279b3.js"></script><script defer src="/js/main.274f9a2f6881da69bee2.js"></script></head>
<script defer src="/js/runtime.e6f022c53e20e3169585.js"></script><script defer src="/js/vendors.e04cb399edf9923e1de2.js"></script><script defer src="/js/main.ae1d30f76c2b6734008c.js"></script></head>
<body
class="h-full select-none font-sans min-h-screen bg-opacity-0 bg-cover bg-center bg-fixed transition-opacity duration-300 ease-in-out flex flex-col"