public override void    Enter(sdGameActor _gameActor)
    {
        base.Enter(_gameActor);

        iCount       = 0;
        fCurrentTime = 0.0f;
    }
示例#2
0
    public void playEffectNow(sdGameActor _gameActor)
    {
        if (stateData == null)
        {
            return;
        }
        Hashtable data = stateData;

        if (data.Contains("EffectFile") && data.Contains("EffectAnchor") && data.Contains("EffectLifeTime"))
        {
            string[] fileName = (string[])data["EffectFile"];
            if (fileName.Length == 0)
            {
                return;
            }
            string[] anchorNameArray = (string[])data["EffectAnchor"];
            if (anchorNameArray.Length == 0)
            {
                return;
            }
            int[] effectLifeTime = (int[])data["EffectLifeTime"];
            if (effectLifeTime.Length == 0)
            {
                return;
            }
            Vector3    effectPosition = Vector3.zero;
            Quaternion rot            = Quaternion.identity;
            if (anchorNameArray[0] == "gamelevel")
            {
                effectPosition = _gameActor.transform.position;
                rot            = _gameActor.transform.rotation;
            }
            _gameActor.attachEffect(fileName[0], anchorNameArray[0], effectPosition, rot, 1.0f, effectLifeTime[0] * 0.001f);
        }
    }
示例#3
0
    // 初始化技能信息aa
    public virtual void SetInfo(sdGameSkill info, sdGameActor kGameActor)
    {
        skillInfo = info;

        if (skillInfo != null)
        {
            cooldown         = (int)skillProperty["dwCooldown"];
            bUnLimitedAction = ((int)skillProperty["UnLimited"]) != 0;
        }

        if (isPassive)
        {
            if (skillProperty != null)
            {
                string level = skillProperty["byLevel"] as string;
                if (level != null)
                {
                    skillLevel = int.Parse(level);
                }

                string str = skillProperty["Buffid"] as string;
                if (str != null)
                {
                    int id = int.Parse(str);
                    if (id != 0)
                    {
                        //调用AddBuff会崩溃  暂时注释掉...
                        kGameActor.AddBuff(id, 0, kGameActor);
                    }
                }
            }
        }
    }
示例#4
0
    void fatalStrikeMove(sdGameActor _gameActor, int s, int e, float speed)
    {
        if (_gameActor.AnimController != null)
        {
            AnimationState aniStateTemp = aniState;

            if (aniStateTemp != null)
            {
                //float f = aniState.normalizedTime - (float)Math.Floor(aniState.normalizedTime);
                int f = (int)(aniStateTemp.normalizedTime * 10000.0f);
                if (f > s && f <= e)
                {
                    if (belongToSkill != null && belongToSkill.id == 1002)
                    {
                        _gameActor.moveGravity(_gameActor.GetDirection() * speed);
                    }
                    else
                    {
                        _gameActor.moveInternal(_gameActor.GetDirection() * speed);
                    }
                }
            }
            //<
        }
    }
示例#5
0
    public void ManualCheckTrigger(sdGameActor actor, Vector3 pos, Vector3 v)
    {
        if (!live)
        {
            return;
        }

        float      fDistance = v.magnitude;
        Vector3    vDir      = v.normalized;
        Ray        r1        = new Ray(pos + new Vector3(0, 0.1f, 0), vDir);
        Ray        r2        = new Ray(pos + new Vector3(0, actor.getHeight() - 0.1f, 0), vDir);
        RaycastHit hit;

        if (GetComponent <Collider>().Raycast(r1, out hit, fDistance))
        {
            if (CheckCondition(actor))
            {
                WhenEnterTrigger(actor.gameObject, new int[4] {
                    0, 0, 0, 0
                });
                return;
            }
        }
        if (GetComponent <Collider>().Raycast(r2, out hit, fDistance))
        {
            if (CheckCondition(actor))
            {
                WhenEnterTrigger(actor.gameObject, new int[4] {
                    0, 0, 0, 0
                });
                return;
            }
        }
    }
示例#6
0
 public void ManualCheckTrigger(sdGameActor actor, Vector3 pos, Vector3 v)
 {
     foreach (sdPhysicsTrigger t in TriggerList)
     {
         t.ManualCheckTrigger(actor, pos, v);
     }
 }
示例#7
0
    // Use this for initialization
    void Start()
    {
        actor = gameObject.GetComponent <sdGameActor>();
        if (actor == null)
        {
            actor = gameObject.GetComponent <sdGameMonster>();
        }
        if (actor != null)
        {
            auto = actor.AutoFightSystem;
            //walkPath = auto.GetCurrentPath();
        }



        renderobj      = new GameObject();
        renderobj.name = gameObject.name + "_AI_Path";
        renderobj.transform.position = Vector3.zero;
        renderobj.transform.rotation = Quaternion.identity;

        renderobj.AddComponent <MeshFilter>();
        MeshRenderer r = renderobj.AddComponent <MeshRenderer>();

        Shader shader = Shader.Find("SDShader/SelfIllum_Object");

        r.material = new Material(shader);
        Vector4 color = new Vector4(Random.Range(0.1f, 1.0f), Random.Range(0.1f, 1.0f), Random.Range(0.1f, 1.0f));

        r.material.SetVector("_Color", color);
    }
示例#8
0
    // 设置所属角色(继承自AutoFight)aa
    public override void SetActor(sdGameActor _gameActor)
    {
        base.SetActor(_gameActor);

        mMonster = (sdGameMonster)_gameActor;
        mBehaviourAdvancedState.SetMonsterAutoFight(this);              //< 初始化触发战斗系统aa
    }
示例#9
0
 protected virtual void    PlayAnim(sdGameActor actor)
 {
     if (id != 100)
     {
         aniState          = actor.AnimController[info];
         currentPlayedAnim = info;
     }
     else
     {
         aniState = actor.AnimController["knockback_death01"];
         if (aniState == null || (Time.frameCount & 1) == 0)
         {
             aniState = actor.AnimController[info];
         }
         else
         {
             if (Application.isEditor)
             {
                 //Debug.Log("knockback_death01");
             }
         }
         if (aniState != null)
         {
             currentPlayedAnim = aniState.name;
         }
         else
         {
             currentPlayedAnim = info;
         }
     }
     if (aniState != null)
     {
         if (bPassive)
         {
             if (id != 100)
             {
                 aniState.wrapMode = WrapMode.Loop;
             }
             else
             {
                 aniState.wrapMode = WrapMode.ClampForever;
             }
         }
         else
         {
             aniState.wrapMode = WrapMode.Once;
             aniState.speed    = 1.0f + actor["AttSpeedModPer"] * 0.0001f;
         }
         if (belongToSkill != null)
         {
             if (belongToSkill.id == 1002)
             {
                 actor.AnimController.Play(info, PlayMode.StopSameLayer);
                 return;
             }
         }
         actor.AnimController.Play(info, PlayMode.StopSameLayer);
     }
 }
示例#10
0
 public override void Leave(sdGameActor _gameActor)
 {
     base.Leave(_gameActor);
     if (control != null)
     {
         control.SetPositionArray(null);
     }
 }
示例#11
0
 // 设置所属角色aa
 public virtual void SetActor(sdGameActor _gameActor)
 {
     mActor = _gameActor;
     if (mActor != null)
     {
         kAutoState.Active(true, this);
     }
 }
示例#12
0
 public bool    OnCastSkill(sdGameActor actor, sdSkill skill)
 {
     if (_enabled)
     {
         return(state.OnCastSkill(actor, skill));
     }
     return(false);
 }
示例#13
0
    public sdBaseState     AddAction(sdGameActor actor, string str)
    {
        sdBaseState state = actor.logicTSM.AddActionState(str);

        state.belongToSkill = this;
        actionStateList.Add(state);
        state.actionID = actionStateList.Count - 1;
        return(state);
    }
示例#14
0
    public static void loadAndLinkActionState(sdGameActor _actor, int iJob)
    {
        {
            Hashtable table  = sdConfDataMgr.Instance().m_vecJobSkillAction[iJob];
            Hashtable action = sdConfDataMgr.CloneHashTable(table);

            _actor.SetSkillAction(action);
        }
    }
示例#15
0
 static void SetActorActive(sdGameActor actor, bool active)
 {
     actor.MotionController.enabled = active;
     for (int i = 0; i < actor.RenderNode.transform.childCount; i++)
     {
         actor.RenderNode.transform.GetChild(i).gameObject.SetActive(active);
     }
     actor.Hide = !active;
 }
示例#16
0
 // 更新时钟aaaaa
 public void tick(sdGameActor _gameActor)
 {
     if (_enabled)
     {
         if (t >= _interval)
         {
             end(_gameActor);
         }
         t += Time.deltaTime;
     }
 }
示例#17
0
 public void end(sdGameActor _gameActor)
 {
     _enabled = false;
     t        = 0.0f;
     if (targetSkill != null)
     {
         targetSkill.leave(_gameActor);
     }
     state       = null;
     targetSkill = null;
 }
示例#18
0
 public void    InitAllSkill(sdGameActor _gameActor)
 {
     foreach (DictionaryEntry de in AllSkill)
     {
         sdSkill skill = de.Value as sdSkill;
         if (skill != null)
         {
             skill.assembleActionStates(_gameActor);
         }
     }
 }
示例#19
0
    public virtual bool enter(sdGameActor _gameActor)
    {
        // 开始冷却aa
        skillState = (int)State.eSS_PreCoolDown;
        ct         = 0.0f;

        // 冷却回调aa


        return(true);
    }
示例#20
0
 public virtual bool leave(sdGameActor _gameActor)
 {
     skillState = (int)State.eSS_CoolDown;
     if (sdUICharacter.Instance != null && _gameActor == sdGameLevel.instance.mainChar)
     {
         int iSkillID = id * 100 + _gameActor.Job;
         sdUICharacter.Instance.ShowShortCutCd(iSkillID);
         sdUICharacter.Instance.SetSkillCurStage(iSkillID, 0);
     }
     return(true);
 }
示例#21
0
    public override void Update(sdGameActor _gameActor)
    {
        base.Update(_gameActor);


        fCurrentTime += Time.deltaTime;
        if (fCurrentTime > fMaxTime)
        {
            _gameActor.logicTSM.nextState = _gameActor.logicTSM.GetCurrentPassiveState();
        }
    }
示例#22
0
    // 从角色列表移除角色aa
    public void RemoveActor(sdGameActor kActor)
    {
        if (mActorList.Contains(kActor))
        {
            kActor.OnRemoveFromBehaviourNode(this);

            kActor.NotifyChangeTarget -= NotifyChangeTarget;
            kActor.NotifyHurt         -= NotifyHurt;

            mActorList.Remove(kActor);
        }
    }
示例#23
0
    public bool    OnContinueSkill(sdGameActor _gameActor)
    {
        sdBaseState next = GetNextSkillAction();

        if (next != null)
        {
            _gameActor.logicTSM.nextState = next;
            return(true);
        }

        return(false);
    }
示例#24
0
    void    EndWeaponTrail(sdGameActor actor)
    {
        if (stateData == null)
        {
            return;
        }

        if (actor.WeaponTrail != null && WeaponTrailLife != 0)
        {
            actor.WeaponTrail.ClearTrail();
        }
    }
示例#25
0
    // 添加角色到角色列表aa
    public void AddActor(sdGameActor kActor)
    {
        if (!mActorList.Contains(kActor))
        {
            mActorList.Add(kActor);

            kActor.NotifyChangeTarget += NotifyChangeTarget;
            kActor.NotifyHurt         += NotifyHurt;

            kActor.OnAddToBehaviourNode(this);
        }
    }
示例#26
0
    public virtual bool OnCastSkill(sdGameActor _gameActor, sdSkill s)
    {
        if (belongToSkill == s)
        {
            return(OnContinueSkill(_gameActor));
        }
        else
        {
            _gameActor.logicTSM.nextState = s.GetFirstValidAction();
            return(_gameActor.logicTSM.nextState != null);
        }

        return(false);
    }
示例#27
0
    // 虚函数(继承自MonoBehaviour)
    void Start()
    {
        mActor = gameObject.GetComponent <sdGameActor>();
        if (mActor == null)
        {
            mActor = gameObject.GetComponent <sdGameMonster>();
        }

        Hexagon.Coord kCoord = new Hexagon.Coord();
        for (int i = 0; i < 37; ++i)
        {
            mElementObjectList.Add(HexagonElement.NewElement(kCoord, 0, 0.0f, 3));
        }
    }
示例#28
0
    void    _InternalRotate(sdGameActor _gameActor, int begin, int end)
    {
        AnimationState aniStateTemp = aniState;

        if (aniStateTemp != null)
        {
            int f = (int)(aniStateTemp.normalizedTime * 10000.0f);

            if (f > begin && f <= end)
            {
                _gameActor.spinToTargetDirection(_gameActor.TargetFaceDirection, true);
            }
        }
    }
示例#29
0
 void comboMove(sdGameActor _gameActor, float tt)
 {
     if (_gameActor.AnimController != null)
     {
         if (aniState != null)
         {
             float f = aniState.normalizedTime - (float)System.Math.Floor(aniState.normalizedTime);
             if (f > tt)
             {
                 _gameActor.motionFunction_todo();
             }
         }
     }
 }
示例#30
0
 public void begin(sdGameActor _gameActor, sdBaseState action, float interval_, float triggerTime_)
 {
     if (_enabled)
     {
         if (targetSkill != action.belongToSkill)
         {
             end(_gameActor);
         }
     }
     state        = action;
     targetSkill  = state.belongToSkill;
     _interval    = interval_;
     _triggerTime = triggerTime_;
     begin();
 }