// Use this for initialization

    /**
     * Register the states that are managed by each individual script in start.
     */

    void Awake()
    {
        statesManager  = GetComponentInParent <CharacterStatesManager>();
        healthState    = new CharacterState(ConstantStrings.CURRENT_HEALTH, initCurrentHealth);
        maxHealthState = new CharacterState(ConstantStrings.MAX_HEALTH, initMaxHealth);

        statesManager.RegisterCharacterState(healthState.name, healthState);
        statesManager.RegisterCharacterState(maxHealthState.name, maxHealthState);
    }
Ejemplo n.º 2
0
 void Awake()
 {
     stateManager         = GetComponentInParent <CharacterStatesManager>();
     meleeAttackCastState = new CharacterState(ConstantStrings.Enemy.HammerBoss.MELEE_ATTACK_CAST_STATE, false);
     stateManager.RegisterCharacterState(ConstantStrings.Enemy.HammerBoss.MELEE_ATTACK_CAST_STATE, meleeAttackCastState);
     hammerThrowCastState = new CharacterState(ConstantStrings.Enemy.HammerBoss.HAMMER_THROW_CAST_STATE, false);
     stateManager.RegisterCharacterState(ConstantStrings.Enemy.HammerBoss.HAMMER_THROW_CAST_STATE, hammerThrowCastState);
     jumpState = new CharacterState(ConstantStrings.Enemy.HammerBoss.JUMP_STATE, false);
     stateManager.RegisterCharacterState(ConstantStrings.Enemy.HammerBoss.JUMP_STATE, jumpState);
     busyState = new CharacterState(ConstantStrings.Enemy.HammerBoss.BUSY_STATE, false);
     stateManager.RegisterCharacterState(ConstantStrings.Enemy.HammerBoss.BUSY_STATE, jumpState);
 }
Ejemplo n.º 3
0
 void Awake()
 {
     statesManager = GetComponentInParent <CharacterStatesManager>();
     hammerThrown  = new CharacterState(ConstantStrings.Enemy.HammerBoss.HAMMER_THROWN, false);
     statesManager.RegisterCharacterState(hammerThrown.name, hammerThrown);
     hammerHitsGround = new CharacterState(ConstantStrings.Enemy.HammerBoss.HAMMER_HITS_GROUND, false);
     statesManager.RegisterCharacterState(hammerHitsGround.name, hammerHitsGround);
     thrownHammerPosition = statesManager.GetExistingCharacterState(ConstantStrings.Enemy.HammerBoss.THROWN_HAMMER_POSITION);
     hammerHitPlayer      = new CharacterState(ConstantStrings.Enemy.HammerBoss.HAMMER_HIT_PLAYER, false);
     statesManager.RegisterCharacterState(hammerHitPlayer.name, hammerHitPlayer);
     hammerHitEnemy = new CharacterState(ConstantStrings.Enemy.HammerBoss.HAMMER_HIT_ENEMY, false);
     statesManager.RegisterCharacterState(hammerHitEnemy.name, hammerHitEnemy);
 }
    void Awake()
    {
        statesManager = GetComponentInParent <CharacterStatesManager>();
        hitEnemyState = new CharacterState(ConstantStrings.HIT_ENEMY, false);

        statesManager.RegisterCharacterState(hitEnemyState.name, hitEnemyState);
    }
    void Awake()
    {
        statesManager = GetComponentInParent <CharacterStatesManager>();
        hitState      = new CharacterState(ConstantStrings.HIT_STATE, hit);

        statesManager.RegisterCharacterState(hitState.name, hitState);
    }
    // Use this for initialization
    void Awake()
    {
        statesManager = GetComponentInParent <CharacterStatesManager>();
        deathState    = new CharacterState(ConstantStrings.DEATH_STATE, dead);

        statesManager.RegisterCharacterState(deathState.name, deathState);
    }
    private void GetAllAbilityTimers()
    {
        lightAttackCooldownTime    = lightAttack.GetComponent <SpellStats>().GetCooldownTime();
        heavyAttackCooldownTime    = heavyAttack.GetComponent <SpellStats>().GetCooldownTime();
        utilityAbilityCooldownTime = utilityAbility.GetComponent <SpellStats>().GetCooldownTime();

        if (lightAttackCooldownState == null)
        {
            lightAttackCooldownState = new CharacterState(
                ConstantStrings.LIGHT_ATTACK_COOLDOWN,
                new float[] { lightAttackCooldownTime, 0 });
            statesManager.RegisterCharacterState(lightAttackCooldownState.name,
                                                 lightAttackCooldownState);

            heavyAttackCooldownState = new CharacterState(
                ConstantStrings.HEAVY_ATTACK_COOLDOWN,
                new float[] { lightAttackCooldownTime, 0 });
            statesManager.RegisterCharacterState(heavyAttackCooldownState.name,
                                                 heavyAttackCooldownState);

            utilityAbilityCooldownState = new CharacterState(
                ConstantStrings.UTILITY_COOLDOWN,
                new float[] { lightAttackCooldownTime, 0 });
            statesManager.RegisterCharacterState(utilityAbilityCooldownState.name,
                                                 utilityAbilityCooldownState);
        }
        else
        {
            lightAttackCooldownState.SetState(
                new float[] { lightAttackCooldownTime, 0 });
            heavyAttackCooldownState.SetState(
                new float[] { heavyAttackCooldownTime, 0 });
            utilityAbilityCooldownState.SetState(
                new float[] { utilityAbilityCooldownTime, 0 });
        }



        //lightAttackCooldown =
        //	new double[]{lightAttack.GetComponent<SpellStats> ().GetCooldownTime (), 0};
        //heavyAttackCooldown =
        //	new double[]{heavyAttack.GetComponent<SpellStats> ().GetCooldownTime (), 0};
        //utilityAbilityCooldown =
        //new double[]{utilityAbility.GetComponent<SpellStats> ().GetCooldownTime (), 0};
    }
 // Use this for initialization
 void Start()
 {
     statesManager = GetComponent <CharacterStatesManager>();
     timeScale     = new CharacterState(ConstantStrings.TIME_SCALE, (float)1);
     statesManager.RegisterCharacterState(timeScale.name, timeScale);
 }