ai
This commit is contained in:
parent
b6db7e8dc7
commit
d9b80b92ca
22 changed files with 563 additions and 62 deletions
|
|
@ -126,6 +126,9 @@ export class CharacterPhysical extends CharacterBase implements DynamicPhysical
|
|||
}
|
||||
|
||||
private initMovementBridge() {
|
||||
// The movementState object-literal getters/setters below can't use `this`
|
||||
// (it would bind to the literal), so alias the character instance.
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
const self = this;
|
||||
this.movementState = {
|
||||
head: this.head,
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ export class NPC extends PlayerBase {
|
|||
|
||||
const charge =
|
||||
distance > npcTuning.chargeRangeThreshold &&
|
||||
Random.getRandom() <
|
||||
Random.getRandom() <
|
||||
npcTuning.chargeBaseChance + npcTuning.chargeAggressionChance * this.aggression
|
||||
? Random.getRandomInRange(npcTuning.chargeMin, 1)
|
||||
: 0;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export abstract class PlayerBase extends CommandReceiver {
|
|||
protected findEmptyPositionForPlayer(preferredCenter: vec2): vec2 {
|
||||
let rotation = 0;
|
||||
let radius = 0;
|
||||
for (; ;) {
|
||||
for (;;) {
|
||||
const playerPosition = vec2.fromValues(
|
||||
radius * Math.cos(rotation) + preferredCenter.x,
|
||||
radius * Math.sin(rotation) + preferredCenter.y,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue