Exemple #1
0
            /// <summary>
            /// Adds an event to the appropriate list for its type; returns the event.
            /// </summary>
            public Event Add(Event evnt)
            {
                switch (evnt)
                {
                case Event.Light e: Lights.Add(e); break;

                case Event.Sound e: Sounds.Add(e); break;

                case Event.SFX e: SFX.Add(e); break;

                case Event.Wind e: Wind.Add(e); break;

                case Event.Treasure e: Treasures.Add(e); break;

                case Event.Generator e: Generators.Add(e); break;

                case Event.Message e: Messages.Add(e); break;

                case Event.ObjAct e: ObjActs.Add(e); break;

                case Event.SpawnPoint e: SpawnPoints.Add(e); break;

                case Event.MapOffset e: MapOffsets.Add(e); break;

                case Event.Navmesh e: Navmeshes.Add(e); break;

                case Event.Environment e: Environments.Add(e); break;

                case Event.PseudoMultiplayer e: PseudoMultiplayers.Add(e); break;

                default:
                    throw new ArgumentException($"Unrecognized type {evnt.GetType()}.", nameof(evnt));
                }
                return(evnt);
            }
Exemple #2
0
        /// <summary>
        /// Update the observable collections
        /// </summary>
        public void UpdateInventoryCategories()
        {
            Soldiers.Clear();
            SeigeWeapons.Clear();
            Treasures.Clear();
            Buffs.Clear();

            foreach (var gameItemQuantity in _inventory)
            {
                if (gameItemQuantity.GameItem is Soldier)
                {
                    Soldiers.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameItem is SeigeWeapon)
                {
                    SeigeWeapons.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameItem is Treasure)
                {
                    Treasures.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameItem is Buff)
                {
                    Buffs.Add(gameItemQuantity);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// Update the observable collections
        /// </summary>
        public void UpdateInventoryCategories()
        {
            Treasures.Clear();
            Gems.Clear();
            ArmorSet.Clear();
            Buffs.Clear();

            foreach (var gameItemQuantity in _inventory)
            {
                if (gameItemQuantity.GameItem is Treasure)
                {
                    Treasures.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameItem is Gem)
                {
                    Gems.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameItem is ArmorSet)
                {
                    ArmorSet.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameItem is Buff)
                {
                    Buffs.Add(gameItemQuantity);
                }
            }
        }
Exemple #4
0
            /// <summary>
            /// Adds an event to the appropriate list for its type; returns the event.
            /// </summary>
            public Event Add(Event evnt)
            {
                switch (evnt)
                {
                case Event.Treasure e: Treasures.Add(e); break;

                case Event.Generator e: Generators.Add(e); break;

                case Event.ObjAct e: ObjActs.Add(e); break;

                case Event.MapOffset e: MapOffsets.Add(e); break;

                case Event.PseudoMultiplayer e: PseudoMultiplayers.Add(e); break;

                case Event.PatrolInfo e: PatrolInfo.Add(e); break;

                case Event.PlatoonInfo e: PlatoonInfo.Add(e); break;

                case Event.Other e: Others.Add(e); break;

                default:
                    throw new ArgumentException($"Unrecognized type {evnt.GetType()}.", nameof(evnt));
                }
                return(evnt);
            }
Exemple #5
0
 public void UpdateInventoryCategories()
 {
     Potions.Clear();
     Treasures.Clear();
     Weapons.Clear();
     Allies.Clear();
     foreach (var GameItem in _inventory)
     {
         if (GameItem.GameItem is Potion)
         {
             Potions.Add(GameItem);
         }
         if (GameItem.GameItem is Treasure)
         {
             Treasures.Add(GameItem);
         }
         if (GameItem.GameItem is Weapon)
         {
             Weapons.Add(GameItem);
         }
         if (GameItem.GameItem is Allies)
         {
             Allies.Add(GameItem);
         }
     }
 }
Exemple #6
0
        /// <summary>
        /// initialize the universe with all of the treasures
        /// </summary>
        private void IntializeUniverseTreasures()
        {
            Treasures.Add(new Treasure
            {
                Name                = "Trantorian Ruby",
                TreasureType        = Treasure.Type.Ruby,
                GameObjectID        = 1,
                Description         = "A deep red ruby the size of an egg.",
                SpaceTimeLocationID = 2,
                HasValue            = true,
                Value               = 25,
                CanAddToInventory   = true
            });

            Treasures.Add(new Treasure
            {
                Name                = "Lodestone",
                TreasureType        = Treasure.Type.Lodestone,
                GameObjectID        = 2,
                Description         = "A deep red ruby the size of an egg.",
                SpaceTimeLocationID = 3,
                HasValue            = true,
                Value               = 15,
                CanAddToInventory   = true
            });
        }
        /// <summary>
        /// initialize the kindom with all of the treasures
        /// </summary>
        private void IntializeKingdomTreasures()
        {
            Treasures.Add(new Treasure
            {
                Name              = "Golden Bear Cloak",
                TreasureType      = Treasure.Type.Armor,
                GameObjectID      = 1,
                Description       = "A tough cloak to keep you safe and warm",
                SwampLocationID   = 2,
                HasValue          = true,
                Value             = 5000,
                CanAddToInventory = true
            });

            Treasures.Add(new Treasure
            {
                Name              = "Silver War Axe",
                TreasureType      = Treasure.Type.Weapon,
                GameObjectID      = 2,
                Description       = "A large silver axe, capable of splitting a horse in two in one swing.",
                SwampLocationID   = 3,
                HasValue          = true,
                Value             = 5000,
                CanAddToInventory = true
            });

            Treasures.Add(new Treasure
            {
                Name              = "Golden Marble",
                TreasureType      = Treasure.Type.Weapon,
                GameObjectID      = 3,
                Description       = "A Marble of purest gold. Also hits with a solid thunk when thrown.",
                SwampLocationID   = 3,
                HasValue          = true,
                Value             = 50,
                CanAddToInventory = true
            });
            Treasures.Add(new Treasure
            {
                Name              = "Iron Helmet",
                TreasureType      = Treasure.Type.Armor,
                GameObjectID      = 4,
                Description       = "Sturdy Helmet to protect your thick noggin.",
                SwampLocationID   = 1,
                HasValue          = true,
                Value             = 5000,
                CanAddToInventory = true
            });
        }
        /// <summary>
        /// initialize the universe with all of the treasures
        /// </summary>
        private void IntializeUniverseTreasures()
        {
            Treasures.Add(new Treasure
            {
                Name         = "Star of Elendil",
                TreasureType = Treasure.Type.Ruby,
                GameObjectID = 1,
                Description  = "A jewel made of \"elvish crystal\" and " +
                               "the chief symbol of the royal line of Arnor",
                SpaceTimeLocationID = 2,
                HasValue            = true,
                Value             = 150,
                CanAddToInventory = true
            });

            Treasures.Add(new Treasure
            {
                Name                = "Star of the Dúnedain",
                TreasureType        = Treasure.Type.Lodestone,
                GameObjectID        = 2,
                Description         = "A silver brooch, shaped like a many-rayed star, worn by the Arnor-descended Rangers of the North.",
                SpaceTimeLocationID = 1,
                HasValue            = true,
                Value               = 75,
                CanAddToInventory   = true
            });

            Treasures.Add(new Treasure
            {
                Name         = "Horn of Gondor",
                TreasureType = Treasure.Type.Lodestone,
                GameObjectID = 3,
                Description  = "A large war-horn tipped with silver written in ancient characters. " +
                               "Belonging to the kings son, someone would certainly be glad reward its return. ",
                SpaceTimeLocationID = 4,
                HasValue            = true,
                Value             = 150,
                CanAddToInventory = true
            });
        }
            /// <summary>
            /// Adds an event to the appropriate list for its type; returns the event.
            /// </summary>
            public Event Add(Event evnt)
            {
                switch (evnt)
                {
                case Event.Light e: Lights.Add(e); break;

                case Event.Sound e: Sounds.Add(e); break;

                case Event.SFX e: SFX.Add(e); break;

                case Event.Wind e: Wind.Add(e); break;

                case Event.Treasure e: Treasures.Add(e); break;

                case Event.Generator e: Generators.Add(e); break;

                case Event.Message e: Messages.Add(e); break;

                default:
                    throw new ArgumentException($"Unrecognized type {evnt.GetType()}.", nameof(evnt));
                }
                return(evnt);
            }
Exemple #10
0
 /// <summary>
 /// initialize the Castle with all of the treasures
 /// </summary>
 private void IntializeCastleTreasures()
 {
     Treasures.Add(new Treasure
     {
         Name              = "Denari",
         TreasureType      = Treasure.Coin.Denari,
         GameObjectID      = 1,
         Description       = Environment.NewLine + "\t" + "A small silver coin.",
         RoomID            = 1,
         HasValue          = true,
         Value             = 25,
         CanAddToInventory = true
     });
     Treasures.Add(new Treasure
     {
         Name              = "Denari",
         TreasureType      = Treasure.Coin.Denari,
         GameObjectID      = 2,
         Description       = Environment.NewLine + "\t" + "A small silver coin.",
         RoomID            = 2,
         HasValue          = true,
         Value             = 25,
         CanAddToInventory = true
     });
     Treasures.Add(new Treasure
     {
         Name              = "Denari",
         TreasureType      = Treasure.Coin.Denari,
         GameObjectID      = 3,
         Description       = Environment.NewLine + "\t" + "A small silver coin.",
         RoomID            = 4,
         HasValue          = true,
         Value             = 25,
         CanAddToInventory = true
     });
     Treasures.Add(new Treasure
     {
         Name              = "Denari",
         TreasureType      = Treasure.Coin.Denari,
         GameObjectID      = 4,
         Description       = Environment.NewLine + "\t" + "A small silver coin.",
         RoomID            = 5,
         HasValue          = true,
         Value             = 25,
         CanAddToInventory = true
     });
     Treasures.Add(new Treasure
     {
         Name              = "Denari",
         TreasureType      = Treasure.Coin.Denari,
         GameObjectID      = 5,
         Description       = Environment.NewLine + "\t" + "A small silver coin.",
         RoomID            = 5,
         HasValue          = true,
         Value             = 25,
         CanAddToInventory = true
     });
     Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 6,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = 6,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     });
     Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 7,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = 3,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     });
     Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 8,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = -1,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     });
     Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 9,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = -1,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     }); Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 10,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = -1,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     }); Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 11,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = -1,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     }); Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 12,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = -1,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     }); Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 13,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = -1,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     }); Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 14,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = -1,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     }); Treasures.Add(new Treasure
     {
         Name              = "Florin",
         TreasureType      = Treasure.Coin.Florin,
         GameObjectID      = 15,
         Description       = Environment.NewLine + "\t" + "A gold coin decorated with a fleur-de-lis on one side and an image of St. John the Baptist on the other.",
         RoomID            = -1,
         HasValue          = true,
         Value             = 100,
         CanAddToInventory = true
     });
 }
Exemple #11
0
            internal override Event ReadEntry(BinaryReaderEx br)
            {
                EventType type = br.GetEnum32 <EventType>(br.Position + 0xC);

                switch (type)
                {
                case EventType.Treasure:
                    var treasure = new Event.Treasure(br);
                    Treasures.Add(treasure);
                    return(treasure);

                case EventType.Generator:
                    var generator = new Event.Generator(br);
                    Generators.Add(generator);
                    return(generator);

                case EventType.ObjAct:
                    var objAct = new Event.ObjAct(br);
                    ObjActs.Add(objAct);
                    return(objAct);

                case EventType.MapOffset:
                    var mapOffset = new Event.MapOffset(br);
                    MapOffsets.Add(mapOffset);
                    return(mapOffset);

                case EventType.WalkRoute:
                    var walkRoute = new Event.WalkRoute(br);
                    WalkRoutes.Add(walkRoute);
                    return(walkRoute);

                case EventType.GroupTour:
                    var groupTour = new Event.GroupTour(br);
                    GroupTours.Add(groupTour);
                    return(groupTour);

                case EventType.Event17:
                    var event17 = new Event.Event17(br);
                    Event17s.Add(event17);
                    return(event17);

                case EventType.Event18:
                    var event18 = new Event.Event18(br);
                    Event18s.Add(event18);
                    return(event18);

                case EventType.Event20:
                    var event20 = new Event.Event20(br);
                    Event20s.Add(event20);
                    return(event20);

                case EventType.Event21:
                    var event21 = new Event.Event21(br);
                    Event21s.Add(event21);
                    return(event21);

                case EventType.PartsGroup:
                    var partsGroup = new Event.PartsGroup(br);
                    PartsGroups.Add(partsGroup);
                    return(partsGroup);

                case EventType.Event23:
                    var event23 = new Event.Event23(br);
                    Event23s.Add(event23);
                    return(event23);

                case EventType.AutoDrawGroup:
                    var autoDrawGroup = new Event.AutoDrawGroup(br);
                    AutoDrawGroups.Add(autoDrawGroup);
                    return(autoDrawGroup);

                case EventType.Other:
                    var other = new Event.Other(br);
                    Others.Add(other);
                    return(other);

                default:
                    throw new NotImplementedException($"Unimplemented model type: {type}");
                }
            }
            internal override Event ReadEntry(BinaryReaderEx br)
            {
                EventType type = br.GetEnum32 <EventType>(br.Position + 8);

                switch (type)
                {
                case EventType.Light:
                    var light = new Event.Light(br);
                    Lights.Add(light);
                    return(light);

                case EventType.Sound:
                    var sound = new Event.Sound(br);
                    Sounds.Add(sound);
                    return(sound);

                case EventType.SFX:
                    var sfx = new Event.SFX(br);
                    SFXs.Add(sfx);
                    return(sfx);

                case EventType.WindSFX:
                    var windSFX = new Event.WindSFX(br);
                    WindSFXs.Add(windSFX);
                    return(windSFX);

                case EventType.Treasure:
                    var treasure = new Event.Treasure(br);
                    Treasures.Add(treasure);
                    return(treasure);

                case EventType.Generator:
                    var generator = new Event.Generator(br);
                    Generators.Add(generator);
                    return(generator);

                case EventType.Message:
                    var message = new Event.Message(br);
                    Messages.Add(message);
                    return(message);

                case EventType.ObjAct:
                    var objAct = new Event.ObjAct(br);
                    ObjActs.Add(objAct);
                    return(objAct);

                case EventType.SpawnPoint:
                    var spawnPoint = new Event.SpawnPoint(br);
                    SpawnPoints.Add(spawnPoint);
                    return(spawnPoint);

                case EventType.MapOffset:
                    var mapOffset = new Event.MapOffset(br);
                    MapOffsets.Add(mapOffset);
                    return(mapOffset);

                case EventType.Navmesh:
                    var navmesh = new Event.Navmesh(br);
                    Navmeshes.Add(navmesh);
                    return(navmesh);

                case EventType.Environment:
                    var environment = new Event.Environment(br);
                    Environments.Add(environment);
                    return(environment);

                case EventType.PseudoMultiplayer:
                    var pseudoMultiplayer = new Event.PseudoMultiplayer(br);
                    PseudoMultiplayers.Add(pseudoMultiplayer);
                    return(pseudoMultiplayer);

                default:
                    throw new NotImplementedException($"Unsupported event type: {type}");
                }
            }
Exemple #13
0
        /// <summary>
        /// initialize the future with all of the treasures
        /// </summary>
        private void IntializeFutureTreasures()
        {
            Treasures.Add(new Treasure
            {
                Name               = "Keys",
                TreasureType       = Treasure.Type.Keys,
                GameObjectID       = 1,
                Description        = "Keys to the Delorean that can take you anywhere.",
                YearTimeLocationID = 2,
                HasValue           = true,
                Value              = 50,
                CanAddToInventory  = true
            });

            Treasures.Add(new Treasure
            {
                Name               = "Cane",
                TreasureType       = Treasure.Type.Cane,
                GameObjectID       = 2,
                Description        = "A gold crusted knuckle handle is at the tip of the cane.",
                YearTimeLocationID = 3,
                HasValue           = false,
                Value              = 15,
                CanAddToInventory  = true
            });

            Treasures.Add(new Treasure
            {
                Name               = "Gold Coin",
                TreasureType       = Treasure.Type.GoldCoin,
                GameObjectID       = 3,
                Description        = "This coin can pay for a lot in 1885.",
                YearTimeLocationID = 5,
                HasValue           = true,
                Value              = 35,
                CanAddToInventory  = true
            });

            Treasures.Add(new Treasure
            {
                Name               = "Map",
                TreasureType       = Treasure.Type.Map,
                GameObjectID       = 4,
                Description        = "This map has been around for centuries and is the only thing that will help navigate the future.",
                YearTimeLocationID = 1,
                HasValue           = true,
                Value              = 100,
                CanAddToInventory  = false
            });

            Treasures.Add(new Treasure
            {
                Name               = "Phone Book",
                TreasureType       = Treasure.Type.PhoneBook,
                GameObjectID       = 5,
                Description        = "This black pocket phone book has all the phone numbers needed to get a hold of everyone in the future.",
                YearTimeLocationID = 6,
                HasValue           = false,
                Value              = 40,
                CanAddToInventory  = true
            });

            Treasures.Add(new Treasure
            {
                Name               = "Nikes",
                TreasureType       = Treasure.Type.Nikes,
                GameObjectID       = 6,
                Description        = "These Nikes are the second Air Jordan's that everyone has been looking for.",
                YearTimeLocationID = 5,
                HasValue           = true,
                Value              = 80,
                CanAddToInventory  = true
            });
        }
            public void Add(IMsbEvent item)
            {
                switch (item)
                {
                case Event.Light e:
                    Lights.Add(e);
                    break;

                case Event.Sound e:
                    Sounds.Add(e);
                    break;

                case Event.SFX e:
                    SFXs.Add(e);
                    break;

                case Event.WindSFX e:
                    WindSFXs.Add(e);
                    break;

                case Event.Treasure e:
                    Treasures.Add(e);
                    break;

                case Event.Generator e:
                    Generators.Add(e);
                    break;

                case Event.Message e:
                    Messages.Add(e);
                    break;

                case Event.ObjAct e:
                    ObjActs.Add(e);
                    break;

                case Event.SpawnPoint e:
                    SpawnPoints.Add(e);
                    break;

                case Event.MapOffset e:
                    MapOffsets.Add(e);
                    break;

                case Event.Navmesh e:
                    Navmeshes.Add(e);
                    break;

                case Event.Environment e:
                    Environments.Add(e);
                    break;

                case Event.PseudoMultiplayer e:
                    PseudoMultiplayers.Add(e);
                    break;

                default:
                    throw new ArgumentException(
                              message: "Item is not recognized",
                              paramName: nameof(item));
                }
            }