Пример #1
0
 public void ApplyModifier_RemoteHandler(ConfigAbilityAction actionConfig, ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, AbilityInvokeEntry invokeEntry)
 {
     MoleMole.Config.ApplyModifier modifier = (MoleMole.Config.ApplyModifier)actionConfig;
     if ((target != base._owner) && Singleton <MPEventManager> .Instance.IsIdentityAuthority(target.runtimeID))
     {
         target.abilityPlugin.ApplyModifier(instancedAbility, modifier.ModifierName);
     }
 }
Пример #2
0
 public void ApplyModifier_AuthorityHandler(ConfigAbilityAction actionConfig, ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref RecordInvokeEntryContext context)
 {
     MoleMole.Config.ApplyModifier modifier = (MoleMole.Config.ApplyModifier)actionConfig;
     if (target == base._owner)
     {
         base._owner.abilityPlugin.ApplyModifier(instancedAbility, modifier.ModifierName);
     }
     else if (Singleton <MPEventManager> .Instance.IsIdentityAuthority(target.runtimeID))
     {
         target.abilityPlugin.ApplyModifier(instancedAbility, modifier.ModifierName);
     }
     else
     {
         context.Finish(true);
     }
 }
Пример #3
0
 public void OnLoaded()
 {
     if (this.AbilitySpecials != ConfigDynamicArguments.EMPTY)
     {
         List <string> list = new List <string>(this.AbilitySpecials.Keys);
         foreach (string str in list)
         {
             if (this.AbilitySpecials[str] is int)
             {
                 this.AbilitySpecials[str] = (int)this.AbilitySpecials[str];
             }
         }
     }
     foreach (KeyValuePair <string, ConfigAbilityModifier> pair in this.Modifiers)
     {
         pair.Value.ModifierName = pair.Key;
         ConfigAbilityModifier modifier = pair.Value;
         if ((AbilityState.Undamagable | AbilityState.MaxMoveSpeed | AbilityState.Immune | AbilityState.CritUp | AbilityState.Shielded | AbilityState.PowerUp | AbilityState.AttackSpeedUp | AbilityState.MoveSpeedUp | AbilityState.Endure).ContainsState(modifier.State))
         {
             modifier.IsBuff = true;
         }
         else if ((AbilityState.Tied | AbilityState.TargetLocked | AbilityState.Fragile | AbilityState.Weak | AbilityState.AttackSpeedDown | AbilityState.MoveSpeedDown | AbilityState.Frozen | AbilityState.Poisoned | AbilityState.Burn | AbilityState.Paralyze | AbilityState.Stun | AbilityState.Bleed).ContainsState(modifier.State))
         {
             modifier.IsDebuff = true;
         }
         if (modifier.IsBuff)
         {
             if (modifier.Stacking == ConfigAbilityModifier.ModifierStacking.Unique)
             {
                 modifier.Stacking = ConfigAbilityModifier.ModifierStacking.Refresh;
             }
         }
         else if (modifier.IsDebuff)
         {
         }
         if ((modifier.State != AbilityState.None) && (modifier.StateOption != null))
         {
             modifier.StateOption.ChangeModifierConfig(modifier);
         }
     }
     if (this.DefaultModifier != null)
     {
         if (this.Modifiers == EMPTY_MODIFIERS)
         {
             this.Modifiers = new Dictionary <string, ConfigAbilityModifier>();
         }
         this.DefaultModifier.ModifierName = "__DEFAULT_MODIFIER";
         this.Modifiers.Add("__DEFAULT_MODIFIER", this.DefaultModifier);
         List <ConfigAbilityAction> list2 = new List <ConfigAbilityAction>(this.OnAdded);
         ApplyModifier item = new ApplyModifier {
             ModifierName = "__DEFAULT_MODIFIER",
             Target       = AbilityTargetting.Caster
         };
         list2.Insert(0, item);
         this.OnAdded         = list2.ToArray();
         this.DefaultModifier = null;
     }
     this.InvokeSites = new List <BaseActionContainer>();
     this.AddSubActions(this.OnAdded);
     this.AddSubActions(this.OnRemoved);
     this.AddSubActions(this.OnAbilityStart);
     this.AddSubActions(this.OnKilled);
     this.AddSubActions(this.OnDestroy);
     this.AddSubActions(this.OnFieldEnter);
     this.AddSubActions(this.OnFieldExit);
     this.AddMixins(this.AbilityMixins);
     string[] array = new string[this.Modifiers.Count];
     this.Modifiers.Keys.CopyTo(array, 0);
     Array.Sort <string>(array);
     this.ModifierIDMap = new ConfigAbilityModifier[array.Length];
     for (int i = 0; i < array.Length; i++)
     {
         ConfigAbilityModifier modifier2 = this.Modifiers[array[i]];
         modifier2.localID     = i;
         this.ModifierIDMap[i] = modifier2;
         this.AddSubActions(modifier2.OnAdded);
         this.AddSubActions(modifier2.OnRemoved);
         this.AddSubActions(modifier2.OnBeingHit);
         this.AddSubActions(modifier2.OnBeingHitResolved);
         this.AddSubActions(modifier2.OnAttackLanded);
         this.AddSubActions(modifier2.OnThinkInterval);
         this.AddSubActions(modifier2.OnEvadeStart);
         this.AddSubActions(modifier2.OnEvadeSuccess);
         this.AddSubActions(modifier2.OnMonsterCreated);
         this.AddSubActions(modifier2.OnAvatarCreated);
         this.AddSubActions(modifier2.OnKilled);
         this.AddMixins(modifier2.ModifierMixins);
     }
 }