Registrarse

[Script] [Rpgmaker script]Clima "tormenta eléctrica"

fghtids

Usuario de platino
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.

Añadir a tu script las cosas escritas en rojo
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]
En el script PokeBattle_Battle buscad esto

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
y esto

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 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í

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
Y ya estaría.

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.
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:

Geo

El señor de las sombras
Genial esto se va directo a mi proyecto,Se agradece que se traigan cosas de este tipo te informare si encuentro algún fallo



Salu2 y Geo fuera
 

fghtids

Usuario de platino
También, si alguien quiere que los movimientos eléctricos se vean mejorados hay que poner en PokeBattle_Move lo siguiente:

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
Aunque personalmente prefiero que los pokémon eléctricos tenga velocidad x1.5

En PokeBattle_Battler buscar esto y añadir lo rojo de forma que quede como está aquí.
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

Los añado al post principal.
 
Última edición:

Axel

Héroe de WaH
Menudo pedazo de aporte, probablemente lo mire a ver si hay algún fallo, quiero asegurarme, y en el caso de que no halla, puede que lo meta. Muchas gracias por traernos algo tan bueno.​
 

Fran

Profesional de WaH
Wuw, aportazo, interesante la cosa, yo tambien voy a probarlo, espero funcione que parece interesante, desde ya "Gran Aporte"
 
M

Miembro eliminado 28262

Invitado
Un genial aporte!
No soy maker pero tanto la idea como el desarrollo es fantástica!!
seguro le servirá a varios makers de la comunidad (a los que quedan)

Es alentador ver que se sigue aportando de estas cosas por aquí
¡Muchas Gracias!
 

KevinXDE

Usuario mítico
Me gusta la idea, per no crees que quitar la mitad de la vida en un turno es muy exagerado? Quizas podrías hacer que quitara lo mismo que Tormenta de Arena/Granizo, pero que quite el doble a Pokémon Voladores, Agua y Acero. Creo que lo veo más realista.

Aun así, es un buen aporte ^^
 

fghtids

Usuario de platino
Me gusta la idea, per no crees que quitar la mitad de la vida en un turno es muy exagerado? Quizas podrías hacer que quitara lo mismo que Tormenta de Arena/Granizo, pero que quite el doble a Pokémon Voladores, Agua y Acero. Creo que lo veo más realista.

Aun así, es un buen aporte ^^

No me parece del todo exagerado, después de todo, le ha caído un rayo a un pájaro ¿no? lo mas realista sería instakill. De todas formas el daño que haga o deje de hacer lo podéis cambiar de la siguiente manera:

-En el 3er script explicado, la parte roja sería esto
Código:
 #----------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)
                [COLOR="Red"] i.pbReduceHP((i.totalhp/3).floor)[/COLOR]
                 pbDisplay(_INTL("{1} is hitted by a thunder!",i.pbThis))
               else  
              [COLOR="Cyan"] i.pbReduceHP((i.totalhp/2).floor)[/COLOR]
               pbDisplay(_INTL("{1} is hitted by a thunder!",i.pbThis))
              if i.isFainted?
                return if !i.pbFaint
              end
             end 
            end
          end
        end
    end

Pues bien, la parte en rojo actualmente indica el daño que recibiría un pokémon sin ser tipo Agua, Volador o Acero. Eso es una función que básicamente significa REDUCIR VIDA EN (VIDA TOTAL/3) es decir vida actual menos 1/3 de vida total. Sabiendo eso puedes cambiar el número 3 por un 16 (que es lo que sería en granizo/tormenta arena) o en un 1 que sería un instakill.
Luego, la parte en cián indica exactamente lo mismo que la roja pero esta reduce en 1/2 la vida de los "entes" especificados antes; en este caso los pokémon Agua, Volador y Acero


Aprovecho esto para decir que la parte de Boostear la velocidad de los pokes eléctricos está mal ya que en batalla técnicamente la boostea al final del turno, durante ese turno por lo que es inútil.

Aquí está la versión buena:

En PokeBattle_Battler buscar esto y añadir lo rojo de forma que quede como está aquí.
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
 
Última edición:

Sayer301!

UnityLord!
Miembro de honor
Buah no soy Maker tampoco, pero me flipa que se aporten ideas de este estilo tan guay, encima explicando todo bastante bien y hasta como cambiar el daño que es algo que tampoco me tenía muy convencido. Mis dieces señor, me quito el sombrero!
 

Sutto

Pokemon Hecatombe Xd
Gran aporte :)
Pero me pasa que no se que poner en la pbs de "moves", perdón si es muy nub la pregunta, gracias de antemano :).
 

fghtids

Usuario de platino
Gran aporte :)
Pero me pasa que no se que poner en la pbs de "moves", perdón si es muy nub la pregunta, gracias de antemano :).
El efecto está hecho para que ocurra cuando en un mapa del proyecto hay un evento en el que cambie el clima a "Storm" (o el mismo mapa tiene ese clima en el metadata)



Creo que no tiene pérdida.
 

Cheve

MoonLover~
Miembro de honor
Aportazo.

Desconozco si existe en algún juego oficial, si no es así, ole tu imaginación (y tus cojones, de paso).

¡Gracias! :D
 
Vaya aporte más genial. Queda muy bien para alguna especie de montaña muy alta, o eso creo, pero igual quedaría bien poder ser implementado como habilidad.

Simplemente, magnifico.
 

Diego Mertens

Dartrix Joven
¡Muchas gracias!
Esto está re piola y no puedo esperar a probarlo en mi proyecto.
Voy a investigar en los movimientos como "Danza Lluvia" y a ver cómo cambiar a este clima en combate usando movimientos o habilidades.
 

White

--------------------------------------------------
Primero de todo es un gran aporte y me parece muy original.

Pero yo tengo una propuesta, podrias hacer que hubiese una probabilidad de que caiga el rayo y quite 1/3 o 1/2, pero no cada turno.

Saludos!!
 

ElTioSans

Usuario de oro
Hola,tengo un problema, por lo que entendí al un mapa tener el clima como Storm debería activarse en ese mapa el efecto de tormenta eléctrica... Pues no pasa eso en mi juego, agradecería que me ayudaran.
 
Arriba