private void Victory() { won = true; MessageBoxInterface[] messageBoxes = new MessageBoxInterface[1]; Color[] colors = new Color[2]; colors[0] = Color.White; colors[1] = Color.White; int mX = 400; int mY = 100; int height = 100; int width = 345; int exp = getExp(); string[] attackMessage = new string[2]; attackMessage[0] = "Victory!!"; attackMessage[1] = "You have earned " + exp + " Exp!"; for (int i = 0; i < 3; i++) { StateHandler.GetPC(i).addExp(exp); } SubStateDisplayMessage temp = new SubStateDisplayMessage(attackMessage, height, width, mX, mY, StateHandler.State); StateHandler.State = temp; ItemFactory.combatGenerate(MonsterList[0].Element, StateHandler.Level, MonsterList[0].Quality, MonsterList[0].Boss, ""); }
public bool findGlobalCollision() { if (StateHandler.GetSceneList() != null) { if ((int)y / 4 < 0 || (int)x / 4 < 0) { return(true); } if ((int)y / 4 >= MapFactory.map.GetLength(0) || (int)x / 4 >= MapFactory.map.GetLength(1)) { return(true); } if (MapFactory.map[(int)y / 4, (int)x / 4] != Globals.TILE_PASSABLE && MapFactory.map[(int)y / 4, (int)x / 4] != Globals.TILE_BOSS) { return(true); } /* * foreach (Actor actor in FSCMStrikesBackLogic.Pulse.getSceneList()) * { * if (this != actor) * { * if (this.DetectCollision(actor)) * { * return true; * } * } * }//*/ } return(false); }
public void initialize() { MediaHandler.playBGM(FSCMStrikesBackLogic.Properties.Resources.Five_Armies, "Five_Armies"); background.model = ModelFactory.loadModel("SuperBattleCave"); background.Scale = 3.0f; TurnList.Add(StateHandler.GetPC(0)); TurnList.Add(StateHandler.GetPC(1)); TurnList.Add(StateHandler.GetPC(2)); for (int i = 0; i < MonsterList.Length; i++) { TurnList.Add(MonsterList[i]); } current = StateHandler.GetPC(0); cameraTarget = PCBuilder.getPC(0); strategy = 0; x = 75; y = 50; z = 10; }
public SubStateOrderChangeTwo(SubStateAbstract theparent, int selected) : base(theparent) { first = selected; int i = 0; StateHandler.AddDelay(); messageBoxes = new MessageBox[1]; colors = new Color[3]; menu = new string[colors.Length]; for (i = 0; i < menu.Length; i++) { menu[i] = StateHandler.GetPC(i).Name; } for (i = 1; i < colors.Length; i++) { colors[i] = Color.DarkGray; } colors[0] = Color.White; mX = 90; mY = 90; width = 900; height = 630; messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true); }//end EVC
public SubStateGameMenu(StateAbstract parent) : base(parent) { StateHandler.AddDelay(); messageBoxes = new MessageBox[1]; colors = new Color[8]; menu = new string[colors.Length]; menu[0] = "Items"; menu[1] = "Equip"; menu[2] = "Rune"; menu[3] = "Status"; menu[4] = "Formation"; menu[5] = "Party Order"; menu[6] = "Return to Title"; menu[7] = "Exit"; for (int i = 1; i < colors.Length; i++) { colors[i] = Color.DarkGray; } colors[0] = Color.White; mX = 30; mY = 30; width = 960; height = 690; messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true); }
public override void Input(int input) { if (input == Globals.KEY_ACCEPT) { StateHandler.AddDelay(); if (count == 0) { parent.ParentInput(Globals.MENU_ATTACK); } else if (count == 1) { parent.ParentInput(Globals.MENU_MAGIC); } else if (count == 2) { StateHandler.State = new SubStateItemMenuCombat(this); parent.ParentInput(Globals.MENU_ITEM); } else if (count == 3) { parent.ParentInput(Globals.MENU_DEFEND); } } if (input == Globals.KEY_UP || input == Globals.KEY_DOWN) { base.Input(input); } }
public override void Input(int input) { if (input == Globals.KEY_ACCEPT) { if (count == 0) { MapFactory.mapLoad("test"); StateInGame.locX = 4; StateInGame.locY = 4; StateInGame.change = true; StateHandler.State = new StateInGame(); } else if (count == 1) { StateHandler.State = new SubStateFeatureNotImplemented(this); } else if (count == 2) { StateHandler.State = new SubStateOptionsMenu(this); } else if (count == 3) { StateHandler.State = new StateCredits(); } } else if (input == Globals.KEY_CANCEL)//used to prevent the user from exiting the main menu { StateHandler.AddDelay(); MediaHandler.playSFX(FSCMStrikesBackLogic.Properties.Resources.menuBack, "menuBack"); } else { base.Input(input); } }
public SubStateFormationMenu(SubStateAbstract theparent) : base(theparent) { StateHandler.AddDelay(); messageBoxes = new MessageBox[1]; colors = new Color[4]; menu = new string[4]; menu[0] = "The Intern"; menu[1] = "Defense"; menu[2] = "Caster"; menu[3] = "Offense"; for (int i = 1; i < colors.Length; i++) { colors[i] = Color.DarkGray; } colors[0] = Color.White; mX = 30; mY = 30; width = 960; height = 690; messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true); }//end EVC
public override void Input(int input) { if (input != Globals.KEY_ACCEPT && input != Globals.KEY_EXIT) { StateHandler.AddDelay(); StateHandler.State = new StateTitleScreen(); } }
public override void Input(int input) { if (input == Globals.KEY_ACCEPT) { switch (count) { case 0: StateHandler.AddDelay(); StateHandler.State = new SubStateItemMenu(this); break; case 1: StateHandler.AddDelay(); StateHandler.State = new SubStateCharSelectMenuEquip(this); break; case 2: StateHandler.AddDelay(); StateHandler.State = new SubStateCharSelectMenuRune(this); break; case 3: StateHandler.AddDelay(); StateHandler.State = new SubStateStatusMenu(this); break; case 4: StateHandler.AddDelay(); StateHandler.State = new SubStateFormationMenu(this); break; case 5: StateHandler.AddDelay(); StateHandler.State = new SubStateOrderChangeOne(this); break; case 6: StateHandler.AddDelay(); //StateHandler.State = new StateTitleScreen();//Does not work. You should check it out and see if you know how to fix it. StateHandler.State = new SubStateFeatureNotImplemented(this); break; case 7: StateHandler.AddDelay(); StateHandler.State = new SubStateConfirmExit(this, 75, 200); break; } } else if (input == Globals.KEY_MENU) { input = Globals.KEY_CANCEL; } else { base.Input(input); } }
public override void Input(int input) { if (input == Globals.KEY_CANCEL || input == Globals.KEY_ACCEPT) { base.Input(input); StateHandler.AddDelay(); StateHandler.State = Parent; } }
public override void Input(int input) { base.Input(input); StateHandler.AddDelay(); if (input == Globals.KEY_ACCEPT) { StateHandler.State = new SubStateCharSelectMenuUse(this, count); } }
public override void ParentInput(int input) { if (input == Globals.KEY_ACCEPT || input == Globals.MESSAGE_CONFIRMED) { StateHandler.AddDelay(); StateHandler.State = this; } Parent.ParentInput(input); }
public override void Input(int input) { if (input == Globals.KEY_ACCEPT) { StateHandler.AddDelay(); StateHandler.State = Parent; } parent.Input(input); }
public SubStateListMenuRune(StateAbstract parent, int thePC, int theSlot) : base(parent) { PCid = thePC; slot = theSlot; StateHandler.AddDelay(); messageBoxes = new MessageBox[1]; int adjustedLen = ItemHandler.runeList.Count + 1; colors = new Color[adjustedLen]; menu = new string[adjustedLen]; int i = 0; foreach (ItemAbstract item in ItemHandler.runeList) { colors[i] = Color.DarkGray; menu[i] = item.Name; i++; } menu[i] = "Unequip"; colors[i] = Color.DarkGray; colors[0] = Color.White; mX = 240; mY = 75; width = 660; height = 390; int tempVal = (int)(Globals.hmod * height); tempVal /= Globals.FONT_HEIGHT; tempVal -= 1; if (tempVal > adjustedLen) { tempVal = adjustedLen; } string[] tempMenu = new string[tempVal]; for (i = 0; i < tempVal; i++) { tempMenu[i] = menu[i]; } messageBoxes[0] = new MessageBox(mX, mY, width, height, tempMenu, colors, true, true, true); StateHandler.State = new SubStateRuneChange(this, PCid, slot, 0); }
}//end EVC public override void Input(int input) { base.Input(input); StateHandler.AddDelay(); if (input == Globals.KEY_ACCEPT) { StateHandler.State = new SubStateOrderChangeTwo(this, count); } else if (input == Globals.KEY_CANCEL) { StateHandler.State = parent; } }//end input
public SubStateItemMenuCombat(StateAbstract theparent) : base(theparent) { absolute = false; parent = theparent; StateHandler.AddDelay(); messageBoxes = new MessageBox[1]; colors = new Color[ItemHandler.itemList.Count]; menu = new string[ItemHandler.itemList.Count]; int i = 0; foreach (ConsumableAbstract item in ItemHandler.itemList) { colors[i] = Color.DarkGray; menu[i] = item.getName(); i++; } if (ItemHandler.itemList.Count > 0) { colors[0] = Color.White; } mX = 100; mY = 45; width = 860; height = 590; int tempVal = (int)(Globals.hmod * height); tempVal /= Globals.FONT_HEIGHT; tempVal -= 1; if (tempVal > menu.Length) { tempVal = menu.Length; } string[] tempMenu = new string[tempVal]; for (i = 0; i < tempVal; i++) { tempMenu[i] = menu[i]; } messageBoxes[0] = new MessageBox(mX, mY, width, height, tempMenu, colors, true, true, true); }
private bool runeSlotTaken(int passedFlag) { if (!isFlag(passedFlag)) { passedFlag = 42; } foreach (RuneAbstract r in StateHandler.GetPC(PCid).runes) { if (r != null && r.Wearflags == passedFlag) { return(true); } } return(false); }
public override List <Actor> GetSceneList() { List <Actor> temp = new List <Actor>(); temp.Add(background); for (int i = 0; i < MonsterList.Length; i++) { temp.Add(MonsterList[i]); } temp.Add(StateHandler.GetPC(0)); temp.Add(StateHandler.GetPC(1)); temp.Add(StateHandler.GetPC(2)); return(temp); }
public override void Input(int input) { if (StateHandler.GetDelay() > 0) { return; } if (input == Globals.KEY_ACCEPT) { StateHandler.AddDelay(); if (parent != null) { Parent.ParentInput(Globals.MESSAGE_CONFIRMED); } } }
}//end EVC public override void Input(int input) { base.Input(input); StateHandler.AddDelay(); if (input == Globals.KEY_ACCEPT) { string temp = StateHandler.GetPC(first).Name; StateHandler.SetPC(StateHandler.GetPC(count).Name, first); StateHandler.SetPC(temp, count); parent = new SubStateOrderChangeOne((SubStateAbstract)parent.Parent); StateHandler.State = parent; } else if (input == Globals.KEY_CANCEL) { StateHandler.State = parent; } }//end input
}//end EVC public override void Input(int input) { base.Input(input); StateHandler.AddDelay(); if (input == Globals.KEY_ACCEPT) { FormationHandler.Formation = count; StateHandler.State = parent; } else if (input == Globals.KEY_CANCEL) { StateHandler.State = parent; } else { StateHandler.State = new SubStateDisplayFormation(this, count); } }//end input
public static void Input(int input) { if (input == Globals.KEY_EXIT) { StateHandler.Exit(true); } if (StateHandler.GetDelay() > 0) { return; } if (StateHandler.Paused && input != Globals.KEY_START) { return; } StateHandler.State.Input(input); }
private void nextTurn() { curIndex++; if (current == MonsterList[0]) { curIndex = 0; } if (curIndex > 2) { current = MonsterList[0]; return; } current = StateHandler.GetPC(curIndex); if (current.Health < 1) { bool gameOver = true; for (int i = 0; i < 3; i++) { if (PCBuilder.getPC(i).Health > 0) { gameOver = false; } } if (gameOver) { StateHandler.AddDelay(); Defeat(); } else { nextTurn(); } } else { cameraTarget = current; } }
private bool equipSlotTaken(int passedFlag) { foreach (EquipmentAbstract e in StateHandler.GetPC(PCid).equipped) { if (e != null) { for (int i = 0; i < 5; i++) { int flag = 1 << i; if (Globals.IS_SET(e.Wearflags, flag)) { if (Globals.IS_SET(passedFlag, flag)) { return(true); } } } } } return(false); }
public override void Input(int input) { if (input == Globals.KEY_ACCEPT) { if (count < ItemHandler.runeList.Count && runeSlotTaken(ItemHandler.runeList[count].Wearflags)) { MediaHandler.playSFX(FSCMStrikesBackLogic.Properties.Resources.menuBack, "error"); return; } StateHandler.State = new SubStateConfirmEquipMenu(this, 310, 90, PCid, slot, count, Globals.ITEM_TYPE_RUNE); } else { StateHandler.AddDelay(); base.Input(input); if (direction(input)) { StateHandler.State = new SubStateRuneChange(this, PCid, slot, count); } } }//end input
public SubStateStatusMenu(StateAbstract parent) : base(parent) { StateHandler.AddDelay(); messageBoxes = new MessageBox[1]; colors = new Color[31]; menu = new string[colors.Length]; PC temp = null; for (int i = 0; i < 29; i += 10) { temp = StateHandler.GetPC(i / 10); menu[i] = temp.Name + " " + temp.getTitle(); menu[i + 1] = temp.getExp() + @"/" + (temp.getLevel() * 1000); menu[i + 2] = "Level: " + temp.getLevel(); menu[i + 3] = "Health: " + temp.Health + "/" + temp.MaxHealth; menu[i + 4] = "MP: " + temp.Mp + "/" + temp.MaxMp; menu[i + 5] = "Attack: " + temp.getAttack(); menu[i + 6] = "Defense: " + temp.getDefense(); menu[i + 7] = "Magic: " + temp.getMagic(); menu[i + 8] = "Magic Defense: " + temp.getMagicDefense(); menu[i + 9] = ""; } menu[30] = "Formation: " + FormationHandler.FormName; for (int i = 0; i < colors.Length; i++) { colors[i] = Color.White; } mX = 30; mY = 30; width = 960; height = 690; messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true); }
public SubStateFeatureNotImplemented(StateAbstract parent) : base(parent) { StateHandler.AddDelay(); messageBoxes = new MessageBox[1]; colors = new Color[1]; menu = new string[1]; menu[0] = "This feature is currently not working."; for (int i = 0; i < colors.Length; i++) { colors[i] = Color.White; } mX = 30; mY = 30; width = 960; height = 690; messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true); }
public SubStateCombatMenu(StateAbstract parent) : base(parent) { StateHandler.AddDelay(); messageBoxes = new MessageBox[1]; colors = new Color[4]; menu = new string[4]; menu[0] = "Attack"; menu[1] = "Magic"; menu[2] = "Items"; menu[3] = "Defend"; colors[0] = Color.White; colors[1] = Color.DarkGray; colors[2] = Color.DarkGray; colors[3] = Color.DarkGray; mX = 450; mY = 600; width = 185; height = 125; messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true); }
public SubStateDisplayFormation(StateAbstract parent, int formation) : base(parent) { StateHandler.AddDelay(); messageBoxes = new MessageBox[1]; colors = new Color[4]; menu = new string[4]; menu = setFormation(formation); for (int i = 1; i < colors.Length; i++) { colors[i] = Color.DarkGray; } colors[0] = Color.White; mX = 130; mY = 40; width = 0; height = 0; messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true); }