Example #1
0
    public static IPlayerState GetDamage(List <DamageClass> damages, GameObject objCharacter)
    {
        CharacterStats character = null;

        if (objCharacter.GetComponent <HolderDataEnemy>())
        {
            character = objCharacter.GetComponent <HolderDataEnemy>().Ai.currentStats;
        }
        if (objCharacter.GetComponent <HolderDataCharacter>())
        {
            character = objCharacter.GetComponent <HolderDataCharacter>().character.currentStats;
        }

        Debug.Log("Battle: HIT!");
        foreach (var damage in damages)
        {
            damage.Damage = character.ReduceDmg(damage.Damage, damage.Element);
            character.lifeStats.TakeDmg(damage.Damage);
            Debug.Log("Damage: " + damage.Damage + " " + damage.Element);
        }
        if (character.lifeStats.HealthStatus == HealthStatus.Dead)
        {
            MissionController.DeadChara(objCharacter);
        }
        return(new IPS_Move());
    }
 void CheckCharacterStatus(GameObject obj)
 {
     if (CheckDead(obj))
     {
         MissionController.Index = MissionController.Characters.FindIndex(x => x == MissionController.currentCharacter);
         MissionController.DeadChara(obj);
     }
     else
     {
         obj.GetComponent <NavMeshObstacle>().enabled = true;
         MissionController.Index = MissionController.Characters.FindIndex(x => x == MissionController.currentCharacter);
         MissionController.Index++;
     }
 }