예제 #1
0
        public bool CheckRunEffEnabl(int skillId, ISkillTarget target)
        {
            EffSkillInstance inst = new EffSkillInstance();

            inst.m_data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId));
            if (null == inst.m_data)
            {
                // TODO : a warning message of no such skill
                return(false);
            }

            if (null != m_effShareSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchType(iterSkill0, inst.m_data.m_cdInfo.m_type)))
            {
                // TODO : a warning message of another instance of this effskill is still running
                return(false);
            }

            if (null != m_effSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchId(iterSkill0, skillId)))
            {
                // TODO : a warning message of another instance of this effskill is still running
                return(false);
            }
            // TODO : cd info check

            if (!inst.m_data.CheckTargetsValid(this, target))
            {
                // TODO : a warning message of not target in scope
                return(false);
            }
            return(true);
        }
예제 #2
0
        public EffSkillInstance RunEffOnProxy(int skillId, ISkillTarget target)
        {
            EffSkillInstance inst = new EffSkillInstance();

            inst.m_data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId));
            if (null == inst.m_data)
            {
                // TODO : a warning message of no such skill
                return(null);
            }

            if (null != m_effShareSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchType(iterSkill0, inst.m_data.m_cdInfo.m_type)))
            {
                // TODO : a warning message of another instance of this effskill is still running
                return(null);
            }

            if (null != m_effSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchId(iterSkill0, skillId)))
            {
                // TODO : a warning message of another instance of this effskill is still running
                return(null);
            }
            // TODO : cd info check

            //if (!inst.m_data.CheckTargetsValid(this, target))
            //{
            //	// TODO : a warning message of not target in scope
            //	return null;
            //}

            inst.m_timeStartPrep = Time.time;
            inst.m_runner        = new CoroutineStoppable(this, inst.m_data.ExecProxy(this, target, inst));
            inst.m_sharedRunner  = new CoroutineStoppable(this, inst.m_data.SharingCooling(this, inst));
            return(inst);
        }
예제 #3
0
    public float GetFinalAttack()
    {
        EffSkill data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, damageSkillID));

        float attackDamage = GetAttribute(Pathea.AttribType.Atk) * data.m_guidInfo.m_hpChangePercent + data.m_guidInfo.m_hpChangeOnce;

        return(attackDamage);
    }
예제 #4
0
        public EffSkillInstance SkipEff(int skillId)
        {
            //enter skill's cooldown without taking effect
            EffSkillInstance inst = new EffSkillInstance();

            inst.m_data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId));
            if (null == inst.m_data)
            {
                // TODO : a warning message of no such skill
                return(null);
            }

            inst.m_runner       = new CoroutineStoppable(this, inst.m_data.SkipExec(this, inst));
            inst.m_sharedRunner = new CoroutineStoppable(this, inst.m_data.SharingCooling(this, inst));
            return(inst);
        }
예제 #5
0
        public bool IsSharedCooling(int skillId)
        {
            EffSkill skill = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId));

            if (skill == null)
            {
                return(false);
            }

            if (null != m_effShareSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchType(iterSkill0, skill.m_cdInfo.m_type)))
            {
                // TODO : a warning message of another instance of this effskill is still running
                return(true);
            }

            return(false);
        }
예제 #6
0
        // TODO : Confirm how an enemy to attack building
        public EffSkillInstance RunEff(int skillId, ISkillTarget target)
        {
            EffSkillInstance inst = new EffSkillInstance();

            inst.m_data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, skillId));
            if (null == inst.m_data)
            {
                // TODO : a warning message of no such skill
                return(null);
            }

            if (null != m_effShareSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchType(iterSkill0, inst.m_data.m_cdInfo.m_type)))
            {
                // TODO : a warning message of another instance of this effskill is still running
                return(null);
            }

            if (null != m_effSkillInsts.Find(iterSkill0 => EffSkillInstance.MatchId(iterSkill0, skillId)))
            {
                // TODO : a warning message of another instance of this effskill is still running
                return(null);
            }
            // TODO : cd info check

            if (!inst.m_data.CheckTargetsValid(this, target))
            {
                // TODO : a warning message of not target in scope
                return(null);
            }

            if (!GameConfig.IsMultiMode || IsController)
            {
                if (GameConfig.IsMultiMode)
                {
                    if (target is CommonInterface)
                    {
                        CommonInterface ta = target as CommonInterface;
                        if (null != ta && null != ta.OwnerView)
                        {
                            RPCServer(EPacketType.PT_InGame_SkillCast, skillId, ta.OwnerView.viewID);
                        }
                        else
                        {
                            RPCServer(EPacketType.PT_InGame_SkillCast, skillId, uLink.NetworkViewID.unassigned);
                        }
                    }
                    else if (target is DefaultPosTarget)
                    {
                        RPCServer(EPacketType.PT_InGame_SkillShoot, skillId, target.GetPosition());
                    }
                    else
                    {
                        RPCServer(EPacketType.PT_InGame_SkillCast, skillId, uLink.NetworkViewID.unassigned);
                    }
                }

                inst.m_timeStartPrep = Time.time;
                inst.m_runner        = new CoroutineStoppable(this, inst.m_data.Exec(this, target, inst));
                inst.m_sharedRunner  = new CoroutineStoppable(this, inst.m_data.SharingCooling(this, inst));
            }
            return(inst);
        }
예제 #7
0
    public void CastDamageSkill(Collider other)
    {
        if (emitRunner == null || other == null)
        {
            return;
        }

        VFVoxelChunkGo chunk      = other.GetComponent <VFVoxelChunkGo>();
        B45ChunkGo     buildChunk = other.GetComponent <B45ChunkGo>();

        if (chunk != null || null != buildChunk)
        {
            EffSkill skillData = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, damageSkillID));
            if (skillData.m_scopeOfSkill != null)
            {
                RunEff(damageSkillID, null);
            }
            else
            {
                RunEff(damageSkillID, new DefaultPosTarget(transform.position));
            }
        }
        else
        {
            if (other != null)
            {
                int emitHarm = AiUtil.GetHarm(emitRunner.gameObject);
                if (GameConfig.IsMultiMode)
                {
                    SkillRunner obj = VCUtils.GetComponentOrOnParent <SkillRunner>(other.gameObject);
                    if (null == obj)
                    {
                        return;
                    }

                    int targetHarm = AiUtil.GetHarm(obj.gameObject);

                    if (AiHarmData.GetHarmValue(emitHarm, targetHarm) == 0)
                    {
                        return;
                    }
                }
                else
                {
                    int targetHarm = AiUtil.GetHarm(other.gameObject);

                    if (AiHarmData.GetHarmValue(emitHarm, targetHarm) == 0)
                    {
                        return;
                    }
                }
            }

            EffSkill data = EffSkill.s_tblEffSkills.Find(iterSkill1 => EffSkill.MatchId(iterSkill1, damageSkillID));

            if (data != null)
            {
                if (data.m_scopeOfSkill != null)
                {
                    RunEff(damageSkillID, null);
                }
                else
                {
                    SkillRunner runner = VCUtils.GetComponentOrOnParent <SkillRunner>(other.gameObject);
                    if (runner != null)
                    {
                        RunEff(damageSkillID, runner);
                    }
                }
            }
        }
    }