Record killers and kills
This commit is contained in:
parent
eab77f3e6c
commit
b3ddddd4b2
|
@ -17,6 +17,7 @@ export class AnimalEntity extends Entity {
|
||||||
nextWander: number = 100 // Time to next wander.
|
nextWander: number = 100 // Time to next wander.
|
||||||
smelledTarget?: Entity
|
smelledTarget?: Entity
|
||||||
seenTarget?: Entity
|
seenTarget?: Entity
|
||||||
|
killer?: AnimalEntity
|
||||||
def: AnimalDefinition
|
def: AnimalDefinition
|
||||||
mode: CreatureDefinition
|
mode: CreatureDefinition
|
||||||
desiredActions: Action[] = []
|
desiredActions: Action[] = []
|
||||||
|
@ -26,6 +27,7 @@ export class AnimalEntity extends Entity {
|
||||||
dead: boolean = false
|
dead: boolean = false
|
||||||
shouldGib: boolean = false
|
shouldGib: boolean = false
|
||||||
actionCooldown: number = 0
|
actionCooldown: number = 0
|
||||||
|
kills: number = 0
|
||||||
|
|
||||||
constructor(def: AnimalDefinition) {
|
constructor(def: AnimalDefinition) {
|
||||||
super(`${def.name}.animal.stand.west.0`)
|
super(`${def.name}.animal.stand.west.0`)
|
||||||
|
@ -342,6 +344,8 @@ export class AnimalEntity extends Entity {
|
||||||
if (Math.random() > 0.5) {
|
if (Math.random() > 0.5) {
|
||||||
this.yell(1)
|
this.yell(1)
|
||||||
}
|
}
|
||||||
|
entities[0].killer = this
|
||||||
|
this.kills++
|
||||||
} else {
|
} else {
|
||||||
// growl if there are no targets.
|
// growl if there are no targets.
|
||||||
this.yell(1)
|
this.yell(1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user