public void ChangeState(CharacterEffectiveState newState)
 {
     currentState = newState;
     currentState.ApplyStateEffect(this);
     if (GameState.Instance.CurrentState == GameState.GameStates.combat)
     {
         controller.combatController.ChangePlayerState();
     }
 }
 public void ReturnToNormalState()
 {
     currentState = defaultState;
     timePassed   = 0;
     if (GameState.Instance.CurrentState == GameState.GameStates.combat)
     {
         controller.combatController.ChangePlayerState();
     }
 }
    /// <summary>
    /// Inicializa las variables del jugador, entre otras características.
    /// </summary>
    public void Initialize()
    {
        isTurn            = false;
        experiencePoints  = 0;
        currentHealth     = maxHealth;
        currentTurn       = maxTurn;
        currentWill       = maxWill;
        currentVisibility = defaultVisibility;
        currentState      = defaultState;
        defaultState.ApplyStateEffect(this);

        characteristics.InitializeCharacteristics();
        characteristics.other.InitializeOthers();

        if (characteristics.playerRace != null)
        {
            characteristics.playerRace.ActivatePassiveHability(this);
        }

        StartCoroutine(ChargeLife());
    }
Beispiel #4
0
    /// <summary>
    /// Inicializa al enemigo para el combate.
    /// </summary>
    /// <param name="controller"></param>
    public void StartCombat(CombatController controller)
    {
        combatController = controller;
        isTurn           = false;

        maxHealth           = myTemplate.MaxHealth;
        maxTurn             = myTemplate.MaxTurn;
        currentDexterity    = myTemplate.defaultDexterity;
        currentIntelligence = myTemplate.defaultIntelligence;
        currentResistance   = myTemplate.defaultResistance;
        currentStrength     = myTemplate.defaultStrength;

        myTemplate.currentVisibility = myTemplate.defaultVisibility;

        currentTurnRegenPerSecond     = myTemplate.DefaultTurnRegenPerSecond;
        currentHealthRegenPerSecond   = myTemplate.DefaultHealthRegenPerSecond;
        currentCriticalHitProbability = myTemplate.DefaultCriticalHitProbability;
        currentEvasion           = myTemplate.DefaultEvasion;
        currentCooldownReduction = myTemplate.DefaultCooldownReduction;
        currentHealth            = myTemplate.MaxHealth;

        currentTurn  = 0;
        currentState = myTemplate.defaultState;
    }
Beispiel #5
0
 /// <summary>
 /// Devuelve el CharacterEffectiveState del enemigo a su default.
 /// </summary>
 public void ReturnToNormalState()
 {
     currentState = myTemplate.defaultState;
     timePassed   = 0;
     combatController.ChangeEnemyState();
 }
Beispiel #6
0
 /// <summary>
 /// Cambia el CharacterEffectiveState actual a uno dado.
 /// </summary>
 /// <param name="newState"></param>
 public void ChangeState(CharacterEffectiveState newState)
 {
     currentState = newState;
     currentState.ApplyStateEffect(this);
     combatController.ChangeEnemyState();
 }