From ca582692d49f08c05f3972ff3685bae7d03bcaeb Mon Sep 17 00:00:00 2001 From: Sven Eberhardt Date: Fri, 12 Sep 2014 01:01:12 +0200 Subject: [PATCH] Missions storyline expanded to Deep Sea Mining. Added short intro in extra section. Also adjusted icons, NextMission and MissionAccess in some scenarios and added a split marker between missions within and missions outside the connected storyline. --- planet/Missions.ocf/Crash.ocs/Scenario.txt | 2 +- planet/Missions.ocf/Crash.ocs/Script.c | 6 + .../Crash.ocs/System.ocg/SeqIntro.c | 10 +- .../Missions.ocf/DarkCastle.ocs/Scenario.txt | 3 +- planet/Missions.ocf/DarkCastle.ocs/Script.c | 8 +- planet/Missions.ocf/DeepSeaMining.ocs/Map.c | 4 + .../DeepSeaMining.ocs/Scenario.txt | 5 +- .../Missions.ocf/DeepSeaMining.ocs/Script.c | 151 +++------- .../DeepSeaMining.ocs/SectIntro.ocg/Map.bmp | Bin 0 -> 4646 bytes .../SectIntro.ocg/Scenario.txt | 5 + .../DeepSeaMining.ocs/StringTblDE.txt | 9 +- .../DeepSeaMining.ocs/StringTblUS.txt | 9 +- .../DeepSeaMining.ocs/System.ocg/DlgTuesday.c | 48 ++++ .../DeepSeaMining.ocs/System.ocg/SeqIntro.c | 269 ++++++++++++++++++ .../DeepSeaMining.ocs/System.ocg/SeqOutro.c | 106 +++++++ .../System.ocg/StringTblDE.txt | 48 ++++ .../System.ocg/StringTblUS.txt | 47 +++ planet/Missions.ocf/Raid.ocs/Scenario.txt | 1 + planet/Missions.ocf/SPLIT.ocs/Info.txt | 1 + planet/Missions.ocf/SPLIT.ocs/Scenario.txt | 5 + .../TreasureHunt.ocs/Scenario.txt | 5 +- planet/Missions.ocf/TreasureHunt.ocs/Script.c | 8 + .../Helpers.ocd/Sequence.ocd/Script.c | 78 ++++- 23 files changed, 683 insertions(+), 145 deletions(-) create mode 100644 planet/Missions.ocf/DeepSeaMining.ocs/SectIntro.ocg/Map.bmp create mode 100644 planet/Missions.ocf/DeepSeaMining.ocs/SectIntro.ocg/Scenario.txt create mode 100644 planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/DlgTuesday.c create mode 100644 planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/SeqIntro.c create mode 100644 planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/SeqOutro.c create mode 100644 planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/StringTblDE.txt create mode 100644 planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/StringTblUS.txt create mode 100644 planet/Missions.ocf/SPLIT.ocs/Info.txt create mode 100644 planet/Missions.ocf/SPLIT.ocs/Scenario.txt diff --git a/planet/Missions.ocf/Crash.ocs/Scenario.txt b/planet/Missions.ocf/Crash.ocs/Scenario.txt index 54f362f79..9308dd44e 100644 --- a/planet/Missions.ocf/Crash.ocs/Scenario.txt +++ b/planet/Missions.ocf/Crash.ocs/Scenario.txt @@ -1,5 +1,5 @@ [Head] -Icon=37 +Icon=23 Title=Crash Version=5,2,90,20 Difficulty=30 diff --git a/planet/Missions.ocf/Crash.ocs/Script.c b/planet/Missions.ocf/Crash.ocs/Script.c index 995d2c2c4..c2473117f 100644 --- a/planet/Missions.ocf/Crash.ocs/Script.c +++ b/planet/Missions.ocf/Crash.ocs/Script.c @@ -7,6 +7,12 @@ static g_is_initialized, g_has_bought_plans, npc_pyrit; +func Initialize() +{ + SetNextMission("Mission.ocf/DeepSeaMining.ocs"); + return true; +} + func DoInit(int first_player) { CreateObject(Windmill, 152, 825+48, 0); diff --git a/planet/Missions.ocf/Crash.ocs/System.ocg/SeqIntro.c b/planet/Missions.ocf/Crash.ocs/System.ocg/SeqIntro.c index abb145a0a..61032f070 100644 --- a/planet/Missions.ocf/Crash.ocs/System.ocg/SeqIntro.c +++ b/planet/Missions.ocf/Crash.ocs/System.ocg/SeqIntro.c @@ -82,7 +82,7 @@ func Intro_4() func Intro_5() { - MessageBoxAll("$MsgIntro2$", this.hero, true); + MessageBoxAll("$MsgIntro2$", GetHero(), true); return ScheduleNext(36); } @@ -136,7 +136,7 @@ func Intro_13() func Intro_14() { - MessageBoxAll("$MsgIntro4$", this.hero, true); + MessageBoxAll("$MsgIntro4$", GetHero(), true); return ScheduleNext(20); } @@ -199,8 +199,8 @@ func Intro_19() func Intro_20() { - this.hero->SetDir(DIR_Left); - MessageBoxAll("$MsgIntro7$", this.hero, true); // what now? + GetHero()->SetDir(DIR_Left); + MessageBoxAll("$MsgIntro7$", GetHero(), true); // what now? return ScheduleNext(150); } @@ -218,7 +218,7 @@ func Intro_22() func Intro_23() { - MessageBoxAll("$MsgIntro10$", this.hero, true); // ok + MessageBoxAll("$MsgIntro10$", GetHero(), true); // ok return ScheduleNext(40); } diff --git a/planet/Missions.ocf/DarkCastle.ocs/Scenario.txt b/planet/Missions.ocf/DarkCastle.ocs/Scenario.txt index ebc897f2b..bff532818 100644 --- a/planet/Missions.ocf/DarkCastle.ocs/Scenario.txt +++ b/planet/Missions.ocf/DarkCastle.ocs/Scenario.txt @@ -2,8 +2,9 @@ Icon=36 Title=DarkCastle Version=5,3,90 -Difficulty=75 +Difficulty=45 NoInitialize=true +MissionAccess=S2Treasure [Definitions] Definition1=Objects.ocd diff --git a/planet/Missions.ocf/DarkCastle.ocs/Script.c b/planet/Missions.ocf/DarkCastle.ocs/Script.c index 2269d13c0..be498cee4 100644 --- a/planet/Missions.ocf/DarkCastle.ocs/Script.c +++ b/planet/Missions.ocf/DarkCastle.ocs/Script.c @@ -137,4 +137,10 @@ func ShroomCaveCheck() Dialogue->MessageBoxAll("$MsgEncounterShrooms$", intruder, true); ClearScheduleCall(nil, Scenario.ShroomCaveCheck); return true; -} \ No newline at end of file +} + +func OnGameOver() +{ + GainMissionAccess("S2Castle"); + return true; +} diff --git a/planet/Missions.ocf/DeepSeaMining.ocs/Map.c b/planet/Missions.ocf/DeepSeaMining.ocs/Map.c index 73904022d..2e926e0e5 100644 --- a/planet/Missions.ocf/DeepSeaMining.ocs/Map.c +++ b/planet/Missions.ocf/DeepSeaMining.ocs/Map.c @@ -13,9 +13,13 @@ static main_island_x, main_island_y; static goal_platform_x, goal_platform_y; +// set after intro to force map creation +static g_intro_done; + // Called be the engine: draw the complete map here. public func InitializeMap(proplist map) { + if (!g_intro_done) return true; Resize(300,400); this.sea_y = 50; this.ground_y = 350; diff --git a/planet/Missions.ocf/DeepSeaMining.ocs/Scenario.txt b/planet/Missions.ocf/DeepSeaMining.ocs/Scenario.txt index 62e1d6381..21b9d292f 100644 --- a/planet/Missions.ocf/DeepSeaMining.ocs/Scenario.txt +++ b/planet/Missions.ocf/DeepSeaMining.ocs/Scenario.txt @@ -2,7 +2,8 @@ Title=DeepSeaMining Icon=31 Version=5,3,0,0 -Difficulty=40 +Difficulty=30 +MissionAccess=S2Crash [Definitions] Definition1=Objects.ocd @@ -41,7 +42,7 @@ BaseMaterial=Clonk=25;Bread=25; BaseProduction=Clonk=25;Bread=25; [Landscape] -Sky=Clouds1 +Sky=Clouds2 TopOpen=1 BottomOpen=0 AutoScanSideOpen=1 diff --git a/planet/Missions.ocf/DeepSeaMining.ocs/Script.c b/planet/Missions.ocf/DeepSeaMining.ocs/Script.c index 66ae14d2d..33da8f91b 100644 --- a/planet/Missions.ocf/DeepSeaMining.ocs/Script.c +++ b/planet/Missions.ocf/DeepSeaMining.ocs/Script.c @@ -11,7 +11,9 @@ static goal_platform_x, goal_platform_y; static const SCEN_TEST = false; -protected func Initialize() +static g_is_initialized, g_is_in_intro, g_intro_done, npc_tuesday, g_tuesday_pos; + +protected func PostIntroInitialize() { // Construction site on goal platform var goal_site = CreateObject(ConstructionSite, goal_platform_x+10, goal_platform_y+3); @@ -35,16 +37,38 @@ protected func Initialize() InitVegetation(); InitAnimals(); InitMainIsland(); - + + // NPC + g_tuesday_pos = FindMainIslandPosition(0, 100, true); + npc_tuesday = CreateObject(Clonk, g_tuesday_pos[0]+20, g_tuesday_pos[1]-10); + npc_tuesday->SetDir(DIR_Left); + npc_tuesday->SetColor(0x804000); + npc_tuesday->SetName("$Tuesday$"); + + SetNextMission("Mission.ocf/TreasureHunt.ocs"); + return; } +func DoInit(int first_player) +{ + StartSequence("Intro", 0, GetCrew(first_player)); + return true; +} + protected func InitializePlayer(int plr) { + // intro has its own initialization + if (g_is_in_intro) return true; + // Harsh zoom range SetPlayerZoomByViewRange(plr, 500, 350, PLRZOOM_LimitMax); SetPlayerZoomByViewRange(plr, 500, 350, PLRZOOM_Direct); SetPlayerViewLock(plr, true); + + // Intro + if (!g_is_initialized) g_is_initialized = DoInit(plr); + if (!g_intro_done) return true; // Position and materials var i, crew; @@ -69,9 +93,6 @@ protected func InitializePlayer(int plr) // Should be done in OnOwnerChanged? It doesn't happen ATM. RedrawAllFlagRadiuses(); - - // Goal message for intro - Dialogue->MessageBox("$MsgIntro$", GetCursor(plr), GetCrew(plr), plr, true); // oh no we're stranded! return; } @@ -240,7 +261,7 @@ private func FindMainIslandPosition(int xpos, int sep, bool no_struct) if (GetMaterial(x,y) == Material("Brick")) continue; // not on goal platform - if (!no_struct || !FindObject(Find_Or(Find_Category(C4D_Structure), Find_Func("IsFlagpole")), Find_Distance(60, x, y))) + if (!no_struct || !FindObject(Find_Or(Find_Category(C4D_Structure), Find_Func("IsFlagpole"), Find_ID(WindGenerator)), Find_Distance(60, x, y))) break; } @@ -253,116 +274,22 @@ private func FindMainIslandPosition(int xpos, int sep, bool no_struct) // Goal fulfilled public func OnGoalsFulfilled() { - var outro = {}; - outro.communicator = FindObject(Find_Func("IsCrystalCommunicator")); - if (!outro.communicator) return false; // what? - // Stop Clonks and disable player controls - Dialogue->StartCinematics(outro.communicator); - // Outro - ScheduleCall(nil, this.Fade2Darkness, 15, 32, {}); - Dialogue->MessageBoxAll("$MsgOutro1$", GetOutroTalker(outro), true); // ok turn it on - ScheduleCall(nil, Scenario.Outro0, 100, 1, outro); + GainMissionAccess("S2Sea"); + StartSequence("Outro", 0); // Return true to force goal rule to not call GameOver() yet return true; } -private func Outro0(proplist outro) -{ - outro.communicator->StartCommunication(); // 250 frames - ScheduleCall(nil, Scenario.Outro1, 650, 1, outro); -} -private func Outro1(proplist outro) -{ - Dialogue->MessageBoxAll("$MsgOutro2$", GetOutroTalker(outro), true); // let's see if it works - ScheduleCall(nil, Scenario.Outro2, 50, 1, outro); -} +// Intro helper -private func Outro2(proplist outro) +global func Particles_Smoke(...) { - outro.communicator->SendCode("...---..."); // 159 frames - return ScheduleCall(nil, Scenario.Outro3, 200, 1, outro); -} - -private func Outro3(proplist outro) -{ - outro.communicator->StopCommunication(); - Dialogue->MessageBoxAll("$MsgOutro3$", GetOutroTalker(outro), true); // i wonder if anyone has heard us - outro.plane = CreateObject(Plane, 100, main_island_y-100); - outro.plane->SetContactDensity(85); // only collision with brick for proper landing - outro.pilot = CreateObject(Clonk, 100, 100); - outro.pilot->MakeInvincible(); - outro.pilot->SetSkin(2); - outro.pilot->Enter(outro.plane); - outro.pilot->SetAction("Walk"); - outro.pilot->SetName("$NamePilot$"); - outro.pilot->SetColor(RGB(55, 65, 75)); - outro.pilot->SetDir(DIR_Right); - outro.plane->FaceRight(); - outro.plane->StartInstantFlight(90, 15); - return ScheduleCall(nil, Scenario.Outro4, 5, 99999999, outro); -} - -private func Outro4(proplist outro) -{ - // Wait for plane to arrive - if (outro.plane->GetX() < outro.communicator->GetX() - 200) return true; - ClearScheduleCall(nil, Scenario.Outro4); - // Plane in range! Ensure players see it. - SetPlayerZoomByViewRange(NO_OWNER, 500, 350, PLRZOOM_Direct); - Dialogue->MessageBoxAll("$MsgOutro4$", outro.pilot, true); // hey, our friends! - return ScheduleCall(nil, Scenario.Outro5, 100, 1, outro); -} - -private func Outro5(proplist outro) -{ - Dialogue->MessageBoxAll("$MsgOutro5$", GetOutroTalker(outro), true); // we're saved! - outro.plane->StartInstantFlight(245, 15); - outro.plane->SetContactDensity(C4M_Solid); - return ScheduleCall(nil, Scenario.Outro6, 60, 1, outro); -} - -private func Outro6(proplist outro) -{ - outro.plane->StartInstantFlight(280, 5); - return ScheduleCall(nil, Scenario.Outro7, 15, 1, outro); -} - -private func Outro7(proplist outro) -{ - outro.plane->CancelFlight(); - return ScheduleCall(nil, Scenario.Outro8, 40, 1, outro); -} - -private func Outro8(proplist outro) -{ - outro.pilot->Exit(); - Dialogue->MessageBoxAll("$MsgOutro6$", outro.pilot, true); // hop on everyone! - return ScheduleCall(nil, Scenario.Outro9, 100, 1, outro); -} - -private func Outro9(proplist outro) -{ - // Reenable crew in case players want to continue playing after round - outro.plane->FaceRight(); - Dialogue->StopCinematics(); - return ScheduleCall(nil, Scenario.Outro10, 100, 1, outro); -} - -private func Outro10(proplist outro) -{ - Sound("Fanfare"); - return GameOver(); -} - -private func Fade2Darkness(proplist v) -{ - v.t += 8; - var fade_val = Max(0xff-v.t); - SetSkyAdjust(RGB(fade_val,fade_val,fade_val)); -} - -private func GetOutroTalker(outro) -{ - return outro.communicator->FindObject(Find_ID(Clonk), Find_OCF(OCF_Alive), outro.communicator->Sort_Distance()); -} + var p = inherited(...); + if (g_intro_sky_moving) + { + p.ForceX = -300; + p.DampingX = 800; + } + return p; +} \ No newline at end of file diff --git a/planet/Missions.ocf/DeepSeaMining.ocs/SectIntro.ocg/Map.bmp b/planet/Missions.ocf/DeepSeaMining.ocs/SectIntro.ocg/Map.bmp new file mode 100644 index 0000000000000000000000000000000000000000..2c28be1e6900d5acd0fbe49c02bb1c233741c226 GIT binary patch literal 4646 zcmeH`KWi016vdB@j2RtS7+F|-poL&U^hF`0k;seBA~x}fjfF-06N`Y5h=Gt8k`PhB zCLj?@yCBAIpx9dp`2sd}f)H6FkbzWV&lA?fhJKa0Z{PU@J9r9gAro`J#SF{Of#qG@xHuvMuKVJ)_CNSV%<5)$7`&_5F3fIf5d9`Eu4ma&W)az<2^UOL?2ep6w)|j1IWoS@Rnt+`MCw% zd;CP!T3vhnLDSRIdieH>mfw8_8$0y8EZh+<-W3Zj@Y|d7%;EHL>k+-jc&VR1zN>P~ zR}^Zuht%#LkSUx@eOA#2bHi7X9|=op#81&nQSHd)zHTt*D36m9bLdhO6}*LZsAI`9 z4lXzgVvd-lPsjW*t138WIr=PfW(S+2s4+<#ha4wQT~p8D!O~yk;4G(L4!>hwZ|T5# zW=!DEsp;Tib{?3tj{kxBp1K}g0<%S==PbriL<#;U@Eynh4*sXa1K1QT9hfv?@P7vX zJ^4NS5BQ%Fo5BBt`2+kt{O{oZB>tbl{~rFo#D9;@>-gWpe@Fi*_yo=l{%7Q^;D2CV zN4*69Jz8Yc3C!L?__f6at>C{SZxa7!@c$Y9ui$?Ip97QPP0DwM-Wl^-?ovRnPxv3; z+kUkMCo_ZF#s7F?J(zC)kVe}B=wsR2h-V-Ft2`X7s3G_B^tTB*Yo11dMuA3wMuA3wMuA3wMuA3wMuA3w JMuGoLf#04SEvoMakeInvincible(); + this.pilot->MakeNonFlammable(); + this.pilot->SetSkin(2); + 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.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); +} + +func Intro_PlaneTimer(...) +{ + // Plane flight overload: Just move sky and have plane do turbulent movement during initial part of intro + var rv = Call(Plane.FxIntPlaneTimer, ...); + if (g_intro_sky_moving) + { + if (!Random(4)) this.rdir = BoundBy((80+Random(21)-GetR())/5,-1,1); + SetXDir(); SetYDir(GetR()*2-GetY()+Random(5),10); + } + return rv; +} + +func Intro_JoinPlayer(int plr) +{ + if (g_intro_done) return false; // too late for join - just join on island + for(var index = 0, crew; crew = GetCrew(plr, index); ++index) crew->Enter(this); + return true; +} + +func Intro_1() +{ + MessageBoxAll("$Intro1$", GetHero(), true); // y clouds? + return ScheduleNext(200); +} + +func Intro_2() +{ + MessageBoxAll("$Intro2$", this.pilot, true); // cuz u told me + return ScheduleNext(300); +} + +func Intro_3() +{ + MessageBoxAll("$Intro3$", GetHero(), true); // 2 turbulent + return ScheduleNext(200); +} + +func Intro_4() +{ + MessageBoxAll("$Intro4$", this.pilot, true); // cuz condensation + return ScheduleNext(380); +} + +func Intro_5() +{ + MessageBoxAll("$Intro5$", GetHero(), true); // go lower now + return ScheduleNext(300); +} + +func Intro_6() +{ + MessageBoxAll("$Intro6$", this.pilot, true); // fuk u + return ScheduleNext(450); +} + +func Intro_7() +{ + MessageBoxAll("$Intro7$", this.pilot, true); // u fly + return ScheduleNext(200); +} + +func Intro_8() +{ + MessageBoxAll("$Intro8$", GetHero(), true); // ... + return ScheduleNext(100); +} + +func Intro_9() +{ + MessageBoxAll("$Intro9$", GetHero(), true); // ok + return ScheduleNext(150); +} + +func Intro_10() +{ + g_intro_sky_moving = false; + this.plane.rdir = 0; + this.plane->StartInstantFlight(this.plane->GetR(), 15); + MessageBoxAll("$Intro10$", GetHero(), true); // aaaah + for (var i=0,plr; iExit(); + crew->SetPosition(this.plane->GetX()+10, this.plane->GetY()); + crew->SetAction("Tumble"); + if (!index) SetPlrView(plr, crew); + } + } + SetViewTarget(); + return ScheduleNext(200, 11); +} + +func Intro_11() +{ + g_intro_done = true; + LoadScenarioSection("main"); + SetWind(0); + SetSkyParallax(0, 20, 20, 0, 0); + GameCall("PostIntroInitialize"); + for (var i=0,plr; iSetPosition(g_tuesday_pos[0],-100); + crew->SetXDir(-10); crew->SetYDir(-30); + if (!index) SetPlrView(plr, crew); + } + } + return ScheduleNext(200, 20); +} + +func Intro_20() +{ + MessageBoxAll("$Intro20$", GetHero(), true); // ouch + for (var i=0,plr; iSetCommand("MoveTo", nil, g_tuesday_pos[0]-15+Random(20), g_tuesday_pos[1]); + } + } + return ScheduleNext(300); +} + +func Intro_21() +{ + Dialogue->SetSpeakerDirs(npc_tuesday, GetHero()); + MessageBoxAll("$Intro21$", npc_tuesday, true); // hi friend + return ScheduleNext(300); +} + +func Intro_22() +{ + MessageBoxAll("$Intro22$", GetHero(), true); // where is plane? + return ScheduleNext(300); +} + +func Intro_23() +{ + MessageBoxAll("$Intro23$", npc_tuesday, true); // 2 cloudy 4 plane + return ScheduleNext(350); +} + +func Intro_24() +{ + MessageBoxAll("$Intro24$", GetHero(), true); // but i need plane + return ScheduleNext(250); +} + +func Intro_25() +{ + MessageBoxAll("$Intro25$", npc_tuesday, true); // u stay here + return ScheduleNext(300); +} + +func Intro_26() +{ + MessageBoxAll("$Intro26$", GetHero(), true); // make fire? + return ScheduleNext(300); +} + +func Intro_27() +{ + MessageBoxAll("$Intro27$", npc_tuesday, true); // fire sux + return ScheduleNext(400); +} + +func Intro_28() +{ + MessageBoxAll("$Intro28$", npc_tuesday, true); // use communicator + return ScheduleNext(300); +} + +func Intro_29() +{ + MessageBoxAll("$Intro29$", GetHero(), true); // ok. where? + return ScheduleNext(250); +} + +func Intro_30() +{ + MessageBoxAll("$Intro30$", npc_tuesday, true); // not built yet + return ScheduleNext(450); +} + +func Intro_31() +{ + MessageBoxAll("$Intro31$", npc_tuesday, true); // go east and finish it with metal+gems + return ScheduleNext(400); +} + +func Intro_32() +{ + MessageBoxAll("$Intro32$", GetHero(), true); // where gems? + return ScheduleNext(250); +} + +func Intro_33() +{ + MessageBoxAll("$Intro33$", npc_tuesday, true); // fish say gems in sea + return ScheduleNext(400); +} + +func Intro_34() +{ + MessageBoxAll("$Intro34$", GetHero(), true); // fish talk? + return ScheduleNext(150); +} + +func Intro_35() +{ + MessageBoxAll("$Intro35$", npc_tuesday, true); // coconut talk! + return ScheduleNext(200); +} + +func Intro_36() +{ + MessageBoxAll("$Intro36$", GetHero(), true); // ok... + return ScheduleNext(150); +} + +func Intro_37() +{ + npc_tuesday->SetDialogue("Tuesday", true); + return Stop(); +} diff --git a/planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/SeqOutro.c b/planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/SeqOutro.c new file mode 100644 index 000000000..907fe57ba --- /dev/null +++ b/planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/SeqOutro.c @@ -0,0 +1,106 @@ +#appendto Sequence + +func Outro_Start() +{ + this.communicator = FindObject(Find_Func("IsCrystalCommunicator")); + if (!this.communicator) return false; // what? + this.hero = this.communicator->FindObject(Find_ID(Clonk), Find_OCF(OCF_Alive), this.communicator->Sort_Distance()); + SetViewTarget(this.communicator); + // Outro + ScheduleCall(nil, this.Outro_Fade2Darkness, 15, 32, {}); + Dialogue->MessageBoxAll("$Outro1$", this.hero, true); // ok turn it on + return ScheduleNext(100); +} + +func Outro_0() +{ + this.communicator->StartCommunication(); // 250 frames + return ScheduleNext(650); +} + +func Outro_1() +{ + Dialogue->MessageBoxAll("$Outro2$", this.hero, true); // let's see if it works + return ScheduleNext(50); +} + +func Outro_2() +{ + this.communicator->SendCode("...---..."); // 159 frames + return ScheduleNext(200); +} + +func Outro_3() +{ + this.communicator->StopCommunication(); + MessageBoxAll("$Outro3$", this.hero, true); // i wonder if anyone has heard us + this.plane = CreateObject(Plane, 100, main_island_y-100); + this.plane->SetContactDensity(85); // only collision with brick for proper landing + this.pilot = CreateObject(Clonk, 100, 100); + 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->SetDir(DIR_Right); + this.plane->FaceRight(); + this.plane->StartInstantFlight(90, 15); + return ScheduleNext(5); +} + +func Outro_4() +{ + // Wait for plane to arrive + if (this.plane->GetX() < this.communicator->GetX() - 200) return ScheduleSame(5); + // Plane in range! Ensure players see it. + SetPlayerZoomByViewRange(NO_OWNER, 500, 350, PLRZOOM_Direct | PLRZOOM_LimitMax); + MessageBoxAll("$Outro4$", this.pilot, true); // hey, our friends! + return ScheduleNext(100); +} + +func Outro_5() +{ + MessageBoxAll("$Outro5$", this.hero, true); // we're saved! + this.plane->StartInstantFlight(245, 15); + this.plane->SetContactDensity(C4M_Solid); + return ScheduleNext(60); +} + +func Outro_6() +{ + this.plane->StartInstantFlight(280, 5); + return ScheduleNext(15); +} + +func Outro_7() +{ + this.plane->CancelFlight(); + return ScheduleNext(40); +} + +func Outro_8() +{ + this.pilot->Exit(); + MessageBoxAll("$Outro6$", this.pilot, true); // hop on everyone! + return ScheduleNext(100); +} + +func Outro_9() +{ + this.plane->FaceRight(); + return ScheduleNext(100); +} + +func Outro_10() +{ + Sound("Fanfare"); + return GameOver(); +} + +func Outro_Fade2Darkness(proplist v) +{ + v.t += 8; + var fade_val = Max(0xff-v.t); + SetSkyAdjust(RGB(fade_val,fade_val,fade_val)); +} diff --git a/planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/StringTblDE.txt b/planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/StringTblDE.txt new file mode 100644 index 000000000..398bfa993 --- /dev/null +++ b/planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/StringTblDE.txt @@ -0,0 +1,48 @@ +Intro1=Pyrit, warum müssen wir in den Wolken fliegen? +Intro2=Du sagtest, wir sollen höher fliegen, nachdem wir fast im Vulkan gelandet waren. +Intro3=Es ist schrecklich turbulent hier. +Intro4=Das liegt daran, dass die Kondensation des Wassers in den Wolken Wärme freisetzt, die die Luft weiter aufsteigen lässt. +Intro5=Danke für den Vortrag. Können wir nun bitte tiefer fliegen? +Intro6=Erst ist es zu turbulent wenn ich tief fliege. Nun ist es zu turbulent wenn ich hoch fliege. +Intro7=Warum steuerst du das Flugzeug nicht einfach selber? +Intro8=... +Intro9=Okay. Wir tauschen Plätze! +Intro10=Aaaah + +Intro20=Autsch. +Intro21=Oh. Ein Freund ist vom Himmel gefallen. Hallo Freund! Mein Name ist Dienstag. +Intro22=Verdammt. Hast du unser Flugzeug gesehen? Ich bin versehentlich raus gefallen. +Intro23=Der Himmel ist hier stets bewölkt. Wir sehen kein Flugzeug und kein Flugzeug sieht uns. +Intro24=Ugh. Aber Pyrit muss uns irgendwie finden. +Intro25=Was auf der Insel strandet bleibt auf der Insel. Genau wie ich. +Intro26=Könnten wir nicht ein Feuer machen oder so? +Intro27=Feuer? Das wird nicht helfen. Kokosnussholz brennt schlecht und das Feuer würde durch die Wolken eh keiner sehen. +Intro28=Aber...wir könnten meinen Kristallkommunikator benutzen! +Intro29=Klingt gut. Wo steht der? +Intro30=Ich bin glücklich auf meiner Insel. Warum sollte ich ein Kommunikationsgerät bauen? Ich habe die Pläne fertig, aber mich nie bemüht es auch zu bauen. +Intro31=Die Baustelle und die Pläne befinden sich am Östlichen Ende dieser Insel. Du brauchst nur etwas Metall und ein paar Edelsteine. +Intro32=Metall klingt einfach. Aber wo finde ich Edelsteine? +Intro33=Die Fische sprechen manchmal über blityende Edelsteine tief unten im Meer. Vielleicht kannst du die abbauen? +Intro34=Fische sprechen mit dir? +Intro35=Wenn du nur zuhörst, sprechen sogar die Kokosnüsse! +Intro36=Okay...ich schaue mal nach der Baustelle. + +Tuesday1=Hallo, Freund. Wie kann ich dir helfen? +TuesdayQCommunicator=Wie benutze ich den Kommunikator? +TuesdayACommunicator=Bringe einfach das nötige Material zur Baustelle. Es wird automatisch funktionieren, wenn du es fertig stellst. +TuesdayQGems=Wo finde ich Edelsteine? +TuesdayAGems=Tauche ins Meer hinein. Die größten Schätze lagern tief unten und sind schwer erreichbar. +TuesdayQFish=Kannst du die Fische weg schicken? +TuesdayAFish=Ich bin nur ein Zuhörer. Ich belaste die freien Geschöpfe dieser Welt nicht mit unnötigen Verboten. +TuesdayQWater=Das wasser ist zu Tief. Wie komme ich an die Edelsteine? +TuesdayAWater=Du könntest probieren, Wandbausätze{{WallKit}} in der Werkzeughütte{{ToolsWorkshop}} zu bauen. Wandbausätze können benutzt werden, um stabile Wände auch unter Wasser zu errichten. Diese schützen dich vor den Fischen und schaffen Raum zum Atmen. +TuesdayAWater2=Mit Wandbausätzen und einer Pumpe solltest du die Edelsteine erreichen können. +TuesdayQBye=Tschüss. + +Outro1=Die Maschine ist fertig. Ob sie wohl funktioniert? +Outro2=Das sieht gut aus. Ich sende ein Notsignal... +Outro3=Hoffentlich hat uns jemand gehört. +Outro4=Hey, sind das nicht unsere gestrandeten Freunde? +Outro5=Hurra, wir sind gerettet! +Outro6=Alles einsteigen! Wir fliegen zum Goldenen Berg. + diff --git a/planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/StringTblUS.txt b/planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/StringTblUS.txt new file mode 100644 index 000000000..83c2b432a --- /dev/null +++ b/planet/Missions.ocf/DeepSeaMining.ocs/System.ocg/StringTblUS.txt @@ -0,0 +1,47 @@ +Intro1=Pyrit, why do we have to fly in the clouds? +Intro2=You told me to fly higher after we almost crashed into the volcano. +Intro3=It's horribly turbulent in here. +Intro4=That's because water condensation in the cloud frees up energy which heats up the air. +Intro5=Thanks for the lecture. Now can we please fly lower again? +Intro6=First it's too turbulent when i fly low over the volcano and now it's too turbulent when i fly up high in the clouds. +Intro7=Why don't you just steer the plane yourself? +Intro8=... +Intro9=Alright. Let's swap places. +Intro10=Aaaah + +Intro20=Ouch. +Intro21=Oh, a friend has fallen from the sky. Hello friend! My name is Tuesday. +Intro22=Damn. Have you seen our airplane? I accidentally dropped out of it. +Intro23=The sky is always cloudy here. We won't see any planes and planes won't see us. +Intro24=Ugh. But i need Pyrit to find me somehow. +Intro25=What lands on the island stays on the island. Just like me. +Intro26=Isn't there any way we could make a fire or something? +Intro27=Fire? That will do no good. Coconut wood doesn't burn well and it won't be seen through the clouds. +Intro28=But...we could use my crystal communicator! +Intro29=Sounds good. Where is it? +Intro30=I'm happy on this island. Why should i build a communication device? I've made plans but I haven't bothered to finish building it. +Intro31=The site and plans how to finish it are at the eastern end of this island. It just needs some metal and some gems. +Intro32=Metal sounds easy enough? Where can I find the gems? +Intro33=The fish sometimes talk about gem reserves deep below the ocean ground. Maybe you can mine those? +Intro34=Fish talk to you? +Intro35=If you listen carefully, even coconuts talk! +Intro36=Okay...i'll see if i can finish this construction. + +Tuesday1=Hello, friend. How can I help you? +TuesdayQCommunicator=How do I use the communicator? +TuesdayACommunicator=Just bring the necessery materials to the construction site. It should work automatically when completed. +TuesdayQGems=Where can I find gems? +TuesdayAGems=Try to dive underground. +TuesdayQFish=Can you tell the fish to go away? +TuesdayAFish=I'm a listener. I do not force restraints onto the free creatures of this world. +TuesdayQWater=The water is too deep. How can I reach the gems? +TuesdayAWater=You could try and build wall kits{{WallKit}} in the tools workshop{{ToolsWorkshop}}. Wall kits can be used to construct stable walls under water protect you from fish and give some room to breath. +TuesdayAWater2=Using wall kits and a pump, you might be able to solve your problems. +TuesdayQBye=Bye + +Outro1=The machine is done! I wonder whether it works. +Outro2=Looks good. Let's send a rescue signal... +Outro3=I wonder if anyone has heard us. +Outro4=Hey, isn't that our stranded friends? +Outro5=Hooray, we're saved! +Outro6=Hop on everyone, we're heading for the Golden Mountain! diff --git a/planet/Missions.ocf/Raid.ocs/Scenario.txt b/planet/Missions.ocf/Raid.ocs/Scenario.txt index 8657efa28..6bae5e986 100644 --- a/planet/Missions.ocf/Raid.ocs/Scenario.txt +++ b/planet/Missions.ocf/Raid.ocs/Scenario.txt @@ -3,6 +3,7 @@ Title=Raid Version=5,4 Difficulty=10 NoInitialize=true +Icon=37 [Definitions] Definition2=Decoration.ocd diff --git a/planet/Missions.ocf/SPLIT.ocs/Info.txt b/planet/Missions.ocf/SPLIT.ocs/Info.txt new file mode 100644 index 000000000..e4e50d271 --- /dev/null +++ b/planet/Missions.ocf/SPLIT.ocs/Info.txt @@ -0,0 +1 @@ +Splits missions between those within (above line) and those outside (below line) storyline. \ No newline at end of file diff --git a/planet/Missions.ocf/SPLIT.ocs/Scenario.txt b/planet/Missions.ocf/SPLIT.ocs/Scenario.txt new file mode 100644 index 000000000..ac8991edf --- /dev/null +++ b/planet/Missions.ocf/SPLIT.ocs/Scenario.txt @@ -0,0 +1,5 @@ +[Head] +Title=------------ +MissionAccess=NEVER +Difficulty=49 +Icon=0 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Scenario.txt b/planet/Missions.ocf/TreasureHunt.ocs/Scenario.txt index 7bbba44cc..3424f012b 100644 --- a/planet/Missions.ocf/TreasureHunt.ocs/Scenario.txt +++ b/planet/Missions.ocf/TreasureHunt.ocs/Scenario.txt @@ -1,9 +1,10 @@ [Head] -Icon=36 +Icon=15 Title=TreasureHunt Version=5,4 -Difficulty=30 +Difficulty=40 NoInitialize=true +MissionAccess=S2Sea [Definitions] Definition2=Decoration.ocd diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/Script.c index 1eb2aa142..a07524456 100644 --- a/planet/Missions.ocf/TreasureHunt.ocs/Script.c +++ b/planet/Missions.ocf/TreasureHunt.ocs/Script.c @@ -9,6 +9,12 @@ static g_is_initialized; // set after first player join static g_max_player_num; // max number of players that were ever joined static g_plr_inventory; // array indexed by players: Array containing inventory of Clonk jsut before it died +func Initialize() +{ + SetNextMission("Mission.ocf/DarkCastle.ocs"); + return true; +} + func DoInit(int first_player) { CreateObject(Flagpole, 210,1185, first_player); @@ -137,6 +143,7 @@ func OnGoldBarCollected(object collecter) func OnGameOver() { + GainMissionAccess("S2Treasure"); // Treasure was collected! UpdateLeagueScores(); return true; @@ -163,3 +170,4 @@ func OnInvincibleDamage(object damaged_target) } return true; } + diff --git a/planet/Objects.ocd/Helpers.ocd/Sequence.ocd/Script.c b/planet/Objects.ocd/Helpers.ocd/Sequence.ocd/Script.c index 5271e3fe7..5cf6ebd18 100644 --- a/planet/Objects.ocd/Helpers.ocd/Sequence.ocd/Script.c +++ b/planet/Objects.ocd/Helpers.ocd/Sequence.ocd/Script.c @@ -114,18 +114,18 @@ func Destruction() /* Sequence callbacks */ -func ScheduleNext(int delay, int skip) +func ScheduleNext(int delay, next_idx) { - return ScheduleCall(this, this.CallNext, delay, 1, skip); + return ScheduleCall(this, this.CallNext, delay, 1, next_idx); } -func ScheduleSame(int delay) { return ScheduleNext(delay, -1); } +func ScheduleSame(int delay) { return ScheduleNext(delay, seq_progress); } -func CallNext(int skip) +func CallNext(next_idx) { // Start conversation context. // Update dialogue progress first. - seq_progress += skip+1; + if (GetType(next_idx)) seq_progress = next_idx; else ++seq_progress; // Then call relevant functions. var fn_progress = Format("%s_%d", seq_name, seq_progress); if (!Call(fn_progress)) @@ -146,6 +146,14 @@ public func SetViewTarget(object view_target) UpdateViewTarget(view_target); ScheduleCall(this, this.UpdateViewTarget, 30, 999999999, view_target); } + else + { + for (var i=0; iFindObject(Find_ID(Clonk), Find_Not(Find_Owner()), nearest_obj->Sort_Distance()); + else + this.hero = FindObject(Find_ID(Clonk), Find_Not(Find_Owner(NO_OWNER))); + // if there is still no hero, take any clonk. let the NPCs do the serquence among themselves + // (to prevent null pointer exceptions if all players left during the sequence) + if (!this.hero) this.hero = FindObject(Find_ID(Clonk)); + // might return zero if all players are gone and there are no NPCs. well, there was noone to listen anyway. + return this.hero; +} + + +/* Scenario section helper functions */ + +// Scenario section overload: Automatically transfers all player clonks +func LoadScenarioSection(name, ...) +{ + // Store objects: All clonks and sequence object + this.save_objs = []; + AddSectSaveObj(this); + var iplr,plr; + for (iplr=0; iplrSetObjectStatus(C4OS_NORMAL); + if (this) this.save_objs = nil; + // Recover HUD + for (iplr=0; iplrContents(i++)) AddSectSaveObj(cont); + return obj->SetObjectStatus(C4OS_INACTIVE); +} + + /* Global helper functions */