public virtual void OnAnimationEnd(AnimationEndCmd cmd) { if (this.CurOutPutAction != string.Empty && this.CurOutPutAction != cmd.actName) { return; } if (ActionStatusName.IsDieAction(this.CurActionStatus)) { this.DeadAnimationEnd(); } else if (DataReader <Action> .Contains(this.CurActionStatus)) { if (DataReader <Action> .Get(this.CurActionStatus).loop == 0) { this.EndAnimationResetToIdle(); } } else { if (!string.IsNullOrEmpty(this.CurActionStatus)) { Debug.LogError("Action表不存在 " + this.CurActionStatus); } this.EndAnimationResetToIdle(); } }
public bool PackTryToCastSkillBySkillIDAndLockOnTarget(int skillID, int random, ComparisonOperator comparisonOperator1, float range1, ComparisonOperator comparisonOperator2, float range2, LogicalOperator logicalOperator) { if (ActionStatusName.IsSkillAction(this.ownerActor.CurActionStatus) && !this.ownerActor.IsUnderTermination) { return(false); } List <int> skillAllValue = this.owner.GetSkillAllValue(); return(skillAllValue.get_Count() != 0 && skillAllValue.Contains(skillID) && !this.CheckSkillInCDByID(skillID) && this.SetTargetFromLockOnTargetBySkillID(skillID, TargetRangeType.SkillRange, false) && ((comparisonOperator1 == ComparisonOperator.None && comparisonOperator2 == ComparisonOperator.None) || this.CheckTargetDistance(comparisonOperator1, range1, comparisonOperator2, range2, logicalOperator)) && this.CheckRandom(random) && this.owner.GetSkillManager().ClientCastSkillByID(skillID)); }
public override bool MoveToSkillTarget(float skillReach) { if (this.GetEntity().AITarget == null) { return(false); } if (!this.GetEntity().AITarget.Actor) { return(false); } float num = XUtility.DistanceNoY(base.FixTransform.get_position(), this.GetEntity().AITarget.Actor.FixTransform.get_position()) - (skillReach + XUtility.GetHitRadius(this.GetEntity().AITarget.Actor.FixTransform)); if (num <= -0.05f) { base.StopMoveToPoint(); return(false); } if (this.CurActionStatus != "run" && !this.CanChangeActionTo("run", true, 0, false) && ActionStatusName.IsSkillAction(this.CurActionStatus) && !this.GetEntity().IsMoveCast&& !base.IsUnderTermination) { return(false); } Vector3 vector = new Vector3(this.GetEntity().AITarget.Actor.FixTransform.get_position().x - base.FixTransform.get_position().x, 0f, this.GetEntity().AITarget.Actor.FixTransform.get_position().z - base.FixTransform.get_position().z); Vector3 normalized = vector.get_normalized(); Vector3 aIMoveFixPoint = base.GetAIMoveFixPoint(base.FixTransform.get_position(), this.GetEntity().AITarget.Actor.FixTransform.get_position(), normalized, num, XUtility.GetHitRadius(base.FixTransform)); this.MoveToPoint(aIMoveFixPoint, 0f, null); this.GetEntity().AIToPoint = new XPoint { position = aIMoveFixPoint }; return(true); }
public override bool CanChangeActionTo(string newAction, bool isCheckHitMoving = true, int candidateSkillID = 0, bool isLogOpen = false) { if (string.IsNullOrEmpty(newAction) || string.IsNullOrEmpty(this.CurActionStatus)) { return(true); } if ((this.GetEntity() as EntityMonster).IsComponont && !string.IsNullOrEmpty(newAction)) { newAction += this.ActionStatusPostfix; } return(!this.GetEntity().IsStatic&& (!this.GetEntity().IsFixed || !XUtility.StartsWith(newAction, "run")) && (!isCheckHitMoving || !this.GetEntity().IsHitMoving || ActionStatusName.IsDieAction(newAction)) && (!isCheckHitMoving || !base.IsStraight || ActionStatusName.IsDieAction(newAction) || ActionStatusName.IsHitAction(newAction)) && (!this.GetEntity().IsEndure || !ActionStatusName.IsHitAction(newAction)) && (!this.GetEntity().IsWeak || (!ActionStatusName.IsActionCauseNormalMove(newAction) && !ActionStatusName.IsSpinAction(newAction))) && base.HasActionOrFixAction(newAction) && ((base.IsUnderCombo && base.ActionSkillComboID != 0 && base.ActionSkillComboID == candidateSkillID) || newAction == this.CurActionStatus || base.ActionPriorityTable[newAction] > base.ActionPriorityTable[this.CurActionStatus] || base.IsUnderTermination || ActionStatusName.IsIdleAction(newAction))); }
public virtual bool CheckSelf() { if (this.MoveSkipThinkCount > 0) { this.MoveSkipThinkCount--; return(false); } if (this.MoveSkipTime > 0f) { this.MoveSkipTime -= (float)this.ThinkInterval * 0.001f; return(false); } return(!this.owner.IsStatic && !this.owner.IsDizzy && !this.owner.IsDead && !this.owner.IsAssault && (!this.ownerActor || !ActionStatusName.IsSkillAction(this.ownerActor.CurActionStatus) || this.owner.IsMoveCast || this.ownerActor.IsUnderTermination)); }
public bool CastSkillBySkillID(int skillID) { return((!ActionStatusName.IsSkillAction(this.ownerActor.CurActionStatus) || this.ownerActor.IsUnderTermination) && this.owner.GetSkillManager().ClientCastSkillByID(skillID)); }
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)); } }
public override bool ClientCastSkillByID(int skillID) { if (!GlobalBattleNetwork.Instance.IsServerEnable) { if (this.IsOpenLog) { Debug.LogError("return 4"); } return(false); } Skill skill = DataReader <Skill> .Get(skillID); if (skill.rush > 0) { this.owner.GetSkillManager().SetTargetBySkillID(skillID, TargetRangeType.SkillRange, (float)skill.rush); } else { this.owner.GetSkillManager().SetTargetBySkillID(skillID, TargetRangeType.SkillRange, 0f); } if (skill.rush > 0 && this.owner.AITarget != null && this.owner.AITarget.Actor) { float num = XUtility.DistanceNoY(this.ownerActor.FixTransform.get_position(), this.owner.AITarget.Actor.FixTransform.get_position()) - (float)skill.reach.get_Item(0) * 0.01f - XUtility.GetHitRadius(this.owner.AITarget.Actor.FixTransform); if (!this.owner.IsStatic && !this.owner.IsDizzy && !this.owner.IsWeak && !this.owner.IsFixed && !this.owner.IsAssault && !this.owner.IsHitMoving && num <= (float)skill.rush * 0.01f && num > 0f && (!ActionStatusName.IsSkillAction(this.ownerActor.CurActionStatus) || this.ownerActor.IsUnderTermination) && this.ownerActor.CanChangeActionTo("rush", true, 0, false) && this.CheckClientHandleSkillByID(skillID)) { this.ClientBeginAssault(skillID, this.owner.AITarget); return(false); } } return(base.ClientCastSkillByID(skillID)); }