Exemplo n.º 1
0
        public void Awake()
        {
            entitySystem = new EntityStateSystem();

            Console.RegisterCommand("showEntity", "showEntity 1337", "returns all states for an entity",
                                    command =>
            {
                var args  = Console.SplitParameters(command);
                var debug = entitySystem.DebugEntity(Convert.ToInt32(args[1]));
                Console.WriteLine(debug);
            }
                                    );

            //TODO: this should be via the entity System. Fix this before save load.
            StaticStates.Add(new WorldEntityState(entitySystem.BuildEntity(new List <IState>())));
            StaticStates.Add(new ActiveEntityState(entitySystem.BuildEntity(new List <IState>())));
            StaticStates.Add(new GameModeState(GameMode.Design));
            StaticStates.Add(new EntityLibraryState(InitialBuildableEntities.BuildableEntityLibrary));
            StaticStates.Add(new SelectedState());

            entitySystem.AddSystem(new WorldInitSystem());
            entitySystem.AddSystem(new GlobalControlsSystem());
            entitySystem.AddSystem(new PlayerEntityModificationSystem());
            entitySystem.AddSystem(new EngineSystem());
            entitySystem.AddSystem(new SubstanceNetworkSystem());
            entitySystem.AddSystem(new EntityLibrarySystem());
            entitySystem.AddSystem(new SaveLoadSystem());
            entitySystem.AddSystem(new CrewMovementSystem());
            entitySystem.AddSystem(new CrewHealthSystem());
            entitySystem.AddSystem(new SeaSystem());

            entitySystem.Init();
            StartCoroutine(Ticker());
        }
Exemplo n.º 2
0
        private Entity SpawnPlayer(Vector3 position)
        {
            var player = entitySystem.CreateEntity(new List <IState>
            {
                new PrefabState(Prefabs.Player),
                new IsPlayerState(),
                new InventoryState(),
                new VisibleSlotState(),
                new PositionState(position),
                new RotationState(Quaternion.identity),
                new PathfindingState(null, null),
                new ActionBlackboardState(null),
                //Warning: Changing 'You' to something else will break stuff.
                new NameState("You", 2.0f),
                new DialogueOutcomeState(),
                new PersonAnimationState(),
                new ClothingState(ClothingTopType.BartenderTop, ClothingBottomType.BartenderBottom),
                new HairState(HairType.Hair_Bartender),
                new FaceState(FaceType.Face_Bartender),
                new IsPersonState(),
                new InteractiveState()
            }, false);

            StaticStates.Add(new PlayerState(player, !GameSettings.DisableTutorial));
            return(player);
        }
Exemplo n.º 3
0
        public void StartGame()
        {
            GameSettings.IsDebugOn          = Debug.isDebugBuild && IsDebugOn;
            GameSettings.SkipFirstDayFadein = SkipFirstDayFadein;
            GameSettings.DisableTutorial    = DisableTutorial;

            entitySystem = new EntityStateSystem();

            //StaticStates
            StaticStates.Add(new DayPhaseState(DayPhase.Morning));
            StaticStates.Add(new TimeState(Constants.GameStartTime));
            StaticStates.Add(new CursorState(null, new SerializableVector3()));
            StaticStates.Add(new MoneyState(Constants.StartingMoney));
            StaticStates.Add(new PlayerDecisionsState());
            StaticStates.Add(new OutcomeTrackerState());
            StaticStates.Add(new PaymentTrackerState());

            //Debug
            entitySystem.AddSystem(new DebugControlsSystem());
            entitySystem.AddSystem(new EntityTooltipSystem());

            //Init
            entitySystem.AddSystem(new WaypointSystem());
            entitySystem.AddSystem(new TransformSystem());
            entitySystem.AddSystem(new SpawningSystem());
            entitySystem.AddSystem(new InitVisualizersSystem());

            //Camera
            entitySystem.AddSystem(new CameraSystem());

            //Game
            entitySystem.AddSystem(new TimeSystem());

            entitySystem.AddSystem(new PausingSystem());
            entitySystem.AddSystem(new PathfindingSystem());
            entitySystem.AddSystem(new CharacterControllerSystem());
            entitySystem.AddSystem(new DrinkMakingSystem());
            entitySystem.AddSystem(new InputResponseSystem());
            entitySystem.AddSystem(new DialogueSystem());
            entitySystem.AddSystem(new HierarchyManipulationSystem()); //Must run before VisibleSlotSystem
            entitySystem.AddSystem(new VisibleSlotSystem());
            entitySystem.AddSystem(new ItemStackSystem());
            entitySystem.AddSystem(new BarQueueSystem());
            entitySystem.AddSystem(new BarEntitiesSystem());

            //NPC/AI
            entitySystem.AddSystem(new ActionManagerSystem());
            entitySystem.AddSystem(new DayDirectorSystem());

            //Input - Ordering of systems important here.
            entitySystem.AddSystem(new CursorSystem());
            entitySystem.AddSystem(new InteractionSystem());
            entitySystem.AddSystem(new EntitySelectorSystem());

            //GameStart
            entitySystem.AddSystem(new GameSetupSystem());

            entitySystem.Init();
            GameStarted = true;
        }
Exemplo n.º 4
0
        public void OnInit()
        {
            StaticStates.Add(new BarEntities());
            var player = SpawnPlayer(new Vector3(9.5f, 1.2f, 0.6f));

            SpawnCamera(new Vector3(12.07f, 15.9f, 0.0f), Quaternion.Euler(48, -90, 0), player);
            SpawnPeople(entitySystem);
            SpawnEntitiesFromBlueprints();
        }
Exemplo n.º 5
0
        private void SpawnCamera(Vector3 position, Quaternion rotation, Entity player)
        {
            var camera = entitySystem.CreateEntity(new List <IState>
            {
                new RotationState(rotation),
                new PositionState(position),
                new PrefabState(Prefabs.Camera),
                new CounterState(),
                new CameraFollowState(player)
            }, false);

            StaticStates.Add(new CameraState(camera));
        }
Exemplo n.º 6
0
        public void OnInit()
        {
            var barEntitiesState = new BarEntities();

            StaticStates.Add(barEntitiesState);
        }