Exemplo n.º 1
0
 private void ThrowDiceMethod(ThrowDice message)
 {
     if (GameStatus.IsGameFinished)
     {
         var messageAnswer = new EnteringNewUserError(false, false, true, false, false);
         Context.Parent.Tell(messageAnswer);
     }
     else
     /// thow an error
     if (GameStatus.GamePlayPerPlayer.Count <= 1)
     {
         var messageAnswer = new EnteringNewUserError(false, false, false, true, false);
         Context.Parent.Tell(messageAnswer);
     }
     else
     {
         var result = GameStatus.ThrowDice(message.PlayerInfo.Id);
         if (result == GameStatusThrowResult.NotPlayerTurn)
         {
             var messageAnswer = new EnteringNewUserError(false, false, false, false, false, true);
             Context.Parent.Tell(messageAnswer);
         }
         else if (result == GameStatusThrowResult.ThrowExecuted || result == GameStatusThrowResult.ThrowWithVictory)
         {
             Context.Parent.Tell(new GameRegister(GameStatus));
         }
     }
 }
Exemplo n.º 2
0
    public void ButtonClick()
    {
        CreateText.instance.TextLog("ダイスを振り直します。(コスト処理は手動)");
        var dice = ThrowDice.Thirow();

        UseSkillController.instance.user.overSan += 1;
        CreateText.instance.TextLog("ダイス:" + dice);
        UseSkillController.instance.thdice = dice;
    }
Exemplo n.º 3
0
    private void AttackMethod()
    {
        SetSkill          = UseSkill;
        SetTarget         = TargetPiece;
        pname             = GameManager.ci.data.name;
        GameManager.state = GameState.AttackPhase;
        var damage     = SetSkill.damage + (cordam.value - 3);
        var cost       = SetSkill.cost + (corcost.value - 3);
        var correction = (corjudge.value - 3) + SetSkill.correction;

        GameManager.DiceFix += correction;

        var msg =
            pname + " : [" + SetSkill.name + "]  コスト" + cost + " / 射程" + SetSkill.rangeMin + "~" + SetSkill.rangeMax
            + " / ダメージ" + damage + "  出目補正" + correction;

        if (SetSkill.explosion)
        {
            msg += " +爆発";
        }
        if (SetSkill.cut)
        {
            msg += " +切断";
        }
        if (SetSkill.oneCombo)
        {
            msg += " +連撃1";
        }
        if (SetSkill.twoCombo)
        {
            msg += " + 連撃2";
        }
        if (SetSkill.areaAttack)
        {
            msg += " +全体攻撃";
        }
        if (SetSkill.fallDowm)
        {
            msg += " +転倒";
        }
        CreateText.instance.TextLog(msg);
        CreateText.instance.TextLog("ターゲット:" + SetTarget.data.name);
        thdice = ThrowDice.Thirow();
        CreateText.instance.TextLog("ダイススロー : " + thdice);
        GameManager.state = GameState.InterruptPhase;
        CreateText.instance.TextLog("支援・妨害・防御を行ってください");
    }
Exemplo n.º 4
0
        public void UserCouldFinishGame()
        {
            
            var probe = CreateTestProbe();
            var gamesNotStarted = new PlayBoardEvent();
            var gameKey = Guid.NewGuid().ToString();
            var owner = new Player( "Pedro Perez", Guid.NewGuid().ToString());

            var playerRegistering = new Player( "Edgar Leonardo", Guid.NewGuid().ToString());
            var playerRegistering2 = new Player( "Edgar Antonio", Guid.NewGuid().ToString());

            var playerRegistering3 = new Player( "Edgar Miguel", Guid.NewGuid().ToString());
            var gameEvent = new GameEvent(gameKey, owner);

            var gameRegister = new GameRegister(gameEvent);
            gamesNotStarted.GameRegistered.Add(gameKey, gameRegister);
            var playboard = Sys.ActorOf(PlayBoardActor.Props(gamesNotStarted));

            var message = new EnterExistingGame(playerRegistering, gameKey);
            playboard.Tell(message, probe.Ref);
            var received = probe.ExpectMsg<UserRegistrationDone>();
            Assert.Equal(gameKey, received.GameId);
            Assert.Equal(playerRegistering.Id, received.PlayerInfo.Id);
            message = new EnterExistingGame(playerRegistering2, gameKey);
            playboard.Tell(message, probe.Ref);
            received = probe.ExpectMsg<UserRegistrationDone>();
            Assert.Equal(gameKey, received.GameId);
            Assert.Equal(playerRegistering2.Id, received.PlayerInfo.Id);

            /// Initializing the game the first player that create the game
            var startGame = new ThrowDice(playerRegistering, gameKey);
            playboard.Tell(startGame, probe.Ref);
            var creceived3 = probe.ExpectMsg<GameRegister>();
            /// The Game must be started, if game is started
            Assert.True(creceived3.GameEventDashboard.IsGameStarted);

            var messageFinishGame = new FinishGame(playerRegistering2, gameKey);
            playboard.Tell(messageFinishGame, probe.Ref);
            var receivedIsStarted = probe.ExpectMsg<GameRegister>();
            Assert.Equal(receivedIsStarted.GameEventDashboard.GameId, gameKey);

        }
Exemplo n.º 5
0
        private static void PlayingRoom(string gameId, Player player)
        {
            DisplayGameInstructions();
            while (true)
            {
                var action = System.Console.ReadLine();

                if (action.Contains("1"))
                {
                    var startGame = new ThrowDice(player, gameId);
                    PlayerCoordinator.Tell(startGame);
                }
                else if (action.Contains("2"))
                {
                    SelectExistingsGames();
                }
                else if (action.Contains("3"))
                {
                    //DisplayPlayer(playerName);
                }
            }
        }
Exemplo n.º 6
0
    private void Cut(ref int hitPartsHP, int dam)
    {
        CreateText.instance.TextLog("切断判定");
        var dice = ThrowDice.Thirow();

        CreateText.instance.TextLog("ダイス:" + dice);
        if (dice > 5)
        {
            CreateText.instance.TextLog("切断成功");
            if (TargetPiece.data.type == "ドール" || TargetPiece.data.type == "サヴァント")
            {
                hitPartsHP = 0;
            }
            else
            {
                TargetPiece.data.bodyhp -= dam;
            }
        }
        else
        {
            CreateText.instance.TextLog("切断失敗");
        }
    }
Exemplo n.º 7
0
        private void ThrowDiceMethod(ThrowDice message)
        {
            var actor = GetActorRefForGame(message.GameId);

            actor.Tell(message);
        }