public void Code(Toon ChosenOne, Toon OpponentToon, IntMoves ManaMoves, StrMoves RageMoves, AgMoves EnergyMoves, LuckMoves luckMoves, MouseState mouse, MouseState oldmouse, Point mousepoint, KeyboardState keyboard, KeyboardState oldkeyboard, Extras extra) { switch (State) { case FightState.InitiliazeMoves: InitializeMoves(ChosenOne, OpponentToon, ManaMoves, RageMoves, EnergyMoves, luckMoves,extra); break; case FightState.ChosenOnesTurn: OnToon = 0; TurnCode(ChosenOne, mouse, oldmouse, mousepoint, ChosenOne, OpponentToon, extra); break; case FightState.OpponentsTurn: OnToon = 1; TurnCode(OpponentToon, mouse, oldmouse, mousepoint, ChosenOne, OpponentToon, extra); break; case FightState.Attack: AttackCode(keyboard, oldkeyboard); break; case FightState.NoResource: NoResourceCode(keyboard, oldkeyboard); break; case FightState.Special: SpecialCode(keyboard, oldkeyboard, ChosenOne,OpponentToon); break; } }
private void MoveChoice(Toon Main, Toon Other, IntMoves ManaMoves, StrMoves RageMoves, AgMoves EnergyMoves, LuckMoves luckMoves, Extras extra) { ManaMoves.InitializeMoves(Other, Main,extra); RageMoves.InitializeMoves(Other, Main,extra); EnergyMoves.InitializeMoves(Other,extra, Main); luckMoves.InitializeMoves(Other); Move ability = new Move(); for (int i = 0; i < 4; i++) { Main.Ability[i] = new Move(); bool Assign = true; if (Main.moveClass[i] == "Mana") { ability = ManaMoves.Ability[rand.Next(0, ManaMoves.NumOfMoves)]; for (int k = 0; k < i; k++) { Assign = true; if (Main.Ability[k].Name == ability.Name) { i--; Assign = false; break; } } if (Assign == true) AssignAbility(Main.Ability[i], ability); } if (Main.moveClass[i] == "Energy") { ability = EnergyMoves.Ability[rand.Next(0, EnergyMoves.NumOfMoves)]; for (int k = 0; k < i; k++) { Assign = true; if (Main.Ability[k].Name == ability.Name) { i--; Assign = false; break; } } if (Assign == true) AssignAbility(Main.Ability[i], ability); } if (Main.moveClass[i] == "Rage") { ability = RageMoves.Ability[rand.Next(0, RageMoves.NumOfMoves)]; for (int k = 0; k < i; k++) { Assign = true; if (Main.Ability[k].Name == ability.Name) { i--; Assign = false; break; } } if (Assign == true) AssignAbility(Main.Ability[i], ability); } if (Main.moveClass[i] == "Luck") { ability = luckMoves.Ability[rand.Next(0, luckMoves.NumOfMoves)]; for (int k = 0; k < i; k++) { Assign = true; if (Main.Ability[k].Name == ability.Name) { i--; Assign = false; break; } } if (Assign == true) AssignAbility(Main.Ability[i], ability); } } }
private void InitializeMoves(Toon ChosenOne, Toon OpponentToon, IntMoves ManaMoves, StrMoves RageMoves, AgMoves EnergyMoves, LuckMoves luckMoves, Extras extra) { MoveChoice(OpponentToon, ChosenOne, ManaMoves, RageMoves, EnergyMoves, luckMoves,extra); MoveChoice(ChosenOne, OpponentToon, ManaMoves, RageMoves, EnergyMoves, luckMoves,extra); OnToon = rand.Next(0, 2); if (OnToon == 0) State = FightState.ChosenOnesTurn; if (OnToon == 1) State = FightState.OpponentsTurn; }