Example #1
0
 public EnemyGenerator(ObjectType p_spawnType, ColorSwaps p_spawnColor, int p_delay)
 {
     base.type = ObjectType.EnemyGenerator;
     this.spawnType = p_spawnType;
     this.spawnColor = p_spawnColor;
     this.delay = p_delay;
     this.range = 150;
     this.debugTexture = new GameTexture("cursor.bmp", new Size(0x10, 0x10), TextureDisposePolicy.DisposeOnSceneChange);
     this.generator = new ObjectGenerator(new PointF(0f, 0f), this.spawnType.ToString(), this.spawnColor, false, this.delay);
 }
Example #2
0
 public TreasureChest(int p_id, string[] p_items, string p_mapName, Direction p_direction)
 {
     this.direction = p_direction;
     this.id = p_id;
     this.mapName = p_mapName;
     this.itemGenerator = new ObjectGenerator(base.location, p_items, ColorSwaps.Normal, true, 30);
     if (this.direction == Direction.Left)
     {
         this.itemGenerator.SetSpawnSpeeds(new Speed(-1f, 0.1f, -1f), new Speed(-6f, 1.2f, 4f));
     }
     else
     {
         this.itemGenerator.SetSpawnSpeeds(new Speed(1f, 0.1f, 1f), new Speed(-6f, 1.2f, 4f));
     }
     base.texture = new GameTexture("treasure.bmp", new Size(0x20, 0x20), TextureDisposePolicy.NeverDispose);
     base.ObjClass = ObjectClass.Special;
     base.type = ObjectType.TreasureChest;
     this.opened = false;
     this.size = new Size(0x20, 0x20);
 }
 public void SetMoneyGenerator(ObjectGenerator g)
 {
     this.moneyGenerator = g;
 }
Example #4
0
 private bool HandleEvents()
 {
     if (this.currentAction == null)
     {
         this.CheckProximity();
     }
     if (this.currentAction.DoAction(this.thisObject))
     {
         if (this.hitPoints <= 0)
         {
             this.currentAction.Finish();
             if (this.thisObject.Type == ObjectType.FinalDragon)
             {
                 if (this.timerOffset <= 0)
                 {
                     this.timerOffset = 0x3e7;
                     GameEngine.Game.CurrentMap.HandleFinalBossDeath();
                     return true;
                 }
             }
             else if (this.thisObject.Type == ObjectType.MechaDragonX)
             {
                 if (this.timerOffset <= 0)
                 {
                     this.timerOffset = 0x3e7;
                     GameEngine.Game.CurrentMap.HandleMechaXDeath(this.thisObject);
                     return false;
                 }
             }
             else if (this.thisObject.ObjClass == ObjectClass.Boss)
             {
                 Shoot[] shootArray = new Shoot[8];
                 int num = 8;
                 shootArray[0] = new Shoot(ObjectType.BossDieStar, 0, 0f, (float) -num, 1, 1, false, false, SoundEffects.Nothing);
                 shootArray[1] = new Shoot(ObjectType.BossDieStar, 0, (float) -num, (float) -num, 1, 1, false, false, SoundEffects.Nothing);
                 shootArray[2] = new Shoot(ObjectType.BossDieStar, 0, (float) -num, 0f, 1, 1, false, false, SoundEffects.Nothing);
                 shootArray[3] = new Shoot(ObjectType.BossDieStar, 0, (float) -num, (float) num, 1, 1, false, false, SoundEffects.Nothing);
                 shootArray[4] = new Shoot(ObjectType.BossDieStar, 0, 0f, (float) num, 1, 1, false, false, SoundEffects.Nothing);
                 shootArray[5] = new Shoot(ObjectType.BossDieStar, 0, (float) num, 0f, 1, 1, false, false, SoundEffects.Nothing);
                 shootArray[6] = new Shoot(ObjectType.BossDieStar, 0, (float) num, (float) -num, 1, 1, false, false, SoundEffects.Nothing);
                 shootArray[7] = new Shoot(ObjectType.BossDieStar, 0, (float) num, (float) num, 1, 1, false, false, SoundEffects.Nothing);
                 foreach (Shoot shoot in shootArray)
                 {
                     shoot.DoAction(this.thisObject);
                 }
                 string[] strArray = new string[1];
                 if (this.thisObject.Type == ObjectType.MechaDragon)
                 {
                     strArray = new string[] { "GOLD|1|5", "GOLD|1|5", "GOLD|5|10" };
                 }
                 else if (this.thisObject.Type == ObjectType.MummyDragon)
                 {
                     strArray = new string[] { "GOLD|1|10", "GOLD|1|10", "GOLD|5|15" };
                 }
                 else if (this.thisObject.Type == ObjectType.ZombieDragon)
                 {
                     strArray = new string[] { "GOLD|1|20", "GOLD|2|10", "GOLD|10|30" };
                 }
                 else if (this.thisObject.Type == ObjectType.PirateDragon)
                 {
                     strArray = new string[] { "GOLD|10|20", "GOLD|5|15", "GOLD|10|30" };
                 }
                 else if (this.thisObject.Type == ObjectType.DaiymoDragon)
                 {
                     strArray = new string[] { "GOLD|20|50", "GOLD|10|30", "GOLD|20|40" };
                 }
                 else if (this.thisObject.Type == ObjectType.PolarDragon)
                 {
                     strArray = new string[] { "GOLD|50|100", "GOLD|40|60", "GOLD|20|40" };
                 }
                 else if (this.thisObject.Type == ObjectType.VampireDragon)
                 {
                     GameEngine.Game.CurrentMap.RevealDoor(false);
                     return false;
                 }
                 GameObject obj2 = ObjectFactory.CreateObjectOfType(ObjectType.TransformSpirit, ColorSwaps.Normal, Direction.Right, "", 0);
                 PointF tf = new PointF(this.thisObject.Location.X, this.thisObject.Location.Y - 48f);
                 obj2.Location = tf;
                 obj2.Solid = false;
                 TransformSpiritBehavior objectBehavior = (TransformSpiritBehavior) obj2.ObjectBehavior;
                 ObjectGenerator g = new ObjectGenerator(new PointF(tf.X - 16f, tf.Y), strArray, ColorSwaps.Red, false, 0x23);
                 g.SetSpawnSpeeds(new Speed(0f, 0f, 0f), new Speed(-6f, 1f, 4f));
                 GameEngine.Game.CurrentMap.AddObject(obj2);
                 objectBehavior.SetMoneyGenerator(g);
                 g.SetActivated(true);
             }
             else
             {
                 this.DropItem();
             }
             return false;
         }
         if (this.actionQueue.Count == 0)
         {
             this.CheckProximity();
         }
         else
         {
             this.currentAction.Finish();
             this.currentAction = this.actionQueue.Dequeue();
             this.currentAction.Reset();
         }
     }
     return true;
 }