예제 #1
0
파일: Enemy.cs 프로젝트: moto2002/Pioneer
        /// <summary>
        ///  <see cref="T:Character.Enemy"/> classのコンストラクタ
        /// </summary>
        /// <param name="builder">このキャラクターの初期設定を保持するEnemyBuilerクラス</param>
        public Enemy(EnemyBuilder builder)
        {
            this.ID             = builder.getId();
            this.NAME           = builder.getName();
            this.abilities      = builder.getAbilities();
            this.DEF            = builder.getDef();
            this.LV             = builder.getLevel();
            this.NORMAL_DROP_ID = builder.getNormalDropId();
            this.RARE_DROP_ID   = builder.getRareDropId();
            this.MODEL_ID       = builder.getModelName();
            this.FACTION        = builder.getFaction();

            this.MAX_HP = builder.getMaxHp();

            this.MAX_MP = builder.getMaxMp();

            this.hp = MAX_HP;
            this.mp = MAX_MP;

            GameObject prefab     = (GameObject)Resources.Load(MODEL_ID);
            GameObject gameobject = MonoBehaviour.Instantiate(prefab);

            this.container = gameobject.GetComponent <Container> ();
            container.setCharacter(this);

            this.UNIQE_ID = UniqueIdCreator.creatUniqueId();

            activeSkillSet   = ActiveSkillSetMasterManager.getInstance().getActiveSkillSetFromId(builder.getActiveSkillSetId(), this);
            reactionSkillSet = ReactionSkillSetMasterManager.getInstance().getReactionSkillSetFromId(builder.getReactionSkillSetId());
            this.ai          = EnemyAISummarizingManager.getInstance().getAiFromId(builder.getAiId(), this, activeSkillSet, reactionSkillSet);

            attributeResistances = builder.getAttributeRegists();
            observer             = new EnemyObserver(ID);
        }
예제 #2
0
        public Merchant(MerchantBuiler builder, Town livingTown)
        {
            id   = builder.getId();
            NAME = builder.getName();
            GameObject modelPrefab = (GameObject)Resources.Load("Models/" + builder.getModelId());

            container = MonoBehaviour.Instantiate(modelPrefab).GetComponent <Container>();
            container.setCharacter(this);
            var yPos = Terrain.activeTerrain.terrainData.GetInterpolatedHeight(
                container.transform.position.x,
                container.transform.position.z
                );

            container.transform.position = new Vector3(container.transform.position.x, yPos, container.transform.position.z);

            massages      = builder.getMassges();
            TRADE_INDEX   = builder.getStartTradeIndex();
            UNIQUE_ID     = UniqueIdCreator.creatUniqueId();
            GOODS_TYPE    = builder.getGoodsType();
            numberOfGoods = builder.getNumberOfGoods();
            goodsLevel    = builder.getGoodsLevel();

            abilities.Add(FriendlyAbility.DEX, builder.getDex());
            abilities.Add(FriendlyAbility.SPC, builder.getSpc());

            failMassage = builder.getFailMassage();

            updateGoods();

            this.livingTown = livingTown;
        }
예제 #3
0
        public Client(IQuest quest, Transform transfrom)
        {
            this.quest     = quest;
            this.UNIQUE_ID = UniqueIdCreator.creatUniqueId();

            MASSAGES = new List <string>()
            {
                "がんばれ"
            };
            UNDERTOOK_MASSAGES = new List <string>()
            {
                "頑張れ"
            };
            CLEAR_MASSAGES = new List <string>()
            {
                "おめでとう"
            };

            var modelPrefab = (GameObject)Resources.Load("Models/MissionClient");

            container = MonoBehaviour.Instantiate(modelPrefab).GetComponent <Container>();
            container.setCharacter(this);

            this.container.transform.position = transfrom.position;
            this.container.transform.rotation = transfrom.rotation;

            isActivated = true;
            needTown    = false;
        }
예제 #4
0
파일: Citizen.cs 프로젝트: moto2002/Pioneer
        public Citizen(CitizenBuilder builder)
        {
            this.id        = builder.getId();
            this.NAME      = builder.getName();
            this.MASSAGES  = builder.getMassges();
            this.UNIQUE_ID = UniqueIdCreator.creatUniqueId();

            var modelPrefab = (GameObject)Resources.Load("Models/" + builder.getModelId());

            container = MonoBehaviour.Instantiate(modelPrefab).GetComponent <Container>();
            container.setCharacter(this);
        }
예제 #5
0
파일: Citizen.cs 프로젝트: moto2002/Pioneer
        public Citizen(int id, Vector3 pos, Quaternion rotate)
        {
            this.id = id;
            var builder = CitizenMasterManager.getInstance().getCitizenBuilderFromId(id);

            this.NAME      = builder.getName();
            this.MASSAGES  = builder.getMassges();
            this.UNIQUE_ID = UniqueIdCreator.creatUniqueId();

            var modelPrefab = (GameObject)Resources.Load("Models/" + builder.getModelId());

            container = MonoBehaviour.Instantiate(modelPrefab, pos, rotate).GetComponent <Container>();
            container.setCharacter(this);
        }
예제 #6
0
        public Client(int id, Dictionary <FriendlyAbility, int> abilities, int level, Vector3 pos, Quaternion rotate)
        {
            this.id        = id;
            this.level     = level;
            this.abilities = new Dictionary <FriendlyAbility, int>(abilities);

            var builder = ClientMasterManager.getInstance().getClientBuilderFromId(id);

            this.NAME               = builder.getName();
            this.MASSAGES           = builder.getMassges();
            this.UNDERTOOK_MASSAGES = builder.getUnderTookMassges();
            this.CLEAR_MASSAGES     = builder.getClearedMassges();
            this.QUEST_TYPE         = builder.getQuestType();
            this.UNIQUE_ID          = UniqueIdCreator.creatUniqueId();
            var modelPrefab = (GameObject)Resources.Load("Models/" + builder.getModelId());

            container = MonoBehaviour.Instantiate(modelPrefab, pos, rotate).GetComponent <Container>();
            container.setCharacter(this);

            needTown = true;
        }
예제 #7
0
        public Merchant(int id, int level, int goodsNumber, Dictionary <FriendlyAbility, int> abilities, Vector3 pos, Quaternion rotate)
        {
            this.goodsLevel    = level;
            this.numberOfGoods = goodsNumber;

            this.abilities = new Dictionary <FriendlyAbility, int>(abilities);

            var builder = MerchantMasterManager.getInstance().getMerchantBuilderFromId(id);

            massages    = builder.getMassges();
            TRADE_INDEX = builder.getStartTradeIndex();
            UNIQUE_ID   = UniqueIdCreator.creatUniqueId();
            GOODS_TYPE  = builder.getGoodsType();
            failMassage = builder.getFailMassage();

            GameObject modelPrefab = (GameObject)Resources.Load("Models/" + builder.getModelId());

            this.container = MonoBehaviour.Instantiate(modelPrefab, pos, rotate).GetComponent <Container>();
            container.setCharacter(this);

            updateGoods();
        }
예제 #8
0
        public Client(ClientBuilder builder, Town livingTown)
        {
            this.id                 = builder.getId();
            this.NAME               = builder.getName();
            this.MASSAGES           = builder.getMassges();
            this.UNDERTOOK_MASSAGES = builder.getUnderTookMassges();
            this.CLEAR_MASSAGES     = builder.getClearedMassges();
            this.level              = builder.getLevel();
            this.QUEST_TYPE         = builder.getQuestType();
            this.abilities.Add(DEX, builder.getDex());
            this.abilities.Add(SPC, builder.getSpc());
            this.UNIQUE_ID = UniqueIdCreator.creatUniqueId();

            var modelPrefab = (GameObject)Resources.Load("Models/" + builder.getModelId());

            container = MonoBehaviour.Instantiate(modelPrefab).GetComponent <Container>();
            container.setCharacter(this);

            this.livingTown = livingTown;

            needTown    = true;
            isActivated = true;
        }
예제 #9
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);
        }