using System; using System.Collections.Generic; using System.Text; using Microsoft.Xna.Framework; using Sprint3_actual.BorderElements; using Sprint3_actual.Text; using Sprint3_actual.SoundManagement; namespace Sprint3_actual.Everything_NPC.OldWomanPhases { public class IntroPhase : IPhase { private room room; private Game1 game; private int roomXMod; private int roomYMod; private bool finished; private int currentTime; private const int maxTime = 9000; private const int textTime2 = 5000; private bool text2Printed; private IBorder textBox; public IntroPhase(room room, Game1 game, int roomXMod, int roomYMod) { this.room = room; this.game = game; this.roomXMod = roomXMod; this.roomYMod = roomYMod; this.text2Printed = false; this.textBox = BorderElementsFactory.Instance.CreateTextBox(96 + roomXMod, 432 + roomYMod); this.currentTime = 0; room.Addons[0] = textBox; } public void Update(GameTime gameTime) { if (currentTime == 0) { SoundEngine.Instance.stopMusic(); room.TextList.Add(TextFactory.Instance.CreateText(1, 215 + roomXMod, 468 + roomYMod)); game.Player.SetPosition(96 + roomXMod, 240 + roomYMod); } this.currentTime += GlobalVars.gameTime.ElapsedGameTime.Milliseconds; if(currentTime > maxTime) { if (!finished) { SoundEngine.Instance.startBossMusic(); } finished = true; room.Addons[0] = null; } if(!text2Printed && currentTime > textTime2) { room.TextList.Add(TextFactory.Instance.CreateText(2, 215 + roomXMod, 468 + roomYMod)); text2Printed = true; } if(!text2Printed && currentTime > textTime2) { room.TextList.Add(TextFactory.Instance.CreateText(2, 215 + roomYMod, 468 + roomYMod)); text2Printed = true; } } public bool IsFinished() { return finished; } } }