Chest and magnet spawning

This commit is contained in:
Martin
2022-12-23 09:52:26 +01:00
parent 4b2d35a733
commit afc9448826
9 changed files with 119 additions and 125 deletions

View File

@@ -29,6 +29,8 @@ export class Enemy extends Component {
private xpReward: number;
private goldReward: number;
private healthPotionRewardChance: number;
private magnetRewardChance: number;
private chestRewardChance: number;
private endOfLifetimeTriggered = false;
@@ -44,6 +46,8 @@ export class Enemy extends Component {
this.xpReward = settings.xpReward;
this.goldReward = settings.goldReward;
this.healthPotionRewardChance = settings.healthPotionRewardChance;
this.magnetRewardChance = settings.magnetRewardChance;
this.chestRewardChance = settings.chestRewardChance;
this.node.setWorldPosition(position);
this.node.active = true;
@@ -88,6 +92,14 @@ export class Enemy extends Component {
return this.healthPotionRewardChance;
}
public get MagnetRewardChance(): number {
return this.magnetRewardChance;
}
public get ChestRewardChance(): number {
return this.chestRewardChance;
}
public get LifetimeEndedEvent(): ISignal<Enemy> {
return this.lifetimeEndedEvent;
}