mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
Renamed variables and methods relating to the Bag, renamed $PokemonBag to $Bag, $bag.has? can now check for a minimum quantity
This commit is contained in:
@@ -207,7 +207,7 @@ module PokeBattle_BattleCommon
|
||||
elsif numOwned>30
|
||||
dex_modifier = 1
|
||||
end
|
||||
dex_modifier *= 2 if $PokemonBag.pbHasItem?(:CATCHINGCHARM)
|
||||
dex_modifier *= 2 if $bag.has?(:CATCHINGCHARM)
|
||||
c = x * dex_modifier / 12
|
||||
# Calculate the number of shakes
|
||||
if c>0 && pbRandom(256)<c
|
||||
|
||||
@@ -8,7 +8,7 @@ class PokeBattle_Battle
|
||||
return if !@internalBattle || !@expGain
|
||||
# Go through each battler in turn to find the Pokémon that participated in
|
||||
# battle against it, and award those Pokémon Exp/EVs
|
||||
expAll = (GameData::Item.exists?(:EXPALL) && $PokemonBag.pbHasItem?(:EXPALL))
|
||||
expAll = $bag.has?(:EXPALL)
|
||||
p1 = pbParty(0)
|
||||
@battlers.each do |b|
|
||||
next unless b && b.opposes? # Can only gain Exp from fainted foes
|
||||
@@ -145,7 +145,7 @@ class PokeBattle_Battle
|
||||
end
|
||||
end
|
||||
# Exp. Charm increases Exp gained
|
||||
exp = exp * 3 / 2 if GameData::Item.exists?(:EXPCHARM) && $PokemonBag.pbHasItem?(:EXPCHARM)
|
||||
exp = exp * 3 / 2 if $bag.has?(:EXPCHARM)
|
||||
# Modify Exp gain based on pkmn's held item
|
||||
i = BattleHandlers.triggerExpGainModifierItem(pkmn.item,pkmn,exp)
|
||||
if i<0
|
||||
|
||||
@@ -43,7 +43,7 @@ class PokeBattle_Battle
|
||||
return if !item
|
||||
return if !GameData::Item.get(item).consumed_after_use?
|
||||
if pbOwnedByPlayer?(idxBattler)
|
||||
if !$PokemonBag.pbDeleteItem(item)
|
||||
if !$bag.remove(item)
|
||||
raise _INTL("Tried to consume item that wasn't in the Bag somehow.")
|
||||
end
|
||||
else
|
||||
@@ -56,8 +56,8 @@ class PokeBattle_Battle
|
||||
return if !item
|
||||
return if !GameData::Item.get(item).consumed_after_use?
|
||||
if pbOwnedByPlayer?(idxBattler)
|
||||
if $PokemonBag && $PokemonBag.pbCanStore?(item)
|
||||
$PokemonBag.pbStoreItem(item)
|
||||
if $bag && $bag.can_add?(item)
|
||||
$bag.add(item)
|
||||
else
|
||||
raise _INTL("Couldn't return unused item to Bag somehow.")
|
||||
end
|
||||
|
||||
@@ -63,14 +63,14 @@ class PokeBattle_Battle
|
||||
#=============================================================================
|
||||
def pbHasMegaRing?(idxBattler)
|
||||
return true if !pbOwnedByPlayer?(idxBattler) # Assume AI trainer have a ring
|
||||
Settings::MEGA_RINGS.each { |item| return true if $PokemonBag.pbHasItem?(item) }
|
||||
Settings::MEGA_RINGS.each { |item| return true if $bag.has?(item) }
|
||||
return false
|
||||
end
|
||||
|
||||
def pbGetMegaRingName(idxBattler)
|
||||
if pbOwnedByPlayer?(idxBattler)
|
||||
Settings::MEGA_RINGS.each do |item|
|
||||
return GameData::Item.get(item).name if $PokemonBag.pbHasItem?(item)
|
||||
return GameData::Item.get(item).name if $bag.has?(item)
|
||||
end
|
||||
end
|
||||
# NOTE: Add your own Mega objects for particular NPC trainers here.
|
||||
|
||||
Reference in New Issue
Block a user