Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-----------------------------------------------------------------------------
- # Script creado por FiaPlay para Pokémon Essentials BES. Créditos si se usa.
- # Discord de FP Systems: https://discord.gg/ds8DWB5NSW
- # Si vas reportar algún bug o preguntar algo recomiendo hacerlo en el hilo del server de PokeLiberty o en FP Systems.
- #Changelog:
- #3.1: Añadida la posibilidad de poner un texto cuando se cambia el clima.
- # Añadida la posibilidad de poner un texto cuando se cambia el campo activo.
- # Añadida la posibilidad de poner un texto cuando se cambia un Pokémon.
- # Se puede definir un color para los diálogos de un personaje específico.
- # Corrección de errores
- #3.0: Añadidos más bufers para diálogos.
- # Si pones //ht en un diálogo no se mostrará el entrenador.
- # Añadida la posibilidad de poner un texto cuando el último Pokémon del jugador tiene pocos PS.
- # Añadida la posibilidad de poner un bgm cuando el jugador saca su último Pokémon.
- # Añadida la posibilidad de poner un texto cuando se usa un movimiento Físico, Especial o de Estado.
- # Optimización, etc.....
- #2.3.1: Corregido bug que hacía que lowhp_last se muestre varias veces.
- # Ahora es posible poner un texto cuando el jugador tiene un solo pokémon en su equipo.(Idea por: Papalomond Sempai)
- #2.3: Cambio de nombre de las claves por otras más cortas y fáciles de recordar.
- # Añadida la posibilidad de poner un texto cuando comienza y termina un turno.
- # Ahora es posible definir un diálogo desde la llamada a Script.
- # Ahora si pones //PN en un texto se mostrará el nombre del jugador.
- # Corrección de errores y optimización.
- #2.2.2: Solucionado bug con la megaevolución salvaje.
- #2.2.1: Solucionado bug de los Pokemon Oscuros del jugador.
- #2.2: Ahora puedes encadenar varios textos colocándolos en una Array. (Se muestran uno detrás de otro)
- # Añadida la posibilidad de poner un texto cuando se unvía un Pokémon Shiny.
- # Añadida la posibilidad de poner un texto cuando el último Pokémon del rival tiene pocos PS.
- # Corrección de errores y refactorización.
- #2.1.1: Solucionado Bug de incompatibilidad con el script de Entrenadores dinámicos.
- #2.1: Añadida la posibilidad de poner un texto cuando el jugador saca un Pokémon oscuro.
- # Añadida la posibilidad de poner un texto cuando el jugador saca su último Pokémon.
- # Añadida la posibilidad de poner un texto cuando un Pokémon recibe un golpe Super-Efectivo.
- # Añadida la posibilidad de poner un texto cuando un Pokémon recibe un golpe Poco-Efectivo.
- # Añadida la posibilidad de poner un texto cuando un Pokémon recibe un Golpe Crítico.
- # Solucionada incompatibilidad con mi script de Megaevolución de Pokémon Salvaje (Coloque este script debajo de ese).
- # Compatibilidad con este sistema de Dynamax: https://www.pokecommunity.com/showthread.php?t=426770
- # Corrección de errores.
- #2.0: Nueva forma de setear los textos (No pienso volver a cambiarla).
- # Eliminada la necesidad de usar variables de evento.
- # Ahora el rival puede decir algo cuando el jugador usa una de las mecánicas de batalla (Megaevolución,Ultraexplosión,etc...)
- # Ahora el rival puede decir algo cuando este saca un Pokémon en específico.
- # Añadida la posibilidad de reproducir un SE junto con los textos.
- #-----------------------------------------------------------------------------
- # Demostración https://youtu.be/lHCQdq62Xh8 (2.0)
- #-----------------------------------------------------------------------------
- # Modo de uso:
- #Para que los campos funcionen siga los pasos de: https://pastebin.com/kK8a85DN
- #Para activar los textos solo setealos usando el método fpTTS_set()
- #Entre paréntesis va un Symbol que es el nombre de la constante con los datos.
- =begin Para un ejemplo práctico pegue una de las siguientes 3 líneas en una llamada a script
- fpTTS_set(:FIAPLAY)
- fpTTS_set(:CHAMPION_BLUE)
- fpTTS_set(:LEADER_BROCK)
- =end
- =begin Si lo que quiere es definirlo desde una llamada a Script (Ni idea de por qué) podría:
- dialogue={
- "mega" => "¡Voy con todo!",
- "super_effective_move(player)" => "Sabes lo que haces muchacho."
- }
- fpTTS_set(dialogue)
- En caso de que quieras solo el del último pokémon:
- fpTTS_set("¡Es el momento de darlo todo!")
- =end
- =begin En caso de que tu proyecto vaya a tener más de un idioma debes poner _INTL antes del diálogo para poder traducirlo. Tal que así:
- "last" => [_INTL("Finaly."),_INTL("The Groundon's awakening.")]
- =end
- #-----------------------------------------------------------------------------
- # FAQ:
- #*¿Para cuando videotutorial?
- # Para cuando tenga ganas.
- #
- #*¿Funciona con combates dobles?
- # Sí, pero no recomendable usarlo en combates múltiples.
- #
- #*¿Cómo puedo añadir nuevos diálogos o modificar como se muestran?
- # Los diálogos se muestran con el comando fpShowText, si tienes algnos conocimientos en programación te será facil modificarlo a tu gusto.
- #
- #*He recibido x error y me parece que es este script.
- # Avísame por el Discord. (Solo si de verdad crees que fue este script)
- #-----------------------------------------------------------------------------
- # Estas son las opciones cámbialas a como necesites.
- #-----------------------------------------------------------------------------
- TEXTSE = "" #SE que se reproducirá al aparecer el sprite del entrenador
- module MBD_Data
- #Lista con los colores de texto de cada entrenador.
- #Por limitaciones de RGSS no funcionan nombres con acentos.
- CHARACTERS_COLORS = {"FiaPlay" => [Color.new(22,245,237),Color.new(1,102,99)],
- "Flandecson" => [Color.new(245,22,22),Color.new(102,1,1)],
- "Mavros" => [Color.new(204,22,245),Color.new(102,1,95)],
- "Brock" => [Color.new(255,77,0),Color.new(77,25,0)]}
- #-----------------------------------------------------------------------------
- # En la siguiente constante están configurados todos los diálogos posibles.
- #-----------------------------------------------------------------------------
- FIAPLAY={
- "last_bgm" => "Battle! (Gym Leader)",
- "last_bgm(player)" => "Battle! (Champion)",
- "last" => ["Es momento de ponerse serio.","Flandecson: No recuerdo la última vez que vi a Fia tan centrado en un combate//ht"],
- "last(player)" => "Te veo en un buen apuro.",
- "end_turn" => {0 => ["¿Qué haces?","Esto solo está empezando."],
- 10 => "Este combate se está alargando más de lo que me gustaría."},
- "pre_start_turn" => {0 => "No recuerdo la última vez que me enfrenté a alguien tan reconocido."},
- "start_turn" => {0 => "Veamos de qué estás hecho... //PN."},
- "one_poke" => ["Jajaja","¿En qué estás pensando //PN?"],
- "lowhp_last" => ["!No puede ser¡","¡Mi //B1N!"],
- "lowhp_last(player)" => "Flandecson: !Estas a punto de caer ante el gran //ON.//ht",
- "shiny" => ["¿Cómo ves mi brillo?","¿Es mucho para tí?"],
- "shiny(player)" => "¿De dónde sacaste eso?",
- "mega" => "¡Qué importa solo debo usar la poderosa energía ancestral!",
- "mega(player)" => ["No podía esperar menos de tí.","Eres digno de retar al gran //ON."],
- "primal" => "El poder primigenio es la clave de mi victoria.",
- "primal(player)" => "Rubíes y Zafiros... Veo que también dominas ese poder.",
- "ultra" => "¡Ilumínanos y muestra el poder del Cosmos!",
- "ultra(player)" => ["Debo admitirlo. Esa ráfaga de luz me ha dejado marvillado.","Mavros: Esa luz...//nAcaso será.//ht"],
- "send" => {PBSpecies::KYOGRE => "Tan solo admira mi Leviatán.",
- PBSpecies::GROUDON => "Un poderoso Reptil Ígneo.",
- PBSpecies::RAYQUAZA => "Tardé años en domar el poder de esta leyenda."},
- "item" => "No puedo dejar que esto termine tan rápido.",
- "recall" => "Me pones en un buen aprieto.",
- "recall(player)" => "Mavros: ¿Qué estará tramando //PN?",
- "shadow" => "No es inhumano , solo es un viejo truco.",
- "shadow(player)" => "Me sorprende verte usando un poder como ese.",
- "caught" => "¿Cómo te atreves?",
- "weather" => {PBWeather::SUNNYDAY => "Fire in the hole!",
- PBWeather::RAINDANCE => ["Mavros: Cae la lluvia...//ht","Flandecson: La naturaleza llora.//ht"]},
- "terrain" => {"Electric" => "Prepárate para una buena descarga.", #Los terrenos son Grassy , Electric , Misty y Psiqui
- "Misty" => ["Flandecson: Esto no se ve bien.","Flandecson: ¡De hecho no se ve nada!"]},
- "critical_move" => "Tengo al universo de mi lado.",
- "critical_move(player)" => "Necesitarás más que suerte para vencerme.",
- "low_effective_move" => "Debo pensar mejor lo que hago.",
- "low_effective_move(player)" => ["Creí tenías más experiencia.","No puedes ganarme cometiendo errores."],
- "super_effective_move" => "Mavros: Cometiste un greve error al meterte el jefe//ht.",
- "super_effective_move(player)" => "Nada mal niño.",
- "special_move" => "Te veo y te analizo.",
- "special_move(player)" => "Ven, acércate a //B1N.",
- "physical_move" => "No puedo perder tiempo.",
- "physical_move(player)" => "¿Acaso sabes lo que haces?",
- "status_move" => "No puedo arriesgarme.",
- "status_move(player)" => "¿Qué estás tramando?.",
- "z_move" => "Es momento de un AZ oculto.",
- "z_move(player)" => "Me estás atacando a matar.",
- "tera" => "Ilumínate con mi resplandor.",
- "tera(player)" => "¡Me sorprende que sepas usar este fenómeno!",
- "tera(Ogerpon)" => ["Mavros: ...acaso es...//ht","¿Podrías dejar de burlarte de mi?"]
- }
- #-----------------------------------------------------------------------------
- # Esto sería para la batalla contra el campeón por defecto.
- #-----------------------------------------------------------------------------
- CHAMPION_BLUE={
- "last" => "No puedo dejar que me derrotes ahora.",
- "last(player)" => "Nuestros eternos combates por fin terminarán.",
- "end_turn" => {0 => ["Este combate solo está empezando.", "No debes confiarte."]},
- "lowhp_last" => "Mientras tenga uno mi poder es infinito.",
- "send" => {PBSpecies::BLASTOISE => "Espero que sepas nadar.",
- PBSpecies::CHARIZARD => "Prepárate para pasar calor."},
- "item" => "Usaré todo lo que tenga a mano para vencerte.",
- "shadow(player)" => ["Veo que caiste en esa tentación.","No mereces siquiera retarme."],
- "critical_move(player)" => "Solo con eso no me ganarás.",
- "low_effective_move(player)" => "¿En qué estabas pensando?",
- "super_effective_move" => "Aprendí mucho con mi Pokedex."
- }
- #-----------------------------------------------------------------------------
- # Esto sería para la batalla contra Brock.
- #-----------------------------------------------------------------------------
- LEADER_BROCK={
- "last_bgm" => "Battle! (Champion)",
- "last" => "Bien, pero si quieres la medalla roca tendrás que luchar un poco más.",
- "end_turn" => {0 => ["¿Qué haces?","Esto solo está empezando."]},
- "shiny" => "Este Onix dorado representa la perseverancia de los entrenadores.",
- "mega(player)" => "Me parece muy temprano para que uses algo así.",
- "item" => "Mi dura voluntad me mantine en pie..",
- "super_effective_move(player)" => "Jamás podrás romper su dura coraza Rocosa."
- }
- end
- #--------------------------------------------------------------------------------
- # A patir de aquí no toques nada a no ser que sepas bien lo que estás haciendo
- # Método que devuelve el nombre del entrenador rival
- #--------------------------------------------------------------------------------
- def getSpeeker(text,battle)
- if text.include?(":")
- return text.before(":")
- else
- return battle.opponent.name
- end
- return ""
- end
- class PokeBattle_Battle
- attr_accessor :tts
- #--------------------------------------------------------------------------------
- # Control de Variables
- #--------------------------------------------------------------------------------
- alias initialize_fpd initialize
- def initialize(*args)
- @tts=$tts ? $tts : {}
- @mbu=[]
- $tts=nil
- initialize_fpd(*args)
- end
- #--------------------------------------------------------------------------------
- # Método que muestra los textos
- #--------------------------------------------------------------------------------
- def fpShowText(key="",mbu="",dtext="")
- return if !@opponent #Revisa si es una batalla contra un entrenador
- return if !@tts[key] #Revisa si el diálogo está definido
- return if !dtext
- text = dtext.length>0 ? dtext : @tts[key] #Revisa si se utilizará el texto directo
- return if @mbu.include?(mbu) #Revisa si se mostró el diálogo antes
- if text.is_a?(Array) #Revisa si es definición simple o en cadena
- it=0
- for i in text
- not_show=false
- not_show=true if i.include?("//ht")
- if not_show #Revisa si debe mostrarse el entrenador
- @scene.set_dialog_color(i)
- pbDisplayPaused(fpBuffer(i)) #Muestra el diálogo
- else
- @scene.set_dialog_color(i)
- @scene.pbShowOpponent(0) #Muestra el entrenador
- pbSEPlay(TEXTSE) if TEXTSE && TEXTSE!="" # Reproduce el SE
- pbDisplayPaused(fpBuffer(i)) #Muestra el diálogo
- @scene.pbHideOpponent() if !text[it+1] || text[it+1].include?("//ht") #Oculta el entrenador
- end
- it+=1
- end
- else
- if text.include?("//ht")#Revisa si debe mostrarse el entrenador
- @scene.set_dialog_color(text)
- pbDisplayPaused(fpBuffer(text)) #Muestra el diálogo
- else
- @scene.set_dialog_color(text)
- @scene.pbShowOpponent(0)
- pbSEPlay(TEXTSE) if TEXTSE && TEXTSE!="" # Reproduce el SE
- pbDisplayPaused(fpBuffer(text)) #Muestra el diálogo
- @scene.pbHideOpponent()
- end
- end
- @scene.set_dialog_color("")
- PBDebug.log("Díalogo Mostrado: #{text}")
- @mbu.push(mbu) if mbu!="" #Añade el diálogo a la lista de los mostrados
- end
- #--------------------------------------------------------------------------------
- # Método que controla los buffers
- #--------------------------------------------------------------------------------
- def fpBuffer(str)
- str.gsub!("//PN",$Trainer.name);str.gsub!("//pn",$Trainer.name) #Nombre de PLAYER
- str.gsub!("//ON",@opponent.name);str.gsub!("//on",@opponent.name) #Nombre del rival
- str.gsub!("//HT","");str.gsub!("//ht","")
- str.gsub!("//T2","");str.gsub!("//t2","") #Tempralmente sin uso
- for i in 0...4
- str.gsub!("//B#{i}N",@battlers[i].name);str.gsub!("//b#{i}n",@battlers[i].name) #Nombre del Battler X
- end
- return str
- end
- #--------------------------------------------------------------------------------
- #Para el último Pokémon , los Pokémon específicos y los Pokémon Oscuros del jugador.
- #--------------------------------------------------------------------------------
- def pbSendOut(index,pokemon)
- pbSetSeen(pokemon)
- @peer.pbOnEnteringBattle(self,pokemon)
- if pbIsOpposing?(index)
- fpShowText("last") if pbPokemonCount(@party2)==1
- pbBGMPlay(@tts["last_bgm"],100,100) if @tts["last_bgm"] && pbPokemonCount(@party2)==1
- @scene.pbTrainerSendOut(index,pokemon)
- if (pbPokemonCount(@party2)>=2 || @tts["last"] == nil) && @tts["send"]
- fpShowText("send","opp#{pokemon.name}",@tts["send"][pokemon.species])
- end
- else
- @scene.pbSendOut(index,pokemon)
- if pbPokemonCount(@party1)==1
- if $Trainer.party.length>1
- fpShowText("last(player)")
- else
- fpShowText("one_poke")
- end
- end
- pbBGMPlay(@tts["last_bgm(player)"],100,100) if @tts["last_bgm(player)"] && pbPokemonCount(@party1)==1
- @battle.fpShowText("shadow(player)","shadow(player)") if pokemon.isShadow?
- end
- @scene.pbResetMoveIndex(index)
- end
- #--------------------------------------------------------------------------------
- #Para la Regresión Primigenia
- #--------------------------------------------------------------------------------
- def pbPrimalReversion(index)
- return if !@battlers[index] || !@battlers[index].pokemon
- return if !(@battlers[index].hasPrimal? rescue false)
- return if (@battlers[index].isPrimal? rescue true)
- fpShowText("primal") if pbIsOpposing?(index)
- pbCommonAnimation("Primal#{PBSpecies.getName(@battlers[index].species)}",@battlers[index],nil)
- @battlers[index].pokemon.makePrimal
- @battlers[index].form=@battlers[index].pokemon.form
- @battlers[index].pbUpdate(true)
- @scene.pbChangePokemon(@battlers[index],@battlers[index].pokemon)
- pbCommonAnimation("Primal#{PBSpecies.getName(@battlers[index].species)}2",@battlers[index],nil)
- pbDisplay(_INTL("¡{1} ha esperimentado una Regresión Primigenia y ha recobrado su apariencia primitiva!",@battlers[index].pbThis))
- fpShowText("primal(player)") if pbBelongsToPlayer?(index)
- PBDebug.log("[Regresión Primigenia] #{@battlers[index].pbThis} ha recobrado su apariencia primitiva")
- end
- #--------------------------------------------------------------------------------
- #Para la Megaevolución
- #--------------------------------------------------------------------------------
- def pbMegaEvolve(index)
- return if !@battlers[index] || !@battlers[index].pokemon
- return if !(@battlers[index].hasMega? rescue false)
- return if (@battlers[index].isMega? rescue true)
- fpShowText("mega") if pbIsOpposing?(index)
- if pbGetOwner(index)==nil
- case (@battlers[index].pokemon.megaMessage rescue 0)
- when 1 # Rayquaza
- pbDisplay(_INTL("¡El ruego vehemente alcanza a {1}!",@battlers[index].pbThis))
- else
- pbDisplay(_INTL("¡La {2} de {1} está reaccionando su poder interior!",
- @battlers[index].pbThis,PBItems.getName(@battlers[index].item)))
- end
- else
- ownername=pbGetOwner(index).fullname
- ownername=pbGetOwner(index).name if pbBelongsToPlayer?(index)
- case (@battlers[index].pokemon.megaMessage rescue 0)
- when 1 # Rayquaza
- pbDisplay(_INTL("¡El ruego vehemente de {1} alcanza a {2}!",ownername,@battlers[index].pbThis))
- else
- pbDisplay(_INTL("¡La {2} de {1} está reaccionando al {4} de {3}!",
- @battlers[index].pbThis,PBItems.getName(@battlers[index].item),
- ownername,pbGetMegaRingName(index)))
- end
- end
- pbCommonAnimation("MegaEvolution",@battlers[index],nil)
- @battlers[index].pokemon.makeMega
- @battlers[index].form=@battlers[index].pokemon.form
- @battlers[index].pbUpdate(true)
- @scene.pbChangePokemon(@battlers[index],@battlers[index].pokemon)
- pbCommonAnimation("MegaEvolution2",@battlers[index],nil)
- meganame=(@battlers[index].pokemon.megaName rescue nil)
- if !meganame || meganame==""
- meganame=_INTL("Mega {1}",PBSpecies.getName(@battlers[index].pokemon.species))
- end
- pbDisplay(_INTL("¡{1} ha Mega Evolucionado en {2}!",@battlers[index].pbThis,meganame))
- PBDebug.log("[Mega Evolución] #{@battlers[index].pbThis} ha Mega Evolucionado")
- fpShowText("mega(player)") if pbBelongsToPlayer?(index)
- side=(pbIsOpposing?(index)) ? 1 : 0
- owner=pbGetOwnerIndex(index)
- @megaEvolution[side][owner]=-2
- end
- #--------------------------------------------------------------------------------
- # Para la Ultraexplosión
- #--------------------------------------------------------------------------------
- def pbUltraBurst(index)
- return if !@battlers[index] || !@battlers[index].pokemon
- return if !(@battlers[index].hasUltra? rescue false)
- return if (@battlers[index].isUltra? rescue true)
- @necrozmaVar = [@battlers[index].pokemonIndex,@battlers[index].form] if pbBelongsToPlayer?(index)
- ownername=pbGetOwner(index).fullname
- ownername=pbGetOwner(index).name if pbBelongsToPlayer?(index)
- fpShowText("ultra") if pbIsOpposing?(index)
- pbDisplay(_INTL("¡{1} emite una luz cegadora!",@battlers[index].pbThis))
- pbCommonAnimation("UltraBurst",@battlers[index],nil)
- @battlers[index].pokemon.makeUltra
- @battlers[index].form=@battlers[index].pokemon.form
- @battlers[index].pbUpdate(true)
- @scene.pbChangePokemon(@battlers[index],@battlers[index].pokemon)
- pbCommonAnimation("UltraBurst2",@battlers[index],nil)
- ultraname=(@battlers[index].pokemon.ultraName rescue nil)
- if !ultraname || ultraname==""
- ultraname=_INTL("Ultra {1}",PBSpecies.getName(@battlers[index].pokemon.species))
- end
- pbDisplay(_INTL("¡{1} ha adoptado una nueva forma gracias a la Ultraexplosión!",@battlers[index].pbThis))
- fpShowText("ultra(player)") if pbIsOpposing?(index)
- PBDebug.log("[Ultra Burst] #{@battlers[index].pbThis} became #{ultraname}")
- side=(pbIsOpposing?(index)) ? 1 : 0
- owner=pbGetOwnerIndex(index)
- @ultraBurst[side][owner]=-2
- end
- #--------------------------------------------------------------------------------
- # Para los Movimientos Z
- #--------------------------------------------------------------------------------
- def pbUseZMove(index,move,crystal)
- return if !@battlers[index] || !@battlers[index].pokemon
- return if !(@battlers[index].hasZMove? rescue false)
- ownername=pbGetOwner(index).fullname
- ownername=pbGetOwner(index).name if pbBelongsToPlayer?(index)
- fpShowText("z_move") if pbIsOpposing?(index)
- pbDisplay(_INTL("¡{1} se envuelve en un halo de Poder Z!",@battlers[index].pbThis))
- pbCommonAnimation("ZPower",@battlers[index],nil)
- PokeBattle_ZMoves.new(self,@battlers[index],move,crystal)
- fpShowText("z_move(player)") if pbBelongsToPlayer?(index)
- side=(pbIsOpposing?(index)) ? 1 : 0
- owner=pbGetOwnerIndex(index)
- @zMove[side][owner]=-2
- end
- #--------------------------------------------------------------------------------
- # Para los objetos
- #--------------------------------------------------------------------------------
- alias pbEnemyUseItem_fp pbEnemyUseItem
- def pbEnemyUseItem(*args)
- fpShowText("item","item")
- pbEnemyUseItem(args)
- end
- #--------------------------------------------------------------------------------
- # Para los Preinicios de turno
- #--------------------------------------------------------------------------------
- alias pbCommandPhase_fp pbCommandPhase
- def pbCommandPhase
- fpShowText("pre_start_turn","pre_start#{@turncount}",@tts["pre_start_turn"][@turncount]) if @tts["pre_start_turn"]
- pbCommandPhase_fp
- end
- #--------------------------------------------------------------------------------
- # Para los inicios de turno
- #--------------------------------------------------------------------------------
- alias pbAttackPhase_fp pbAttackPhase
- def pbAttackPhase
- fpShowText("start_turn","start#{@turncount}",@tts["start_turn"][@turncount]) if @tts["start_turn"]
- pbAttackPhase_fp
- end
- #--------------------------------------------------------------------------------
- # Para los finales de turno y pocos PS en el último Pokémon
- #--------------------------------------------------------------------------------
- alias pbEndOfRoundPhase_fp pbEndOfRoundPhase
- def pbEndOfRoundPhase
- fpShowText("lowhp_last","lowhp_last") if pbPokemonCount(@party2)==1 && @battlers[1].totalhp/2 >= @battlers[1].hp && !@battlers[1].isFainted?
- fpShowText("lowhp_last(player)","lowhp_last(player)") if pbPokemonCount(@party1)==1 && @battlers[0].totalhp/2 >= @battlers[0].hp && !@battlers[0].isFainted?
- fpShowText("end_turn","end#{@turncount}",@tts["end_turn"][@turncount]) if @tts["end_turn"]
- pbEndOfRoundPhase_fp
- end
- #--------------------------------------------------------------------------------
- # Para los climas
- #--------------------------------------------------------------------------------
- def weather=(v)
- @weather=v
- fpShowText("weather","weather#{v}",@tts["weather"][v]) if @tts["weather"]
- end
- #--------------------------------------------------------------------------------
- # Para los cambios
- #--------------------------------------------------------------------------------
- def pbRecallAndReplace(index,newpoke,newpokename=-1,batonpass=false,moldbreaker=false)
- @battlers[index].pbResetForm
- if !@battlers[index].isFainted?
- fpShowText("recall","recall") if pbIsOpposing?(index)
- @scene.pbRecall(index)
- fpShowText("recall(player)","recall(player)") if pbBelongsToPlayer?(index)
- end
- pbMessagesOnReplace(index,newpoke,newpokename)
- pbReplace(index,newpoke,batonpass)
- return pbOnActiveOne(@battlers[index],false,moldbreaker)
- end
- end
- #--------------------------------------------------------------------------------
- # Para los golpes Super-Efectivos, Poco-Efectivos, Críticos, etc....
- #--------------------------------------------------------------------------------
- class PokeBattle_Move
- def pbEffectMessages(attacker,opponent,ignoretype=false,alltargets=nil)
- if opponent.damagestate.critical
- if alltargets && alltargets.length>1
- @battle.pbDisplay(_INTL("¡Es un golpe crítico en {1}!",opponent.pbThis(true)))
- else
- @battle.pbDisplay(_INTL("¡Es un golpe crítico!"))
- end
- @battle.fpShowText("critical_move","critical_move") if @battle.pbIsOpposing?(attacker.index)
- @battle.fpShowText("critical_move(player)","critical_move(player)") if @battle.pbBelongsToPlayer?(attacker.index)
- end
- if !pbIsMultiHit && attacker.effects[PBEffects::ParentalBond]==0
- if opponent.damagestate.typemod>8
- if alltargets && alltargets.length>1
- @battle.pbDisplay(_INTL("¡Es super efectivo en {1}!",opponent.pbThis(true)))
- else
- @battle.pbDisplay(_INTL("¡Es super efectivo!"))
- end
- @battle.fpShowText("super_effective_move","super_effective_move") if @battle.pbIsOpposing?(attacker.index)
- @battle.fpShowText("super_effective_move(player)","super_effective_move(player)") if @battle.pbBelongsToPlayer?(attacker.index)
- elsif opponent.damagestate.typemod>=1 && opponent.damagestate.typemod<8
- if alltargets && alltargets.length>1
- @battle.pbDisplay(_INTL("No es muy efectivo en {1}...",opponent.pbThis(true)))
- else
- @battle.pbDisplay(_INTL("No es muy efectivo..."))
- end
- @battle.fpShowText("low_effective_move","low_effective_move") if @battle.pbIsOpposing?(attacker.index)
- @battle.fpShowText("low_effective_move(player)","low_effective_move(player)") if @battle.pbBelongsToPlayer?(attacker.index)
- end
- end
- if pbIsSpecial?(0)
- @battle.fpShowText("special_move","special_move") if @battle.pbIsOpposing?(attacker.index)
- @battle.fpShowText("special_move(player)","special_move(player)") if @battle.pbBelongsToPlayer?(attacker.index)
- elsif pbIsPhysical?(0)
- @battle.fpShowText("physical_move","physical_move") if @battle.pbIsOpposing?(attacker.index)
- @battle.fpShowText("physical_move(player)","physical_move(player)") if @battle.pbBelongsToPlayer?(attacker.index)
- else
- @battle.fpShowText("status_move","status_move") if @battle.pbIsOpposing?(attacker.index)
- @battle.fpShowText("status_move(player)","status_move(player)") if @battle.pbBelongsToPlayer?(attacker.index)
- end
- if opponent.damagestate.endured
- @battle.pbDisplay(_INTL("¡{1} aguantó el golpe!",opponent.pbThis))
- elsif opponent.damagestate.sturdy
- @battle.pbDisplay(_INTL("¡{1} resistió con Robustez!",opponent.pbThis))
- elsif opponent.damagestate.focussash
- @battle.pbDisplay(_INTL("¡{1} resistió usando Banda Focus!",opponent.pbThis))
- opponent.pbConsumeItem
- elsif opponent.damagestate.focusband
- @battle.pbDisplay(_INTL("¡{1} resistió usando Cinta Focus!",opponent.pbThis))
- end
- end
- #--------------------------------------------------------------------------------
- # Para los golpes Ineficaces
- #--------------------------------------------------------------------------------
- def pbTypeModMessages(type,attacker,opponent)
- return 8 if type<0
- typemod=pbTypeModifier(type,attacker,opponent)
- if typemod==0
- @battle.pbDisplay(_INTL("No afecta a {1}...",opponent.pbThis(true)))
- else
- typemod = 0 if pbTypeImmunityByAbility(type,attacker,opponent)
- end
- if typemod==0
- @battle.fpShowText("non_effective_move","non_effective_move") if @battle.pbIsOpposing?(attacker.index)
- @battle.fpShowText("non_effective_move(player)","non_effective_move(player)") if @battle.pbBelongsToPlayer?(attacker.index)
- end
- return typemod
- end
- end
- #--------------------------------------------------------------------------------
- # Para los Pokémon Shiny y Oscuros
- #--------------------------------------------------------------------------------
- class PokeBattle_Scene
- alias pbCommonAnimation_fp pbCommonAnimation
- def pbCommonAnimation(*args)
- pbCommonAnimation_fp(*args)
- name=args[0] ; attacker=args[1]
- case name
- when "Shadow"
- @battle.fpShowText("shadow","shadow")
- when "Shiny"
- @battle.fpShowText("shiny","shiny") if @battle.pbIsOpposing?(attacker.index)
- @battle.fpShowText("shiny(player)","shiny(player)") if @battle.pbBelongsToPlayer?(attacker.index)
- end
- end
- #--------------------------------------------------------------------------------
- #Setea el color de las letras
- #--------------------------------------------------------------------------------
- def set_dialog_color(text)
- name=getSpeeker(text,@battle)
- msgwindow=@sprites["messagewindow"]
- if MBD_Data::CHARACTERS_COLORS.include?(name) && text.length>0
- msgwindow.baseColor=MBD_Data::CHARACTERS_COLORS[name][0]
- msgwindow.shadowColor=MBD_Data::CHARACTERS_COLORS[name][1]
- else
- msgwindow.baseColor=PokeBattle_SceneConstants::MESSAGEBASECOLOR
- msgwindow.shadowColor=PokeBattle_SceneConstants::MESSAGESHADOWCOLOR
- end
- end
- #--------------------------------------------------------------------------------
- #Corrección para que el entrenador no se muestre en ciertos casos
- #--------------------------------------------------------------------------------
- alias pbShowOpponent_fp pbShowOpponent
- def pbShowOpponent(*args)
- return if @sprites["trainer"] && @sprites["trainer"].x<500
- pbShowOpponent_fp(args)
- end
- end
- #--------------------------------------------------------------------------------
- #Para los Pokémon Oscuros capturados
- #--------------------------------------------------------------------------------
- module PokeBattle_BattleCommon
- alias pbStorePokemon_fp pbStorePokemon
- def pbStorePokemon(poke)
- fpShowText("caught","caught") if poke.isShadow?
- pbStorePokemon_fp(poke)
- end
- end
- #--------------------------------------------------------------------------------
- #Métodos Auxiliares.
- #--------------------------------------------------------------------------------
- class ::String
- def before(t)
- z=0
- r=""
- for i in self.scan(/./)
- break if i==t
- r.insert(z,i)
- z+=1
- end
- return r
- end
- end
- #--------------------------------------------------------------------------------
- # Método que setea los textos
- #--------------------------------------------------------------------------------
- def fpTTS_set(param)
- if param.is_a?(Symbol)
- if hasConst?(MBD_Data,param)
- $tts=getConst(MBD_Data,param)
- else
- raise "Constante de Diálogos no definida."
- end
- elsif param.is_a?(Hash)
- $tts=param
- elsif param.is_a(String)
- $tts={};$tts["last"]=param
- else
- raise "Parámetro incorrecto, se esperaba un Hash, Symbol o String."
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement