示例#1
0
        private void DealDamage(BrainController brainController)
        {
            var        brainVariables = brainController.GetComponent <FightBrainVariables>();
            FightBrain fightBrain     = (FightBrain)brainController.currentBrain;
            var        avatarStats    = brainController.Stats;
            int        crit           = Random.value <= avatarStats.critChance ? 1 : 0;
            float      damage         = Random.Range(avatarStats.damage.x, avatarStats.damage.y) * (1 + crit * (avatarStats.critMultiplayer - 1));

            fightBrain.TakeDamage(brainVariables.currentEnemy, damage, crit == 1);
        }
示例#2
0
 internal void ChangeBrains(TurnIntoClass turnIntoTarget)
 {
     // TODO: Check current brain and switch it to new. (Current brain hotSwitch)
     if (turnIntoTarget.idleBrain != null)
     {
         idleBrain = turnIntoTarget.idleBrain;
     }
     if (turnIntoTarget.fightBrain != null)
     {
         fightBrain = turnIntoTarget.fightBrain;
     }
 }
示例#3
0
 internal void RestoreBrains()
 {
     // TODO: Check current brain and switch it to new. (Current brain hotSwitch)
     idleBrain  = oldIdleBrain;
     fightBrain = oldFightBrain;
 }
示例#4
0
 private void Start()
 {
     ChangeBrain(idleBrain);
     oldIdleBrain  = idleBrain;
     oldFightBrain = fightBrain;
 }