mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-09-24 04:39:05 +00:00
Added health potion
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { BoxCollider2D, Color, Component, Material, randomRange, Sprite, Vec3, _decorator } from "cc";
|
||||
import { BoxCollider2D, Component, Material, randomRange, Sprite, Vec3, _decorator } from "cc";
|
||||
import { ISignal } from "../../../Services/EventSystem/ISignal";
|
||||
import { Signal } from "../../../Services/EventSystem/Signal";
|
||||
import { delay } from "../../../Services/Utils/AsyncUtils";
|
||||
@@ -28,6 +28,7 @@ export class Enemy extends Component {
|
||||
|
||||
private xpReward: number;
|
||||
private goldReward: number;
|
||||
private healthPotionRewardChance: number;
|
||||
|
||||
private endOfLifetimeTriggered = false;
|
||||
|
||||
@@ -42,6 +43,7 @@ export class Enemy extends Component {
|
||||
|
||||
this.xpReward = settings.xpReward;
|
||||
this.goldReward = settings.goldReward;
|
||||
this.healthPotionRewardChance = settings.healthPotionRewardChance;
|
||||
|
||||
this.node.setWorldPosition(position);
|
||||
this.node.active = true;
|
||||
@@ -82,6 +84,10 @@ export class Enemy extends Component {
|
||||
return this.goldReward;
|
||||
}
|
||||
|
||||
public get HealthPotionRewardChance(): number {
|
||||
return this.healthPotionRewardChance;
|
||||
}
|
||||
|
||||
public get LifetimeEndedEvent(): ISignal<Enemy> {
|
||||
return this.lifetimeEndedEvent;
|
||||
}
|
||||
|
Reference in New Issue
Block a user