- 37
- Posts
- 8
- Years
- Seen Jan 21, 2021
I'm trying to implement these moves; the first should raise the user's side Attack while lowering the opponents side. Currently it works for everything except the partner's Atk.
The next one sacrifices 1/3 of the user's max Hp to heal the target by that same amount (like Wish does). The trouble is Wish has it's own weird mechanics where it affects the same battle.position rather than a target, as seen here:
This is what I have so far (still need the proportional aspect):
The third move shouldn't be too hard; not sure what the issue is (t still works on sleeping foes). I just copied the section from Dream Eater for the second part. Does it have anything to do with also being a TargetStatDownMove?
Finally, and I'm pretty sure this one is a mess, I'm trying to script a move that affects all battlers and increases the Hp of Light types by 1/3 while decreasing the Hp of Dark and Ghost types by 1/3:
I get this error when using it (and the Pokemon keeps trying to use the move after each identical error rather than the game shutting down)
Exception: ArgumentError
Message: wrong number of arguments(3 for 1)
Backtrace:
Move_Effects_100-17F:2738:in `pbHasType?'
Move_Effects_100-17F:2738:in `pbMoveFailed?'
Move_Effects_100-17F:2737:in `eachBattler'
PokeBattle_Battle:421:in `each'
PokeBattle_Battle:421:in `eachBattler'
Move_Effects_100-17F:2737:in `pbMoveFailed?'
Battler_UseMove:305:in `pbUseMove'
Battler_UseMove:59:in `pbProcessTurn'
Battler_UseMove:58:in `logonerr'
Battler_UseMove:58:in `pbProcessTurn'
Any assistance is much appreciated.
Code:
#===============================================================================
# Victory Cry - raises Atk, lower foe's Atk
#===============================================================================
class PokeBattle_Move_304 < PokeBattle_TargetStatDownMove
def initialize(battle,move)
super
@statDown = [PBStats::ATTACK,1]
end
def pbEffectGeneral(user)
if user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
user.pbRaiseStatStage(PBStats::ATTACK,1,user)
end
showAnim = true
end
end
The next one sacrifices 1/3 of the user's max Hp to heal the target by that same amount (like Wish does). The trouble is Wish has it's own weird mechanics where it affects the same battle.position rather than a target, as seen here:
Spoiler:
Code:
class PokeBattle_Move_0D7 < PokeBattle_Move
def healingMove?; return true; end
def pbMoveFailed?(user,targets)
if @battle.positions[user.index].effects[PBEffects::Wish]>0
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbEffectGeneral(user)
@battle.positions[user.index].effects[PBEffects::Wish] = 2
@battle.positions[user.index].effects[PBEffects::WishAmount] = (user.totalhp/2.0).round
@battle.positions[user.index].effects[PBEffects::WishMaker] = user.pokemonIndex
end
end
This is what I have so far (still need the proportional aspect):
Code:
#===============================================================================
# Self Sacrifice - Heals target by 2/3 of its max HP, giving 1/3 of its own.
#===============================================================================
class PokeBattle_Move_305 < PokeBattle_Move
def healingMove?; return true; end
def pbFailsAgainstTarget?(user,target)
if target.hp==target.totalhp
@battle.pbDisplay(_INTL("{1}'s HP is full!",target.pbThis))
return true
elsif !target.canHeal?
@battle.pbDisplay(_INTL("{1} is unaffected!",target.pbThis))
return true
end
return false
end
def pbEffectAgainstTarget(user,target)
hpGain = (target.totalhp/1.5).round
user.pbReduceHP(user.totalhp/3,false)
user.pbItemHPHealCheck
target.pbRecoverHP(hpGain)
@battle.pbDisplay(_INTL("{1}'s HP was restored.",target.pbThis))
end
end
The third move shouldn't be too hard; not sure what the issue is (t still works on sleeping foes). I just copied the section from Dream Eater for the second part. Does it have anything to do with also being a TargetStatDownMove?
Code:
#===============================================================================
# Blinding Beacon- (may lower acc, no effect on sleeping foes (eyes closed)
#===============================================================================
class PokeBattle_Move_306 < PokeBattle_TargetStatDownMove
def initialize(battle,move)
super
@statDown = [PBStats::ACCURACY,1]
end
def pbFailsAgainstTarget?(user,target)
if !target.asleep?
@battle.pbDisplay(_INTL("{1} wasn't affected!",target.pbThis))
return true
end
return false
end
end
Finally, and I'm pretty sure this one is a mess, I'm trying to script a move that affects all battlers and increases the Hp of Light types by 1/3 while decreasing the Hp of Dark and Ghost types by 1/3:
Spoiler:
Code:
#===============================================================================
# Starlight - increases Hp of Light Types and decreases Hp of Dark & Ghost Types by 1/3
#===============================================================================
class PokeBattle_Move_307 < PokeBattle_Move
def pbMoveFailed?(user,targets)
@validTargets = []
@battle.eachBattler do |b|
next if !b.pbHasType?(:LIGHT,:DARK,:GHOST)
next if b.semiInvulnerable?
@validTargets.push(b.index)
end
if @validTargets.length==0
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
return false
end
def pbFailsAgainstTarget?(user,target)
return false if @validTargets.include?(target.index)
return true if !target.pbHasType?(:LIGHT,:DARK,:GHOST) || target.semiInvulnerable?
end
def pbEffectAgainstTarget(user,target)
@validTargets = []
@battle.eachBattler do |b|
next if !b.pbHasType?(:LIGHT)
hpGain = (target.totalhp/1.5).round
target.pbRecoverHP(hpGain)
@battle.pbDisplay(_INTL("{1}'s HP was restored.",target.pbThis))
end
end
def pbEffectAgainstTarget(user,target)
@validTargets = []
@battle.eachBattler do |b|
next if !b.pbHasType?(:DARK,:GHOST)
user.pbReduceHP(user.totalhp/3,false)
user.pbItemHPHealCheck
end
end
end
I get this error when using it (and the Pokemon keeps trying to use the move after each identical error rather than the game shutting down)
Spoiler:
Exception: ArgumentError
Message: wrong number of arguments(3 for 1)
Backtrace:
Move_Effects_100-17F:2738:in `pbHasType?'
Move_Effects_100-17F:2738:in `pbMoveFailed?'
Move_Effects_100-17F:2737:in `eachBattler'
PokeBattle_Battle:421:in `each'
PokeBattle_Battle:421:in `eachBattler'
Move_Effects_100-17F:2737:in `pbMoveFailed?'
Battler_UseMove:305:in `pbUseMove'
Battler_UseMove:59:in `pbProcessTurn'
Battler_UseMove:58:in `logonerr'
Battler_UseMove:58:in `pbProcessTurn'
Any assistance is much appreciated.