Ejemplo n.º 1
0
    public virtual void    PlayHitEffect(sdActorInterface monster)
    {
        if (stateData != null)
        {
            string strHitEffect = stateData["HitEffect"] as string;

            if (strHitEffect.Length > 0)
            {
                int       hitEffectLife = (int)stateData["HitEffectLife"];
                float     fLife         = hitEffectLife * 0.001f;
                Transform bindnode      = monster.transform;
                if (monster.actorType == ActorType.AT_Monster)
                {
                    sdGameMonster actor = (sdGameMonster)monster;
                    if (actor.ChestPoint.Length > 0)
                    {
                        GameObject chest = actor.GetNode(actor.ChestPoint.Replace("\r\n", ""));
                        if (chest != null)
                        {
                            bindnode = chest.transform;
                        }
                    }
                }
                else if (monster.actorType == ActorType.AT_Player)
                {
                    if (stateData.ContainsKey("HitDummy"))
                    {
                        int pos = (int)stateData["HitDummy"];
                        if (pos == 1)
                        {
                            sdGameActor gameactor = (sdGameActor)monster;
                            GameObject  chest     = gameactor.GetNode("Bip01 Spine");
                            if (chest != null)
                            {
                                bindnode = chest.transform;
                            }
                        }
                    }
                }
                bool bRotate = true;
                if (stateData.ContainsKey("HitEffectRotate"))
                {
                    bRotate = ((int)stateData["HitEffectRotate"] == 1);
                }
                sdActorInterface.AddHitEffect(strHitEffect, bindnode, fLife, Vector3.zero, bRotate);
            }
        }
    }
Ejemplo n.º 2
0
    public int     OnHit(List <sdActorInterface> lstactor, HeaderProto.ESkillEffect eSkileffect)
    {
        int CalcDamage = (int)info["CalcDamage"];

        info["ParentID"] = skillID * 100;
        int nRet = 0;
        List <Bubble.BubbleType> lstBubbleType = new List <Bubble.BubbleType>();

        for (int index = 0; index < lstactor.Count; ++index)
        {
            sdActorInterface actor = lstactor[index];

            if (PeriodTime == 0)
            {
                if (!actor.IsCanSummonAttack(uniqueID))
                {
                    lstBubbleType.Add(Bubble.BubbleType.eBT_Max);
                    continue;
                }
                actor.SetSummonAttackInfo(uniqueID);
            }
            DamageResult dr;
            dr.damage = 0;
            if (CalcDamage != 0)
            {
                dr = sdGameLevel.instance.battleSystem.testHurt(castActor, info, actor, 0, eSkileffect);
                lstBubbleType.Add(dr.bubbleType);
                if (Bubble.IsHurtOther(dr.bubbleType))
                {
                    ++nRet;
                }
            }
            else
            {
                lstBubbleType.Add(Bubble.BubbleType.eBT_Max);
            }

            string hitEffect = info["HitEffect"] as string;
            if (hitEffect.Length > 0 && dr.damage > 0)
            {
                int       life     = (int)info["HitEffectLife"];
                Transform bindnode = actor.transform;
                if (actor.actorType == ActorType.AT_Player)
                {
                    if (info.ContainsKey("HitDummy"))
                    {
                        int pos = (int)info["HitDummy"];
                        if (pos == 1)
                        {
                            sdGameActor gameactor = (sdGameActor)actor;
                            GameObject  chest     = gameactor.GetNode("Bip01 Spine");
                            if (chest != null)
                            {
                                bindnode = chest.transform;
                            }
                        }
                    }
                }
                else
                {
                    sdGameMonster monster = (sdGameMonster)actor;
                    if (monster.ChestPoint.Length > 0)
                    {
                        GameObject chest = monster.GetNode(monster.ChestPoint.Replace("\r\n", ""));
                        if (chest != null)
                        {
                            bindnode = chest.transform;
                        }
                    }
                }
                sdGameActor.AddHitEffect(hitEffect, bindnode, life * 0.001f, Vector3.zero, true);
            }
        }
        sdBaseState.AddSkillEffect(castActor, lstactor, lstBubbleType, skillEffect, transform, skillID);
        return(nRet);
    }
Ejemplo n.º 3
0
    void    PlayEffect()
    {
        if (m_Effect != null)
        {
            return;
        }
        Hashtable buffs = sdConfDataMgr.Instance().GetTable("buff");
        object    table = buffs[templateId.ToString()];

        if (table != null)
        {
            Hashtable buffinfo = table as Hashtable;
            if (buffinfo != null)
            {
                object texiao = buffinfo["Effect"];
                if (texiao != null)
                {
                    string str = texiao as string;
                    if (str != null && str.Length > 0)
                    {
                        object           bind     = buffinfo["Dummy"];
                        sdActorInterface actor    = GetActor();
                        GameObject       bindNode = GetActor().gameObject;
                        bool             bHead    = false;
                        if (actor.actorType == ActorType.AT_Player)
                        {
                            sdGameActor gactor = (sdGameActor)actor;
                            if (bind != null)
                            {
                                int Dummy = (int)bind;
                                if (Dummy == 1)
                                {
                                    bindNode = gactor.GetNode("Bip01_attack_target");
                                }
                                else if (Dummy == 2)
                                {
                                    bindNode = gactor.GetNode("Bip01 HeadNub");
                                    bHead    = true;
                                }
                            }
                        }
                        else
                        {
                            sdGameMonster monster = (sdGameMonster)actor;
                            if (bind != null)
                            {
                                int Dummy = (int)bind;
                                if (Dummy == 1)
                                {
                                    bindNode = monster.GetNode(monster.ChestPoint.Replace("\r\n", ""));
                                }
                                else if (Dummy == 2)
                                {
                                    bindNode = monster.GetNode(monster.HeadPoint.Replace("\r\n", ""));
                                    bHead    = true;
                                }
                            }
                        }
                        if (bindNode != null)
                        {
                            bool bRotate = (int.Parse((string)buffinfo["EffectRotate"])) != 0;
                            if (bHead)
                            {
                                CharacterController cc = actor.GetComponent <CharacterController>();
                                AddEffect(str, actor.transform, 0.0f, new Vector3(0, cc.height, 0), false);
                            }
                            else
                            {
                                AddEffect(str, bindNode.transform, 0.0f, new Vector3(0, 0.0f, 0), bRotate);
                            }
                        }
                        else
                        {
                            AddEffect(str, GetActor().transform, 0.0f, new Vector3(0, 0, 0), true);
                        }
                    }
                }
            }
        }
    }