private void ResetWeaponBySkillID(string from, string to) { if (Miscs.ArrayContains <string>(this.ResetWeaponShownSkillIDs, from)) { this.SetWeaponVisible(1); } }
private bool OnHittingOtherResolve(EvtHittingOther evt) { bool flag = false; if (this.config.ModifyAllAnimEvents) { flag = true; } else { flag = Miscs.ArrayContains <string>(this.config.AnimEventIDs, evt.animEventID); } if (!base.actor.abilityPlugin.EvaluateAbilityPredicate(this.config.Predicates, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.toID), evt)) { return(false); } if (flag) { evt.attackData.attackerCritChance += base.instancedAbility.Evaluate(this.config.CritChanceDelta); evt.attackData.attackerCritDamageRatio += base.instancedAbility.Evaluate(this.config.CritDamageRatioDelta); evt.attackData.attackerAniDamageRatio += base.instancedAbility.Evaluate(this.config.AnimDamageRatioDelta); evt.attackData.attackerAttackPercentage += base.instancedAbility.Evaluate(this.config.DamagePercentageDelta); evt.attackData.attackerShieldDamageRatio += base.instancedAbility.Evaluate(this.config.ShieldDamageDelta); evt.attackData.attackerAttackValue += base.instancedAbility.Evaluate(this.config.AttackValueDelta); base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.Actions, base.instancedAbility, base.instancedModifier, Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.toID), evt); } return(true); }
private bool OnChargeRelease(EvtChargeRelease evt) { if (evt.isSwitchRelease && Miscs.ArrayContains <string>(this.config.AfterSkillIDs, evt.releaseSkillID)) { base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.Actions, base.instancedAbility, base.instancedModifier, null, evt); return(true); } return(false); }
public void AuthorityOnAnimatorStateChanged(AnimatorStateInfo fromState, AnimatorStateInfo toState) { if (!Miscs.ArrayContains <int>(this._muteSyncTagHashes, toState.tagHash)) { MPSendPacketContainer pc = Singleton <MPManager> .Instance.CreateSendPacket <Packet_Entity_AnimatorStateChange>(); Packet_Entity_AnimatorStateChange.StartPacket_Entity_AnimatorStateChange(pc.builder); Packet_Entity_AnimatorStateChange.AddNormalizedTimeTo(pc.builder, (fromState.shortNameHash != toState.shortNameHash) ? toState.normalizedTime : 0f); Packet_Entity_AnimatorStateChange.AddToStateHash(pc.builder, toState.shortNameHash); Packet_Entity_AnimatorStateChange.AddStateSync(pc.builder, EntityStateSync.CreateEntityStateSync(pc.builder, this._animatorEntity.XZPosition.x, this._animatorEntity.XZPosition.z, MPMiscs.ForwardToXZAngles(this._animatorEntity.FaceDirection))); pc.Finish <Packet_Entity_AnimatorStateChange>(Packet_Entity_AnimatorStateChange.EndPacket_Entity_AnimatorStateChange(pc.builder)); Singleton <MPManager> .Instance.SendStateUpdateToOthers(base.runtimeID, pc); } }
private void WithTransientSkillIDChangedCallback(string from, string to) { if (Miscs.ArrayContains <string>(this.config.TransientSkillIDs, to)) { this._lastFrom = from; } else if (Miscs.ArrayContains <string>(this.config.TransientSkillIDs, from)) { this.SkillIDChangedCallback(this._lastFrom, to); } else { this.SkillIDChangedCallback(from, to); } }
public override void OnAdded() { base.entity.onCurrentSkillIDChanged = (Action <string, string>)Delegate.Combine(base.entity.onCurrentSkillIDChanged, new Action <string, string>(this.SkillIDChangedCallback)); if (Miscs.ArrayContains <string>(this.config.SkillIDs, base.entity.CurrentSkillID)) { if (!this.config.Inverse) { this.AddModifier(); } } else if (this.config.Inverse) { this.AddModifier(); } }
private void ShowWingTrailBySkillID(string from, string to) { if (Miscs.ArrayContains <string>(this.ShowWingTrailSkillIDs, to)) { for (int i = 0; i < this.wingTrails.Length; i++) { this.wingTrails[i].Emit = true; } } else { for (int j = 0; j < this.wingTrails.Length; j++) { this.wingTrails[j].Emit = false; } } }
private bool OnHittingOther(EvtHittingOther evt) { bool flag = false; if (!evt.attackData.isAnimEventAttack) { return(false); } if (this._animEventIDs != null) { if (Miscs.ArrayContains <string>(this._animEventIDs, evt.animEventID)) { flag = true; } } else { flag = true; } if (flag) { BaseAbilityActor actor = Singleton <EventManager> .Instance.GetActor <BaseAbilityActor>(evt.toID); if ((actor == null) || !actor.IsActive()) { return(false); } Vector3 from = base.actor.entity.transform.position - actor.entity.transform.position; float num = Vector3.Angle(base.actor.entity.transform.forward, actor.entity.transform.forward); float num2 = Vector3.Angle(from, actor.entity.transform.forward); bool flag2 = (num < this._forwardAngleRangeMax) && (num > this._forwardAngleRangeMin); bool flag3 = (num2 < this._posAngleRangeMax) && (num2 > this._posAngleRangeMin); bool flag4 = from.magnitude < this._backHitRange; if ((flag2 && flag3) && flag4) { evt.attackData.addedDamageRatio += base.instancedAbility.Evaluate(this.config.BackDamageRatio); base.actor.abilityPlugin.HandleActionTargetDispatch(this.config.Actions, base.instancedAbility, base.instancedModifier, base.actor, evt); } } return(true); }
private void PreStartHandleBenchmark() { if (this.isBenchmark) { foreach (DevAvatarData data in this.avatarDevDatas) { if (!Miscs.ArrayContains <string>(data.avatarTestSkills, "Test_UnlockAllAniSkill")) { Miscs.ArrayAppend <string>(ref data.avatarTestSkills, "Test_UnlockAllAniSkill"); } if (!Miscs.ArrayContains <string>(data.avatarTestSkills, "Test_Undamagable")) { Miscs.ArrayAppend <string>(ref data.avatarTestSkills, "Test_Undamagable"); } } foreach (DevMonsterData data2 in this.monsterDevDatas) { if (!Miscs.ArrayContains <string>(data2.abilities, "Test_Undamagable")) { Miscs.ArrayAppend <string>(ref data2.abilities, "Test_Undamagable"); } } } }
private void SkillIDChangedCallback(string from, string to) { if (this._state == State.Idle) { if (Miscs.ArrayContains <string>(this.config.BeforeSkillIDs, to)) { if (this.IsTriggerCharging()) { this._monster.ResetTrigger(this.config.AfterSkillTriggerID); this._monster.SetTrigger(this.config.NextLoopTriggerID); this._state = State.Before; this._loopIx = 0; } else { this._monster.ResetTrigger(this.config.NextLoopTriggerID); this._monster.SetTrigger(this.config.AfterSkillTriggerID); } } } else if (this._state == State.Before) { if (to == this.config.ChargeLoopSkillIDs[this._loopIx]) { if (this.config.ChargeLoopEffects != null) { MixinEffect effect = this.config.ChargeLoopEffects[this._loopIx]; if (effect.EffectPattern != null) { this._chargeEffectPatternIx = base.entity.AttachEffect(effect.EffectPattern); } if (effect.AudioPattern != null) { this._chargeAudioLoopName = effect.AudioPattern; base.entity.PlayAudio(effect.AudioPattern); } } this._state = State.InLoop; this._chargeTimer.timespan = this.config.ChargeLoopDurations[this._loopIx] * this._chargeTimeRatio; this._chargeTimer.Reset(true); } else if (Miscs.ArrayContains <string>(this.config.AfterSkillIDs, to)) { this._monster.ResetTrigger(this.config.AfterSkillTriggerID); this._monster.ResetTrigger(this.config.NextLoopTriggerID); this._state = State.After; } else if (!Miscs.ArrayContains <string>(this.config.BeforeSkillIDs, to)) { this._monster.ResetTrigger(this.config.AfterSkillTriggerID); this._monster.ResetTrigger(this.config.NextLoopTriggerID); this._state = State.Idle; } } else if (this._state == State.InLoop) { if (Miscs.ArrayContains <string>(this.config.ChargeLoopSkillIDs, to)) { if (this.config.ChargeLoopEffects != null) { base.entity.DetachEffect(this._chargeEffectPatternIx); if (this._chargeAudioLoopName != null) { base.entity.StopAudio(this._chargeAudioLoopName); this._chargeAudioLoopName = null; } MixinEffect effect2 = this.config.ChargeLoopEffects[this._loopIx]; if (effect2.EffectPattern != null) { this._chargeEffectPatternIx = base.entity.AttachEffect(effect2.EffectPattern); } if (effect2.AudioPattern != null) { this._chargeAudioLoopName = effect2.AudioPattern; base.entity.PlayAudio(effect2.AudioPattern); } if (this.config.ChargeSwitchEffects != null) { base.FireMixinEffect(this.config.ChargeSwitchEffects[this._loopIx - 1], base.entity, false); } } } else if (Miscs.ArrayContains <string>(this.config.AfterSkillIDs, to)) { if (this.config.ChargeLoopEffects != null) { base.entity.DetachEffectImmediately(this._chargeEffectPatternIx); this._chargeEffectPatternIx = -1; if (this._chargeAudioLoopName != null) { base.entity.StopAudio(this._chargeAudioLoopName); this._chargeAudioLoopName = null; } } EvtChargeRelease evt = new EvtChargeRelease(base.actor.runtimeID, to) { isSwitchRelease = this._switchTimer.isActive && !this._switchTimer.isTimeUp }; Singleton <EventManager> .Instance.FireEvent(evt, MPEventDispatchMode.Normal); this._switchTimer.Reset(false); this._chargeTimer.Reset(false); this._state = State.After; } else { if (this.config.ChargeLoopEffects != null) { base.entity.DetachEffectImmediately(this._chargeEffectPatternIx); this._chargeEffectPatternIx = -1; if (this._chargeAudioLoopName != null) { base.entity.StopAudio(this._chargeAudioLoopName); this._chargeAudioLoopName = null; } } this._monster.ResetTrigger(this.config.AfterSkillTriggerID); this._monster.ResetTrigger(this.config.NextLoopTriggerID); this._state = State.Idle; } } else if (this._state == State.After) { if (Miscs.ArrayContains <string>(this.config.BeforeSkillIDs, to) && this.IsTriggerCharging()) { this._monster.ResetTrigger(this.config.AfterSkillTriggerID); this._monster.SetTrigger(this.config.NextLoopTriggerID); this._state = State.Before; this._loopIx = 0; } else { this._monster.ResetTrigger(this.config.AfterSkillTriggerID); this._monster.ResetTrigger(this.config.NextLoopTriggerID); this._state = State.Idle; } } }
private void SkillIDChangedCallback(string from, string to) { if (this._state == State.Idle) { if (Miscs.ArrayContains <string>(this.config.BeforeSkillIDs, to)) { this.SkillIDChangedToBefore(); } } else if (this._state == State.Before) { if (to == this.config.ChargeLoopSkillIDs[this._loopIx]) { if (this.config.ChargeLoopEffects != null) { MixinEffect effect = this.config.ChargeLoopEffects[this._loopIx]; if (effect.EffectPattern != null) { this._chargeEffectPatternIx = base.entity.AttachEffect(effect.EffectPattern); } if (effect.AudioPattern != null) { this._chargeAudioLoopName = effect.AudioPattern; base.entity.PlayAudio(effect.AudioPattern); } } this._state = State.InLoop; this.OnBeforeToInLoop(); if (this.config.ChargeSubTargetAmount != null) { int targetAmount = this.config.ChargeSubTargetAmount[this._loopIx]; this.SelectSubTargets(targetAmount); } } else if (Miscs.ArrayContains <string>(this.config.AfterSkillIDs, to)) { this._avatar.ResetTrigger(this.config.AfterSkillTriggerID); this._avatar.ResetTrigger(this.config.NextLoopTriggerID); this._state = State.After; } else if (Miscs.ArrayContains <string>(this.config.BeforeSkillIDs, to)) { if (Miscs.ArrayContains <string>(this.config.BeforeSkillIDs, from)) { this.SkillIDChangedToBefore(); } } else { this._avatar.ResetTrigger(this.config.AfterSkillTriggerID); this._avatar.ResetTrigger(this.config.NextLoopTriggerID); this._state = State.Idle; } } else if (this._state == State.InLoop) { if (Miscs.ArrayContains <string>(this.config.ChargeLoopSkillIDs, to)) { if (this.config.ChargeLoopEffects != null) { if (this.config.ImmediatelyDetachLoopEffect) { base.entity.DetachEffectImmediately(this._chargeEffectPatternIx); } else { base.entity.DetachEffect(this._chargeEffectPatternIx); } if (this._chargeAudioLoopName != null) { base.entity.StopAudio(this._chargeAudioLoopName); this._chargeAudioLoopName = null; } MixinEffect effect2 = this.config.ChargeLoopEffects[this._loopIx]; if (effect2.EffectPattern != null) { this._chargeEffectPatternIx = base.entity.AttachEffect(effect2.EffectPattern); } if (effect2.AudioPattern != null) { this._chargeAudioLoopName = effect2.AudioPattern; base.entity.PlayAudio(effect2.AudioPattern); } if (this.config.ChargeSwitchEffects != null) { base.FireMixinEffect(this.config.ChargeSwitchEffects[this._loopIx - 1], base.entity, false); } } this._switchTimer.Reset(true); } else if (Miscs.ArrayContains <string>(this.config.AfterSkillIDs, to)) { if (this.config.ChargeLoopEffects != null) { if (this.config.ImmediatelyDetachLoopEffect) { base.entity.DetachEffectImmediately(this._chargeEffectPatternIx); } else { base.entity.DetachEffect(this._chargeEffectPatternIx); } this._chargeEffectPatternIx = -1; if (this._chargeAudioLoopName != null) { base.entity.StopAudio(this._chargeAudioLoopName); this._chargeAudioLoopName = null; } } EvtChargeRelease evt = new EvtChargeRelease(base.actor.runtimeID, to) { isSwitchRelease = this._switchTimer.isActive && !this._switchTimer.isTimeUp }; Singleton <EventManager> .Instance.FireEvent(evt, MPEventDispatchMode.Normal); this._switchTimer.Reset(false); this._state = State.After; this.OnInLoopToAfter(); } else { if (this.config.ChargeLoopEffects != null) { if (this.config.ImmediatelyDetachLoopEffect) { base.entity.DetachEffectImmediately(this._chargeEffectPatternIx); } else { base.entity.DetachEffect(this._chargeEffectPatternIx); } this._chargeEffectPatternIx = -1; if (this._chargeAudioLoopName != null) { base.entity.StopAudio(this._chargeAudioLoopName); this._chargeAudioLoopName = null; } } this._avatar.ResetTrigger(this.config.AfterSkillTriggerID); this._avatar.ResetTrigger(this.config.NextLoopTriggerID); this._state = State.Idle; this.ClearSubTargets(); } } else if (this._state == State.After) { if (Miscs.ArrayContains <string>(this.config.BeforeSkillIDs, to)) { this.SkillIDChangedToBefore(); } else { this._avatar.ResetTrigger(this.config.AfterSkillTriggerID); this._avatar.ResetTrigger(this.config.NextLoopTriggerID); this._state = State.Idle; } this.ClearSubTargets(); } }