From 724eac83c84ca435a81ce772b60af6086d8aea65 Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Sat, 15 Oct 2011 01:24:24 +0200 Subject: [PATCH] BeyondTheRocks: Added Ore mine scenario A somewhat more difficult scenario for suitable for a next release, may also be used for testing stuff in the meanwhile, --- .../IronPeak.ocs/DescDE.rtf | Bin 0 -> 774 bytes .../IronPeak.ocs/DescUS.rtf | Bin 0 -> 760 bytes .../BeyondTheRocks.ocf/IronPeak.ocs/Icon.png | Bin 0 -> 1097 bytes .../IronPeak.ocs/Landscape.txt | 90 +++++++++ .../IronPeak.ocs/Material.ocg/Rock.ocm | 13 ++ .../IronPeak.ocs/Material.ocg/TEXMAP.TXT | 72 +++++++ .../IronPeak.ocs/Scenario.txt | 49 +++++ .../BeyondTheRocks.ocf/IronPeak.ocs/Script.c | 181 ++++++++++++++++++ .../BeyondTheRocks.ocf/IronPeak.ocs/Title.txt | 2 + 9 files changed, 407 insertions(+) create mode 100644 planet/BeyondTheRocks.ocf/IronPeak.ocs/DescDE.rtf create mode 100644 planet/BeyondTheRocks.ocf/IronPeak.ocs/DescUS.rtf create mode 100644 planet/BeyondTheRocks.ocf/IronPeak.ocs/Icon.png create mode 100644 planet/BeyondTheRocks.ocf/IronPeak.ocs/Landscape.txt create mode 100644 planet/BeyondTheRocks.ocf/IronPeak.ocs/Material.ocg/Rock.ocm create mode 100644 planet/BeyondTheRocks.ocf/IronPeak.ocs/Material.ocg/TEXMAP.TXT create mode 100644 planet/BeyondTheRocks.ocf/IronPeak.ocs/Scenario.txt create mode 100644 planet/BeyondTheRocks.ocf/IronPeak.ocs/Script.c create mode 100644 planet/BeyondTheRocks.ocf/IronPeak.ocs/Title.txt diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescDE.rtf b/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescDE.rtf new file mode 100644 index 0000000000000000000000000000000000000000..e5bb052b1b4255db92dac00bb07911056bcce190 GIT binary patch literal 774 zcmY*XOKaRP5bimU|1jsW7<(Uul2Zyf^bp9QM_tC!$P$(%M;foQS@yqov<`)W7)xUG zy*yWy*>(zJ@%N(Vq1&JK%8<2ftpVfEwa3F%*%X=kAe&a%viee#)edtZZs9q53{SV) zbR|7@L$SK2Xu}sD@oSI|T>}8$WpHDY+_Oy;Znxk5Dr)JDXZA^!Q>Nkdc3opJ< z>?semijXY)&hmXD9KoT1m>7DZ2s(*5LzxU9%sE+k(g%Vi z$|a+y7{H2DLmCa0X2Z!;D4(goDlftL!2w1CQ<4*5@!jIz zX^}M8AxjZj#xm|;bzZwIRLMS17(n~1m#HvDfrbe$P>3er?9VbSyDFJJIMYOul#Egc z6bCW3<&|luKUSK?nAUht&T|d!jDpEE0m97geZi56!08M0!GC_rG>H*0WeANxi?z`T Tdh<17$Ab*ezTL)2M)uoZEp-)# literal 0 HcmV?d00001 diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescUS.rtf b/planet/BeyondTheRocks.ocf/IronPeak.ocs/DescUS.rtf new file mode 100644 index 0000000000000000000000000000000000000000..4989351892a142a91147f690a26f49e2eb8011d6 GIT binary patch literal 760 zcmY*XJB!>f5Ket?|6%H|7<(Uqa8&{+QUp?@R5O-Fmar`Or1ARpmi_M;*&!idge5+G zFU?(Lww=OQ{I=+M=#H18GGuLA*MM>8+VknIY>Lc%ke^oBviee#)edtZZsAMz7+xNa z=cl{+s0NCZkyC~r#WESsaB0q6bCmDWetvnVtEYAJ(VW$yJ2hiAYF9d)RKF`6Tlk(+ zgr9_CMLa+KS^KKreS&Xqb4Z?%y`Yl)hX#iRVq)ltBIqRH3}rHaFz00DN*@T8D2I&V zVgM^v4QVt~nw=+8p?swRtK0MkGT>qnOrq_ic3&tjqY2cS5 z(6|)Zl-T(qa%HY15g;>7GuH@KDye>a4PK?DrPLTZ5BLZyOhZm6!gc_hY9Hb*?;5j|y9JYCY8pU6{#Ex;@DnkH2EK~XwGy*Si?qQG zSr(CHEaL%I=e65QmG1L|0kqG0nF?bRYMAf_g=hlK{wmXQsFvxCGfgB-$tZLgYe}9*0k|6S0hR_JLL>sNJH~Rp| Hkbd|LI!qAH literal 0 HcmV?d00001 diff --git a/planet/BeyondTheRocks.ocf/IronPeak.ocs/Icon.png b/planet/BeyondTheRocks.ocf/IronPeak.ocs/Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..735dd146cba444bcab34648be6e6be3bebd2fb07 GIT binary patch literal 1097 zcmV-P1h)H$P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01m$d+s^+9L>o3 zXFqV>8SHFZpaaYU33v=VeRS)aa9*vwKyv{~V7cqv<&YA4b)&!tI2S-U|2Uvu7}L8w znERsVodU%LYhVA;U}xI^v%uvK=i0ZHi~RkbcMdRsPT9Q?0}J#kYpUfk|0Fj$zuB&C zP8rNzL}I zSOvOMDgQSBz}$X_jALw?MA@=teXHC4az1klQ|sC{0;p4JJ+B*mQr9k#n!=d!YL(ym zpxgO$YGM1Th3jh^q|?a^P>(_|4-dz(TQ>$sxoXzS+=5O3TCeJ*uSxDKumsFl;mUr9 z?pYJqtsB{E8aax|&pA6BR>fPu0#KaALeFUKfF5woh%BwQ%Dc19ZUH`|#Ha}zgupmP z3tYL`nYrUtdq8)}_SFDWH*|qv&%32}J2UrYo&6jbRL0oC7`#qOBH&fao_Fih@XZ1K zWfpo?uv*p()?4L$BXTG0{P=6ztb=iORNyd6^VP6e-e0#e7sQAl`I+RoxcD2);mIF+)rdVQtHwtyTk zgPm>BQ_Y8!HA@S*zh{NDIwgC|AXCAKyujcXbhmC8$4E?27?b5j7pC73ckG%ju-f(R z#vpUw39=y~g%d##R6t}R$FZJGiac*3b)2v{2ts8IM#OiVyKF?NkWw2M>C~1hgUo#^ z$c7b4CzHm&i6xJxSD8F(66}Y_Ufr-;HynltkX6=fEEd`3v1Kigb-f#U)sDj0t6CMj z5y4DlX;OlyprA3H$OAOv7!Svh@li~aMj16B{Fo@MK*7ydUBpfO9H?kkY}!qwz1mArR%G{_Gqu0A_${vB;`n zS=@0dH-TQ;lzw}#fB56?ql3SI{ZoG!2{-^A0Z;!0I(S#5U%#q= P00000NkvXXu0mjf?vVU( literal 0 HcmV?d00001 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