public bool tick() { if (ToMoveTo != null) { CurrentTile.CurrentCharacter = null; CurrentTile.Walkable = true; ToMoveTo.CurrentCharacter = this; ToMoveTo = null; if (SpellReady) { ChooseSpell.refreshLocation(this); } return(true); } return(false); }
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); }
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); }
public void showChooseSpell() { ChooseSpell.refreshLocation(this); gameManager.addRangeToForm(ChooseSpell); SpellReady = true; }