Esempio n. 1
0
 public override void OnAdded()
 {
     this._globalShieldValue = base.instancedAbility.caster.abilityPlugin.CreateOrGetDynamicFloat(GLOBAL_SHIELD_KEY, 0f);
     this._globalShieldValue.SubAttach(new Action <float, float>(this.OnShieldChanged), ref this._totalShieldValue);
     if (this.config.ShieldEffects != null)
     {
         this._shieldEffectRange = new float[this.config.ShieldEffectRanges.Length + 1];
         this.config.ShieldEffectRanges.CopyTo(this._shieldEffectRange, 0);
         this._shieldEffectRange[this.config.ShieldEffectRanges.Length] = 1f;
     }
     this.UpdateShieldEffect();
 }
Esempio n. 2
0
 public override void OnAdded()
 {
     this._state    = State.Idle;
     this.maxShield = (base.actor.baseMaxHP * base.instancedAbility.Evaluate(this.config.ShieldHPRatio)) + base.instancedAbility.Evaluate(this.config.ShieldHP);
     this._forceResumeTimer.SetActive(false);
     this._minForceResumeTimer.SetActive(false);
     this._shieldResumeTimer.SetActive(false);
     this._globalShieldValue = base.actor.abilityPlugin.CreateOrGetDynamicFloat(GLOBAL_SHIELD_KEY, this.maxShield);
     this._globalShieldValue.Pub(this.maxShield);
     foreach (BaseAbilityActor actor in Singleton <EventManager> .Instance.GetAlliedActorsOf <BaseAbilityActor>(base.actor))
     {
         actor.abilityPlugin.ApplyModifier(base.instancedAbility, this.config.ChildShieldModifierName);
     }
     if (this.config.ControlledAbilityStates != null)
     {
         for (int i = 0; i < this.config.ControlledAbilityStates.Length; i++)
         {
             this._controlledAbilityState |= this.config.ControlledAbilityStates[i];
         }
     }
     Singleton <EventManager> .Instance.RegisterEventListener <EvtBeingHit>(base.actor.runtimeID);
 }