public override void Bleed(BattleAction_Bleed data, bool isServerData)
 {
     if (data.bleedSoldierId != this.owner.ID)
     {
         return;
     }
     if (EntityWorld.Instance.AllEntities.ContainsKey(data.dmgSrcSoldierId))
     {
         this.owner.SetHPChange(HPChangeMessage.GetDamageMessage(data.bleedHp, data.dmgSrcType, data.elemType, this.owner, EntityWorld.Instance.AllEntities[data.dmgSrcSoldierId], data.isCrt, data.isParry, data.isMiss));
         if (data.hp <= 0L && DataReader <AvatarModel> .Get(this.owner.FixModelID).noTurn == 0 && !this.owner.IsLogicBoss && this.owner.Actor && !this.owner.Actor.IsLockModelDir)
         {
             Vector3 position = EntityWorld.Instance.AllEntities[data.dmgSrcSoldierId].Actor.FixTransform.get_position();
             Vector3 vector   = new Vector3(position.x - this.owner.Actor.FixTransform.get_position().x, 0f, position.z - this.owner.Actor.FixTransform.get_position().z);
             if (vector != Vector3.get_zero())
             {
                 this.owner.Actor.ForceSetDirection(vector);
                 this.owner.Actor.ApplyMovingDirAsForward();
             }
         }
     }
     else
     {
         this.owner.SetHPChange(HPChangeMessage.GetDamageMessage(data.bleedHp, data.dmgSrcType, data.elemType, this.owner, null, data.isCrt, data.isParry, data.isMiss));
     }
     this.owner.DamageSourceID = data.dmgSrcSoldierId;
     this.owner.Hp             = data.hp;
 }
示例#2
0
 protected override void ThrowBloodEffect(HPChangeMessage data)
 {
     if (data.hpChangeType != HPChangeMessage.HPChangeType.KillRecover)
     {
         WaveBloodManager.Instance.ThrowBlood(data);
     }
 }
示例#3
0
    protected override void UpdateHpChangeInfluence(HPChangeMessage data)
    {
        switch (data.hpChangeType)
        {
        case HPChangeMessage.HPChangeType.Normal:
        case HPChangeMessage.HPChangeType.Critical:
        case HPChangeMessage.HPChangeType.Parry:
        case HPChangeMessage.HPChangeType.CriticalAndParry:
            if (base.IsPlayerMate)
            {
                if (!this.IsEntitySelfType && DataReader <JJiaoSeSheZhi> .Get(this.TypeID).hitTips > 0)
                {
                    EventDispatcher.Broadcast <int, LiveTextMessage>(BattleUIEvent.LiveText, 1, new LiveTextMessage
                    {
                        contentID = DataReader <JJiaoSeSheZhi> .Get(this.TypeID).hitTips,
                        showTime  = 2000,
                        name      = this.Name
                    });
                }
            }
            else if (data.modeType == HPChangeMessage.ModeType.MonsterBySelf && base.Actor)
            {
                EventDispatcher.Broadcast <int, Transform>(CameraEvent.PlayerGetHit, this.TypeID, base.Actor.FixTransform);
            }
            break;

        case HPChangeMessage.HPChangeType.Miss:
            if (base.IsPlayerMate && !this.IsEntitySelfType && DataReader <JJiaoSeSheZhi> .Get(this.TypeID).hitTips > 0)
            {
                EventDispatcher.Broadcast <int, LiveTextMessage>(BattleUIEvent.LiveText, 1, new LiveTextMessage
                {
                    contentID = DataReader <JJiaoSeSheZhi> .Get(this.TypeID).hitTips,
                    showTime  = 2000,
                    name      = this.Name
                });
            }
            break;

        case HPChangeMessage.HPChangeType.KillRecover:
            if (base.Actor && !this.IsEntitySelfType)
            {
                int   templateId   = (int)float.Parse(DataReader <GlobalParams> .Get("killReply").value);
                float speed        = float.Parse(DataReader <GlobalParams> .Get("killReplySpeed").value) * 0.01f;
                float lessDistance = float.Parse(DataReader <GlobalParams> .Get("killReplyHeight_y").value) * 0.01f;
                int   getFxID      = (int)float.Parse(DataReader <GlobalParams> .Get("killReply_get").value);
                FXManager.Instance.PlayFXOfFollow(templateId, data.casterPosition, base.Actor.FixTransform, speed, lessDistance, XUtility.GetHitRadius(base.Actor.FixTransform), delegate
                {
                    if (!this.Actor)
                    {
                        return;
                    }
                    FXManager.Instance.PlayFX(getFxID, this.Actor.FixTransform, Vector3.get_zero(), Quaternion.get_identity(), 1f, 1f, 0, false, 0, null, null, 1f, FXClassification.Normal);
                    WaveBloodManager.Instance.ThrowBlood(data);
                }, FXClassification.Normal);
            }
            break;
        }
        base.UpdateHpChangeInfluence(data);
    }
示例#4
0
 public static HPChangeMessage GetBreakMessage(EntityParent target, EntityParent source)
 {
     return(new HPChangeMessage
     {
         targetID = source.ID,
         modeType = HPChangeMessage.GetModeType(target, source),
         hpChangeType = HPChangeMessage.HPChangeType.Break
     });
 }
示例#5
0
 public static HPChangeMessage GetDamageMessage(long damageValue, BattleAction_Bleed.DmgSrcType causeType, ElemType.ENUM elementType, EntityParent target, EntityParent source, bool isCritical, bool isParry, bool isMiss)
 {
     return(new HPChangeMessage
     {
         targetID = target.ID,
         modeType = HPChangeMessage.GetModeType(target, source),
         causeType = HPChangeMessage.GetCauseType(causeType),
         elementType = HPChangeMessage.GetElementType(elementType),
         hpChangeType = HPChangeMessage.GetHPChangeType(isCritical, isParry, isMiss),
         hpChangeValue = (float)damageValue
     });
 }
示例#6
0
 public static HPChangeMessage GetTreatMessage(long treatValue, BattleAction_Treat.TreatSrcType causeType, EntityParent target, EntityParent source, bool hasCasterPosition, Vector3 casterPosition)
 {
     return(new HPChangeMessage
     {
         targetID = target.ID,
         modeType = HPChangeMessage.GetModeType(target, source),
         hpChangeType = HPChangeMessage.GetHPChangeType(causeType),
         hpChangeValue = (float)treatValue,
         hasCasterPosition = hasCasterPosition,
         casterPosition = casterPosition
     });
 }
        public override void ClientHandleHit(EntityParent caster, Effect effectData, XPoint basePoint)
        {
            if (!this.ownerActor)
            {
                return;
            }
            AvatarModel avatarModel = DataReader <AvatarModel> .Get(this.owner.FixModelID);

            XPoint xPoint      = basePoint.ApplyOffset(effectData.offset);
            string hitAction   = this.ownerActor.GetHitAction(effectData.hitAction);
            float  num         = 0f;
            float  hitMoveTime = 0f;

            if (effectData.hitMove != null && effectData.hitMove.get_Count() > 1)
            {
                num         = effectData.hitMove.get_Item(0) * avatarModel.hitMove;
                hitMoveTime = effectData.hitMove.get_Item(1);
            }
            Vector3 arg_157_0;

            if (effectData.hitBase == 1)
            {
                Vector3 vector = new Vector3(xPoint.position.x - this.ownerActor.FixTransform.get_position().x, 0f, xPoint.position.z - this.ownerActor.FixTransform.get_position().z);
                arg_157_0 = vector.get_normalized();
            }
            else
            {
                Vector3 vector2 = new Vector3(basePoint.position.x - this.ownerActor.FixTransform.get_position().x, 0f, basePoint.position.z - this.ownerActor.FixTransform.get_position().z);
                arg_157_0 = vector2.get_normalized();
            }
            Vector3 hitMoveDir      = arg_157_0;
            string  curActionStatus = this.ownerActor.CurActionStatus;

            if (num == 0f)
            {
                this.ownerActor.ClientPlayHit(hitAction, effectData.hitstraight, effectData.hitActionPriority, true);
            }
            else
            {
                this.ownerActor.ClientPlayHitMove(hitAction, hitMoveDir, num, hitMoveTime, effectData.hitstraight, effectData.hitActionPriority, delegate(Vector3 toPos, Vector3 dir)
                {
                });
            }
            if (caster != null && caster.IsEntitySelfType && caster.Actor && this.ownerActor.CurActionStatus == hitAction && ActionStatusName.IsSkillAction(curActionStatus))
            {
                WaveBloodManager.Instance.ThrowBlood(HPChangeMessage.GetBreakMessage(this.owner, caster));
            }
        }
示例#8
0
 public virtual void Bleed(BattleAction_Bleed data, bool isServerData)
 {
     if (data.bleedSoldierId != this.owner.ID)
     {
         return;
     }
     if (EntityWorld.Instance.AllEntities.ContainsKey(data.dmgSrcSoldierId))
     {
         this.owner.SetHPChange(HPChangeMessage.GetDamageMessage(data.bleedHp, data.dmgSrcType, data.elemType, this.owner, EntityWorld.Instance.AllEntities[data.dmgSrcSoldierId], data.isCrt, data.isParry, data.isMiss));
     }
     else
     {
         this.owner.SetHPChange(HPChangeMessage.GetDamageMessage(data.bleedHp, data.dmgSrcType, data.elemType, this.owner, null, data.isCrt, data.isParry, data.isMiss));
     }
     this.owner.DamageSourceID = data.dmgSrcSoldierId;
     this.owner.Hp             = data.hp;
 }
示例#9
0
 protected override void UpdateHpChangeInfluence(HPChangeMessage data)
 {
     switch (data.hpChangeType)
     {
     case HPChangeMessage.HPChangeType.Normal:
     case HPChangeMessage.HPChangeType.Critical:
     case HPChangeMessage.HPChangeType.Parry:
     case HPChangeMessage.HPChangeType.CriticalAndParry:
     case HPChangeMessage.HPChangeType.Miss:
         if (base.IsPlayerMate && base.OwnerID != EntityWorld.Instance.EntSelf.ID && DataReader <Pet> .Get(this.TypeID).hitTips > 0)
         {
             EventDispatcher.Broadcast <int, LiveTextMessage>(BattleUIEvent.LiveText, 3, new LiveTextMessage
             {
                 contentID = DataReader <Pet> .Get(this.TypeID).hitTips,
                 showTime  = 2000,
                 name      = this.Name
             });
         }
         break;
     }
     base.UpdateHpChangeInfluence(data);
 }
示例#10
0
        public void Treat(BattleAction_Treat data, bool isServerData)
        {
            if (data.beTreatedSoldierId != this.owner.ID)
            {
                return;
            }
            Vector3 casterPosition = Vector3.get_zero();

            if (EntityWorld.Instance.AllEntities.ContainsKey(data.treatSrcSoldierId))
            {
                bool flag;
                if (EntityWorld.Instance.AllEntities[data.treatSrcSoldierId].Actor)
                {
                    flag           = true;
                    casterPosition = EntityWorld.Instance.AllEntities[data.treatSrcSoldierId].Actor.FixTransform.get_position();
                }
                else
                {
                    flag = (data.pos != null);
                    if (flag)
                    {
                        casterPosition = XUtility.GetTerrainPoint(data.pos.x * 0.01f, data.pos.y * 0.01f, 0f);
                    }
                }
                this.owner.SetHPChange(HPChangeMessage.GetTreatMessage(data.treatHp, data.treatSrcType, this.owner, EntityWorld.Instance.AllEntities[data.treatSrcSoldierId], flag, casterPosition));
            }
            else
            {
                bool flag = data.pos != null;
                if (flag)
                {
                    casterPosition = XUtility.GetTerrainPoint(data.pos.x * 0.01f, data.pos.y * 0.01f, 0f);
                }
                this.owner.SetHPChange(HPChangeMessage.GetTreatMessage(data.treatHp, data.treatSrcType, this.owner, null, flag, casterPosition));
            }
            this.owner.Hp = data.hp;
        }
示例#11
0
 private IEnumerator BeginThrowBlood(HPChangeMessage data)
 {
     WaveBloodManager.< BeginThrowBlood > c__Iterator30 <BeginThrowBlood> c__Iterator = new WaveBloodManager.< BeginThrowBlood > c__Iterator30();
示例#12
0
 public void ThrowBlood(HPChangeMessage data)
 {
     XTaskManager.instance.StartCoroutine(this.BeginThrowBlood(data));
 }