Prevent monsters from puddling; allow missing animals to beastmode
This commit is contained in:
parent
1dbcc8d238
commit
926165faf0
|
@ -61,7 +61,7 @@ export class AnimalEntity extends Entity {
|
||||||
this.lastYellElapsed += delta
|
this.lastYellElapsed += delta
|
||||||
|
|
||||||
let waterZones = this.zones.filter(v=>v.type==='fluid')
|
let waterZones = this.zones.filter(v=>v.type==='fluid')
|
||||||
if (waterZones.length) {
|
if (waterZones.length && !this.isMonster) {
|
||||||
this.puddleTimer += delta
|
this.puddleTimer += delta
|
||||||
if (this.puddleTimer >= 600) {
|
if (this.puddleTimer >= 600) {
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
|
@ -280,11 +280,18 @@ export class AnimalEntity extends Entity {
|
||||||
turn() {
|
turn() {
|
||||||
this.isMonster = !this.isMonster
|
this.isMonster = !this.isMonster
|
||||||
if (this.isMonster) {
|
if (this.isMonster) {
|
||||||
console.log(`${this.sprite.spriteKey}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
//if (this.def.name !== 'deer' && this.def.name !== 'turkey') {
|
||||||
this.sprite.setCtor(`${this.sprite.spriteKey}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
//this.sprite.setCtor(`${Math.random()>0.5?'deer':'turkey'}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
||||||
|
if (this.def.name !== 'deer') {
|
||||||
|
this.sprite.setCtor(`deer.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
||||||
|
} else {
|
||||||
|
this.sprite.setCtor(`${this.sprite.spriteKey}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(`${this.sprite.spriteKey}.animal.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
if (this.sprite.setKey === 'attack') {
|
||||||
this.sprite.setCtor(`${this.sprite.spriteKey}.animal.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
this.sprite.setKey = 'stand'
|
||||||
|
}
|
||||||
|
this.sprite.setCtor(`${this.def.name}.animal.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
attack(ctx: WorldContext) {
|
attack(ctx: WorldContext) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user