diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescDE.rtf b/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescDE.rtf new file mode 100644 index 000000000..e5bb052b1 Binary files /dev/null and b/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescDE.rtf differ diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescUS.rtf b/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescUS.rtf new file mode 100644 index 000000000..498935189 Binary files /dev/null and b/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescUS.rtf differ diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/Icon.png b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Icon.png new file mode 100644 index 000000000..735dd146c Binary files /dev/null and b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Icon.png differ diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/Landscape.txt b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Landscape.txt new file mode 100644 index 000000000..d111b571f --- /dev/null +++ b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Landscape.txt @@ -0,0 +1,90 @@ +/*-- + Iron Peak + Author: Maikel + + A mountain peak filled with iron ore and coal, the crust consists + of granite, rock, ice and some entrances. +--*/ + +// Fills an overlay randomly with the specified material. +overlay RandomMat { + mask=1; invert=1; grp=1; + // Combine multiple algortihms to obtain more regularity than just rndchecker. + overlay { + algo=rndchecker; a=18; + zoomX=-25; zoomY=-25; + turbulence=100; lambda=3; + mask=1; + } | overlay { + algo=bozo; a=25; + zoomX=10; zoomY=-10; + turbulence=1000; lambda=3; + mask=1; + } | overlay { + algo=bozo; a=25; + zoomX=-10; zoomY=10; + turbulence=1000; lambda=3; + mask=1; + }; +}; + +// Fills the mountain with materials. +overlay MountainMaterials { + // Earth as background material. + mat=Earth; tex=earth; + RandomMat & overlay { mat=Earth; tex=earth_dry; }; + RandomMat & overlay { mat=Earth; tex=earth_rough; }; + // Combine random mat with all materials needed. + RandomMat & overlay { mat=Granite; tex=granite; }; + RandomMat & overlay { mat=Rock; tex=rock_cracked; }; + RandomMat & overlay { mat=Snow; tex=snow1; }; + RandomMat & overlay { mat=Ice; tex=ice3; }; + RandomMat & overlay { mat=Rock; tex=rock; }; + RandomMat & overlay { mat=Tunnel; tex=tunnel; }; + RandomMat & overlay { mat=Sulphur; tex=sulphur; }; + RandomMat & overlay { mat=Ore; tex=ore; }; + RandomMat & overlay { mat=Coal; tex=coal; }; + // A little more diagonal tunnels. + overlay { + algo=lines; a=3; b=20; + rotate=45; + turbulence=100; + mat=Tunnel; tex=tunnel; + }; + overlay { + algo=lines; a=3; b=20; + rotate=-45; + turbulence=100; + mat=Tunnel; tex=tunnel; + }; +}; + +// Fills the mountain crust with rocks and some earth and ice. +overlay CrustMaterials { + mat=Rock; tex=rock; + // Combine random mat with crust materials. + RandomMat & overlay { mat=Earth; tex=earth_dry; }; + RandomMat & overlay { mat=Ice; tex=ice3; }; + RandomMat & overlay { mat=Tunnel; tex=tunnel; }; + RandomMat & overlay { mat=Granite; tex=granite; }; + RandomMat & overlay { mat=Rock; tex=rock_cracked; }; +}; + +map IronPeak { + overlay { + // A simple mountain peak with the polygon algorithm. + algo=poly; + point { x=0%; y=140%; }; + point { x=45%; y=12%; }; + point { x=55%; y=12%; }; + point { x=100%; y=140%; }; + turbulence=100; lambda=1; + // Fill the mountain with materials. + MountainMaterials; + overlay { + // Create a crust mainly with rocks and some entrance points. + algo=border; a=5; b=5; + CrustMaterials; + }; + }; +}; diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/Material.ocg/Rock.ocm b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Material.ocg/Rock.ocm new file mode 100644 index 000000000..7b5b90f85 --- /dev/null +++ b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Material.ocg/Rock.ocm @@ -0,0 +1,13 @@ +[Material] +Name=Rock +Shape=Rough +Density=50 +Friction=100 +BlastFree=1 +Blast2Object=Rock +Blast2ObjectRatio=75 +MaxAirSpeed=100 +MaxSlide=250 +Placement=50 +Soil=1 +TextureOverlay=rock diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/Material.ocg/TEXMAP.TXT b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Material.ocg/TEXMAP.TXT new file mode 100644 index 000000000..52a3f4177 --- /dev/null +++ b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Material.ocg/TEXMAP.TXT @@ -0,0 +1,72 @@ +# Static Map Material/Texture Table +# Index +128 for underground materials +OverloadMaterials +OverloadTextures + +10=Tunnel-tunnel +11=Tunnel-tunnel +12=Tunnel-brickback +13=BrickSoft-brick1 +19=DuroLava-lava_red +20=Water-water1-water2-water3-water1-water3-water2 +#21=Oil-Liquid +22=Acid-acid +23=Lava-lava_red +24=DuroLava-lava_red +25=Water-water +#26=Oil-Smooth +27=Acid-acid +28=Lava-lava_red +29=Earth-earth_dry +30=Earth-earth_rough +31=Earth-earth_topsoil +32=Earth-earth_midsoil +#33=Ashes-Smooth3 +#34=Ashes-Rough +#35=Ashes-Ridge + +36=Ore-ore +37=Ore-ore +38=Ore-ore + +40=Granite-granite +41=Granite-granite +42=Granite-rock + +45=Gold-gold + +50=Rock-rock +51=Rock-rock_cracked +52=Rock-rock + +53=Sulphur-sulphur + +54=Coal-coal + +55=Sand-sand_rough +#56=Sand-Smooth2 +#57=Sand-Smooth3 + + + +#59=FlyAshes-Smooth + +#60=Crystal-Flare +#61=Crystal-Structure +#62=Crystal-Structure2 + +65=Ice-ice2 +66=Ice-ice2 +67=Ice-ice3 +68=Ice-ice3 + +70=Snow-snow1 +71=Snow-snow1 +72=Snow-snow1 +73=Brick-brick1 + +#80=FlySand-Smooth2 +#81=FlySand-Smooth3 +#82=FlySand-Smooth + + diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/Scenario.txt b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Scenario.txt new file mode 100644 index 000000000..f4cf3e5a2 --- /dev/null +++ b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Scenario.txt @@ -0,0 +1,49 @@ +[Head] +Icon=1 +Title=IronPeak +Version=5,0,0,0 +Difficulty=20 + +[Definitions] +Definition1=Objects.ocd + +[Game] +Rules=Rule_EnergyNeed=1;Rule_TeamAccount=1; + +[Player1] +Wealth=80 +Crew=Clonk=2 +Knowledge=WoodenCabin=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;CableCrossing=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1; +HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;CableLorry=2;CableLorryReel=5; + +[Player2] +Wealth=80 +Crew=Clonk=2 +Knowledge=WoodenCabin=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;CableCrossing=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1; +HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;CableLorry=2;CableLorryReel=5; + +[Player3] +Wealth=80 +Crew=Clonk=2 +Knowledge=WoodenCabin=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;CableCrossing=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1; +HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;CableLorry=2;CableLorryReel=5; + +[Player4] +Wealth=80 +Crew=Clonk=2 +Knowledge=WoodenCabin=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;CableCrossing=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1; +HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;CableLorry=2;CableLorryReel=5; + +[Landscape] +InEarth=Rock=1;Firestone=3;Loam=2 +InEarthLevel=30,0,0,100 +Sky=Clouds2 +MapWidth=150 +MapHeight=150 +BottomOpen=1 + +[Weather] +Climate=100 +YearSpeed=0 +Wind=1,100,-100,100 + diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/Script.c b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Script.c new file mode 100644 index 000000000..87f1d35f9 --- /dev/null +++ b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Script.c @@ -0,0 +1,181 @@ +/** + Iron Peak + A chilly mountain peak filled with iron ore and coal. + + @authors Maikel +*/ + + +// Spawn location for all players. +static mountain_location; + +protected func Initialize() +{ + // Goal: Resource extraction, set to ore mining. + var goal = CreateObject(Goal_ResourceExtraction); + goal->SetResource("Ore"); + + // Goal: Construct flagpole at the top. + // TODO: implement this goal. + + // Find A good location for the players to start. + FindMountainLocation(); + + // Cover the mountain in some snow already. + GiveMountainSnowCover(); + + // Bottom of the map should only be open at the sides. + CloseMapBottom(); + + // Add a snow storm effect, strong winds and lot's of snow. + AddEffect("SnowStorm", nil, 100, 5, nil); + + // Create a lorry with necessary equipment to start a settlement. + //var lorry = CreateObject(Lorry, mountain_location[0], mountain_location[1], NO_OWNER); + //lorry->CreateContents(Wood, 16); + //lorry->CreateContents(Metal, 4); + //lorry->CreateContents(Dynamite, 3); + //lorry->CreateContents(CableReel, 3); + // TODO: Make sure lorry stays on mountains. + + // Place some coniferous trees, but only up to 2/3 of the mountain. + for (var i = 0; i < 16 + Random(5); i++) + PlaceVegetation(Tree_Coniferous, 0, LandscapeHeight() / 3, LandscapeWidth(), 2 * LandscapeHeight() / 3, 1000 * (61 + Random(40))); + + // Some mushrooms as source of food. + for (var i = 0; i < 30 + Random(10); i++) + PlaceVegetation(Mushroom, 0, 0, LandscapeWidth(), LandscapeHeight()); + + // Set time of day to evening and create some clouds and celestials. + CreateObject(Environment_Clouds); + CreateObject(Environment_Celestial); + var time = CreateObject(Environment_Time); + time->SetTime(1125); + time->SetCycleSpeed(0); + + // A light blue hue, to indicate the cold climate. + var blue = 12; + SetGamma(RGB(0,0,blue), RGB(128-blue,128-blue,128+blue), RGB(255-blue,255-blue,255)); + + // Some natural disasters. + var earthquakes = CreateObject(Earthquake); + // earthquakes->SetChance(30); + // TODO: Rockfall. + + //LogMatCounts(); + return; +} + +private func FindMountainLocation() +{ + // Default to top middle of the map. + mountain_location = [LandscapeWidth() / 2, LandscapeHeight() / 2]; + var x = 0, y = 0; + for (var i = 0; i < 1000; i++) + { + // Random x coordinate. + var x = Random(LandscapeWidth()), y = 0; + // Find corresponding y coordinate. + while (!GBackSolid(x, y) && y < 9 * LandscapeHeight() / 10) + y += 2; + // Check if surface is relatively flat (check for flatter surfaces first). + var d = i / 250 + 1; + if (!GBackSolid(x + 10, y - 20) && !GBackSolid(x - 10, y - 20) && !GBackSolid(x + 10, y - d) && !GBackSolid(x - 10, y - d) && GBackSolid(x + 10, y + d) && GBackSolid(x - 10, y + d)) + if (y > LandscapeHeight() / 2) + { + mountain_location = [x, y - 10]; + break; + } + } + return; +} + +private func LogMatCounts() +{ + for (var i = 0; i < 128; i++) + { + if (GetMaterialCount(i) > 0) + Log("Material %s has %d count.", MaterialName(i), GetMaterialCount(i) / 100); + } + return; +} + +private func GiveMountainSnowCover() +{ + // Loop over the map horizontally. + for (var x = 0; x < LandscapeWidth(); x += 20) + { + // Find height of mountain at this x. + var y = 0; + while (!GBackSolid(x, y) && y < LandscapeHeight()) + y += 10; + if (y < 9 * LandscapeHeight() / 10) + CastPXS("Snow", 10 + Random(50), 40, x, y - 40, 180, 40); + } + return; +} + +private func CloseMapBottom() +{ + var y = LandscapeHeight() - 1; + for (var x = 0; x < LandscapeWidth(); x++) + if (!GBackSky(x, y)) + DrawMaterialQuad("Brick", x, y-1, x, y+1, x-1, y+1, x-1, y-1, true); + return; +} + +// This effect should be called every 5 frames. +global func FxSnowStormStart(object target, proplist effect) +{ + // Always a strong wind, either to the left or the right. + effect.wind = (2 * Random(2) - 1) * (90 + Random(10)); + // Accordingly a stormy sound. + Sound("WindLoop.ogg", true, 80, nil, 1); + return 1; +} + +global func FxSnowStormTimer(object target, proplist effect) +{ + // Change wind every now and then. + if (!Random(200)) + effect.wind = (2 * Random(2) - 1) * (90 + Random(10)); + + // Adapt current wind to target wind and add a little random. + var wind = GetWind(0, 0, true); + if (effect.wind > wind) + SetWind(wind + Random(3)); + else if (effect.wind < wind) + SetWind(wind - Random(3)); + else + SetWind(wind + 1 - Random(3)); + return 1; +} + +protected func InitializePlayer(int plr) +{ + // Disable FoW for development reasons. + SetFoW(false, plr); + // Move clonks to location and give them a shovel. + var index = 0, crew; + while (crew = GetCrew(plr, index)) + { + crew->SetPosition(mountain_location[0], mountain_location[1]); + // First clonk can construct, others can mine. + if (index == 0) + { + crew->CreateContents(Hammer); + crew->CreateContents(Axe); + crew->CreateContents(CableReel); + crew->CreateContents(Dynamite); + } + else + { + crew->CreateContents(Shovel); + crew->CreateContents(Pickaxe); + crew->CreateContents(Dynamite, 2); + } + index++; + } + return; +} + diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/Title.txt b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Title.txt new file mode 100644 index 000000000..fa24b3c53 --- /dev/null +++ b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Title.txt @@ -0,0 +1,2 @@ +DE:Eisenberg +US:Iron Peak \ No newline at end of file