コード例 #1
0
ファイル: Identity.cs プロジェクト: moto2002/Pioneer
                          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");
                          }
コード例 #2
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);
     }
 }