- 6
- Posts
- 8
- Years
- Seen May 4, 2017
Y have created a weather effect that damages everyone in the battlefield by 1/3hp every turn.
-Pokemon with Electric or Ground type are not affected.
-Pokemon with LightningRod or VoldAbsorb abilities are not affected.
-Pokemon with Flying,Water or Steel types are damaged by 1/2hp instead of 1/3hp.
But i wanted to make that the damage effect only applies each 2 turns. How can i do that?
These are my changes:
-Pokemon with Electric or Ground type are not affected.
-Pokemon with LightningRod or VoldAbsorb abilities are not affected.
-Pokemon with Flying,Water or Steel types are damaged by 1/2hp instead of 1/3hp.
But i wanted to make that the damage effect only applies each 2 turns. How can i do that?
These are my changes:
Spoiler:
Changes are in red
In the PBWeather
In the PokeBattle_Battle
And in the same script right before "when PBWeather::HEAVYRAIN"
I have already tested it and it seems to works as i described.
In the PBWeather
Code:
begin
module PBWeather
SUNNYDAY = 1
RAINDANCE = 2
SANDSTORM = 3
HAIL = 4
HARSHSUN = 5
HEAVYRAIN = 6
STRONGWINDS = 7
[COLOR="Red"]THUNDERSTO = 9[/COLOR]
In the PokeBattle_Battle
Code:
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]
And in the same script right before "when PBWeather::HEAVYRAIN"
Code:
[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]
I have already tested it and it seems to works as i described.