Example #1
0
        /// <summary>
        /// Occurs when the character dies
        /// </summary>
        /// <returns>Returns always true</returns>
        public bool OnDie()
        {
            //Pronounce my dead to other people
            if (this.sessionParty != null)
            {
                foreach (Character target in this.sessionParty.GetCharacters())
                {
                    if (target.id == this.id)
                    {
                        continue;
                    }
                    if (target.client.isloaded == true)
                    {
                        SMSG_PARTYMEMBERDIED spkt = new SMSG_PARTYMEMBERDIED();
                        spkt.SessionId = target.id;
                        spkt.Index     = 1;
                        spkt.ActorId   = this.id;
                        target.client.Send((byte[])spkt);
                    }
                }
            }

            // SUBSCRIBE FOR RESPAWN
            this.ISONBATTLE = false;
            Respawns.Subscribe(this);
            return(true);
        }
Example #2
0
        /// <summary>
        /// Add new regions
        /// </summary>
        /// <param name="location"></param>
        public void Add(PointF first, PointF last)
        {
            var location = new Location();

            location.Left   = (int)first.X;
            location.Top    = (int)first.Y;
            location.Right  = (int)last.X;
            location.Bottom = (int)last.Y;
            Respawns.Add(location);

            AddedLocation?.Invoke(this, location);
        }
Example #3
0
        /// <summary>
        /// Add new regions
        /// </summary>
        /// <param name="first"></param>
        /// <param name="last"></param>
        public void AddRespawn(Vector first, Vector last)
        {
            var location = new Respawn
            {
                Rectangle = new RectangleVector()
                {
                    LeftTop     = first,
                    RightBottom = last
                }
            };

            Respawns.Add(location);

            Added?.Invoke(this, new AddedArgs(location, typeof(Respawn)));
        }
Example #4
0
	void Awake(){
		instance = this;
	}
Example #5
0
        /// <summary>
        /// Remove respawn nflavor script
        /// </summary>
        /// <param name="index"></param>
        public void RemoveR(int index)
        {
            Respawns.RemoveAt(index);

            Removed?.Invoke(this, new EventArgs());
        }
Example #6
0
        /// <summary>
        /// Remove respawn nflavor script
        /// </summary>
        /// <param name="index"></param>
        public void RemoveRespawn(int index)
        {
            Respawns.RemoveAt(index);

            Removed?.Invoke(this, new RemovedArgs(index, typeof(Respawn)));
        }
Example #7
0
 /// <summary>
 /// Reinitilize child objet
 /// </summary>
 public void Dispose()
 {
     Respawns.Clear();
     Props.Clear();
     Render();
 }