From 4967b07a39a5e533e1f3615fd35caa3f4d57462d Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Sun, 6 Jul 2014 18:13:09 +0200 Subject: [PATCH] Iron Peak game goal is now metal production and expansion --- .../Goals.ocd/Expansion.ocd/StringTblDE.txt | 4 +- planet/Worlds.ocf/IronPeak.ocs/DescDE.rtf | Bin 875 -> 3698 bytes planet/Worlds.ocf/IronPeak.ocs/DescUS.rtf | Bin 793 -> 3444 bytes planet/Worlds.ocf/IronPeak.ocs/Map.c | 2 - .../IronPeak.ocs/Material.ocg/TEXMAP.TXT | 43 +---- planet/Worlds.ocf/IronPeak.ocs/Scenario.txt | 18 +- planet/Worlds.ocf/IronPeak.ocs/Script.c | 172 +++++++++++------- 7 files changed, 123 insertions(+), 116 deletions(-) diff --git a/planet/Objects.ocd/Goals.ocd/Expansion.ocd/StringTblDE.txt b/planet/Objects.ocd/Goals.ocd/Expansion.ocd/StringTblDE.txt index 1f6a22ace..40c95fbc2 100644 --- a/planet/Objects.ocd/Goals.ocd/Expansion.ocd/StringTblDE.txt +++ b/planet/Objects.ocd/Goals.ocd/Expansion.ocd/StringTblDE.txt @@ -1,5 +1,5 @@ -Name=Ausdehnung +Name=Ausbreitung #Goal window -MsgGoalFulfilled=Du hast deine Ausdehnungsziele erreicht. +MsgGoalFulfilled=Du hast deine Ausbreitungsziele erreicht. MsgGoalUnFulfilled=Dehne deine Herrschaft aus, durch das bauen der Flaggen. Momentan kontrollierst du erst %d% der gefragter Herrschaft. \ No newline at end of file diff --git a/planet/Worlds.ocf/IronPeak.ocs/DescDE.rtf b/planet/Worlds.ocf/IronPeak.ocs/DescDE.rtf index 73e33ade1d8d23dc8e36d9c1452c7ae640888f04..b44e4053def37b9bd494cbc37e0b03d8a2ab23b5 100644 GIT binary patch literal 3698 zcmds3O>f*b5WV|X%q?vY1d_aKualG0v`CA56meRh1uv91TCqz}TawD!YwUmT8%eu% zVK=FP9*kb3Avv6RGxIp)wF;@umG;pp!*!i0ji1w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#5hidFjLV{2Nnqf2 m70%u6AtyH`wS>>6Wt3Kd3s-MBf!XLgv0|L>#(#gH+U{?CGUzY> delta 267 zcmew&HIvP}I;N;3%`hf0uQ(G-Bp0L`8kri!q@<>$8Gy)~#JqGP150hlvt8qq~KeeR+5^MS)yR7XJV*l1VpBW2G+GPWtpkv*_nAMCNZVS zhA{<+MJX|P`Q@1@$t5{JP7KHfLjz;un4}n>m1)IB1`3`<`FRQfsfpPj)x2CWNg#1U zGYHQOXjMvT@@88O9!6HM&}3OI4d%q0oXIX+drhEPz#8526LYK-{EJc*ax?QX^U|Sq OnHYnufv5y}g8=}AM^{+@ diff --git a/planet/Worlds.ocf/IronPeak.ocs/Map.c b/planet/Worlds.ocf/IronPeak.ocs/Map.c index da493d872..690fa8d38 100644 --- a/planet/Worlds.ocf/IronPeak.ocs/Map.c +++ b/planet/Worlds.ocf/IronPeak.ocs/Map.c @@ -27,7 +27,6 @@ protected func InitializeMap(proplist map) // Set the map size. map->Resize(map_size[0], map_size[1]); - // Draw the main surface: a mountain with the polygon algorithm. var wdt = map.Wdt; var hgt = map.Hgt; @@ -99,6 +98,5 @@ public func DrawMaterial(string mat, proplist onto_mask, int speck_size, int rat rnd_checker = {Algo = MAPALGO_Turbulence, Iterations = 4, Op = rnd_checker}; var algo = {Algo = MAPALGO_And, Op = [onto_mask, rnd_checker]}; Draw(mat, algo); - return; } diff --git a/planet/Worlds.ocf/IronPeak.ocs/Material.ocg/TEXMAP.TXT b/planet/Worlds.ocf/IronPeak.ocs/Material.ocg/TEXMAP.TXT index 73357dcb5..d2056352b 100644 --- a/planet/Worlds.ocf/IronPeak.ocs/Material.ocg/TEXMAP.TXT +++ b/planet/Worlds.ocf/IronPeak.ocs/Material.ocg/TEXMAP.TXT @@ -3,70 +3,47 @@ OverloadMaterials OverloadTextures +1=Vehicle-none + 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 + +28=Earth-earth 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 +33=Ashes-ashes +35=SandDry-sand_rough 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=Firestone-firestone 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 +56=Sand-sand_smooth 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/Worlds.ocf/IronPeak.ocs/Scenario.txt b/planet/Worlds.ocf/IronPeak.ocs/Scenario.txt index b7945e693..ec09ed443 100644 --- a/planet/Worlds.ocf/IronPeak.ocs/Scenario.txt +++ b/planet/Worlds.ocf/IronPeak.ocs/Scenario.txt @@ -7,36 +7,26 @@ Difficulty=40 [Definitions] Definition1=Objects.ocd -[Game] -Rules=Rule_TeamAccount=1; - [Player1] -Wealth=40 Crew=Clonk=2 Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Basement=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; -BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Clonk=5;Bread=1; [Player2] -Wealth=40 Crew=Clonk=2 Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Basement=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; -BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Clonk=5;Bread=1; [Player3] -Wealth=40 Crew=Clonk=2 Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Basement=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; -BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Clonk=5;Bread=1; [Player4] -Wealth=40 Crew=Clonk=2 Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Basement=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; -BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; - +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Clonk=5;Bread=1; [Landscape] -InEarth=Rock=1;Firestone=3;Loam=2 -InEarthLevel=30,0,0,100 Sky=Clouds2 MapWidth=150 MapHeight=150 diff --git a/planet/Worlds.ocf/IronPeak.ocs/Script.c b/planet/Worlds.ocf/IronPeak.ocs/Script.c index c4b16face..e82ab8fbe 100644 --- a/planet/Worlds.ocf/IronPeak.ocs/Script.c +++ b/planet/Worlds.ocf/IronPeak.ocs/Script.c @@ -7,7 +7,7 @@ // Scenario properties which can be set later by the lobby options. -static const SCENOPT_Material = 1; // Amount of material available from start. +static const SCENOPT_Material = 3; // Amount of material available from start. static const SCENOPT_MapSize = 1; // Size of the map. static const SCENOPT_Difficulty = 1; // Difficulty settings. @@ -16,50 +16,59 @@ static mountain_location; protected func Initialize() { - // Goal: Resource extraction, set to ore mining. - var goal = CreateObject(Goal_ResourceExtraction); - goal->SetResource("Ore"); + // Goal: Expand your area of influence to secure the ore. + var goal = CreateObject(Goal_Expansion); + goal->SetExpansionGoal(300 + 100 * SCENOPT_Difficulty); - // Goal: Construct flagpole at the top. - // TODO: implement this goal. + // Second goal: Construct metal. + var metal_cnt = 10 + 10 * SCENOPT_Difficulty; + goal = CreateObject(Goal_Construction); + goal->AddConstruction(Metal, metal_cnt); + + // Rules: team account and buying at flagpole. + CreateObject(Rule_TeamAccount); + CreateObject(Rule_BuyAtFlagpole); // Find A good location for the players to start. FindMountainLocation(); - // Cover the mountain in some snow already. - GiveMountainSnowCover(); - - // 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); - // TODO: Make sure lorry stays on mountains. - - // Place some coniferous trees, but only up to 2/3 of the mountain. - Tree_Coniferous->Place(16 + Random(5), Rectangle(0, LandscapeHeight() / 3, LandscapeWidth(), 2 * LandscapeHeight() / 3)); - - // Some mushrooms as source of food. - Mushroom->Place(30 + Random(10)); - - // Set time of day to evening and create some clouds and celestials. - Cloud->Place(20); - CreateObject(Environment_Celestial); - var time = CreateObject(Environment_Time); - time->SetTime(60 * 22); - 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. - // Earthquake->SetChance(30); - // TODO: Rockfall. + // Initialize different parts of the scenario. + InitEnvironment(); + InitVegetation(SCENOPT_MapSize); + InitAnimals(); + InitMaterial(SCENOPT_Material); + return; +} +protected func InitializePlayer(int 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); + } + else + { + crew->CreateContents(Shovel); + crew->CreateContents(Pickaxe); + } + if (SCENOPT_Material >= 2) + crew->CreateContents(Loam, 2); + if (SCENOPT_Material == 3) + crew->CreateContents(DynamiteBox); + index++; + } + // Harsh zoom range. + SetPlayerZoomByViewRange(plr, 500, 350, PLRZOOM_LimitMax); + SetPlayerZoomByViewRange(plr, 500, 350, PLRZOOM_Direct); + // Set player wealth. + SetWealth(plr, 20 + 20 * SCENOPT_Material); return; } @@ -87,6 +96,65 @@ private func FindMountainLocation() return; } +private func InitEnvironment() +{ + // Cover the mountain in some snow already. + GiveMountainSnowCover(); + // Add a snow storm effect, strong winds and lot's of snow. + AddEffect("SnowStorm", nil, 100, 5, nil); + + // Set time of day to evening and create some clouds and celestials. + Cloud->Place(20); + CreateObject(Environment_Celestial); + var time = CreateObject(Environment_Time); + time->SetTime(60 * 22); + 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. + Earthquake->SetChance(5 + 5 * SCENOPT_Difficulty); + // TODO: Rockfall. + return; +} + +private func InitVegetation(int map_size) +{ + // Place some coniferous trees, but only up to 2/3 of the mountain. + Tree_Coniferous->Place(16 + Random(5), Rectangle(0, LandscapeHeight() / 3, LandscapeWidth(), 2 * LandscapeHeight() / 3)); + // Also some cave mushrooms as a source of wood. + LargeCaveMushroom->Place(5 + 2 * map_size + Random(5), nil, { terraform = false }); + + // Some mushrooms as source of food. + Mushroom->Place(30 + Random(10)); + + // Some objects in the earth. + PlaceObjects(Rock, 10 + 10 * map_size + Random(10),"Earth"); + PlaceObjects(Firestone, 20 + 10 * map_size + Random(5), "Earth"); + PlaceObjects(Loam, 20 + 10 * map_size + Random(5), "Earth"); + return; +} + +private func InitAnimals() +{ + return; +} + +private func InitMaterial(int amount) +{ + // An abandoned lorry somewhere close to the highest point of the peak. + var lorry = CreateObject(Lorry, LandscapeWidth() / 2, FindHeight(LandscapeWidth() / 2)); + lorry->CreateContents(Pickaxe, 2); + lorry->CreateContents(Shovel, 2); + lorry->CreateContents(Bread, 2 * amount); + lorry->CreateContents(Dynamite, 2 * amount); + lorry->CreateContents(DynamiteBox, amount); + lorry->CreateContents(Ropeladder, amount); + return; +} + private func GiveMountainSnowCover() { // Loop over the map horizontally. @@ -129,32 +197,6 @@ global func FxSnowStormTimer(object target, proplist effect) return 1; } -protected func InitializePlayer(int 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(Dynamite, 2); - } - else - { - crew->CreateContents(Shovel); - crew->CreateContents(Pickaxe); - crew->CreateContents(Dynamite, 2); - } - index++; - } - SetPlayerZoomByViewRange(plr, 500, 350, PLRZOOM_LimitMax); - return; -} - /*-- Some helper functions --*/ global func LogMatCounts()