Example #1
0
        public Character(Grid grid,
                         Tile currentTile,
                         Teams team,
                         CharacterType[] characterType,
                         GameManager gameManager,
                         GameNetworkManager gameNetworkManager)
        {
            this.grid = grid;
            currentTile.CurrentCharacter = this;
            this.team               = team;
            SpellReady              = false;
            this.characterType      = characterType;
            this.gameManager        = gameManager;
            this.gameNetworkManager = gameNetworkManager;
            ChooseSpell             = new ChooseSpell(this, ActiveSpells, gameNetworkManager);
            InactiveSpell           = new InactiveSpell(this, InactiveSpells, gameNetworkManager);

            Stats          = CharacterType.statsCopy();
            ActiveSpells   = new List <Spells[]>();
            InactiveSpells = new List <Spells[]>();
            LearnedSpells  = new List <Spells[]>();
            SpellLevel     = new Dictionary <Spells[], int>();
            brush          = (team == Teams.Blue) ? Brushes.BlueViolet : Brushes.Red;
            isBlue         = (team == Teams.Blue);
            statusEffects  = new List <StatusEffect>();

            IsDead = false;

            statsMultiplier = new Dictionary <StatusType, float>();
            statsAdder      = new Dictionary <StatusType, int>();
            foreach (StatusType statusType in Enum.GetValues(typeof(StatusType)))
            {
                statsAdder.Add(statusType, 0);
                statsMultiplier.Add(statusType, 1f);
            }

            hpBar = new StatBar(this,
                                team == Teams.Blue ? Brushes.GreenYellow : Brushes.OrangeRed, 0);
            charageBar = new StatBar(this, Brushes.Blue, 1);
        }
Example #2
0
 public bool updateBuy()
 {
     if (!spellsUIVisibleBuy && this.CurrentTile == gameManager.SelectedTile && LearnedSpells.Count != 0)
     {
         ChooseSpell.refreshPanel(this, ActiveSpells);
         InactiveSpell.refreshPanel(InactiveSpells);
         gameManager.addRangeToForm(ChooseSpell);
         if (team == Teams.Blue)
         {
             gameManager.addRangeToForm(InactiveSpell);
         }
         spellsUIVisibleBuy = true;
         return(true);
     }
     else if (this.CurrentTile != gameManager.SelectedTile)
     {
         gameManager.removeRangeFromForm(InactiveSpell, ChooseSpell);
         spellsUIVisibleBuy = false;
         return(true);
     }
     return(false);
 }