Skip to content

Commit

Permalink
need to push this
Browse files Browse the repository at this point in the history
  • Loading branch information
nikothedude committed Jun 18, 2024
1 parent a477fcc commit 414b718
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 90 deletions.
4 changes: 2 additions & 2 deletions MCTE.version
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"modVersion":
{
"major":1,
"minor":4,
"patch":3 # Can be a number, character or string (1, 2, a, b, "-RC2", etc)
"minor":5,
"patch":0 # Can be a number, character or string (1, 2, a, b, "-RC2", etc)
},
}
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
1.5.0

Clarified that the error message toggle is in lunasettings

Now has UNGP rules for applying terrain effects to all battles
The backend has been notably refactored to allow for this
Uses enums now, and a significantly different approach to instantiating effects

YOU CANNOT DISABLE MCTE IF YOU HAVE THESE RULES ENABLED! IT WILL PROBABLY CRASH

By default, the slipstream PPT mult is now very forgiving
Its more fun this way

Expand Down
Binary file modified jars/niko_MCTE.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion jars/src/niko/MCTE/UNGP/rules/permaHyperstorm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class permaHyperstorm: UNGPterrainEffect() {
override fun updateDifficultyCache(difficulty: UNGP_SpecialistSettings.Difficulty?) {
if (difficulty == null) return

sizeMult = difficulty.getLinearValue(1f, 1f)
sizeMult = difficulty.getLinearValue(1f, 0.5f)
super.updateDifficultyCache(difficulty)
}

Expand All @@ -30,6 +30,7 @@ class permaHyperstorm: UNGPterrainEffect() {
}

override fun getDescriptionParams(index: Int, difficulty: UNGP_SpecialistSettings.Difficulty?): String {
updateDifficultyCache(difficulty)
val minClouds = MCTE_settings.MIN_HYPERCLOUDS_TO_ADD_PER_CELL * sizeMult
val maxClouds = MCTE_settings.MAX_HYPERCLOUDS_TO_ADD_PER_CELL * sizeMult

Expand Down
2 changes: 1 addition & 1 deletion jars/src/niko/MCTE/UNGP/rules/permaSlipstream.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import niko.MCTE.combatEffectTypes
import niko.MCTE.scripts.everyFrames.combat.terrainEffects.baseTerrainEffectScript
import niko.MCTE.scripts.everyFrames.combat.terrainEffects.slipstream.SlipstreamEffectScript
import niko.MCTE.settings.MCTE_settings
import niko.MCTE.utils.terrainEffectCreationLogic
import ungp.scripts.campaign.specialist.UNGP_SpecialistSettings

class permaSlipstream: UNGPterrainEffect() {
Expand Down Expand Up @@ -33,6 +32,7 @@ class permaSlipstream: UNGPterrainEffect() {
}

override fun getDescriptionParams(index: Int, difficulty: UNGP_SpecialistSettings.Difficulty?): String {
updateDifficultyCache(difficulty)
return when (index) {
0 -> "slipstream"
1 -> "safety overrides"
Expand Down
8 changes: 4 additions & 4 deletions jars/src/niko/MCTE/UNGP/rules/randomTerrainEffect.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import niko.MCTE.scripts.everyFrames.combat.terrainEffects.pulsarBeam.pulsarEffe
import niko.MCTE.scripts.everyFrames.combat.terrainEffects.slipstream.SlipstreamEffectScript
import niko.MCTE.settings.MCTE_settings
import niko.MCTE.utils.MCTE_debugUtils
import niko.MCTE.utils.terrainEffectCreationLogic
import niko.MCTE.utils.terrainScriptsTracker
import org.lazywizard.lazylib.MathUtils
import ungp.scripts.campaign.specialist.UNGP_SpecialistSettings
Expand Down Expand Up @@ -78,8 +77,8 @@ class randomTerrainEffect: UNGPterrainEffect() {
return combatEffectTypes.MESONFIELD.createInformedEffectInstance(stormList, effectMult)
}
combatEffectTypes.HYPERSPACE -> return combatEffectTypes.HYPERSPACE.createInformedEffectInstance(combatEffectTypes.instantiateHyperstormCells(engine, effectMult, true))
combatEffectTypes.PULSAR -> return combatEffectTypes.PULSAR.createInformedEffectInstance(hashMapOf(Pair(MathUtils.getRandomNumberInRange(0f, 360f), MCTE_settings.PULSAR_BASE_FORCE * 20f)), effectMult)
combatEffectTypes.BLACKHOLE -> return combatEffectTypes.BLACKHOLE.createInformedEffectInstance(hashMapOf(Pair(MathUtils.getRandomNumberInRange(0f, 360f), MCTE_settings.BLACKHOLE_BASE_GRAVITY * 20f)), effectMult)
combatEffectTypes.PULSAR -> return combatEffectTypes.PULSAR.createInformedEffectInstance(hashMapOf(Pair(MathUtils.getRandomNumberInRange(0f, 360f), 0.6f)), effectMult)
combatEffectTypes.BLACKHOLE -> return combatEffectTypes.BLACKHOLE.createInformedEffectInstance(hashMapOf(Pair(MathUtils.getRandomNumberInRange(0f, 360f), 0.4f)), effectMult)
}
MCTE_debugUtils.log.info("$usableEffect does not match any implemented random terrain effects, skipping random effect gen")
return null
Expand All @@ -95,8 +94,9 @@ class randomTerrainEffect: UNGPterrainEffect() {
}

override fun getDescriptionParams(index: Int, difficulty: UNGP_SpecialistSettings.Difficulty?): String {
updateDifficultyCache(difficulty)
when (index) {
0 -> return "$effectMult"
0 -> return "${effectMult}x"
else -> return ""
}
}
Expand Down
12 changes: 10 additions & 2 deletions jars/src/niko/MCTE/combatEffectTypes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import niko.MCTE.scripts.everyFrames.combat.terrainEffects.mesonField.mesonField
import niko.MCTE.scripts.everyFrames.combat.terrainEffects.pulsarBeam.pulsarEffectScript
import niko.MCTE.scripts.everyFrames.combat.terrainEffects.slipstream.SlipstreamEffectScript
import niko.MCTE.settings.MCTE_settings
import niko.MCTE.settings.MCTE_settings.BLACKHOLE_TIMEMULT_MULT
import niko.MCTE.utils.MCTE_debugUtils
import niko.MCTE.utils.MCTE_nebulaUtils
import niko.MCTE.utils.MCTE_nebulaUtils.getCloudsInRadius
Expand All @@ -34,10 +35,15 @@ enum class combatEffectTypes {
val isInFlare = entry
if (isInFlare) instance.isStorm = true

if (effectMult == 0f) {
instance.eccmChanceMod = 0f
} else {
instance.eccmChanceMod *= if (isInFlare) MCTE_settings.MAGSTORM_ECCM_MULT / effectMult else MCTE_settings.MAGFIELD_ECCM_MULT / effectMult
}

instance.visionMod *= if (isInFlare) MCTE_settings.MAGSTORM_VISION_MULT * effectMult else MCTE_settings.MAGFIELD_VISION_MULT * effectMult
instance.missileMod *= if (isInFlare) MCTE_settings.MAGSTORM_MISSILE_MULT * effectMult else MCTE_settings.MAGFIELD_MISSILE_MULT * effectMult
instance.rangeMod *= if (isInFlare) MCTE_settings.MAGSTORM_RANGE_MULT * effectMult else MCTE_settings.MAGFIELD_RANGE_MULT * effectMult
instance.eccmChanceMod *= if (isInFlare) MCTE_settings.MAGSTORM_ECCM_MULT * effectMult else MCTE_settings.MAGFIELD_ECCM_MULT * effectMult
instance.missileBreakLockBaseChance += if (isInFlare) MCTE_settings.MAGSTORM_MISSILE_SCRAMBLE_CHANCE * effectMult else MCTE_settings.MAGFIELD_MISSILE_SCRAMBLE_CHANCE * effectMult
}
}
Expand Down Expand Up @@ -79,8 +85,10 @@ enum class combatEffectTypes {

for (entry in pushDirs) {
instance.anglesToIntensity[entry.key] = entry.value
instance.timeMult += (entry.value * BLACKHOLE_TIMEMULT_MULT)
}
if (effectMult <= 0) {

if (effectMult == 0f) {
instance.timeMult = 0f
} else {
instance.timeMult *= effectMult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ class blackHoleEffectScript(
}

private fun getGravityForceForEntity(entity: CombatEntityAPI, baseIntensity: Float): Float {
var timeMult = 1f
val engineMult: Float = engine.timeMult.modifiedValue
if (entity is ShipAPI) {
timeMult = entity.mutableStats.timeMult.modifiedValue
}
val adjustedIntensity = baseIntensity * BLACKHOLE_BASE_GRAVITY
val totalTimeMult = engineMult
val mult = if (entity is DamagingProjectileAPI) 0.3f else 1f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import niko.MCTE.settings.MCTE_settings.SLIPSTREAM_PPT_MULT
import niko.MCTE.settings.MCTE_settings.loadSettings
import niko.MCTE.utils.MCTE_debugUtils
import niko.MCTE.utils.MCTE_ids
import niko.MCTE.utils.terrainEffectCreationLogic
import niko.MCTE.utils.terrainScriptsTracker
import org.lazywizard.lazylib.MathUtils
import org.lazywizard.lazylib.VectorUtils
Expand Down
74 changes: 0 additions & 74 deletions jars/src/niko/MCTE/utils/terrainEffectCreationLogic.kt

This file was deleted.

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 Combat Terrain Effects", # Displayed to the player
"author":"Niko",
"utility":"true",
"version":"1.4.3",
"version":"1.5.0",
"description":"Adds combat effects to magnetic fields, slipstreams, nebulae, hyperstorms, pulsars, and black holes.",
"gameVersion": "0.97a-RC11",
"jars":["jars/niko_MCTE.jar"],
Expand Down

0 comments on commit 414b718

Please sign in to comment.