//if keycode character is selected private void KeycodeSelect_Click(object sender, EventArgs e) { //set player who clicked to keycode character if (Form1.P1Character == "unselected") { Form1.P1Character = "Keycode"; P1SelectionLabel.Visible = true; P1SelectionLabel.Location = new Point(437, 154); P1PreviewBox.Image = Properties.Resources.Keycode_passive; P1CharNameLabel.Text = "Keycode"; Refresh(); } else if (Form1.P2Character == "unselected") { Form1.P2Character = "Keycode"; P2SelectionLabel.Visible = true; P2SelectionLabel.Location = new Point(437, 191); P2PreviewBox.Image = Properties.Resources.P2Keycode_passive; P2CharNameLabel.Text = "Keycode"; Refresh(); //once player two has selected a character show the fight button FightButton.Show(); FightButton.Focus(); FightButton.BringToFront(); } }
private void booleanSelectButton_Click(object sender, EventArgs e) { //set the player who clicked to void character if (Form1.P1Character == "unselected") { Form1.P1Character = "Boolean"; P1SelectionLabel.Visible = true; P1SelectionLabel.Location = new Point(437, 274); P1PreviewBox.Image = Properties.Resources.Boolean_Passive; P1CharNameLabel.Text = "Boolean"; Refresh(); } else if (Form1.P2Character == "unselected") { Form1.P2Character = "Boolean"; P2SelectionLabel.Visible = true; P2SelectionLabel.Location = new Point(437, 310); P2PreviewBox.Image = Properties.Resources.Boolean_Passive__2_; P2CharNameLabel.Text = "Boolean"; Refresh(); //once player two has selected a character show the fight button FightButton.Show(); FightButton.Focus(); FightButton.BringToFront(); } }
private void FightButton_Click(object sender, EventArgs e) { if (monsterDa >= hp) { MessageBox.Show("勇者,還是快逃吧!"); } else { EscapeButton.Hide(); FightButton.Hide(); FuncButton.Show(); FuncButton.Text = "攻擊鈕-剩餘" + attacknum + "次"; } }
public MainScreen() { InitializeComponent(); //Story.SetNext(64); TutorialScreen.BringToFront(); TutorialScreen.Show(); CharacterName.Text = ""; LabelODa.Text = LabelOHP.Text = LabelDa.Text = LabelHP.Text = LabelLv.Text = ""; kill = hp = da = 0; lv = 'C'; Rank[1] = 'C'; Rank[2] = 'B'; Rank[3] = 'A'; Rank[4] = 'S'; FightButton.Hide(); EscapeButton.Hide(); FuncButton.Hide(); da = 10; hp = 10; PocDefine(); }
//if there is a keydown event on fight button private void FightButton_KeyDown(object sender, KeyEventArgs e) { //if the key pressed is m if (e.KeyCode == Keys.M) { //go back to character selection start and hide the fight button Form1.P1Character = "unselected"; Form1.P2Character = "unselected"; FightButton.Hide(); HitboxSelect.Focus(); //reset the previews to be empty P1CharNameLabel.ResetText(); P2CharNameLabel.ResetText(); P1PreviewBox.Image = null; P2PreviewBox.Image = null; P1SelectionLabel.Hide(); P2SelectionLabel.Hide(); //reload the screen Refresh(); } }
public void CreateMain() { BladeButton buttonMainQuit = null; List <MenuItem> list = new List <MenuItem>(); // FightButton fightButton = new FightButton(new Vector2(100f, 140f), new Vector2(-160f, 120f)); FightButton fightButton = new FightButton(new Vector2(160f, 140f), new Vector2(-160f, 120f)); list.Add(fightButton); // CoOpButton coOpButton = new CoOpButton(new Vector2(220f, 140f), new Vector2(480f, 120f)); CoOpButton coOpButton = new CoOpButton(new Vector2(240f, 140f), new Vector2(480f, 120f)); list.Add(coOpButton); WorkshopButton workshopButton = new WorkshopButton(new Vector2(270f, 210f), new Vector2(270f, 300f)); list.Add(workshopButton); ArchivesButton archivesButton = new ArchivesButton(new Vector2(200f, 210f), new Vector2(200f, 300f)); list.Add(archivesButton); TrialsButton trialsButton = new TrialsButton(new Vector2(130f, 210f), new Vector2(130f, 300f)); list.Add(trialsButton); BladeButton buttonMainOptions; BladeButton buttonMainCredits; BladeButton buttonModOptions; // h = 18 if (MainMenu.NoQuit) { buttonModOptions = new BladeButton(188f, "MOD OPTIONS", new Action(this.MainOptions)); list.Add(buttonModOptions); buttonMainOptions = new BladeButton(206f, "OPTIONS", new Action(this.MainOptions)); list.Add(buttonMainOptions); buttonMainCredits = new BladeButton(224f, "CREDITS", new Action(this.MainCredits)); list.Add(buttonMainCredits); } else { buttonModOptions = new BladeButton(174f, "MOD OPTIONS", new Action(ModOptions)); list.Add(buttonModOptions); buttonMainOptions = new BladeButton(192f, "OPTIONS", new Action(this.MainOptions)); list.Add(buttonMainOptions); buttonMainCredits = new BladeButton(210f, "CREDITS", new Action(this.MainCredits)); list.Add(buttonMainCredits); buttonMainQuit = new BladeButton(228f, "QUIT", new Action(this.MainQuit)); list.Add(buttonMainQuit); } base.Add <MenuItem>(list); fightButton.DownItem = trialsButton;//buttonModOptions; fightButton.LeftItem = buttonModOptions; fightButton.RightItem = coOpButton; coOpButton.DownItem = trialsButton; coOpButton.LeftItem = fightButton; //buttonMainOptions.UpItem = fightButton; buttonMainOptions.UpItem = buttonModOptions; buttonMainOptions.DownItem = buttonMainCredits; buttonMainOptions.RightItem = trialsButton; buttonMainCredits.UpItem = buttonMainOptions; buttonMainCredits.RightItem = trialsButton; // MOD OPTIONS buttonModOptions.UpItem = fightButton; buttonModOptions.DownItem = buttonMainOptions; buttonModOptions.RightItem = fightButton; if (!MainMenu.NoQuit) { buttonMainCredits.DownItem = buttonMainQuit; buttonMainQuit.UpItem = buttonMainCredits; buttonMainQuit.RightItem = trialsButton; } trialsButton.RightItem = archivesButton; trialsButton.LeftItem = buttonMainOptions; trialsButton.UpItem = coOpButton; archivesButton.LeftItem = trialsButton; archivesButton.UpItem = coOpButton; if (workshopButton != null) { archivesButton.RightItem = workshopButton; coOpButton.DownItem = archivesButton; trialsButton.UpItem = fightButton; workshopButton.RightItem = null; workshopButton.LeftItem = archivesButton; workshopButton.UpItem = coOpButton; } if (this.OldState == MainMenu.MenuState.Options) { this.ToStartSelected = buttonMainOptions; } else if (this.OldState == MainMenu.MenuState.Archives) { this.ToStartSelected = archivesButton; } else if (this.OldState == MainMenu.MenuState.Workshop) { this.ToStartSelected = workshopButton; } else if (this.OldState == MainMenu.MenuState.Credits) { this.ToStartSelected = buttonMainCredits; } else if (this.OldState == MainMenu.MenuState.CoOp || MainMenu.RollcallMode == MainMenu.RollcallModes.Quest || MainMenu.RollcallMode == MainMenu.RollcallModes.DarkWorld) { this.ToStartSelected = coOpButton; } else if (MainMenu.RollcallMode == MainMenu.RollcallModes.Trials) { this.ToStartSelected = trialsButton; } else { this.ToStartSelected = fightButton; } this.BackState = MainMenu.MenuState.PressStart; this.TweenBGCameraToY(0); MainMenu.CurrentMatchSettings = null; }
private void EscapeButton_Click(object sender, EventArgs e) { FightButton.Hide(); EscapeButton.Hide(); PocDefine(); }
private void PocDefine() { if (endflag) { this.Close(); return; } int type = Story.GetStoryType(); Addflag = true; //0 as Normal Story Line //1 as chararcter Screen //2 as Request if (type == 0) { onType = 0; TutorialScreen.Show(); CharacterScreen.Hide(); SetTutorialPic(Story.GetPicID()); AddText(Story.GetStoryText()); } if (type == 99) { onType = 0; CreateHero c = new CreateHero(); AddText(Story.GetStoryText()); c.ShowDialog(); Story.next++; PocDefine(); return; } if (type == 98) { onType = 1; TutorialScreen.Hide(); CharacterScreen.Show(); MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg"); HandleEventString(Story.GetEventID()); SetOtherPic(Story.GetPicID()); AddText(Story.GetStoryText()); Request r = new Request(Story.GetRequestID()); r.ShowDialog(); name = r.name; } if (type == 97) { onType = 1; TutorialScreen.Hide(); CharacterScreen.Show(); MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg"); HandleEventString(Story.GetEventID()); SetOtherPic(Story.GetPicID()); AddText(Story.GetStoryText()); nextflag = false; attacknum = 3; FuncButton.Text = "攻擊鈕-剩餘3次"; FuncButton.Show(); } if (type == 96) { onType = 1; TutorialScreen.Hide(); CharacterScreen.Show(); MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg"); HandleEventString(Story.GetEventID()); SetOtherPic(Story.GetPicID()); AddText(Story.GetStoryText()); LevelUP u = new LevelUP(1, 1, 2, "請使用++這個運算子來為想要提升之能力升級,請注意項目名稱和別忘了加上分號。打完後記得按ENTER確認唷!"); u.ShowDialog(); SetCharacter(u); Story.next++; PocDefine(); return; } if (type == 95) { onType = 1; TutorialScreen.Hide(); CharacterScreen.Show(); MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg"); HandleEventString(Story.GetEventID()); SetOtherPic(Story.GetPicID()); AddText(Story.GetStoryText()); HandleEventString(Story.GetEventID()); nextflag = false; FightButton.Show(); EscapeButton.Show(); Story.next++; return; } if (type == 1) { onType = 1; TutorialScreen.Hide(); CharacterScreen.Show(); MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg"); HandleEventString(Story.GetEventID()); SetOtherPic(Story.GetPicID()); if (Addflag) { AddText(Story.GetStoryText()); } } if (type == 2) { onType = 1; TutorialScreen.Hide(); CharacterScreen.Show(); SetOtherPic(Story.GetPicID()); HandleEventString(Story.GetEventID()); AddText(Story.GetStoryText()); MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg"); Request r = new Request(Story.GetRequestID()); r.ShowDialog(); Story.next++; PocDefine(); return; } if (type == 999) { onType = 0; TutorialScreen.Show(); CharacterScreen.Hide(); SetTutorialPic(Story.GetPicID()); AddText(Story.GetStoryText()); endflag = true; } Story.next++; }