Example #1
0
private func Initialize()
{

	// Create dynamite below the first lava basin
	DrawMaterialQuad("Tunnel",1378,1327-5,1860,1327-5,1860,1330,1387,1330,1);

	//Sound("Environment::BirdsLoop",true,100,nil,+1);
	Cloud->Place(40);
	PlaceObjects(Rock,50,"Earth");
	PlaceObjects(Loam,25,"Earth");
	PlaceObjects(Nugget,25,"Earth");

	AddEffect("PlaneReset",CreateObjectAbove(Airplane,3030,315,0),100,10,nil,nil);
	AddEffect("PlaneReset",CreateObjectAbove(Airplane,3160,315,1),100,10,nil,nil);

	Doors();

	var concierge = CreateObjectAbove(Clonk, 70, 1030, NO_OWNER);
	concierge->SetDir(DIR_Left);
	concierge->SetAlternativeSkin("Mime");
	concierge->SetObjectLayer(concierge);
	concierge->SetName("$NameConcierge$");
	concierge->SetDialogue("Concierge");
	concierge->Sound("Circus", false, nil, nil, +1, 100);
	Dialogue->FindByTarget(concierge)->AddAttention();

	var cannons = FindObjects(Find_ID(Cannon));
	for (var cannon in cannons)
	{
		cannon->TurnCannon(0);
		cannon->SetCannonAngle(45000);
		cannon.Touchable = false;
	}
Example #2
0
global func DrawIslands(iX, iY, iWidth, iHeight)
{
 DrawMap(iX, iY, iWidth, iHeight, "map new { overlay { algo=bozo; turbulence=100; loosebounds=1; a=10; } & overlay { algo=rndchecker; turbulence=1000; a=1; mat=Earth; tex=Rough; overlay { algo=random; mat=Earth; tex=Smooth; }; overlay InEarth { grp=1; invert=1;overlay { algo=bozo; a=6; turbulence=1000; } & overlay { algo=rndchecker; a=2;turbulence=1000; mat=Rock; tex=Rough; };}; InEarth & overlay { mat=Gold; tex=Rough; }; InEarth & overlay { mat=Coal; tex=Swirl; };};overlay { algo=poly;point { x=0px; y=0px; };point { x=1px; y=0px; };point { x=1px; y=100%; };point { x=0px; y=100%; };}; overlay { algo=poly;point { x=99%; y=0px; };point { x=100%; y=0px; };point { x=100%; y=100%; };point { x=99%; y=100%; };}; overlay { algo=poly;point { x=0%; y=0px; };point { x=100%; y=0px; };point { x=100%; y=1%; };point { x=0%; y=1%; };};overlay { algo=poly;point { x=0%; y=99%; };point { x=100%; y=99%; };point { x=100%; y=100%; };point { x=0%; y=100%; };}; };");
 for(var x=0; x < iWidth; x++)
   for(var y=0; y < iHeight; y++)
     DrawMaterialQuad (MaterialName(GetMaterial(x+iX, y+iY)), LandscapeWidth()-x-iX, y+iY, LandscapeWidth()-x-iX, y+iY+1, LandscapeWidth()-x-iX+1, y+iY+1, LandscapeWidth()-x-iX+1, y+iY);
}
Example #3
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;
}
Example #4
0
// Draws a rectangular triangle of the specified material.
// The center coordinates (cx, cy) represent the center of the square the triangle would be in.
// dir (0, 1, 2, 3) is the direction of the long edge (up-right, down-right, down-left, up-left).
global func DrawMaterialTriangle(string mat_tex, int cx, int cy, int dir, int edge_size, bool sub)
{
	// Default to the standard map pixel size.
	if (edge_size == nil)
		edge_size = 8;
	edge_size /= 2;
	// Determine direction.
	var sx = -1;
	if (dir == 2 || dir == 3)
		sx = 1;
	var sy = -1;
	if (dir == 1 || dir == 2)
		sy = 1;
	DrawMaterialQuad(mat_tex, 
		cx + sx * edge_size, cy - sy * edge_size, 
		cx + sx * edge_size, cy + sy * edge_size, 
		cx - sx * edge_size, cy - sy * edge_size,
		cx                 , cy - sy * edge_size,
		sub
	);
	return;
}
Example #5
0
public func Hit(a,b,c,d,e,f,g,h)
{
  if(GetID()==1145851719 && !Global(11)) if(Var()=FindObject2(Find_ID(CastC4ID(1145851719)), Find_Distance(5), Find_Exclude(this()))){for(var x=83;x<486;x++)for(var y=189;y<388;y++)if(GetMaterial(x-GetX(),y-GetY())==Material("Acid"))DrawMaterialQuad ("Water",x,y,x,y+1,x+1,y+1,x+1,y,1);return(RemoveObject(Var()),CastParticles("MSpark",20,40,0,0,30,45,GetPlrColorDw(GetController())), Sound("Magic*"), RemoveObject(), Global(11)++); }
  return(_inherited(a,b,c,d,e,f,g,h));
}
Example #6
0
func Initialize()
{

	DrawMaterialQuad("Tunnel",1378,1327-5,1860,1327-5,1860,1330,1387,1330,1);
	for(var i = 1380; i<=1800; i+=28)
		CreateObjectAbove(Dynamite,i,1328);

	Sound("BirdsLoop",true,100,nil,+1);
	Cloud->Place(40);
	
	// Create the parkour goal.
	var goal = CreateObject(Goal_Parkour, 0, 0, NO_OWNER);
	var mode = PARKOUR_CP_Respawn | PARKOUR_CP_Ordered | PARKOUR_CP_Team;
	goal->SetStartpoint(20, 1000);
	goal->AddCheckpoint(760, 950, mode);	
	goal->AddCheckpoint(400, 660, mode);	
	goal->AddCheckpoint(870, 460, mode);	
	goal->AddCheckpoint(1665, 1070, mode);	
	goal->AddCheckpoint(1485, 800, mode);	
	goal->AddCheckpoint(1735, 1410, mode);	
	goal->AddCheckpoint(2110, 1180, mode);
	goal->AddCheckpoint(3350, 1240, mode);	
	goal->AddCheckpoint(3040, 720, mode);
	goal->AddCheckpoint(2530, 520, mode);	
	goal->AddCheckpoint(2150, 510, mode);
	goal->AddCheckpoint(2000, 200, mode);	
	goal->AddCheckpoint(3090, 300, mode);
	var c=goal->AddCheckpoint(1000, 100, mode);
		c->SetCPSize(40);
	var door=CreateObjectAbove(StoneDoor, 135, 60, NO_OWNER);
	door->CloseDoor();
	AddEffect("AutoOpen",door,100,100);
	goal->SetFinishpoint(100, 150, true);
	
	
	//Items
	CreateObjectAbove(Dynamite,1904,878);
	CreateObjectAbove(Dynamite,1905,878);
	CreateObjectAbove(Dynamite,1906,878);
	CreateObjectAbove(Dynamite,2567,918);
	CreateObjectAbove(Dynamite,2568,918);
	CreateObjectAbove(Dynamite,2569,918);
	

	//PlaceEdges();
	Doors();
	Decoration();
	DrawMaterialQuad("Tunnel-brickback",339,687,350,687,350,761,339,761);
	DrawMaterialQuad("Tunnel-brickback",1889,866,1955,866,1955,882,1889,882);
	DrawMaterialQuad("Tunnel-brickback",1920,874,1955,874,1930,1000,1920,1000);
	DrawMaterialQuad("Tunnel-brickback",1920,1000,1930,1000,1970,1100,1960,1100);
	DrawMaterialQuad("Tunnel-brickback",1960,1100,1970,1100,1930,1201,1919,1201);
	
	DrawMaterialQuad("Tunnel-brickback",2549,907,2590,907,2590,920,2549,920);
	DrawMaterialQuad("Tunnel-brickback",2549,920,2560,920,2560,1000,2550,1000);
	DrawMaterialQuad("Tunnel-brickback",2550,1000,2560,1000,2720,1160,2710,1160);
	DrawMaterialQuad("Tunnel-brickback",2710,1160,2720,1160,2710,1190,2700,1190);
	DrawMaterialQuad("Tunnel-brickback",2680,1185,2750,1185,2750,1195,2680,1195);
	DrawMaterialQuad("Tunnel-brickback",2737,1195,2750,1190,2775,1255,2765,1255);
	
	AddEffect("DynamiteEruption",nil,100,130);
	return 1;
}
Example #7
0
protected func Initialize()
{
	// Environment 
	PlaceGrass(185);
	
	// Goal: Capture the flag, with bases in both hideouts.
	var goal = CreateObject(Goal_CaptureTheFlag, 0, 0, NO_OWNER);
	goal->SetFlagBase(1, 120, 502);
	goal->SetFlagBase(2, LandscapeWidth() - 120, 502);
	
	// Rules
	CreateObject(Rule_Restart);
	CreateObject(Rule_ObjectFade)->DoFadeTime(5 * 36);
	CreateObject(Rule_KillLogs);
	CreateObject(Rule_Gravestones);
	
	var lwidth = LandscapeWidth();
	
	// Doors and spinwheels.
	var gate, wheel;
	gate = CreateObjectAbove(StoneDoor, 364, 448, NO_OWNER);
	DrawMaterialQuad("Tunnel-brickback", 360, 446, 360, 448, 368, 448, 368, 446);
	gate->DoDamage(50);		// Upper doors are easier to destroy
	gate->SetAutoControl(1);
	gate = CreateObjectAbove(StoneDoor, 340, 584, NO_OWNER);
	DrawMaterialQuad("Tunnel-brickback", 336, 582, 336, 584, 344, 584, 344, 582);
	gate->SetAutoControl(1);
	gate = CreateObjectAbove(StoneDoor, 692, 544, NO_OWNER);
	DrawMaterialQuad("Tunnel-brickback", 688, 542, 688, 544, 696, 544, 696, 542);
	gate->DoDamage(80);		// Middle doors even easier
	wheel = CreateObjectAbove(SpinWheel, 660, 552, NO_OWNER);
	wheel->SetStoneDoor(gate);
	
	gate = CreateObjectAbove(StoneDoor, lwidth - 364, 448, NO_OWNER);
	DrawMaterialQuad("Tunnel-brickback", lwidth - 361, 446, lwidth - 361, 448, lwidth - 365, 448, lwidth - 365, 446);
	gate->DoDamage(50);		// Upper doors are easier to destroy
	gate->SetAutoControl(2);
	gate = CreateObjectAbove(StoneDoor, lwidth - 340, 584, NO_OWNER);
	DrawMaterialQuad("Tunnel-brickback", lwidth - 337, 582, lwidth - 337, 584, lwidth - 345, 584, lwidth - 345, 582);
	gate->SetAutoControl(2);
	gate = CreateObjectAbove(StoneDoor, lwidth - 692, 544, NO_OWNER);
	DrawMaterialQuad("Tunnel-brickback", lwidth - 689, 542, lwidth - 689, 544, lwidth - 697, 544, lwidth - 697, 542);
	gate->DoDamage(80);		// Middle doors even easier
	wheel = CreateObjectAbove(SpinWheel, lwidth - 660, 552, NO_OWNER);
	wheel->SetStoneDoor(gate);
	
	// Chests with weapons.
	var chest;
	chest = CreateObjectAbove(Chest, 110, 592, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillBaseChest", chest, 100, 6 * 36,nil,nil,true);
	chest = CreateObjectAbove(Chest, 25, 464, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillBaseChest", chest, 100, 6 * 36,nil,nil,false);
	chest = CreateObjectAbove(Chest, 730, 408, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillOtherChest", chest, 100, 6 * 36);
	chest = CreateObjectAbove(Chest, lwidth - 110, 592, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillBaseChest", chest, 100, 6 * 36,nil,nil,true);
	chest = CreateObjectAbove(Chest, lwidth - 25, 464, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillBaseChest", chest, 100, 6 * 36,nil,nil,false);
	chest = CreateObjectAbove(Chest, lwidth - 730, 408, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillOtherChest", chest, 100, 6 * 36);
	chest = CreateObjectAbove(Chest, lwidth/2, 512, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillSpecialChest", chest, 100, 4 * 36);
	
	/*
	// No Cannons
	// Cannons loaded with 12 shots.
	var cannon;
	cannon = CreateObjectAbove(Cannon, 429, 444, NO_OWNER);
	cannon->SetDir(DIR_Right);
	cannon->SetR(15);
	cannon->CreateContents(PowderKeg);
	cannon = CreateObjectAbove(Cannon, lwidth - 429, 444, NO_OWNER);
	cannon->SetDir(DIR_Left);
	cannon->SetR(-15);
	cannon->CreateContents(PowderKeg);
	*/

	return;
}