- 32
- Posts
- 7
- Years
- Far, far away
- Seen May 1, 2023
Hello, these days I've been trying to create a new weather ability called "Call of Winter", which would cause heavy hail in a battle.
The following effects are what I would like to achieve:
- user takes less damage from fire attacks by 0.5
- hail damage is 1/8 instead of 1/16
- heavy hail is permanent as long as user is still in battle; it can only be cancelled by "Primordial Sea", "Desolate Land", and "Delta Wind"
- boosts ice attacks by 1.5
- priority of priority moves that deal damages is reduced by 1
- reduces speed of all non ice Pokemon by 1 stage
This is what I have done so far:
In PBWeather, I have:
#11045744
begin
module PBWeather
SUNNYDAY = 1
RAINDANCE = 2
SANDSTORM = 3
HAIL = 4
HARSHSUN = 5
HEAVYRAIN = 6
STRONGWINDS = 7
HEAVYHAIL = 9
# Shadow Sky is weather 8
end
In PokeBattle_Battler, I have roughly starting at line 980:
if self.hasWorkingAbility(:DELTASTREAM) && @battle.weather!=PBWeather::STRONGWINDS
@battle.weather=PBWeather::STRONGWINDS
@battle.weatherduration=-1
@battle.pbCommonAnimation("StrongWinds",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} caused a mysterious air current that protects Flying-type Pokémon!",pbThis,PBAbilities.getName(self.ability)))
PBDebug.log("[Ability triggered] #{pbThis}'s Delta Stream made an air current blow")
end
if self.hasWorkingAbility(:CALLOFWINTER) && @battle.weather!=PBWeather::HEAVYHAIL
@battle.weather=PBWeather::HEAVYHAIL
@battle.weatherduration=-1
@battle.pbCommonAnimation("Blizzard",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} caused a heavy snowstorm!",pbThis,PBAbilities.getName(self.ability)))
PBDebug.log("[Ability triggered] #{pbThis}'s Call of Winter made the hailstorm unforgiving")
end
if @battle.weather!=PBWeather::HEAVYRAIN &&
@battle.weather!=PBWeather::HARSHSUN &&
@battle.weather!=PBWeather::STRONGWINDS &&
@battle.weather!=PBWeather::HEAVYHAIL
.
.
.
In PokeBattle_MoveEffects, I have tried to write what would happen every time something would start a new weather, for example:
################################################################################
# Starts sunny weather. (Sunny Day)
################################################################################
class PokeBattle_Move_0FF < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
case @battle.weather
when PBWeather::HEAVYRAIN
@battle.pbDisplay(_INTL("There is no relief from this heavy rain!"))
return -1
when PBWeather::HARSHSUN
@battle.pbDisplay(_INTL("The extremely harsh sunlight was not lessened at all!"))
return -1
when PBWeather::STRONGWINDS
@battle.pbDisplay(_INTL("The mysterious air current blows on regardless!"))
return -1
when PBWeather::HEAVYHAIL
@battle.pbDisplay(_INTL("The snowstorm still shows no mercy!"))
return -1
when PBWeather::SUNNYDAY
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.weather=PBWeather::SUNNYDAY
@battle.weatherduration=5
@battle.weatherduration=8 if attacker.hasWorkingItem(:HEATROCK)
@battle.pbCommonAnimation("Sunny",nil,nil)
@battle.pbDisplay(_INTL("The sunlight turned harsh!"))
return 0
end
end
In PokeBattle_Battle, I have tried to initialize a battle, starting at line 2504:
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."))
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."))
elsif @weather==PBWeather::HEAVYHAIL
pbCommonAnimation("Blizzard",nil,nil)
pbDisplay(_INTL("A snowstorm is raging."))
end
In PokeBattle_Battle again, I need to write something about the end of round in line 2874. And this is what I have come up with so far and which I would put under the second last "end" of shadowsky in line 3077:
when PBWeather::HEAVYHAIL
hasabil=false
for i in 0...4
if isConst?(@battlers.ability,PBAbilities,:CALLOFWINTER) && !@battlers.fainted?
hasabil=true; break
end
end
@weatherduration=0 if !hasabil
if @weatherduration==0
pbDisplay(_INTL("The heavy hail has dissipated."))
@weather=0
PBDebug.log("[End of effect] Call of Winter's hail weather ended")
else
pbCommonAnimation("Blizzard",nil,nil)
# pbDisplay(_INTL("The heavy snowstorm is unforgiving."))
if pbWeather==PBWeather::HEAVYHAIL
PBDebug.log("[Lingering effect triggered] Hail weather damage")
for i in priority
next if i.fainted?
if !i.pbHasType?(:ICE) &&
!i.hasWorkingAbility(:ICEBODY) &&
!i.hasWorkingAbility(:SNOWCLOAK) &&
!i.hasWorkingAbility(:MAGICGUARD) &&
!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/8).floor)
pbDisplay(_INTL("{1} is buffeted by the heavy hail!",i.pbThis))
if i.fainted?
return if !i.pbFaint
end
end
end
end
end
Now, my problem is that my last code gives me a syntax error. Apparently, the issues lies with the first line, namely: "when PBWeather::HEAVYHAIL". If I completely remove the fourth code, then I will get no issues. Though, when my Gyarados that has "Call of Winter" fights against a wild Pkm, the name of its ability would be mentioned, but I do not see any animation of this weather effect. And when I switch Gyarados out with another Pkm, the message that the hail has dissipated would appear four times.
Would someone mind helping me a bit out?
1) How would I have to change the fourth code?
2) How can I make the weather battle animation work?
3) Sandstorm boosts SpecialDefense of all Rock Pkm, and Rain makes water attacks stronger and fire attacks weaker. So, where might I find this? Because I would like to make heavy hail boost ice moves and weaken fire moves.
4) And if someone has some ideas how to approach
- priority of priority moves that deal damages is reduced by 1
- reduces speed of all non ice Pokemon by 1 stage
and would be willing to share it, that would be cool. :]
The following effects are what I would like to achieve:
Spoiler:
- user takes less damage from fire attacks by 0.5
- hail damage is 1/8 instead of 1/16
- heavy hail is permanent as long as user is still in battle; it can only be cancelled by "Primordial Sea", "Desolate Land", and "Delta Wind"
- boosts ice attacks by 1.5
- priority of priority moves that deal damages is reduced by 1
- reduces speed of all non ice Pokemon by 1 stage
This is what I have done so far:
In PBWeather, I have:
Spoiler:
#11045744
begin
module PBWeather
SUNNYDAY = 1
RAINDANCE = 2
SANDSTORM = 3
HAIL = 4
HARSHSUN = 5
HEAVYRAIN = 6
STRONGWINDS = 7
HEAVYHAIL = 9
# Shadow Sky is weather 8
end
In PokeBattle_Battler, I have roughly starting at line 980:
Spoiler:
if self.hasWorkingAbility(:DELTASTREAM) && @battle.weather!=PBWeather::STRONGWINDS
@battle.weather=PBWeather::STRONGWINDS
@battle.weatherduration=-1
@battle.pbCommonAnimation("StrongWinds",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} caused a mysterious air current that protects Flying-type Pokémon!",pbThis,PBAbilities.getName(self.ability)))
PBDebug.log("[Ability triggered] #{pbThis}'s Delta Stream made an air current blow")
end
if self.hasWorkingAbility(:CALLOFWINTER) && @battle.weather!=PBWeather::HEAVYHAIL
@battle.weather=PBWeather::HEAVYHAIL
@battle.weatherduration=-1
@battle.pbCommonAnimation("Blizzard",nil,nil)
@battle.pbDisplay(_INTL("{1}'s {2} caused a heavy snowstorm!",pbThis,PBAbilities.getName(self.ability)))
PBDebug.log("[Ability triggered] #{pbThis}'s Call of Winter made the hailstorm unforgiving")
end
if @battle.weather!=PBWeather::HEAVYRAIN &&
@battle.weather!=PBWeather::HARSHSUN &&
@battle.weather!=PBWeather::STRONGWINDS &&
@battle.weather!=PBWeather::HEAVYHAIL
.
.
.
In PokeBattle_MoveEffects, I have tried to write what would happen every time something would start a new weather, for example:
Spoiler:
################################################################################
# Starts sunny weather. (Sunny Day)
################################################################################
class PokeBattle_Move_0FF < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
case @battle.weather
when PBWeather::HEAVYRAIN
@battle.pbDisplay(_INTL("There is no relief from this heavy rain!"))
return -1
when PBWeather::HARSHSUN
@battle.pbDisplay(_INTL("The extremely harsh sunlight was not lessened at all!"))
return -1
when PBWeather::STRONGWINDS
@battle.pbDisplay(_INTL("The mysterious air current blows on regardless!"))
return -1
when PBWeather::HEAVYHAIL
@battle.pbDisplay(_INTL("The snowstorm still shows no mercy!"))
return -1
when PBWeather::SUNNYDAY
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.weather=PBWeather::SUNNYDAY
@battle.weatherduration=5
@battle.weatherduration=8 if attacker.hasWorkingItem(:HEATROCK)
@battle.pbCommonAnimation("Sunny",nil,nil)
@battle.pbDisplay(_INTL("The sunlight turned harsh!"))
return 0
end
end
In PokeBattle_Battle, I have tried to initialize a battle, starting at line 2504:
Spoiler:
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."))
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."))
elsif @weather==PBWeather::HEAVYHAIL
pbCommonAnimation("Blizzard",nil,nil)
pbDisplay(_INTL("A snowstorm is raging."))
end
In PokeBattle_Battle again, I need to write something about the end of round in line 2874. And this is what I have come up with so far and which I would put under the second last "end" of shadowsky in line 3077:
Spoiler:
when PBWeather::HEAVYHAIL
hasabil=false
for i in 0...4
if isConst?(@battlers.ability,PBAbilities,:CALLOFWINTER) && !@battlers.fainted?
hasabil=true; break
end
end
@weatherduration=0 if !hasabil
if @weatherduration==0
pbDisplay(_INTL("The heavy hail has dissipated."))
@weather=0
PBDebug.log("[End of effect] Call of Winter's hail weather ended")
else
pbCommonAnimation("Blizzard",nil,nil)
# pbDisplay(_INTL("The heavy snowstorm is unforgiving."))
if pbWeather==PBWeather::HEAVYHAIL
PBDebug.log("[Lingering effect triggered] Hail weather damage")
for i in priority
next if i.fainted?
if !i.pbHasType?(:ICE) &&
!i.hasWorkingAbility(:ICEBODY) &&
!i.hasWorkingAbility(:SNOWCLOAK) &&
!i.hasWorkingAbility(:MAGICGUARD) &&
!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/8).floor)
pbDisplay(_INTL("{1} is buffeted by the heavy hail!",i.pbThis))
if i.fainted?
return if !i.pbFaint
end
end
end
end
end
Now, my problem is that my last code gives me a syntax error. Apparently, the issues lies with the first line, namely: "when PBWeather::HEAVYHAIL". If I completely remove the fourth code, then I will get no issues. Though, when my Gyarados that has "Call of Winter" fights against a wild Pkm, the name of its ability would be mentioned, but I do not see any animation of this weather effect. And when I switch Gyarados out with another Pkm, the message that the hail has dissipated would appear four times.
Would someone mind helping me a bit out?
1) How would I have to change the fourth code?
2) How can I make the weather battle animation work?
3) Sandstorm boosts SpecialDefense of all Rock Pkm, and Rain makes water attacks stronger and fire attacks weaker. So, where might I find this? Because I would like to make heavy hail boost ice moves and weaken fire moves.
4) And if someone has some ideas how to approach
- priority of priority moves that deal damages is reduced by 1
- reduces speed of all non ice Pokemon by 1 stage
and would be willing to share it, that would be cool. :]