Skip to content

Commit

Permalink
fix: xp and drop when npcs are dead
Browse files Browse the repository at this point in the history
  • Loading branch information
sdilauro committed Aug 30, 2024
1 parent ad540fc commit 71cd7b3
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scene/src/enemies/MonsterMob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export class MonsterMob extends GenericMonster {
Animator.playSingleAnimation(this.entity, this.impactClip)
if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
}
}

Expand All @@ -308,6 +309,7 @@ export class MonsterMob extends GenericMonster {

if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
return
}

Expand Down Expand Up @@ -357,6 +359,7 @@ export class MonsterMob extends GenericMonster {

if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
return
}

Expand Down
2 changes: 2 additions & 0 deletions scene/src/enemies/monster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export class MonsterOligar extends GenericMonster {
Animator.playSingleAnimation(this.entity, this.impactClip)
if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
}
}

Expand All @@ -324,6 +325,7 @@ export class MonsterOligar extends GenericMonster {

if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
return
}

Expand Down
2 changes: 2 additions & 0 deletions scene/src/enemies/monsterHealer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export class MonsterHealer extends GenericMonster {
Animator.playSingleAnimation(this.entity, this.impactClip)
if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
}
}

Expand All @@ -279,6 +280,7 @@ export class MonsterHealer extends GenericMonster {

if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
return
}

Expand Down
2 changes: 2 additions & 0 deletions scene/src/enemies/monsterMage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export class MonsterMage extends GenericMonster {
Animator.playSingleAnimation(this.entity, this.impactClip)
if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
}
}

Expand All @@ -268,6 +269,7 @@ export class MonsterMage extends GenericMonster {

if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
return
}

Expand Down
2 changes: 2 additions & 0 deletions scene/src/enemies/monsterMeat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export class MonsterMeat extends GenericMonster {
Animator.playSingleAnimation(this.entity, this.impactClip)
if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
}
}

Expand All @@ -300,6 +301,7 @@ export class MonsterMeat extends GenericMonster {

if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
return
}

Expand Down
2 changes: 2 additions & 0 deletions scene/src/enemies/monsterMobAuto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export class MonsterMobAuto extends GenericMonster {
Animator.playSingleAnimation(this.entity, this.impactClip)
if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
}
}

Expand All @@ -307,6 +308,7 @@ export class MonsterMobAuto extends GenericMonster {

if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
return
}

Expand Down
3 changes: 3 additions & 0 deletions scene/src/enemies/monsterPoison.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ export class MonsterPoison extends GenericMonster {
Animator.playSingleAnimation(this.entity, this.impactClip)
if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
}
}

Expand All @@ -264,6 +265,7 @@ export class MonsterPoison extends GenericMonster {

if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
return
}

Expand Down Expand Up @@ -307,6 +309,7 @@ export class MonsterPoison extends GenericMonster {

if (this.health <= 0) {
this.onDead()
pointerEventsSystem.removeOnPointerDown(this.entity)
return
}

Expand Down

0 comments on commit 71cd7b3

Please sign in to comment.