phase 12 koncxana
This commit is contained in:
@@ -51,6 +51,11 @@ class NPC {
|
||||
this.moveSpeed = type.includes('chicken') ? 120 : 60; // Chickens faster than cows
|
||||
this.gridMoveTime = type.includes('chicken') ? 250 : 500;
|
||||
this.passive = true; // NEW FLAG
|
||||
|
||||
if (type.includes('cow')) {
|
||||
this.milkReady = true; // Starts milkable
|
||||
this.milkCooldown = 0;
|
||||
}
|
||||
} else {
|
||||
this.hp = 20;
|
||||
this.maxHp = 20;
|
||||
@@ -244,6 +249,18 @@ class NPC {
|
||||
return;
|
||||
}
|
||||
|
||||
// 3.1 Livestock Production Logic
|
||||
if (this.type.includes('cow') && !this.milkReady) {
|
||||
this.milkCooldown -= delta;
|
||||
if (this.milkCooldown <= 0) {
|
||||
this.milkReady = true;
|
||||
// Optional: Visual indicator (milk particle?)
|
||||
if (this.scene.events) this.scene.events.emit('show-floating-text', {
|
||||
x: this.sprite.x, y: this.sprite.y - 40, text: '!', color: '#FFFFFF'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 3. AI Logic
|
||||
if (this.type !== 'merchant' && this.state !== 'TAMED' && this.state !== 'FOLLOW' && !this.passive) {
|
||||
this.handleAggressiveAI(delta);
|
||||
|
||||
Reference in New Issue
Block a user