示例#1
0
    // Token: 0x06001A10 RID: 6672 RVA: 0x000D4E70 File Offset: 0x000D3070
    protected override int FindValidTargetPrepped(RaycastHit[] hits)
    {
        float num = (float)this.m_AIEntity.GetHijackerLevel();

        this.m_CursorTex = Manager.GetInputControl().m_CursorTextureInteract;
        for (int i = 0; i < hits.Length; i++)
        {
            AIEntity component = base.GetTransform(hits[i]).GetComponent <AIEntity>();
            if (ModdedAbilityHijack.PossibleHijackTarget(component, this.m_Owner))
            {
                if (component.HijackLevelRequired > 0 && !component.IsReturningToBase() && !this.TargetIsResearcher(component))
                {
                    if ((float)component.HijackLevelRequired <= num && !this.m_AIEntity.IsJammed && !component.IsScrambled())
                    {
                        return(i);
                    }
                    this.m_CursorTex = Manager.GetInputControl().m_CursorTextureInteractFailLevel;
                }
                else
                {
                    this.m_CursorTex = Manager.GetInputControl().m_CursorTextureInteractFailLevel;
                }
            }
        }
        return(-1);
    }
示例#2
0
 protected override void ActivatingStart()
 {
     Debug.Log("ModdedAbilityHijack: ActivatingStart");
     base.ActivatingStart();
     //UID component = this.m_Target.GetComponent<UID>();
     //if (component == null)
     //{
     //    Debug.LogWarning("TODO: set this up to work for a position as well as a target");
     //}
     if (this.m_Target != null)
     {
         AIEntity component2 = this.m_Target.GetComponent <AIEntity>();
         this.m_AIEntity.HijackTarget(this.m_Target, base.GetRange(), ModdedAbilityHijack.GetHijackTime(component2.HijackLevelRequired, this.m_AIEntity.GetHijackerLevel()), new AbilityHijack.TargetHijackedDelegate(this.TargetHijacked), true, AudioManager.Get().m_HijackTimer);
         this.UpdateEnergyRegen();
     }
 }
    protected new void ActivatingStart()
    {
        Debug.Log("ModdedAbilityHijack: ActivatingStart");
        // TODO this crashes because of call cycle
        var method = typeof(Ability).GetMethod("ActivatingStart", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);

        method.Invoke(this, null);
        base.ActivatingStart();

        //UID component = this.m_Target.GetComponent<UID>();
        //if (component == null)
        //{
        //    Debug.LogWarning("TODO: set this up to work for a position as well as a target");
        //}
        //  else
        if (this.m_Target != null)
        {
            AIEntity component2 = this.m_Target.GetComponent <AIEntity>();
            this.m_AIEntity.HijackTarget(this.m_Target, base.GetRange(), ModdedAbilityHijack.GetHijackTime(component2.HijackLevelRequired, this.m_AIEntity.GetHijackerLevel()), new ModdedAbilityHijack_old.TargetHijackedDelegate(this.TargetHijacked), true, AudioManager.Get().m_HijackTimer);
            this.UpdateEnergyRegen();
        }
    }
示例#4
0
    // Token: 0x06001A15 RID: 6677 RVA: 0x000D4FF8 File Offset: 0x000D31F8
    public override string GetTargetToolTip(GameObject target)
    {
        float    num       = (float)this.m_AIEntity.GetHijackerLevel();
        AIEntity component = target.GetComponent <AIEntity>();

        if (this.m_State == Ability.AbilityState.prepped && ModdedAbilityHijack.PossibleHijackTarget(component, this.m_Owner))
        {
            int hijackLevelRequired = component.HijackLevelRequired;
            if ((hijackLevelRequired <= 0 || component.IsReturningToBase()) && this.TargetIsResearcher(component))
            {
                return(TextManager.GetLoc("HIJACK_TOOLTIP_03", true, false));
            }
            if ((float)hijackLevelRequired > num)
            {
                return(string.Format(TextManager.GetLoc("HIJACK_TOOLTIP_02", true, false), hijackLevelRequired));
            }
            if (this.m_AIEntity.IsJammed)
            {
                return(TextManager.GetLoc("HIJACK_TOOLTIP_04", true, false));
            }
        }
        return(string.Empty);
    }
示例#5
0
 // Token: 0x06001A21 RID: 6689 RVA: 0x000D5458 File Offset: 0x000D3658
 public SaveAbilityHijack(ModdedAbilityHijack a) : base(a)
 {
 }
示例#6
0
 // Token: 0x06001A13 RID: 6675 RVA: 0x000D4F78 File Offset: 0x000D3178
 public static bool ValidHijackTarget(AIEntity _aie, AIEntity _hijacker)
 {
     return(ModdedAbilityHijack.PossibleHijackTarget(_aie, _hijacker.m_UID));
 }
示例#7
0
 // Token: 0x06001A12 RID: 6674 RVA: 0x000D4F5C File Offset: 0x000D315C
 public static bool ValidHijackTarget(UID _uid, AIEntity _hijacker)
 {
     return(_uid && ModdedAbilityHijack.ValidHijackTarget(_uid.GetComponent <AIEntity>(), _hijacker));
 }