Phase 9: reproducible builds, balance from the server, spark check, play feedback
Build: every tool pinned (JDK, packwiz, Gradle plugins, Python packages), exports normalised, tools/check_reproducible.py proves two clean builds are byte-identical. Server-side balance: a server can load config/cobblesurvival/datapack.zip in place of the jar's data, /reload applies it, tools/server_update.py packages it and refuses when a client change is needed. JEI drop pages are sent by the server. Code-held balance numbers moved to tuning/server.json. Performance: spark in the pack (server only), tools/perf_test.py with fake players whose chunks really are active, docs/performance.md. Adrian's feedback: default keys R, U, J, §; drop pages link to Cobblemon Info and show real chances; bosses only hurt in battles; battle XP halved; channels between the islands low level; temperature ×3 with insulation doubled; hazards start at once; no item dots on the map; a wild attack starts a battle; the starter only faints; quest book on join with a basics page and an HMs page; regional forms obtainable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0741c84077
commit
4083791944
133 files changed
+8350
-3273
No files matched your search
@@ -34,7 +34,8 @@ import java.util.concurrent.ConcurrentLinkedQueue
|
||||
* - once a second, every online player's party and PC are swept for fainted Pokémon (one whose trainer was offline
|
||||
* or in a battle when it fainted).
|
||||
* Settling: a Pokémon holding an item from `#cobblesurvival:revival_charms` is healed and the charm is used up;
|
||||
* any other is removed from its party or PC.
|
||||
* any other is removed from its party or PC. The one exception is the player's starter (Adrian, 2026-11-09): it only
|
||||
* faints, and can't be released or sacrificed either ([isStarter]; CobbleHardcoreMon's side is mixin/HardcorePartyMixin).
|
||||
*/
|
||||
object Permadeath {
|
||||
val REVIVAL_CHARMS: TagKey<Item> =
|
||||
@@ -50,6 +51,18 @@ object Permadeath {
|
||||
// CobbleHardcoreMon settles the battle at NORMAL priority; it has to see the revived Pokémon fainted.
|
||||
CobblemonEvents.BATTLE_ENDED.subscribe(Priority.HIGHEST, ::onBattleEnded)
|
||||
NeoForge.EVENT_BUS.addListener(::onServerTick)
|
||||
CobblemonEvents.POKEMON_RELEASED_EVENT_PRE.subscribe(Priority.NORMAL) { event ->
|
||||
if (!isStarter(event.pokemon)) return@subscribe
|
||||
event.cancel()
|
||||
event.player.sendSystemMessage(Component.translatableWithFallback("message.cobblesurvival.permadeath.starter_release",
|
||||
"%s is your first partner: it can't be released.", event.pokemon.getDisplayName(false)).withStyle(ChatFormatting.YELLOW))
|
||||
}
|
||||
}
|
||||
|
||||
/** The Pokémon this player chose as a starter, which Cobblemon remembers for each player. */
|
||||
fun isStarter(pokemon: Pokemon): Boolean {
|
||||
val owner = pokemon.getOwnerUUID() ?: return false
|
||||
return Cobblemon.playerDataManager.getGenericData(owner).starterUUID == pokemon.uuid
|
||||
}
|
||||
|
||||
private fun onBattleFainted(event: BattleFaintedEvent) {
|
||||
@@ -85,7 +98,7 @@ object Permadeath {
|
||||
|
||||
private fun settle(player: ServerPlayer, pokemon: Pokemon) {
|
||||
val store = pokemon.storeCoordinates.get()?.store
|
||||
if (!pokemon.isFainted() || (store !is PlayerPartyStore && store !is PCStore)) return
|
||||
if (!pokemon.isFainted() || isStarter(pokemon) || (store !is PlayerPartyStore && store !is PCStore)) return
|
||||
// Faints during a battle are settled when it ends (above, and by CobbleHardcoreMon).
|
||||
if (player.isInBattle()) return
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user