public override void Initialize() { base.Initialize(); EliminationBoss boss = new EliminationBoss(Game, player, spriteSheet, this, 0); untriggeredEvents.Add(boss); LevelEvent swarm = new EvenSwarm(Game, player, spriteSheet, this, EnemyType.meteor, 0, 35000, 30); SetupCreature testSetup = new SetupCreature(); testSetup.SetMovement(Movement.FullStop); swarm.CreatureSetup(testSetup); untriggeredEvents.Add(swarm); LevelEvent trueMessage = new SimpleMessageVertical(Game, player, spriteSheet, this, 2000, "HELLUUU!!"); untriggeredEvents.Add(trueMessage); LevelEvent trueMessage2 = new SimpleMessageVertical(Game, player, spriteSheet, this, 3000, "HELLUUU2!!"); untriggeredEvents.Add(trueMessage2); LevelEvent trueMessage3 = new SimpleMessageVertical(Game, player, spriteSheet, this, 5000, "HELLUUU33!!"); untriggeredEvents.Add(trueMessage3); LevelEvent message = new SingleEnemy(Game, player, spriteSheet, this, EnemyType.R_mosquito, 3000, 100); untriggeredEvents.Add(message); SetCustomVictoryCondition(LevelObjective.Boss, -1); }
private void CreateDurationEvent(String state, float startTime, float endTime) { state = Regex.Replace(state, " ", ""); String enemyData = state.Substring(0, 1); String movementData = state.Substring(1, 2); String eventData = state.Substring(3, 1); SortedDictionary <string, int> settings = new SortedDictionary <string, int>(); MatchCollection matches = Regex.Matches(state, @"([A-Z])(\d+)"); foreach (Match match in matches) { String letter = match.Groups[1].Value; String valueString = match.Groups[2].Value; int value = Convert.ToInt32(valueString); settings.Add(letter, value); } //String enemy = SaveLoadStringLibrary.GetEnemyTypeFromSaveString(enemyData); String enemy = enemyData; EnemyType identifier = DataConversionLibrary.GetEnemyEnumFromString(enemy); Movement movement = DataConversionLibrary.GetMovementEnumFromString(movementData); switch (eventData) { case "E": { int density = settings["D"]; LevelEvent lvEv = new EvenSwarm(Game, player, spriteSheet, this, identifier, 1000 * startTime, 1000 * (endTime - startTime), density); SetMovement(lvEv, movement); untriggeredEvents.Add(lvEv); break; } case "G": { int startDensity = settings["S"]; int peakDensity = settings["P"]; int peakTime = settings["T"]; LevelEvent lvEv = new GradientSwarm(Game, player, spriteSheet, this, identifier, 1000 * startTime, 1000 * (endTime - startTime), peakTime, startDensity, peakDensity); SetMovement(lvEv, movement); untriggeredEvents.Add(lvEv); break; } } }