예제 #1
0
func Intro_Init(object flagpole)
{
	// Fix plane outside landscape for now
	this.plane = CreateObjectAbove(Airplane, 100,-20);
	this.plane->FaceRight();
	this.plane->SetR(80);
	this.plane->SetColor(0xa04000);
	this.plane_Hit = this.plane.Hit;
	this.plane.Hit = this.Intro_PlaneHit;
	this.plane.intro_seq = this;
	this.plane_cat = this.plane->GetCategory();
	this.plane->SetCategory(C4D_StaticBack);
	this.plane->MakeInvincible();
	this.plane.Touchable = 0;
	
	// Pyrit the pilot
	this.pilot = npc_pyrit = CreateObjectAbove(Clonk, 100, 100, NO_OWNER);
	this.pilot->MakeInvincible();
	this.pilot->Enter(this.plane);
	this.pilot->SetAction("Walk");
	this.pilot->SetName("Pyrit");
	this.pilot->SetColor(0xff0000);
	this.pilot->SetDir(DIR_Left);
	this.pilot->SetObjectLayer(this.pilot);
	this.pilot->SetAlternativeSkin("MaleBrownHair");
	
	this.plane->PlaneMount(this.pilot);
	// Pyit has a red hat!
	this.pilot->AttachMesh(Hat, "skeleton_head", "main", Trans_Translate(5500, 0, 0));

	// Dialogue object also used as helper container for clonks
	this.dialogue = this.pilot->SetDialogue("Pyrit");
	this.dialogue->SetInteraction(false);

}
예제 #2
0
파일: DlgPyrit.c 프로젝트: 772/openclonk
func Dlg_Pyrit_Init(object clonk)
{
	// Pyit has a red hat!
	clonk->AttachMesh(Hat, "skeleton_head", "main", Trans_Translate(5500, 0, 0));
	// Clonk moves slowly.
	clonk.ActMap = { Prototype = Clonk.ActMap, Walk = { Prototype = Clonk.ActMap.Walk } };
	clonk.ActMap.Walk.Speed /= 3;
	clonk->SetAction("Walk");
	// Hammering animation
	AddEffect("PyritHammering", clonk, 1, Pyrit_Hammer_SwingTime+5, this);
	return true;
}
예제 #3
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);
}
예제 #4
0
func FxPyritHammeringTimer(object c, proplist fx, int time)
{
	if (!fx.hat)
	{
		// Pyit has a red hat!
		fx.hat = c->AttachMesh(Hat, "skeleton_head", "main", Trans_Translate(5500, 0, 0));
	}
	if (FrameCounter() < this.anim_continue_frame || c.has_sequence) return FX_OK;
	this.anim = 0;
	if (!fx.catapult) if (!(fx.catapult = c->FindObject(Find_ID(Catapult), Sort_Distance()))) return FX_OK;
	if ((!Random(20) && GetPlayerCount()) || this.was_walk_interrupted)
	{
		// Move between two places (only if players are joined so Pyrit stays in place for object saving)
		var new_pos = [fx.catapult->GetX()-24, fx.catapult->GetX()+26][c->GetX() < fx.catapult->GetX()];
		c->SetCommand("MoveTo", nil, new_pos, fx.catapult->GetY());
		this.anim_continue_frame = FrameCounter() + 50;
		this.was_walk_interrupted = false;
	}
예제 #5
0
파일: SeqIntro.c 프로젝트: aburgm/openclonk
func Intro_Init()
{
	this.plane = CreateObjectAbove(Airplane, 0, 400);
	this.plane->SetColor(0xa04000);
	this.pilot = npc_pyrit = CreateObjectAbove(Clonk, 100, 100, NO_OWNER);
	this.pilot->MakeInvincible();
	this.pilot->SetSkin(2);
	this.pilot->Enter(this.plane);
	this.pilot->SetAction("Walk");

	this.pilot->SetName("Pyrit");
	this.pilot->SetColor(0xff0000); // currently overridden by skin
	this.pilot->SetAlternativeSkin("MaleBrownHair");
	this.pilot->SetDir(DIR_Left);
	this.pilot->SetObjectLayer(this.pilot);
	this.pilot->AttachMesh(Hat, "skeleton_head", "main", Trans_Translate(5500, 0, 0));
	this.dialogue = this.pilot->SetDialogue("Pilot");
	this.dialogue->SetInteraction(false);

	this.plane->FaceRight();
	this.plane->PlaneMount(this.pilot);
}
예제 #6
0
func Intro_Start()
{
	// Intro starts high up in the clouds
	Music("TheSkylands");
	LoadScenarioSection("Intro");
	SetWind(-100);
	this.intro_skyscroll_xdir = -10;
	SetSkyParallax(0, 20, 20, this.intro_skyscroll_xdir, 0);
	
	this.plane = CreateObjectAbove(Airplane, 500, 200);
	this.plane->SetColor(0xa04000);
	this.pilot = CreateObjectAbove(Clonk, 100, 100, NO_OWNER);
	this.pilot->MakeInvincible();
	this.pilot->SetSkin(2);
	this.pilot->Enter(this.plane);
	this.pilot->SetAction("Walk");

	this.pilot->SetName("Pyrit");
	this.pilot->SetColor(0xff0000);
	this.pilot->SetAlternativeSkin("MaleBrownHair");
	this.pilot->SetDir(DIR_Left);
	this.pilot->SetObjectLayer(this.pilot);
	this.pilot->AttachMesh(Hat, "skeleton_head", "main", Trans_Translate(5500, 0, 0)); // Hat is seen in the cockpit!

	this.plane->PlaneMount(this.pilot);
	this.plane.FxIntPlaneTimer = this.Intro_PlaneTimer;
	RemoveEffect("IntPlane", this.plane);
	AddEffect("IntPlane",this.plane,1,1,this.plane);
	this.plane->FaceRight();
	this.plane->StartInstantFlight(90, 0);
	g_intro_sky_moving = true;
	

	SetViewTarget(this.plane);

	return ScheduleNext(100, 1);
}
예제 #7
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;
}