- 282
- Posts
- 6
- Years
- Seen Feb 3, 2025
So I'm trying to add a new move called Dragon Fleet into my game. I wanted it to work like Beat Up, dealing slightly more damage, but only add hits for the user and all Dragon-types in the user's party. In the PokeBattle_MoveEffects script, I copied the code for Beat Up and tried to change it so it would only register for Dragon-types, but it didn't work differently than Beat Up.
---------------------------------------------------------------------------
Here is the code that I changed from Beat Up in order to implement Dragon Fleet:
class PokeBattle_Move_179 < PokeBattle_Move
def pbIsMultiHit
return true
end
def pbNumHits(attacker)
return @participants.length
end
def pbOnStartUse(attacker)
[email protected](attacker.index)
@participants=[]
for i in 0...party.length
if attacker.pokemonIndex==i
@participants.push(i)
elsif party && !party.egg? && party.hp>0 && party.status==0 && party.pbHasType?(:DRAGON)
@participants.push(i)
end
end
if @participants.length==0
@battle.pbDisplay(_INTL("But it failed!"))
return false
end
return true
end
def pbBaseDamage(basedmg,attacker,opponent)
[email protected](attacker.index)
atk=party[@participants[0]].baseStats[1]
@participants[0]=nil; @participants.compact!
return 5+(atk/7)
end
end
Here is the original code for Beat Up:
class PokeBattle_Move_0C1 < PokeBattle_Move
def pbIsMultiHit
return true
end
def pbNumHits(attacker)
return @participants.length
end
def pbOnStartUse(attacker)
[email protected](attacker.index)
@participants=[]
for i in 0...party.length
if attacker.pokemonIndex==i
@participants.push(i)
elsif party && !party.egg? && party.hp>0 && party.status==0
@participants.push(i)
end
end
if @participants.length==0
@battle.pbDisplay(_INTL("But it failed!"))
return false
end
return true
end
def pbBaseDamage(basedmg,attacker,opponent)
[email protected](attacker.index)
atk=party[@participants[0]].baseStats[1]
@participants[0]=nil; @participants.compact!
return 5+(atk/10)
end
end
---------------------------------------------------------------------------
I know that the method for ".hasType?" was called because there was no error, it just always returned true. When I tried to see what would happen if I put an "!" in front of it to negate the statement, the attack only hit once (based on just the user). Accessing a type works if it is the user or the opponent, but it doesn't seem to work properly here. Thanks if anyone is able to help me.
---------------------------------------------------------------------------
Here is the code that I changed from Beat Up in order to implement Dragon Fleet:
class PokeBattle_Move_179 < PokeBattle_Move
def pbIsMultiHit
return true
end
def pbNumHits(attacker)
return @participants.length
end
def pbOnStartUse(attacker)
[email protected](attacker.index)
@participants=[]
for i in 0...party.length
if attacker.pokemonIndex==i
@participants.push(i)
elsif party && !party.egg? && party.hp>0 && party.status==0 && party.pbHasType?(:DRAGON)
@participants.push(i)
end
end
if @participants.length==0
@battle.pbDisplay(_INTL("But it failed!"))
return false
end
return true
end
def pbBaseDamage(basedmg,attacker,opponent)
[email protected](attacker.index)
atk=party[@participants[0]].baseStats[1]
@participants[0]=nil; @participants.compact!
return 5+(atk/7)
end
end
Here is the original code for Beat Up:
class PokeBattle_Move_0C1 < PokeBattle_Move
def pbIsMultiHit
return true
end
def pbNumHits(attacker)
return @participants.length
end
def pbOnStartUse(attacker)
[email protected](attacker.index)
@participants=[]
for i in 0...party.length
if attacker.pokemonIndex==i
@participants.push(i)
elsif party && !party.egg? && party.hp>0 && party.status==0
@participants.push(i)
end
end
if @participants.length==0
@battle.pbDisplay(_INTL("But it failed!"))
return false
end
return true
end
def pbBaseDamage(basedmg,attacker,opponent)
[email protected](attacker.index)
atk=party[@participants[0]].baseStats[1]
@participants[0]=nil; @participants.compact!
return 5+(atk/10)
end
end
---------------------------------------------------------------------------
I know that the method for ".hasType?" was called because there was no error, it just always returned true. When I tried to see what would happen if I put an "!" in front of it to negate the statement, the attack only hit once (based on just the user). Accessing a type works if it is the user or the opponent, but it doesn't seem to work properly here. Thanks if anyone is able to help me.