diff --git a/Assets/Sprites/monsters.png b/Assets/Sprites/monsters.png index 2f0e43b..1aea7c1 100644 --- a/Assets/Sprites/monsters.png +++ b/Assets/Sprites/monsters.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:deb114bb62d37632e853ef723f58d293e98271b3c2961931ebbb06ce017de687 -size 23824 +oid sha256:b6edd2fe10b0bd791027637cfc201cbcabcb9645ff3f21d8a6a2907bde8c8f8a +size 34075 diff --git a/Assets/Sprites/nutria.yaml b/Assets/Sprites/nutria.yaml index ae836b3..7d4e85d 100644 --- a/Assets/Sprites/nutria.yaml +++ b/Assets/Sprites/nutria.yaml @@ -100,3 +100,151 @@ animations: y: 10 origin_x: 0 origin_y: 0 + monster: + sets: + attack: + subsets: + north: + frames: + - x: 75 + y: 600 + width: 75 + height: 75 + - x: 150 + y: 600 + width: 75 + height: 75 + east: + frames: + - x: 75 + y: 825 + width: 75 + height: 75 + - x: 150 + y: 825 + width: 75 + height: 75 + west: + frames: + - x: 75 + y: 675 + width: 75 + height: 75 + - x: 150 + y: 675 + width: 75 + height: 75 + south: + frames: + - x: 75 + y: 750 + width: 75 + height: 75 + - x: 150 + y: 750 + width: 75 + height: 75 + run: + subsets: + north: + frames: + - x: 225 + y: 600 + width: 75 + height: 75 + - x: 300 + y: 600 + width: 75 + height: 75 + - x: 375 + y: 600 + width: 75 + height: 75 + - x: 450 + y: 600 + width: 75 + height: 75 + east: + frames: + - x: 225 + y: 825 + width: 75 + height: 75 + - x: 300 + y: 825 + width: 75 + height: 75 + - x: 375 + y: 825 + width: 75 + height: 75 + - x: 450 + y: 825 + width: 75 + height: 75 + west: + frames: + - x: 225 + y: 675 + width: 75 + height: 75 + - x: 300 + y: 675 + width: 75 + height: 75 + - x: 375 + y: 675 + width: 75 + height: 75 + - x: 450 + y: 675 + width: 75 + height: 75 + south: + frames: + - x: 225 + y: 750 + width: 75 + height: 75 + - x: 300 + y: 750 + width: 75 + height: 75 + - x: 375 + y: 750 + width: 75 + height: 75 + - x: 450 + y: 750 + width: 75 + height: 75 + stand: + subsets: + north: + frames: + - x: 0 + y: 600 + width: 75 + height: 75 + east: + frames: + - x: 0 + y: 825 + width: 75 + height: 75 + south: + frames: + - x: 0 + y: 750 + width: 75 + height: 75 + west: + frames: + - x: 0 + y: 675 + width: 75 + height: 75 + time: 180 + source: monsters.png + origin_x: 37 + origin_y: 48 diff --git a/Engine/src/live/AnimalEntity.ts b/Engine/src/live/AnimalEntity.ts index 9276915..becbf66 100644 --- a/Engine/src/live/AnimalEntity.ts +++ b/Engine/src/live/AnimalEntity.ts @@ -293,8 +293,10 @@ export class AnimalEntity extends Entity { turn() { this.isMonster = !this.isMonster if (this.isMonster) { - if (this.def.name !== 'deer' && this.def.name !== 'turkey') { - 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.def.name !== 'turkey' && this.def.name !== 'nutria') { + let keys = ['deer', 'turkey', 'nutria'] + let v = 1 + Math.floor(Math.random()*3) + this.sprite.setCtor(`${keys[v]}.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}`) }