Example #1
0
func Special3(object clonk, int x, int y, bool released, bool mouseclick, bool abletocast, bool cooldown)
{
	var props =
	{
		Alpha = 40,
		Size = Special3Spell.SpellRange*2,
		BlitMode = GFX_BLIT_Additive,
		Rotation = PV_Step(10, 0, 1),
		Attach = ATTACH_Back | ATTACH_MoveRelative
		
	};
	props = Particles_Colored(props, GetPlayerColor(clonk->GetOwner()));
	return CastSpellWithSpellRange(clonk, x, y, released, mouseclick, abletocast, cooldown, props, Special3Spell);
}
Example #2
0
func JumpEffect(object clonk, dir)
{
	var from, to;

	if (dir == "Up")
	{
		from = 50; 
		to = 130;
	}
	if (dir == "Left")
	{
		from = -30; 
		to = 50;
	}
	if (dir == "Right")
	{
		from = 130; 
		to = 210;
	}
	if (dir == "Down")
	{
		from = 230; 
		to = 310;
	}

	clonk->Sound("Fire::Inflame", false, 30, nil, nil, nil, -100);
	
	var trailparticles =
	{
		Size = PV_Linear(0, 20),
		Alpha = PV_Linear(255, 0),
		OnCollision = PC_Die(),
		CollisionVertex = 0,
		DampingX = 900, DampingY = 900,
		BlitMode = GFX_BLIT_Additive
	};
	trailparticles = Particles_Colored(trailparticles, GetPlayerColor(clonk->GetOwner()));
	for(var i = from; i < to; i+=5)
	{
		var r = 10;
		var x = Cos(i, r);
		var y = Sin(i, r);
		clonk->CreateParticle("Shockwave", x, y, Cos(i, r), Sin(i, r), 60, trailparticles, 2);
	}
}
Example #3
0
func BlockEffect(object clonk, int radius)
{
	var trailparticles =
	{
		Size = PV_KeyFrames(0, 0, 0, 200, PV_Random(10, 25), 1000, 0),
		Alpha = PV_Linear(255, 0),
		OnCollision = PC_Die(),
		CollisionVertex = 0,
		DampingX = 900, DampingY = 900,
		BlitMode = GFX_BLIT_Additive
	};
	trailparticles = Particles_Colored(trailparticles, GetPlayerColor(clonk->GetOwner()));
	
	clonk->CreateParticle("Shockwave",
		PV_Sin(PV_Random(0, 360, 0, 1), PV_Random(radius - 1, radius + 1, 0, 2)),
		PV_Cos(PV_Random(0, 360, 0, 1), PV_Random(radius - 1, radius + 1, 0, 2)),
		PV_Random(-5, 5), PV_Random(-5, 5), PV_Random(20, 30), trailparticles, 100);
}
Example #4
0
func Initialize()
{
	SetCategory(0);
	
	AddTimer("SwimAround", 15);
	SetAction("Swim");
	SetComDir(COMD_None);
	
	var particles = 
	{
		Size = PV_Sin(PV_Step(PV_Random(1, 2)), PV_Random(0, 1), PV_Random(1,2)),
		Attach = ATTACH_MoveRelative,
		Alpha = 100
	};
	particles = Particles_Colored(particles, HSL(Random(255), 100, 75));
	
	var amount = RandomX(5, 10);
	CreateParticle("SphereSpark", PV_Random(-3, 3), PV_Random(-3, 3), 0, 0, 0, particles, amount);
}
Example #5
0
// Timer during movement: Draw tail
func Drawing()
{
	var x=GetX(), y=GetY();
	var vx=x-last_x, vy=y-last_y;
	last_x = x; last_y = y;
	var v=Distance(vx,vy);
	if (!v) return;
	var s1=v;
	var s2=4;
	var dx1=vx*s1/v, dy1=vy*s1/v, dx2=vy*s2/v, dy2=-vx*s2/v;
	x -= dx1; y -= dy1;
	DrawMaterialQuad("Gold-gold", x+dx1+dx2,y+dy1+dy2, x+dx1-dx2,y+dy1-dy2, x-dx1-dx2,y-dy1-dy2, x-dx1+dx2,y-dy1+dy2, true);
	CreateParticle("MagicSpark", 0,0, PV_Random(-vx*2-15,-vx*2+15), PV_Random(-vy*2-15,-vy*2+15), PV_Random(30,80), Particles_Colored(Particles_Spark(),GetPlayerColor(GetOwner())), 3);
	return true;
}