Add relations, NPCs attack enemies using relation, NPCs attack targeted players

This commit is contained in:
Evan
2024-12-27 16:53:56 -08:00
parent cb75f6780c
commit ac1d0c0378
13 changed files with 133 additions and 41 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
import {Execution, MutableGame, MutablePlayer, PlayerID} from "../game/Game";
import { Execution, MutableGame, MutablePlayer, PlayerID } from "../game/Game";
export class TargetPlayerExecution implements Execution {
@@ -18,6 +18,7 @@ export class TargetPlayerExecution implements Execution {
tick(ticks: number): void {
if (this.requestor.canTarget(this.target)) {
this.requestor.target(this.target)
this.target.updateRelation(this.requestor, -5000)
}
this.active = false
}