Merge branch 'ys/lang-fixes' into 'main'

Clear smog lang

Closes #1120

See merge request cable-mc/cobblemon!1225
This commit is contained in:
Hiroku committed 2024-10-26 21:19:36 +00:00
commit 92ce7fd395
3 files changed
+39

No files matched your search

@@ -68,6 +68,7 @@ object ShowdownInterpreter {
updateInstructionParser["cant"] = { _, _, message, _ -> CantInstruction(message) }
updateInstructionParser["-clearallboost"] = { _, _, message, _ -> ClearAllBoostInstruction(message) }
updateInstructionParser["-clearnegativeboost"] = { _, _, message, _ -> ClearNegativeBoostInstruction(message) }
updateInstructionParser["-clearboost"] = { _, _, message, _ -> ClearBoostInstruction(message) }
updateInstructionParser["-copyboost"] = { _, _, message, _ -> CopyBoostInstruction(message) }
updateInstructionParser["-crit"] = { _, instructionSet, message, _ -> CritInstruction(message, instructionSet) }
updateInstructionParser["-curestatus"] = { _, _, message, _ -> CureStatusInstruction(message) }
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.battles.interpreter.instructions
import com.cobblemon.mod.common.api.battles.interpreter.BattleContext
import com.cobblemon.mod.common.api.battles.interpreter.BattleMessage
import com.cobblemon.mod.common.api.battles.model.PokemonBattle
import com.cobblemon.mod.common.battles.dispatch.InterpreterInstruction
import com.cobblemon.mod.common.util.battleLang
/**
* Format: |-clearboost|POKEMON
*
* Clear the boosts from the target POKEMON.
* @author Yaseen
* @since October 26th, 2024
*/
class ClearBoostInstruction(val message: BattleMessage): InterpreterInstruction {
override fun invoke(battle: PokemonBattle) {
val battlePokemon = message.battlePokemon(0, battle) ?: return
battle.dispatchWaiting(1.5F) {
val pokemonName = battlePokemon.getName()
val lang = battleLang("clearboost", pokemonName)
battle.broadcastChatMessage(lang)
battlePokemon.contextManager.clear(BattleContext.Type.BOOST, BattleContext.Type.UNBOOST)
battle.minorBattleActions[battlePokemon.uuid] = message
}
}
}
@@ -1298,6 +1298,7 @@
"cobblemon.battle.clearallboost": "All stat changes were eliminated!",
"cobblemon.battle.clearallnegativeboost": "%1$s's negative stat changes were removed!",
"cobblemon.battle.clearallnegativeboost.zeffect": "%1$s's returned its decreased stats to normal using its Z-Power!",
"cobblemon.battle.clearboost": "%1$s's stat changes were removed!",
"cobblemon.battle.unboost.slight": "%1$s's %2$s fell.",
"cobblemon.battle.unboost.sharp": "%1$s's %2$s harshly fell.",
"cobblemon.battle.unboost.severe": "%1$s's %2$s severely fell.",