Este fue el primer script que hice en rpg maker. Consiste en un clima nuevo basado en una "tormenta eléctrica" cuyos efectos son:
-Cada final de turno todos los pokémon en el campo de batalla son dañados 1/3hp.
-Los pokémon tipo eléctrico o tierra son inmunes a este efecto. También lo son los pokémon con Pararrayos o Absor.Electricidad.
-Los pokémon de tipo Volador, Agua o Acero reciben un daño de 1/2 de su vida en lugar de 1/3.
-No te puedes proteger de este efecto con ningún objeto (de momento) ni con la habilidad Funda.
En PokeBattle_Battle
Cualquier bug que podáis encontrar no dudéis en reportarmelo. Saludos.
-Cada final de turno todos los pokémon en el campo de batalla son dañados 1/3hp.
-Los pokémon tipo eléctrico o tierra son inmunes a este efecto. También lo son los pokémon con Pararrayos o Absor.Electricidad.
-Los pokémon de tipo Volador, Agua o Acero reciben un daño de 1/2 de su vida en lugar de 1/3.
-No te puedes proteger de este efecto con ningún objeto (de momento) ni con la habilidad Funda.
Añadir a tu script las cosas escritas en rojo
de forma que queden como está en este post.
En el script PBWeather
En el script PokeBattle_Battle buscad esto
y esto
y finalmente para implementar que cuando el clima de "Storm" en el overworld cause este tipo de clima hay que buscar en PField_Field
y cambiar el script para que la sección indicada quede así
Y ya estaría.
de forma que queden como está en este post.
En el script PBWeather
Código:
#11045744
begin
module PBWeather
SUNNYDAY = 1
RAINDANCE = 2
SANDSTORM = 3
HAIL = 4
HARSHSUN = 5
HEAVYRAIN = 6
STRONGWINDS = 7
[COLOR="Red"]THUNDERSTO = 9[/COLOR]
Código:
if @weather==PBWeather::SUNNYDAY
pbCommonAnimation("Sunny",nil,nil)
pbDisplay(_INTL("The sunlight is strong."))
elsif @weather==PBWeather::RAINDANCE
pbCommonAnimation("Rain",nil,nil)
pbDisplay(_INTL("It is raining."))
elsif @weather==PBWeather::SANDSTORM
pbCommonAnimation("Sandstorm",nil,nil)
pbDisplay(_INTL("A sandstorm is raging."))
elsif @weather==PBWeather::HAIL
pbCommonAnimation("Hail",nil,nil)
pbDisplay(_INTL("Hail is falling."))
[COLOR="red"] elsif @weather==PBWeather::THUNDERSTO
pbCommonAnimation("Rain",nil,nil)
pbDisplay(_INTL("You are under a thunderstorm"))[/COLOR]
elsif @weather==PBWeather::HEAVYRAIN
pbCommonAnimation("HeavyRain",nil,nil)
pbDisplay(_INTL("It is raining heavily."))
elsif @weather==PBWeather::HARSHSUN
pbCommonAnimation("HarshSun",nil,nil)
pbDisplay(_INTL("The sunlight is extremely harsh."))
elsif @weather==PBWeather::STRONGWINDS
pbCommonAnimation("StrongWinds",nil,nil)
pbDisplay(_INTL("The wind is strong."))
end
Código:
!i.hasWorkingAbility(:OVERCOAT) &&
!i.hasWorkingItem(:SAFETYGOGGLES) &&
![0xCA,0xCB].include?(PBMoveData.new(i.effects[PBEffects::TwoTurnAttack]).function) # Dig, Dive
@scene.pbDamageAnimation(i,0)
i.pbReduceHP((i.totalhp/16).floor)
pbDisplay(_INTL("{1} is buffeted by the hail!",i.pbThis))
if i.isFainted?
return if !i.pbFaint
end
end
end
end
end
[COLOR="red"] #----------THUNDERSTORM------------
when PBWeather::THUNDERSTO
@weatherduration=@weatherduration-1 if @weatherduration>0
if @weatherduration==0
pbDisplay(_INTL("The thunder storm stopped."))
@weather=0
PBDebug.log("[End of effect] Thunder weather ended")
else
pbCommonAnimation("Rain",nil,nil)
# pbDisplay(_INTL("The thunderstorm continues falling."))
if pbWeather==PBWeather::THUNDERSTO
PBDebug.log("[Lingering effect triggered] Thunderstorm damage")
for i in priority
next if i.isFainted?
if !i.pbHasType?(:ELECTRIC) &&
!i.pbHasType?(:GROUND) &&
!i.hasWorkingAbility(:LIGHTNINGROD) &&
!i.hasWorkingAbility(:VOLTABSORB) &&
![0xCA,0xCB].include?(PBMoveData.new(i.effects[PBEffects::TwoTurnAttack]).function) # Dig, Dive
@scene.pbDamageAnimation(i,0)
if !i.pbHasType?(:WATER) &&
!i.pbHasType?(:FLYING) &&
!i.pbHasType?(:STEEL)
i.pbReduceHP((i.totalhp/3).floor)
pbDisplay(_INTL("{1} is hitted by a thunder!",i.pbThis))
else
i.pbReduceHP((i.totalhp/2).floor)
pbDisplay(_INTL("{1} is hitted by a thunder!",i.pbThis))
if i.isFainted?
return if !i.pbFaint
end
end
end
end
end
end[/COLOR]
when PBWeather::HEAVYRAIN
hasabil=false
for i in 0...4
if isConst?(@battlers[i].ability,PBAbilities,:PRIMORDIALSEA) && !@battlers[i].isFainted?
hasabil=true; break
end
y cambiar el script para que la sección indicada quede así
Código:
def pbPrepareBattle(battle)
case $game_screen.weather_type
when PBFieldWeather::Rain, PBFieldWeather::HeavyRain
battle.weather=PBWeather::RAINDANCE
battle.weatherduration=-1
[COLOR="Red"] when PBFieldWeather::Storm
battle.weather=PBWeather::THUNDERSTO
battle.weatherduration=-1[/COLOR]
when PBFieldWeather::Snow, PBFieldWeather::Blizzard
battle.weather=PBWeather::HAIL
battle.weatherduration=-1
when PBFieldWeather::Sandstorm
battle.weather=PBWeather::SANDSTORM
battle.weatherduration=-1
when PBFieldWeather::Sun
battle.weather=PBWeather::SUNNYDAY
battle.weatherduration=-1
end
battle.shiftStyle=($PokemonSystem.battlestyle==0)
battle.battlescene=($PokemonSystem.battlescene==0)
battle.environment=pbGetEnvironment
end
En PokeBattle_Battle
Código:
case @battle.pbWeather
when PBWeather::SUNNYDAY, PBWeather::HARSHSUN
if isConst?(type,PBTypes,:FIRE)
damage=(damage*1.5).round
elsif isConst?(type,PBTypes,:WATER)
damage=(damage*0.5).round
end
[COLOR="Red"] when PBWeather::THUNDERSTO
if isConst?(type,PBTypes,:ELECTRIC)
damage=(damage*1.5).round
end[/COLOR]
when PBWeather::RAINDANCE, PBWeather::HEAVYRAIN
if isConst?(type,PBTypes,:FIRE)
damage=(damage*0.5).round
elsif isConst?(type,PBTypes,:WATER)
damage=(damage*1.5).round
end
end
En PokeBattle_Battler buscar esto y añadir lo rojo de forma que quede como está aquí.
Ya está testeado y funciona correctamente.
Ya está testeado y funciona correctamente.
Código:
def pbSpeed()
stagemul=[10,10,10,10,10,10,10,15,20,25,30,35,40]
stagediv=[40,35,30,25,20,15,10,10,10,10,10,10,10]
speed=@speed
stage=@stages[PBStats::SPEED]+6
speed=(speed*stagemul[stage]/stagediv[stage]).floor
speedmult=0x1000
case @battle.pbWeather
when PBWeather::RAINDANCE, PBWeather::HEAVYRAIN
speedmult=speedmult*2 if self.hasWorkingAbility(:SWIFTSWIM)
when PBWeather::SUNNYDAY, PBWeather::HARSHSUN
speedmult=speedmult*2 if self.hasWorkingAbility(:CHLOROPHYLL)
when PBWeather::SANDSTORM
speedmult=speedmult*2 if self.hasWorkingAbility(:SANDRUSH)
[COLOR="red"] when PBWeather::THUNDERSTO
speedmult=speedmult*2 if self.pbHasType?(:ELECTRIC)[/COLOR]
end
if self.hasWorkingAbility(:QUICKFEET) && self.status>0
speedmult=(speedmult*1.5).round
end
if self.hasWorkingAbility(:UNBURDEN) && @effects[PBEffects::Unburden] &&
self.item==0
speedmult=speedmult*2
end
if self.hasWorkingAbility(:SLOWSTART) && self.turncount<=5
speedmult=(speedmult/2).round
end
Cualquier bug que podáis encontrar no dudéis en reportarmelo. Saludos.
Última edición: