Exemple #1
0
func Intro_PlaneHit()
{
	// Plane hit ground! Continue sequence.
	Sound("Objects::Plane::PlaneCrash", true);
	SetR(-90);
	var particles = Particles_Smoke(true);
	particles.Size = PV_Linear(PV_Random(20, 60), PV_Random(50, 100));
	CreateParticle("Smoke", PV_Random(-30,30), PV_Random(-30,30), PV_Random(-60, 60), PV_Random(-20,0), PV_Random(200, 500), particles, 20);
	particles.Size = PV_Linear(PV_Random(50, 80), PV_Random(100, 200));
	CreateParticle("Smoke", PV_Random(-30,30), PV_Random(-30,30), PV_Random(-20, 20), PV_Random(-20,0), PV_Random(100, 200), particles, 20);
	for (var iplr=0,plr; iplr<GetPlayerCount(C4PT_User); ++iplr)
	{
		plr = GetPlayerByIndex(iplr, C4PT_User);
		var icrew=0,crew;
		while (crew=GetCrew(plr, icrew++))
		{
			crew->Exit(0,-5, 0, Random(1)+1, Random(5)-6);
			crew->SetAction("Tumble");
		}
	}
	SetMeshMaterial("CrashedAirplane");
	this.MeshTransformation=Trans_Mul(Trans_Rotate(10,0,2,1), Airplane.MeshTransformation);
	this.Hit = this.intro_seq.plane_Hit;
	this.intro_seq.plane_crashed = true;
	this.intro_seq->ScheduleNext(50);
	return true;
}
Exemple #2
0
func FxIntTurnTimer(pTarget, effect, iTime)
{
	// Check wether the clonk wants to turn (Not when he wants to stop)
	var iRot = effect.rot;
	if( (effect.dir != GetDirection() && (GetAction() != "Jump") || this->~IsAiming()) || effect.turn_type != lAnim.turnType) 
	{
		effect.dir = GetDirection();
		if(effect.dir == COMD_Right)
		{
			if(lAnim.turnType == 0)
				iRot = 180-25;
			if(lAnim.turnType == 1)
				iRot = 180;
		}
		else
		{
			if(lAnim.turnType == 0)
				iRot = 25;
			if(lAnim.turnType == 1)
				iRot = 0;
		}
		// Save new ComDir
		effect.dir = GetDirection();
		effect.turn_type = lAnim.turnType;
		// Notify effects
//		ResetAnimationEffects();
	}
	if(iRot != effect.curr_rot)
	{
		effect.curr_rot += BoundBy(iRot-effect.curr_rot, -18, 18);
		SetMeshTransformation(Trans_Rotate(effect.curr_rot, 0, 1, 0), 0);
	}
	effect.rot = iRot;
	return;
}
Exemple #3
0
public func Construction()
{
	this.MeshTransformation = Trans_Rotate(Random(360), 0, 1, 0);
	
	var sibling = nil;
	for (var bone in ["bone1", "bone2", "bone3"])
	{
		var transformation;
		var rand = Random(2);
		if (rand == 0) 
			transformation = Trans_Rotate(RandomX(-20, 20), 1, 0, 0);
		else if(rand == 1)
			transformation = Trans_Rotate(RandomX(-20, 20), 0, 0, 1);
		sibling = TransformBone(bone, transformation, 1, Anim_Const(1000), sibling);
	}
}
Exemple #4
0
private func GetCarryTransform(clonk)
{
	var offset;
	if (GetCarrySpecial(clonk))
	{
		offset = Trans_Translate(3000, 0, 0);
	}
	else
	{
		offset = Trans_Identity();
	}
	return Trans_Mul(Trans_Rotate(90, 0, 0, 1), offset);
}
Exemple #5
0
func Death()
{
	RemoveTimer(this.UpdateSwim);
	RemoveTimer(this.Activity);
	this.MeshTransformation = Trans_Rotate(160 + Random(41), 1, 0, 0);
	if (base_transform) this.MeshTransformation = Trans_Mul(base_transform, this.MeshTransformation);
	StopAnimation(swim_animation);
	AddTimer(this.Decaying, 500);
	this.Collectible = true;
	
	// maybe respawn a new fish if roe is near
	var roe = FindObject(Find_Distance(200), Find_ID(FishRoe));
	if (roe)
		roe->Hatch(GetID());
	
	return _inherited(...);
}
Exemple #6
0
private func Initialize()
{
	SetProperty("MeshTransformation", Trans_Rotate(RandomX(0,359),0,1,0));
}
Exemple #7
0
protected func Construction()
{
	//SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180),RandomX(-10,10),10), Trans_Scale(RandomX(5,10))));
	SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180), 0, 1, 0), Trans_Scale(10)));
}
Exemple #8
0
func Construction()
{
	SetProperty("MeshTransformation",Trans_Rotate(13,0,1,0));
	SetCableSpeed(1);
}
Exemple #9
0
protected func Initialize()
{
	SetProperty("MeshTransformation",Trans_Mul(Trans_Scale(150,150,150),Trans_Rotate(Random(360),0,1,0)));
}
Exemple #10
0
protected func Construction()
{
	this.MeshTransformation = Trans_Rotate(RandomX(0, 359), 0, 1, 0);
}
Exemple #11
0
protected func Construction()
{
	SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-40,40),0,20), Trans_Scale(550)));
}
Exemple #12
0
global func DoFireBreath(proplist fx, int x, int y, int tx, int ty, int timer)
{
	var anim_length = 12;

	var sx = x - 3 + 6 * fx.cyclops->GetDir();
	var sy = y - 15;	

	// effects
	if (fx.spraying_charge <= 0)
	{
		if (ObjectDistance(fx.cyclops, fx.target) < CYCLOPS_FireBreath_Reach && fx.spraying < CYCLOPS_FireBreath_Duration)
		{
			var action = "IdleLookAround";
			fx.cyclops->PlayAnimation(action, CLONK_ANIM_SLOT_Arms, Anim_Linear(0, 0, fx.cyclops->GetAnimationLength(action), anim_length, ANIM_Remove), Anim_Linear(0, 0, 1000, 5, ANIM_Remove));
			fx.spraying_charge = 1;
		}
	}
	else if (fx.spraying_charge < anim_length)
	{
		fx.spraying_charge++;
		
		if (fx.spraying_charge >= anim_length)
		{
			fx.cyclops->Sound("BalloonInflate");
		}
	}
	else if (fx.spraying < CYCLOPS_FireBreath_Duration)
	{
		var target_angle = Normalize(Angle(sx, sy, tx, ty), -180);
		var source_angle = -90 + fx.cyclops->GetDir() * 180;

		var a = Min(CYCLOPS_FireBreath_Duration, fx.spraying * 2);
		var b = CYCLOPS_FireBreath_Duration - a;
		var angle = (b * source_angle + a * target_angle) / CYCLOPS_FireBreath_Duration;
		angle = Normalize(angle, -180);
		var head_angle = Normalize(angle - source_angle, -180);

		// turn his head towards the clonk
		// somehow the turning head makes the cyclops invisible, though
		var transform = Trans_Rotate(10, 0, 0, 1);
		//var transform = Trans_Rotate(head_angle, 0, 0, 1);

		if (!fx.anim_nr)
		{
			fx.anim_nr = fx.cyclops->TransformBone("skeleton_head", transform, 5, Anim_Const(1000));
		}
		else
		{
			fx.cyclops->SetAnimationBoneTransform(fx.anim_nr, transform);
		}

		fx.spraying = Min(CYCLOPS_FireBreath_Duration, fx.spraying + 1);
		var distance = Min(CYCLOPS_FireBreath_Reach, ObjectDistance(fx.cyclops, fx.target));

		FireBreathEffect(fx, angle, distance, sx, sy, timer);
		FireBreathDamage(fx, angle, distance, sx, sy);
	}
	else
	{
		// cooldown and reset
		fx.spraying = Min(2 * CYCLOPS_FireBreath_Duration, Max(CYCLOPS_FireBreath_Duration + 1, fx.spraying + 1));
		if (fx.spraying == 2 * CYCLOPS_FireBreath_Duration)
		{
			fx.spraying = 0;
			fx.spraying_charge = 0;
			fx.spray_old = {time = 0, v0 = 0, v1 = 0, reach = 0};
			fx.spray_cur = {time = 0, v0 = 0, v1 = 0, reach = 0};
		}
	}
}
Exemple #13
0
func Construction()
{
	SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180),0,10), Trans_Scale(RandomX(787,1212)), GetID().MeshTransformation));
}
Exemple #14
0
protected func Initialize()
{
	this.MeshTransformation = Trans_Mul(Trans_Scale(1000, 1400, 1000), Trans_Translate(0, 3500, 0), Trans_Rotate(RandomX(0, 359), 0, 1, 0));
	SetR(RandomX(-30, 30));
	return;
}