コード例 #1
0
ファイル: GameState.cs プロジェクト: zerratar/townofblakulla
    void Start()
    {
        this.validator            = new GamePhaseValidator();
        this.trialVoteHandler     = new TrialVoteHandler(this);
        this.judgementVoteHandler = new JudgementVoteHandler(this);
        if (!SunLight)
        {
            SunLight = GameObject.Find("Directional Light").GetComponent <Light>();
        }

        this.startPhase = new StartPhase();
        this.endPhase   = new EndPhase();
        this.gameUI     = this.GetComponent <GameUI>();

        if (!playerHandler)
        {
            playerHandler = this.GetComponent <PlayerHandler>();
        }

        if (Players == null || Players.Length == 0)
        {
            Players = GameObject.FindObjectsOfType <PlayerController>();
        }

        if (!Camera)
        {
            Camera = GameObject.FindObjectOfType <WaypointCamera>();
        }
    }
コード例 #2
0
 public MoveToGallowsPhase(
     GameUI gameUI,
     TrialVoteHandler trialVotes,
     PlayerHandler playerHandler)
     : base("Move to gallows")
 {
     gameUi             = gameUI;
     this.trialVotes    = trialVotes;
     this.playerHandler = playerHandler;
 }
コード例 #3
0
 public GoHomePhase(
     GameUI gameUI,
     TrialVoteHandler trialVotes,
     PlayerHandler playerHandler)
     : base("Day is over - going home")
 {
     gameUi             = gameUI;
     this.trialVotes    = trialVotes;
     this.playerHandler = playerHandler;
 }
コード例 #4
0
 public DefensePhase(
     GameUI gameUI,
     PlayerHandler playerHandler,
     TrialVoteHandler trialVotes,
     float duration)
     : base("Defense", duration)
 {
     gameUi             = gameUI;
     this.playerHandler = playerHandler;
     this.trialVotes    = trialVotes;
 }
コード例 #5
0
 public TrialVotingPhase(
     GameUI gameUI,
     PlayerHandler playerHandler,
     TrialVoteHandler voteHandler,
     float duration)
     : base("Voting", duration)
 {
     gameUi             = gameUI;
     this.playerHandler = playerHandler;
     this.voteHandler   = voteHandler;
 }
コード例 #6
0
 public LeaveGallowsPhase(
     GameUI gameUI,
     PlayerHandler playerHandler,
     TrialVoteHandler trialVotes,
     JudgementVoteHandler judgementVotes)
     : base("Player is innocent - leaving gallows")
 {
     gameUi              = gameUI;
     this.playerHandler  = playerHandler;
     this.trialVotes     = trialVotes;
     this.judgementVotes = judgementVotes;
 }
コード例 #7
0
 public ReviewExecutionPhase(
     GameUI gameUI,
     PlayerHandler playerHandler,
     TrialVoteHandler trialVotes,
     JudgementVoteHandler judgementVote)
     : base("Execution Review")
 {
     gameUi             = gameUI;
     this.playerHandler = playerHandler;
     this.trialVotes    = trialVotes;
     this.judgementVote = judgementVote;
 }
コード例 #8
0
 public JudgementPhase(
     GameUI gameUI,
     PlayerHandler playerHandler,
     TrialVoteHandler trialVotes,
     JudgementVoteHandler judgementVotes,
     float duration)
     : base("Judgement", duration)
 {
     gameUi              = gameUI;
     this.playerHandler  = playerHandler;
     this.trialVotes     = trialVotes;
     this.judgementVotes = judgementVotes;
 }
コード例 #9
0
 public ExecutionPhase(
     GameUI gameUI,
     WaypointCamera camera,
     PlayerHandler playerHandler,
     TrialVoteHandler trialVotes,
     JudgementVoteHandler judgementVote)
     : base("Execution")
 {
     gameUi             = gameUI;
     this.camera        = camera;
     this.playerHandler = playerHandler;
     this.trialVotes    = trialVotes;
     this.judgementVote = judgementVote;
 }
コード例 #10
0
 public NightPhase(
     Action <Phase> onEnter,
     Action <Phase> onExit,
     GameUI gameUI,
     TrialVoteHandler trialVotes,
     PlayerHandler playerHandler,
     bool standardMode)
     : base(
         "Night",
         new GoHomePhase(
             gameUI,
             trialVotes,
             playerHandler),
         new DuringNightPhase(standardMode ? 30f : 15f))
 {
     this.onEnter       = onEnter;
     this.onExit        = onExit;
     this.playerHandler = playerHandler;
 }
コード例 #11
0
ファイル: DayPhase.cs プロジェクト: zerratar/townofblakulla
    public DayPhase(
        Action <Phase> onEnter,
        Action <Phase> onExit,
        GameUI gameUI,
        WaypointCamera camera,
        PlayerHandler playerHandler,
        TrialVoteHandler trialVoteHandler,
        JudgementVoteHandler judgementVoteHandler,
        bool standardMode)
        : base(
            "Day",

            new GotoTownPhase(playerHandler),

            new ReviewNightPhase(playerHandler),

            new DiscussionPhase(
                5f),
            //standardMode ? 45f : 15f)),

            new TrialVotingPhase(
                gameUI, playerHandler, trialVoteHandler,
                30f),

            new MoveToGallowsPhase(
                gameUI, trialVoteHandler, playerHandler),

            new DefensePhase(
                gameUI,
                playerHandler,
                trialVoteHandler,
                5f),
            //20f),

            new JudgementPhase(
                gameUI,
                playerHandler,
                trialVoteHandler,
                judgementVoteHandler,
                20f),

            new LeaveGallowsPhase(
                gameUI,
                playerHandler,
                trialVoteHandler,
                judgementVoteHandler),

            new LastWordsPhase(
                gameUI,
                judgementVoteHandler,
                5f),

            new ExecutionPhase(
                gameUI,
                camera,
                playerHandler,
                trialVoteHandler,
                judgementVoteHandler),

            new ReviewExecutionPhase(
                gameUI,
                playerHandler,
                trialVoteHandler,
                judgementVoteHandler)
            )
    {
        this.onEnter              = onEnter;
        this.onExit               = onExit;
        this.playerHandler        = playerHandler;
        this.trialVoteHandler     = trialVoteHandler;
        this.judgementVoteHandler = judgementVoteHandler;
    }