Example #1
0
 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);
 }
Example #2
0
 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;
 }
Example #3
0
 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;
 }
Example #4
0
 public void SendHitPlayer(Mob m)
 {
 }
Example #5
0
 public void SendMobTarget(Mob m)
 {
     SendMessage(MsgHeader.Mobpos, m.Netid, m.Target.X, m.Target.Y);
 }
Example #6
0
 public void SendNewMob(Mob m)
 {
     SendMessage(MsgHeader.Newmob, (int)m.Class, m.Netid, m.Position.X, m.Position.Y);
 }
Example #7
0
 /// <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);
 }
Example #8
0
 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;
 }