using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConqueringOneself { public enum AttackEffect { Damage, Defend, CounterPhysical, Heal, Drain, CounterMagical, Berserker, Nullify, RestoreMP, MPDamage, UnblockableDamage, Regeneration, Aura, Reality } public enum AttackType { Physical, Magic } public class Attack { public static List unlearnedAttacks = new List(); public const int NUMBER_OF_ATTACKS = 19; public int id = -1; public string name = "NAMELESS"; public int strength = 50; public AttackEffect effect = AttackEffect.Damage; public int mpCost = 0; public int priority = 0; public AttackType type = AttackType.Physical; public void SetAttack(int id, string name, int strength, AttackEffect effect, int mpCost = 0, AttackType type = AttackType.Physical, int priority = 0) { this.id = id; this.name = name; this.strength = strength; this.effect = effect; this.mpCost = mpCost; this.type = type; this.priority = priority; } public Attack(int id) { switch (id) { case 0: SetAttack(0, "Attack", 50, AttackEffect.Damage); break; case 1: SetAttack(1, "Defend", 0, AttackEffect.Defend, 0, AttackType.Physical, -9); break; case 2: SetAttack(2, "Counterstrike", 25, AttackEffect.CounterPhysical, 0, AttackType.Physical, -9); break; case 3: SetAttack(3, "Thunderbolt", 60, AttackEffect.Damage, 20, AttackType.Magic, -1); break; case 4: SetAttack(4, "Heal", 100, AttackEffect.Heal, 50, AttackType.Magic, -1); break; case 5: SetAttack(5, "Drain", 30, AttackEffect.Drain, 10, AttackType.Magic, 1); break; case 6: SetAttack(6, "Disruption", 25, AttackEffect.CounterMagical, 10, AttackType.Magic, -9); break; case 7: SetAttack(7, "Berserker", 100, AttackEffect.Berserker, 0, AttackType.Physical, 9); break; case 8: SetAttack(8, "Nullify", 0, AttackEffect.Nullify, 50, AttackType.Magic, -4); break; case 9: SetAttack(9, "Meditate", 50, AttackEffect.RestoreMP, 0, AttackType.Magic, 5); break; case 10: SetAttack(10, "Thunderstorm", 150, AttackEffect.Damage, 100, AttackType.Magic, -1); break; case 11: SetAttack(11, "Ghostpunch", 40, AttackEffect.Damage, 0, AttackType.Magic, 4); break; case 12: SetAttack(12, "Soulnumb", 40, AttackEffect.MPDamage, 10, AttackType.Magic, 7); break; case 13: SetAttack(13, "Instakick", 30, AttackEffect.Damage, 0, AttackType.Physical, -10); break; case 14: SetAttack(14, "Instablast", 30, AttackEffect.Damage, 10, AttackType.Magic, -10); break; case 15: SetAttack(15, "Unblockable", 25, AttackEffect.UnblockableDamage, 0, AttackType.Physical, 2); break; case 16: SetAttack(16, "Regeneration", 0, AttackEffect.Regeneration, 50, AttackType.Magic, 6); break; case 17: SetAttack(17, "Aura", 0, AttackEffect.Aura, 20, AttackType.Magic, 6); break; case 18: SetAttack(18, "Reality", 0, AttackEffect.Reality, 0, AttackType.Magic, -8); break; } } public static void InitializeUnlearned(List learnedAttacks) { unlearnedAttacks = new List(); for (int i = 0; i < NUMBER_OF_ATTACKS; i++) { bool gotIt = false; for (int ii = 0; ii < learnedAttacks.Count; ii++) { if (learnedAttacks[ii].id == i) gotIt = true; } if (!gotIt) unlearnedAttacks.Add(i); } } public static List GetMovesToLearn() { List toReturn = new List(); List chosen = new List(); Random random = new Random(); while (chosen.Count < Main.LEVELUP_MOVE_CHOICES) { int pickNumber = random.Next(unlearnedAttacks.Count); if (!chosen.Contains(pickNumber)) chosen.Add(pickNumber); } for (int i = 0; i < chosen.Count; i++) { toReturn.Add(new Attack(unlearnedAttacks[chosen[i]])); } return toReturn; } public static string GetExplanation(int id) { string p = "\n(Priority: " + new Attack(id).priority + ")"; switch (id) { case 0: return "A basic physical attack. Deals 50\ndamage." + p; case 1: return "Defend against incoming attacks.\nHalves all damage received this turn." + p; case 2: return "If your enemy uses a physical\nattack, counterattack for 25 damage." + p; case 3: return "MP COST: 20\nA basic magical\nattack. Deals 60 damage." + p; case 4: return "MP COST: 50\nA spell to heal 100 HP." + p; case 5: return "MP COST: 10\nBlack magic to drain\n30 HP from your enemy." + p; case 6: return "MP COST: 10\nIf your enemy uses a magical attack,\ncounterattack for 25 damage." + p; case 7: return "Charge recklessly towards your enemy.\nDeals 100 damage to him and 50 damage\nto you." + p; case 8: return "MP COST: 50\nCompletely prevent all effects from\nyour enemy's attack." + p; case 9: return "Meditate to restore 50 MP." + p; case 10: return "MP COST: 100\nA powerful magic attack, dealing 150 damage." + p; case 11: return "A magic attack that costs no MP.\nDeals 40 damage." + p; case 12: return "MP COST: 10\nAn attack that strikes the soul.\nLowers enemy's MP by 40." + p; case 13: return "A very quick physical attack.\nDeals 30 damage." + p; case 14: return "MP COST: 10\nA very quick magical attack.\nDeals 30 damage." + p; case 15: return "An attack that cannot be\ndefended against.\nDeals 25 damage." + p; case 16: return "MP COST: 50\nHeals 10 HP every turn.\nLasts until dispelled." + p; case 17: return "MP COST: 20\nRecovers 10 MP every turn.\nLasts until dispelled." + p; case 18: return "Dispel all lasting effects." + p; } return ""; } } }