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.
|
||||
smelledTarget?: Entity
|
||||
seenTarget?: Entity
|
||||
killer?: AnimalEntity
|
||||
def: AnimalDefinition
|
||||
mode: CreatureDefinition
|
||||
desiredActions: Action[] = []
|
||||
|
@ -26,6 +27,7 @@ export class AnimalEntity extends Entity {
|
|||
dead: boolean = false
|
||||
shouldGib: boolean = false
|
||||
actionCooldown: number = 0
|
||||
kills: number = 0
|
||||
|
||||
constructor(def: AnimalDefinition) {
|
||||
super(`${def.name}.animal.stand.west.0`)
|
||||
|
@ -342,6 +344,8 @@ export class AnimalEntity extends Entity {
|
|||
if (Math.random() > 0.5) {
|
||||
this.yell(1)
|
||||
}
|
||||
entities[0].killer = this
|
||||
this.kills++
|
||||
} else {
|
||||
// growl if there are no targets.
|
||||
this.yell(1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user