Пример #1
0
        /// <summary>
        /// Loads prop data from db.
        /// </summary>
        private void LoadDefault()
        {
            if ((this.Data = AuraData.PropsDb.Find(this.Info.Id)) == null)
            {
                Log.Warning("Prop.LoadDefault: No data found for '{0}'.", this.Info.Id);
                return;
            }

            // Add state for wells, otherwise they aren't interactable
            // and you can walk through them o,o
            // TODO: Can we generalize this somehow?
            // They also have XML, but that doesn't seem to be needed.
            // <xml _RESOURCE="100.000000" _LAST_COLLECT_TIME="63559712423945"/>
            if (this.Data.HasTag("/water/well/"))
            {
                this.State = "default";
            }
        }
Пример #2
0
        /// <summary>
        /// Loads prop data from db.
        /// </summary>
        private void LoadDefault()
        {
            // Get shapes
            // TODO: Add prop shape db? Check for reference props in world?
            if (this.Info.Id == 203)             // Campfire
            {
                var size  = 80;
                var shape = new ShapeData();
                shape.X1 = (int)(this.Info.X - size);
                shape.Y1 = (int)(this.Info.Y - size);
                shape.X2 = (int)(this.Info.X + size);
                shape.Y2 = (int)(this.Info.Y - size);
                shape.X3 = (int)(this.Info.X + size);
                shape.Y3 = (int)(this.Info.Y + size);
                shape.X4 = (int)(this.Info.X - size);
                shape.Y4 = (int)(this.Info.Y + size);

                this.Shapes.Add(shape);
            }
            else
            {
                // No collision data.
            }

            // Load prop data
            if ((this.Data = AuraData.PropsDb.Find(this.Info.Id)) == null)
            {
                Log.Warning("Prop.LoadDefault: No data found for '{0}'.", this.Info.Id);
                return;
            }

            // Add state for wells, otherwise they aren't interactable
            // and you can walk through them o,o
            // TODO: Can we generalize this somehow?
            // They also have XML, but that doesn't seem to be needed.
            // <xml _RESOURCE="100.000000" _LAST_COLLECT_TIME="63559712423945"/>
            if (this.Data.HasTag("/water/well/"))
            {
                this.State = "default";
            }
        }
Пример #3
0
        /// <summary>
        /// Creates new prop with given entity id.
        /// </summary>
        /// <param name="entityId"></param>
        /// <param name="id"></param>
        /// <param name="regionId"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="direction"></param>
        /// <param name="scale"></param>
        /// <param name="altitude"></param>
        /// <param name="state"></param>
        /// <param name="ident"></param>
        /// <param name="title"></param>
        public Prop(long entityId, int id, int regionId, int x, int y, float direction, float scale, float altitude, string state, string ident, string title)
        {
            this.Shapes     = new List <Point[]>();
            this.Temp       = new PropTemp();
            this.Vars       = new ScriptVariables();
            this.Extensions = new PropExtensionManager(this);

            _resource = 100;

            this.EntityId       = entityId;
            this.Ident          = ident;
            this.Title          = title;
            this.Info.Id        = id;
            this.Info.Region    = regionId;
            this.Info.X         = x;
            this.Info.Y         = y;
            this.Info.Altitude  = altitude;
            this.Info.Direction = direction;
            this.Info.Scale     = scale;
            this.LastCollect    = DateTime.Now;

            this.Info.Color1                                 =
                this.Info.Color2                             =
                    this.Info.Color3                         =
                        this.Info.Color4                     =
                            this.Info.Color5                 =
                                this.Info.Color6             =
                                    this.Info.Color7         =
                                        this.Info.Color8     =
                                            this.Info.Color9 = 0xFF808080;

            this.State = state;
            this.UpdateShapes();

            // Load prop data
            if ((this.Data = AuraData.PropsDb.Find(this.Info.Id)) == null)
            {
                Log.Warning("Prop: No data found for '{0}'.", this.Info.Id);
            }
        }
Пример #4
0
Файл: Prop.cs Проект: Vinna/aura
		/// <summary>
		/// Creates new prop with given entity id.
		/// </summary>
		/// <param name="entityId"></param>
		/// <param name="id"></param>
		/// <param name="regionId"></param>
		/// <param name="x"></param>
		/// <param name="y"></param>
		/// <param name="direction"></param>
		/// <param name="scale"></param>
		/// <param name="altitude"></param>
		/// <param name="state"></param>
		/// <param name="ident"></param>
		/// <param name="title"></param>
		public Prop(long entityId, int id, int regionId, int x, int y, float direction, float scale, float altitude, string state, string ident, string title)
		{
			this.Shapes = new List<Point[]>();
			this.Temp = new PropTemp();
			this.Extensions = new PropExtensionManager(this);

			_resource = 100;

			this.EntityId = entityId;
			this.Ident = ident;
			this.Title = title;
			this.Info.Id = id;
			this.Info.Region = regionId;
			this.Info.X = x;
			this.Info.Y = y;
			this.Info.Direction = direction;
			this.Info.Scale = scale;
			this.LastCollect = DateTime.Now;

			this.Info.Color1 =
			this.Info.Color2 =
			this.Info.Color3 =
			this.Info.Color4 =
			this.Info.Color5 =
			this.Info.Color6 =
			this.Info.Color7 =
			this.Info.Color8 =
			this.Info.Color9 = 0xFF808080;

			this.State = state;
			this.UpdateShapes();

			// Load prop data
			if ((this.Data = AuraData.PropsDb.Find(this.Info.Id)) == null)
				Log.Warning("Prop: No data found for '{0}'.", this.Info.Id);
		}