Ejemplo n.º 1
0
    public virtual void Initialize(Entity source, SpecialAbilityData abilitydata, List <SpecialAbilityData> sequencedAbilities = null)
    {
        this.source      = source;
        this.abilitydata = abilitydata;
        SessionID        = IDFactory.GenerateAbilityID();
        SetUpAbility();

        if (sequencedAbilities != null && sequencedAbilities.Count > 0)
        {
            for (int i = 0; i < sequencedAbilities.Count; i++)
            {
                SpecialAbility sAbility = new SpecialAbility();
                this.sequencedAbilities.Add(sAbility);
                sAbility.ParentAbility = this;
                sAbility.Initialize(source, sequencedAbilities[i]);
                //Debug.Log(sequencedAbilities[i].abilityName + " is a sequence of " + abilitydata.abilityName);
            }

            sequenceTimer = new Timer(sequenceWindow, false, ResetSequenceIndex);
        }

        animationHash = Animator.StringToHash(animationTrigger);

        if (activationMethod == Constants.SpecialAbilityActivationMethod.Passive)
        {
            Activate();
        }
    }
Ejemplo n.º 2
0
    public virtual void Initialize(Entity source, SpecialAbilityData abilitydata, List <SpecialAbilityData> sequencedAbilities = null)
    {
        this.source      = source;
        this.abilitydata = abilitydata;

        SetUpAbility();

        if (sequencedAbilities != null && sequencedAbilities.Count > 0)
        {
            for (int i = 0; i < sequencedAbilities.Count; i++)
            {
                SpecialAbility sAbility = new SpecialAbility();
                this.sequencedAbilities.Add(sAbility);
                sAbility.ParentAbility = this;
                sAbility.Initialize(source, sequencedAbilities[i]);
            }

            sequenceTimer = new Timer("SequenceTimer", sequenceWindow, false, ResetSequenceIndex);
        }

        if (activationMethod == Constants.SpecialAbilityActivationMethod.Passive)
        {
            Activate();
        }
    }
Ejemplo n.º 3
0
    public void AddAbility(SpecialAbilityData abilityData, List <SpecialAbilityData> sequencedAbilities = null)
    {
        SpecialAbility newAbility = new SpecialAbility();

        newAbility.Initialize(source, abilityData, sequencedAbilities);


        abilities.AddUnique(newAbility);
    }
Ejemplo n.º 4
0
    public virtual void PopulateSpecialAblities(List <SpecialAbilityData> abilityData)
    {
        for (int i = 0; i < abilityData.Count; i++)
        {
            SpecialAbility newAbility = new SpecialAbility();

            newAbility.Initialize(source, abilityData[i], abilityData[i].sequencedAbilities);
            abilities.Add(newAbility);

            //Debug.Log("Adding " + newAbility.abilityName);
        }
    }