Пример #1
0
 public IkariMoveState(Ikari parent)
     : base(parent)
 {
     ikari = parent;
     moveParameter = stateParent.baseParameter.moveParameter;
     accel = 0;
 }
Пример #2
0
 public IkariReturnState(Ikari parent, Murasa target) : base(parent)
 {
     ikari                    = parent;
     moveParameter            = stateParent.baseParameter.moveParameter;
     moveParameter.direction += 180;
     accel                    = 0;
     returntarget             = target;
 }
Пример #3
0
        public BlowLogic(MoveParameter m, GameObject target, FrameCounter sync)
        {
            move = m;

            blow = target;

            framecounter = sync;
        }
Пример #4
0
 //раздуватель - длинный список параетров
 public MoveCommand(IGameStateService changeGameState,
                    IPlayerStateService changePlayerState, MoveParameter parameter)
 {
     gameState      = changeGameState;
     playerState    = changePlayerState;
     this.parameter = parameter;
     actionCharge   = 5;
 }
        public BlowLogic(MoveParameter m, GameObject target, FrameCounter sync)
        {
            move = m;

            blow = target;

            framecounter = sync;
        }
Пример #6
0
 public IkariReturnState(Ikari parent,Murasa target)
     : base(parent)
 {
     ikari = parent;
     moveParameter = stateParent.baseParameter.moveParameter;
     moveParameter.direction += 180;
     accel = 0;
     returntarget = target;
 }
Пример #7
0
        private void CreateBullet()
        {
            var list = AttackLibrary.GetInstance;
            shibuki = (GameObject.Instantiate(list.shibuki) as GameObject).GetComponent<Shibuki>();
            shibuki.parent = character;
            shibuki.Init();

            shibuki.SetTransformParent();

            MoveParameter param = new MoveParameter(character.frontDirection + Random.Range(-25, 25), Random.Range(2F, 4F));
            Damage d = new Damage(30, true, 5, param.direction, false);
            shibuki.SetMoveDirection(param, d);
            SoundManager.Play(SoundManager.shot1);
        }
        public void CreateBullet()
        {
            var list = AttackLibrary.GetInstance;
            oodama = (GameObject.Instantiate(list.oodama) as GameObject).GetComponent<Oodama>();
            oodama.parent = character;

            MoveParameter param = new MoveParameter(Random.Range(190, 250), Random.Range(20, 50) * 0.1F);
            Damage da = new Damage(30, false, 25, param.direction, false);
            oodama.Init();
            oodama.transform.localPosition = new Vector3(500, 400);
            oodama.SetMoveDirection(param, da);
            oodama.sprite.color = new Color(1, 1, 1, 0.5F);
            SoundManager.Play(SoundManager.shot2);
        }
        public CharacterChargeBlowState(Character parent)
            : base(parent)
        {
            framecounter = new FrameCounter(7);
            var move = new MoveParameter(character.frontDirection, 7F);
            var blow = (GameObject.Instantiate(AttackLibrary.GetInstance.chargeBlow) as GameObject)
                .GetComponent<ChargeBlow>();

            blow.parent = character;
            blow.syncCounter = framecounter;
            SoundManager.Play(SoundManager.attackHeavy);

            logic = new BlowLogic(move, blow.gameObject, framecounter);
            parameter.invincibly.Start(7, false);
        }
Пример #10
0
        public CharacterBlowState(Character parent)
            : base(parent)
        {
            framecounter = new FrameCounter(7);
            var move = new MoveParameter(character.frontDirection, 5F);
            var blow = (GameObject.Instantiate(AttackLibrary.GetInstance.blow) as GameObject)
                       .GetComponent <NormalBlow>();

            blow.parent      = character;
            blow.syncCounter = framecounter;
            SoundManager.Play(SoundManager.attackLight);

            logic = new BlowLogic(move, blow.gameObject, framecounter);
            parameter.invincibly.Start(7, false);
        }
Пример #11
0
        public void CreateBullet()
        {
            var list = AttackLibrary.GetInstance;

            oodama        = (GameObject.Instantiate(list.oodama) as GameObject).GetComponent <Oodama>();
            oodama.parent = character;

            MoveParameter param = new MoveParameter(Random.Range(190, 250), Random.Range(20, 50) * 0.1F);
            Damage        da    = new Damage(30, false, 25, param.direction, false);

            oodama.Init();
            oodama.transform.localPosition = new Vector3(500, 400);
            oodama.SetMoveDirection(param, da);
            oodama.sprite.color = new Color(1, 1, 1, 0.5F);
            SoundManager.Play(SoundManager.shot2);
        }
Пример #12
0
        private void CreateBullet()
        {
            var list = AttackLibrary.GetInstance;

            shibuki        = (GameObject.Instantiate(list.shibuki) as GameObject).GetComponent <Shibuki>();
            shibuki.parent = character;
            shibuki.Init();

            shibuki.SetTransformParent();

            MoveParameter param = new MoveParameter(character.frontDirection + Random.Range(-25, 25), Random.Range(2F, 4F));
            Damage        d     = new Damage(30, true, 5, param.direction, false);

            shibuki.SetMoveDirection(param, d);
            SoundManager.Play(SoundManager.shot1);
        }
Пример #13
0
    float GetMoveParameter(MoveParameter move)
    {
        switch (move)
        {
        case MoveParameter.RUN:
            return(0.6f);

        case MoveParameter.CLIMB:
            return(30);

        case MoveParameter.JUMP:
            return(30);
        }

        // unhandled
        return(0);
    }
Пример #14
0
        private (int, int) CheckParameter(MoveParameter param)//add coords to params?
        {
            (int, int)coordinates = gameState.GetRobotCoordinates();
            switch (param)
            {
            case MoveParameter.Up:
                return(CanMoveUp(coordinates));

            case MoveParameter.Down:
                return(CanMoveDown(coordinates));

            case MoveParameter.Left:
                return(CanMoveLeft(coordinates));

            case MoveParameter.Right:
                return(CanMoveRight(coordinates));

            default:
                return(0, 0);
            }
        }
Пример #15
0
 public DamageParameter(int dir, float damage, bool ignoreDeffence)
 {
     moveParameter = new MoveParameter(dir, damage);
     isIgnoreDeffence = ignoreDeffence;
 }
Пример #16
0
 /// <summary>
 /// 体重補正をかけた移動値を返す
 /// </summary>
 /// <param name="param"></param>
 /// <param name="weight"></param>
 /// <returns></returns>
 static public Vector3 CalculateVelocityByWeight(MoveParameter param, Weight weight)
 {
     return(param.velocity * (Weight.MIDDLE / weight.quantity));
 }
Пример #17
0
        private void SetMoveCommand(MoveParameter parameter)
        {
            Command moveCommand = new MoveCommand(gameStateService, playerStateService, parameter);

            commandController.SetMoveCommand(moveCommand);
        }
Пример #18
0
 public void Move(MoveParameter moveParameter)
 {
     SetMoveCommand(moveParameter);
     commandController.Move();
 }
Пример #19
0
 public MoveState(BaseCharacter parent)
     : base(parent)
 {
     moveParameter = stateParent.baseParameter.moveParameter;
 }
Пример #20
0
 /// <summary>
 /// �̏d�␳��������ړ��l��Ԃ�
 /// </summary>
 /// <param name="param"></param>
 /// <param name="weight"></param>
 /// <returns></returns>
 public static Vector3 CalculateVelocityByWeight(MoveParameter param, Weight weight)
 {
     return param.velocity * (Weight.MIDDLE / weight.quantity);
 }
Пример #21
0
 /// <summary>
 /// �O�����������ݒ肷��
 /// </summary>
 /// <param name="param"></param>
 /// <param name="damage"></param>
 public void SetMoveDirection(MoveParameter param, Damage damage)
 {
     attackParameter.damage = damage;
     baseParameter.moveParameter = param;
 }
Пример #22
0
 public IkariMoveState(Ikari parent) : base(parent)
 {
     ikari         = parent;
     moveParameter = stateParent.baseParameter.moveParameter;
     accel         = 0;
 }
Пример #23
0
 public DamageParameter(int dir, float damage, bool ignoreDeffence)
 {
     moveParameter    = new MoveParameter(dir, damage);
     isIgnoreDeffence = ignoreDeffence;
 }
Пример #24
0
    // Start is called before the first frame update

    public void CreateRulette(GameObject data)
    {
        float totalRange = 0;

        for (int i = 0; i < data.transform.childCount; i++)
        {
            moveParameter = data.transform.GetChild(i).GetComponent <MoveParameter>();

            // ネットワークオブジェクトにしてみた
            // GameObject netObj = PhotonNetwork.Instantiate(ROULETTE_IMAGE, transform.position, Quaternion.identity, 0);

            //親子関係とサイズの変更はPrefabのStartでやる
            // netObj.transform.parent = imageParentTransform;
            //netObj.transform.localScale = new Vector3(1, 1, 1);
            //Debug.Log("ネットワークオブジェクトにしてみた");

            //Image obj = netObj.GetComponent<Image>();


            var obj = Instantiate(rouletteImage, imageParentTransform);
            obj.fillAmount = moveParameter.GetMoveRange() / 96f;

            // ピースの回転
            Vector3    axis  = new Vector3(0f, 0f, -1f);
            float      angle = CONVERT_CONSTANT * totalRange;
            Quaternion q     = Quaternion.AngleAxis(angle, axis);
            obj.transform.rotation = q * obj.transform.rotation;

            // ルーレットの色を決定
            if (moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.White)
            {
                obj.color = Color.white;
            }
            else if (moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.Blue)
            {
                obj.color = new Color(0, 154, 255, 255);
            }
            else if (moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.Purple)
            {
                obj.color = Color.magenta;
            }
            else if (moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.Gold)
            {
                obj.color = Color.yellow;
            }
            else if (moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.Red)
            {
                obj.color = Color.red;
            }


            // ワザの名前を入力
            Text[] texts = obj.GetComponentsInChildren <Text>();
            texts[0].text = moveParameter.GetMoveName();
            if (moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.White ||
                moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.Gold)
            {
                texts[1].text = moveParameter.GetMovePower().ToString();
            }
            else if (moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.Purple)
            {
                string star = "";
                for (int j = 0; j < moveParameter.GetMoveNumberOfStar(); j++)
                {
                    star += "☆";
                }
                texts[1].text = star;
            }
            else if (moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.Blue ||
                     moveParameter.GetMoveColorName() == MoveParameter.MoveOfColorName.Red)
            {
                texts[1].text = "";
            }

            obj.transform.GetChild(0).transform.rotation = Quaternion.Euler(0, 0, -(moveParameter.GetMoveRange() / 2 + totalRange) * CONVERT_CONSTANT);
            totalRange += moveParameter.GetMoveRange();

            // Debug.Log(moveParameter.GetMoveName());
        }
    }
Пример #25
0
 public MoveState(BaseCharacter parent) : base(parent)
 {
     moveParameter = stateParent.baseParameter.moveParameter;
 }
Пример #26
0
 /// <summary>
 /// 外部から向きを設定する
 /// </summary>
 /// <param name="param"></param>
 /// <param name="damage"></param>
 public void SetMoveDirection(MoveParameter param, Damage damage)
 {
     attackParameter.damage      = damage;
     baseParameter.moveParameter = param;
 }
Пример #27
0
    // 引数はGameMasterから渡されるワザのデータ)
    public IEnumerator Spin(GameObject data)
    {
        yield return(new WaitForSeconds(0.1f));



        // 初期位置から目標点までの回転角度

        BoardController boardController = GameObject.Find("BoardMaster").GetComponent <BoardController>();
        int             myPlayerId      = boardController.GetMyPlayerId();
        int             whichTurn       = boardController.GetWhichTurn();

        // バトルを仕掛けた側がgoalAngleを生成し相手プレイヤーに送る
        if (myPlayerId == whichTurn)
        {
            goalAngle = 360 * N + Random.Range(0, 360);
            boardController.SetGoalAngleCustomProperty(rouletteParentParameter.GetPlayerId(), goalAngle);
        }

        // 仕掛けた側から送られてgoalAngleを受け取って回る
        else
        {
            while (receiveFlag == false)
            {
                yield return(null);
            }
            receiveFlag = false;
        }

        loopCount = 0;

        // スローになるまでの角速度立式
        omega      = 2 * goalAngle / (totalTime + normalTime);
        deltaOmega = omega * clock / (totalTime - normalTime + clock);
        omegaSlow  = omega;

        while (loopCount < totalTime / clock)
        {
            // スローになるまで
            if (loopCount < normalTime / clock)
            {
                // 等角速度運動
                transform.Rotate(new Vector3(0, 0, omega * clock));
            }

            else if (loopCount < totalTime / clock)
            {
                // 速度をループ回数に対して階段状に小さくする
                omegaSlow = omegaSlow - deltaOmega;

                transform.Rotate(new Vector3(0, 0, omegaSlow * clock));
            }

            loopCount++;

            // clock秒ごとにwhile文を呼び出す
            yield return(new WaitForSeconds(clock));
        }
        // 回転終了
        Debug.Log("ゴールは" + goalAngle % 360);

        // ピース幅を順番に見て、goalAngle %360がどの範囲にあるかを調べる
        float totalRange = 0;

        for (int i = 0; i < data.transform.childCount; i++)
        {
            // 各ワザのパラメータ取得
            moveParameter = data.transform.GetChild(i).GetComponent <MoveParameter>();

            // 不等式の両端
            float leftAngle  = totalRange * 3.75f;
            float rightAngle = leftAngle + moveParameter.GetMoveRange() * 3.75f;

            // Debug.Log(leftAngle + "から" + rightAngle);
            if (leftAngle <= (goalAngle + offsetAngle) % 360 &&
                (goalAngle + offsetAngle) % 360 < rightAngle)
            {
                // goalAngleに該当するワザ
                Debug.Log("getMoveName = " + moveParameter.GetMoveName());
                Debug.Log("getMoveColor = " + moveParameter.GetMoveColorName());
                // moveParameter.ExecMoveEffect(phaseState);
                yield return(moveParameter);
            }
            totalRange += moveParameter.GetMoveRange();
        }
        // 次のスピンのためにオフセットを準備
        offsetAngle += goalAngle % 360;

        // ここでmoveParameterから両者の技を参照して色判定を行う
        // この実装だとfor文でcurrent側のmoveParameterが捨てられているので書き方を変える
        // 勝敗結果と技の効果はSpinControllerに返した上、さらにboardControllerに渡したほうがいいよね~
        goalAngle = -1;
    }