Exemple #1
0
                          public void activateSkill(IPlayable player)
                          {
                              if (SKILL_TYPE == "NONE")
                              {
                                  return;
                              }

                              var activeNames = Enum.GetNames(typeof(ActiveSkillType));

                              foreach (string name in activeNames)
                              {
                                  if (name == SKILL_TYPE)
                                  {
                                      ActiveSkillType type  = (ActiveSkillType)Enum.Parse(typeof(ActiveSkillType), SKILL_TYPE);
                                      IActiveSkill    skill = ActiveSkillSupporter.getActiveSkill(type, SKILL_ID);
                                      player.addSkill(skill);
                                      return;
                                  }
                              }

                              if (SKILL_TYPE == "REACTION")
                              {
                                  player.addSkill(ReactionSkillMasterManager.getInstance().getReactionSkillFromId(SKILL_ID));
                                  return;
                              }

                              throw new InvalidProgramException("SkillType " + SKILL_TYPE + "wan't found");
                          }
Exemple #2
0
        /// <summary>
        /// リアクション処理中のスキルを更新します
        /// </summary>
        private void updateProsessingPair()
        {
            if (needToProgressReaction)
            {
                if (waitingDecideReactionSkills.Count > 0)
                {
                    var missReaction   = ReactionSkillMasterManager.getInstance().getReactionSkillFromId(2);
                    var prosessingPair = waitingDecideReactionSkills[0];
                    waitingProgressSkills.Add(new KeyValuePair <ReactionSkill, KeyValuePair <IBattleable, AttackSkill> >(missReaction, prosessingPair));
                    waitingDecideReactionSkills.Remove(prosessingPair);

                    reactionAlert();

                    needToProgressReaction = false;
                    reactionLimit          = prosessingPair.Value.getDelay(prosessingPair.Key);
                    needToReaction         = true;

                    reactionButton.enabled = true;
                }
                else if (waitingProgressSkills.Count <= 0)
                {
                    needToReaction = false;
                    deleteAlert();
                }
            }
        }
Exemple #3
0
        public bool hasReactionSkill(int id)
        {
            var skills = player.getReactionSkills();
            var targetReactionSkill = ReactionSkillMasterManager.getInstance().getReactionSkillFromId(id);

            return(skills.Contains(targetReactionSkill));
        }
Exemple #4
0
        public List <ReactionSkill> getReactionSkills()
        {
            List <ReactionSkill> skills = new List <ReactionSkill>();

            foreach (int id in reactionSkillIds)
            {
                skills.Add(ReactionSkillMasterManager.getInstance().getReactionSkillFromId(id));
            }

            return(skills);
        }
Exemple #5
0
 public void use(IPlayable user)
 {
     if (IS_REACTIONSKILL)
     {
         var reactionSkill = ReactionSkillMasterManager.getInstance().getReactionSkillFromId(SKILL_ID);
         user.addSkill(reactionSkill);
     }
     else
     {
         var activeSkill = ActiveSkillSupporter.getActiveSkill(SKILL_TYPE, SKILL_ID);
         user.addSkill(activeSkill);
     }
 }
        /// <summary>
        /// ダメージを与えられます
        /// </summary>
        private void dammage()
        {
            IBattleable attacker = prosessingPair.Key;
            AttackSkill useSkill = prosessingPair.Value;

            int atk = useSkill.getAtk(attacker);
            int hit = useSkill.getHit(attacker);

            choseReaction.reaction(user, atk, hit, useSkill.getAttackSkillAttribute());
            waitingReactionActiveSkills.Remove(prosessingPair);
            updateProsessingPair();

            choseReaction = ReactionSkillMasterManager.getInstance().getReactionSkillFromId(2);
        }
Exemple #7
0
        /// <summary>
        /// リアクションが必要な時に毎フレーム行う処理
        /// </summary>
        private void reactionState()
        {
            reactionLimit -= Time.deltaTime;
            if (reactionLimit <= 0)
            {
                var reactionedSkill = waitingProgressSkills[0].Key;
                reaction();
                var missReaction = ReactionSkillMasterManager.getInstance().getReactionSkillFromId(2);

                if (reactionedSkill.Equals(missReaction))
                {
                    reactoinContents.SetActive(false);
                    contents.SetActive(true);
                    detachReactionContents();
                    backButton.gameObject.SetActive(isInputingBackButton);
                    needToProgressReaction = true;
                    updateProsessingPair();
                }
            }
        }