Beispiel #1
0
        public TestModule(ITokenizer tokenizer)
            : base("/test")
        {
            Post["/"] = parameters =>
            {
                return("default");
            };

            Get["/simulation"] = parameters =>
            {
                ContentsPrepare.Init();

                Player[] player = { new Player(), new Player(), new Player() };

                var data = PlayerDataDatabase.GetPlayerData("102");
                if (data != null)
                {
                    player[0].LoadPlayer(data);
                }

                data = PlayerDataDatabase.GetPlayerData("103");
                if (data != null)
                {
                    player[1].LoadPlayer(data);
                }

                data = PlayerDataDatabase.GetPlayerData("104");
                if (data != null)
                {
                    player[2].LoadPlayer(data);
                }

                Party users = new Party(PartyType.PLAYER, 10);
                foreach (Player p in player)
                {
                    users.AddCharacter(p);
                }

                DungeonMaster newMaster = new DungeonMaster();
                newMaster.Init(60, 4, users);

                return("turn : " + newMaster.Start());
            };
        }
Beispiel #2
0
        static void Main()
        {
            Map              map             = new Map();
            Party            party           = new Party();
            List <Character> characters      = Character.CreateCharacters();
            Place            visitorLocation = map.Locations.Find(location => location.Name == "Visitor Center");
            bool             gameOver        = false;
            Character        visitor         = Welcome();

            party.AddCharacter(visitor);
            Intro();
            while (!gameOver)
            {
                Place.VisitorCenterEvents(visitorLocation, party, characters);
                // Other Event "Listeners"
                visitorLocation = UserDirection(party, map, visitorLocation);
                gameOver        = CheckForEnd(visitor);
            }
            EndGame();
        }
Beispiel #3
0
    public void Activate()
    {
        if (_modActive)
        {
            return;
        }

        _modActive = true;

        if (ValidateBytes())
        {
            GameMemory.Write <byte>(_offsetModBytes1, _modBytes);
            GameMemory.Write <byte>(_offsetModBytes2, _modBytes);
        }

        if (ModSettings.ReadSetting <bool>("AutoAddRemove"))
        {
            Party.AddCharacter(Character.Seymour);
            GameMemory.Write <byte>(offsetSeymourInParty, 17);
        }
    }
        public static void Simulation(string src)
        {
            var data = JsonMapper.ToObject <Dictionary <string, object> >(src);

            Party party = new Party(PartyType.PLAYER, (int)data["level"]);

            for (int i = 0; i < 4; ++i)
            {
                string playerId = (string)data["char_" + i];

                var playerData = PlayerDataDatabase.GetPlayerData(playerId);
                Debug.Assert(playerData != null, "player data is null : " + playerId);
                // Console.WriteLine( playerData.name + " count : " + playerData.equipments.Count );

                Player newPlayer = new Player();
                newPlayer.LoadPlayer(playerData);

                party.AddCharacter(newPlayer);
            }

            Simulation(party);
        }
Beispiel #5
0
        static void Main()
        {
            Map              map             = new Map();
            Party            party           = new Party();
            List <Character> characters      = Character.CreateCharacters();
            Place            visitorLocation = map.Locations.Find(location => location.Name == "Visitor Center");
            bool             gameOver        = false;
            bool             isVictorious    = false;
            Character        visitor         = Welcome();

            party.AddCharacter(visitor);
            Intro();
            while (!gameOver)
            {
                Place.VisitorCenterEvents(visitorLocation, party, characters);
                Place.UtilityBunkerEvents(visitorLocation, party, characters);
                Place.RadioStationEvents(visitorLocation, party);
                Place.HerbivorePenEvents(visitorLocation, party, characters);
                Place.ParkOperationsEvents(visitorLocation, party, characters);
                Place.BoatDockEvents(visitorLocation, party);
                Place.HeliPadEvents(visitorLocation, party);
                Place.PathEvents(visitorLocation, party, characters);
                // Other Event "Listeners"
                gameOver = visitorLocation.CanLeave(party);
                if (!gameOver)
                {
                    visitorLocation = UserDirection(party, map, visitorLocation);
                    gameOver        = CheckForEnd(visitor);
                }
                else
                {
                    isVictorious = true;
                }
            }
            EndGame(isVictorious);
        }
 public void AddCharacterToParty(Character character)
 {
     Party.AddCharacter(character);
     OuterRim.HomePlanet.RemoveCharacter(character);
     OuterRim.RebelBase.AddCharacter(character);
 }