public DamageCircle(Hero heroOwner, Mob mobOwner, bool destroyOnHit, int id, MapRoom room) { Id = id; HeroOwner = heroOwner; MobOwner = mobOwner; DestroyOnHit = destroyOnHit; Room = room; ShapeManager.AddCircle(this); }
public DamageCircle AddCircle(Hero heroOwner, Mob mobOwner, TimeSpan lifeSpan, bool destroyOnHit, MapRoom room) { DamageCircle c = new DamageCircle(heroOwner, mobOwner, destroyOnHit, NextId++, room); Circles.Add(c); //remove event Globals.EventManager.AddEvent(delegate () { c.Destroy(); return 0; }, $"removecircle{NextId - 1}", false, lifeSpan, TimeSpan.Zero, TimeSpan.Zero); return c; }
public static Mob MobClient(MobClass mobclass, Vector2 pos) { Mob m = new Mob(); m.Class = mobclass; m.Target = m.Position = new Vector3(pos, ZLayer.Npc); if(!Debug.DebugMode) m.Visible = false; m.Color = Color.Red; m.InitClass(); m.InitSprite(m.File); m.InitLabel(); return m; }
public void SendHitPlayer(Mob m) { }
public void SendMobTarget(Mob m) { SendMessage(MsgHeader.Mobpos, m.Netid, m.Target.X, m.Target.Y); }
public void SendNewMob(Mob m) { SendMessage(MsgHeader.Newmob, (int)m.Class, m.Netid, m.Position.X, m.Position.Y); }
/// <summary> /// Update mob pos (target) /// </summary> /// <param name="m"></param> public void SendMobTarget(Mob m) { foreach (ServerClient c in Rooms[m.Map].Clients) c.SendMobTarget(m); }
public static Mob MobServer(MobClass mobclass, MobMap map, Vector2 pos) { Mob m = new Mob(); m.Target = m.Position = new Vector3(pos, ZLayer.Npc); m.Map = map; m.Netid = NextNetid++; m.Class = mobclass; m.StartRoaming(); m.StartUpdatingPos(); return m; }