Example #1
0
    public void UpdatePower()
    {
        DoorStory doorStory = storiesHelper.Get <DoorStory>();

        currentUsage = BASE_USAGE + doorStory.GetPowerUsage();

        remainingPower = Math.Max(0, remainingPower - currentUsage);

        if (remainingPower <= 0)
        {
            storiesHelper.Dispatch(DoorStory.OpenDoorsFactory.Get());
        }
    }
Example #2
0
    void MoveEnemy(Enemy enemy, Location currentLocation)
    {
        DoorStory       doorStory = storiesHelper.Get <DoorStory>();
        List <Location> exits     = doorStory.GetExits(currentLocation);

        int numRooms = exits.Count;
        int roomIdx  = Random.Range(0, numRooms);

        Location newLocation = (Location)exits[roomIdx];

        characterLocations[enemy] = newLocation;

        if (newLocation == Location.Office)
        {
            storiesHelper.Dispatch(GameStateStory.SetGameStateFactory.Get(GameState.LOST));
        }
    }