public override void Render(IRenderer dg) { this.back.Render(dg); if (this.player.badstatus[4]) { Color color = Color.FromArgb(200, Color.Black); this._rect = new Rectangle(0, 0, 240, 160); this._position = new Vector2(0.0f, 0.0f); dg.DrawImage(dg, "fadescreen", this._rect, true, this._position, color); } Panel[,] panel = this.panel; int upperBound1 = panel.GetUpperBound(0); int upperBound2 = panel.GetUpperBound(1); for (int lowerBound1 = panel.GetLowerBound(0); lowerBound1 <= upperBound1; ++lowerBound1) { for (int lowerBound2 = panel.GetLowerBound(1); lowerBound2 <= upperBound2; ++lowerBound2) { panel[lowerBound1, lowerBound2].Render(dg); } } if (this.backscreen > 0) { Color color = Color.FromArgb(this.backscreen, this.backscreencolor, this.backscreencolor, this.backscreencolor); this._rect = new Rectangle(0, 0, 240, 160); this._position = new Vector2(0.0f, 0.0f); dg.DrawImage(dg, "fadescreen", this._rect, true, this._position, color); } foreach (CharacterBase allObject in this.AllObjects()) { if (allObject.downprint) { allObject.BarrierRend(dg); allObject.Render(dg); allObject.BarrierPowerRend(dg); } allObject.RenderDOWN(dg); } var renderedObjects = this.AllObjects().Where(allObject => (allObject.position.Y >= 0 && allObject.position.Y <= 2) && (!(allObject is EnemyBase) || allObject.Hp <= 0 || !this.player.badstatus[4]) && (!allObject.upprint && !allObject.downprint) && allObject.rend) .OrderBy(ao => ao.position.Y).ThenByDescending(ao => TypeRenderOrder.IndexOf(ao.GetType())); foreach (CharacterBase allObject in renderedObjects) { allObject.BarrierRend(dg); allObject.Render(dg); allObject.BarrierPowerRend(dg); } foreach (CharacterBase allObject in this.AllObjects()) { if (allObject.upprint) { allObject.BarrierRend(dg); allObject.Render(dg); allObject.BarrierPowerRend(dg); } allObject.RenderUP(dg); } if (!this.player.addonSkill[57]) { foreach (CharacterBase characterBase in this.AllChara()) { characterBase.HPRender(dg); } } foreach (CharacterBase characterBase in this.AllChara()) { if (characterBase is EnemyBase enemyBase) { enemyBase.Nameprint(dg, enemyBase.printNumber); } } if (this.nowscene != SceneBattle.BATTLESCENE.end) { this.mind.Render(dg, this.positionHPwindow.X); } if (this.nowscene == SceneBattle.BATTLESCENE.custom) { this.custom.Render(dg); if (this.custom.scene == Custom.CUSTOMCHENE.chipMake) { this.customgauge.Render(dg); } } else if (this.nowscene != SceneBattle.BATTLESCENE.end && this.nowscene != SceneBattle.BATTLESCENE.init && this.nowscene != SceneBattle.BATTLESCENE.printstart) { this.customgauge.Render(dg); } else if (this.nowscene == SceneBattle.BATTLESCENE.end) { this.result.Render(dg); } if (this.printdelete > 0 && this.simultaneousdel >= 2 && !this.blackOut) { this._rect = new Rectangle(456, 32 + (simultaneousdel - 2) * 16, 112, 16); this._position = new Vector2(120f, 24f); dg.DrawImage(dg, "battleobjects", this._rect, false, this._position, Color.White); } else if (this.counterPrintTime > 0) { this._rect = new Rectangle(536, 224, 96, 16); this._position = new Vector2(120f, 24f); dg.DrawImage(dg, "battleobjects", this._rect, false, this._position, Color.White); } if (this.nowscene == SceneBattle.BATTLESCENE.pause) { this._rect = new Rectangle(208, 0, 40, 16); this._position = new Vector2(120f, 60f); dg.DrawImage(dg, "battleobjects", this._rect, false, this._position, Color.White); } if (this.nowscene == SceneBattle.BATTLESCENE.printstart) { this._position = new Vector2(120f, 80f); this._rect = new Rectangle(456, 64, 152, 16); float scall = this.startflame >= 15 ? (this.startflame >= 17 ? (this.startflame >= 60 ? (float)(1.0 - (this.startflame - 60) * 0.0599999986588955) : 1f) : 1.02f) : startflame * 0.06f; dg.DrawImage(dg, "battleobjects", this._rect, false, this._position, scall, 0.0f, Color.White); int[] numArray = this.ChangeCount(this.battlecount + 1); foreach (var data in ((IEnumerable <int>)numArray).Select((v, i) => new { v, i })) { this._rect = new Rectangle(data.v * 8, 104, 8, 16); this._position = new Vector2(120 + (numArray.Length - 1) * 4 - data.i * 8, 79f); dg.DrawImage(dg, "font", this._rect, false, this._position, scall, 0.0f, Color.FromArgb(byte.MaxValue, byte.MaxValue, 230, 30)); } } Color color1 = this.nowscene != SceneBattle.BATTLESCENE.dead ? Color.FromArgb(fadealpha, byte.MaxValue, byte.MaxValue, byte.MaxValue) : Color.FromArgb(fadealpha, 0, 0, 0); this._rect = new Rectangle(0, 0, 240, 160); this._position = new Vector2(0.0f, 0.0f); dg.DrawImage(dg, "fadescreen", this._rect, true, this._position, color1); if (this.eventmanager.playevent) { this.eventmanager.Render(dg); } this.Remove(); }
private void UpdateBattle() { if (this.bashtime > 0) { --this.bashtime; } List <CharacterBase> list = new List <CharacterBase>().Concat <CharacterBase>(this.enemys.Cast <CharacterBase>()).ToList <CharacterBase>(); list.Add(this.player); this.redRight = 0; this.blueLeft = 5; foreach (CharacterBase characterBase in list) { if (characterBase.union == Panel.COLOR.red) { if (this.redRight < characterBase.position.X) { this.redRight = characterBase.position.X; } } else if (this.blueLeft > characterBase.position.X) { this.blueLeft = characterBase.position.X; } } foreach (CharacterBase allObject in this.AllObjects()) { if (!this.blackOut || allObject.blackOutObject) { allObject.Updata(); } if (this.blackOut) { if (allObject is Player player) { if (this.blackOutChips.Count > 0) { if (!this.blackOutChips[0].blackOutLend && this.blackOutChips[0].userNum != player.number && this.blackOutChips.Count < 3) { player.BlackOutControl(); } if (this.blackOutChips[0].userNum == player.number && this.blackOutChips[0].BlackOut(player, this, this.blackOutChips[0].name, this.blackOutChips[0].PowerToString(player))) { this.blackOutChips[0].ActionBO(player, this); } } } else if (this.blackOutChips.Count > 0 && this.blackOutChips[0].userNum == allObject.number && this.blackOutChips[0].BlackOut(allObject, this, this.blackOutChips[0].name, this.blackOutChips[0].PowerToString(allObject))) { this.blackOutChips[0].ActionBO(allObject, this); } } allObject.ShakingSingle(); } foreach (EnemyBase enemy in this.enemys) { if (enemy.whitetime > 0) { --enemy.whitetime; } } Panel[,] panel = this.panel; int upperBound1 = panel.GetUpperBound(0); int upperBound2 = panel.GetUpperBound(1); for (int lowerBound1 = panel.GetLowerBound(0); lowerBound1 <= upperBound1; ++lowerBound1) { for (int lowerBound2 = panel.GetLowerBound(1); lowerBound2 <= upperBound2; ++lowerBound2) { panel[lowerBound1, lowerBound2].Update(); } } this.UpdateAllObject(); if (this.nowscene != SceneBattle.BATTLESCENE.end) { if (this.manyenemys <= 0) { return; } this.HitCheck(); if (!this.blackOut) { this.customgauge.Update(); ++this.time[0]; if (this.time[0] >= 60) { this.time[0] = 0; ++this.time[1]; if (this.time[1] >= 60) { this.time[1] = 0; if (this.time[2] < 99) { ++this.time[2]; } } } } } else { this.result.Update(); } this.Remove(); }
public override void Updata() { if (this.manyenemys <= 0 && this.nowscene != SceneBattle.BATTLESCENE.end && !this.blackOut && !this.stopEnd) { this.savedata.selectQuestion = 0; this.BattleEnd(false); } Panel[,] panel = this.panel; int upperBound1 = panel.GetUpperBound(0); int upperBound2 = panel.GetUpperBound(1); for (int lowerBound1 = panel.GetLowerBound(0); lowerBound1 <= upperBound1; ++lowerBound1) { for (int lowerBound2 = panel.GetLowerBound(1); lowerBound2 <= upperBound2; ++lowerBound2) { panel[lowerBound1, lowerBound2].BrightReset(); } } this.back.Update(); if (this.nowscene == SceneBattle.BATTLESCENE.init) { this.EnemyInit(); } if (this.eventmanager.playevent) { this.eventmanager.UpDate(); foreach (Player player in this.players) { player.mind.Update(); } } else { switch (this.nowscene) { case SceneBattle.BATTLESCENE.printstart: if (this.startflame > 75) { this.nowscene = SceneBattle.BATTLESCENE.custom; } ++this.startflame; break; case SceneBattle.BATTLESCENE.battle: case SceneBattle.BATTLESCENE.end: case SceneBattle.BATTLESCENE.dead: this.UpdateBattle(); break; } if (this.nowscene == SceneBattle.BATTLESCENE.custom) { this.custom.Update(); } if (this.nowscene == SceneBattle.BATTLESCENE.dead) { if (this.fadealpha < byte.MaxValue) { this.fadealpha += 5; } else { this.fadealpha = byte.MaxValue; this.sound.StopBGM(); this.Death(); } } if (this.nowscene == SceneBattle.BATTLESCENE.battle && Input.IsPress(Button._Start)) { this.nowscene = SceneBattle.BATTLESCENE.pause; this.sound.PlaySE(SoundEffect.pause); } else if (this.nowscene == SceneBattle.BATTLESCENE.pause && Input.IsPress(Button._Start)) { this.nowscene = SceneBattle.BATTLESCENE.battle; this.sound.PlaySE(SoundEffect.pause); } if (!this.blackOut) { if (this.printdelete > 0) { --this.printdelete; } if (this.simultaneoustime > 0) { --this.simultaneoustime; } if (this.counterPrintTime > 0) { --this.counterPrintTime; } } foreach (CharacterBase characterBase in this.AllChara()) { characterBase.HPDown(); } this.mind.Update(); } }