Exemplo n.º 1
0
 public ModdedAbilityHijack(Ability.AbilityData _data, UID _owner) : base(_data, _owner)
 {
     ModdedAbilityHijack.AbilityData abilityData = (ModdedAbilityHijack.AbilityData)_data;
     this.m_HijackedAbilityIDs = abilityData.m_HijackedAbilityIDs;
     this.m_AIEntity.m_Modifiers.RegisterEventCallback(ModifierType.EnergyRegenRate, new Modifiers.OnModifierChangedDelegate(this.OnModifierChanged));
     this.m_AIEntity.m_Modifiers.RegisterEventCallback(ModifierType.EnergyRegenRateMultiplier, new Modifiers.OnModifierChangedDelegate(this.OnModifierChanged));
     this.m_AIEntity.m_Modifiers.RegisterEventCallback(ModifierType.JammerAmount, new Modifiers.OnModifierChangedDelegate(this.OnModifierChanged));
     this.m_AIEntity.RegisterEventCallback(AIEventNotification.Killed, new AIEntityEvent(this.NotifyMyDeath));
 }
    // private bool m_RequiresActivating = true;

    public ModdedAbilityHijack_old(Ability.AbilityData _data, UID _owner) : base(_data, _owner)
    {
        Debug.Log("called ctor of ModdedAbilityHijack");


        var field = typeof(Ability).GetField("m_RequiresActivating", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);
        var value = field.GetValue(this);

        Debug.Log(value);
        field.SetValue(this, true);
    }