コード例 #1
0
        private void inputMission()
        {
            int charamakeLevel = 0;

            foreach (Identity identity in choseIdentities)
            {
                charamakeLevel += identity.getLevel();
            }
            charamakeLevel += choseJob.getLevel();
            charamakeLevel += choseHumanity.getLevel();

            List <MissionNode> missionNodes = new List <MissionNode>();

            for (int i = 0; i < 20; i++)
            {
                IMissionBuilder builder     = QuestHelper.getRandomMission(charamakeLevel);
                var             missionNode = Instantiate(missionNodePrefab).GetComponent <MissionNode>();
                missionNode.setQuest(builder);
                missionNodes.Add(missionNode);
            }
            missionSelectView = selectView.creatSelectView <MissionNode, IMissionBuilder>(missionNodes);

            var printMission = missionSelectView.getElement();

            parameterView.printText(printMission.getName(), printMission.getDescription(), printMission.getFlavorText());

            state = CharaMakeState.MISSION;
        }
コード例 #2
0
 public void missionChose()
 {
     this.choseMission = missionSelectView.getElement();
     missionSelectView.delete();
     selectView.detach();
     Destroy(parameterView.gameObject);
     inputResult();
 }
コード例 #3
0
        /// <summary>
        /// カーソルの移動移動
        /// </summary>
        private void moveCursor()
        {
            int   axis    = 0;
            float rawAxis = Input.GetAxisRaw("Vertical");

            if (rawAxis > 0)
            {
                axis = -1;
            }
            else if (rawAxis < 0)
            {
                axis = 1;
            }

            if (axis != 0)
            {
                switch (state)
                {
                case CharaMakeState.JOB:
                    int index = jobSelectView.getIndex() + axis;
                    Job job   = jobSelectView.moveTo(index);
                    jobView.printText(job);
                    break;

                case CharaMakeState.HUMANITY:
                    Humanity humanity = humanitySelectView.moveTo(humanitySelectView.getIndex() + axis);
                    parameterView.printText(humanity.getName(), humanity.getDescription(), humanity.getFlavorText());
                    break;

                case CharaMakeState.IDENTITY:
                    Identity identity = identitySelectView.moveTo(identitySelectView.getIndex() + axis);
                    parameterView.printText(identity.getName(), identity.getDescription(), identity.getFlavorText());
                    break;

                case CharaMakeState.MISSION:
                    IMissionBuilder mission = missionSelectView.moveTo(missionSelectView.getIndex() + axis);
                    parameterView.printText(mission.getName(), mission.getDescription(), mission.getFlavorText());
                    break;
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// <see cref="T:Character.Hero"/> classのコンストラクタです
        /// </summary>
        /// <param name="job">職業</param>
        public Player(Job job, Humanity humanity, List <Identity> identities, IMissionBuilder mission, string name)
        {
            Dictionary <BattleAbility, int>   battleParameters   = job.defaultSettingBattleAbility();
            Dictionary <FriendlyAbility, int> friendlyParameters = job.defaultSettingFriendlyAbility();

            activeSkills.AddRange(job.getActiveSkills());
            reactionSkills.AddRange(job.getReactionSkills());

            setMft(battleParameters[BattleAbility.MFT]);
            setFft(battleParameters [BattleAbility.FFT]);
            setMgp(battleParameters [BattleAbility.MGP]);
            setPhy(battleParameters [BattleAbility.PHY]);
            setAgi(battleParameters [BattleAbility.AGI]);
            setDex(friendlyParameters [FriendlyAbility.DEX]);
            setSpc(friendlyParameters [FriendlyAbility.SPC]);

            setMaxHp(battleAbilities[BattleAbility.PHY] * 3 + 30);
            setMaxMp(battleAbilities[BattleAbility.MGP] * 5 + 10);
            hp = maxHp;
            mp = maxMp;

            this.NAME = name;

            this.job = job;

            UNIQUE_ID = UniqueIdCreator.creatUniqueId();

            this.level = 1;

            menuPrefab = (GameObject)Resources.Load("Prefabs/Menu");

            party.join(this);

            //もうちとくふうするかも

            var bKeys = Enum.GetValues(typeof(BattleAbility));
            var fKeys = Enum.GetValues(typeof(FriendlyAbility));

            foreach (Identity identity in identities)
            {
                var battleBonus = identity.getBattleAbilityBonuses();
                foreach (BattleAbility ability in bKeys)
                {
                    battleAbilities[ability] += battleBonus[ability];
                }

                var friBonus = identity.getFriendlyAblityBonuses();
                foreach (FriendlyAbility ability in fKeys)
                {
                    friendlyAbilities[ability] += friBonus[ability];
                }

                identity.activateSkill(this);
            }

            humanity.activate(this);
            foreach (BattleAbility ability in bKeys)
            {
                battleAbilities[ability] += humanity.getAbilityBonus(ability);
            }
            foreach (FriendlyAbility ability in fKeys)
            {
                friendlyAbilities[ability] += humanity.getAbilityBonus(ability);
            }

            checkAbilities();

            flags = new FlagList(this);

            this.mission = mission.build(flags);
            undertakingQuests.Add(this.mission);
        }
コード例 #5
0
        /// <summary>
        /// パラメータを表示させます
        /// </summary>
        /// <param name="job">J職業</param>
        /// <param name="humanity">人間性</param>
        /// <param name="identities">特徴のリスト</param>
        /// <param name="manager">元となるマネージャ</param>
        public void setParameters(Job job, Humanity humanity, List <Identity> identities, IMissionBuilder builder, CharaMakeManager manager)
        {
            nameField.interactable = false;
            jobText.text           = job.getName();
            humanityText.text      = humanity.getName();
            missionText.text       = builder.getName();
            int i = 0;

            foreach (Text text in identityTexts)
            {
                text.text = identities[i].getName();
                i++;
            }
            this.manager = manager;
        }