mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-11-20 07:08:53 -05:00
Change the interpretation a little and added an else fallback, can't figure out that 'battlemessage' will need assistance
This commit is contained in:
1 parent
321ccacdb3
commit
5efefe9ceb
2 files changed
+20
-13
No files matched your search
@@ -47,7 +47,7 @@ open class PokemonBattle(
|
||||
val side2: BattleSide
|
||||
) {
|
||||
/** Whether or not logging will be silenced for this battle. */
|
||||
var mute = true
|
||||
var mute = false
|
||||
|
||||
init {
|
||||
side1.battle = this
|
||||
|
||||
@@ -743,26 +743,33 @@ object ShowdownInterpreter {
|
||||
|
||||
private fun handleFieldStartInstructions(battle: PokemonBattle, message: String, remainingLines: MutableList<String>){
|
||||
battle.dispatch{
|
||||
when {
|
||||
"move: Mud Sport" in message -> battle.broadcastChatMessage(battleLang("mud_sport_field"))
|
||||
"move: Electric Terrain" in message -> battle.broadcastChatMessage(battleLang("electric_terrain_field"))
|
||||
"move: Grassy Terrain" in message -> battle.broadcastChatMessage(battleLang("grassy_terrain_field"))
|
||||
"move: Misty Terrain" in message -> battle.broadcastChatMessage(battleLang("misty_terrain_field"))
|
||||
"move: Psychic Terrain" in message -> battle.broadcastChatMessage(battleLang("psychic_terrain_field"))
|
||||
"move: Water Sport" in message -> battle.broadcastChatMessage(battleLang("water_sport_field"))
|
||||
val editedMessage = message.split("|-fieldstart|")[1]
|
||||
val pnx = editedMessage.substring(0, 3)
|
||||
val fromWhat = editedMessage.split("|")[1]
|
||||
when (fromWhat) {
|
||||
"move: Mud Sport" -> battle.broadcastChatMessage(battleLang("mud_sport_field"))
|
||||
"move: Electric Terrain" -> battle.broadcastChatMessage(battleLang("electric_terrain_field"))
|
||||
"move: Grassy Terrain" -> battle.broadcastChatMessage(battleLang("grassy_terrain_field"))
|
||||
"move: Misty Terrain" -> battle.broadcastChatMessage(battleLang("misty_terrain_field"))
|
||||
"move: Psychic Terrain" -> battle.broadcastChatMessage(battleLang("psychic_terrain_field"))
|
||||
"move: Water Sport" -> battle.broadcastChatMessage(battleLang("water_sport_field"))
|
||||
else -> battle.broadcastChatMessage(editedMessage.text())
|
||||
}
|
||||
GO
|
||||
WaitDispatch(1F)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleAbilityInstructions(battle: PokemonBattle, message: String, remainingLines: MutableList<String>) {
|
||||
battle.dispatch {
|
||||
val pnx = message.split("|-ability|")[1].substring(0, 3)
|
||||
val editedMessage = message.split("|-ability|")[1]
|
||||
val pnx = editedMessage.substring(0, 3)
|
||||
val (_, pokemon) = battle.getActorAndActiveSlotFromPNX(pnx)
|
||||
when {
|
||||
"Speed Boost" in message -> battle.broadcastChatMessage(battleLang("speed_boost_ability",pokemon.battlePokemon!!.getName()))
|
||||
val fromWhat = editedMessage.split("|")[1]
|
||||
when (fromWhat) {
|
||||
"Speed Boost" -> battle.broadcastChatMessage(battleLang("speed_boost_ability", pokemon.battlePokemon!!.getName()))
|
||||
else -> battle.broadcastChatMessage(editedMessage.text())
|
||||
}
|
||||
GO
|
||||
WaitDispatch(1F)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user