Esempio n. 1
0
 private void method_1(Map map_0, Ship ship_0, bool bool_0)
 {
     if (ship_0 != null && bool_0)
     {
         if (ship_0 != this.Context.Game.Hero)
         {
             if (ship_0.Id == this.Context.Game.Hero.Pet.Id && this.Context.Game.Hero.Pet.Hp == 0)
             {
                 int num = base.PetDeaths;
                 base.PetDeaths = num + 1;
                 return;
             }
             NpcShip npcShip = ship_0 as NpcShip;
             if (npcShip != null && (this.Context.Map.IsGG || !npcShip.LastTookDamageHero.Cooldown(5000)))
             {
                 Dictionary <string, int> obj = this.dictionary_0;
                 lock (obj)
                 {
                     string text = NpcUtils.NpcType.smethod_0(ship_0.Name);
                     if (!this.dictionary_0.ContainsKey(text))
                     {
                         this.dictionary_0.Add(text, 0);
                     }
                     Dictionary <string, int> dictionary = this.dictionary_0;
                     string key = text;
                     int    num = dictionary[key];
                     dictionary[key] = num + 1;
                 }
             }
         }
         return;
     }
 }
Esempio n. 2
0
 public override bool vmethod_1(Ship ship_0, out Ship ship_1)
 {
     ship_1 = null;
     if (ship_0 == null)
     {
         return(false);
     }
     if (base.vmethod_0(ship_0, out ship_1, false))
     {
         return(true);
     }
     if (ship_0 != null)
     {
         NpcShip npcShip = base.Context.method_71(200);
         CooldownTracker <BotAction> cooldowns = base.Context.Cooldowns;
         if (npcShip != null && cooldowns.method_0(BotAction.SelectShip) && cooldowns.method_0(BotAction.TargetQuickSwitch) && npcShip != ship_0 && this.vmethod_53(ship_0, npcShip))
         {
             cooldowns.method_1(BotAction.TargetQuickSwitch, 625.0);
             ship_1 = npcShip;
             return(true);
         }
     }
     if (base.C.AttackingId == ship_0.Id && this.vmethod_51(ship_0 as NpcShip) && ship_0.HpPercentage < 24.75f && base.C.float_0 >= 24.75f && base.C.method_73().Any(new Func <NpcShip, bool>(this.method_38)))
     {
         base.C.NpcLockout.method_1(ship_0.Id, 1428.0);
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
 public virtual bool vmethod_51(NpcShip npcShip_0)
 {
     if (base.Map.GG != (GEnum5)300)
     {
         SelectedNpcModel selectedNpcModel = this.vmethod_5(npcShip_0);
         return(selectedNpcModel == null || !selectedNpcModel.GG_ChaseFleeing);
     }
     return(false);
 }
Esempio n. 4
0
        public static int smethod_0(Ship ship_0)
        {
            NpcShip npcShip = ship_0 as NpcShip;

            if (npcShip != null && npcShip.Type != null && npcShip.Type.Class != null)
            {
                return(SecurityManager.smethod_1(npcShip.Type));
            }
            return(540);
        }
Esempio n. 5
0
    public override bool vmethod_10(NpcShip npcShip_0)
    {
        GClass187 gclass;

        if (npcShip_0.HasModifier(EntityModifierType.INVINCIBILITY, out gclass))
        {
            return(false);
        }
        SelectedNpcModel selectedNpcModel = this.vmethod_5(npcShip_0);

        return(selectedNpcModel == null || selectedNpcModel.Enabled);
    }
Esempio n. 6
0
    public override void Update()
    {
        base.Update();
        this.method_25(base.Map.method_7 <NpcShip>(base.Hero.Position, new Func <NpcShip, bool>(GClass856.< > c.< > c_0.method_1), null, 0).FirstOrDefault <ValueTuple <NpcShip, float, int> >().Item1);
        if (this.method_24() != null)
        {
            this.method_29(DateTimeOffset.Now);
        }
        NpcShip npcShip = this.method_24();

        this.method_27((npcShip != null) ? npcShip.Position : base.Map.Center);
    }
Esempio n. 7
0
    public override bool vmethod_6(NpcShip npcShip_1)
    {
        SelectedNpcModel selectedNpcModel = this.vmethod_5(npcShip_1);

        if (selectedNpcModel == null || selectedNpcModel.IgnoreOwnership)
        {
            return(true);
        }
        if (base.method_0() == GroupAttackMode.Assist)
        {
            int?num  = (npcShip_1 != null) ? new int?(npcShip_1.Id) : null;
            int num2 = base.method_12();
            return(num.GetValueOrDefault() == num2 & num != null);
        }
        return(false);
    }
Esempio n. 8
0
    public override bool vmethod_10(NpcShip npcShip_1)
    {
        GClass187 gclass;

        if (npcShip_1.HasModifier(EntityModifierType.INVINCIBILITY, out gclass))
        {
            return(false);
        }
        NpcUtils.NpcType type = npcShip_1.Type;
        if (((type != null) ? type.Class : null) == NpcUtils.N_EMFreighter)
        {
            return(false);
        }
        SelectedNpcModel selectedNpcModel = this.vmethod_5(npcShip_1);

        return(selectedNpcModel == null || selectedNpcModel.Enabled);
    }
Esempio n. 9
0
    private void method_3(Map map_0, Ship ship_1)
    {
        NpcShip npcShip = ship_1 as NpcShip;

        if (npcShip != null)
        {
            NpcUtils.NpcType type = npcShip.Type;
            if (((type != null) ? type.Class : null) == NpcUtils.N_Cubikon)
            {
                GClass846.< > c__DisplayClass20_0 CS$ < > 8__locals1 = new GClass846.< > c__DisplayClass20_0();
                CS$ < > 8__locals1.vector2_0 = ship_1.Position;
                Vector2 vector = this.method_1().Keys.OrderBy(new Func <Vector2, float>(CS$ < > 8__locals1.method_0)).First <Vector2>();
                this.method_1()[vector] = DateTimeOffset.Now.AddSeconds(300.0);
                base.Log.Info <Vector2>("Cubikon at spawn {position} destroyed", vector);
            }
        }
    }
Esempio n. 10
0
    public override int vmethod_9(NpcShip npcShip_1)
    {
        int num = base.vmethod_9(npcShip_1);

        if (num >= 0)
        {
            if (npcShip_1.LastAttackedHero.smethod_0(5000))
            {
                num++;
            }
            MapProfile mapProfile = base.C.MapProfile;
            if (mapProfile != null && mapProfile.Escort_PreferFreeNPCs && (npcShip_1.LeashedBy <= 0 || base.Hero.Group.jYrndIqmin(npcShip_1.LeashedBy)))
            {
                num += 3;
            }
        }
        return(num);
    }
Esempio n. 11
0
    private static EntityDataRoot smethod_12(GClass839 gclass839_0, Map map_0, Ship ship_0)
    {
        EntityDataRoot entityDataRoot = GClass840.smethod_2(map_0, ship_0);
        Color          color_         = MapUtils.smethod_16(map_0, ship_0);
        NpcShip        npcShip        = ship_0 as NpcShip;

        if (npcShip != null && (!(gclass839_0.Behavior ?? gclass839_0.gclass853_0).vmethod_8(npcShip) || npcShip.LeashedBy > 0))
        {
            color_ = Color.Gray;
        }
        Color?nullable_ = null;

        entityDataRoot.Data = new List <EntityRenderFragment>
        {
            GClass840.smethod_6(color_, 4, nullable_)
        };
        return(entityDataRoot);
    }
Esempio n. 12
0
    public override IEnumerable <string> vmethod_50()
    {
        IEnumerator <string> enumerator = this.method_32().GetEnumerator();

        for (;;)
        {
            try
            {
IL_52:
                if (!enumerator.MoveNext())
                {
                    break;
                }
                goto IL_A2;
IL_4A:
                goto IL_52;
            }
            finally
            {
                if (enumerator != null)
                {
                    enumerator.Dispose();
                }
            }
            break;
IL_A2:
            string text = enumerator.Current;
            yield return(text);

            goto IL_4A;
        }
        enumerator = null;
        string  format  = "Payload HP: {0:0.0}%";
        NpcShip npcShip = this.method_24();

        yield return(string.Format(format, (npcShip != null) ? npcShip.HpPercentage : 0f));

        DateTimeOffset now = DateTimeOffset.Now;

        yield break;
        yield break;
    }
Esempio n. 13
0
    public override bool UntCgkpMdca(Ship ship_0, out Ship ship_1)
    {
        GClass905.< > c__DisplayClass1_0 CS$ < > 8__locals1;
        CS$ < > 8__locals1.gclass905_0 = this;
        ship_1 = null;
        if (base.UntCgkpMdca(ship_0, out ship_1))
        {
            return(true);
        }
        CS$ < > 8__locals1.ship_0 = ship_0;
        if (CS$ < > 8__locals1.ship_0 == null)
        {
            return(false);
        }
        Vector2 position     = CS$ < > 8__locals1.ship_0.Position;
        Vector2 heroPosition = base.C.HeroPosition;
        NpcShip npcShip      = CS$ < > 8__locals1.ship_0 as NpcShip;

        if (npcShip == null)
        {
            this.method_23(1.0, ref CS$ < > 8__locals1);
            return(true);
        }
        if ((!base.C.IsAttacking || base.C.AttackingId != CS$ < > 8__locals1.ship_0.Id) && CS$ < > 8__locals1.ship_0 == base.C.Map.SelectedShip && !this.vmethod_5(npcShip))
        {
            bool flag = base.Hero.Pet.IsEnabled && base.Hero.Pet.TargetId == npcShip.Id;
            if ((npcShip.ShieldPercentage < 99f && !flag) || !this.vmethod_6(npcShip))
            {
                this.method_23(2.0, ref CS$ < > 8__locals1);
                return(true);
            }
        }
        if (CS$ < > 8__locals1.ship_0.ShieldPercentage >= 98f && Vector2.Distance(position, heroPosition) > 3500f && CS$ < > 8__locals1.ship_0.HpMax - CS$ < > 8__locals1.ship_0.Hp <= 150000)
        {
            this.method_23(1.0, ref CS$ < > 8__locals1);
            return(true);
        }
        return(false);
    }
Esempio n. 14
0
 public override bool vmethod_8(NpcShip npcShip_0)
 {
     NpcUtils.NpcType  type     = npcShip_0.Type;
     NpcUtils.NpcClass npcClass = (type != null) ? type.Class : null;
     return((npcClass == NpcUtils.N_Cubikon || Vector2.Distance(this.Module.BestSpawn, npcShip_0.Position) < 800f) && (npcClass != NpcUtils.N_Protegit || !this.method_24()) && base.vmethod_8(npcShip_0));
 }
Esempio n. 15
0
        public void method_9(GClass269 gclass269_0)
        {
            string[] array = gclass269_0.string_0.Split(new char[]
            {
                '|'
            });
            Hero hero = this.Hero;

            try
            {
                if (gclass269_0.string_0 == "0|l")
                {
                    this.IsLoggedOut = true;
                    this.Connection.Socket.Disconnect(ErrorReason.LoggedOut, null, false);
                }
                else if (array[0] == "ERR")
                {
                    this.Log.Warn("Error {msg}", gclass269_0.string_0);
                    if (array[1] == "41")
                    {
                        this.IsLoggedIn = false;
                    }
                    this.Connection.Socket.Disconnect(ErrorReason.ConnectionLost, null, false);
                }
                if (array.Length >= 3 && array[1] == "A")
                {
                    if (array[2] == "C")
                    {
                        hero.Credits = double.Parse(array[3]);
                        hero.Uridium = double.Parse(array[4]);
                    }
                    else if (array[2] == "BK")
                    {
                        hero.BootyKeys = (double)int.Parse(array[3]);
                    }
                    else if (array[2] == "STD")
                    {
                        this.Log.Info(array[3]);
                    }
                }
                string text = array[1];
                if (text != null)
                {
                    if (!(text == "i"))
                    {
                        if (!(text == "S"))
                        {
                            if (!(text == "LM"))
                            {
                                if (!(text == "n"))
                                {
                                    if (text == "7" && array.Length > 2 && array[2] == "HS")
                                    {
                                        this.Connection.method_2(new string[]
                                        {
                                            "JCPU",
                                            "GET"
                                        });
                                    }
                                }
                                else
                                {
                                    string text2 = array[2];
                                    if (text2 != null)
                                    {
                                        if (!(text2 == "INV"))
                                        {
                                            if (!(text2 == "LSH"))
                                            {
                                                if (!(text2 == "USH"))
                                                {
                                                    if (text2 == "fx")
                                                    {
                                                        string string_ = array[4];
                                                        Ship   ship    = this.Map.method_4(int.Parse(array[5]));
                                                        if (ship != null)
                                                        {
                                                            if (array[3] == "start")
                                                            {
                                                                ship.StartEffect(string_);
                                                            }
                                                            else
                                                            {
                                                                ship.EndEffect(string_);
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    Ship ship2 = this.Map.method_4(int.Parse(array[3]));
                                                    if (ship2 != null)
                                                    {
                                                        NpcShip npcShip = ship2 as NpcShip;
                                                        if (npcShip != null)
                                                        {
                                                            npcShip.LeashedBy = 0;
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                Ship ship3 = this.Map.method_4(int.Parse(array[3]));
                                                if (ship3 != null)
                                                {
                                                    NpcShip npcShip2 = ship3 as NpcShip;
                                                    if (npcShip2 != null)
                                                    {
                                                        npcShip2.LeashedBy = int.Parse(array[4]);
                                                        if (npcShip2.LeashedBy == this.Hero.Id)
                                                        {
                                                            npcShip2.LeashedBy = -1;
                                                        }
                                                        else
                                                        {
                                                            Ship ship4 = this.Map.method_4(npcShip2.LeashedBy);
                                                            if (ship4 != null)
                                                            {
                                                                ship4.TargetId = ship3.Id;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            Ship ship5 = this.Map.method_4(int.Parse(array[3]));
                                            if (ship5 != null)
                                            {
                                                ship5.Cloaked = (array[4] == "1");
                                            }
                                        }
                                    }
                                }
                            }
                            else if (array[2] == "ST" && array.Length > 5)
                            {
                                double num   = double.Parse(array[5], CultureInfo.InvariantCulture);
                                string text2 = array[3];
                                if (text2 != null)
                                {
                                    if (!(text2 == "EP"))
                                    {
                                        if (!(text2 == "HON"))
                                        {
                                            if (!(text2 == "CRE"))
                                            {
                                                if (text2 == "URI")
                                                {
                                                    this.Hero.Uridium = num;
                                                }
                                            }
                                            else
                                            {
                                                this.Hero.Credits = num;
                                            }
                                        }
                                        else
                                        {
                                            this.Hero.Honor = num;
                                        }
                                    }
                                    else
                                    {
                                        this.Hero.Experience = num;
                                        this.Hero.Level      = int.Parse(array[6]);
                                    }
                                }
                            }
                        }
                        else
                        {
                            string text2 = array[2];
                            if (text2 != null && text2 == "CFG")
                            {
                                this.Hero.Config = int.Parse(array[3]);
                            }
                        }
                    }
                    else
                    {
                        this.NextMapId = int.Parse(array[2]);
                        this.Connection.SendMessage(new GClass146(true));
                        this.method_8(false);
                    }
                }
            }
            catch
            {
            }
            GameManager.GClass77.GDelegate3 logMessage = this.LogMessage;
            if (logMessage == null)
            {
                return;
            }
            logMessage(this, gclass269_0);
        }
Esempio n. 16
0
 public override bool vmethod_8(NpcShip npcShip_1)
 {
     return(this.method_24() != null && Vector2.Distance(this.method_26(), npcShip_1.Position) < 1500f && base.vmethod_8(npcShip_1));
 }
Esempio n. 17
0
 public override bool vmethod_48(NpcShip npcShip_0)
 {
     return(false);
 }
Esempio n. 18
0
 public override bool vmethod_12(NpcShip npcShip_1)
 {
     return(false);
 }
Esempio n. 19
0
    public override bool vmethod_12(NpcShip npcShip_0)
    {
        bool flag;

        return(npcShip_0 != null && (npcShip_0.HpPercentage <= 24.75f || base.Map.method_8(npcShip_0, out flag)));
    }
Esempio n. 20
0
    public override bool vmethod_7(NpcShip npcShip_0)
    {
        Vector2 position = npcShip_0.Position;

        return(this.vmethod_16()[0].Contains((int)position.X, (int)position.Y) && base.vmethod_7(npcShip_0));
    }
Esempio n. 21
0
 public void method_25(NpcShip npcShip_1)
 {
     this.npcShip_0 = npcShip_1;
 }