Inheritance: Terraria.Graphics.Effects.CustomSky
			public override void InitializeUfo(ref MartianSky.Ufo ufo)
			{
				ufo.Position.X = (float)(MartianSky.Ufo.Random.NextDouble() * (double)(Main.maxTilesX << 4));
				ufo.Position.Y = (float)(MartianSky.Ufo.Random.NextDouble() * 5000.0);
				ufo.Opacity = 0f;
				ufo.Rotation = 0f;
				this._ticks = 0;
				this._maxTicks = MartianSky.Ufo.Random.Next(120, 240);
			}
			public override void InitializeUfo(ref MartianSky.Ufo ufo)
			{
				ufo.Position.X = (float)(MartianSky.Ufo.Random.NextDouble() * (double)(Main.maxTilesX << 4));
				ufo.Position.Y = (float)(MartianSky.Ufo.Random.NextDouble() * 5000.0);
				ufo.Opacity = 0f;
				float num = (float)MartianSky.Ufo.Random.NextDouble() * 5f + 10f;
				double num2 = MartianSky.Ufo.Random.NextDouble() * 0.60000002384185791 - 0.30000001192092896;
				ufo.Rotation = (float)num2;
				if (MartianSky.Ufo.Random.Next(2) == 0)
				{
					num2 += 3.1415927410125732;
				}
				this._speed = new Vector2((float)Math.Cos(num2) * num, (float)Math.Sin(num2) * num);
				this._ticks = 0;
				this._maxTicks = MartianSky.Ufo.Random.Next(400, 500);
			}
			public override bool Update(ref MartianSky.Ufo ufo)
			{
				if (this._ticks < 10)
				{
					ufo.Opacity += 0.1f;
				}
				else if (this._ticks > this._maxTicks - 10)
				{
					ufo.Opacity -= 0.1f;
				}
				if (this._ticks == this._maxTicks)
				{
					return false;
				}
				this._ticks++;
				return true;
			}
示例#4
0
 public override bool Update(ref MartianSky.Ufo ufo)
 {
     if (this._ticks < 10)
     {
         ufo.Opacity = ufo.Opacity + 0.1f;
     }
     else if (this._ticks > this._maxTicks - 10)
     {
         ufo.Opacity = ufo.Opacity - 0.1f;
     }
     ufo.Position = ufo.Position + this._speed;
     if (this._ticks == this._maxTicks)
     {
         return false;
     }
     MartianSky.ZipBehavior zipBehavior = this;
     zipBehavior._ticks = zipBehavior._ticks + 1;
     return true;
 }
示例#5
0
 public abstract bool Update(ref MartianSky.Ufo ufo);
示例#6
0
 public abstract void InitializeUfo(ref MartianSky.Ufo ufo);
示例#7
0
 public override bool Update(ref MartianSky.Ufo ufo)
 {
     if (this._ticks < 10)
     {
         ufo.Opacity = ufo.Opacity + 0.1f;
     }
     else if (this._ticks > this._maxTicks - 10)
     {
         ufo.Opacity = ufo.Opacity - 0.1f;
     }
     if (this._ticks == this._maxTicks)
     {
         return false;
     }
     MartianSky.HoverBehavior hoverBehavior = this;
     hoverBehavior._ticks = hoverBehavior._ticks + 1;
     return true;
 }