mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Fixed Natural Gift always being Normal-type
This commit is contained in:
@@ -470,27 +470,27 @@ class PokeBattle_Move_096 < PokeBattle_Move
|
|||||||
:ENIGMABERRY, :MICLEBERRY, :CUSTAPBERRY, :JABOCABERRY, :ROWAPBERRY,
|
:ENIGMABERRY, :MICLEBERRY, :CUSTAPBERRY, :JABOCABERRY, :ROWAPBERRY,
|
||||||
:KEEBERRY, :MARANGABERRY]
|
:KEEBERRY, :MARANGABERRY]
|
||||||
}
|
}
|
||||||
@berry = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbMoveFailed?(user,targets)
|
def pbMoveFailed?(user,targets)
|
||||||
# NOTE: Unnerve does not stop a Pokémon using this move.
|
# NOTE: Unnerve does not stop a Pokémon using this move.
|
||||||
@berry = user.item
|
item = user.item
|
||||||
if !@berry || !@berry.is_berry? || !user.itemActive?
|
if !item || !item.is_berry? || !user.itemActive?
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
# NOTE: The AI calls this method via pbCalcType, but it involves @berry which
|
# NOTE: The AI calls this method via pbCalcType, but it involves user.item
|
||||||
# won't always be accurate (although it will always be defined). Since
|
# which here is assumed to be not nil (because item.id is called). Since
|
||||||
# the AI won't want to use it if the user has no item anyway, and
|
# the AI won't want to use it if the user has no item anyway, perhaps
|
||||||
# complex item movement is unlikely, perhaps this is good enough.
|
# this is good enough.
|
||||||
def pbBaseType(user)
|
def pbBaseType(user)
|
||||||
|
item = user.item
|
||||||
ret = :NORMAL
|
ret = :NORMAL
|
||||||
@typeArray.each do |type, items|
|
@typeArray.each do |type, items|
|
||||||
next if !items.include?(@berry.id)
|
next if !items.include?(item.id)
|
||||||
ret = type if GameData::Type.exists?(type)
|
ret = type if GameData::Type.exists?(type)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -510,7 +510,7 @@ class PokeBattle_Move_096 < PokeBattle_Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbBaseDamage(baseDmg,user,target)
|
def pbBaseDamage(baseDmg,user,target)
|
||||||
return pbNaturalGiftBaseDamage(@berry.id)
|
return pbNaturalGiftBaseDamage(user.item.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbEndOfMoveUsageEffect(user,targets,numHits,switchedBattlers)
|
def pbEndOfMoveUsageEffect(user,targets,numHits,switchedBattlers)
|
||||||
@@ -519,7 +519,6 @@ class PokeBattle_Move_096 < PokeBattle_Move
|
|||||||
# an effect like a target's Red Card.
|
# an effect like a target's Red Card.
|
||||||
# NOTE: There is no item consumption animation.
|
# NOTE: There is no item consumption animation.
|
||||||
user.pbConsumeItem(true,true,false) if user.item
|
user.pbConsumeItem(true,true,false) if user.item
|
||||||
@berry = nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ class PokeBattle_Trainer
|
|||||||
trainer.party.each { |p| ret.party.push(PokeBattle_Pokemon.convert(p)) }
|
trainer.party.each { |p| ret.party.push(PokeBattle_Pokemon.convert(p)) }
|
||||||
ret.badges = trainer.badges.clone
|
ret.badges = trainer.badges.clone
|
||||||
ret.money = trainer.money
|
ret.money = trainer.money
|
||||||
trainer.seen.each_with_index { |value, i| ret.pokedex.set_seen(i) if value }
|
trainer.seen.each_with_index { |value, i| ret.pokedex.set_seen(i, false) if value }
|
||||||
trainer.owned.each_with_index { |value, i| ret.pokedex.set_owned(i) if value }
|
trainer.owned.each_with_index { |value, i| ret.pokedex.set_owned(i, false) if value }
|
||||||
trainer.formseen.each_with_index do |value, i|
|
trainer.formseen.each_with_index do |value, i|
|
||||||
species_id = GameData::Species.try_get(i)&.species
|
species_id = GameData::Species.try_get(i)&.species
|
||||||
next if species_id.nil? || value.nil?
|
next if species_id.nil? || value.nil?
|
||||||
@@ -112,6 +112,7 @@ class PokeBattle_Trainer
|
|||||||
ret.pokedex.set_shadow_pokemon_owned(i) if value
|
ret.pokedex.set_shadow_pokemon_owned(i) if value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
ret.pokedex.refresh_accessible_dexes
|
||||||
ret.has_pokedex = trainer.pokedex
|
ret.has_pokedex = trainer.pokedex
|
||||||
ret.has_pokegear = trainer.pokegear
|
ret.has_pokegear = trainer.pokegear
|
||||||
ret.mystery_gift_unlocked = trainer.mysterygiftaccess if trainer.mysterygiftaccess
|
ret.mystery_gift_unlocked = trainer.mysterygiftaccess if trainer.mysterygiftaccess
|
||||||
|
|||||||
Reference in New Issue
Block a user