public SelectedNpcModel GetModel(Ship ship, Map map = null, int?targetMap = null, int offsetWave = 0) { if (ship == null) { return(null); } if (map != null) { int int_ = targetMap ?? map.MapId; if (MapUtils.smethod_10(int_) != GEnum5.None) { if (this.NpcWhitelist.Any((SelectedNpcModel t) => NpcUtils.NpcById[t.NpcId] is NpcUtils.GGWaveType)) { GEnum5 type = MapUtils.smethod_10(int_); DarkOrbitWebAPI.GalaxyGatesInfo ggInfo = map.Game.Web.GgInfo; DarkOrbitWebAPI.jumpgateGate jumpgateGate = (ggInfo != null) ? ggInfo.GetGate(type) : null; if (jumpgateGate == null) { return(null); } SelectedNpcModel result = null; int num = 0; foreach (KeyValuePair <SelectedNpcModel, NpcUtils.GGWaveType> keyValuePair in (from t in this.NpcWhitelist where NpcUtils.NpcById[t.NpcId] is NpcUtils.GGWaveType select t).ToDictionary((SelectedNpcModel t) => t, (SelectedNpcModel t) => (NpcUtils.GGWaveType)NpcUtils.NpcById[t.NpcId])) { if (jumpgateGate.currentWave >= keyValuePair.Value.WaveNumber) { if (offsetWave == 0) { result = keyValuePair.Key; } } else { num++; if (num == offsetWave) { result = keyValuePair.Key; } } } return(result); } } } if (ship == Ship.Default) { return(null); } string name = ship.Name; NpcUtils.NpcType npc = NpcUtils.NpcType.smethod_5(name); return(this.NpcWhitelist.FirstOrDefault((SelectedNpcModel t) => t.NpcId == npc.Id)); }
public static int smethod_1(NpcUtils.NpcType npcType_0) { if (npcType_0 == null || npcType_0.Class == null) { return(540); } NpcUtils.NpcClass @class = npcType_0.Class; int num = (npcType_0.Group == NpcUtils.G_Boss) ? 15 : ((npcType_0.Group == NpcUtils.G_Uber) ? 30 : 0); int num2; if (SecurityManager.NpcRangesRegular.TryGetValue(@class, out num2)) { return(num2 + Math.Min(num, Math.Max(0, 610 - num2))); } return(540 + num); }
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); }
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); } } }
public NpcShip method_6(Vector2 vector2_0, Func <NpcShip, bool> func_0 = null, Func <NpcShip, int> func_1 = null, int int_0 = 0) { Map.< > c__DisplayClass87_0 CS$ < > 8__locals1 = new Map.< > c__DisplayClass87_0(); CS$ < > 8__locals1.priority = func_1; CS$ < > 8__locals1.origin = vector2_0; CS$ < > 8__locals1.now = DateTimeOffset.Now; List <NpcShip> list = this.All <NpcShip>(CS$ < > 8__locals1.origin, func_0, CS$ < > 8__locals1.priority, int_0).ToList <NpcShip>(); bool isGG = this.IsGG; CS$ < > 8__locals1.dpsByType = new Dictionary <NpcUtils.NpcType, double>(); foreach (NpcShip npcShip in list) { if (npcShip.Type != null) { if (!CS$ < > 8__locals1.dpsByType.ContainsKey(npcShip.Type)) { CS$ < > 8__locals1.dpsByType[npcShip.Type] = 0.0; } int num = (int)(CS$ < > 8__locals1.now - npcShip.LastAttackedHero).TotalMilliseconds; Dictionary <NpcUtils.NpcType, double> dpsByType = CS$ < > 8__locals1.dpsByType; NpcUtils.NpcType type = npcShip.Type; dpsByType[type] += (double)((float)npcShip.LastAttackedHeroDamage / (float)(num / 1000 + 1)); } } var source = list.Select(new Func <NpcShip, <> f__AnonymousType2 <NpcShip, float, int, int, double> >(CS$ < > 8__locals1.method_0)); if (!isGG) { var <> f__AnonymousType = source.Where(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, bool > (Map.< > c.< > 9.method_0)).OrderBy(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, int > (Map.< > c.< > 9.method_1)).ThenByDescending(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, int > (Map.< > c.< > 9.method_2)).ThenByDescending(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, int > (Map.< > c.< > 9.method_3)).ThenByDescending(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, double > (Map.< > c.< > 9.method_4)).ThenByDescending(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, float > (Map.< > c.< > 9.method_5)).FirstOrDefault(); if (< > f__AnonymousType == null) { return(null); } return(< > f__AnonymousType.t); } else { var <> f__AnonymousType2 = source.OrderByDescending(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, int > (Map.< > c.< > 9.method_6)).ThenBy(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, int > (Map.< > c.< > 9.method_7)).ThenByDescending(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, double > (Map.< > c.< > 9.method_8)).ThenByDescending(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, int > (Map.< > c.< > 9.method_9)).ThenByDescending(new Func << > f__AnonymousType2 <NpcShip, float, int, int, double>, float > (Map.< > c.< > 9.method_10)).FirstOrDefault(); if (< > f__AnonymousType2 == null) { return(null); } return(< > f__AnonymousType2.t); } }
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)); }