private void CheckTurnPlayer() { if (tp.turnEnd) { // begin enemy turn IsPlayerTurn = false; tp = new TurnPress(d.enemyTurns * 2); CombatLog.AppendText("Player turn over, it is now the enemy's turn."); CombatLog.AppendText(Environment.NewLine); CombatLog.AppendText(Environment.NewLine); TurnBox.Text = tp.PrintIcons(); UseSkillButton.Enabled = false; UseItemButton.Enabled = false; UseRelic.Enabled = false; IsPlayerTurn = false; if (!d.IsDungeonComplete()) { eTurn = 0; timer.Start(); } } else { TurnBox.Text = tp.PrintIcons(); } }
private void CheckTurnEnemies() { if (tp.turnEnd) { timer.Stop(); // begin player turn IsPlayerTurn = true; tp = new TurnPress(p.Turns + p.stats[Stat.TURNS]); UseSkillButton.Enabled = true; UseItemButton.Enabled = true; UseRelic.Enabled = true; IsPlayerTurn = true; CombatLog.AppendText($"Enemy turn over, it is now {p.Name}'s turn."); CombatLog.AppendText(Environment.NewLine); CombatLog.AppendText(Environment.NewLine); TurnBox.Text = tp.PrintIcons(); } else { TurnBox.Text = tp.PrintIcons(); } }
public ActionHandler() { tp = new TurnPress(); pt = true; }
private void CreateEnemies() { PictureBox[] e_icons = { EnemyPic1, EnemyPic2, EnemyPic3 }; TextBox[] e_boxes = { EnemyBox1, EnemyBox2, EnemyBox3 }; ProgressBar[] e_bars = { EnemyBar1, EnemyBar2, EnemyBar3 }; RadioButton[] c_boxes = { Target1, Target2, Target3 }; IsPlayerTurn = true; tp = new TurnPress(p.Turns + p.stats[Stat.TURNS]); TurnBox.Text = tp.PrintIcons(); for (int e = 0; e < e_icons.Length; e++) { if (e_icons[e].Image != null) { e_icons[e].Image = null; } e_boxes[e].Text = ""; c_boxes[e].Enabled = false; } d.GenerateFight(); c_boxes[0].Checked = true; if (d.isBoss) { BossGroup.Visible = true; EnemyGroup.Visible = false; useBountyKeyToolStripMenuItem.Enabled = false; useEXBountyKeyToolStripMenuItem.Enabled = false; useElderKeyToolStripMenuItem.Enabled = false; Enemy boss = d.enemies[0]; BossPicture.Image = Image.FromFile(boss.image); BossName.Text = boss.weakName; bc.CheckDefault(boss.hp); bc.SetSubBars(boss.hp); BossBar.Maximum = bc.hp_default; int subs = bc.subbars; int baseB = bc.baseBar; for (int i = 0; i < subs; i++) { sbars[i].Visible = true; sbars[i].Value = sbars[i].Maximum; } BossBar.Value = baseB; mm.Pause(); if (d.isFinalBoss) { mm.Stop(); mm.SetFinalBossSong(); mm.PlayFinalBossSong(); } else if (d.isElderGod) { mm.PlayElderSong(); } else if (d.isEXBoss || d.isEXInvader) { mm.PlayEXSong(); } else if (d.isBountyBoss) { mm.PlayBountySong(); } else if (d.isInvader) { mm.PlayInvaderSong(); } else { mm.PlayBossSong(); } TitleCard.Image = Image.FromFile(boss.titleCard); } else { BossGroup.Visible = false; EnemyGroup.Visible = true; switch (d.enemies.Count) { case 1: e_icons[1].Image = Image.FromFile(d.enemies[0].image); e_boxes[1].Text = d.enemies[0].weakName; e_bars[1].Maximum = d.enemies[0].hp; e_bars[1].Value = d.enemies[0].hp; // change later c_boxes[0].Enabled = true; break; case 2: int x = 0; for (int i = 0; i < d.enemies.Count; i++) { e_icons[x].Image = Image.FromFile(d.enemies[i].image); e_boxes[x].Text = d.enemies[i].weakName; e_bars[x].Maximum = d.enemies[i].hp; e_bars[x].Value = d.enemies[i].hp; c_boxes[i].Enabled = true; x += 2; } break; case 3: for (int i = 0; i < d.enemies.Count; i++) { e_icons[i].Image = Image.FromFile(d.enemies[i].image); e_boxes[i].Text = d.enemies[i].weakName; e_bars[i].Maximum = d.enemies[i].hp; e_bars[i].Value = d.enemies[i].hp; c_boxes[i].Enabled = true; } break; } } }