private void CheckZonesInRange() { if (Spacemap == null) { return; } // bei einer Base bekommt man dann NAZ, wenn man selber 5sekunden nicht angreift // bei einem Portal bekommt man dann NAZ, wenn man selber 5sekunden nicht angreift und 3sekunden nicht angegriffen wurde. // Portal NAZ Radius: 500 (Durchmesser 1000) // Base NAZ Radius: 1793 (Durchmesser: 3586) (Die Türme bestimmen die NAZ) Position currentPosition = MovementAssembly.ActualPosition(); lock (_checkZonesInRange) { bool isNaz = false; bool canEquip = false; if (!Spacemap.MapInfo.IsBattleMap) { foreach (PortalObject portal in Spacemap.MapInfo.Portals) { if (portal.OwnerFaction.ID == Faction.ID && portal.Position.DistanceTo(currentPosition) < 500 && AttackAssembly.LastAttack.FromNow(CurrentClock.ElapsedMilliseconds) > 5000 && AttackTraceAssembly.LastAttackTime.FromNow(CurrentClock.ElapsedMilliseconds) > 3000) { isNaz = true; break; } } } foreach (BaseObject @base in Spacemap.MapInfo.Bases) { if (@base.OwnerFaction.ID == Faction.ID && @base.Position.DistanceTo(currentPosition) < 1793 && AttackAssembly.LastAttack.FromNow(CurrentClock.ElapsedMilliseconds) > 5000) { isNaz = true; canEquip = true; break; } } ZoneAssembly.ChangeEquip(canEquip); if (isNaz) { ZoneAssembly.ShowDMZ(); } else { ZoneAssembly.HideDMZ(); } } }
public NpcController(int id, string username, Faction faction) : base(id, username, faction) { BoosterAssembly = new BoosterAssembly(this); HangarAssembly = new NpcHangarAssembly(this, Ship.YAMATO, Map.MAP_R_ZONE, new Position(10000, 6000), 1_000_000, 1_000_000); MovementAssembly = new MovementAssembly(this); AttackAssembly = new NpcAttackAssembly(this); EffectsAssembly = new EffectsAssembly(this); AttackTraceAssembly = new AttackTraceAssembly(this); ZoneAssembly = new ZoneAssembly(this); BoosterAssembly.Set(BoosterType.SHIELD_REGNERATION, 0.05); BoosterAssembly.Set(BoosterType.SHIELD_ABSORBATION, 0.5); BoosterAssembly.Set(BoosterType.HITPOINTS_REGENERATION, 0.01); TimerStart(); InitializeTimer(); SpacemapController.For(HangarAssembly.Map.ID).Add(this); }
public override void Die() { PlayerEffectsAssembly.CureInfection(true); MovementAssembly.Move(MovementAssembly.ActualPosition(), MovementAssembly.ActualPosition()); Lock(null); EntitiesLockedSafe(x => { if (x.Locked != null && x.Locked.ID == ID) { x.Lock(null); } }); ICommand killCommand = PacketBuilder.KillCommand(this); GameManager.Get(AttackTraceAssembly.CurrentMainAttacker, out PlayerController killer); Send(killCommand, PacketBuilder.KillScreen.KillScreenCommand(DestructionTypeModule.PLAYER, killer)); // send kill screen EntitesInRange(x => { if (x.ID == AttackTraceAssembly.CurrentMainAttacker) // killer // render rewards etc. { x.Send( killCommand, PacketBuilder.Legacy("0|A|STD|You killed " + Account.Username + "!") ); } else { x.Send(killCommand); } }); AttackTraceAssembly.Reset(); Spacemap?.Remove(this); // remove from spacemap TimerStop(); }