mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 22:54:59 +00:00
update 6.7
This commit is contained in:
128
Data/Scripts/052_InfiniteFusion/Gameplay/Items/New Balls.rb
Normal file
128
Data/Scripts/052_InfiniteFusion/Gameplay/Items/New Balls.rb
Normal file
@@ -0,0 +1,128 @@
|
||||
###################
|
||||
## NEW POKEBALLS #
|
||||
###################
|
||||
|
||||
#GENDER BALL (24) - switch le gender du pokemon
|
||||
#catch rate: pokeball
|
||||
BallHandlers::OnCatch.add(:GENDERBALL,proc{|ball,battle,pokemon|
|
||||
if pokemon.gender == 0
|
||||
pokemon.makeFemale
|
||||
elsif pokemon.gender == 1
|
||||
pokemon.makeMale
|
||||
end
|
||||
})
|
||||
|
||||
#BOOST BALL 25 - rend le pokemon traded
|
||||
#catch rate: 80% pokeball
|
||||
BallHandlers::ModifyCatchRate.add(:TRADEBALL,proc{|ball,catchRate,battle,pokemon|
|
||||
catchRate=(catchRate*0.8).floor(1)
|
||||
next catchRate
|
||||
})
|
||||
BallHandlers::OnCatch.add(:TRADEBALL,proc{|ball,battle,pokemon|
|
||||
pokemon.obtain_method = 2
|
||||
})
|
||||
|
||||
#ABILITY BALL 26 - change l'ability
|
||||
#catch rate: 60% pokeball
|
||||
BallHandlers::ModifyCatchRate.add(:ABILITYBALL,proc{|ball,catchRate,battle,pokemon|
|
||||
catchRate=(catchRate*0.6).floor(1)
|
||||
next catchRate
|
||||
})
|
||||
BallHandlers::OnCatch.add(:ABILITYBALL,proc{|ball,battle,pokemon|
|
||||
species = getSpecies(dexNum(pokemon))
|
||||
ability = species.hidden_abilities[-1]
|
||||
pokemon.ability = ability
|
||||
pokemon.ability_index= getAbilityIndexFromID(ability,pokemon)
|
||||
})
|
||||
|
||||
#VIRUS BALL 27 - give pokerus
|
||||
#catch rate: 40% pokeball
|
||||
BallHandlers::ModifyCatchRate.add(:VIRUSBALL,proc{|ball,catchRate,battle,pokemon|
|
||||
catchRate=(catchRate*0.4).floor(1)
|
||||
next catchRate
|
||||
})
|
||||
BallHandlers::OnCatch.add(:VIRUSBALL,proc{|ball,battle,pokemon|
|
||||
pokemon.givePokerus
|
||||
})
|
||||
|
||||
#SHINY BALL 28 - rend shiny
|
||||
#catchrate: 20% pokeball
|
||||
BallHandlers::ModifyCatchRate.add(:SHINYBALL,proc{|ball,catchRate,battle,pokemon|
|
||||
catchRate=(catchRate*0.2).floor(1)
|
||||
next catchRate
|
||||
})
|
||||
BallHandlers::OnCatch.add(:SHINYBALL,proc{|ball,battle,pokemon|
|
||||
pokemon.glitter=true
|
||||
})
|
||||
|
||||
#PERFECTBALL 29
|
||||
#catch rate: 10% pokeball
|
||||
BallHandlers::ModifyCatchRate.add(:PERFECTBALL,proc{|ball,catchRate,battle,pokemon|
|
||||
catchRate=(catchRate*0.1).floor(1)
|
||||
next catchRate
|
||||
})
|
||||
BallHandlers::OnCatch.add(:PERFECTBALL,proc{|ball,battle,pokemon|
|
||||
stats = [:ATTACK, :SPECIAL_ATTACK, :SPECIAL_DEFENSE, :SPEED, :DEFENSE, :HP]
|
||||
first = rand(stats.length)
|
||||
second = rand(stats.length)
|
||||
pokemon.iv[stats[first]] = 31
|
||||
pokemon.iv[stats[second]] = 31
|
||||
})
|
||||
|
||||
|
||||
#DREAMBALL - endormi
|
||||
BallHandlers::ModifyCatchRate.add(:DREAMBALL,proc{|ball,catchRate,battle,battler|
|
||||
battler.status = :SLEEP
|
||||
next catchRate
|
||||
})
|
||||
#TOXICBALL - empoisonné
|
||||
BallHandlers::ModifyCatchRate.add(:TOXICBALL,proc{|ball,catchRate,battle,battler|
|
||||
battler.status = :POISON
|
||||
next catchRate
|
||||
})
|
||||
#SCORCHBALL - brulé
|
||||
BallHandlers::ModifyCatchRate.add(:SCORCHBALL,proc{|ball,catchRate,battle,battler|
|
||||
battler.status = :BURN
|
||||
next catchRate
|
||||
})
|
||||
#FROSTBALL - frozen
|
||||
BallHandlers::ModifyCatchRate.add(:FROSTBALL,proc{|ball,catchRate,battle,battler|
|
||||
battler.status = :FROZEN
|
||||
next catchRate
|
||||
})
|
||||
#SPARKBALL - paralizé
|
||||
BallHandlers::ModifyCatchRate.add(:SPARKBALL,proc{|ball,catchRate,battle,battler|
|
||||
battler.status = :PARALYSIS
|
||||
next catchRate
|
||||
})
|
||||
#PUREBALL - marche mieux quand pas de status
|
||||
BallHandlers::ModifyCatchRate.add(:PUREBALL,proc{|ball,catchRate,battle,battler|
|
||||
catchRate=(catchRate*7/2).floor if battler.status ==0
|
||||
next catchRate
|
||||
})
|
||||
#STATUSBALL - marche mieux quand any status
|
||||
BallHandlers::ModifyCatchRate.add(:STATUSBALL,proc{|ball,catchRate,battle,battler|
|
||||
catchRate=(catchRate*5/2).floor if battler.status !=0
|
||||
next catchRate
|
||||
})
|
||||
|
||||
#FUSIONBALL - marche mieux quand fusedr
|
||||
BallHandlers::ModifyCatchRate.add(:FUSIONBALL,proc{|ball,catchRate,battle,battler|
|
||||
catchRate*=3 if GameData::Species.get(battler.species).id_number > Settings::NB_POKEMON
|
||||
next catchRate
|
||||
})
|
||||
|
||||
#CANDY BALL - +5 level
|
||||
#catchrate: 80% pokeball
|
||||
BallHandlers::ModifyCatchRate.add(:CANDYBALL,proc{|ball,catchRate,battle,pokemon|
|
||||
catchRate=(catchRate*0.8).floor
|
||||
next catchRate
|
||||
})
|
||||
BallHandlers::OnCatch.add(:CANDYBALL,proc{|ball,battle,pokemon|
|
||||
pokemon.level = pokemon.level+5
|
||||
})
|
||||
#FIRECRACKER
|
||||
BallHandlers::ModifyCatchRate.add(:FIRECRACKER,proc{|ball,catchRate,battle,battler|
|
||||
battler.hp -= 10
|
||||
next 0
|
||||
})
|
||||
141
Data/Scripts/052_InfiniteFusion/Gameplay/Items/New HMs.rb
Normal file
141
Data/Scripts/052_InfiniteFusion/Gameplay/Items/New HMs.rb
Normal file
@@ -0,0 +1,141 @@
|
||||
|
||||
#===============================================================================
|
||||
# Rock Smash
|
||||
#===============================================================================
|
||||
|
||||
|
||||
def pbRockSmashRandomEncounter
|
||||
if rand(100)<30
|
||||
if pbEncounter(:RockSmash)
|
||||
return
|
||||
else
|
||||
pbDefaultRockSmashEncounter(5,15)
|
||||
end
|
||||
else
|
||||
rockSmashItem(false)
|
||||
end
|
||||
end
|
||||
|
||||
def pbDefaultRockSmashEncounter(minLevel,maxLevel)
|
||||
level =rand((maxLevel-minLevel).abs)+minLevel
|
||||
pbWildBattle(:GEODUDE,level)
|
||||
return true
|
||||
end
|
||||
|
||||
#FOR ROCK TUNNEL AND CERULEAN CAVE (+diamond)
|
||||
def pbRockSmashRandomEncounterSpecial
|
||||
if rand(100)<35
|
||||
pbEncounter(:RockSmash)
|
||||
else
|
||||
rockSmashItem(true)
|
||||
end
|
||||
end
|
||||
|
||||
def getRockSmashItemList(inclRareItems)
|
||||
basicItems = [:ROCKGEM, :GROUNDGEM,:STEELGEM,
|
||||
:HARDSTONE,:HARDSTONE,:HARDSTONE,:ROCKGEM,
|
||||
:SMOOTHROCK,:STARDUST,:HEARTSCALE,:HEARTSCALE,
|
||||
:HEARTSCALE,:SOFTSAND,:HEARTSCALE,:RAREBONE]
|
||||
|
||||
rareItems = [:RAREBONE,:STARDUST,:ETHER,
|
||||
:REVIVE,:NUGGET,:DIAMOND]
|
||||
|
||||
fossilItems = [:ROOTFOSSIL,:CLAWFOSSIL,:DOMEFOSSIL,:HELIXFOSSIL,
|
||||
:SKULLFOSSIL,:ARMORFOSSIL,:JAWFOSSIL,:SAILFOSSIL]
|
||||
|
||||
# Kernel.pbMessage(inclRareItems.to_s)
|
||||
|
||||
itemsList = inclRareItems ? basicItems + basicItems + rareItems : basicItems
|
||||
|
||||
#beaten league
|
||||
if $game_switches[12]
|
||||
itemsList += fossilItems
|
||||
end
|
||||
return itemsList
|
||||
end
|
||||
|
||||
def rockSmashItem(isDark=false)
|
||||
chance = 50
|
||||
if rand(100)< chance
|
||||
if rand(5) == 0 && !hatUnlocked?(HAT_AERODACTYL)
|
||||
obtainHat(HAT_AERODACTYL)
|
||||
else
|
||||
itemsList = getRockSmashItemList(isDark)
|
||||
i = rand(itemsList.length)
|
||||
Kernel.pbItemBall(itemsList[i],1,nil,false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#Used in underwater maps
|
||||
def pbRockSmashRandomEncounterDive
|
||||
if rand(100)<25
|
||||
pbEncounter(:RockSmash)
|
||||
else
|
||||
if rand(100)<20
|
||||
itemsList = [:WATERGEM,:STEELGEM,
|
||||
:HEARTSCALE,:HEARTSCALE,:HARDSTONE,:ROCKGEM,
|
||||
:SMOOTHROCK,:WATERSTONE,:PEARL,:HEARTSCALE,
|
||||
:HEARTSCALE,:HEARTSCALE,:SHOALSHELL,:BIGPEARL]
|
||||
|
||||
i = rand(itemsList.length)
|
||||
Kernel.pbItemBall(itemsList[i],1,nil,false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
############### MORNING SUN / MOONLIGHT
|
||||
HiddenMoveHandlers::CanUseMove.add(:MORNINGSUN,proc{|move,pkmn|
|
||||
mapMetadata = GameData::MapMetadata.try_get($game_map.map_id)
|
||||
if !mapMetadata || !mapMetadata.outdoor_map
|
||||
Kernel.pbMessage(_INTL("Can't use that here."))
|
||||
next false
|
||||
end
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:MORNINGSUN,proc{|move,pokemon|
|
||||
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(pokemon)
|
||||
pbFadeOutIn(99999){
|
||||
pbSkipTime(9)
|
||||
newTime = pbGetTimeNow.strftime("%I:%M %p")
|
||||
Kernel.pbMessage(_INTL("{1} waited until morning...",$Trainer.name))
|
||||
Kernel.pbMessage(_INTL("The time is now {1}",newTime))
|
||||
$game_screen.weather(:None,0,0)
|
||||
$game_map.refresh
|
||||
}
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:MOONLIGHT,proc{|move,pkmn|
|
||||
mapMetadata = GameData::MapMetadata.try_get($game_map.map_id)
|
||||
if !mapMetadata || !mapMetadata.outdoor_map
|
||||
Kernel.pbMessage(_INTL("Can't use that here."))
|
||||
next false
|
||||
end
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:MOONLIGHT,proc{|move,pokemon|
|
||||
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,GameData::Move.get(move).name))
|
||||
pbHiddenMoveAnimation(pokemon)
|
||||
pbFadeOutIn(99999){
|
||||
pbSkipTime(21)
|
||||
newTime = pbGetTimeNow.strftime("%I:%M %p")
|
||||
Kernel.pbMessage(_INTL("{1} waited until night...",$Trainer.name))
|
||||
Kernel.pbMessage(_INTL("The time is now {1}",newTime))
|
||||
$game_screen.weather(:None,0,0)
|
||||
$game_map.refresh
|
||||
}
|
||||
next true
|
||||
})
|
||||
|
||||
def pbSkipTime(newTime)
|
||||
currentTime = pbGetTimeNow.hour
|
||||
hoursToAdd = newTime - currentTime
|
||||
$game_variables[UnrealTime::EXTRA_SECONDS] += hoursToAdd*3600
|
||||
end
|
||||
2204
Data/Scripts/052_InfiniteFusion/Gameplay/Items/New Items effects.rb
Normal file
2204
Data/Scripts/052_InfiniteFusion/Gameplay/Items/New Items effects.rb
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,53 @@
|
||||
class VariableCurrencyMartAdapter < PokemonMartAdapter
|
||||
def initialize(currency)
|
||||
@currency_variable = currency
|
||||
end
|
||||
def getMoney
|
||||
return pbGet(@currency_variable).to_i
|
||||
end
|
||||
|
||||
def getMoneyString
|
||||
return pbGet(@currency_variable).to_s
|
||||
end
|
||||
|
||||
def setMoney(value)
|
||||
pbSet(@currency_variable,value)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def pbVariablePokemonMart(stock,currencyVariable,currency_name="Points",speech=nil,cantsell=true)
|
||||
for i in 0...stock.length
|
||||
stock[i] = GameData::Item.get(stock[i]).id
|
||||
stock[i] = nil if GameData::Item.get(stock[i]).is_important? && $PokemonBag.pbHasItem?(stock[i])
|
||||
end
|
||||
stock.compact!
|
||||
commands = []
|
||||
cmdBuy = -1
|
||||
cmdSell = -1
|
||||
cmdQuit = -1
|
||||
commands[cmdBuy = commands.length] = _INTL("Buy")
|
||||
commands[cmdSell = commands.length] = _INTL("Sell") if !cantsell
|
||||
commands[cmdQuit = commands.length] = _INTL("Quit")
|
||||
cmd = pbMessage(
|
||||
speech ? speech : _INTL("Welcome! How may I serve you?"),
|
||||
commands,cmdQuit+1)
|
||||
loop do
|
||||
if cmdBuy>=0 && cmd==cmdBuy
|
||||
adapter = VariableCurrencyMartAdapter.new(currencyVariable)
|
||||
scene = PokemonMart_Scene.new(currency_name)
|
||||
screen = PokemonMartScreen.new(scene,stock,adapter)
|
||||
screen.pbBuyScreen
|
||||
elsif cmdSell>=0 && cmd==cmdSell #NOT IMPLEMENTED
|
||||
scene = PokemonMart_Scene.new(currency_name)
|
||||
screen = PokemonMartScreen.new(scene,stock,adapter)
|
||||
screen.pbSellScreen
|
||||
else
|
||||
pbMessage(_INTL("Please come again!"))
|
||||
break
|
||||
end
|
||||
cmd = pbMessage(_INTL("Is there anything else I can help you with?"),
|
||||
commands,cmdQuit+1)
|
||||
end
|
||||
$game_temp.clear_mart_prices
|
||||
end
|
||||
Reference in New Issue
Block a user