Skip to content

Commit

Permalink
ok we're here
Browse files Browse the repository at this point in the history
  • Loading branch information
nikothedude committed Jul 11, 2024
1 parent dd56a49 commit 4e0afb0
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 13 deletions.
Binary file removed More Planetary Conditions.7z
Binary file not shown.
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
3.3.4:
3.4.0:
SAVE COMPATIBLE

Overgrown Nanoforge
Clarified that overgrown nanoforges give a very powerful item when culled
Added a button to the core UI that toggles the built-in commodity weighting
TLDR is that supply adjustments previously had a super high chance of picking a commodity the nanoforge already produces
Now you can toggle it
Can now generate with indevo's ship components

Ultra-Magnetic fields
Fixed a bug where ultra-magnetic fields would have null names (and cause crashes)
Expand Down
Binary file modified jars/niko_morePlanetaryConditions.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion mod_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name":"More Planetary Conditions", # Displayed to the player
"author":"Niko",
"utility":"false",
"version":"3.3.4BETAc",
"version":"3.4.0",
"description":"Adds a bunch of misc. planetary conditions to the game, many, if not most, with custom scripted effects that go beyond what most other conditions, vanilla or modded, do.",
"gameVersion": "0.97a-RC11",
"jars":["jars/niko_morePlanetaryConditions.jar"],
Expand Down
4 changes: 2 additions & 2 deletions niko_MPC.version
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"modVersion":
{
"major":3,
"minor":3,
"patch":4 # Can be a number, character or string (1, 2, a, b, "-RC2", etc)
"minor":4,
"patch":0 # Can be a number, character or string (1, 2, a, b, "-RC2", etc)
},
}
10 changes: 5 additions & 5 deletions src/data/niko_MPC_modPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import data.scripts.campaign.econ.conditions.defenseSatellite.handlers.niko_MPC_
import data.scripts.campaign.econ.conditions.overgrownNanoforge.handler.overgrownNanoforgeJunkHandler
import data.scripts.campaign.econ.conditions.overgrownNanoforge.industries.overgrownNanoforgeOptionsProvider
import data.scripts.campaign.econ.conditions.overgrownNanoforge.listeners.overgrownNanoforgeDiscoveryListener
import data.scripts.campaign.econ.conditions.overgrownNanoforge.overgrownNanoforgeCommodityDataStore
import data.scripts.campaign.econ.conditions.overgrownNanoforge.sources.effects.effectTypes.spawnFleet.overgrownNanoforgeSpawnFleetScript
import data.scripts.campaign.econ.conditions.overgrownNanoforge.sources.effects.overgrownNanoforgeEffectPrototypes
import data.scripts.campaign.econ.conditions.terrain.hyperspace.niko_MPC_realspaceHyperspace
Expand Down Expand Up @@ -91,6 +92,10 @@ class niko_MPC_modPlugin : BaseModPlugin() {
@Throws(RuntimeException::class)
override fun onApplicationLoad() {
val isLazyLibEnabled = Global.getSettings().modManager.isModEnabled("lw_lazylib")
niko_MPC_settings.MCTE_loaded = Global.getSettings().modManager.isModEnabled("niko_moreCombatTerrainEffects")
niko_MPC_settings.indEvoEnabled = Global.getSettings().modManager.isModEnabled("IndEvo")
AOTD_vaultsEnabled = Global.getSettings().modManager.isModEnabled("aotd_vok")
nexLoaded = Global.getSettings().modManager.isModEnabled("nexerelin")
if (!isLazyLibEnabled) {
throw RuntimeException("LazyLib is required for more planetary conditions!")
}
Expand All @@ -108,11 +113,6 @@ class niko_MPC_modPlugin : BaseModPlugin() {
use unused aurorae2 t exture in graphics/planets to make a tachyon field that makes you go fast around stars? \n\
investigaet dark nebula in graphics/fx. good terrain sprite"
)*/

niko_MPC_settings.MCTE_loaded = Global.getSettings().modManager.isModEnabled("niko_moreCombatTerrainEffects")
niko_MPC_settings.indEvoEnabled = Global.getSettings().modManager.isModEnabled("IndEvo")
AOTD_vaultsEnabled = Global.getSettings().modManager.isModEnabled("aotd_vok")
nexLoaded = Global.getSettings().modManager.isModEnabled("nexerelin")
}

val overgrownNanoforgeItemInstance = overgrownNanoforgeItemEffect(overgrownNanoforgeItemId, 0, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import data.scripts.campaign.econ.conditions.overgrownNanoforge.intel.overgrownN
import data.scripts.campaign.intel.baseNikoEventStageInterface
import data.utilities.niko_MPC_settings
import lunalib.lunaExtensions.addLunaToggleButton
import lunalib.lunaUI.elements.LunaProgressBar

class overgrownNanoforgeIndustryManipulationIntel(
brain: overgrownNanoforgeSpreadingBrain,
Expand Down Expand Up @@ -49,6 +50,12 @@ class overgrownNanoforgeIndustryManipulationIntel(
override fun addMiddleDescriptionText(info: TooltipMakerAPI, width: Float, stageId: Any?) {
super.addMiddleDescriptionText(info, width, stageId)
val overallSuppressionMeter = overallManipulationMeter?.get() ?: return
if (playerCanManipulateGrowth()) {
addFocusButton(info, overallSuppressionMeter)
}
}

fun addFocusButton(info: TooltipMakerAPI, overallSuppressionMeter: LunaProgressBar) {
val focusButton = info.addLunaToggleButton(ourHandler.focusingOnExistingCommodities, 100f, overallSuppressionMeter.height)
focusButton.position.rightOfMid(overallSuppressionMeter.elementPanel, 5f)
focusButton.onInput { ourHandler.focusingOnExistingCommodities = focusButton.value }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package data.scripts.campaign.econ.conditions.overgrownNanoforge
import com.fs.starfarer.api.impl.campaign.ids.Commodities
import data.scripts.campaign.econ.conditions.overgrownNanoforge.handler.overgrownNanoforgeHandler
import data.scripts.campaign.econ.conditions.overgrownNanoforge.handler.overgrownNanoforgeIndustryHandler
import data.utilities.niko_MPC_settings
import data.utilities.niko_MPC_settings.OVERGROWN_NANOFORGE_ALREADY_PRODUCING_COMMODITY_WEIGHT_MULT


Expand Down Expand Up @@ -31,10 +32,11 @@ object overgrownNanoforgeCommodityDataStore: HashMap<String, overgrownNanoforgeC

val organicsData = overgrownNanoforgeCommoditySetupData(Commodities.ORGANICS, 12f, 10f, hashMapOf(Pair(Commodities.HEAVY_MACHINERY, 0.35f)))
val volatilesData = overgrownNanoforgeCommoditySetupData(Commodities.VOLATILES, 17f,8f, hashMapOf(Pair(Commodities.HEAVY_MACHINERY, 0.5f)))
init {
reload()
}

val shipComponentsData = overgrownNanoforgeCommoditySetupData("IndEvo_parts", 40f, 5f, hashMapOf(Pair(Commodities.ORE, 0.8f), Pair(Commodities.HEAVY_MACHINERY, 0.1f)))

fun reload() {
this.clear()
this[Commodities.SUPPLIES] = supplyData
this[Commodities.METALS] = metalData
this[Commodities.RARE_METALS] = rareMetalData
Expand All @@ -51,6 +53,10 @@ object overgrownNanoforgeCommodityDataStore: HashMap<String, overgrownNanoforgeC
this[Commodities.RARE_ORE] = rareOreData
this[Commodities.VOLATILES] = volatilesData
this[Commodities.ORGANICS] = organicsData

if (niko_MPC_settings.indEvoEnabled) {
this["IndEvo_parts"] = shipComponentsData
}
}

fun getWeightForCommodity(commodityId: String, nanoforge: overgrownNanoforgeHandler, negative: Boolean = false): Float {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import com.fs.starfarer.api.impl.campaign.procgen.StarSystemGenerator
import com.fs.starfarer.api.impl.campaign.terrain.MagneticFieldTerrainPlugin
import com.fs.starfarer.api.ui.TooltipMakerAPI
import com.fs.starfarer.api.util.Misc
import data.niko_MPC_modPlugin
import data.scripts.campaign.econ.conditions.hasDeletionScript
import data.scripts.campaign.econ.conditions.niko_MPC_baseNikoCondition
import data.scripts.everyFrames.deletionScript
Expand Down
2 changes: 1 addition & 1 deletion src/data/utilities/niko_MPC_marketUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object niko_MPC_marketUtils {

val commodities = hashSetOf(Commodities.FUEL, Commodities.DRUGS, Commodities.FOOD, Commodities.DOMESTIC_GOODS,
Commodities.HEAVY_MACHINERY, Commodities.HAND_WEAPONS, Commodities.METALS, Commodities.ORE, Commodities.RARE_METALS, Commodities.RARE_ORE,
Commodities.SHIPS, Commodities.LUXURY_GOODS, Commodities.ORGANICS, Commodities.VOLATILES, Commodities.SUPPLIES)
Commodities.SHIPS, Commodities.LUXURY_GOODS, Commodities.ORGANICS, Commodities.VOLATILES, Commodities.SUPPLIES, "IndEvo_parts", )

@JvmStatic
fun removeNonNanoforgeProducableCommodities(list: MutableSet<String>): MutableSet<String> {
Expand Down
2 changes: 2 additions & 0 deletions src/data/utilities/niko_MPC_settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.fs.starfarer.api.Global
import data.niko_MPC_modPlugin
import data.niko_MPC_modPlugin.Companion.modId
import data.scripts.campaign.econ.conditions.defenseSatellite.handlers.niko_MPC_derelictSatelliteHandler
import data.scripts.campaign.econ.conditions.overgrownNanoforge.overgrownNanoforgeCommodityDataStore
import data.scripts.campaign.econ.conditions.overgrownNanoforge.sources.effects.randomizedSourceBudgets
import data.utilities.niko_MPC_debugUtils.displayError
import data.utilities.niko_MPC_satelliteUtils.getSatelliteHandlers
Expand Down Expand Up @@ -102,6 +103,7 @@ object niko_MPC_settings {

DERELICT_ESCORT_SIMULATE_FLEETS = LunaSettings.getBoolean(modId, "MPC_derelictEscortSimulateFleets")!!
DERELICT_ESCORT_SPAWN_ON_PATROLS = LunaSettings.getBoolean(modId, "MPC_derelictEscortSpawnOnPatrols")!!
overgrownNanoforgeCommodityDataStore.reload()
}

fun loadNexSettings() {
Expand Down

0 comments on commit 4e0afb0

Please sign in to comment.