public void Attack(bool playerTurn) { if (playerTurn) { TimedMethod[] moves = player.BasicAttack(); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } moves = Party.CheckDeath(); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } GetEnemy(); //delay += 60; menu.SetActive(false); methodQueue.Enqueue(new TimedMethod(0, "EndTurn")); } else { TimedMethod[] moves = Attacks.Attack(enemy, player); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } moves = Party.CheckDeath(); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } GetPlayer(); } }
//The method called when pressing the attack button public virtual TimedMethod[] BasicAttack() { if (Party.BagContains(new Metronome())) { return(Attacks.Attack(this, Party.GetEnemy(), strength + 2, strength + 2, GetAccuracy(), true, true, false)); } return(Attacks.Attack(this, Party.GetEnemy())); }
public void AttackAny(Character atkr, Character targ, int lower, int upper, int accuracy, bool usesPower, bool consumeCharge, bool piercing) { TimedMethod[] moves = Attacks.Attack(atkr, targ, lower, upper, accuracy, usesPower, consumeCharge, piercing); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } if (consumeCharge) { moves = Party.CheckDeath(); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } } GetEnemy(); GetPlayer(); }
public override TimedMethod[] BasicAttack() { TimedMethod[] attackPart; Attacks.SetAudio("Knife", 6); if (Party.BagContains(new Metronome())) { attackPart = Attacks.Attack(this, Party.GetEnemy(), strength + 3, strength + 3, GetAccuracy(), true, true, true); } else { attackPart = Attacks.Attack(this, Party.GetEnemy(), strength, strength + 5, GetAccuracy(), true, true, true); } TimedMethod[] moves = new TimedMethod[attackPart.Length + 1]; moves[0] = new TimedMethod(0, "Audio", new object[] { "Small Swing" }); attackPart.CopyTo(moves, 1); return(moves); }
public override TimedMethod[] BasicAttack() { TimedMethod[] attackPart; Attacks.SetAudio("Sword", 10); if (Party.BagContains(new Metronome())) { attackPart = Attacks.Attack(this, Party.GetEnemy(), strength + 3, strength + 3, GetAccuracy(), true, true, false); } else { attackPart = Attacks.Attack(this, Party.GetEnemy()); } GainGuard(1); TimedMethod[] moves = new TimedMethod[attackPart.Length + 2]; moves[0] = new TimedMethod(0, "Audio", new object[] { "Big Swing" }); moves[1] = new TimedMethod(0, "CharLogSprite", new object[] { "1", Party.playerSlot - 1, "guard", true }); attackPart.CopyTo(moves, 2); return(moves); }
public override TimedMethod[] BasicAttack() { TimedMethod[] attackPart; Attacks.SetAudio("Metal Hit", 10); if (Party.BagContains(new Metronome())) { attackPart = Attacks.Attack(this, Party.GetEnemy(), strength + 3, strength + 3, GetAccuracy(), true, true, false); } else { attackPart = Attacks.Attack(this, Party.GetEnemy()); } TimedMethod ifHit = new TimedMethod("Null"); GainCharge(1); TimedMethod[] moves = new TimedMethod[attackPart.Length + 2]; moves[0] = new TimedMethod(0, "AudioAfter", new object[] { "Small Swing", 5 }); moves[1] = new TimedMethod(0, "CharLogSprite", new object[] { "1", Party.playerSlot - 1, "charge", true }); attackPart.CopyTo(moves, 2); return(moves); }
public override TimedMethod[] BasicAttack() { TimedMethod[] attackPart; Attacks.SetAudio("Blunt Hit", 15); if (Party.BagContains(new Metronome())) { attackPart = Attacks.Attack(this, Party.GetEnemy(), strength + 3, strength + 3, GetAccuracy(), true, true, false); } else { attackPart = Attacks.Attack(this, Party.GetEnemy()); } TimedMethod switchPart = new TimedMethod(0, "Log", new object[] { "" }); if (Party.playerCount > 1) { int steps = new System.Random().Next(Party.playerCount - 1); for (int i = 0; i < 4; i++) { if (Party.members[i] != null && Party.members[i].GetAlive() && i != Party.playerSlot - 1) { if (steps == 0) { switchPart = new TimedMethod(60, "SwitchTo", new object[] { i + 1 }); } else { steps--; } } } } TimedMethod[] moves = new TimedMethod[attackPart.Length + 2]; moves[0] = new TimedMethod(0, "AudioAfter", new object[] { "Big Swing", 10 }); attackPart.CopyTo(moves, 1); moves[moves.Length - 1] = switchPart; return(moves); }
public void StagnantAttack(bool playerTurn, int lower, int upper, int accuracy, bool usesPower, bool consumeCharge, bool piercing) { if (playerTurn) { TimedMethod[] moves = Attacks.Attack(player, enemy, lower, upper, accuracy, usesPower, consumeCharge, piercing); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } if (consumeCharge) { moves = Party.CheckDeath(); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } } GetEnemy(); } else { TimedMethod[] moves = Attacks.Attack(enemy, player, lower, upper, accuracy, usesPower, consumeCharge, piercing); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } if (consumeCharge) { moves = Party.CheckDeath(); foreach (TimedMethod m in moves) { methodQueue.Enqueue(m); } } GetPlayer(); } }