private void EnemyInit() { if (this.fadealpha == 0) { if (this.initcount < manyenemys) { ++this.initflame; if (this.enemys[this.initcount].EnemyInitAction()) { this.initflame = 0; ++this.initcount; } } else { this.nowscene = this.battlecount < 0 ? (this.nowscene = SceneBattle.BATTLESCENE.custom) : (this.nowscene = SceneBattle.BATTLESCENE.printstart); } } else { if (this.fadealpha == byte.MaxValue) { this.sound.StartBGM(this.bgm); } this.fadealpha -= 15; } }
public SceneBattle( IAudioEngine s, ShanghaiEXE p, SceneMain main, EventManager e, bool res, int count, bool gameover, string bgm, SaveData save) : base(s, p, save) { p.TexClear(false); this.main = main; this.gameover = gameover; this.bgm = bgm; this.doresult = res; for (int x = 0; x < this.panel.GetLength(0); ++x) { for (int y = 0; y < this.panel.GetLength(1); ++y) { this.panel[x, y] = new Panel(this.sound, this, x, y) { state = Panel.PANEL._nomal, color = x >= 3 ? Panel.COLOR.blue : Panel.COLOR.red }; this.panel[x, y].colordefault = this.panel[x, y].color; if (x == 0 || x == 5) { this.panel[x, y].inviolability = true; } } } this.battlenum = this.savedata.ValList[9]; this.tutorial = this.parent.tutorial; this.eventmanager = e; this.playerstatus = main; this.positionHPwindow = new Vector2(24f, 8f); this.mind = new MindWindow(this.sound, this, this.savedata); this.player = new Player(this.sound, this, 1, 1, main, this.savedata.busterspec[0], this.savedata.busterspec[1], this.savedata.busterspec[2], this.mind, this.savedata); this.players.Add(this.player); this.parent = p; this.back = new BackDefault(); this.nowscene = SceneBattle.BATTLESCENE.init; this.custom = new Custom(this.sound, this, main, this.player, this.savedata); this.customgauge = new CustomGauge(this.sound); this.battlecount = count; AttackBase.AtIDBlue = 0L; AttackBase.AtIDRed = 0L; }
public void BattleEnd(bool escape) { this.main.FolderReset(); this.nowscene = SceneBattle.BATTLESCENE.end; this.savedata.FlagList[6] = !escape; this.player.chargeTime = 0; this.player.chargeMax = false; this.player.charge = false; this.result = new Result(this.sound, this, this.playerstatus, this.time, this.simultaneousdel, this.player.damaged, this.player.manymove, this.player.stylepoint, this.player, this.savedata, escape); if (!escape) { this.SetBustedFlags(); } for (int index = 0; index < this.player.haveChip.Count; ++index) { this.player.haveChip[index] = new ChipBase(this.sound); } this.player.numOfChips = 0; }
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(); } }