public void Damaged(AttackActor actor) { Damaged(actor, (eCombatState state) => { if (state == eCombatState.DEAD) { ShapeDead(); GameManager.Get <GameManager.Turn>().Unsubscribe(this); } }); }
public void Damaged(AttackActor actor, ICombatCallback callback) { _hp -= actor.Damage; if (Hp < 0) { _combatState = eCombatState.DEAD; } if (callback != null) { callback(_combatState); } }
public float hitByTarget(AttackActor actor, float damages) { this.currentHealth = this.currentHealth - damages; this.currentHealth = this.currentHealth >= 0 ? this.currentHealth : 0; this.healthSlider.value = this.currentHealth; if (currentHealth <= 0) { this.isAlive = false; gameOver(); } Debug.Log("[HIT] Enemy hit player (Damage: " + damages + ")"); //TODO Add anims return(damages); }
public float hitByTarget(AttackActor actor, float damages) { Debug.Log("[HIT] Enemy receives damage (damage: " + damages + ")"); //TODO receive damage this.currentHealth = this.currentHealth - damages; this.currentHealth = this.currentHealth >= 0 ? this.currentHealth : 0; if (currentHealth <= 0) { this.isAlive = false; } Debug.Log("[HIT] Enemy hit player (Damage: " + damages + ", health: " + this.currentHealth + ")"); if (this.IsLowLife()) { this.SetState(MoleStateFactory.creaRunAway()); } if (this.IsAlive() == false) { Debug.Log("[DEAD] Enemy just die"); Destroy(this.gameObject, this.timeBeforeDeadRemoved); } //TODO Add anims return(damages); }
public void Damaged(AttackActor actor, ICombatCallback callback) { _impl.Damaged(actor, callback); Debug_DisplayStatus(); }
public MeleeHandAttackType(AttackActor o) { this.attackActor = o; }
public void Damaged(AttackActor actor, ICombatCallback callback) { _decoTarget.Damaged(actor, callback); }