Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-----------------------------------------------------------------------------
- # Script creado por FiaPlay para Pokémon Essentials 16.3. Créditos si se usa
- # Discord de FP Systems: https://discord.gg/ds8DWB5NSW
- # Versión para Essentials BW: https://pastebin.com/ky8nkSeK
- # Si vas reportar algún bug o preguntar algo recomiendo hacerlo en el hilo del server de PokeLiberty o en FP Systems.
- #Changelog:
- #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 se acaba un turno.
- # Añadida la posibilidad de poner un texto cuando comienza 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.
- #1.4: Eliminados los buffers de texto (Para ser sincero son innecesarios e incompatibles con los cambios de esta versión)
- # Ahora si un diálogo no está definido se omite. (En anteriores versiones se mostraba un texto en blanco.)
- # Ahora los textos se activan desde el mismo método que se setean. Se desactivan automáticamente al terminar la batalla.
- # Compatibilidad con el script de Movimientos Z.
- #1.3: Añadida la posiblidad de usar buffers de texto.
- # Añadido un método para revisar si hay una versión actualizada del script.
- #1.2: Añadida la posiblidad de usar varias músicas de último Pokémon.
- # Añadida la posibilidad de poner un texto cuando el rival usa un objeto.
- # Añadida la posibilidad de poner un texto cuando el rival saca un pokémon oscuro.
- # Añadida la posibilidad de poner un texto cuando capturas pokémon oscuro del rival.
- # Correción de errores (Incluido uno que viene por defecto en essentials).
- #1.1: Añadido un par de métodos para setear textos más facilmente.
- #1.0: Versión inicial.
- #-----------------------------------------------------------------------------
- # Demostración https://youtu.be/lHCQdq62Xh8 (2.0)
- #-----------------------------------------------------------------------------
- # Modo de uso:
- #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(:TEST2_3)
- 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)
- =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.
- #
- #*¿Es compatible con EBS?
- # No deberías recibir mensajes de error, pero algunos textos no se mostrarán.
- #
- #*¿Funciona con combates dobles?
- # No deberías recibir mensajes de error, pero no prometo nada.
- #
- #*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)
- #
- #*¿Piensas portearlo a Essentials 21.1?
- # Puedo , pero solo es cuestión de tiempo para que Essentials Deluxe se actualice.
- #-----------------------------------------------------------------------------
- # Estas son las opciones cámbialas a como necesites.
- #-----------------------------------------------------------------------------
- TEXTSE = "" #SE que se reproducirá al aparecer el sprite del entrenador
- module MBD_Data
- #-----------------------------------------------------------------------------
- # En la siguiente constante están configurados todos los diálogos posibles.
- #-----------------------------------------------------------------------------
- TEST2_3={
- "last_bgm" => "Boss02",
- "last" => ["¡Ho, no. Es mi último Pokémon!","Pero todavía puedo luchar."],
- "last(player)" => "Te veo en un buen apuro.",
- "end_turn" => [0,["¿Qué haces?","Esto solo está empezando."]],
- "start_turn" => [0,"Veamos de qué estás hecho... \PN."],
- "one_poke" => ["Jajaja","¿En qué estás pensando \PN?"],
- "lowhp_last" => ["!No puede ser¡","¡ESTOY AL LÍMITE!"],
- "shiny" => ["¿Cómo ves mi brillo?","¿Es mucho para tí?"],
- "shiny(player)" => "¿De donde sacaste eso?",
- "mega" => "¡Qué importa solo debo usar la poderosa energía ancestral!",
- "mega(player)" => "No podía esperar menos de tí.",
- "primal" => "El poder primigenio es la clave de mi victoria.",
- "primal(player)" => "Rubíes y Zafiros... Veo que también dominas ese poder.",
- "ultra" => "¡Necrozma Muestra tu verdadera forma!",
- "ultra(player)" => "Debo admitirlo. Esa ráfaga de luz me ha dejado marvillado.",
- "send" => [:KYOGRE,"Tan solo admira mi Leviatán.",:GROUDON,"Un poderoso Reptil Ígneo."],
- "item" => "No puedo dejar que esto termine tan rápido.",
- "shadow" => "No es inhumano , solo es un viejo truco.",
- "shadow(player)" => "Me sorprende verte usando un poder como ese.",
- "caught" => "¡Cómo te atreves!",
- "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" => "Cometiste un greve error al meterte conmigo.",
- "super_effective_move(player)" => "Nada mal niño.",
- "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!",
- "dynamax" => "Un gran tamaño conlleva un gran poder.",
- "dynamax(player)" => "Eres toda una caja de sorpresas."
- }
- #-----------------------------------------------------------------------------
- # Esto sería para la batalla contra el campeón por defecto.
- #-----------------------------------------------------------------------------
- CHAMPION_BLUE={
- "last" => "No puedo dejar que me derrotes ahora.",
- "last(player)" => "Luego de tantos combtes por fin podré derotaré.",
- "end_turn" => [0,["Este combate solo está empezando.", "Todavía no te confies."]],
- "lowhp_last" => "Mientras tenga uno mi poder es infinito.",
- "send" => [:BLASTOISE,"Espero que sepas nadar.",: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 nisiquiera 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" => "elite",
- "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" => "No puedo rendirme tan rápido.",
- "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.
- #--------------------------------------------------------------------------------
- class PokeBattle_Battle
- #--------------------------------------------------------------------------------
- # 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=nil)
- return if $fpr && $fpr["no_dialogue"]
- return if !@opponent # Revisa si es una batalla contra un entrenador
- return if !@tts[key] #Revisa si el diálogo está definido
- text = dtext ? dtext : @tts[key]
- return if @mbu.include?(mbu) #Revisa si se mostró el diálogo antes
- if defined?(EBUISTYLE);@scene.pbShowOpponent(0,true);else;@scene.pbShowOpponent(0);end #Muestra el entrenador
- pbSEPlay(TEXTSE) if TEXTSE && TEXTSE!="" # Reproduce el SE
- if text.is_a?(Array)
- for i in text; pbDisplayPaused(fpBuffer(i)); end #Muestra el diálogo
- else
- pbDisplayPaused(fpBuffer(text)) #Muestra el diálogo
- end
- if defined?(EBUISTYLE);@scene.pbHideOpponent(true);else;@scene.pbHideOpponent();end #Oculta el entrenador
- 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)
- 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)
- @scene.pbTrainerSendOut(index,pokemon)
- if (pbPokemonCount(@party2)>=2 || @tts["last"] == nil) && @tts["send"]
- for i in 0...@tts["send"].length/2
- name=pokemon.name
- if isConst?(pokemon.species,PBSpecies,@tts["send"][i*2])
- fpShowText("send","opp#{name}",@tts["send"][i*2+1])
- end
- end
- end
- pbBGMPlay(@tts["last_bgm"],100,100) if @tts["last_bgm"] && pbPokemonCount(@party2)==1
- fpShowText("last") if pbPokemonCount(@party2)==1
- else
- @scene.pbSendOut(index,pokemon)
- if pbPokemonCount(@party1)==1
- if $Trainer.party.length>1
- fpShowText("last(player)")
- else
- fpShowText("one_poke")
- end
- end
- @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)
- if isConst?(@battlers[index].pokemon.species,PBSpecies,:KYOGRE)
- pbCommonAnimation("PrimalKyogre",@battlers[index],nil)
- elsif isConst?(@battlers[index].pokemon.species,PBSpecies,:GROUDON)
- pbCommonAnimation("PrimalGroudon",@battlers[index],nil)
- else
- pbCommonAnimation("MegaEvolution",@battlers[index],nil)
- end
- @battlers[index].pokemon.makePrimal
- @battlers[index].form=@battlers[index].pokemon.form
- @battlers[index].pbUpdate(true)
- @scene.pbChangePokemon(@battlers[index],@battlers[index].pokemon)
- if isConst?(@battlers[index].pokemon.species,PBSpecies,:KYOGRE)
- pbCommonAnimation("PrimalKyogre2",@battlers[index],nil)
- elsif isConst?(@battlers[index].pokemon.species,PBSpecies,:GROUDON)
- pbCommonAnimation("PrimalGroudon2",@battlers[index],nil)
- else
- pbCommonAnimation("MegaEvolution2",@battlers[index],nil)
- end
- 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
- #Código relacionado a la compatibilidad con la Megaevolución salvaje
- #--------------------------------------------------------------------------------
- def pbMegaEvolve(index)
- return if !@battlers[index] || !@battlers[index].pokemon
- return if !(@battlers[index].hasMega? rescue false)
- return if (@battlers[index].isMega? rescue true)
- ownername=pbGetOwner(index).fullname if @opponent
- ownername=pbGetOwner(index).name if pbBelongsToPlayer?(index)
- if @opponent || !pbIsOpposing(index)
- fpShowText("mega") if pbIsOpposing?(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
- else # Salvaje
- pbDisplay(_INTL("¡{1} reacciona con una energía desconocida!",@battlers[index].pbThis))
- 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))
- fpShowText("mega(player)") if pbBelongsToPlayer?(index)
- PBDebug.log("[Mega Evolución] #{@battlers[index].pbThis} ha Mega Evolucionado")
- 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)
- 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 pbBelongsToPlayer?(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)
- fpShowText("z_move") if pbIsOpposing?(index)
- pbDisplay(_INTL("¡{1} se está cubriendo 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 la Teracristalización
- #--------------------------------------------------------------------------------
- def fpTeracristal(index)
- teratype=@battlers[index].pokemon.teratype
- return if !@battlers[index] || !@battlers[index].pokemon
- pbDisplay(_INTL("¡{1} se está cubriendo de cristal!",@battlers[index].pbThis))
- pbCommonAnimation("MegaEvolution",@battlers[index],nil)
- fpShowText("tera") if pbIsOpposing?(index) && defined?(MBD_Data)
- @battlers[index].effects[PBEffects::Type3]=-1
- @battlers[index].pokemon.makeTera
- @battlers[index].type1=teratype
- @battlers[index].type2=teratype
- fpShowText("tera(player)") if pbBelongsToPlayer?(index) && defined?(MBD_Data)
- pbCommonAnimation("MegaEvolution2",@battlers[index],nil)
- typename=PBTypes.getName(teratype)
- pbDisplay(_INTL("¡{1} ha cambiado al tipo {2}!",@battlers[index].pbThis,typename))
- PBDebug.log("[Teracristalización] #{@battlers[index].pbThis} ha Teracristalizado (#{typename})")
- side=(pbIsOpposing?(index)) ? 1 : 0
- owner=pbGetOwnerIndex(index)
- @teraCristal[side][owner]=-2
- end
- #--------------------------------------------------------------------------------
- #Para el Dynamax
- #--------------------------------------------------------------------------------
- def pbDynamax(index)
- return if !@battlers[index] || !@battlers[index].pokemon
- return if !(@battlers[index].hasDynamax? rescue false)
- return if (@battlers[index].isDynamax? rescue true)
- @battlers[index].effects[PBEffects::Dynamax]=3
- @battlers[index].effects[PBEffects::DBoost]=true
- fpShowText("dynamax") if pbIsOpposing?(index)
- @scene.pbRecall(index)
- # Checking Gigantamax
- if @battlers[index].hasGigantamax?
- @battlers[index].pokemon.makeGigantamax
- @battlers[index].effects[PBEffects::Gigantamax]=3
- @battlers[index].form=@battlers[index].pokemon.form
- @scene.pbChangePokemon(@battlers[index],@battlers[index].pokemon)
- end
- if pbBelongsToPlayer?(index) || @battlers[index].pbPartner && !pbIsOpposing?(index)
- @scene.pbSendOut(index,@battlers[index].pokemon)
- elsif pbIsOpposing?(index)
- @scene.pbTrainerSendOut(index,@battlers[index].pokemon)
- end
- @battlers[index].pokemon.makeDynamax
- @battlers[index].pbUpdate(true)
- maxname=(@battlers[index].pokemon.maxName rescue nil)
- if !maxname || maxname ==""
- maxname = _INTL("{1}",PBSpecies.getName(@battlers[index].pokemon.species))
- end
- pbDisplay(_INTL("{1}'s ball surges with Dynamax energy!",@battlers[index].pbThis,text))
- fpShowText("dynamax(player)") if pbBelongsToPlayer?(index)
- PBDebug.log("[Dynamax] #{@battlers[index].pbThis} became Max #{maxname}")
- side = (pbIsOpposing?(index)) ? 1 : 0
- owner = pbGetOwnerIndex(index)
- @dynaMax[side][owner]=-2
- pbPlayCry(@battlers[index])
- end
- #--------------------------------------------------------------------------------
- # Para los objetos
- #--------------------------------------------------------------------------------
- def pbEnemyUseItem(item,battler)
- return 0 if !@internalbattle
- items=pbGetOwnerItems(battler.index)
- return if !items
- opponent=pbGetOwner(battler.index)
- for i in 0...items.length
- if items[i]==item
- items.delete_at(i)
- break
- end
- end
- fpShowText("item","item")
- itemname=PBItems.getName(item)
- pbDisplayBrief(_INTL("¡{1} ha usado\r\n{2}!",opponent.fullname,itemname))
- PBDebug.log("[Objeto usado] El rival ha usado #{itemname} en #{battler.pbThis(true)}")
- if isConst?(item,PBItems,:POTION)
- battler.pbRecoverHP(20,true)
- pbDisplay(_INTL("Los PS de {1} fueron restaurados.",battler.pbThis))
- elsif isConst?(item,PBItems,:SUPERPOTION)
- battler.pbRecoverHP(50,true)
- pbDisplay(_INTL("Los PS de {1} fueron restaurados.",battler.pbThis))
- elsif isConst?(item,PBItems,:HYPERPOTION)
- battler.pbRecoverHP(200,true)
- pbDisplay(_INTL("Los PS de {1} fueron restaurados.",battler.pbThis))
- elsif isConst?(item,PBItems,:MAXPOTION)
- battler.pbRecoverHP(battler.totalhp-battler.hp,true)
- pbDisplay(_INTL("Los PS de {1} fueron restaurados.",battler.pbThis))
- elsif isConst?(item,PBItems,:FULLRESTORE)
- fullhp=(battler.hp==battler.totalhp)
- battler.pbRecoverHP(battler.totalhp-battler.hp,true)
- battler.status=0; battler.statusCount=0
- battler.effects[PBEffects::Confusion]=0
- if fullhp
- pbDisplay(_INTL("¡{1} se puso saludable!",battler.pbThis))
- else
- pbDisplay(_INTL("Los PS de {1} fueron restaurados.",battler.pbThis))
- end
- elsif isConst?(item,PBItems,:FULLHEAL)
- battler.status=0; battler.statusCount=0
- battler.effects[PBEffects::Confusion]=0
- pbDisplay(_INTL("¡{1} se puso saludable!",battler.pbThis))
- elsif isConst?(item,PBItems,:XATTACK)
- if battler.pbCanIncreaseStatStage?(PBStats::ATTACK,battler)
- battler.pbIncreaseStat(PBStats::ATTACK,1,battler,true)
- end
- elsif isConst?(item,PBItems,:XDEFEND)
- if battler.pbCanIncreaseStatStage?(PBStats::DEFENSE,battler)
- battler.pbIncreaseStat(PBStats::DEFENSE,1,battler,true)
- end
- elsif isConst?(item,PBItems,:XSPEED)
- if battler.pbCanIncreaseStatStage?(PBStats::SPEED,battler)
- battler.pbIncreaseStat(PBStats::SPEED,1,battler,true)
- end
- elsif isConst?(item,PBItems,:XSPECIAL)
- if battler.pbCanIncreaseStatStage?(PBStats::SPATK,battler)
- battler.pbIncreaseStat(PBStats::SPATK,1,battler,true)
- end
- elsif isConst?(item,PBItems,:XSPDEF)
- if battler.pbCanIncreaseStatStage?(PBStats::SPDEF,battler)
- battler.pbIncreaseStat(PBStats::SPDEF,1,battler,true)
- end
- elsif isConst?(item,PBItems,:XACCURACY)
- if battler.pbCanIncreaseStatStage?(PBStats::ACCURACY,battler)
- battler.pbIncreaseStat(PBStats::ACCURACY,1,battler,true)
- end
- end
- 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?
- if @tts["end_turn"]
- for i in 0...@tts["end_turn"].length/2
- if @turncount==@tts["end_turn"][i*2]
- fpShowText("end_turn","end#{@turncount}",@tts["end_turn"][i*2+1])
- end
- end
- end
- pbEndOfRoundPhase_fp
- end
- #--------------------------------------------------------------------------------
- # Para los inicios de turno
- #--------------------------------------------------------------------------------
- alias pbAttackPhase_fp pbAttackPhase
- def pbAttackPhase
- if @tts["start_turn"]
- for i in 0...@tts["start_turn"].length/2
- if @turncount==@tts["start_turn"][i*2]
- fpShowText("start_turn","start#{@turncount}",@tts["start_turn"][i*2+1])
- end
- end
- end
- pbAttackPhase_fp
- end
- end
- #--------------------------------------------------------------------------------
- # Para los golpes Super-Efectivos, Poco-Efectivos y Críticos
- #--------------------------------------------------------------------------------
- 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 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
- 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
- end
- #--------------------------------------------------------------------------------
- #Para los Pokémon Oscuros capturados
- #--------------------------------------------------------------------------------
- module PokeBattle_BattleCommon
- alias pbStorePokemon_fp pbStorePokemon
- def pbStorePokemon(poke)
- fpShowText("caught","shadowcaught") if poke.isShadow?
- pbStorePokemon_fp(poke)
- 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
- else
- raise "Parámetro incorrecto, se esperaba un Hash o Symbol."
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement