public void MovePlayer(int from, int to, float counter = 0.25f) { tilePos = to; xPos = tilePos % 40; yPos = tilePos / 40; Player.name = "Player" + to.ToString(); AnimaUnit animaUnit = new AnimaUnit(); animaUnit.MoveUnit(Player, from, to, counter); Tile.passable[from] = true; Tile.passable[to] = false; PlayerStat playerStat = new PlayerStat(); playerStat.GainRage(-1); if (Artifact.titles[to] != Artifact.Title.None) { Artifact.Title title = Artifact.titles[to]; Artifact artifact = new Artifact(); artifact.Destroy(to); AbilityEffect ability = new AbilityEffect(); ability.GainArtifact(title); } Turn.currentTurn = Turn.CurrentTurn.PlayerNeutral; }
public void UpdateStat(Artifact.Title title, int i) { switch (title) { case Artifact.Title.Crossbow: PlayerAttack.range[i] = 4; PlayerAttack.level[i] = 1; PlayerAttack.cooldown[i] = 0; PlayerAttack.powerMin[i] = 2; PlayerAttack.powerMax[i] = 5; PlayerAttack.target[i] = PlayerAttack.Target.Enemy; break; case Artifact.Title.BoneSword: PlayerAttack.range[i] = 1; PlayerAttack.level[i] = 1; PlayerAttack.cooldown[i] = 0; PlayerAttack.powerMin[i] = 3; PlayerAttack.powerMax[i] = 7; PlayerAttack.target[i] = PlayerAttack.Target.Enemy; break; case Artifact.Title.Fireball: PlayerAttack.range[i] = 4; PlayerAttack.level[i] = 1; PlayerAttack.cooldown[i] = 0; PlayerAttack.powerMin[i] = 2; PlayerAttack.powerMax[i] = 5; PlayerAttack.target[i] = PlayerAttack.Target.Enemy; break; case Artifact.Title.HeavyCannon: PlayerAttack.range[i] = 4; PlayerAttack.level[i] = 1; PlayerAttack.cooldown[i] = 9; PlayerAttack.powerMin[i] = 8; PlayerAttack.powerMax[i] = 11; PlayerAttack.powerSpecial[i] = 1; PlayerAttack.target[i] = PlayerAttack.Target.Enemy; break; case Artifact.Title.ExplosiveShot: PlayerAttack.range[i] = 4; PlayerAttack.level[i] = 1; PlayerAttack.cooldown[i] = 9; PlayerAttack.powerMin[i] = 8; PlayerAttack.powerMax[i] = 11; PlayerAttack.powerSpecial[i] = 3; PlayerAttack.target[i] = PlayerAttack.Target.Enemy; break; } PlayerAttack.cooldownMax[i] = PlayerAttack.cooldown[i]; }
public void GainArtifact(Artifact.Title title) { Artifact artifact = new Artifact(); Artifact.Type type = artifact.GetArtifactType(title); int i = 6; if (type == Artifact.Type.AbilityWeak) { i = 0; if (PlayerAttack.occupied[0]) { artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[0]); } } else if (type == Artifact.Type.AbilityStrong) { i = 1; if (PlayerAttack.occupied[1]) { i = 2; if (PlayerAttack.occupied[2]) { i = 1; artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[1]); } } } else if (type == Artifact.Type.Helmet) { i = 3; if (PlayerAttack.occupied[3]) { artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[3]); } } else if (type == Artifact.Type.Armor) { i = 4; if (PlayerAttack.occupied[4]) { artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[4]); } } else if (type == Artifact.Type.Gauntlet) { i = 5; if (PlayerAttack.occupied[5]) { artifact.SummonArtifact(PlayerMovement.tilePos, PlayerAttack.title[5]); } } if (i < 6) { PlayerAttack.title[i] = title; PlayerAttack.Abilities[i].GetComponentInChildren <Image>().sprite = Resources.Load <Sprite>("Artifacts/" + title.ToString()); PlayerAttack.occupied[i] = true; PlayerAttack.description[i] = artifact.GetDescription(title, i); AbilityStat abilityStat = new AbilityStat(); abilityStat.UpdateStat(title, i); PlayerAttack attack = new PlayerAttack(); attack.DisplayAbility(i); } }