示例#1
0
func Initialize()
{
	SetAction("Travel");
	SetRDir(10);
	SetObjectLayer(nil);
	//AddEffect("MoveTo", this, 1, 1, this);
	
	ox=GetX();
	oy=GetY();
	
	rangedummy = CreateObject(Dummy, 0, 0, GetOwner());
	rangedummy.Visibility = VIS_Owner;
	rangedummy->SetAction("HangOnto", this);
		var props =
		{
			R = 255,
			G = 0,
			B = 0,
			Alpha = 40,
			Size = 70,
			BlitMode = GFX_BLIT_Additive,
			Rotation = PV_Step(10, 0, 1),
			Attach = ATTACH_Back | ATTACH_MoveRelative
			
		};
	rangedummy->CreateParticle("Shockwave2", 0, 0, 0, 0, 0, props, 1);
	
	moveparticle =
	{
		Alpha = 100,
		Size = AttackSize * 2,
		R = pR,
		G = pG,
		B = pB,
		Rotation = PV_Random(0,360),
		BlitMode = GFX_BLIT_Additive,
	};
	
	moveparticle2 =
	{
		Size = PV_Linear(2,0),
		BlitMode = GFX_BLIT_Additive,
		R = pR,
		G = pG,
		B = pB,
		Attach=ATTACH_Back,
	};
	
	movetrailparticles =
	{
		Size = PV_Linear(5,0),
		BlitMode = GFX_BLIT_Additive,
		R = pR,
		G = pG,
		B = pB,
		Attach=ATTACH_Back,
	};
	
	followtrailparticles =
	{
		Size = PV_Linear(5,0),
		BlitMode = GFX_BLIT_Additive,
		R = 50,
		G = 50,
		B = 50,
		Attach=ATTACH_Back,
	};
	
	hometrailparticles =
	{
		Size = PV_Linear(5,0),
		BlitMode = GFX_BLIT_Additive,
		R = 0,
		G = 255,
		B = 255,
		Attach=ATTACH_Back,
	};
	
	hometrailparticles2 =
	{
		Size = PV_Linear(2,0),
		BlitMode = GFX_BLIT_Additive,
		R = 0,
		G = 255,
		B = 255,
		Attach=ATTACH_Back,
	};
	
	
}
示例#2
0
func FxHomeCallTimer(object target, proplist fx, int time)
{
	if(!master)
	{
		KillBall();
		return -1;
	}	
	
	if(GetEffect("Blocked", this))
	{
		ox=GetX();
		oy=GetY();
		return;
	}
	
	DrawParticleLine("Flash", 0, 0, ox-GetX(), oy-GetY(), 1, 0, 0, 15, hometrailparticles);
	
	if(time%7 == 0)
	{
		for(var i = 0; i < 360; i+=5)
		{
			CreateParticle("Flash", Sin(i, 3), -Cos(i, 5), 0, 0, 10, hometrailparticles2, 2);
		}
	}

	fx.x = master->GetX();
	fx.y = master->GetY();
	var angle = Angle(GetX(), GetY(), fx.x, fx.y, 10);
	var txdir = Sin(angle, Speed + 12, 10);
	var tydir = -Cos(angle, Speed + 12, 10);
	SetXDir((GetXDir() + (txdir - GetXDir())/2));
	SetYDir((GetYDir() + (tydir - GetYDir())/2));
	
	CheckForEnemies(HomeCallSize);
	
	ox=GetX();
	oy=GetY();
	
	var dst = Distance(GetX(), GetY(), fx.x, fx.y);
	if(dst < 8)
	{
		AddShield(master);
		Sound("Ball::ball_shield", false, 20);
		
		var particles =
		{
			Prototype = Particles_Glimmer(),
			R = pR,
			G = pG,
			B = pB,
			Alpha = 255,
			Size = PV_Linear(10, 0),
			OnCollision = PC_Bounce(),
		};
		CreateParticle("StarSpark", 0, 0, PV_Random(-60,60), PV_Random(-60, 60), 25, particles, 5);
		
		var particle =
		{
			Alpha = PV_Linear(255, 0),
			Size = 50,
			R = pR,
			G = pG,
			B = pB,
			BlitMode = GFX_BLIT_Additive,
		};
		master->CreateParticle("StarSpark", 0, 0, 0, 0, 7, particle, 4);
		
		FollowMaster();
		return -1;
	}
}