Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// AIをidから取得します
 /// </summary>
 /// <returns>オーダーされたAI</returns>
 /// <param name="id">取得したいAIのID</param>
 /// <param name="user">AIを設定したいIBattleableオブジェクト</param>
 /// <param name="activeSkills">userのActiveSkillSet.</param>
 /// <param name="reactionSkills">userのReactionSkillSet.</param>
 public IEnemyAI getAiFromId(int id, IBattleable user, ActiveSkillSet activeSkills, ReactionSkillSet reactionSkills)
 {
     foreach (IEnemyAIBuilder builder in summarizingAI)
     {
         if (builder.getId() == id)
         {
             return(builder.build(user, activeSkills, reactionSkills));
         }
     }
     throw new ArgumentException("invalid aiId");
 }
Ejemplo n.º 3
0
 public IEnemyAI build(IBattleable bal, ActiveSkillSet activeSKills, ReactionSkillSet passiveSkills)
 {
     return(new Coward(bal, activeSKills, passiveSkills));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// AIのコンストラクタ
 /// </summary>
 /// <param name="user">AIを使用するIBattleableキャラクター</param>
 /// <param name="acitiveSkills">userが使用するActiveSkillSet</param>
 /// <param name="reactionSkills">userが使用するReactionSkillSet</param>
 public Coward(IBattleable user, ActiveSkillSet acitiveSkills, ReactionSkillSet reactionSkills)
 {
     this.user           = user;
     this.activeSkills   = acitiveSkills;
     this.reactionSkills = reactionSkills;
 }