diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/DefCore.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/DefCore.txt deleted file mode 100644 index b6a82edc8..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/DefCore.txt +++ /dev/null @@ -1,5 +0,0 @@ -[DefCore] -id=Ambience -Version=6,0 -Category=C4D_StaticBack | C4D_Rule -Picture=0,0,128,128 diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/Graphics.png b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/Graphics.png deleted file mode 100644 index eb56c3723..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/Graphics.png and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/Script.c b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/Script.c deleted file mode 100644 index 277cb5ae5..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/Script.c +++ /dev/null @@ -1,297 +0,0 @@ -/** - Ambience - Controls sound and music depending on the environment the player is in - - @author Sven2 -*/ - -local exec_counter; // counter to distribute execution of players across frames -local last_environment; // array indexed by player number: pointer to environment the player was in last -local environments; // array of available environments for which it is checked if the player is in. sorted by priority. - -// Initialization -protected func Initialize() -{ - // Base environment - Environment = { - actions = [], - min_change_delay = 1, - min_initial_change_delay = 5, - AddSound = this.Env_AddSound, - AddAction = this.Env_AddAction, - SetMusic = this.Env_SetMusic - }; - // Register default environments (overloadable) - this->InitializeEnvironments(); - // Periodic execution of ambience events - last_environment = []; - AddTimer(this.Execute, 10); - return true; -} - -func InitializeEnvironments() -{ - // Register all standard environments - environments = []; - // Underwater: Clonk is swimming in water - var underwater = this.env_underwater = new Environment {}; - underwater->SetMusic("underwater"); - underwater.CheckPlayer = this.EnvCheck_Underwater; - AddEnvironment(underwater, 1400); - // City: Clonk is surrounded by buildings - var city = this.env_city = new Environment {}; - city->SetMusic("city"); - city.CheckPlayer = this.EnvCheck_City; - AddEnvironment(city, 1200); - // Lava: Lava material is nearby - var lava = this.env_lava = new Environment {}; - lava->SetMusic("lava"); - lava.CheckPlayer = this.EnvCheck_Lava; - lava.mat_mask = CreateArray(); // material mask for lava materials. +1 cuz sky. - lava.mat_mask[Material("Lava")+1] = true; // loop over materials and check incindiary instead? Whoever introduces the next lava type can do that... - lava.mat_mask[Material("DuroLava")+1] = true; - lava.min_change_delay = 3; // Easy to miss lava on search. - AddEnvironment(lava, 1000); - // Underground: Clonk in front of tunnel - var underground = this.env_underground = new Environment {}; - underground->SetMusic("underground"); - underground.CheckPlayer = this.EnvCheck_Underground; - AddEnvironment(underground, 800); - // Mountains: Overground and lots of rock around - var mountains = this.env_mountains = new Environment {}; - mountains->SetMusic("mountains"); - mountains.CheckPlayer = this.EnvCheck_Mountains; - mountains.mat_mask = CreateArray(); // material mask for mountain materials. +1 cuz sky. - mountains.mat_mask[Material("Rock")+1] = true; - mountains.mat_mask[Material("Granite")+1] = true; - mountains.mat_mask[Material("Ore")+1] = true; - mountains.mat_mask[Material("Gold")+1] = true; - mountains.min_change_delay = 3; // Pretty unstable condition - AddEnvironment(mountains, 600); - // Snow: It's snowing around the clonk - var snow = this.env_snow = new Environment {}; - snow->SetMusic("snow"); - snow.CheckPlayer = this.EnvCheck_Snow; - snow.min_change_delay = 6; // Persist a while after snowing stopped - snow.mat = Material("Snow"); - AddEnvironment(snow, 400); - // Night: Sunlight blocked by planet - var night = this.env_night = new Environment {}; - night->SetMusic("night"); - night.CheckPlayer = this.EnvCheck_Night; - AddEnvironment(night, 200); - // Overground: Default environment - var overground = this.env_overground = new Environment {}; - overground->SetMusic("overground"); - overground.CheckPlayer = this.EnvCheck_Overground; - overground->AddSound("Ding", 100); - AddEnvironment(overground, 0); - return true; -} - -private func Execute() -{ - // Per-player execution every third timer (~.8 seconds) - var i=GetPlayerCount(C4PT_User); - exec_counter += !(i%3); - while (i--) if (!(++exec_counter % 3)) ExecutePlayer(GetPlayerByIndex(i, C4PT_User)); - return true; -} - -private func ExecutePlayer(int plr) -{ - var cursor = GetCursor(plr); - // Determine environment the player is currently in - var environment = nil; - if (cursor) - { - var last_env = last_environment[plr]; - var x = cursor->GetX(), y = cursor->GetY(); - for (test_environment in environments) - { - if (environment = test_environment->CheckPlayer(cursor, x, y, test_environment == last_env)) - { - // We've found a matchign environment. - // Was it a change? Then check delays first - if (test_environment != last_env) - { - if (last_env && last_env.no_change_delay) - { - // Environment should change but a delay is specified. Keep last environment for now. - --last_env.no_change_delay; - environment = last_env; - break; - } - // New environment and change delay has passed. - environment.no_change_delay = environment.min_initial_change_delay; - Log("%s environment: %s", GetPlayerName(plr), environment.music); - } - else - { - // Was no change: Reset change delays - environment.no_change_delay = Max(environment.no_change_delay, environment.min_change_delay); - } - break; - } - } - } - last_environment[plr] = environment; - if (!environment) return true; - // Music by environment - this->SetPlayList(environment.music, plr, true, 3000); - // Sounds and actions by environment - for (var action in environment.actions) - if (Random(1000) < action.chance) - cursor->Call(action.fn, action.par[0], action.par[1], action.par[2], action.par[3], action.par[4]); - return true; -} - -func InitializePlayer(int plr) -{ - // Newly joining players should have set playlist immediately (so they don't start playing a random song just to switch it immediately) - ExecutePlayer(plr); - return true; -} - -func RemovePlayer(int plr) -{ - // Ensure newly joining players don't check on another player's environment - last_environment[plr] = nil; - return true; -} - -protected func Activate(int byplr) -{ - MessageWindow(this.Description, byplr); - return true; -} - -/* Environment functions */ - -func AddEnvironment(proplist new_env, priority) -{ - if (GetType(priority)) new_env.Priority = priority; - this.environments[GetLength(environments)] = new_env; - SortArrayByProperty(this.environments, "Priority", true); - return true; -} - -private func Env_AddSound(string snd_name, chance) -{ - return Env_AddAction(Global.Sound, snd_name, chance ?? 50); -} - -private func Env_AddAction(afn, par0, par1, par2, par3, par4) -{ - return this.actions[GetLength(this.actions)] = { fn=afn, par=[par0, par1, par2, par3, par4] }; -} - -private func Env_SetMusic(string playlist) -{ - this.music = playlist; - return true; -} - -/* Default environment checks */ - -private func EnvCheck_Underwater(object cursor, int x, int y, bool is_current) -{ - // Clonk should be swimming - if (cursor->GetProcedure() != "SWIM") return nil; - // For initial change, clonk should also be diving: Check for breath below 80% - // Use > instead of >= to ensure 0-breath-clonks can also get the environment - if (!is_current && cursor->GetBreath() > cursor.MaxBreath*4/5) return nil; - return this; -} - -private func EnvCheck_City(object cursor, int x, int y, bool is_current) -{ - // There must be buildings around the clonk - var building_count = cursor->ObjectCount(cursor->Find_AtRect(-180,-100,360,200), Find_Func("IsStructure")); - // 3 buildings to start the environment. Just 1 building to sustain it. - if (building_count < 3-2*is_current) return nil; - return this; -} - -private func EnvCheck_Lava(object cursor, int x, int y, bool is_current) -{ - // Check for lava pixels. First check if the last lava pixel we found is still in place. - var search_range; - if (is_current) - { - if (this.mat_mask[GetMaterial(this.last_x, this.last_y)+1]) - if (Distance(this.last_x, this.last_y, x, y) < 140) - return this; - search_range = 140; - } - else - { - search_range = 70; - } - // Now search for lava in search range - var ang = Random(360); - for (; search_range >= 0; search_range -= 10) - { - ang += 200; - var x2 = x + Sin(ang, search_range); - var y2 = y + Cos(ang, search_range); - if (this.mat_mask[GetMaterial(x2, y2)+1]) - { - // Lava found! - this.last_x = x2; - this.last_y = y2; - return this; - } - } - // No lava found - return nil; -} - -private func EnvCheck_Underground(object cursor, int x, int y, bool is_current) -{ - // Check for underground: No sky at cursor or above - if (GetMaterial(x,y)<0) return nil; - if (GetMaterial(x,y-30)<0) return nil; - if (GetMaterial(x-10,y-20)<0) return nil; - if (GetMaterial(x+10,y-20)<0) return nil; - return this; -} - -private func EnvCheck_Mountains(object cursor, int x, int y, bool is_current) -{ - // Check for mountains: Rock materials below - var num_rock; - for (var y2=0; y2<=45; y2+=15) - for (var x2=-75; x2<=75; x2+=15) - num_rock += this.mat_mask[GetMaterial(x+x2,y+y2)+1]; - // need 15pts on first check; 5 to sustain - if (num_rock < 15-is_current*10) return nil; - return this; -} - -private func EnvCheck_Snow(object cursor, int x, int y, bool is_current) -{ - // Must be snowing from above - if (GetPXSCount(this.mat, x-300, y-200, 600, 300) < 20 - is_current*15) return nil; - return this; -} - -private func EnvCheck_Night(object cursor, int x, int y, bool is_current) -{ - // Night time. - var time = FindObject(Find_ID(Environment_Time)); - if (!time || !time->IsNight()) return nil; - return this; -} - -private func EnvCheck_Overground(object cursor, int x, int y, bool is_current) -{ - // This is the fallback environment - return this; -} - -/*-- Proplist --*/ - -local Name = "$Name$"; -local Description = "$Description$"; -local Environment; diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommActive.ogg b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommActive.ogg deleted file mode 100644 index cdfa22316..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommActive.ogg and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommBoost.ogg b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommBoost.ogg deleted file mode 100644 index 6dba3e948..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommBoost.ogg and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommCharge.ogg b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommCharge.ogg deleted file mode 100644 index 3a1e0960b..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommCharge.ogg and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommToneA.ogg b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommToneA.ogg deleted file mode 100644 index d59ff84ce..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommToneA.ogg and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommToneB.ogg b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommToneB.ogg deleted file mode 100644 index 26fe35a39..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommToneB.ogg and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommWumm.ogg b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommWumm.ogg deleted file mode 100644 index f79c88424..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/CrystalCommWumm.ogg and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/DefCore.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/DefCore.txt deleted file mode 100644 index befb6df74..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/DefCore.txt +++ /dev/null @@ -1,15 +0,0 @@ -[DefCore] -id=CrystalCommunicator -Version=6,0 -Category=C4D_Structure -Width=90 -Height=70 -Offset=-45,-35 -Vertices=2 -VertexX=-40,40 -VertexY=34,34 -VertexFriction=100,100 -Mass=300 -Components=Ruby=6;Amethyst=6;Metal=6; -Rotate=0 -Construction=1 diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/Graphics.5.png b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/Graphics.5.png deleted file mode 100644 index 3b4517853..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/Graphics.5.png and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsSite0.5.png b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsSite0.5.png deleted file mode 100644 index f897c1c44..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsSite0.5.png and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsSite1.5.png b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsSite1.5.png deleted file mode 100644 index dd184a19a..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsSite1.5.png and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsSite2.5.png b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsSite2.5.png deleted file mode 100644 index 2a7690e89..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsSite2.5.png and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsTopFace.5.png b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsTopFace.5.png deleted file mode 100644 index 78256f4e3..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/GraphicsTopFace.5.png and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/Script.c b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/Script.c deleted file mode 100644 index db567fe7c..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/Script.c +++ /dev/null @@ -1,357 +0,0 @@ -/*-- - Crystal communicator - Author: Sven2 - - Shining structure built from gems and metal ---*/ - -#include Library_Structure - -local top_face, base_face; - -public func IsCrystalCommunicator() { return !base_face; } - -/* Construction */ - -public func SetConstructionSiteOverlay(object site, int dir, object stick, object component_obj) -{ - // Play component-specific sound for adding stuff to the site - if (component_obj && !component_obj->GetDefFragile()) component_obj->~Hit(); - // Construction site graphics by provided metal - var metal_completion = site->ContentsCount(Metal) * 3 / Max(GetComponent(Metal, nil, nil, this), 1); - site->SetGraphics(["Site0", "Site1", "Site2", nil][metal_completion], CrystalCommunicator, 1, GFXOV_MODE_Base); - site->SetGraphics(nil, nil, 2); - // Add graphics of contained gems - UpdateGemOverlays(site, [1, 3, 7, 12][metal_completion]); - return true; -} - -public func DoConstructionEffects(object site) -{ - // Grab all gems from site - GrabContents(site); - var metal; - while (metal = FindContents(Metal)) metal->RemoveObject(); - // Site is done immediately - SetCon(100); - // Create TopFace overlay - top_face = CreateObjectAbove(GetID(),0,35,GetOwner()); - top_face.Plane = this.Plane + 10; - top_face->SetGraphics("TopFace"); - top_face->SetAction("Attach", this); - top_face.base_face = this; - // Transfer gem overlays - this.gem_overlays = site.gem_overlays; - UpdateGemOverlays(this, 13, true); - // Construction done. Remove site. - site->RemoveObject(site); - // Start finals effect - return true; -} - - -/* Gem overlays */ - -static const CrystalCommunicator_GemsX = [ 15,440,336,221,121,298,220, 50, 14,333,129, 77], - CrystalCommunicator_GemsY = [255, 75,100, 84, 44,107, 15,130,107,153,149,106], - CrystalCommunicator_GemsZ = [ 5, 3, 4, 0, 4, 0, 5, 2, 3, 1, 1, 4], - CrystalCommunicator_GemCount = 12; - -private func UpdateGemOverlays(object obj, int max_overlays, bool refresh_existing) -{ - // Add overlays for any gems that have not yet been added - var gem_overlay_index = 3; - if (!obj.gem_overlays) obj.gem_overlays = []; - var n_overlays = GetLength(obj.gem_overlays); - var i; - // Remove overlays of gems that have left - for (i=0; iContained() != obj) - { - obj->SetGraphics(nil, nil, gem_overlay_index+i); - if (obj.top_face) obj.top_face->SetGraphics(nil, nil, gem_overlay_index+i); - obj.gem_overlays[i] = nil; - } - // Add new overlays - for (var gem in FindObjects(Find_Container(obj), Find_Func("GetGemColor"))) - { - // Already displayed? - i = GetIndexOf(obj.gem_overlays, gem); - if (i>=0) - { - if (!refresh_existing) continue; - } - else - { - // Find a spot for this gem - i = GetIndexOf(obj.gem_overlays, nil); - if (i<0) i=n_overlays; - // No free space? - if (i == max_overlays) if (refresh_existing) continue; else break; - } - // Add overlay - var gem_gfx = gem.graphics_index; - if (gem_gfx) gem_gfx = Format("%d", gem_gfx+1); else gem_gfx = nil; - var x = CrystalCommunicator_GemsX[i]; - var y = CrystalCommunicator_GemsY[i]; - var z = CrystalCommunicator_GemsZ[i]; - var size = z*100+500; - var off_y; - if (obj == this) off_y = 35000; else off_y = 70000; - var gem_target; - if (obj.top_face && z>=3) gem_target = obj.top_face; else gem_target = obj; - gem_target->SetGraphics(gem_gfx, gem->GetID(), gem_overlay_index+i, GFXOV_MODE_Base); - gem_target->SetObjDrawTransform(size,0,x*200-45000, 0,size,y*200-off_y, gem_overlay_index+i); - if (z<3) gem_target->SetClrModulation(0xffb0b0b0, gem_overlay_index+i); - // Remember in list - obj.gem_overlays[i] = gem; - n_overlays = GetLength(obj.gem_overlays); - } - // Make sure a glitter effect is there - if (!GetEffect("IntGemGlitter", obj)) AddEffect("IntGemGlitter", obj, 1, 12, nil, CrystalCommunicator); - return true; -} - -private func FxIntGemGlitterTimer(target) -{ - // Glitter at random gem position - if (Random(2)) - { - var i = Random(12), gem; - if (gem = target.gem_overlays[i]) - { - var x = CrystalCommunicator_GemsX[i]/5 - 45; - var y = CrystalCommunicator_GemsY[i]/5 - 35; - if (target->GetID() == ConstructionSite) y -= 35; - var size = CrystalCommunicator_GemsZ[i]*4 + 10; - var sparkle_fx = GetEffect("Sparkle", gem); - sparkle_fx.Size = PV_KeyFrames(1, 0, 0, 500, size, 1000, 0); // modifying value directly in gem, assuming gem won't leave this structure any more - if (sparkle_fx && sparkle_fx.particles) - target->CreateParticle("MagicRing", x, y, 0, 0, size, sparkle_fx.particles, 1); - } - } -} - - - -/* End sequence */ - -local ruby_particle, amethyst_particle, beam_particles, gem_particles; -local flash_particle, small_flash_particle, large_flash_particle; -local time; -local send_code, next_send_time, send_code_pos; - -public func StartCommunication() -{ - // forward to main object - if (base_face) return base_face->StartCommunication(); - // Init particles - // Gem particles - beam_particles = CreateArray(CrystalCommunicator_GemCount); - gem_particles = CreateArray(CrystalCommunicator_GemCount); - ruby_particle = new Particles_MagicRing() { R = 0xff, G = 0x00, B = 0x30 }; - amethyst_particle = new Particles_MagicRing() { R = 0xa0, G = 0x00, B = 0xff }; - for (var i=0; iGetID() == Ruby) base = ruby_particle; else base = amethyst_particle; - } - else - { - if (i%2) base = ruby_particle; else base = amethyst_particle; - } - gem_particles[i] = base; - var x = CrystalCommunicator_GemsX[i]/5 - 45; - beam_particles[i] = CreateCirclingParticle(base, 100, 20, Abs(x), x>0); - } - // Central flash particles - flash_particle = { - Size = PV_KeyFrames(0, 0, 0, 500, 60, 1000, 0), - R = PV_KeyFrames(0, 750, 255, 1000, 0), - G = PV_KeyFrames(0, 300, 255, 1000, 0), - B = PV_KeyFrames(0, 300, 255, 500, 0), - Rotation = PV_Random(0, 360), - Alpha = PV_KeyFrames(0, 0, 255, 750, 100, 1000, 0), - BlitMode = GFX_BLIT_Additive, - Attach = ATTACH_Front | ATTACH_MoveRelative, - }; - large_flash_particle = { - Size = PV_KeyFrames(0, 0, 0, 500, 200, 1000, 0), - R = PV_KeyFrames(0, 750, 255, 1000, 0), - G = PV_KeyFrames(0, 300, 255, 1000, 0), - B = PV_KeyFrames(0, 300, 255, 500, 0), - Rotation = PV_Random(0, 360), - Alpha = PV_KeyFrames(0, 0, 255, 750, 100, 1000, 0), - BlitMode = GFX_BLIT_Additive, - Attach = ATTACH_Front | ATTACH_MoveRelative, - }; - // Gem flash particle - small_flash_particle = { - Size = PV_KeyFrames(0, 0, 0, 500, 20, 1000, 0), - R = PV_KeyFrames(0, 750, 255, 1000, 0), - G = PV_KeyFrames(0, 300, 255, 1000, 0), - B = PV_KeyFrames(0, 300, 255, 500, 0), - Rotation = PV_Random(0, 360), - Alpha = PV_KeyFrames(0, 0, 255, 750, 100, 1000, 0), - BlitMode = GFX_BLIT_Additive, - Attach = ATTACH_Front | ATTACH_MoveRelative, - }; - // Run effects - Sound("CrystalCommCharge"); - time = 0; - AddTimer(this.PreActivity, 5); -} - -private func PreActivity() -{ - // Warmup effects - var i,x,y,z; - for (i=0; i=3) gem_target = top_face; else gem_target = this; - if (time < 20 || !Random(3)) - { - if (!(time % 5)) gem_target->CreateParticle("StarFlash", x,y, 0,0, 60+Random(10), small_flash_particle, 1); - } - else - gem_target->CreateParticle("StarFlash", x, y, -x, -y, 10, small_flash_particle, 10); - } - if (time == 20) Sound("CrystalCommBoost"); - if (time > 50) - { - RemoveTimer(this.PreActivity); - time = 0; - CreateParticle("StarFlash", PV_Random(-12, +12), PV_Random(-12, +12), PV_Random(-10, +10),PV_Random(-10, +10), PV_Random(20, 100), large_flash_particle, 10); - Sound("CrystalCommWumm"); - SetAction("Active"); - AddTimer(this.Activity, 1); - } - ++time; -} - -public func StopCommunication() -{ - // forward to main object - if (base_face) return base_face->StopCommunication(); - // Stop activities - RemoveTimer(this.PreActivity); - RemoveTimer(this.Activity); - SetAction("Idle"); - time = 0; - return true; -} - -private func Activity() -{ - // Send codes - if (send_code) - { - if (next_send_time == time) - { - var send_char = GetChar(send_code, send_code_pos++); - if (!send_char) - { - // All sent. - send_code = nil; - } - else - { - // Next char to send - if (send_char == GetChar(".")) - { - Sound("CrystalCommToneA"); - next_send_time = time + 13; - } - else - { - Sound("CrystalCommToneB"); - next_send_time = time + 27; - } - } - } - if (next_send_time - time > 10) - { - // During tone: Effects - CreateParticle("StarFlash", PV_Random(-3, +3), 0, 0,-30, 500, flash_particle, 1); - } - } - // Effects - // Circulate through gems - var i = time % CrystalCommunicator_GemCount; - var x = CrystalCommunicator_GemsX[i]/5 - 45, y = CrystalCommunicator_GemsY[i]/5 - 35, z = CrystalCommunicator_GemsZ[i]; - var gem_target; - if (top_face && z>=3) gem_target = top_face; else gem_target = this; - // Create ring moving upwards - if (Abs(x) > 5) CreateParticle("MagicRing", x, y, 0, -Min(time/20,10), 2000, beam_particles[i], 1); - // Create flash at gem - gem_target->CreateParticle("StarFlash", x, y, 0, 0, 20+Random(10), gem_particles[i], 1); - // Create central flash - if (!(time % 5)) CreateParticle("StarFlash", PV_Random(-6, +6), PV_Random(-6, +6), 0,0, 20+Random(10), flash_particle, 1); - ++time; -} - -private func CreateCirclingParticle(proplist prototype, int frames_per_cycle, int num_cycles, int rad, bool start_backmove) -{ - var a = (rad * 10000000) / (2429 * frames_per_cycle * frames_per_cycle); - var ang0 = (!!start_backmove) * 180; - var particle = { - Prototype = prototype, - Size = PV_Sin(PV_Linear( ang0, 360*num_cycles),5,8), - ForceX = PV_Sin(PV_Linear( ang0+90, ang0+90+360*num_cycles), a, 0), - ForceY = 0, - Attach = ATTACH_Front | ATTACH_MoveRelative, - }; - return particle; - -} - -public func SendCode(string code) -{ - send_code = code; - next_send_time = time; - send_code_pos = 0; - return true; -} - - -/* Definition data */ - -public func Definition(proplist def) -{ -} - -local ActMap = { - Attach = { - Prototype = Action, - Name = "Attach", - Procedure = DFA_ATTACH, - Directions = 1, - FacetBase = 1, - Length = 1, - Delay = 0, - NextAction = "Hold" - }, - Active = { - Prototype = Action, - Name = "Active", - Procedure = DFA_NONE, - Directions = 1, - FacetBase = 1, - Delay = 0, - Length = 1, - NextAction = "Active", - Sound = "CrystalCommActive", - }, - }; - -local Collectible = false; -local Name = "$Name$"; -local Description = "$Description$"; -local Touchable = 0; -local Plane = 280; diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/StringTblDE.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/StringTblDE.txt deleted file mode 100644 index 1183ba56d..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/StringTblDE.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name=Kristallkommunikator -Description=Gerät zur Langstreckenkommunikation \ No newline at end of file diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/StringTblUS.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/StringTblUS.txt deleted file mode 100644 index 1f8601a08..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/CrystalCommunicator.ocd/StringTblUS.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name=Crystal communicator -Description=Device for long range communication. \ No newline at end of file diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/DescDE.rtf b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/DescDE.rtf deleted file mode 100644 index 9133dc5fa..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/DescDE.rtf and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/DescUS.rtf b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/DescUS.rtf deleted file mode 100644 index d87907202..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/DescUS.rtf and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/DefCore.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/DefCore.txt deleted file mode 100644 index 14d019cb5..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/DefCore.txt +++ /dev/null @@ -1,5 +0,0 @@ -[DefCore] -id=Goal_BuildCrystalCommunicator -Version=6,0 -Category=C4D_StaticBack|C4D_Goal -Picture=0,0,128,128 diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/Graphics.png b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/Graphics.png deleted file mode 100644 index 987852638..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/Graphics.png and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/Script.c b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/Script.c deleted file mode 100644 index b563c2dfa..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/Script.c +++ /dev/null @@ -1,61 +0,0 @@ -/*-- - Build crystal communicator - Author: Sven2 - - Player must build the crystal communicator ---*/ - - -#include Library_Goal - - -/*-- Goal interface --*/ - -// The goal is fulfilled if the communicator has been built -public func IsFulfilled() -{ - return ObjectCount(Find_ID(CrystalCommunicator)); -} - -public func GetDescription(int plr) -{ - var message; - if (IsFulfilled()) - message = "$MsgGoalFulfilled$"; - else - message = "$MsgGoalUnfulfilled$"; - return message; -} - -// Shows or hides a message window with information. -public func Activate(int plr) -{ - // If goal message open -> hide it. - if (GetEffect("GoalMessage", this)) - { - CustomMessage("", nil, plr, nil, nil, nil, nil, nil, MSG_HCenter); - RemoveEffect("GoalMessage", this); - return; - } - // Otherwise open a new message. - AddEffect("GoalMessage", this, 100, 0, this); - var message; - if (IsFulfilled()) - { - message = "@$MsgGoalFulfilled$"; - } - else - { - message = "@$MsgGoalUnfulfilled$"; - } - CustomMessage(message, nil, plr, 0, 16 + 64, 0xffffff, GUI_MenuDeco, this, MSG_HCenter); - return; -} - -protected func FxGoalMessageStart() {} - -//public func GetShortDescription(int plr) { return ""; } - -/*-- Proplist --*/ - -local Name = "$Name$"; diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/StringTblDE.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/StringTblDE.txt deleted file mode 100644 index 832b2173d..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/StringTblDE.txt +++ /dev/null @@ -1,5 +0,0 @@ -Name=Kristallkommunikator bauen - -#Goal window -MsgGoalFulfilled=Glückwunsch; der Kristallkommunikator steht. -MsgGoalUnfulfilled=Bringe das nötige Baumaterial zur Baustelle des Kristallkommunikator! diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/StringTblUS.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/StringTblUS.txt deleted file mode 100644 index dc7cbcba7..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/GoalCrystalCommunicator.ocd/StringTblUS.txt +++ /dev/null @@ -1,5 +0,0 @@ -Name=Build crystal communicator - -#Goal window -MsgGoalFulfilled=Congratulations, the crystal communicator is done. -MsgGoalUnfulfilled=Find the missing components and bring them to the crystal communicator construction site! diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Map.c b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Map.c deleted file mode 100644 index a5714fe08..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Map.c +++ /dev/null @@ -1,275 +0,0 @@ -/** - Blue lake - Dynamic map with a big lake containing islands of material - Plus lava basins with gems at the bottom - Parts adapted from Gem Grabbers by Maikel - - @authors Sven2 -*/ - -#include Library_Map - -// zoomed coordinates for scenario script -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 && !SCEN_TEST) return true; - Resize(300,400); - this.sea_y = 50; - this.ground_y = 350; - this.map_zoom = 7; - main_island_x = this.Wdt/2 * this.map_zoom; - main_island_y = this.sea_y * this.map_zoom; - - Draw("Water", nil, [0,this.sea_y,this.Wdt,this.Hgt]); - DrawMainIsland(80); - DrawGround(); - - // Regular resource islands - DrawSecondaryIslands(3, 15, [["Ore", 50], ["Coal", 40]], true); - DrawSecondaryIslands(10, 6, [["Firestone", 70]], false); - DrawSecondaryIslands(3, 8, [["Gold", 40]], true); - - // Amethyst islands - var i=0, imod=Random(2); - while (i<3 || GetPixelCount("Amethyst")<15) - { - DrawSecondaryIsland(8, [["Amethyst", 70]], true, [0, this.Wdt-70][(i+imod)%2], 70, this.sea_y+50); - ++i; - } - - FixLiquidBorders("Earth"); - - // Ensure that left and right side are always open because they're used for water refill - Draw("Sky", nil, [0,0,1,this.sea_y]); - Draw("Sky", nil, [this.Wdt-1,0,1,this.sea_y]); - Draw("Water", nil, [0,this.sea_y,1,70]); - Draw("Water", nil, [this.Wdt-1,this.sea_y,1,70]); - - // Top level of water has sky background - Draw("^Water", Duplicate("Water"), [0,this.sea_y,this.Wdt,11]); - - // Return true to tell the engine a map has been successfully created. - return true; -} - -// Draws the main island with all basic resources -private func DrawMainIsland(int size) -{ - // Shape of the main island. Shape taken from Gem Grabbers. - var island_algo = {Algo = MAPALGO_Polygon}; - var x = this.Wdt / 2; - var y = this.sea_y; - island_algo.X = [x-size/3, x-size/2, x-size/3, x-size/6, x+size/6, x+size/3, x+size/2, x+size/3]; - island_algo.Y = [y-size/6, y, y+size/3, y+size/6, y+size/6, y+size/3, y, y-size/6]; - - // Draw the earth patch of the island. - island_algo = {Algo = MAPALGO_Turbulence, Iterations = 4, Op = island_algo}; - var island = CreateLayer(); - island->Draw("Earth", island_algo); - - // Draw goal platform shape - while (island->GetPixel(x,y)) ++x; // Find right side of island at sea level - var platform_algo = {Algo = MAPALGO_Polygon}; - platform_algo.X = [x-5,x+14,x+14,x+7,x ,x-5]; - platform_algo.Y = [y ,y ,y+ 1,y+2,y+4,y ]; - island->Draw("Earth", platform_algo); - - // Preserve drawn island shape for border algorithms - var island_shape = island->Duplicate(); - - // Overlay a set of materials inside the island. - DrawIslandMat("Earth-earth_dry", island, 4, 30, true); - DrawIslandMat("Earth-earth_midSoil", island, 3, 30, true); - DrawIslandMat("Tunnel", island, 3, 10, true); - //DrawIslandMat("Water", island, 4, 8); - //DrawIslandMat("Gold", island, 3, 6); - DrawIslandMat("Ore", island, 6, 18, true); - DrawIslandMat("Coal", island, 6, 18, true); - DrawIslandMat("Firestone", island, 6, 12, true); - - // Draw a top border out of sand and top soil. - var sand_border = {Algo = MAPALGO_And, Op = [{Algo = MAPALGO_Border, Op = island_shape, Top = [-1,2]}, {Algo = MAPALGO_RndChecker, Ratio = 50, Wdt = 4, Hgt = 3}]}; - var topsoil_border = {Algo = MAPALGO_And, Op = [{Algo = MAPALGO_Border, Op = island_shape, Top = [-1,3]}, {Algo = MAPALGO_RndChecker, Ratio = 40, Wdt = 4, Hgt = 2}]}; - island->Draw("Sand", sand_border); - island->Draw("Earth-earth_topSoil", topsoil_border); - - // Draw a bottom border out of granite and rock. - var granite_border = {Algo = MAPALGO_Border, Op = island_shape, Bottom = [-4,3]}; - island->Draw("Granite", granite_border); - var rock_border = {Algo = MAPALGO_RndChecker, Ratio = 20, Wdt = 2, Hgt = 2}; - island->Draw("Rock", {Algo = MAPALGO_And, Op = [granite_border, rock_border]}); - island->Draw("Rock-rock_cracked", {Algo = MAPALGO_And, Op = [granite_border, rock_border]}); - - // Draw goal platform - island->Draw("Sky", nil, [x,y-10,14,10]); - island->Draw("Brick", nil, [x,y,14,2]); - goal_platform_x = (x+7)*this.map_zoom; - goal_platform_y = y *this.map_zoom; - - // Draw island onto main map - Blit(island); - - return true; -} - -// Draws multiple underwater resource islands -private func DrawSecondaryIslands(int n, ...) -{ - for (var i=0; iDraw("Earth", island_algo); - var island_shape = island->Duplicate(); - - DrawIslandMat("Earth-earth_dry", island, 4, 30); - DrawIslandMat("Earth-earth_midSoil", island, 3, 30); - - // Overlay a set of materials inside the island. - for (var mat in materials) - { - DrawIslandMat(mat[0], island, 3, mat[1], has_border); - } - - // Draw a border out of granite and rock. - if (has_border) - { - var island_shape = island->Duplicate(); - var granite_border = {Algo = MAPALGO_Border, Op = island_shape, Top = [-2,2]}; - island->Draw("Granite", granite_border); - var rock_border = {Algo = MAPALGO_RndChecker, Ratio = 20, Wdt = 2, Hgt = 2}; - island->Draw("Rock", {Algo = MAPALGO_And, Op = [granite_border, rock_border]}); - island->Draw("Rock-rock_cracked", {Algo = MAPALGO_And, Op = [granite_border, rock_border]}); - } - - // Draw island onto main map - Blit(island); - - return true; -} - -private func DrawGround() -{ - // Bottom of the sea - var ground_algo = { Algo = MAPALGO_Rect, X=-100, Y=this.ground_y, Wdt=this.Wdt+200, Hgt=this.Hgt-this.ground_y+1000 }; - ground_algo = {Algo = MAPALGO_Turbulence, Iterations = 4, Amplitude = [10,100], Scale = 20, Op = ground_algo }; - var ground2_algo = { Algo = MAPALGO_Rect, X=-100, Y=this.Hgt-10, Wdt=this.Wdt+200, Hgt=this.Hgt-this.ground_y+1000 }; - ground2_algo = {Algo = MAPALGO_Turbulence, Iterations = 2, Amplitude = 10, Scale = 30, Op = ground2_algo }; - var ground = CreateLayer(); - // Ensure lots of earth - while (true) - { - ground->Draw("Earth", ground_algo); - ground->Draw("Granite", ground2_algo); - if (ground->GetPixelCount("Earth") > 10000) break; - } - ground->Draw("DuroLava", {Algo=MAPALGO_Turbulence, Amplitude=10, Scale=20, Iterations=3, Op={Algo=MAPALGO_And, Op=[ground->Duplicate("Granite"), {Algo = MAPALGO_RndChecker, Ratio=50, Wdt=30, Hgt=2}]}}); - // Granite/Rock top border - ground->Draw("Granite", {Algo = MAPALGO_Turbulence, Amplitude = 5, Iterations = 1, Op = {Algo = MAPALGO_Border, Op = ground->Duplicate(), Top= [-2,2]}}); - ground->Draw("Rock", {Algo=MAPALGO_And, Op=[ground->Duplicate("Granite"), {Algo = MAPALGO_RndChecker, Ratio = 40, Wdt = 2, Hgt = 2}]}); - // Alterations in earth material - DrawIslandMat("Earth-earth_dry", ground, 12, 60, false); - DrawIslandMat("Earth-earth_midSoil", ground, 8, 60, false); - // Gem spots - var gem_spots = CreateLayer(); - var earth_mats = CreateMatTexMask("Earth"); - var i=0; - while (i<3 || gem_spots->GetPixelCount("Ruby") < 15) - { - var gem_mat = "Ruby"; - // Find an earth spot - var pos = {X=Random(this.Wdt), Y=this.Hgt/2+Random(this.Hgt/2)}; - ground->FindPosition(pos, "Earth"); - // Find center of this earth area - var x=pos.X, y=pos.Y; - var x0=x-1, x1=x+1, y0=y-1, y1=y+1; - while (earth_mats[ground->GetPixel(x,y0)]) --y0; - while (earth_mats[ground->GetPixel(x,y1)]) ++y1; - y=Min((y0+y1)/2, this.Hgt-6); - while (earth_mats[ground->GetPixel(x0,y)]) --x0; - while (earth_mats[ground->GetPixel(x1,y)]) ++x1; - x=(x0+x1)/2; - var size = 9; - // Lava basin here - var lava_algo = {Algo = MAPALGO_Ellipsis, X=x, Y=y, Wdt=size, Hgt=size}; - lava_algo = {Algo = MAPALGO_Turbulence, Amplitude = 5, Iterations = 5, Op = lava_algo}; - gem_spots->Draw("DuroLava", lava_algo); - // Gems at bottom center - y += 2; - size = 3; - var gem_algo = {Algo = MAPALGO_Ellipsis, X=x, Y=y, Wdt=size, Hgt=size}; - gem_algo = {Algo = MAPALGO_Turbulence, Amplitude = 3, Iterations = 1, Op = gem_algo}; - gem_spots->Draw(gem_mat, gem_algo); - // Draw to map - ground->Blit(gem_spots); - ++i; - } - // Lava basins surrounded by granite - ground->Draw("Rock", {Algo=MAPALGO_And, Op=[{Algo=MAPALGO_Not, Op=gem_spots}, {Algo = MAPALGO_Turbulence, Amplitude = 5, Iterations = 5, Op = {Algo = MAPALGO_Border, Op = gem_spots, Wdt=-4}}]}); - ground->Draw("Granite", {Algo = MAPALGO_Border, Op = gem_spots, Wdt=-1}); - // Lots of rocks - DrawIslandMat("Rock-rock_cracked", ground, 2, 20, false); - DrawIslandMat("Rock", ground, 2, 20, false); - // And some lava - DrawIslandMat("DuroLava", ground, 2, 20, false); - // Other materials (rare) - DrawIslandMat("Ore", ground, 12, 8, false); - DrawIslandMat("Coal", ground, 12, 8, false); - DrawIslandMat("Gold", ground, 12, 8, false); - DrawIslandMat("Firestone", ground, 12, 8, false); - Blit(ground); - return true; -} - -// Draws some material inside an island. -private func DrawIslandMat(string mat, proplist onto_mask, int speck_size, int ratio, has_border) -{ - if (!speck_size) - speck_size = 3; - if (!ratio) - ratio = 20; - // Use random checker algorithm to draw patches of the material. - var rnd_checker = {Algo = MAPALGO_RndChecker, Ratio = ratio, Wdt = speck_size, Hgt = speck_size}; - rnd_checker = {Algo = MAPALGO_Turbulence, Iterations = 4, Op = rnd_checker}; - var algo; - if (has_border) - { - var mask_border = {Algo = MAPALGO_Border, Op = onto_mask, Wdt = 3}; - algo = {Algo = MAPALGO_And, Op = [{Algo = MAPALGO_Xor, Op = [onto_mask->Duplicate("Earth"), mask_border]}, rnd_checker]}; - } - else - { - algo = {Algo = MAPALGO_And, Op = [onto_mask->Duplicate("Earth"), rnd_checker]}; - } - onto_mask->Draw(mat, algo); - - return true; -} diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Scenario.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Scenario.txt deleted file mode 100644 index 160de96b1..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Scenario.txt +++ /dev/null @@ -1,57 +0,0 @@ -[Head] -Title=DeepSeaMining -Icon=31 -Version=6,0 -Difficulty=30 -MissionAccess=S2Crash - -[Definitions] -Definition1=Objects.ocd - -[Game] -Rules=Rule_TeamAccount=1;Rule_BuyAtFlagpole=1;Rule_BaseRespawn=1; -Goals=Goal_BuildCrystalCommunicator=1; -ValueOverloads=Ruby=10;Amethyst=10 - -[Player1] -Wealth=25 -Crew=Clonk=2 -Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;Basement=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;Lorry=1; -BaseMaterial=Clonk=25;Bread=25; -BaseProduction=Clonk=25;Bread=25; - -[Player2] -Wealth=25 -Crew=Clonk=2 -Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;Basement=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;Lorry=1; -BaseMaterial=Clonk=25;Bread=25; -BaseProduction=Clonk=25;Bread=25; - -[Player3] -Wealth=25 -Crew=Clonk=2 -Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;Basement=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;Lorry=1; -BaseMaterial=Clonk=25;Bread=25; -BaseProduction=Clonk=25;Bread=25; - -[Player4] -Wealth=25 -Crew=Clonk=2 -Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;Basement=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;Lorry=1; -BaseMaterial=Clonk=25;Bread=25; -BaseProduction=Clonk=25;Bread=25; - -[Landscape] -Sky=Clouds2 -TopOpen=1 -BottomOpen=0 -AutoScanSideOpen=1 -MapWidth=300 -MapHeight=400 -MapZoom=7 - -[Weather] -Climate=0 -StartSeason=0 -YearSpeed=0 -Wind=0,100,-100,100 diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Script.c b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Script.c deleted file mode 100644 index 51d74c028..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Script.c +++ /dev/null @@ -1,300 +0,0 @@ -/** - Deep Sea Mining - Mine gems buried deeply below the ocean. - - @authors Sven2 -*/ - -// set in Map.c -static main_island_x, main_island_y; -static goal_platform_x, goal_platform_y; - -static const SCEN_TEST = true; - -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 = CreateObjectAbove(ConstructionSite, goal_platform_x+10, goal_platform_y+3); - goal_site->Set(CrystalCommunicator); - goal_site->MakeUncancellable(); - if (SCEN_TEST) - { - for (var i=0; i<6; ++i) - { - goal_site->CreateObjectAbove(Metal,-20); - goal_site->CreateObjectAbove(Ruby,0); - goal_site->CreateObjectAbove(Amethyst,20); - } - goal_site->CreateContents(Metal,6); - goal_site->CreateContents(Ruby,6); - goal_site->CreateContents(Amethyst,5); - } - - // Initialize different parts of the scenario. - InitEnvironment(); - InitVegetation(); - InitAnimals(); - InitMainIsland(); - - // NPC - g_tuesday_pos = FindMainIslandPosition(0, 100, true); - npc_tuesday = CreateObjectAbove(Clonk, g_tuesday_pos[0]+20, g_tuesday_pos[1]-10); - npc_tuesday->SetDir(DIR_Left); - npc_tuesday->SetColor(0x804000); - npc_tuesday->SetName("$Tuesday$"); - - return true; -} - -func DoInit(int first_player) -{ - if (!SCEN_TEST) - StartSequence("Intro", 0, GetCrew(first_player)); - else - { - PostIntroInitialize(); - g_intro_done = true; - } - 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; - for (i = 0; crew = GetCrew(plr, i); ++i) - { - var pos = FindMainIslandPosition(); - crew->SetPosition(pos[0], pos[1] - 11); - crew->CreateContents(Shovel); - if (SCEN_TEST) - { - var cs = FindObject(Find_ID(ConstructionSite)); - crew->SetPosition(cs->GetX(), cs->GetY()-20); - } - } - - // Claim ownership of unowned structures - for (var structure in FindObjects(Find_Or(Find_Category(C4D_Structure), Find_Func("IsFlagpole")), Find_Owner(NO_OWNER))) - structure->SetOwner(plr); - - return; -} - -// Initializes environment and disasters. -private func InitEnvironment() -{ - // Water refill from sides - var initial_water_level = 0; - while (GetMaterial(0,initial_water_level) != Material("Water")) ++initial_water_level; - ScheduleCall(nil, this.EnsureWaterLevel, 20, 999999999, initial_water_level); - - // Set a certain parallax. - SetSkyParallax(0, 20, 20); - - // Ambience sounds - CreateObjectAbove(Ambience); - - // No disasters for now - //Meteor->SetChance(5); Cloud->SetLightning(16); - - return; -} - -// Ensures that the sea doesn't disappear -func EnsureWaterLevel(int level, bool no_recursion) -{ - var water_mat = Material("Water"); - if (GetMaterial(0,level) != water_mat) CastPXS("Water", 100, 20, 0,level, 90, 10); - if (GetMaterial(LandscapeWidth()-1,level) != water_mat) CastPXS("Water", 100, 20, LandscapeWidth()-1,level, 270, 10); - // Extra insertion at a lower level so it's not easy to block off - if (!no_recursion && !Random(3)) EnsureWaterLevel(level + 50 + Random(450), true); - return true; -} - -private func InitVegetation() -{ - // Grass on starting island. - PlaceGrass(85); - - // Place some cocont trees all around the main island - for (var i = 0; i < 10 + Random(8); i++) - PlaceVegetation(Tree_Coconut, 0, 0, LandscapeWidth(), LandscapeHeight(), 1000 * (61 + Random(40))); - - // Create an effect to make sure there will always grow some new trees. - ScheduleCall(nil, this.EnsureTrees, 100, 999999999); - - // Some objects in the earth. - PlaceObjects(Rock, 10 + Random(10),"Earth"); - PlaceObjects(Firestone, 35 + Random(5), "Earth"); - PlaceObjects(Loam, 25 + Random(5), "Earth"); - - // Underwater vegetation - Seaweed->Place(20); - Coral->Place(30); - - return; -} - -// Ensures that there will always grow some trees on the main island. -func EnsureTrees() -{ - var wdt = LandscapeWidth(); - var hgt = LandscapeHeight(); - // Place a tree if there are less than eight trees, with increasing likelihood for lower amounts of trees. - var nr_trees = ObjectCount(Find_Func("IsTree"), Find_Func("IsStanding")); - if (Random(9) >= nr_trees) - if (!Random(20)) - PlaceVegetation(Tree_Coconut, main_island_x - 300, main_island_y - 200, 600, 400, 3); - return true; -} - -private func InitAnimals() -{ - // Place fish in upper ocean area (there tend to be small basins below, where lots of fish could get stuck) - var fish_area = GetFishArea(); - Fish->Place(50, fish_area); - Piranha->Place(25, fish_area); - ScheduleCall(nil, this.EnsureAnimals, 237, 999999999); - return true; -} - -private func GetFishArea() { return Shape->Rectangle(50, main_island_y, LandscapeWidth() - 100, LandscapeHeight()/2 - main_island_y); } - -private func EnsureAnimals() -{ - if (ObjectCount(Find_ID(Fish), Find_Not(Find_Action("Dead"))) < 50) DoFishSpawn(Fish); - if (ObjectCount(Find_ID(Piranha), Find_Not(Find_Action("Dead"))) < 25) DoFishSpawn(Piranha); - return true; -} - -private func DoFishSpawn(fish_type) -{ - // Try placement away from Clonks. If a Clonk was nearby, just remove it immediately. - var fish = fish_type->Place(1, GetFishArea()); - if (fish) - if (fish->FindObject(fish->Find_Distance(300), Find_ID(Clonk), Find_OCF(OCF_Alive))) - fish->RemoveObject(); - return fish; -} - -// Initializes the main island according to the material specification. -private func InitMainIsland() -{ - var amount = 3; - var pos; - - // Always start with a lorry filled with: hammer(x2), axe(x2), wood(x6) and metal(x4). - var lorry_pos = FindMainIslandPosition(0, 80); - var lorry = CreateObjectAbove(Lorry, lorry_pos[0], lorry_pos[1] - 8); - lorry->CreateContents(Hammer, 2); - lorry->CreateContents(Axe, 2); - lorry->CreateContents(Wood, 6); - lorry->CreateContents(Metal, 4); - - // If more material is specified, create a small settlement: flag(x2) and windmill. - // Also fill lorry a bit more with: pickaxe(x1), dynamite(x4), wood(x4), metal(x2). - if (amount >= 2) - { - pos = FindMainIslandPosition(-120, 20); - CreateObjectAbove(Flagpole, pos[0]-7, pos[1]); - var rfp = CreateObjectAbove(Flagpole, pos[0]+7, pos[1]); - rfp->SetNeutral(true); - pos = FindMainIslandPosition(120, 20); - CreateObjectAbove(Flagpole, pos[0], pos[1]); - pos = FindMainIslandPosition(nil, nil, true); - CreateObjectAbove(WindGenerator, pos[0], pos[1]); - lorry->CreateContents(Wood, 4); - lorry->CreateContents(Metal, 2); - lorry->CreateContents(Pickaxe, 1); - lorry->CreateContents(Dynamite, 4); - } - - // If still more material is specified, create a larger settlement: sawmill, chemical lab, tools workshop. - // Also fill lorry a bit more with: Barrel (x1), Bucket(x1), Loam(x4), DynamiteBox(x2). - if (amount >= 3) - { - pos = FindMainIslandPosition(nil, nil, true); - CreateObjectAbove(Sawmill, pos[0], pos[1]); - pos = FindMainIslandPosition(nil, nil, true); - CreateObjectAbove(ChemicalLab, pos[0], pos[1]); - pos = FindMainIslandPosition(nil, nil, true); - CreateObjectAbove(ToolsWorkshop, pos[0], pos[1]); - - lorry->CreateContents(Barrel, 1); - lorry->CreateContents(Bucket, 1); - lorry->CreateContents(Loam, 4); - lorry->CreateContents(DynamiteBox, 1); - lorry->CreateContents(WallKit, 4); - //lorry->CreateContents(Boompack, 1); - } - - return; -} - -// Tries to find a position on the main island. -private func FindMainIslandPosition(int xpos, int sep, bool no_struct) -{ - if (xpos == nil) - xpos = 0; - if (sep == nil) - sep = 250; - - for (var i = 0; i < 100; i++) - { - var x = main_island_x + xpos + Random(sep*2+1)-sep; - var y = main_island_y / 2 - 220; - - while (!GBackSolid(x, y) && y < LandscapeHeight()*3/4) - y++; - - 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_ID(WindGenerator)), Find_Distance(60, x, y))) - break; - } - - return [x, y]; -} - - -/* Outro */ - -// Goal fulfilled -public func OnGoalsFulfilled() -{ - SetNextMission("Missions.ocf/TreasureHunt.ocs"); - GainScenarioAchievement("Done"); - GainMissionAccess("S2Sea"); - StartSequence("Outro", 0); - // Return true to force goal rule to not call GameOver() yet - return true; -} - - -// Intro helper - -global func Particles_Smoke(...) -{ - var p = inherited(...); - if (g_intro_sky_moving) - { - p.ForceX = -300; - p.DampingX = 800; - } - return p; -} diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/SectIntro.ocg/Map.bmp b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/SectIntro.ocg/Map.bmp deleted file mode 100644 index 2c28be1e6..000000000 Binary files a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/SectIntro.ocg/Map.bmp and /dev/null differ diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/SectIntro.ocg/Scenario.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/SectIntro.ocg/Scenario.txt deleted file mode 100644 index a0dc63fe4..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/SectIntro.ocg/Scenario.txt +++ /dev/null @@ -1,5 +0,0 @@ -[Landscape] -BottomOpen=0 -TopOpen=1 -MapZoom=20,0,5,20 -Sky=Clouds2 diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/StringTblDE.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/StringTblDE.txt deleted file mode 100644 index 92bdf6c9d..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/StringTblDE.txt +++ /dev/null @@ -1 +0,0 @@ -Tuesday=Dienstag diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/StringTblUS.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/StringTblUS.txt deleted file mode 100644 index 7ca85b75d..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/StringTblUS.txt +++ /dev/null @@ -1 +0,0 @@ -Tuesday=Tuesday diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/DlgTuesday.c b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/DlgTuesday.c deleted file mode 100644 index cd1a41770..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/DlgTuesday.c +++ /dev/null @@ -1,48 +0,0 @@ -// NPC Tuesday: Sits on the island and does nothing -// (except giving some hints) - -#appendto Dialogue - -func Dlg_Tuesday_1(object clonk) -{ - MessageBox("$Tuesday1$", clonk, dlg_target); - return true; -} - -func Dlg_Tuesday_2(object clonk) -{ - var options = [["$TuesdayQCommunicator$", "Dlg_Tuesday_Communicator"], ["$TuesdayQGems$", "Dlg_Tuesday_Gems"], ["$TuesdayQFish$", "Dlg_Tuesday_Fish"], ["$TuesdayQWater$", "Dlg_Tuesday_Water"], ["$TuesdayQBye$", "StopDialogue()"]]; - MessageBox("", clonk, clonk, nil, false, options); - SetDialogueProgress(1); - return true; -} - -func Dlg_Tuesday_Communicator(object clonk, q) -{ - SetDialogueProgress(2); - return MessageBox("$TuesdayACommunicator$", clonk); -} - -func Dlg_Tuesday_Gems(object clonk, q) -{ - SetDialogueProgress(2); - return MessageBox("$TuesdayAGems$", clonk); -} - -func Dlg_Tuesday_Fish(object clonk, q) -{ - SetDialogueProgress(2); - return MessageBox("$TuesdayAFish$", clonk); -} - -func Dlg_Tuesday_Water(object clonk, q) -{ - SetDialogueProgress(10); - return MessageBox("$TuesdayAWater$", clonk); -} - -func Dlg_Tuesday_10(object clonk) -{ - SetDialogueProgress(2); - return MessageBox("$TuesdayAWater2$", clonk); -} diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/Gems_NoSell.c b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/Gems_NoSell.c deleted file mode 100644 index ea9777df2..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/Gems_NoSell.c +++ /dev/null @@ -1,2 +0,0 @@ -#appendto Ruby -func IsValuable(){} \ No newline at end of file diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/SeqIntro.c b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/SeqIntro.c deleted file mode 100644 index 07eec921f..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/SeqIntro.c +++ /dev/null @@ -1,271 +0,0 @@ -#appendto Sequence - -static g_intro_sky_moving; -static npc_tuesday; - -func Intro_Start() -{ - // Intro starts high up in the clouds - LoadScenarioSection("Intro"); - SetPlayList("skyisland", NO_OWNER, true); - SetWind(-100); - SetSkyParallax(0, 20, 20, -10, 0); - - this.plane = CreateObjectAbove(Plane, 500, 200); - this.plane->SetColor(0xa04000); - this.pilot = CreateObjectAbove(Clonk, 100, 100, NO_OWNER); - this.pilot->MakeInvincible(); - 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/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/SeqOutro.c b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/SeqOutro.c deleted file mode 100644 index 30bfb448b..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/SeqOutro.c +++ /dev/null @@ -1,106 +0,0 @@ -#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_1() -{ - this.communicator->StartCommunication(); // 250 frames - return ScheduleNext(650); -} - -func Outro_2() -{ - Dialogue->MessageBoxAll("$Outro2$", this.hero, true); // let's see if it works - return ScheduleNext(50); -} - -func Outro_3() -{ - this.communicator->SendCode("...---..."); // 159 frames - return ScheduleNext(200); -} - -func Outro_4() -{ - this.communicator->StopCommunication(); - MessageBoxAll("$Outro3$", this.hero, true); // i wonder if anyone has heard us - this.plane = CreateObjectAbove(Plane, 100, main_island_y-100); - this.plane->SetContactDensity(85); // only collision with brick for proper landing - this.pilot = CreateObjectAbove(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_5() -{ - // 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_6() -{ - MessageBoxAll("$Outro5$", this.hero, true); // we're saved! - this.plane->StartInstantFlight(245, 15); - this.plane->SetContactDensity(C4M_Solid); - return ScheduleNext(60); -} - -func Outro_7() -{ - this.plane->StartInstantFlight(280, 5); - return ScheduleNext(15); -} - -func Outro_8() -{ - this.plane->CancelFlight(); - return ScheduleNext(40); -} - -func Outro_9() -{ - this.pilot->Exit(); - MessageBoxAll("$Outro6$", this.pilot, true); // hop on everyone! - return ScheduleNext(100); -} - -func Outro_10() -{ - this.plane->FaceRight(); - return ScheduleNext(100); -} - -func Outro_11() -{ - 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/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/StringTblDE.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/StringTblDE.txt deleted file mode 100644 index 3afb27cdc..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/StringTblDE.txt +++ /dev/null @@ -1,48 +0,0 @@ -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 glitzernde 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/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/StringTblUS.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/StringTblUS.txt deleted file mode 100644 index 83c2b432a..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/System.ocg/StringTblUS.txt +++ /dev/null @@ -1,47 +0,0 @@ -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/Experimental.ocf/Ambience_DeepSeaMining.ocs/Title.txt b/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Title.txt deleted file mode 100644 index 84a978b8c..000000000 --- a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Title.txt +++ /dev/null @@ -1,2 +0,0 @@ -DE:AmbienceTest: Tiefseemine -US:AmbienceTest: Deep sea mining \ No newline at end of file diff --git a/planet/Missions.ocf/Crash.ocs/Objects.c b/planet/Missions.ocf/Crash.ocs/Objects.c index f86b96aa8..0920ab8cc 100644 --- a/planet/Missions.ocf/Crash.ocs/Objects.c +++ b/planet/Missions.ocf/Crash.ocs/Objects.c @@ -2,6 +2,8 @@ func InitializeObjects() { + CreateObject(Ambience); + CreateObject(Grass, 555, 550); CreateObjectAbove(Grass, 533, 550); CreateObjectAbove(Grass, 1306, 706); diff --git a/planet/Missions.ocf/DeepSeaMining.ocs/Script.c b/planet/Missions.ocf/DeepSeaMining.ocs/Script.c index 2c1c9064b..f7d9b61ee 100644 --- a/planet/Missions.ocf/DeepSeaMining.ocs/Script.c +++ b/planet/Missions.ocf/DeepSeaMining.ocs/Script.c @@ -33,6 +33,7 @@ protected func PostIntroInitialize() } // Initialize different parts of the scenario. + CreateObject(Ambience); InitEnvironment(); InitVegetation(); InitAnimals(); diff --git a/planet/Missions.ocf/Raid.ocs/Objects.c b/planet/Missions.ocf/Raid.ocs/Objects.c index 230821e5f..0e24fa7be 100644 --- a/planet/Missions.ocf/Raid.ocs/Objects.c +++ b/planet/Missions.ocf/Raid.ocs/Objects.c @@ -4,6 +4,8 @@ static g_chemical, g_cabin, g_sawmill, g_workshop, g_windmill, g_flagpole, npc_n func InitializeObjects() { + CreateObject(Ambience); + var Rule_BaseRespawn001 = CreateObject(Rule_BaseRespawn); Rule_BaseRespawn001->SetInventoryTransfer(true); Rule_BaseRespawn001->SetFreeCrew(true); diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Objects.c b/planet/Missions.ocf/TreasureHunt.ocs/Objects.c index 73c2f29dd..5d8e88811 100644 --- a/planet/Missions.ocf/TreasureHunt.ocs/Objects.c +++ b/planet/Missions.ocf/TreasureHunt.ocs/Objects.c @@ -1,13 +1,9 @@ /* Automatically created objects file */ -static npc_dagobert, npc_tarzan, g_golden_shovel, g_flagpole; +static g_flagpole, npc_dagobert, npc_tarzan, g_golden_shovel; func InitializeObjects() { - var Rule_BaseRespawn001 = CreateObject(Rule_BaseRespawn, 0, 0); - Rule_BaseRespawn001->SetInventoryTransfer(true); - Rule_BaseRespawn001->SetFreeCrew(true); - CreateObjectAbove(Grass, 1627, 396); CreateObjectAbove(Grass, 1636, 385); CreateObjectAbove(Grass, 1786, 469); @@ -15,35 +11,39 @@ func InitializeObjects() CreateObjectAbove(Grass, 1564, 493); CreateObjectAbove(Grass, 1537, 525); CreateObjectAbove(Grass, 1585, 486); - CreateObjectAbove(Grass, 1739, 430); + CreateObject(Grass, 1739, 429); - var Column0010 = CreateObjectAbove(Column, 779, 591); - Column0010->SetClrModulation(0xffffd0d0); - Column0010->SetMeshMaterial("AncientColumn", 0); - Column0010.Plane = 50; + var Chest001 = CreateObjectAbove(Chest, 1002, 313); + Chest001.Plane = 50; - var Chest0009 = CreateObjectAbove(Chest, 1002, 313); - Chest0009.Plane = 50; + var Column001 = CreateObjectAbove(Column, 779, 591); + Column001->SetClrModulation(0xffffd0d0); + Column001->SetMeshMaterial("AncientColumn", 0); + Column001.Plane = 50; - CreateObject(Rule_TeamAccount, 0, 0); + var Rule_BaseRespawn001 = CreateObject(Rule_BaseRespawn); + Rule_BaseRespawn001->SetInventoryTransfer(true); + Rule_BaseRespawn001->SetFreeCrew(true); - CreateObject(Rule_NoPowerNeed, 0, 0); + CreateObject(Rule_TeamAccount); - var LargeCaveMushroom0013 = CreateObjectAbove(LargeCaveMushroom, 1308, 1038); - LargeCaveMushroom0013->SetClrModulation(0xffe4effc); - var LargeCaveMushroom0017 = CreateObjectAbove(LargeCaveMushroom, 1345, 1028); - LargeCaveMushroom0017->SetClrModulation(0xffe1e3ee); - LargeCaveMushroom0017->SetMeshMaterial("FlyAmanitaMushroom", 0); - var LargeCaveMushroom0021 = CreateObjectAbove(LargeCaveMushroom, 1399, 1025); - LargeCaveMushroom0021->SetClrModulation(0xfff3e3e7); - LargeCaveMushroom0021->SetMeshMaterial("FlyAmanitaMushroom", 0); - var LargeCaveMushroom0025 = CreateObjectAbove(LargeCaveMushroom, 1464, 999); - LargeCaveMushroom0025->SetClrModulation(0xffe0e6dd); - var LargeCaveMushroom0029 = CreateObjectAbove(LargeCaveMushroom, 1450, 1012); - LargeCaveMushroom0029->SetClrModulation(0xffe4eae2); - var LargeCaveMushroom0033 = CreateObjectAbove(LargeCaveMushroom, 1523, 993); - LargeCaveMushroom0033->SetClrModulation(0xffe2deee); - LargeCaveMushroom0033->SetMeshMaterial("FlyAmanitaMushroom", 0); + CreateObject(Rule_NoPowerNeed); + + var LargeCaveMushroom001 = CreateObjectAbove(LargeCaveMushroom, 1308, 1038); + LargeCaveMushroom001->SetClrModulation(0xffe4effc); + var LargeCaveMushroom002 = CreateObjectAbove(LargeCaveMushroom, 1345, 1028); + LargeCaveMushroom002->SetClrModulation(0xffe1e3ee); + LargeCaveMushroom002->SetMeshMaterial("FlyAmanitaMushroom", 0); + var LargeCaveMushroom003 = CreateObjectAbove(LargeCaveMushroom, 1399, 1025); + LargeCaveMushroom003->SetClrModulation(0xfff3e3e7); + LargeCaveMushroom003->SetMeshMaterial("FlyAmanitaMushroom", 0); + var LargeCaveMushroom004 = CreateObjectAbove(LargeCaveMushroom, 1464, 999); + LargeCaveMushroom004->SetClrModulation(0xffe0e6dd); + var LargeCaveMushroom005 = CreateObjectAbove(LargeCaveMushroom, 1450, 1012); + LargeCaveMushroom005->SetClrModulation(0xffe4eae2); + var LargeCaveMushroom006 = CreateObjectAbove(LargeCaveMushroom, 1523, 993); + LargeCaveMushroom006->SetClrModulation(0xffe2deee); + LargeCaveMushroom006->SetMeshMaterial("FlyAmanitaMushroom", 0); CreateObjectAbove(Trunk, 1000, 313); CreateObjectAbove(Trunk, 1006, 313); @@ -53,12 +53,10 @@ func InitializeObjects() CreateObjectAbove(EnvPack_Guidepost, 81, 743); CreateObjectAbove(EnvPack_BridgeRustic, 591, 356); - CreateObjectAbove(EnvPack_Bag, 506, 968); CreateObjectAbove(EnvPack_Lantern, 356, 458); - - CreateObjectAbove(EnvPack_TreeTrunks, 601, 408); + CreateObject(EnvPack_TreeTrunks, 601, 408); CreateObjectAbove(EnvPack_Rail, 564, 354); CreateObjectAbove(EnvPack_Rail, 616, 356); @@ -73,24 +71,18 @@ func InitializeObjects() CreateObjectAbove(Fern, 1645, 384); CreateObjectAbove(Fern, 1525, 535); - var Branch0066 = CreateObjectAbove(Branch, 1320, 326); - Branch0066->SetR(148); - Branch0066->SetPosition(1320, 329); - var Branch0067 = CreateObjectAbove(Branch, 1327, 298); - Branch0067->SetR(165); - Branch0067->SetPosition(1327, 291); - var Branch0068 = CreateObjectAbove(Branch, 1424, 257); - Branch0068->SetR(108); - Branch0068->SetPosition(1424, 260); - var Branch0069 = CreateObjectAbove(Branch, 1430, 248); - Branch0069->SetR(39); - Branch0069->SetPosition(1430, 240); - var Branch0070 = CreateObjectAbove(Branch, 1413, 262); - Branch0070->SetR(128); - Branch0070->SetPosition(1413, 265); - var Branch0071 = CreateObjectAbove(Branch, 1396, 263); - Branch0071->SetR(-131); - Branch0071->SetPosition(1396, 266); + var Branch001 = CreateObject(Branch, 1320, 329); + Branch001->SetR(148); + var Branch002 = CreateObject(Branch, 1327, 291); + Branch002->SetR(165); + var Branch003 = CreateObject(Branch, 1424, 260); + Branch003->SetR(108); + var Branch004 = CreateObject(Branch, 1430, 240); + Branch004->SetR(39); + var Branch005 = CreateObject(Branch, 1413, 265); + Branch005->SetR(128); + var Branch006 = CreateObject(Branch, 1396, 266); + Branch006->SetR(-131); CreateObjectAbove(SproutBerryBush, 1823, 493); @@ -102,532 +94,455 @@ func InitializeObjects() CreateObjectAbove(Tree_Coniferous, 1864, 464); CreateObjectAbove(Tree_Coniferous, 2788, 680); - var Lichen0093 = CreateObjectAbove(Lichen, 2694, 706); - Lichen0093->SetAction("Grown"); + var Lichen001 = CreateObjectAbove(Lichen, 2694, 706); + Lichen001->SetAction("Grown"); CreateObjectAbove(BigRock, 1301, 500); CreateObjectAbove(BigRock, 1207, 282); - CreateObjectAbove(BigRock, 1291, 263); + CreateObject(BigRock, 1291, 260); + var Amethyst001 = CreateObjectAbove(Amethyst, 803, 583); + Amethyst001.Plane = 190; - var Amethyst0099 = CreateObjectAbove(Amethyst, 803, 583); - Amethyst0099.Plane = 190; + var Chest002 = CreateObjectAbove(Chest, 515, 967); + Chest002.tool_spawn = TeleGlove; + var Chest003 = CreateObjectAbove(Chest, 227, 760); + Chest003.tool_spawn = Pickaxe; + var Chest004 = CreateObjectAbove(Chest, 624, 943); + Chest004.tool_spawn = GrappleBow; + var Chest005 = CreateObjectAbove(Chest, 603, 942); + Chest005.tool_spawn = GrappleBow; + var Chest021 = CreateObjectAbove(Chest, 472, 455); + var Chest010 = CreateObjectAbove(Chest, 546, 383); + var Chest006 = CreateObjectAbove(Chest, 840, 47); + Chest006.tool_spawn = WindBag; + var Chest013 = CreateObjectAbove(Chest, 853, 1574); + var Chest012 = CreateObjectAbove(Chest, 1428, 1542); + var Chest011 = CreateObjectAbove(Chest, 1765, 1191); + var Chest007 = CreateObjectAbove(Chest, 1878, 719); + Chest007.tool_spawn = Axe; + var Chest014 = CreateObjectAbove(Chest, 1943, 714); + var Chest015 = CreateObjectAbove(Chest, 2103, 1119); + var Chest016 = CreateObjectAbove(Chest, 397, 583); + var Chest008 = CreateObjectAbove(Chest, 871, 583); + Chest008->SetMeshMaterial("GoldenChest", 0); + var Chest018 = CreateObjectAbove(Chest, 12, 39); + var Chest017 = CreateObjectAbove(Chest, 2786, 55); + var Chest009 = CreateObjectAbove(Chest, 1830, 486); + Chest009.tool_spawn = Hammer; + var Chest019 = CreateObjectAbove(Chest, 730, 135); + var Chest020 = CreateObjectAbove(Chest, 1626, 1591); - var Chest0101 = CreateObjectAbove(Chest, 515, 967); - Chest0101.tool_spawn = TeleGlove; - var Chest0102 = CreateObjectAbove(Chest, 227, 760); - Chest0102.tool_spawn = Pickaxe; - var Chest0103 = CreateObjectAbove(Chest, 624, 943); - Chest0103.tool_spawn = GrappleBow; - var Chest0104 = CreateObjectAbove(Chest, 603, 942); - Chest0104.tool_spawn = GrappleBow; - var Chest0105 = CreateObjectAbove(Chest, 472, 455); - var Chest0106 = CreateObjectAbove(Chest, 546, 383); - var Chest0107 = CreateObjectAbove(Chest, 840, 47); - Chest0107.tool_spawn = WindBag; - var Chest0108 = CreateObjectAbove(Chest, 853, 1574); - var Chest0109 = CreateObjectAbove(Chest, 1428, 1542); - var Chest0110 = CreateObjectAbove(Chest, 1765, 1191); - var Chest0111 = CreateObjectAbove(Chest, 1878, 719); - Chest0111.tool_spawn = Axe; - var Chest0112 = CreateObjectAbove(Chest, 1943, 714); - var Chest0113 = CreateObjectAbove(Chest, 2103, 1119); - var Chest0114 = CreateObjectAbove(Chest, 397, 583); - var Chest0115 = CreateObjectAbove(Chest, 871, 583); - Chest0115->SetMeshMaterial("GoldenChest", 0); - var Chest0116 = CreateObjectAbove(Chest, 12, 39); - var Chest0117 = CreateObjectAbove(Chest, 2786, 55); - var Chest0118 = CreateObjectAbove(Chest, 1830, 486); - Chest0118.tool_spawn = Hammer; - var Chest0119 = CreateObjectAbove(Chest, 730, 135); - var Chest0120 = CreateObjectAbove(Chest, 1626, 1591); + var StoneDoor001 = CreateObject(StoneDoor, 940, 1132); + StoneDoor001->SetComDir(COMD_Down); + StoneDoor001->MakeInvincible(); + var StoneDoor002 = CreateObject(StoneDoor, 1084, 1132); + StoneDoor002->SetComDir(COMD_Down); + StoneDoor002->MakeInvincible(); + var StoneDoor003 = CreateObject(StoneDoor, 564, 436); + StoneDoor003->SetComDir(COMD_Down); + StoneDoor003->MakeInvincible(); + var StoneDoor004 = CreateObject(StoneDoor, 843, 716); + StoneDoor004->SetComDir(COMD_Down); + StoneDoor004->MakeInvincible(); + var StoneDoor005 = CreateObject(StoneDoor, 1058, 700); + StoneDoor005->SetComDir(COMD_Down); + StoneDoor005->MakeInvincible(); + var StoneDoor006 = CreateObject(StoneDoor, 1092, 1028); + StoneDoor006->SetComDir(COMD_Down); + StoneDoor006->MakeInvincible(); + var StoneDoor007 = CreateObject(StoneDoor, 1892, 932); + StoneDoor007->SetComDir(COMD_Down); + StoneDoor007->MakeInvincible(); + var StoneDoor008 = CreateObject(StoneDoor, 813, 716); + StoneDoor008->SetComDir(COMD_Down); + StoneDoor008->MakeInvincible(); + var StoneDoor009 = CreateObject(StoneDoor, 781, 716); + StoneDoor009->SetComDir(COMD_Down); + StoneDoor009->SetClrModulation(0xffa0a0a0); + var StoneDoor010 = CreateObject(StoneDoor, 692, 748); + StoneDoor010->SetComDir(COMD_Down); + StoneDoor010->MakeInvincible(); + var StoneDoor011 = CreateObject(StoneDoor, 684, 332); + StoneDoor011->SetComDir(COMD_Down); + StoneDoor011->MakeInvincible(); - var StoneDoor0121 = CreateObjectAbove(StoneDoor, 940, 1151); - StoneDoor0121->SetComDir(COMD_Down); - StoneDoor0121->MakeInvincible(); - var StoneDoor0123 = CreateObjectAbove(StoneDoor, 1084, 1151); - StoneDoor0123->SetComDir(COMD_Down); - StoneDoor0123->MakeInvincible(); - var StoneDoor0125 = CreateObjectAbove(StoneDoor, 564, 455); - StoneDoor0125->SetComDir(COMD_Down); - StoneDoor0125->MakeInvincible(); - var StoneDoor0127 = CreateObjectAbove(StoneDoor, 843, 735); - StoneDoor0127->SetComDir(COMD_Down); - StoneDoor0127->MakeInvincible(); - var StoneDoor0129 = CreateObjectAbove(StoneDoor, 1058, 719); - StoneDoor0129->SetComDir(COMD_Down); - StoneDoor0129->MakeInvincible(); - var StoneDoor0131 = CreateObjectAbove(StoneDoor, 1092, 1047); - StoneDoor0131->SetComDir(COMD_Down); - StoneDoor0131->MakeInvincible(); - var StoneDoor0133 = CreateObjectAbove(StoneDoor, 1892, 951); - StoneDoor0133->SetComDir(COMD_Down); - StoneDoor0133->MakeInvincible(); - var StoneDoor0135 = CreateObjectAbove(StoneDoor, 813, 735); - StoneDoor0135->SetComDir(COMD_Down); - StoneDoor0135->MakeInvincible(); - var StoneDoor0137 = CreateObjectAbove(StoneDoor, 781, 735); - StoneDoor0137->SetComDir(COMD_Down); - StoneDoor0137->SetClrModulation(0xffa0a0a0); - var StoneDoor0138 = CreateObjectAbove(StoneDoor, 692, 767); - StoneDoor0138->SetComDir(COMD_Down); - StoneDoor0138->MakeInvincible(); - var StoneDoor0140 = CreateObjectAbove(StoneDoor, 684, 351); - StoneDoor0140->SetComDir(COMD_Down); - StoneDoor0140->MakeInvincible(); - - var SpinWheel0142 = CreateObjectAbove(SpinWheel, 589, 457); - SpinWheel0142->SetMeshMaterial("SpinWheelGearRed", 0); - SpinWheel0142->SetStoneDoor(StoneDoor0121); - var SpinWheel0143 = CreateObjectAbove(SpinWheel, 611, 456); - SpinWheel0143->SetMeshMaterial("SpinWheelGearBlue", 0); - SpinWheel0143->SetStoneDoor(StoneDoor0123); - var SpinWheel0144 = CreateObjectAbove(SpinWheel, 619, 410); - SpinWheel0144->SetMeshMaterial("SpinWheelBaseAlt", 1); - SpinWheel0144->SetStoneDoor(StoneDoor0125); - var SpinWheel0145 = CreateObjectAbove(SpinWheel, 1223, 1553); - SpinWheel0145->SetStoneDoor(StoneDoor0129); - var SpinWheel0146 = CreateObjectAbove(SpinWheel, 1117, 1048); - SpinWheel0146->SetStoneDoor(StoneDoor0131); - var SpinWheel0147 = CreateObjectAbove(SpinWheel, 2761, 690); - SpinWheel0147->SetMeshMaterial("SpinWheelBaseAlt", 1); - SpinWheel0147->SetStoneDoor(StoneDoor0135); - var SpinWheel0148 = CreateObjectAbove(SpinWheel, 1850, 1463); - SpinWheel0148->SetMeshMaterial("SpinWheelGearRed", 0); - SpinWheel0148->SetMeshMaterial("SpinWheelBaseAlt", 1); - SpinWheel0148->SetStoneDoor(StoneDoor0127); - var SpinWheel0149 = CreateObjectAbove(SpinWheel, 2793, 1521); - SpinWheel0149->SetMeshMaterial("SpinWheelGearRed", 0); - SpinWheel0149->SetMeshMaterial("SpinWheelBaseAlt", 1); - SpinWheel0149->SetStoneDoor(StoneDoor0133); - var SpinWheel0150 = CreateObjectAbove(SpinWheel, 830, 735); - SpinWheel0150->SetStoneDoor(StoneDoor0138); - var SpinWheel0151 = CreateObjectAbove(SpinWheel, 703, 352); - SpinWheel0151->SetMeshMaterial("SpinWheelBaseAlt", 1); - SpinWheel0151->SetStoneDoor(StoneDoor0140); + var SpinWheel001 = CreateObjectAbove(SpinWheel, 589, 457); + SpinWheel001->SetMeshMaterial("SpinWheelGearRed", 0); + SpinWheel001->SetStoneDoor(StoneDoor001); + var SpinWheel002 = CreateObjectAbove(SpinWheel, 611, 456); + SpinWheel002->SetMeshMaterial("SpinWheelGearBlue", 0); + SpinWheel002->SetStoneDoor(StoneDoor002); + var SpinWheel003 = CreateObjectAbove(SpinWheel, 619, 410); + SpinWheel003->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel003->SetStoneDoor(StoneDoor003); + var SpinWheel004 = CreateObjectAbove(SpinWheel, 1223, 1553); + SpinWheel004->SetStoneDoor(StoneDoor005); + var SpinWheel005 = CreateObjectAbove(SpinWheel, 1117, 1048); + SpinWheel005->SetStoneDoor(StoneDoor006); + var SpinWheel006 = CreateObjectAbove(SpinWheel, 2761, 690); + SpinWheel006->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel006->SetStoneDoor(StoneDoor008); + var SpinWheel007 = CreateObjectAbove(SpinWheel, 1850, 1463); + SpinWheel007->SetMeshMaterial("SpinWheelGearRed", 0); + SpinWheel007->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel007->SetStoneDoor(StoneDoor004); + var SpinWheel008 = CreateObjectAbove(SpinWheel, 2793, 1521); + SpinWheel008->SetMeshMaterial("SpinWheelGearRed", 0); + SpinWheel008->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel008->SetStoneDoor(StoneDoor007); + var SpinWheel009 = CreateObjectAbove(SpinWheel, 830, 735); + SpinWheel009->SetStoneDoor(StoneDoor010); + var SpinWheel010 = CreateObjectAbove(SpinWheel, 703, 352); + SpinWheel010->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel010->SetStoneDoor(StoneDoor011); CreateObjectAbove(Pump, 1027, 1152); CreateObjectAbove(Sawmill, 1259, 1047); - var ToolsWorkshop0156 = CreateObjectAbove(ToolsWorkshop, 1169, 903); + var ToolsWorkshop001 = CreateObjectAbove(ToolsWorkshop, 1169, 903); - var Column0158 = CreateObjectAbove(Column, 779, 488); - Column0158->SetR(180); - Column0158->SetClrModulation(0xffffd0d0); - Column0158->SetMeshMaterial("AncientColumn", 0); - Column0158->SetPosition(779, 488); - var Column0159 = CreateObjectAbove(Column, 1419, 217); - Column0159->SetMeshMaterial("AncientColumn", 0); - CreateObjectAbove(Column, 1386, 616); + var Column002 = CreateObject(Column, 779, 488); + Column002->SetR(180); + Column002->SetClrModulation(0xffffd0d0); + Column002->SetMeshMaterial("AncientColumn", 0); + var Column003 = CreateObject(Column, 1419, 217); + Column003->SetMeshMaterial("AncientColumn", 0); + CreateObject(Column, 1386, 616); CreateObjectAbove(Ruin_Windmill, 1678, 375); CreateObjectAbove(Ruin_WoodenCabin, 1199, 1046); - var Idol0163 = CreateObjectAbove(Idol, 1045, 721); - Idol0163->SetMeshMaterial("IdolGrayColor", 0); + var Idol001 = CreateObjectAbove(Idol, 1045, 721); + Idol001->SetMeshMaterial("IdolGrayColor", 0); g_flagpole = CreateObjectAbove(Flagpole, 210, 1185); - g_flagpole->SetNeutral(true); g_flagpole.StaticSaveVar = "g_flagpole"; + g_flagpole->SetNeutral(true); - var LotsOfCoins0164 = CreateObjectAbove(LotsOfCoins, 805, 592); - LotsOfCoins0164.Plane = 200; + var LotsOfCoins001 = CreateObject(LotsOfCoins, 805, 583); + LotsOfCoins001.Plane = 200; - var Idol0230 = CreateObjectAbove(Idol, 824, 583); - Idol0230->SetR(-4); - Idol0230.Plane = 220; - Idol0230->SetPosition(824, 568); + var Idol002 = CreateObject(Idol, 824, 568); + Idol002->SetR(-4); + Idol002.Plane = 220; - var Lorry0231 = CreateObjectAbove(Lorry, 200, 1183); - var Lorry0233 = CreateObjectAbove(Lorry, 708, 1407); - Lorry0233->SetMeshMaterial("RuinedLorry", 0); + var Lorry002 = CreateObjectAbove(Lorry, 200, 1183); + var Lorry001 = CreateObjectAbove(Lorry, 708, 1407); + Lorry001->SetMeshMaterial("RuinedLorry", 0); - var Catapult0235 = CreateObjectAbove(Catapult, 1714, 951); - Catapult0235->SetRDir(2); + var Catapult001 = CreateObjectAbove(Catapult, 1714, 951); + Catapult001->SetRDir(-7); CreateObjectAbove(StrawMan, 1924, 439); CreateObjectAbove(StrawMan, 2642, 705); - - var Clonk0238 = CreateObjectAbove(Clonk, 316, 430); - Clonk0238->SetColor(0xff); - S2AI->AddAI(Clonk0238); - S2AI->SetHome(Clonk0238, 315, 422, DIR_Left); - S2AI->SetGuardRange(Clonk0238, 296, 322, 350, 140); - S2AI->SetEncounterCB(Clonk0238, "EncounterCastle"); - Clonk0238->SetDir(DIR_Left); - var Clonk0245 = CreateObjectAbove(Clonk, 501, 455); - Clonk0245->SetDir(DIR_Right); - Clonk0245->SetColor(0xff); - S2AI->AddAI(Clonk0245); - S2AI->SetHome(Clonk0245, 502, 445, DIR_Right); - S2AI->SetGuardRange(Clonk0245, 460, 300, 200, 160); - S2AI->SetMaxAggroDistance(Clonk0245, 60); - var Clonk0252 = CreateObjectAbove(Clonk, 534, 454); - Clonk0252->SetDir(DIR_Right); - Clonk0252->SetColor(0xff); - S2AI->AddAI(Clonk0252); - S2AI->SetHome(Clonk0252, 534, 446, DIR_Right); - S2AI->SetGuardRange(Clonk0252, 460, 300, 200, 160); - S2AI->SetMaxAggroDistance(Clonk0252, 60); - var Clonk0259 = CreateObjectAbove(Clonk, 671, 638); - Clonk0259->SetDir(DIR_Right); - Clonk0259->SetCon(150); - Clonk0259->SetColor(0xffffa000); - S2AI->AddAI(Clonk0259); - S2AI->SetHome(Clonk0259, 671, 629, DIR_Right); - S2AI->SetGuardRange(Clonk0259, 580, 480, 320, 175); - S2AI->SetEncounterCB(Clonk0259, "EncounterFinal"); - npc_dagobert = CreateObjectAbove(Clonk, 369, 1143); + var Clonk001 = CreateObjectAbove(Clonk, 316, 431); + S2AI->AddAI(Clonk001); + S2AI->SetHome(Clonk001, 315, 422, DIR_Left); + S2AI->SetGuardRange(Clonk001, 296, 322, 350, 140); + S2AI->SetEncounterCB(Clonk001, "EncounterCastle"); + Clonk001->SetDir(DIR_Left); + var Clonk002 = CreateObjectAbove(Clonk, 501, 454); + Clonk002->SetDir(DIR_Right); + S2AI->AddAI(Clonk002); + S2AI->SetHome(Clonk002, 502, 445, DIR_Right); + S2AI->SetGuardRange(Clonk002, 460, 300, 200, 160); + S2AI->SetMaxAggroDistance(Clonk002, 60); + var Clonk003 = CreateObjectAbove(Clonk, 534, 455); + Clonk003->SetDir(DIR_Right); + S2AI->AddAI(Clonk003); + S2AI->SetGuardRange(Clonk003, 460, 300, 200, 160); + S2AI->SetMaxAggroDistance(Clonk003, 60); + var Clonk004 = CreateObjectAbove(Clonk, 671, 638); + Clonk004->SetDir(DIR_Right); + Clonk004->SetCon(150); + Clonk004->SetColor(0xffffa000); + S2AI->AddAI(Clonk004); + S2AI->SetHome(Clonk004, 671, 629, DIR_Right); + S2AI->SetGuardRange(Clonk004, 580, 480, 320, 175); + S2AI->SetEncounterCB(Clonk004, "EncounterFinal"); + npc_dagobert = CreateObjectAbove(Clonk, 369, 1142); npc_dagobert->SetColor(0xffa000); npc_dagobert->SetName("Scrooge"); npc_dagobert.StaticSaveVar = "npc_dagobert"; npc_dagobert->MakeInvincible(); npc_dagobert->SetDir(DIR_Left); - var Clonk0273 = CreateObjectAbove(Clonk, 1720, 375); - Clonk0273->SetDir(DIR_Right); - Clonk0273->SetColor(0x808080); - Clonk0273->SetName("Otto"); - Clonk0273->SetSkin(2); - var Clonk0280 = CreateObjectAbove(Clonk, 1868, 950); - Clonk0280->SetColor(0xff0000); - Clonk0280->SetName("Donald"); - Clonk0280->SetDir(DIR_Left); - var Clonk0286 = CreateObjectAbove(Clonk, 676, 942); - Clonk0286->SetDir(DIR_Right); - Clonk0286->SetColor(0x802000); - Clonk0286->SetName("Jane"); - Clonk0286->SetSkin(1); - npc_tarzan = CreateObjectAbove(Clonk, 751, 875); + var Clonk005 = CreateObjectAbove(Clonk, 1720, 375); + Clonk005->SetDir(DIR_Right); + Clonk005->SetColor(0x808080); + Clonk005->SetName("Otto"); + Clonk005->SetSkin(2); + var Clonk006 = CreateObjectAbove(Clonk, 1868, 951); + Clonk006->SetColor(0xff0000); + Clonk006->SetName("Donald"); + Clonk006->SetDir(DIR_Left); + var Clonk007 = CreateObjectAbove(Clonk, 676, 943); + Clonk007->SetDir(DIR_Right); + Clonk007->SetColor(0x802000); + Clonk007->SetName("Jane"); + Clonk007->SetSkin(1); + npc_tarzan = CreateObjectAbove(Clonk, 754, 879); npc_tarzan->SetXDir(3); - npc_tarzan->SetYDir(-1); + npc_tarzan->SetYDir(27); npc_tarzan->SetColor(0x402000); npc_tarzan->SetName("Tarzan"); npc_tarzan.StaticSaveVar = "npc_tarzan"; npc_tarzan->SetDir(DIR_Left); - var Clonk0299 = CreateObjectAbove(Clonk, 498, 967); - Clonk0299->SetColor(0x20ffff); - Clonk0299->SetName("Sophie"); - Clonk0299->SetSkin(3); - Clonk0299->SetDir(DIR_Left); - var Clonk0306 = CreateObjectAbove(Clonk, 853, 735); - Clonk0306->SetDir(DIR_Right); - Clonk0306->SetColor(0x6000); - Clonk0306->SetName("Riku"); - Clonk0306->SetSkin(2); - var Clonk0313 = CreateObjectAbove(Clonk, 1098, 1150); - Clonk0313->SetDir(DIR_Right); - Clonk0313->SetColor(0x800000); - Clonk0313->SetName("Ann"); - Clonk0313->SetSkin(3); + var Clonk008 = CreateObjectAbove(Clonk, 498, 966); + Clonk008->SetColor(0x20ffff); + Clonk008->SetName("Sophie"); + Clonk008->SetSkin(3); + Clonk008->SetDir(DIR_Left); + var Clonk009 = CreateObjectAbove(Clonk, 853, 734); + Clonk009->SetDir(DIR_Right); + Clonk009->SetColor(0x6000); + Clonk009->SetName("Riku"); + Clonk009->SetSkin(2); + var Clonk010 = CreateObjectAbove(Clonk, 1098, 1151); + Clonk010->SetDir(DIR_Right); + Clonk010->SetColor(0x800000); + Clonk010->SetName("Ann"); + Clonk010->SetSkin(3); + var Pickaxe001 = Clonk010->CreateContents(Pickaxe); - npc_dagobert->SetDialogue("Dagobert",true); - Clonk0273->SetDialogue("Otto",true); + Clonk010->SetDialogue("Ann",true); + Clonk009->SetDialogue("Riku",true); - var GrappleBow0335 = npc_tarzan->CreateContents(GrappleBow); - var GrappleBow0333 = npc_tarzan->CreateContents(GrappleBow); + var TeleGlove001 = Clonk008->CreateContents(TeleGlove); + + Clonk008->SetDialogue("Sophie",true); + Clonk006->SetDialogue("Donald",true); + Clonk007->SetDialogue("Jane",true); + + var GrappleBow001 = npc_tarzan->CreateContents(GrappleBow); + var GrappleBow002 = npc_tarzan->CreateContents(GrappleBow); npc_tarzan->SetDialogue("Tarzan",false); - Clonk0286->SetDialogue("Jane",true); - Clonk0280->SetDialogue("Donald",true); - - var TeleGlove0325 = Clonk0299->CreateContents(TeleGlove); - - Clonk0299->SetDialogue("Sophie",true); - Clonk0306->SetDialogue("Riku",true); - - var Pickaxe0320 = Clonk0313->CreateContents(Pickaxe); - - Clonk0313->SetDialogue("Ann",true); + Clonk005->SetDialogue("Otto",true); + npc_dagobert->SetDialogue("Dagobert",true); CreateObjectAbove(Skull, 53, 1138); - var Bone0344 = CreateObjectAbove(Bone, 25, 1141); - Bone0344->SetR(-69); - Bone0344->SetPosition(25, 1139); - var Bone0345 = CreateObjectAbove(Bone, 48, 1135); - Bone0345->SetR(-51); - Bone0345->SetPosition(48, 1135); - var Bone0346 = CreateObjectAbove(Bone, 472, 963); - Bone0346->SetR(-52); - Bone0346->SetRDir(-7); - Bone0346->SetPosition(472, 962); - var Bone0347 = CreateObjectAbove(Bone, 488, 962); - Bone0347->SetR(-51); - Bone0347->SetPosition(488, 962); - var Bone0348 = CreateObjectAbove(Bone, 479, 962); - Bone0348->SetR(-51); - Bone0348->SetPosition(479, 962); - var Bone0349 = CreateObjectAbove(Bone, 464, 963); - Bone0349->SetR(-51); - Bone0349->SetPosition(464, 963); + var Bone001 = CreateObject(Bone, 25, 1139); + Bone001->SetR(-65); + var Bone002 = CreateObject(Bone, 48, 1135); + Bone002->SetR(-51); + var Bone003 = CreateObject(Bone, 472, 966); + Bone003->SetR(-41); + Bone003->SetRDir(11); + var Bone004 = CreateObject(Bone, 488, 964); + Bone004->SetR(-51); + Bone004->SetYDir(8); + var Bone005 = CreateObject(Bone, 479, 964); + Bone005->SetR(-51); + Bone005->SetYDir(8); + var Bone006 = CreateObject(Bone, 464, 965); + Bone006->SetR(-51); + Bone006->SetYDir(8); - Lorry0231->CreateContents(Loam); - Lorry0231->CreateContents(Loam); - Lorry0231->CreateContents(Loam); - Lorry0231->CreateContents(Loam); - CreateObjectAbove(Loam, 153, 1235); - CreateObjectAbove(Loam, 357, 1320); - CreateObjectAbove(Loam, 265, 1454); - CreateObjectAbove(Loam, 528, 1453); - CreateObjectAbove(Loam, 554, 1456); - CreateObjectAbove(Loam, 988, 1287); - CreateObjectAbove(Loam, 1030, 1275); - CreateObjectAbove(Loam, 1065, 1270); - CreateObjectAbove(Loam, 1051, 1261); - CreateObjectAbove(Loam, 1049, 1282); - CreateObjectAbove(Loam, 1081, 1269); - CreateObjectAbove(Loam, 1334, 1052); - CreateObjectAbove(Loam, 1532, 861); - CreateObjectAbove(Loam, 1619, 807); - CreateObjectAbove(Loam, 1642, 442); - CreateObjectAbove(Loam, 1694, 402); - CreateObjectAbove(Loam, 1578, 527); - CreateObjectAbove(Loam, 1746, 459); + Lorry002->CreateContents(Loam, 4); + CreateObject(Loam, 153, 1232); + CreateObject(Loam, 357, 1317); + CreateObject(Loam, 265, 1451); + CreateObject(Loam, 528, 1450); + CreateObject(Loam, 554, 1453); + CreateObject(Loam, 988, 1284); + CreateObject(Loam, 1030, 1272); + CreateObject(Loam, 1065, 1267); + CreateObject(Loam, 1051, 1258); + CreateObject(Loam, 1049, 1279); + CreateObject(Loam, 1081, 1266); + CreateObject(Loam, 1334, 1049); + CreateObject(Loam, 1532, 858); + CreateObject(Loam, 1619, 804); + CreateObject(Loam, 1642, 439); + CreateObject(Loam, 1694, 399); + CreateObject(Loam, 1578, 524); + CreateObject(Loam, 1746, 456); - var Metal0372 = CreateObjectAbove(Metal, 1922, 978); - Metal0372->SetR(20); - Metal0372->SetPosition(1922, 976); + var Metal001 = CreateObject(Metal, 1922, 976); + Metal001->SetR(20); - var Nugget0373 = CreateObjectAbove(Nugget, 812, 590); - Nugget0373->SetClrModulation(0xffffd0a0); - CreateObjectAbove(Nugget, 869, 583); - var Nugget0375 = CreateObjectAbove(Nugget, 853, 584); - Nugget0375->SetClrModulation(0xffffd0a0); - var Nugget0376 = CreateObjectAbove(Nugget, 823, 584); - Nugget0376->SetClrModulation(0xffffd0a0); + var Nugget001 = CreateObject(Nugget, 812, 589); + Nugget001->SetClrModulation(0xffffd0a0); + CreateObject(Nugget, 869, 582); + var Nugget002 = CreateObject(Nugget, 853, 583); + Nugget002->SetClrModulation(0xffffd0a0); + var Nugget003 = CreateObject(Nugget, 823, 583); + Nugget003->SetClrModulation(0xffffd0a0); - Chest0106->CreateContents(GoldBar); - Chest0110->CreateContents(GoldBar); - Chest0109->CreateContents(GoldBar); - Chest0108->CreateContents(GoldBar); - Lorry0233->CreateContents(GoldBar); - Chest0107->CreateContents(GoldBar); - Chest0112->CreateContents(GoldBar); - Chest0113->CreateContents(GoldBar); - Chest0114->CreateContents(GoldBar); - var GoldBar0386 = Chest0009->CreateContents(GoldBar); - GoldBar0386->SetR(-1); - Chest0117->CreateContents(GoldBar); - var GoldBar0388 = Chest0116->CreateContents(GoldBar); - GoldBar0388->SetR(-97); - var GoldBar0389 = Chest0119->CreateContents(GoldBar); - GoldBar0389->SetClrModulation(0xffffd0a0); - GoldBar0389->SetR(-29); - var GoldBar0390 = CreateObjectAbove(GoldBar, 880, 542); - GoldBar0390->SetR(-29); - GoldBar0390->SetClrModulation(0xffffd0a0); - GoldBar0390->SetPosition(880, 540); - ToolsWorkshop0156->CreateContents(GoldBar); - CreateObjectAbove(GoldBar, 72, 1463); - CreateObjectAbove(GoldBar, 2746, 736); - var GoldBar0394 = CreateObjectAbove(GoldBar, 2507, 1262); - GoldBar0394->SetR(-6); - GoldBar0394->SetPosition(2507, 1262); - Chest0120->CreateContents(GoldBar); - var GoldBar0396 = CreateObjectAbove(GoldBar, 972, 1280); - GoldBar0396->SetR(55); - GoldBar0396->SetPosition(972, 1277); + Chest010->CreateContents(GoldBar); + Chest011->CreateContents(GoldBar); + Chest012->CreateContents(GoldBar); + Chest013->CreateContents(GoldBar); + Lorry001->CreateContents(GoldBar); + Chest006->CreateContents(GoldBar); + Chest014->CreateContents(GoldBar); + Chest015->CreateContents(GoldBar); + Chest016->CreateContents(GoldBar); + Chest001->CreateContents(GoldBar); + Chest017->CreateContents(GoldBar); + Chest018->CreateContents(GoldBar); + var GoldBar001 = Chest019->CreateContents(GoldBar); + GoldBar001->SetClrModulation(0xffffd0a0); + var GoldBar002 = CreateObject(GoldBar, 880, 540); + GoldBar002->SetR(-29); + GoldBar002->SetClrModulation(0xffffd0a0); + ToolsWorkshop001->CreateContents(GoldBar); + CreateObject(GoldBar, 72, 1463); + CreateObject(GoldBar, 2746, 736); + CreateObject(GoldBar, 2507, 1262); + Chest020->CreateContents(GoldBar); + var GoldBar003 = CreateObject(GoldBar, 972, 1277); + GoldBar003->SetR(55); - CreateObjectAbove(Ruby, 864, 585); - CreateObjectAbove(Ruby, 806, 587); + CreateObject(Ruby, 864, 581); + CreateObject(Ruby, 806, 583); CreateObjectAbove(Ruby, 849, 582); - CreateObjectAbove(Ruby, 856, 588); + CreateObject(Ruby, 856, 584); - var Amethyst0405 = CreateObjectAbove(Amethyst, 793, 588); - Amethyst0405->SetR(22); - Amethyst0405->SetPosition(793, 584); - CreateObjectAbove(Amethyst, 885, 561); - CreateObjectAbove(Amethyst, 828, 585); + var Amethyst002 = CreateObject(Amethyst, 793, 584); + Amethyst002->SetR(22); + CreateObject(Amethyst, 885, 557); + CreateObject(Amethyst, 828, 581); - Lorry0231->CreateContents(Dynamite); - Lorry0231->CreateContents(Dynamite); - Chest0107->CreateContents(Dynamite); - Chest0107->CreateContents(Dynamite); - Chest0107->CreateContents(Dynamite); + Lorry002->CreateContents(Dynamite, 2); + Chest006->CreateContents(Dynamite, 3); CreateObjectAbove(Dynamite, 1046, 722); - Chest0104->CreateContents(Dynamite); - Chest0103->CreateContents(Dynamite); - Chest0104->CreateContents(Dynamite); - Chest0103->CreateContents(Dynamite); - Chest0101->CreateContents(Dynamite); - Chest0109->CreateContents(Dynamite); - Chest0109->CreateContents(Dynamite); - Chest0109->CreateContents(Dynamite); - Chest0112->CreateContents(Dynamite); - Chest0112->CreateContents(Dynamite); - Chest0112->CreateContents(Dynamite); + Chest005->CreateContents(Dynamite, 2); + Chest004->CreateContents(Dynamite, 2); + Chest002->CreateContents(Dynamite); + Chest012->CreateContents(Dynamite, 3); + Chest014->CreateContents(Dynamite, 3); - var Bow0434 = Clonk0238->CreateContents(Bow); + var Bow001 = Clonk001->CreateContents(Bow); - var Arrow0435 = Bow0434->CreateContents(Arrow); - Arrow0435->SetR(90); - var Arrow0436 = Clonk0238->CreateContents(Arrow); - Arrow0436->SetR(90); - var Arrow0437 = CreateObjectAbove(Arrow, 313, 431); - Arrow0437->SetR(90); - Arrow0437->SetPosition(313, 431); - var Arrow0438 = CreateObjectAbove(Arrow, 313, 431); - Arrow0438->SetR(90); - Arrow0438->SetPosition(313, 431); - var Arrow0439 = CreateObjectAbove(Arrow, 313, 431); - Arrow0439->SetR(90); - Arrow0439->SetPosition(313, 431); - var Arrow0440 = CreateObjectAbove(Arrow, 313, 431); - Arrow0440->SetR(90); - Arrow0440->SetPosition(313, 431); - var Arrow0441 = CreateObjectAbove(Arrow, 313, 431); - Arrow0441->SetR(90); - Arrow0441->SetPosition(313, 431); - var Arrow0442 = CreateObjectAbove(Arrow, 313, 431); - Arrow0442->SetR(90); - Arrow0442->SetPosition(313, 431); - var Arrow0443 = CreateObjectAbove(Arrow, 313, 431); - Arrow0443->SetR(90); - Arrow0443->SetPosition(313, 431); - var Arrow0444 = CreateObjectAbove(Arrow, 313, 431); - Arrow0444->SetR(90); - Arrow0444->SetPosition(313, 431); - var Arrow0445 = CreateObjectAbove(Arrow, 313, 431); - Arrow0445->SetR(90); - Arrow0445->SetPosition(313, 431); + Bow001->CreateContents(Arrow); + Clonk001->CreateContents(Arrow); + var Arrow003 = CreateObject(Arrow, 313, 431); + Arrow003->SetR(90); + var Arrow004 = CreateObject(Arrow, 313, 431); + Arrow004->SetR(90); + var Arrow005 = CreateObject(Arrow, 313, 431); + Arrow005->SetR(90); + var Arrow006 = CreateObject(Arrow, 313, 431); + Arrow006->SetR(90); + var Arrow007 = CreateObject(Arrow, 313, 431); + Arrow007->SetR(90); + var Arrow008 = CreateObject(Arrow, 313, 431); + Arrow008->SetR(90); + var Arrow009 = CreateObject(Arrow, 313, 431); + Arrow009->SetR(90); + var Arrow010 = CreateObject(Arrow, 313, 431); + Arrow010->SetR(90); + var Arrow011 = CreateObject(Arrow, 313, 431); + Arrow011->SetR(90); - Chest0105->CreateContents(Bread); - Chest0105->CreateContents(Bread); - Lorry0233->CreateContents(Bread); - Lorry0233->CreateContents(Bread); - Lorry0233->CreateContents(Bread); + Chest021->CreateContents(Bread, 2); + Lorry001->CreateContents(Bread, 3); - Chest0105->CreateContents(DynamiteBox); - Chest0105->CreateContents(DynamiteBox); - Chest0116->CreateContents(DynamiteBox); - Chest0116->CreateContents(DynamiteBox); - Chest0117->CreateContents(DynamiteBox); - Chest0117->CreateContents(DynamiteBox); - Chest0120->CreateContents(DynamiteBox); - Chest0113->CreateContents(DynamiteBox); - Chest0119->CreateContents(DynamiteBox); + Chest021->CreateContents(DynamiteBox, 2); + Chest018->CreateContents(DynamiteBox, 2); + Chest017->CreateContents(DynamiteBox, 2); + Chest020->CreateContents(DynamiteBox); + Chest015->CreateContents(DynamiteBox); + Chest019->CreateContents(DynamiteBox); - Clonk0252->CreateContents(Sword); - Clonk0245->CreateContents(Sword); - Chest0107->CreateContents(Sword); - Clonk0259->CreateContents(Sword); - Clonk0259->CreateContents(Sword); + Clonk003->CreateContents(Sword); + Clonk002->CreateContents(Sword); + Chest006->CreateContents(Sword); + Clonk004->CreateContents(Sword, 2); + Lorry001->CreateContents(Sword); - var Seaweed0465 = CreateObjectAbove(Seaweed, 2494, 1263); - Seaweed0465->SetPhase(41); - var Seaweed0468 = CreateObjectAbove(Seaweed, 2508, 1263); - Seaweed0468->SetPhase(33); - var Seaweed0471 = CreateObjectAbove(Seaweed, 2520, 1263); - Seaweed0471->SetPhase(10); - var Seaweed0474 = CreateObjectAbove(Seaweed, 2508, 1263); - Seaweed0474->SetPhase(10); - var Seaweed0477 = CreateObjectAbove(Seaweed, 2503, 1263); - Seaweed0477->SetPhase(36); - var Seaweed0480 = CreateObjectAbove(Seaweed, 2526, 1262); - Seaweed0480->SetPhase(36); - var Seaweed0483 = CreateObjectAbove(Seaweed, 2516, 1263); - Seaweed0483->SetPhase(36); - var Seaweed0486 = CreateObjectAbove(Seaweed, 2499, 1263); - Seaweed0486->SetPhase(36); - var Seaweed0489 = CreateObjectAbove(Seaweed, 2663, 1278); - Seaweed0489->SetPhase(39); - var Seaweed0492 = CreateObjectAbove(Seaweed, 2769, 1272); - Seaweed0492->SetPhase(39); - var Seaweed0495 = CreateObjectAbove(Seaweed, 2751, 1279); - Seaweed0495->SetPhase(39); - var Seaweed0498 = CreateObjectAbove(Seaweed, 2762, 1271); - Seaweed0498->SetPhase(39); - var Seaweed0501 = CreateObjectAbove(Seaweed, 2775, 1279); - Seaweed0501->SetPhase(39); - var Seaweed0504 = CreateObjectAbove(Seaweed, 2762, 1271); - Seaweed0504->SetPhase(39); - var Seaweed0507 = CreateObjectAbove(Seaweed, 2659, 1279); - Seaweed0507->SetPhase(39); - var Seaweed0510 = CreateObjectAbove(Seaweed, 2416, 1245); - Seaweed0510->SetPhase(77); - var Seaweed0513 = CreateObjectAbove(Seaweed, 2395, 1239); - Seaweed0513->SetPhase(77); - var Seaweed0516 = CreateObjectAbove(Seaweed, 2396, 1239); - Seaweed0516->SetPhase(77); - var Seaweed0519 = CreateObjectAbove(Seaweed, 2332, 1145); - Seaweed0519->SetPhase(77); - var Seaweed0522 = CreateObjectAbove(Seaweed, 2407, 1246); - Seaweed0522->SetPhase(77); + CreateObjectAbove(Seaweed, 2494, 1263); + CreateObjectAbove(Seaweed, 2508, 1263); + CreateObjectAbove(Seaweed, 2520, 1263); + CreateObjectAbove(Seaweed, 2508, 1263); + CreateObjectAbove(Seaweed, 2503, 1263); + CreateObjectAbove(Seaweed, 2526, 1262); + CreateObjectAbove(Seaweed, 2516, 1263); + CreateObjectAbove(Seaweed, 2499, 1263); + CreateObjectAbove(Seaweed, 2663, 1278); + CreateObjectAbove(Seaweed, 2769, 1272); + CreateObjectAbove(Seaweed, 2751, 1279); + CreateObjectAbove(Seaweed, 2762, 1271); + CreateObjectAbove(Seaweed, 2775, 1279); + CreateObjectAbove(Seaweed, 2762, 1271); + CreateObjectAbove(Seaweed, 2659, 1279); + CreateObjectAbove(Seaweed, 2416, 1245); + CreateObjectAbove(Seaweed, 2395, 1239); + CreateObjectAbove(Seaweed, 2396, 1239); + CreateObjectAbove(Seaweed, 2332, 1145); + CreateObjectAbove(Seaweed, 2407, 1246); - CreateObjectAbove(Mushroom, 1580, 760); - CreateObjectAbove(Mushroom, 1613, 776); - CreateObjectAbove(Mushroom, 1525, 848); - CreateObjectAbove(Mushroom, 1612, 863); + CreateObjectAbove(Mushroom, 1580, 759); + CreateObjectAbove(Mushroom, 1613, 775); + CreateObjectAbove(Mushroom, 1525, 846); + CreateObjectAbove(Mushroom, 1612, 862); CreateObjectAbove(Mushroom, 1321, 895); - CreateObjectAbove(Mushroom, 1315, 896); - CreateObjectAbove(Mushroom, 1343, 904); - CreateObjectAbove(Mushroom, 1347, 903); + CreateObjectAbove(Mushroom, 1315, 894); + CreateObjectAbove(Mushroom, 1343, 903); + CreateObjectAbove(Mushroom, 1347, 901); CreateObjectAbove(Balloon, 491, 383); - var Barrel0558 = CreateObjectAbove(Barrel, 623, 456); - Barrel0558->SetColor(0xff000000); + var Barrel001 = CreateObjectAbove(Barrel, 623, 456); + Barrel001->SetColor(0xff000000); CreateObjectAbove(Sproutberry, 1823, 488); CreateObjectAbove(Sproutberry, 1823, 488); CreateObjectAbove(Sproutberry, 1823, 488); - var Boompack0563 = CreateObjectAbove(Boompack, 543, 383); - Boompack0563->SetColor(0xff); - var Boompack0564 = CreateObjectAbove(Boompack, 548, 384); - Boompack0564->SetColor(0xff); - var Boompack0565 = CreateObjectAbove(Boompack, 1948, 713); - Boompack0565->SetColor(0xff); - var Boompack0566 = CreateObjectAbove(Boompack, 1944, 487); - Boompack0566->SetR(135); - Boompack0566->SetColor(0xff); - Boompack0566->SetPosition(1944, 483); + CreateObjectAbove(Boompack, 543, 383); + CreateObjectAbove(Boompack, 548, 384); + CreateObjectAbove(Boompack, 1948, 713); + var Boompack001 = CreateObject(Boompack, 1944, 483); + Boompack001->SetR(135); g_golden_shovel = CreateObjectAbove(Shovel, 1841, 1011); g_golden_shovel->SetMeshMaterial("GoldenShovel", 0); g_golden_shovel.StaticSaveVar = "g_golden_shovel"; - CreateObjectAbove(Pipe, 1838, 1016); + CreateObject(Pipe, 1838, 1013); - var LotsOfCoins0567 = CreateObjectAbove(LotsOfCoins, 838, 592); - LotsOfCoins0567.Plane = 500; + var LotsOfCoins002 = CreateObject(LotsOfCoins, 838, 583); + LotsOfCoins002.Plane = 500; - var GemOfPower0575 = CreateObjectAbove(GemOfPower, 825, 572); - GemOfPower0575->SetCategory(C4D_StaticBack); + var GemOfPower001 = CreateObjectAbove(GemOfPower, 825, 572); + GemOfPower001->SetCategory(C4D_StaticBack); CreateObjectAbove(Firestone, 564, 1136); CreateObjectAbove(Firestone, 552, 1136); CreateObjectAbove(Firestone, 562, 1136); CreateObjectAbove(Firestone, 571, 1136); CreateObjectAbove(Firestone, 567, 1136); - CreateObjectAbove(Firestone, 558, 1136); - CreateObjectAbove(Firestone, 546, 1136); + CreateObject(Firestone, 558, 1135); + CreateObject(Firestone, 546, 1135); CreateObjectAbove(Firestone, 560, 1136); - CreateObjectAbove(Firestone, 546, 1136); - CreateObjectAbove(Firestone, 546, 1136); - CreateObjectAbove(Firestone, 555, 1136); + CreateObject(Firestone, 546, 1135); + CreateObject(Firestone, 546, 1135); + CreateObject(Firestone, 555, 1135); CreateObjectAbove(Firestone, 562, 1136); - CreateObjectAbove(Firestone, 550, 1136); + CreateObject(Firestone, 550, 1135); CreateObjectAbove(Firestone, 552, 1136); - CreateObjectAbove(Firestone, 342, 1225); - CreateObjectAbove(Firestone, 166, 1261); - CreateObjectAbove(Firestone, 234, 1424); + CreateObject(Firestone, 342, 1224); + CreateObject(Firestone, 166, 1260); + CreateObject(Firestone, 234, 1423); CreateObjectAbove(Firestone, 315, 431); - CreateObjectAbove(Firestone, 1359, 1061); - CreateObjectAbove(Firestone, 1348, 1042); - CreateObjectAbove(Firestone, 1384, 1055); - CreateObjectAbove(Firestone, 1417, 1107); - CreateObjectAbove(Firestone, 1432, 1113); - CreateObjectAbove(Firestone, 1436, 1104); - CreateObjectAbove(Firestone, 1340, 920); - CreateObjectAbove(Firestone, 1476, 876); - CreateObjectAbove(Firestone, 1549, 866); - CreateObjectAbove(Firestone, 1607, 792); - CreateObjectAbove(Firestone, 2053, 852); - CreateObjectAbove(Firestone, 2161, 943); - CreateObjectAbove(Firestone, 2073, 862); - CreateObjectAbove(Firestone, 2064, 852); - + CreateObject(Firestone, 1359, 1060); + CreateObject(Firestone, 1348, 1041); + CreateObject(Firestone, 1384, 1054); + CreateObject(Firestone, 1417, 1106); + CreateObject(Firestone, 1432, 1112); + CreateObject(Firestone, 1436, 1103); + CreateObject(Firestone, 1340, 919); + CreateObject(Firestone, 1476, 875); + CreateObject(Firestone, 1549, 865); + CreateObject(Firestone, 1607, 791); + CreateObject(Firestone, 2053, 851); + CreateObject(Firestone, 2161, 942); + CreateObject(Firestone, 2073, 861); + CreateObject(Firestone, 2064, 851); return true; } diff --git a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/StringTblDE.txt b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/StringTblDE.txt index 03e0304eb..6a9d3329d 100644 --- a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/StringTblDE.txt +++ b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/StringTblDE.txt @@ -2,7 +2,7 @@ PlaneNoOil=Das Flugzeug braucht noch Treibstoff. Ich muss irgendwo Intro1=Autsch. Pyrit! Intro2=Wie kann der Treibstoff leer sein? Du sagtest doch, ein Fass Öl bringt uns locker an unser Ziel und zurück! -Intro3=Dachte ich auch. Aber da wusste ich noch nicht, dass ich drei Tage über dem Ozean kreisen und auf einer einsamen Insel suchen müsste. +Intro3=Dachte ich auch. Aber da wusste ich noch nicht, dass ich drei Tage über dem Ozean kreisen und nach einer einsamen Insel suchen müsste. Intro4=Das ist alles deine Schuld. Ich sags ja nur. Intro5=Was können wir nun tun? Intro6=Ich schlage vor du suchst neues Öl und ich repariere derweil das Flugzeug. diff --git a/planet/Music.ocg/IslandDreams.ogg b/planet/Music.ocg/IslandDreams.ogg index fa8327977..b1761d359 100644 Binary files a/planet/Music.ocg/IslandDreams.ogg and b/planet/Music.ocg/IslandDreams.ogg differ diff --git a/planet/Music.ocg/Motorway.ogg b/planet/Music.ocg/Motorway.ogg index c32fed384..98eb6d487 100644 Binary files a/planet/Music.ocg/Motorway.ogg and b/planet/Music.ocg/Motorway.ogg differ diff --git a/planet/Music.ocg/TheSkylands.ogg b/planet/Music.ocg/TheSkylands.ogg index 9acd477fa..e60efbe54 100644 Binary files a/planet/Music.ocg/TheSkylands.ogg and b/planet/Music.ocg/TheSkylands.ogg differ diff --git a/planet/Objects.ocd/Environment.ocd/Ambience.ocd/DefCore.txt b/planet/Objects.ocd/Environment.ocd/Ambience.ocd/DefCore.txt index 350feff15..f73dc401b 100644 --- a/planet/Objects.ocd/Environment.ocd/Ambience.ocd/DefCore.txt +++ b/planet/Objects.ocd/Environment.ocd/Ambience.ocd/DefCore.txt @@ -1,8 +1,7 @@ [DefCore] id=Ambience Version=6,0 -Category=C4D_StaticBack +Category=C4D_StaticBack | C4D_Environment Width=1 Height=1 Offset=-1,-1 - diff --git a/planet/Objects.ocd/Environment.ocd/Ambience.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/Ambience.ocd/Script.c index d3b521aaa..d30b9e91a 100644 --- a/planet/Objects.ocd/Environment.ocd/Ambience.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/Ambience.ocd/Script.c @@ -1,5 +1,381 @@ /** Ambience + Controls sound and music depending on the environment the player is in + + @author Sven2 +*/ + +local exec_counter; // counter to distribute execution of players across frames +local player_environments; // array indexed by player number: array of derived environments with per-player data +local all_environments; // array of available environments for which it is checked if the player is in. sorted by priority. + +// Initialization +protected func Initialize() +{ + // Register default environments (overloadable) + this->InitializeEnvironments(); + // Initial player data + player_environments = []; + for (var i=0; iGetX(), y = cursor->GetY(); + for (var env in environments) + { + var was_active = env.is_active; + var is_active = env->CheckPlayer(cursor, x, y, was_active); + if (is_active == was_active) + { + // No change. Reset change delays. + env.change_delay = 0; + } + else + { + // Environment change. The change must persist for a while to become active. + if (++env.change_delay > env.min_change_delays[!is_active]) + { + // Waited long enough. Activate or deactivate this environment. + env.is_active = is_active; + //Log("%s environment: %s set to %v", GetPlayerName(plr), env.Name, is_active); + } + } + } + // Sound and music by active environments + var has_music = false, sound_modifier = nil; + for (var env in environments) if (env.is_active) + { + // Music! + if (env.music && !has_music) + { + this->SetPlayList(env.music, plr, true, 3000); + has_music = true; + } + // Sound effects like cave reverb etc. + if (env.sound_modifier && !sound_modifier) sound_modifier = env.sound_modifier; + // Sounds and actions by environment + for (var action in env.actions) + { + if (Random(1000) < action.chance) + { + cursor->Call(action.fn, action.par[0], action.par[1], action.par[2], action.par[3], action.par[4]); + } + } + // Does this stop all other environments? + if (env.is_exclusive) break; + } + // Apply or clear global sound modifier + SetGlobalSoundModifier(sound_modifier); + } + return true; +} + +func InitializePlayer(int plr) +{ + if (GetPlayerType(plr) == C4PT_User) + { + // Every player keeps a copy of the environment list to maintain delays + // Start with a large change delay to ensure first execution does set a proper environment + var n = GetLength(all_environments); + var envs = CreateArray(n); + for (var i=0; i < n; ++i) + envs[i] = new all_environments[i] { change_delay = 999, is_active = false }; + player_environments[plr] = envs; + // Newly joining players should have set playlist immediately (so they don't start playing a random song just to switch it immediately) + ExecutePlayer(plr); + } + return true; +} + +func RemovePlayer(int plr) +{ + // Ensure newly joining players don't check on another player's environment + player_environments[plr] = nil; + return true; +} + +protected func Activate(int byplr) +{ + MessageWindow(this.Description, byplr); + return true; +} + +/* Environment functions */ + +func AddEnvironment(proplist new_env, priority) +{ + if (GetType(priority)) new_env.Priority = priority; + this.all_environments[GetLength(all_environments)] = new_env; + SortArrayByProperty(this.all_environments, "Priority", true); + return true; +} + +private func Env_AddSound(chance, string snd_name) +{ + return Env_AddAction(chance ?? 50, Global.Sound, snd_name); +} + +private func Env_AddAction(achance, afn, par0, par1, par2, par3, par4) +{ + // Make sure to not write into prototype proplist. + if (this.actions == this.Prototype.actions) this.actions = []; + return this.actions[GetLength(this.actions)] = { chance=achance, fn=afn, par=[par0, par1, par2, par3, par4] }; +} + +/* Default environment checks */ + +private func EnvCheck_Underwater(object cursor, int x, int y, bool is_current) +{ + // Clonk should be swimming + if (cursor->GetProcedure() != "SWIM") return false; + // For initial change, clonk should also be diving: Check for breath below 95% + // Use > instead of >= to ensure 0-breath-clonks can also get the environment + if (!is_current && cursor->GetBreath() > cursor.MaxBreath*95/100) return false; + return true; +} + +private func EnvCheck_City(object cursor, int x, int y, bool is_current) +{ + // There must be buildings around the clonk + var building_count = cursor->ObjectCount(cursor->Find_AtRect(-180,-100,360,200), Find_Func("IsStructure")); + // 3 buildings to start the environment. Just 1 building to sustain it. + if (building_count < 3-2*is_current) return false; + return true; +} + +private func EnvCheck_Lava(object cursor, int x, int y, bool is_current) +{ + // Check for lava pixels. First check if the last lava pixel we found is still in place. + var search_range; + if (is_current) + { + if (this.mat_mask[GetMaterial(this.last_x, this.last_y)+1]) + if (Distance(this.last_x, this.last_y, x, y) < 140) + return true; + search_range = 140; + } + else + { + search_range = 70; + } + // Now search for lava in search range + var ang = Random(360); + for (; search_range >= 0; search_range -= 10) + { + ang += 200; + var x2 = x + Sin(ang, search_range); + var y2 = y + Cos(ang, search_range); + if (this.mat_mask[GetMaterial(x2, y2)+1]) + { + // Lava found! + this.last_x = x2; + this.last_y = y2; + return true; + } + } + // No lava found + return false; +} + +private func EnvCheck_Underground(object cursor, int x, int y, bool is_current) +{ + // Check for underground: No sky at cursor or above + if (GetMaterial(x,y)<0) return false; + if (GetMaterial(x,y-30)<0) return false; + if (GetMaterial(x-10,y-20)<0) return false; + if (GetMaterial(x+10,y-20)<0) return false; + return true; +} + +private func EnvCheck_Mountains(object cursor, int x, int y, bool is_current) +{ + // Check for mountains: Rock materials below + var num_rock; + for (var y2=0; y2<=45; y2+=15) + for (var x2=-75; x2<=75; x2+=15) + num_rock += this.mat_mask[GetMaterial(x+x2,y+y2)+1]; + // need 15pts on first check; 5 to sustain + if (num_rock < 15-is_current*10) return false; + return true; +} + +private func EnvCheck_Snow(object cursor, int x, int y, bool is_current) +{ + // Must be snowing from above + if (GetPXSCount(this.mat, x-300, y-200, 600, 300) < 20 - is_current*15) return false; + return true; +} + +private func EnvCheck_Night(object cursor, int x, int y, bool is_current) +{ + // Night time. + var time = FindObject(Find_ID(Environment_Time)); + if (!time || !time->IsNight()) return false; + return true; +} + +private func EnvCheck_Day(object cursor, int x, int y, bool is_current) +{ + // This is the fallback environment + return true; +} + +/*-- Proplist --*/ + +local SoundModifier, CaveModifier, UnderwaterModifier; + +func ReleaseSoundModifier() { return ChangeSoundModifier(this, true); } +func UpdateSoundModifier() { return ChangeSoundModifier(this, false); } // OpenAL-Soft implementation does not work for all modifiers + +public func Definition(def) +{ + // Base environment + def.Environment = { + actions = [], + min_change_delays = [1, 1], + AddSound = def.Env_AddSound, + AddAction = def.Env_AddAction, + }; + // Base sound modifier + SoundModifier = { + Release = Ambience.ReleaseSoundModifier, + Update = Ambience.UpdateSoundModifier, + }; + // Modifiers for different ambiences + CaveModifier = new SoundModifier { + Type = C4SMT_Reverb, + Reverb_Late_Reverb_Gain = 300, + Reverb_Late_Reverb_Delay = 10, + Reverb_Decay_HFRatio = 800, + }; + UnderwaterModifier = nil; // not supported yet + return true; +} + +local Environment; + +local Name = "$Name$"; +local Description = "$Description$"; + + + + +/** + Ambience Objects Cares about the placement of purely visual objects and handles sound ambience The placement uses categories and thus is forward-compatible. */ @@ -41,7 +417,6 @@ static const Environment_Attributes = }; - // provides a simple interface for creation of environment objects and decoration with standard values // the objects are placed on a best-effort-basis. That means f.e. objects that rely on water will not be placed when there is no water in the landscape. global func CreateEnvironmentObjects( @@ -106,23 +481,3 @@ CreateEnvironmentObjects("Temperate", Rectangle(LandscapeWidth()/2, 0, Landscape p_id->Place(amount_percentage, area); } } - -/* Sound ambience */ - -local SoundModifier, CaveModifier; - -func ReleaseSoundModifier() { return ChangeSoundModifier(this, true); } -func UpdateSoundModifier() { return ChangeSoundModifier(this, false); } // do not use - -func Definition() -{ - // Base sound modifier - SoundModifier = { - Release = Ambience.ReleaseSoundModifier, - Update = Ambience.UpdateSoundModifier, - }; - // Modifiers for different ambiences - CaveModifier = new SoundModifier { - Type = C4SMT_Reverb, - }; -} diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/StringTblDE.txt b/planet/Objects.ocd/Environment.ocd/Ambience.ocd/StringTblDE.txt similarity index 100% rename from planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/StringTblDE.txt rename to planet/Objects.ocd/Environment.ocd/Ambience.ocd/StringTblDE.txt diff --git a/planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/StringTblUS.txt b/planet/Objects.ocd/Environment.ocd/Ambience.ocd/StringTblUS.txt similarity index 100% rename from planet/Experimental.ocf/Ambience_DeepSeaMining.ocs/Ambience.ocd/StringTblUS.txt rename to planet/Objects.ocd/Environment.ocd/Ambience.ocd/StringTblUS.txt