Esempio n. 1
0
 public void DamageEntity()
 {
     EntitySelector.GetSelectedEntity().GetComponent <BattleEntity>().Damage(hitpts);
     BattleManager.battleState = BattleManager.BattleState.EntityTurn; // Need to call StartBattle();
     BattleManager.GetScript().StartBattle();
     Destroy(transform.parent.gameObject);
 }
Esempio n. 2
0
    public void DamageEntity()
    {
        var chancesToHit         = 4;                                                             // this is the amount of chances spawned by AttackBox.cs
        var realHitPts           = ((float)hitpts / (float)chancesToHit) * Player.GetAttackDmg(); // multiply so we can change the amount of dmg
        var selectedBattleEntity = EntitySelector.GetSelectedEntity().GetComponent <BattleEntity>();

        selectedBattleEntity.StartCoroutine(DamageEntityPeriod(1f, selectedBattleEntity, realHitPts));

        var attBox = transform.parent.GetComponent <AttackBox>();

        attBox.DestroyAreas();
        DestroyFeedbackItems();
        Destroy(attBox.gameObject);
        Destroy(gameObject);
    }