예제 #1
0
    private bool IsSkillCanBreakByType(SkillNode node, SkillCategory category = SkillCategory.kNone)
    {
        if (node == null)
        {
            return(true);
        }
        SkillScript skill = m_SkillManager.GetSkillById(node.SkillId);

        if (skill == null || !skill.IsActive())
        {
            return(true);
        }
        if (category == SkillCategory.kNone)
        {
            return(skill.CanStopBackSwing());
        }
        if (node.Category == SkillCategory.kAttack && category == SkillCategory.kAttack)
        {
            return(skill.CanStopBackSwing());
        }
        if (node.Category != SkillCategory.kAttack && category == SkillCategory.kAttack)
        {
            return(skill.CanStop());
        }
        return(skill.CanStop());
    }
예제 #2
0
    IEnumerator PreCombatWaitForKeyPress(SkillScript charSkillScript, int processCount, Character nextCharacter, ActivationTime currentTime)
    {
        yield return(WaitForKeyPress());

        charSkillScript.SetThisCharacterUsingSkill(false);
        PreCombatEndCombatSkillActivation(nextCharacter, processCount, currentTime);
    }
예제 #3
0
    private SkillNode InitNodeByScript(List <SkillScript> skills, SkillScript ss)
    {
        SkillNode first = new SkillNode();

        first.SkillId  = ss.SkillId;
        first.Category = ss.Category;
        SkillScript nextSkillScript = GetSkillById(skills, ss.NextSkillId);

        if (nextSkillScript != null)
        {
            first.NextSkillNode = InitNodeByScript(skills, nextSkillScript);
        }
        SkillScript qSkillScript = GetSkillById(skills, ss.QSkillId);

        if (qSkillScript != null)
        {
            first.SkillQ = InitNodeByScript(skills, qSkillScript);
        }
        SkillScript eSkillScript = GetSkillById(skills, ss.ESkillId);

        if (eSkillScript != null)
        {
            first.SkillE = InitNodeByScript(skills, eSkillScript);
        }
        return(first);
    }
예제 #4
0
        private void MigrateSkills(IList <IXQueryable> oldSkills, IEnumerable <IXQueryable> newSkills)
        {
            var skillsToRemove = new List <int>();

            for (var i = 0; i < oldSkills.Count; ++i)
            {
                var replacement = newSkills.FirstOrDefault(s => CrewConfiguration.KeyEqualityComparer.Equals(oldSkills[i], s));
                if (replacement == null)
                {
                    skillsToRemove.Add(i);
                }
                else
                {
                    oldSkills[i] = replacement;
                    this.Configuration.ScriptHost.SetScript(this.GetScriptKey(replacement),
                                                            SkillScript.Create(replacement, () => this.ActualLearntSkillTrainingLevel));
                }
            }

            for (var i = skillsToRemove.Count - 1; i >= 0; --i)
            {
                oldSkills.RemoveAt(skillsToRemove[i]);
            }

            this.SetLastSkillScriptLevelGetter(() => this.ActualLastSkillTrainingLevel);
        }
예제 #5
0
 public void CastSkill(SkillScript skill)
 {
     if (!IsAlive)
     {
         return;
     }
     if (OnCC)
     {
         return;
     }
     if (skill.CastCondition())
     {
         if (unitAnimation.HasAnimation(skill.AniName))
         {
             if (target != null)
             {
                 FacingPosition(target.transform.position);
             }
             unitAnimation.PlayAnimation(skill.AniName);
             CastSkillCallBack = () =>
             {
                 skill.OnCast();
             };
         }
         else
         {
             skill.OnCast();
         }
         for (int i = 0; i < listSkill.Count; i++)
         {
             listSkill[i].TriggerPassiveAfterCastSkill(skill);
         }
     }
 }
예제 #6
0
 public void CastSkillAtPosition(SkillScript skill, Vector2 pos)
 {
     if (!IsAlive)
     {
         return;
     }
     if (OnCC)
     {
         return;
     }
     if (skill.CastCondition())
     {
         if (unitAnimation.HasAnimation(skill.AniName))
         {
             FacingPosition(pos);
             unitAnimation.PlayAnimation(skill.AniName);
             CastSkillCallBack = () =>
             {
                 skill.OnCastDragSkill(pos);
             };
         }
         else
         {
             skill.OnCastDragSkill(pos);
         }
     }
 }
예제 #7
0
    public void SendSkillImpactToObj(int skillid, int impactgroupid, GameObject obj)
    {
        if (m_SkillManager == null)
        {
            Debug.Log("skill manage is null!");
            return;
        }
        SkillScript skill_script = m_SkillManager.GetSkillById(skillid);

        if (skill_script == null)
        {
            return;
        }
        skill_script.PlayCollideSound();
        StateImpact impacts = FindImpactByState(skill_script, impactgroupid, GetBeHitState(obj));

        if (impacts == null)
        {
            return;
        }
        foreach (ImpactInfo imp_info in impacts.m_ImpactInfos)
        {
            ImpactInfo info = imp_info.Clone() as ImpactInfo;
            info.m_Velocity = gameObject.transform.TransformPoint(info.m_Velocity);
            info.m_Velocity = info.m_Velocity - gameObject.transform.position;
            info.m_Attacker = gameObject;
            m_ImpactSystem.SendImpact(gameObject, obj, info);
        }
    }
예제 #8
0
    // Update is called once per frame
    void Update()
    {
        // 키보드 입력을 받아 스킬클래스에게 전달
        foreach (KeyCode key in keyBoardCodes)
        {
            if (Input.GetKeyDown(key))
            {
                foreach (var SkillScript in skillArray)
                {
                    SkillScript.InputKeyBoardBtn(key);
                }
            }
        }

        // 마우스 입력을 받아 스킬클래스에게 전달
        foreach (int key in mouseCodes)
        {
            if (Input.GetMouseButtonDown(key))
            {
                foreach (var SkillScript in skillArray)
                {
                    SkillScript.InputMouseBtn(key);
                }
            }
        }
    }
예제 #9
0
 public void SetGrenadeTo(GameObject skill)
 {
     grenade = Instantiate(skill, transform.position, new Quaternion()) as GameObject;
     grenade.transform.parent = transform.parent;
     grenadescript            = grenade.GetComponent <SkillScript>();
     grenadescript.SetAimTransform(aimNode);
     grenadescript.SetParent(parent);
 }
예제 #10
0
 public void SetSkill3To(GameObject skill)
 {
     skill3 = Instantiate(skill, transform.position, new Quaternion()) as GameObject;
     skill3.transform.parent = transform.parent;
     skill3script            = skill3.GetComponent <SkillScript>();
     skill3script.SetAimTransform(aimNode);
     skill3script.SetParent(parent);
 }
예제 #11
0
        public void LearnSkill(IXQueryable skill)
        {
            this.SetLastSkillScriptLevelGetter(() => this.ActualLearntSkillTrainingLevel);

            CrewInstance.TransferSkill(skill, _availableSkills, _learntSkills);
            this.Configuration.ScriptHost.SetScript(this.GetScriptKey(skill), SkillScript.Create(skill, () => this.ActualLastSkillTrainingLevel));

            this.InvalidateSkillEffects();
        }
예제 #12
0
    void Start()
    {
        SkillScript script = GetComponent <SkillScript> ();

        script.explanationText            = "攻撃力強くなるよ";
        script.invocationEffectPrefabPath = "res/prefab/atteff1";
        script.runtimeEffectPrefabPath    = "res/prefab/eff2";
        script.skillIconSpritePath        = "Attack_up";
    }
예제 #13
0
    // Use Awake as CombatManagers need to take in character in Start
    void Awake()
    {
        myCharacter     = GetComponent <Character>();
        myOpponent      = FindObjectOfType <EnemyScript>().GetComponent <Character>();
        myCombatManager = FindObjectOfType <CombatManager>();
        mySkillScript   = GetComponent <SkillScript>();

        mySkillScript.SetThisCharacterOpponent(myOpponent);
    }
예제 #14
0
    void Start()
    {
        SkillScript script = GetComponent <SkillScript> ();

        script.explanationText            = "このスキル・・・\n踊るよ・・・";
        script.invocationEffectPrefabPath = "res/prefab/spdeff1";
        script.runtimeEffectPrefabPath    = "res/prefab/spdeff2";
        script.skillIconSpritePath        = "Avoidance_up";
    }
예제 #15
0
파일: spdUp.cs 프로젝트: potohu9/newSurvior
    void Start()
    {
        SkillScript script = GetComponent <SkillScript> ();

        script.explanationText            = "早くなるよ";
        script.invocationEffectPrefabPath = "res/prefab/spdeff1";
        script.runtimeEffectPrefabPath    = "res/prefab/spdeff2";
        script.skillIconSpritePath        = "Speed_up";
    }
예제 #16
0
    void Start()
    {
        SkillScript script = GetComponent <SkillScript> ();

        script.explanationText            = "防御力強くなるよ";
        script.invocationEffectPrefabPath = "res/prefab/dffeff";
        script.runtimeEffectPrefabPath    = "res/prefab/dffeff2";
        script.skillIconSpritePath        = "Deffens_up";
    }
예제 #17
0
    private AnimationClip GetCurPlayingAnims()
    {
        SkillScript ss = m_SkillManager.GetCurPlaySkill();

        if (ss != null)
        {
            return(ss.GetCurAnimationClip());
        }
        return(null);
    }
예제 #18
0
    // child should override this function
    public override bool StopSkill(SkillNode node)
    {
        SkillScript ss = m_SkillManager.GetCurPlaySkill();

        if (ss != null && ss.IsActive())
        {
            ss.StopSkill();
        }
        return(true);
    }
예제 #19
0
    public override void ForceStopCurSkill()
    {
        SkillScript ss = m_SkillManager.GetCurPlaySkill();

        if (ss == null)
        {
            return;
        }
        ss.ForceStopSkill();
    }
 public void LoadSkill(SkillScript skillScript, bool loop = false, bool flip = false)
 {
     this.skillScript = skillScript;
     this.loop        = loop;
     isAlive          = true;
     if (skeletonAnimation != null)
     {
         skeletonAnimation.skeleton.flipX = flip;
     }
 }
예제 #21
0
    // Update is called once per frame
    void Update()
    {
        if (script.setSukill != null)
        {
            GameObject skillObj = GameObject.Find(script.setSukill);
            skillText = skillObj.GetComponent <SkillScript>();

            Text myText = GetComponent <Text>();
            myText.text = skillText.explanationText;
        }
    }
예제 #22
0
 public void LoadSkill(SkillInfo info)
 {
     _skillScript       = new SkillScript(info.IndexSkill);
     _skillScript.Level = info.LevelSkill;
     Icon.sprite        = Resources.Load <Sprite>(string.Format(CONSTANT.PathUISkillIcon, _skillScript.IconName));
     for (int i = 0; i < ListLevel.Count; i++)
     {
         ListLevel[i].gameObject.SetActive(i < _skillScript.MaxLevel);
         ListLevel[i].color = i < _skillScript.Level ? Color.red : Color.black;
     }
 }
예제 #23
0
    /// <summary>
    /// Damageを与える
    /// </summary>
    /// <param name="target">Target.</param>
    /// <param name="sc">Skill Script.</param>
    /// <param name="time">Damageを与える時間</param>
    /// <returns></returns>
    public IEnumerator Damage(GameObject target, SkillScript sc, float time)
    {
        if (sc.s_targetNum == TargetNum.MUTIPLE)
        {
            CreateRange();
            GameObject.FindGameObjectWithTag("Range").GetComponent <SphereCollider>().radius = sc.s_range;
        }
        float timer = 0;

        while (true)
        {
            timer += Time.deltaTime;
            float counter = timer / time;
            if (counter >= 1)
            {
                try
                {
                    float s_power = 1;  //精霊の力
                    if (CheckFlag(ConditionStatus.POWER_UP))
                    {
                        s_power = 1.5f;
                    }
                    if (sc.s_targetNum == TargetNum.MUTIPLE)
                    {
                        foreach (var r_target in GameObject.FindGameObjectWithTag("Range").GetComponent <RangeDetect>().targets)
                        {
                            if (r_target.layer != LayerMask.NameToLayer("Enemy"))
                            {
                                continue;
                            }
                            Target_Damage(r_target, sc.s_power, s_power);
                        }
                    }
                    else
                    {
                        Target_Damage(target, sc.s_power, s_power);
                    }
                    if (GameObject.FindGameObjectWithTag("Range"))
                    {
                        DeleteRange();
                    }
                    StartCoroutine(SkillRecast(sc.gameObject, sc.s_recast));
                    ReturnPos();
                    yield break;
                }
                catch (MissingReferenceException)
                {
                    ReturnPos();
                    yield break;
                }
            }
            yield return(new WaitForEndOfFrame());
        }
    }
        public void LoadSkill(SkillScript skill, SpellDragObject.OnFinishDrag onFinish)
        {
            this.skill        = skill;
            SpellDrag.enabled = skill.CanDrag;
            SpellDrag.CallBackOnFinishDrag = CastSkillAtPosition;
            SpellDrag.ScaleAOE             = skill.AreaOfEffect * 2;
            SpellImage.sprite = Resources.Load <Sprite>(string.Format(CONSTANT.PathUISkillIcon, skill.IconName));

            BtnCast.enabled = skill.Type == SkillScript.SkillType.Active;
            BtnCast.onClick.RemoveAllListeners();
            BtnCast.onClick.AddListener(CastSkill);
        }
예제 #25
0
    private bool checkSkillRandEvent()
    {
        DataType myName           = DataType.DATA_SKILL_RAND_EVENT;
        IDictionaryEnumerator itr = DataManager.RandEventTable.GetEnumerator();

        while (itr.MoveNext())
        {
            SkillRandEventTableItem item = itr.Value as SkillRandEventTableItem;
            if (!checkParam(item.triggerType < RandEventTriggerType.Count, myName, item.resID, "触发类型"))
            {
                return(false);
            }

            if (item._3DEffectID != uint.MaxValue && !checkLink(myName, item.resID, DataType.DATA_EFFECT, item._3DEffectID))
            {
                return(false);
            }

            if (!checkParam(item.triggerScript == SkillScriptDef.Invalid || item.triggerScript < SkillScriptDef.Count,
                            myName, item.resID, "脚本ID"))
            {
                return(false);
            }

            SkillScript script = SkillScriptFactory.Instance.Allocate(item.triggerScript, null);

            if (!checkParam(script.ScriptTriggerType == item.triggerType, myName, item.resID, "触发类型", "脚本的触发类型和随机事件的触发类型不一致"))
            {
                return(false);
            }
        }
//      foreach (int key in DataManager.RandEventTable.Keys)
//      {
//          SkillRandEventTableItem item = DataManager.RandEventTable[key] as SkillRandEventTableItem;
//          if (!checkParam(item.triggerType < RandEventTriggerType.Count, myName, key, "触发类型"))
//              return false;
//
//          if (item._3DEffectID != uint.MaxValue && !checkLink(myName, key, DataType.DATA_EFFECT, item._3DEffectID))
//              return false;
//
//          if (!checkParam(item.triggerScript == SkillScriptDef.Invalid || item.triggerScript < SkillScriptDef.Count,
//              myName, key, "脚本ID"))
//              return false;
//
//          SkillScript script = SkillScriptFactory.Instance.Allocate(item.triggerScript, null);
//
//          if (!checkParam(script.ScriptTriggerType == item.triggerType, myName, key, "触发类型", "脚本的触发类型和随机事件的触发类型不一致"))
//              return false;
//      }

        return(true);
    }
예제 #26
0
    public void RegisterSkillCollideCurveMove(string str_param)
    {
        if (m_SkillManager == null)
        {
            return;
        }
        SkillScript cur_skill = m_SkillManager.GetCurPlaySkill();

        if (cur_skill != null)
        {
            cur_skill.RegisterCollideCurveMove(str_param);
        }
    }
예제 #27
0
    public override float GetSkillCD(SkillNode node)
    {
        if (node == null)
        {
            return(0);
        }
        SkillScript skill = m_SkillManager.GetSkillById(node.SkillId);

        if (skill == null)
        {
            return(0);
        }
        return(skill.m_CD);
    }
예제 #28
0
    public override bool IsSkillCanBreakByImpact(SkillNode node)
    {
        if (node == null)
        {
            return(true);
        }
        SkillScript ss = m_SkillManager.GetSkillById(node.SkillId);

        if (ss == null)
        {
            return(true);
        }
        return(ss.IsCanBreakByImpact());
    }
예제 #29
0
    public override bool IsSkillInCD(SkillNode node)
    {
        if (node == null)
        {
            return(false);
        }
        SkillScript skill = m_SkillManager.GetSkillById(node.SkillId);

        if (skill == null)
        {
            return(false);
        }
        return(skill.IsInCD());
    }
예제 #30
0
    public override float GetLockInputTime(SkillNode node)
    {
        if (node == null)
        {
            return(0);
        }
        SkillScript skill = m_SkillManager.GetSkillById(node.SkillId);

        if (skill == null)
        {
            return(0);
        }
        return(node.StartTime + skill.LockInputTime);
    }