Skip to content

Commit ac2b6ff

Browse files
tweaks
1 parent c8b5539 commit ac2b6ff

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/Entity/Misc/Dominator.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
along with this program. If not, see <https://www.gnu.org/licenses/>
1717
*/
1818

19-
import { Color, ColorsHexCode, NameFlags, StyleFlags, Tank, ClientBound } from "../../Const/Enums";
19+
import { Color, ColorsHexCode, NameFlags, StyleFlags, EntityTags, Tank, ClientBound } from "../../Const/Enums";
2020
import ArenaEntity from "../../Native/Arena";
2121
import ClientCamera, { CameraEntity } from "../../Native/Camera";
22+
import { Entity } from "../../Native/Entity";
2223
import { AI, AIState, Inputs } from "../AI";
24+
import ObjectEntity from "../Object";
2325
import LivingEntity from "../Live";
2426
import Bullet from "../Tank/Projectile/Bullet";
2527
import TankBody from "../Tank/TankBody";
@@ -97,6 +99,14 @@ export default class Dominator extends TankBody {
9799
this.styleData.values.flags ^= StyleFlags.isFlashing;
98100
this.damageReduction = 1.0;
99101
}
102+
103+
this.entityTags |= EntityTags.isDominator;
104+
}
105+
106+
public static isDominator(entity: Entity | null | undefined): entity is Dominator {
107+
if (!ObjectEntity.isObject(entity)) return false;
108+
109+
return !!(entity.entityTags & EntityTags.isDominator);
100110
}
101111

102112
public onDeath(killer: LivingEntity) {

src/Entity/Misc/Mothership.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default class Mothership extends TankBody {
8989
this.game.broadcast()
9090
.u8(ClientBound.Notification)
9191
// If mothership has a team name, use it, otherwise just say has destroyed a mothership
92-
.stringNT(`${killerTeamIsATeam ? killerTeam.teamName : (killer.nameData?.values.name || "an unnamed tank")} has destroyed ${teamIsATeam ? team.teamName + "'s" : "a"} Mothership!`)
92+
.stringNT(`${killerTeamIsATeam ? (killerTeam.teamName || "a mysterious group") : (killer.nameData?.values.name || "an unnamed tank")} has destroyed ${teamIsATeam ? team.teamName + "'s" : "a"} Mothership!`)
9393
.u32(killerTeamIsATeam ? ColorsHexCode[killerTeam.teamData.values.teamColor] : 0x000000)
9494
.float(-1)
9595
.stringNT("").send();

src/Entity/Misc/TeamEntity.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const ColorsTeamName: { [K in Color]?: string } = {
3737
[Color.EnemyTriangle]: "TRIANGLE",
3838
[Color.EnemyPentagon]: "PENTAGON",
3939
[Color.EnemyCrasher]: "CRASHER",
40-
[Color.Neutral]: "a mysterious group",
40+
[Color.Neutral]: "NEUTRAL",
4141
[Color.ScoreboardBar]: "SCOREBOARD",
4242
[Color.Box]: "MAZE",
4343
[Color.EnemyTank]: "ENEMY",
@@ -62,6 +62,6 @@ export class TeamEntity extends Entity implements TeamGroupEntity {
6262
public static isTeam(entity: Entity | null | undefined): entity is TeamEntity {
6363
if (!entity) return false;
6464

65-
return !!entity.teamData
65+
return !!entity.teamData;
6666
}
6767
}

0 commit comments

Comments
 (0)