From ca641bd76cf7454da918f33bf1413ef059bda593 Mon Sep 17 00:00:00 2001 From: Brett <15183337+Brett208@users.noreply.github.com> Date: Sat, 12 Sep 2026 17:17:57 -0400 Subject: [PATCH] Create helper functions to ease creation of map beacons (common ore, rare ore, fumaroles, and magma vents) --- OP2Helper.cpp | 20 ++++++++++++++++++++ OP2Helper.h | 13 +++++++++++++ 2 files changed, 33 insertions(+) diff --git a/OP2Helper.cpp b/OP2Helper.cpp index e803cea..1d8c645 100644 --- a/OP2Helper.cpp +++ b/OP2Helper.cpp @@ -45,6 +45,26 @@ void InitPlayerResources(int playerNum, const ResourceSet& resourceSet) player.SetRareOre(resources.rareOre); } +void CreateCommonOreBeacon(LOCATION loc, Yield yield, Variant variant) +{ + TethysGame::CreateBeacon(map_id::mapMiningBeacon, loc.x, loc.y, BeaconTypes::OreTypeCommon, yield, variant); +} + +void CreateRareOreBeacon(LOCATION loc, Yield yield, Variant variant) +{ + TethysGame::CreateBeacon(map_id::mapMiningBeacon, loc.x, loc.y, BeaconTypes::OreTypeRare, yield, variant); +} + +void CreateFumarole(LOCATION loc) +{ + TethysGame::CreateBeacon(map_id::mapFumarole, loc.x, loc.y, -1, -1, -1); +} + +void CreateMagmaVent(LOCATION loc) +{ + TethysGame::CreateBeacon(map_id::mapMagmaVent, loc.x, loc.y, -1, -1, -1); +} + void CreateTubeLine(LOCATION loc1, LOCATION loc2) { diff --git a/OP2Helper.h b/OP2Helper.h index 4dff00b..b431aad 100644 --- a/OP2Helper.h +++ b/OP2Helper.h @@ -49,6 +49,19 @@ bool operator!= (const LOCATION& loc1, const LOCATION &loc2); // Note: The following are general purpose functions // to help you implement your map. + +// Series of functions to simplify calls to TethysGame::CreateBeacon() + +// Add a common ore beacon to the map +void CreateCommonOreBeacon(LOCATION loc, Yield yield, Variant variant = Variant::VariantRandom); +// Add a rare ore beacon to the map +void CreateRareOreBeacon(LOCATION loc, Yield yield, Variant variant = Variant::VariantRandom); +// Add a fumarole (source of rare ore) to the map +void CreateFumarole(LOCATION loc); +// Add a magma vent (source of power using a GeoCon) to the map +void CreateMagmaVent(LOCATION loc); + + // Starting Resources void InitPlayerResources(int playerNum, const ResourceSet& resourceSet = CES1ResourceSet);