private bool ListenBeingHit(EvtBeingHit evt) { if (!this._saveActive) { return(false); } if (evt.attackData.rejected) { return(false); } if (this._alliedIDs.Contains(evt.targetID)) { AvatarActor other = Singleton <EventManager> .Instance.GetActor <AvatarActor>(evt.targetID); if ((other.HP == 0f) && other.IsOnStage()) { Singleton <LevelManager> .Instance.levelActor.TriggerSwapLocalAvatar(other.runtimeID, base.actor.runtimeID, true); base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.AdditionalActions, base.instancedAbility, base.instancedModifier, other, null); this._saveCountRemains--; } if (this._saveCountRemains == 0) { this.StopSaving(); } } return(true); }
private bool OnBeingHit(EvtBeingHit evt) { if (Singleton <AvatarManager> .Instance.IsLocalAvatar(evt.targetID)) { } return(false); }
public void AbilityBeingHit(EvtBeingHit evt) { if ((this.abilityState & AbilityState.WitchTimeSlowed) != AbilityState.None) { float resumeTime = 0.5f; if ((evt.animEventID != null) && (Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.sourceID) == 3)) { AvatarActor actor = Singleton <EventManager> .Instance.GetActor <AvatarActor>(evt.sourceID); if ((actor != null) && (actor.config != null)) { ConfigAvatarAnimEvent event2 = SharedAnimEventData.ResolveAnimEvent(actor.config, evt.animEventID); if ((event2 != null) && (event2.WitchTimeResume != null)) { resumeTime = event2.WitchTimeResume.ResumeTime; } } } if (evt.attackData.isAnimEventAttack && (evt.attackData.hitEffect > AttackResult.AnimatorHitEffect.Light)) { this.entity.SetTimeScale(1f, 1); this._witchTimeResumeTimer.timespan = resumeTime; this._witchTimeResumeTimer.Reset(true); } } }
protected void IgnoreHitDamage(EvtBeingHit evtHit) { if (evtHit != null) { evtHit.attackData.Reject(AttackResult.RejectType.RejectAll); } }
private bool PostBeingHit(EvtBeingHit evt) { if (!base.actor.abilityPlugin.EvaluateAbilityPredicate(this.config.Predicates, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt)) { return(false); } if (evt.attackData.rejected) { return(false); } float num = evt.attackData.damage * base.instancedAbility.Evaluate(this.config.DamagePercentage); this._attackProperty.AddedDamageValue = num; this._attackProperty.DamagePercentage = 0f; this._attackProperty.AniDamageRatio = 0f; this._attackProperty.FrameHalt = 0; this._attackProperty.HitType = AttackResult.ActorHitType.Ailment; this._attackProperty.HitEffect = AttackResult.AnimatorHitEffect.Normal; this._attackProperty.RetreatVelocity = 0f; this._attackProperty.IsAnimEventAttack = true; this._attackProperty.IsInComboCount = false; bool forceSkipAttackerResolve = !base.actor.IsActive(); AttackData attackData = DamageModelLogic.CreateAttackDataFromAttackProperty(base.actor, this._attackProperty, null, null); AttackPattern.SendHitEvent(base.actor.runtimeID, evt.sourceID, null, null, attackData, forceSkipAttackerResolve, MPEventDispatchMode.Normal); base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.Actions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); return(true); }
private void OnPostBeingHit(EvtBeingHit evt) { if ((((evt.attackData.attackerClass == EntityClass.ShortSworder) && (evt.attackData.attackerAniDamageRatio < this.config.NoDodgeAttackRatio)) && (evt.attackData.attackerNature != EntityNature.Psycho)) && ((this.config.DodgeRatio > UnityEngine.Random.value) || (evt.attackData.hitEffect == AttackResult.AnimatorHitEffect.ThrowUp))) { base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.DodgeActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); Singleton <EventManager> .Instance.FireEvent(new EvtBeingHit(evt.sourceID, base.actor.runtimeID, null, this.CreateNoDamageAttack()), MPEventDispatchMode.Normal); } }
protected virtual void ModifyDamage(EvtBeingHit evt, float multiple = 1) { evt.attackData.damage = (evt.attackData.damage * (1f + (base.instancedAbility.Evaluate(this.config.DamageTakenRatio) * multiple))) + (base.instancedAbility.Evaluate(this.config.DamageTakenDelta) * multiple); if (evt.attackData.damage < 0f) { evt.attackData.damage = 0f; } }
protected override void OnPostBeingHit(EvtBeingHit evtHit) { base.OnPostBeingHit(evtHit); if ((this.config.DodgeMeleeAttack && this.config.CanHitTrigger) && ((evtHit.attackData.hitType == AttackResult.ActorHitType.Melee) && base.CheckAllowTeleport())) { base.IgnoreHitDamage(evtHit); this.TeleportBack(evtHit.sourceID); } }
protected virtual bool OnBeingHit(EvtBeingHit evt) { if (!base.actor.abilityPlugin.EvaluateAbilityPredicate(this.config.Predicates, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt)) { return(false); } base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.Actions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); evt.attackData.attackeeAddedDamageTakeRatio += base.instancedAbility.Evaluate(this.config.AddedDamageTakeRatio); return(true); }
private bool OnBeingHit(EvtBeingHit evt) { if (this._dynamicObject.IsActive()) { Singleton <EventManager> .Instance.FireEvent(new EvtEvadeSuccess(base.ownerID, evt.sourceID, evt.animEventID, evt.attackData), MPEventDispatchMode.CheckRemoteMode); this.Kill(); } return(true); }
private bool OnBeingHit(EvtBeingHit evt) { if (!this._allowBlock) { return(false); } if (this.config.BlockSkillIDs != null) { string currentSkillID = base.actor.entity.CurrentSkillID; if (string.IsNullOrEmpty(currentSkillID)) { return(false); } bool flag = false; for (int i = 0; i < this.config.BlockSkillIDs.Length; i++) { if (currentSkillID == this.config.BlockSkillIDs[i]) { flag = true; } } if (!flag) { return(false); } } if (!base.actor.abilityPlugin.EvaluateAbilityPredicate(this.config.AttackerPredicates, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt)) { return(false); } if (!base.actor.abilityPlugin.EvaluateAbilityPredicate(this.config.TargetPredicates, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.targetID), evt)) { return(false); } if (UnityEngine.Random.value >= this._blockChance) { return(false); } evt.attackData.damage -= base.instancedAbility.Evaluate(this.config.DamageReduce); evt.attackData.damage *= 1f - base.instancedAbility.Evaluate(this.config.DamageReduceRatio); evt.attackData.damage = (evt.attackData.damage >= 0f) ? evt.attackData.damage : 0f; evt.attackData.hitEffect = AttackResult.AnimatorHitEffect.Light; if (evt.attackData.damage == 0f) { evt.attackData.hitLevel = AttackResult.ActorHitLevel.Mute; } base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.BlockActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); if (this.IsBlockHasCD()) { this._blockTimer.Reset(true); this._allowBlock = false; } return(true); }
private bool OnBeingHit(EvtBeingHit evt) { BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID); if ((actor != null) && (Vector3.Distance(actor.entity.transform.position, base.actor.entity.transform.position) > this._protectRange)) { evt.attackData.damage *= 1f - this._damageReduceRatio; base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.OnRangeAttackProtectShieldSuccessActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.targetID), evt); } return(true); }
protected bool CheckAngle(EvtBeingHit evt) { BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID); bool flag = Vector3.Angle(base.actor.entity.transform.forward, actor.entity.transform.position - base.actor.entity.transform.position) < this.config.DefendAngle; if (this.config.ReverseAngle) { flag = !flag; } return(flag); }
protected virtual void OnPostBeingHit(EvtBeingHit evtHit) { if ((this.config.CanHitTrigger && (evtHit.attackData.hitType == AttackResult.ActorHitType.Ranged)) && this.CheckAllowTeleport()) { this.IgnoreHitDamage(evtHit); this.Teleport(); this.ClearTargetAttackTarget(evtHit.sourceID); } if (this._timer > 0f) { this.IgnoreHitDamage(evtHit); } }
private bool ListenBeingHit(EvtBeingHit evt) { if (!evt.attackData.rejected) { BaseActor actor = Singleton <EventManager> .Instance.GetActor(evt.sourceID); if (((actor == null) || !(actor is AvatarActor)) || !this._inStastics) { return(false); } int num = this._damageLs.SeekAddPosition <Tuple <float, float> >(); this._damageLs[num] = Tuple.Create <float, float>(this._stasticsTimer, evt.attackData.GetTotalDamage()); } return(false); }
public static void SendHitEvent(uint attackerID, uint beHitID, string attackName, AttackResult.HitCollsion hitCollision, AttackData attackData, bool forceSkipAttackerResolve = false, MPEventDispatchMode mode = 0) { if (forceSkipAttackerResolve || Singleton <LevelManager> .Instance.gameMode.ShouldAttackPatternSendBeingHit(beHitID)) { EvtBeingHit evt = new EvtBeingHit { targetID = beHitID, sourceID = attackerID, animEventID = attackName }; if (attackData != null) { if (attackData.hitCollision == null) { attackData.hitCollision = hitCollision; } evt.attackData = attackData; } else { evt.attackData = DamageModelLogic.CreateAttackDataFromAttackerAnimEvent(Singleton <EventManager> .Instance.GetActor(attackerID), attackName); evt.attackData.resolveStep = AttackData.AttackDataStep.AttackerResolved; evt.attackData.hitCollision = hitCollision; } Singleton <EventManager> .Instance.FireEvent(evt, mode); } else { EvtHittingOther other = new EvtHittingOther { hitCollision = hitCollision, targetID = attackerID, toID = beHitID, animEventID = attackName }; if (attackData != null) { if (attackData.hitCollision == null) { attackData.hitCollision = hitCollision; } other.attackData = attackData; } else { other.hitCollision = hitCollision; } Singleton <EventManager> .Instance.FireEvent(other, mode); } }
private bool OnBeingHit(EvtBeingHit evt) { if (this._defendFailTimer.isActive && !this._defendFailTimer.isTimeUp) { if (this.config.DefendReplaceAttackEffect != null) { evt.attackData.attackEffectPattern = this.config.DefendReplaceAttackEffect; } base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.DefendSuccessActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); if (this._isDefendingPerfect) { base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.DefendSuccessPerfectActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); } } return(true); }
protected override bool OnPostBeingHit(EvtBeingHit evt) { base.OnPostBeingHit(evt); if (this.GetReplaceDamage(evt.attackData.damage) != evt.attackData.damage) { evt.attackData.damage = this.GetReplaceDamage(evt.attackData.damage); if (this.config.UseReplaceAniDamageRatio) { evt.attackData.attackerAniDamageRatio = this.config.ReplaceAniDamageRatio; } } evt.attackData.fireDamage = this.GetReplaceDamage(evt.attackData.fireDamage); evt.attackData.thunderDamage = this.GetReplaceDamage(evt.attackData.thunderDamage); evt.attackData.alienDamage = this.GetReplaceDamage(evt.attackData.alienDamage); evt.attackData.plainDamage = this.GetReplaceDamage(evt.attackData.plainDamage); return(true); }
private bool ListenBeingHit(EvtBeingHit evt) { if (!evt.attackData.rejected) { BaseActor actor = Singleton <EventManager> .Instance.GetActor(evt.targetID); if (((actor != null) && (actor is AvatarActor)) && (Singleton <AvatarManager> .Instance.IsLocalAvatar(actor.runtimeID) && evt.attackData.IsFinalResolved())) { this._tempDamageTaken += evt.attackData.GetTotalDamage(); if (this._tempDamageTaken > this.targetDamageTaken) { this.Fail(); } } } return(false); }
private bool OnBeingHit(EvtBeingHit evt) { if (Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.sourceID) != 3) { return(false); } if (this._threatTable.ContainsKey(evt.sourceID)) { this._threatTable[evt.sourceID] = Mathf.Clamp(this._threatTable[evt.sourceID] + 1, 0, 100); } else { this._threatTable[evt.sourceID] = 1; } this.ThreatTableChanged(); return(true); }
private bool OnBeingHit(EvtBeingHit evt) { if (!this._isInDefend) { return(false); } if (this.config.DefendReplaceAttackEffect != null) { evt.attackData.attackEffectPattern = this.config.DefendReplaceAttackEffect; } base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.DefendSuccessActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); if (this._perfectDefendState == PerfectDefendState.PerfectDefend) { base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.DefendSuccessPerfectActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); } return(true); }
public static EvtBeingHit Deserialize(Packet_Event_EvtBeingHit table, EvtBeingHit obj) { if (obj == null) { obj = new EvtBeingHit(); } obj.targetID = table.TargetID; obj.sourceID = table.SourceID; obj.animEventID = table.AnimEventID; if (table.GetAttackData(GetCachedTable <MPAttackData>()) != null) { obj.attackData = Deserialize(GetCachedTable <MPAttackData>(), new AttackData()); } obj.beHitEffect = (BeHitEffect)table.BeHitEffect; obj.resolvedDamage = table.ResolvedDamage; return(obj); }
public bool ListenBeingHit(EvtBeingHit evt) { switch (Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.targetID)) { case 4: case 3: case 7: if (evt.attackData.hitLevel == AttackResult.ActorHitLevel.Mute) { return(true); } Singleton <NotifyManager> .Instance.FireNotify(new Notify(NotifyTypes.ShowDamegeText, evt)); break; } return(true); }
private bool ListenBeingHit(EvtBeingHit evt) { if (evt.attackData.isAnimEventAttack) { BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.targetID); if ((actor == null) || !(actor is AvatarActor)) { return(false); } if (actor.abilityState.ContainsState(AbilityState.Invincible) || actor.abilityState.ContainsState(AbilityState.Undamagable)) { return(false); } this._betweenAttackResumeTimer.Reset(true); } return(false); }
private bool ListenMonsterBeingHit(EvtBeingHit evt) { bool flag = Singleton <AvatarManager> .Instance.IsLocalAvatar(evt.sourceID); MonsterActor actor = Singleton <EventManager> .Instance.GetActor <MonsterActor>(evt.targetID); if (flag && (actor != null)) { BaseMonoAvatar avatarByRuntimeID = Singleton <AvatarManager> .Instance.GetAvatarByRuntimeID(evt.sourceID); if ((((avatarByRuntimeID != null) && (avatarByRuntimeID.GetAttackTarget() != null)) && (actor.isElite && (base.step == 0))) && ((base.GetCurrentStepState() == BaseLevelTutorial.StepState.Sleep) && !this.IsAllStepDone())) { this.ActiveCurrentStep(); this.WaitShowTutorialStep(this.GetDelayTime(base.step), new Action(this.ShowTutorialStep1)); } } return(false); }
private bool ListenBeingHit(EvtBeingHit evt) { if (evt.attackData.rejected) { return(false); } BaseActor actor = Singleton <EventManager> .Instance.GetActor(evt.sourceID); if (((actor == null) || !(actor is AvatarActor)) || (!this._inStastics || !Singleton <LevelManager> .Instance.levelActor.IsLevelBuffActive(LevelBuffType.WitchTime))) { return(false); } this._tempAllDamage += evt.attackData.damage; if (this._tempAllDamage >= this.targetDamage) { this.Finish(); } return(true); }
protected override bool OnBeingHit(EvtBeingHit evt) { float totalDamage; BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID); if ((actor == null) || (actor.entity == null)) { return(false); } if (this.config.DefendElemental) { totalDamage = evt.attackData.GetTotalDamage(); } else { totalDamage = evt.attackData.damage; } float num2 = totalDamage * Mathf.Pow(evt.attackData.attackerAniDamageRatio, this.config.ShieldAniDamageRatioPow); if (base.CheckSkillID(evt)) { if (base.CheckAngle(evt)) { this.shield -= num2; if (this.shield <= 0f) { base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.ShieldBrokenActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); this.shield = this.maxShield; } else { base.DefendSuccess(evt); } (base.actor.entity as BaseMonoAnimatorEntity).SetLocomotionFloat(this.config.ShieldRatioAnimatorParam, this.shield / this.maxShield, false); } else { base.DefendFailure(evt); } } return(true); }
private bool ListenBeingHit(EvtBeingHit evt) { if (!evt.attackData.rejected) { BaseActor actor = Singleton <EventManager> .Instance.GetActor(evt.targetID); if (((actor != null) && (actor is AvatarActor)) && Singleton <AvatarManager> .Instance.IsLocalAvatar(actor.runtimeID)) { if (evt.attackData.hitEffect == AttackResult.AnimatorHitEffect.KnockDown) { this._beHitDownNum++; } if (this._beHitDownNum > this.targetDownNum) { this.Fail(); } } } return(false); }
protected bool CheckSkillID(EvtBeingHit evt) { if (evt.attackData.isAnimEventAttack) { if (evt.attackData.rejected) { return(false); } if (base.actor.abilityState.ContainsState(AbilityState.Invincible) || base.actor.abilityState.ContainsState(AbilityState.Undamagable)) { return(false); } if (!base.actor.abilityPlugin.EvaluateAbilityPredicate(this.config.DefendPredicates, base.instancedAbility, base.instancedModifier, base.actor, evt)) { return(false); } if (this.config.AlwaysDefend) { return(true); } string currentSkillID = base.actor.entity.CurrentSkillID; if (!string.IsNullOrEmpty(currentSkillID)) { bool flag = false; for (int i = 0; i < this.config.DefendSkillIDs.Length; i++) { if (this.config.DefendSkillIDs[i] == currentSkillID) { flag = true; break; } } float num2 = base.entity.GetCurrentNormalizedTime() % 1f; if ((flag && (num2 > this.config.DefendNormalizedTimeStart)) && (num2 < this.config.DefendNormalizedTimeStop)) { return(true); } } } return(false); }
protected void DefendSuccess(EvtBeingHit evt) { if (this.config.DefendDamageReduce >= 1f) { if (!this.config.DefendElemental && (evt.attackData.GetElementalDamage() > 0f)) { evt.attackData.damage = 0f; evt.attackData.hitEffect = AttackResult.AnimatorHitEffect.Mute; } else { evt.attackData.Reject(AttackResult.RejectType.RejectButShowAttackEffect); } } else { evt.attackData.hitEffect = this.config.DefendSuccessHitEffect; evt.attackData.damage *= 1f - this.config.DefendDamageReduce; } base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.DefendSuccessActions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.sourceID), evt); }