Skip to content

Commit 8ce4f53

Browse files
committed
🐛 (mapScript) 通过soft依赖无法加载mapPatches
1 parent 0a6cbcd commit 8ce4f53

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

scripts/mapScript/1002.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@file:Depends("mapScript/shared/hexed")
2-
@file:Depends("mapScript/tags/autoExchange", "等价交换", soft = true)
32

43
package mapScript
54

@@ -16,7 +15,7 @@ import kotlin.time.Duration.Companion.minutes
1615

1716
val generator = HexedGenerator(4, 5, 144, 34)
1817
registerGenerator(
19-
"HEXed PVP 超大区块", "WayZer", """插件控制的随机pvp图[@pvpProtect=480]""",
18+
"HEXed PVP 超大区块", "WayZer", """插件控制的随机pvp图[@pvpProtect=480][@autoExchange]""",
2019
mode = Gamemode.pvp,
2120
filter = setOf("all", "display", "pvp", "hexed"),
2221
width = generator.width, height = generator.height

scripts/mapScript/1004.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@file:Depends("mapScript/shared/hexed")
2-
@file:Depends("mapScript/13545", "CoreWar", soft = true)
32

43
package mapScript
54

@@ -21,7 +20,7 @@ val generator = HexedGenerator(4, 5, 78)
2120
registerGenerator(
2221
"HEXed * CoreWar", "WayZer", """
2322
塔防掉落[@TDDrop=all]
24-
招兵买马(CoreWar)模式 @13545
23+
招兵买马(CoreWar)模式 [@coreWar]
2524
[@pvpProtect=0]
2625
""".trimIndent(),
2726
mode = Gamemode.pvp,

scripts/mapScript/lib/ScriptMapGenerator.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ class ScriptMapGenerator(val script: Script, val width: Int, val height: Int) {
9292
)
9393
}
9494

95+
override fun toString(): String = "ScriptGeneratorMap"
96+
9597
override suspend fun loadMap(info: MapInfo) {
9698
val generator = knownMaps[info.id]?.generator ?: return MapManager.loadMap()
9799
generator.load()

scripts/mapScript/tags/autoExchange.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ val cores = content?.run {
3030
@Language("JSON5")
3131
val patch = """
3232
{
33-
"name": "CoreWar",
33+
"name": "AutoExchange",
3434
${cores.joinToString("\n")}
3535
}
3636
""".trimIndent()
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/**@author WayZer*/
55

6-
package mapScript
6+
package mapScript.tags
77

88
import arc.util.Align
99
import coreLibrary.lib.util.loop
@@ -13,6 +13,7 @@ import mindustry.net.Administration
1313
import mindustry.world.blocks.storage.CoreBlock
1414
import org.intellij.lang.annotations.Language
1515

16+
registerMapTag("@coreWar")
1617
modeIntroduce(
1718
"招兵买马 CoreWar", """
1819
点击核心可以打开菜单
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package mapScript
1+
package mapScript.tags
22

33
import arc.math.Mathf
44
import cf.wayzer.scriptAgent.contextScript
@@ -25,7 +25,7 @@ import kotlin.reflect.KMutableProperty0
2525
private val confirmed = mutableSetOf<String>()
2626

2727
class CoreWarMenu(val player: Player, val build: Building) : MenuBuilder<Unit>(followup = true) {
28-
private val script = contextScript<_13545>()
28+
private val script = contextScript<CoreWar>()
2929
private val isErekir = build.block in arrayOf(Blocks.coreAcropolis, Blocks.coreBastion, Blocks.coreCitadel)
3030
private val item = if (isErekir) Items.beryllium else Items.copper
3131
private fun Building.getResource() = items.get(item)

0 commit comments

Comments
 (0)