func Intro_Stop() { // Lava gets quiet after intro var lava = FindObject(Find_ID(BoilingLava)); if (lava) lava->SetIntensity(25); // if players got stuck somewhere, unstick them for (var i=0; i<GetPlayerCount(C4PT_User); ++i) { var plr = GetPlayerByIndex(i, C4PT_User); var crew = GetCrew(plr); if (crew && !Inside(crew->GetX(),125,170)) { crew->SetPosition(135+Random(25), 860); } crew->Extinguish(); crew->DoEnergy(100); } this.dialogue->SetInteraction(true); this.dialogue->AddAttention(); SetPlayerZoomByViewRange(NO_OWNER, 400,300, PLRZOOM_Set); // Turn and relocate the airplane to make starting it easier. var plane = FindObject(Find_ID(Airplane)); if (plane) { plane->FaceLeft(); plane->SetR(-90); plane->SetPosition(1387, 345); } return true; }
func Intro_1() { MessageBox_last_pos = true; // force first message right side of screen MessageBoxAll("$Intro1$", GetHero(), true); // finally there SetPlayerZoomByViewRange(NO_OWNER, 500,300, PLRZOOM_Set | PLRZOOM_LimitMax); return ScheduleNext(150); }
func InitializePlayer(int plr, int iX, int iY, object pBase, int iTeam) { //SpawnPlayer(plr); SetPlayerZoomByViewRange(plr, 700, 0, PLRZOOM_Direct); //SetPlayerZoomByViewRange(plr, 700, 0, PLRZOOM_Direct); return; }
func Intro_1() { SetPlayerZoomByViewRange(NO_OWNER, 800,600, PLRZOOM_Set); MessageBoxAll("$MsgIntro1$", this.pilot, true); this.plane->ContainedLeft(this.pilot); return ScheduleNext(10); }
func InitializePlayer(int plr) { // Harsh zoom range for (var flag in [PLRZOOM_LimitMax, PLRZOOM_Direct]) SetPlayerZoomByViewRange(plr,500,350,flag); SetPlayerViewLock(plr, true); // First player init base if (!g_was_player_init) { InitBase(plr); g_was_player_init = true; } // Position and materials var i, crew; for (i=0; crew=GetCrew(plr,i); ++i) { crew->SetPosition(100+Random(80), 192-10); crew->CreateContents(Shovel); if (!i) { crew->CreateContents(Hammer); } else if (i==1) { crew->CreateContents(Axe); } } return true; }
func Attack_9() { Attack_ClonkDirs(); SetPlayerZoomByViewRange(NO_OWNER, 200,100, PLRZOOM_Set | PLRZOOM_LimitMax); SetViewTarget(npc_newton); return ScheduleNext(40); }
func Intro_Stop() { this.dialogue->SetInteraction(true); this.dialogue->AddAttention(); this.dialogue->Dlg_Pyrit_StartHammering(npc_pyrit); SetPlayerZoomByViewRange(NO_OWNER, 400,300, PLRZOOM_Set); g_goal = CreateObject(Goal_TreasureHunt, 0, 0); return true; }
func Attack_Start(chopping_clonk) { this.hero = chopping_clonk; g_attack_started = true; SetPlayerZoomByViewRange(NO_OWNER, 200,100, PLRZOOM_Set | PLRZOOM_LimitMax); SetViewTarget(chopping_clonk); MessageBox_last_pos = true; // force first message right side of screen MessageBoxAll("$Attack1$", this.hero, true); // tree down return ScheduleNext(30); }
func Outro_Start(object plane) { // Player closest to plane becomes outro protagonist this.plane = plane; this.hero = plane->FindObject(Find_ID(Clonk), Find_Not(Find_Owner(NO_OWNER)), plane->Sort_Distance()); SetPlayerZoomByViewRange(NO_OWNER, 200,100, PLRZOOM_Set | PLRZOOM_LimitMax); SetViewTarget(this.hero); npc_pyrit.has_sequence = true; // Pyrit stops hammering return ScheduleNext(5); }
func Intro_Start(object flagpole) { // Intro starts at flagpole; some time before plane drops this.flagpole = flagpole; SetViewTarget(this.flagpole); SetPlayerZoomByViewRange(NO_OWNER, 800,600, PLRZOOM_Set); // zoom out from plane return ScheduleNext(80); }
func Outro_Start(object plane) { // Player closest to plane becomes outro protagonist this.plane = plane; GetHero(npc_pyrit); SetPlayerZoomByViewRange(NO_OWNER, 200,100, PLRZOOM_Set | PLRZOOM_LimitMax); SetViewTarget(GetHero()); npc_pyrit.has_sequence = true; // Pyrit stops hammering this.plane->SetR(90); // in case Pyrit isn't done yet this.plane.MeshTransformation=Airplane.MeshTransformation; var max_unstick = 10; while (this.plane->Stuck() && max_unstick--) this.plane->SetPosition(this.plane->GetX(), this.plane->GetY()-1); return ScheduleNext(5); }
func Intro_Start(object hero) { this.hero = hero; this.plane->StartInstantFlight(90, 15); SetViewTarget(this.pilot); SetPlayerZoomByViewRange(NO_OWNER, 200,100, PLRZOOM_Set); // zoom out from plane // Lava goes crazy during the intro var lava = FindObject(Find_ID(BoilingLava)); if (lava) lava->SetIntensity(500); return ScheduleNext(80); }
func Attack_Stop() { g_attack_done = true; // Remove AI planes for (var i=0; i<3; ++i) { if (this.planes[i]) this.planes[i]->RemoveObject(); } // Newton gives the next quest Dialogue->FindByTarget(npc_newton)->AddAttention(); g_goal->SetStageNewton(); // revert to regular zoom SetPlayerZoomByViewRange(NO_OWNER, 400,300, PLRZOOM_Set | PLRZOOM_LimitMax); return true; }
func InitializePlayer(int plr) { // Players only if (GetPlayerType(plr)!=C4PT_User) return; // Scenario init if (!g_is_initialized) g_is_initialized = DoInit(plr); // Harsh zoom range for (var flag in [PLRZOOM_LimitMax, PLRZOOM_Direct]) SetPlayerZoomByViewRange(plr,400,250,flag); SetPlayerViewLock(plr, true); // Create per-player-counted tools if (g_max_player_num < GetPlayerCount(C4PT_User)) { ++g_max_player_num; for (var obj in FindObjects(Find_ID(Chest))) if (obj.tool_spawn) obj->CreateContents(obj.tool_spawn); }
func InitializePlayer(int plr) { // Players only if (GetPlayerType(plr)!=C4PT_User) return; // Scenario init if (!g_is_initialized) g_is_initialized = DoInit(plr); // Harsh zoom range for (var flag in [PLRZOOM_LimitMax, PLRZOOM_Direct]) SetPlayerZoomByViewRange(plr,400,250,flag); SetPlayerViewLock(plr, true); // Initial join var crew = GetCrew(plr); crew->SetPosition(35 + Random(10) , 1140); crew->SetDir(DIR_Right); crew->CreateContents(Shovel); crew->CreateContents(Hammer); crew->CreateContents(Axe); return true; }
global func IntroAddPlayer(int plr) { var effect = GetEffect("IntIntro"); if(!effect) return false; if(effect.Time > 30) return false; var crew; for(var index = 0; crew = GetCrew(plr, index); ++index) { var skin = crew->GetCrewExtraData("Skin"); if (skin == nil) skin = GetPlrClonkSkin(plr); var container = effect.Cabin->CreateContents(Clonk); container->SetOwner(plr); if(skin != nil) container->SetSkin(skin); container->SetName(crew->GetName()); container->SetAction("Walk"); crew->Enter(container); container.ActMap = { Prototype = Clonk.ActMap }; container.ActMap.Walk = { Prototype = Clonk.ActMap.Walk, Decel = 100 }; container.ActMap.Jump = { Prototype = Clonk.ActMap.Jump, Speed = 0, Accel = 0 }; container.JumpSpeed = 0; SetPlrView(plr, crew); SetPlayerViewLock(plr, true); SetPlayerZoomByViewRange(plr, 320, 240); container->SetCommand("None", container); crew->SetCommand("None", crew); // Give everyone but the first player a shovel -- the first // player's shovel can be found in the valley if(GetLength(effect.Players) != 0) crew->CreateContents(Shovel); effect.Players[GetLength(effect.Players)] = crew; } return true; }
func Attack_4() { SetViewTarget(this.planes[0]); SetPlayerZoomByViewRange(NO_OWNER, 600,500, PLRZOOM_Set | PLRZOOM_LimitMax); return ScheduleNext(50); }
func Intro_Start(object hero) { SetPlayerZoomByViewRange(NO_OWNER, 200,100, PLRZOOM_Set | PLRZOOM_LimitMax); SetViewTarget(hero); return ScheduleNext(5); }