Ejemplo n.º 1
0
    public void Initialize(Unit unit)
    {
        Id = Guid.NewGuid();
        isPlayerControlled = unit.IsHumanPlayer;

        if (unit.IsHumanPlayer)
        {
            StatHelper.InitializePlayerStats(stats);
        }
        else
        {
            StatHelper.InitializeCreatureStats(stats);
        }

        StatHelper.InitializeSpeedRates(speedRates);

        SpellHistory = new SpellHistory();

        GlobalCooldown = new Cooldown(1);
        SpellCast      = new SpellCast();

        Buffs  = new Buffs(unit);
        Spells = new SpellStorage();

        PreviousTargets = new List <Guid>();
        PeriodicEffects = new List <PeriodicEffectAura>();
        AbsorbEffects   = new List <AbsorbEffect>();
        CharacterEvents = new Dictionary <int, List <SpellScriptAura> >();
        for (int i = 0; i < CharacterEventTypes.Count; i++)
        {
            CharacterEvents.Add(i, new List <SpellScriptAura>());
        }
    }
Ejemplo n.º 2
0
    public void Dispose()
    {
        target = null;

        health       = null;
        mainResourse = null;
        parameters   = null;
        states       = null;

        GlobalCooldown.Dispose();
        GlobalCooldown = null;

        SpellCast.Dispose();
        SpellCast = null;

        Buffs.Dispose();
        Buffs = null;

        Spells.Dispose();
        Spells = null;

        AbsorbEffects.Clear();
        AbsorbEffects = null;

        PeriodicEffects.Clear();
        PeriodicEffects = null;

        PreviousTargets.Clear();
        PreviousTargets = null;

        for (int i = 0; i < CharacterEventTypes.Count; i++)
        {
            CharacterEvents[i].Clear();
        }

        CharacterEvents.Clear();
        CharacterEvents = null;
    }
Ejemplo n.º 3
0
 /// <summary>
 ///  Defines some default values on the start of the game
 /// </summary>
 void Start()
 {
     this.spells = this.GetComponent <SpellStorage>();
     this.state  = MagicSystemState.ElementSelection;
     this.castIndicator.gameObject.SetActive(false);
 }