Exemplo n.º 1
0
        public void Init(ActData.AttackDef data, IActUnit owner, string action, ISkillItem skillItem,
                         Action <HitDefinition> finishHandle)
        {
            mAttackDef    = data;
            mOwner        = owner;
            mAction       = action;
            mSkillItem    = skillItem;
            mFinishHandle = finishHandle;

            mIsFinish    = false;
            mInitPos     = owner.Position;
            mOrientation = owner.Orientation;
            mDelayTime   = mAttackDef.Delay * 0.001f;
            UpdatePosition(0);

            if (!string.IsNullOrEmpty(mAttackDef.SelfEffect))
            {
                Vector3 tmpPos = new Vector3(mAttackDef.SelfEffectOffset.X * 0.01f,
                                             mAttackDef.SelfEffectOffset.Y * 0.01f,
                                             mAttackDef.SelfEffectOffset.Z * 0.01f);

                mHitDefEffectMgr.PlayEffect(mAttackDef.SelfEffect, mAttackDef.SelfEffectDuration * 0.001f,
                                            mCacheTransform, tmpPos, mOwner.Transform.rotation);
            }
        }
Exemplo n.º 2
0
        public override ECombatResult Combat(IActUnit target, ISkillItem skillItem)
        {
            ECombatResult tmpResult = base.Combat(target, skillItem);

            if (ECombatResult.ECR_Block != tmpResult)
            {
                Game.EventMgr.FireNow(this, ReferencePool.Fetch <UnitEvent.Combo>());
            }

            return(tmpResult);
        }
Exemplo n.º 3
0
 public virtual ECombatResult Combat(IActUnit target, ISkillItem skillItem)
 {
     return(ECombatResult.ECR_Normal);
 }
Exemplo n.º 4
0
        public void CreateHitDefinition(ActData.AttackDef data, IActUnit owner, string action, ISkillItem skillItem)
        {
            HitDefinition tmpHitDef = mHitDefPool.Spawn();

            tmpHitDef.CacheTransform.SetParent(mHitDefRoot, false);
            tmpHitDef.Init(data, owner, action, skillItem, OnFinishHandle);
            mHitDefList.Add(tmpHitDef);
        }