compatibility items trainers

This commit is contained in:
infinitefusion
2021-06-24 12:10:44 -04:00
parent c23f50e5a6
commit ba536c0b02
51 changed files with 91816 additions and 34867 deletions

View File

@@ -9,6 +9,10 @@ module MessageConfig
SMALL_FONT_SIZE = 25
NARROW_FONT_NAME = "Power Green Narrow"
NARROW_FONT_SIZE = 29
BUBBLE_TEXT_BASE = Color.new(248,248,248)#(72,80,88)#DIALOG
BUBBLE_TEXT_SHADOW= Color.new(166,160,151)
# 0 = Pause cursor is displayed at end of text
# 1 = Pause cursor is displayed at bottom right
# 2 = Pause cursor is displayed at lower middle side
@@ -92,9 +96,9 @@ module MessageConfig
def self.pbSettingToTextSpeed(speed)
case speed
when 0 then return 2
when 1 then return 1
when 2 then return -2
when 0 then return 1
when 1 then return -2
when 2 then return -999
end
return TEXT_SPEED || 1
end

View File

@@ -145,7 +145,7 @@ GameData::Weather.register({
# NOTE: This alters the screen tone in RPG::Weather#update_screen_tone.
GameData::Weather.register({
:id => :Sun,
:id => :Sunny,
:id_number => 7,
:category => :Sun,
:tone_proc => proc { |strength|

View File

@@ -30,168 +30,168 @@ GameData::EncounterType.register({
:id => :Land,
:type => :land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :LandDay,
:type => :land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :LandNight,
:type => :land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :LandMorning,
:type => :land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :LandAfternoon,
:type => :land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :LandEvening,
:type => :land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :Cave,
:type => :cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :CaveDay,
:type => :cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :CaveNight,
:type => :cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :CaveMorning,
:type => :cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :CaveAfternoon,
:type => :cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :CaveEvening,
:type => :cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :Water,
:type => :water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :WaterDay,
:type => :water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :WaterNight,
:type => :water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :WaterMorning,
:type => :water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :WaterAfternoon,
:type => :water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :WaterEvening,
:type => :water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :OldRod,
:type => :fishing,
:old_slots => [70, 30]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :GoodRod,
:type => :fishing,
:old_slots => [60, 20, 20]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :SuperRod,
:type => :fishing,
:old_slots => [40, 40, 15, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :RockSmash,
:type => :none,
:trigger_chance => 50,
:old_slots => [60, 30, 5, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :HeadbuttLow,
:type => :none,
:old_slots => [30, 25, 20, 10, 5, 5, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :HeadbuttHigh,
:type => :none,
:old_slots => [30, 25, 20, 10, 5, 5, 4, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})
GameData::EncounterType.register({
:id => :BugContest,
:type => :contest,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
:old_slots => [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
})

View File

@@ -25,7 +25,7 @@ class PokemonSystem
@runstyle = 0 # Default movement speed (0=walk, 1=run)
@bgmvolume = 100 # Volume of background music and ME
@sevolume = 100 # Volume of sound effects
@textinput = 0 # Text input mode (0=cursor, 1=keyboard)
@textinput = 1 # Text input mode (0=cursor, 1=keyboard)
end
end
@@ -328,7 +328,7 @@ class PokemonOption_Scene
end
}
),
EnumOption.new(_INTL("Text Speed"),[_INTL("Slow"),_INTL("Normal"),_INTL("Fast")],
EnumOption.new(_INTL("Text Speed"),[_INTL("Normal"),_INTL("Fast"),_INTL("Instant")],
proc { $PokemonSystem.textspeed },
proc { |value|
$PokemonSystem.textspeed = value

View File

@@ -481,7 +481,7 @@ module Compiler
:height => contents["Height"],
:weight => contents["Weight"],
:color => contents["Color"],
:shape => GameData::BodyShape.get(contents["Shape"]).id,
#:shape => GameData::BodyShape.get(contents["Shape"]).id,
:habitat => contents["Habitat"],
:generation => contents["Generation"],
:back_sprite_x => contents["BattlerPlayerX"],

View File

@@ -0,0 +1,198 @@
################################################################################
# Randomized Pokemon Script
# By Umbreon
################################################################################
# Used for a randomized pokemon challenge mainly.
#
# By randomized, I mean EVERY pokemon will be random, even interacted pokemon
# like legendaries. (You may easily disable the randomizer for certain
# situations like legendary battles and starter selecting.)
#
# To use: simply activate Switch Number X
# (X = the number listed After "Switch = ", default is switch number 36.)
#
# If you want certain pokemon to NEVER appear, add them inside the black list.
# (This does not take into effect if the switch stated above is off.)
#
# If you want ONLY certain pokemon to appear, add them to the whitelist. This
# is only recommended when the amount of random pokemon available is around
# 32 or less.(This does not take into effect if the switch stated above is off.)
#
################################################################################
########################## You may edit any settings below this freely.
module RandomizedChallenge
Switch = 36 # switch ID to randomize a pokemon, if it's on then ALL
# pokemon will be randomized. No exceptions.
BlackListedPokemon = [] #[PBSpecies::MEW, PBSpecies::ARCEUS]
# Pokemon to Black List. Any pokemon in here will NEVER appear.
WhiteListedPokemon = []
# Leave this empty if all pokemon are allowed, otherwise only pokemon listed
# above will be selected.
end
######################### Do not edit anything below here.
class PokeBattle_Pokemon
alias randomized_init initialize
def initialize(species, level, player = nil, withMoves = true)
if $game_switches && $game_switches[RandomizedChallenge::Switch]
if $game_switches[991]
species = rand(PBSpecies.maxValue - 1) + 1
basestatsum = $pkmn_dex[species][5][0] # HP
basestatsum += $pkmn_dex[species][5][1] # Attack
basestatsum += $pkmn_dex[species][5][2] # Defense
basestatsum += $pkmn_dex[species][5][3] # Speed
basestatsum += $pkmn_dex[species][5][4] # Special Attack
basestatsum += $pkmn_dex[species][5][5] # Special Defense
while basestatsum > $game_variables[53] || basestatsum < $game_variables[87]
species = rand(PBSpecies.maxValue - 1) + 1
basestatsum = $pkmn_dex[species][5][0] # HP
basestatsum += $pkmn_dex[species][5][1] # Attack
basestatsum += $pkmn_dex[species][5][2] # Defense
basestatsum += $pkmn_dex[species][5][3] # Speed
basestatsum += $pkmn_dex[species][5][4] # Special Attack
basestatsum += $pkmn_dex[species][5][5] # Special Defense
end
#Kernel.pbMessage(_INTL("total = {1}, {2}",basestatsum, PBSpecies.getName(species)))
else
if $game_switches[841]
species = getRandomCustomSprite()
else
species = rand(PBSpecies.maxValue - 1) + 1
end
end
end
randomized_init(species, level, player, withMoves)
end
end
def getRandomCustomSprite()
filesList = Dir["./Graphics/CustomBattlers/*"]
i = rand(filesList.length - 1)
path = filesList[i]
file = File.basename(path, ".*")
splitPoke = file.split(".")
head = splitPoke[0].to_i
body = splitPoke[1].to_i
return (body * NB_POKEMON) + head
end
=begin
##########################
# Trainer house shit
#########################
#Battleformat : 0 = single
# 1 = double
def Kernel.pbTrainerHouse(bstMin,bstMax,level,battleformat)
return false if !validateLevel()
#activate random Pokemon
$game_switches[991] = true
#Set game variables
$game_variables[87]=bstMin
$game_variabes[53]=bstMax
#initialize variables
trainerHouse=true
currentStreak=0
backupTeamLevels()
doubleBattle = battleformat == 1 ? true : false
while trainerHouse
currentStreak += 1
TrainerHouseVictory(currentStreak) if TrainerHouseBattle(level)
end
end
def backupTeamLevels()
$game_variables[91] = $Trainer.pokemonParty[0].level
$game_variables[92] = $Trainer.pokemonParty[1].level
$game_variables[93] = $Trainer.pokemonParty[2].level
end
#choisir le trainer a combattre en fonction du level
def TrainerHouseBattle(level,battleformat)
victoryMessage = getVictoryMessage()
getTrainerHouseBattle(rand(1),level,battleformat)
return
end
#initialiser background & musique pour le combat
def setBattleConstants()
$PokemonGlobal.nextBattleBGM="SubwayTrainerBattle"
$PokemonGlobal.nextBattleBack="IndoorC"
end
#Ajouter les TP après un victoire
def TrainerHouseVictory(currentStreak)
tp_won = currentStreak + 1
$game_variables[49] = tp_won
end
#Valider si le niveau est un challenge possible
def validateLevel(level)
validLevels=[25,50,100]
return validLevels.include?(level)
end
def getVictoryMessage()
return "You're good!"
end
def getTrainerHouseBattle(IsMale,level,single=true)
victoryMessage = getVictoryMessage()
LV25MALE_SINGLE = pbTrainerBattle(PBTrainers::COOLTRAINER_M2,"Matthew",_I(victoryMessage),false,0,true)
LV25FEMALE_SINGLE = pbTrainerBattle(PBTrainers::COOLTRAINER_F2,"Jessica",_I(victoryMessage),false,0,true)
LV25MALE_DOUBLE = pbTrainerBattle(PBTrainers::COOLTRAINER_M2,"Alex",_I(victoryMessage),false,0,true)
LV25FEMALE_DOUBLE = pbTrainerBattle(PBTrainers::COOLTRAINER_F2,"Laurie",_I(victoryMessage),false,0,true)
LV50MALE_SINGLE = pbTrainerBattle(PBTrainers::COOLTRAINER_M2,"Alberto",_I(victoryMessage),false,0,true)
LV50FEMALE_SINGLE = pbTrainerBattle(PBTrainers::COOLTRAINER_F2,"Skyler",_I(victoryMessage),true,0,true)
LV50MALE_DOUBLE = pbTrainerBattle(PBTrainers::COOLTRAINER_M2,"Patrick",_I(victoryMessage),false,0,true)
LV50FEMALE_DOUBLE = pbTrainerBattle(PBTrainers::COOLTRAINER_F2,"Heather",_I(victoryMessage),true,0,true)
LV100MALE_SINGLE = pbTrainerBattle(PBTrainers::COOLTRAINER_M2,"Joe",_I(victoryMessage),false,0,true)
LV100FEMALE_SINGLE = pbTrainerBattle(PBTrainers::COOLTRAINER_F2,"Melissa",_I(victoryMessage),true,0,true)
LV100MALE_DOUBLE = pbTrainerBattle(PBTrainers::COOLTRAINER_M2,"Stephen",_I(victoryMessage),false,0,true)
LV100FEMALE_DOUBLE = pbTrainerBattle(PBTrainers::COOLTRAINER_F2,"Kim",_I(victoryMessage),true,0,true)
if single #SINGLE
if level == 25
return LV25MALE_SINGLE if IsMale == 1
return LV25FEMALE_SINGLE
elsif level == 50
return LV50MALE_SINGLE if IsMale == 1
return LV50FEMALE_SINGLE
else
return LV100MALE_SINGLE if IsMale == 1
return LV100FEMALE_SINGLE
end
else #DOUBLE
if level == 25
return LV25MALE_DOUBLE if IsMale == 1
return LV25FEMALE_DOUBLE
elsif level == 50
return LV50MALE_DOUBLE if IsMale == 1
return LV50FEMALE_DOUBLE
else
return LV100MALE_DOUBLE if IsMale == 1
return LV100FEMALE_DOUBLE
end
end
end
=end

View File

@@ -0,0 +1,235 @@
module OptionTypes
WILD_POKE = 0
TRAINER_POKE = 1
end
class RandomizerOptionsScene < PokemonOption_Scene
RANDOM_WILD = 778
RANDOM_TRAINERS = 987
RANDOM_STARTERS = 954
RANDOM_ITEMS = 958
RANDOM_TMS = 959
def initialize
super
@openTrainerOptions = false
@openWildOptions = false
end
def pbStartScene
super
@changedColor = true
@sprites["title"]=Window_UnformattedTextPokemon.newWithSize(
_INTL("Randomizer settings"),0,0,Graphics.width,64,@viewport)
@sprites["textbox"].text=_INTL("Set the randomizer settings")
pbFadeInAndShow(@sprites) { pbUpdate }
end
def pbGetOptionsIngame()
options = [
EnumOption.new(_INTL("Starters"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[RANDOM_STARTERS] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_STARTERS] = value == 0
}
),
EnumOption.new(_INTL("Trainers"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[RANDOM_TRAINERS] ? 0 : 1 },
proc { |value|
if !$game_switches[RANDOM_TRAINERS] && value == 0
@openTrainerOptions = true
openTrainerOptionsMenu()
end
$game_switches[RANDOM_TRAINERS] = value == 0
}
),
EnumOption.new(_INTL("Wild Pokémon"), [_INTL("On"), _INTL("Off")],
proc {
$game_switches[RANDOM_WILD] ? 0 : 1
},
proc { |value|
if !$game_switches[RANDOM_WILD] && value == 0
@openWildOptions = true
openWildPokemonOptionsMenu()
end
$game_switches[RANDOM_WILD] = value == 0
}
),
EnumOption.new(_INTL("Items"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[RANDOM_ITEMS] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_ITEMS] = value == 0
}
),
EnumOption.new(_INTL("TMs"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[RANDOM_TMS] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_TMS] = value == 0
}
),
]
return options
end
def openTrainerOptionsMenu()
return if !@openTrainerOptions
scene = RandomizerTrainerOptionsScene.new
screen = PokemonOption.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
pbUpdateSceneMap
}
@openTrainerOptions = false
end
def openWildPokemonOptionsMenu()
return if !@openWildOptions
scene = RandomizerWildPokemonOptionsScene.new
screen = PokemonOption.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
pbUpdateSceneMap
}
@openWildOptions = false
end
end
class RandomizerTrainerOptionsScene < PokemonOption_Scene
RANDOM_TEAMS_CUSTOM_SPRITES = 600
RANDOM_HELD_ITEMS = 843
RANDOM_GYM_TYPES = 921
def initialize
@changedColor = false
end
def pbStartScene
super
@sprites["option"].nameBaseColor = Color.new(35, 130, 200)
@sprites["option"].nameShadowColor = Color.new(20, 75, 115)
@changedColor = true
for i in 0...@PokemonOptions.length
@sprites["option"][i] = (@PokemonOptions[i].get || 0)
end
@sprites["title"]=Window_UnformattedTextPokemon.newWithSize(
_INTL("Randomizer settings: Trainers"),0,0,Graphics.width,64,@viewport)
@sprites["textbox"].text=_INTL("Set the randomizer settings for trainers")
pbFadeInAndShow(@sprites) { pbUpdate }
end
def pbFadeInAndShow(sprites, visiblesprites = nil)
return if !@changedColor
super
end
def pbGetOptionsIngame()
options = [
EnumOption.new(_INTL("Custom Sprites only"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[RANDOM_TEAMS_CUSTOM_SPRITES] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_TEAMS_CUSTOM_SPRITES] = value == 0
}
),
EnumOption.new(_INTL("Trainer Held items"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[RANDOM_HELD_ITEMS] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_HELD_ITEMS] = value == 0
}
),
EnumOption.new(_INTL("Gym types"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[RANDOM_GYM_TYPES] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_GYM_TYPES] = value == 0
}
),
]
return options
end
end
class RandomizerWildPokemonOptionsScene < PokemonOption_Scene
RANDOM_WILD_AREA = 777
RANDOM_WILD_GLOBAL = 956
RANDOM_STATIC = 955
REGULAR_TO_FUSIONS = 953
GIFT_POKEMON = 780
def initialize
@changedColor = false
end
def pbStartScene
super
@sprites["option"].nameBaseColor = Color.new(70, 170, 40)
@sprites["option"].nameShadowColor = Color.new(40, 100, 20)
@changedColor = true
for i in 0...@PokemonOptions.length
@sprites["option"][i] = (@PokemonOptions[i].get || 0)
end
@sprites["title"]=Window_UnformattedTextPokemon.newWithSize(
_INTL("Randomizer settings: Wild Pokémon"),0,0,Graphics.width,64,@viewport)
@sprites["textbox"].text=_INTL("Set the randomizer settings for wild Pokémon")
pbFadeInAndShow(@sprites) { pbUpdate }
end
def pbFadeInAndShow(sprites, visiblesprites = nil)
return if !@changedColor
super
end
def pbGetOptionsIngame()
options = [
EnumOption.new(_INTL("Type"), [_INTL("Global"), _INTL("Area")],
proc {
if $game_switches[RANDOM_WILD_AREA]
1
else
0
end
},
proc { |value|
if value == 0
$game_switches[RANDOM_WILD_GLOBAL] = true
$game_switches[RANDOM_WILD_AREA] = false
else
value == 1
$game_switches[RANDOM_WILD_GLOBAL] = false
$game_switches[RANDOM_WILD_AREA] = true
end
}
),
EnumOption.new(_INTL("Static encounters"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[RANDOM_STATIC] ? 0 : 1 },
proc { |value|
$game_switches[RANDOM_STATIC] = value == 0
}
),
EnumOption.new(_INTL("Gift Pokémon"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[GIFT_POKEMON] ? 0 : 1 },
proc { |value|
$game_switches[GIFT_POKEMON] = value == 0
}
),
EnumOption.new(_INTL("Fuse everything"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[REGULAR_TO_FUSIONS] ? 0 : 1 },
proc { |value|
$game_switches[REGULAR_TO_FUSIONS] = value == 0
}
),
]
return options
end
end

View File

@@ -0,0 +1,38 @@
def pbGetRandomItem(item)
#keyItem ou HM -> on randomize pas
return item if $ItemData[item][ITEMTYPE] == 6 || $ItemData[item][ITEMUSE] == 4
return item if isConst?(item, PBItems, :CELLBATTERY)
return item if isConst?(item, PBItems, :MAGNETSTONE)
#TM
if ($ItemData[item][ITEMUSE] == 3)
return $game_switches[959] ? pbGetRandomTM() : item
end
#item normal
return item if !$game_switches[958]
#berries
return pbGetRandomBerry() if $ItemData[item][ITEMTYPE] == 5
newItem = rand(PBItems.maxValue)
#on veut pas de tm ou keyitem
while ($ItemData[newItem][ITEMUSE] == 3 || $ItemData[newItem][ITEMUSE] == 4 || $ItemData[newItem][ITEMTYPE] == 6)
newItem = rand(PBItems.maxValue)
end
return newItem
end
def pbGetRandomBerry()
newItem = rand(PBItems.maxValue)
while (!($ItemData[newItem][ITEMTYPE] == 5))
newItem = rand(PBItems.maxValue)
end
return newItem
end
def pbGetRandomTM()
newItem = rand(PBItems.maxValue)
while (!($ItemData[newItem][ITEMUSE] == 3)) # || $ItemData[newItem][ITEMUSE]==4))
newItem = rand(PBItems.maxValue)
end
return newItem
end

View File

@@ -0,0 +1,164 @@
##### by route
#
# Randomize encounter by routes
# Script by Frogman
#
def Kernel.randomizeWildPokemonByRoute()
bstRange = $game_variables[197]
randomizeToFusions = $game_switches[953]
$game_switches[829] = randomizeToFusions #unused mais probab. utile pour débugger les inévitables bugs quand les gens vont se partager leurs fichiers
maxSpecies = randomizeToFusions ? PBSpecies.maxValue : NB_POKEMON
data=load_data("Data/encounters.dat")
map_index = 0
nb_maps= data.size
if data.is_a?(Hash)
for map in data
map_index += 1
displayProgress(map_index,nb_maps,bstRange)
map_id = map[0]
encountersList = map[1][1]
next if encountersList== nil
type_index =-1
for encounterType in encountersList
type_index +=1
next if encounterType == nil
previousSpecies = -1
previousNewSpecies = -1
encounter_index = 0
for encounter in encounterType
species = encounter[0]
if species != previousSpecies
newSpecies= getNewSpecies(species,bstRange,true,maxSpecies)
previousSpecies = species
previousNewSpecies = newSpecies
else
newSpecies = previousNewSpecies
end
if data[map_id][1][type_index][encounter_index] != nil
data[map_id][1][type_index][encounter_index][0] = newSpecies
end
encounter_index +=1
end #for -encounter
end #for encountertype
end #for - map
end #if
filename = "Data/encounters_randomized.dat"
save_data(Marshal.load(Marshal.dump(data)),filename)
$PokemonEncounters.setup($game_map.map_id)
end
#file = File.new('Data/test.txt', 'w')
#file.puts data.inspect
def displayProgress(current,total,bst)
return if bst >= 100
return if bst >= 20 && current % 10 != 0
Kernel.pbMessageNoSound(_INTL("\\ts[]Generating encounters file...\\n Map {1}/{2}\\^",current,total))
end
class PokemonEncounters
def setup(mapID)
@density=nil
@stepcount=0
@enctypes=[]
begin
data=load_data(getEncountersFilePath())
if data.is_a?(Hash) && data[mapID]
@density=data[mapID][0]
@enctypes=data[mapID][1]
else
@density=nil
@enctypes=[]
end
rescue
@density=nil
@enctypes=[]
end
end
def getEncountersFilePath()
if $game_switches[777] && $game_switches[778] #[777] = random-by-area [778] = wildpokerandom activated
return "Data/encounters_randomized.dat"
else
return "Data/encounters.dat"
end
end
def pbMapEncounter(mapID,enctype)
if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
raise ArgumentError.new(_INTL("Encounter type out of range"))
end
data=load_data(getEncountersFilePath())
if data.is_a?(Hash) && data[mapID]
enctypes=data[mapID][1]
else
return nil
end
return nil if enctypes[enctype]==nil
chances=EncounterTypes::EnctypeChances[enctype]
chancetotal=0
chances.each {|a| chancetotal+=a}
rnd=rand(chancetotal)
chosenpkmn=0
chance=0
for i in 0...chances.length
chance+=chances[i]
if rnd<chance
chosenpkmn=i
break
end
end
encounter=enctypes[enctype][chosenpkmn]
level=encounter[1]+rand(1+encounter[2]-encounter[1])
return [encounter[0],level]
end
end
def getRandomPokemon(originalPokemon,bstRange,maxDexNumber)
originalBst = getBaseStatsTotal(originalPokemon)
bstMin = originalBst-bstRange
bstMax = originalBst+bstRange
foundAPokemon = false
while ! foundAPokemon
newPoke = rand(maxDexNumber-1)+1
newPokeBST = getBaseStatsTotal(newPoke)
if newPokeBST >= bstMin && newPokeBST <= bstMax
foundAPokemon = true
end
end
return newPoke
end
def getBaseStatsTotal(species)
baseStats=$pkmn_dex[species][5]
baseStat_temp = 0
for i in 0...baseStats.length
baseStat_temp+=baseStats[i]
end
return (baseStat_temp/range).floor
end
######################################################

View File

@@ -0,0 +1,693 @@
#A l'entrée d'un gym: mettre $game_variables[113] = au numéro du gym
#pewter = 0, ceruean = 1 etc.
#Le remettre a -1 à la sortie du gym
#Le mettre a -1 au début du jeu
#
#Aussi des trucs modifiés dans le dude qui donne les freshwater au début
#Faudrait aussi s'assurer que il dise pas n'importe quoi en pas randomized
#
#Voir cerulean gym pour implantation
#
#
#
#
#initialiser la RANDOM_TYPE_ARRAY au début du jeu en runnant Kernel.initRandomTypeArray(8)
#
#
#
#
#
#
##################################################################
# TODO:
#
#
#
###
###############################################################
#
GYM_TYPES_ARRAY = [0,5,11,13,12,3,14,10,4,1,0,6,2,16,7,15,1,8,15,1,7,16,18,17,7,16]
#$randomTrainersArray = []
#[fighting dojo est 9eme (1), 0 au debut pour pasavoir a faire -1]
def Kernel.initRandomTypeArray()
typesArray = [0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,14,15,11,17].shuffle #ne pas remettre 10 (QMARKS)
$game_variables[151] = $game_switches[921] ? typesArray : GYM_TYPES_ARRAY
end
def setRivalStarter(starter1, starter2, starter3, choice)
starters=[starter1,starter2,starter3]
starters.delete_at(choice)
if starters[0] > NB_POKEMON || starters[1] > NB_POKEMON
rivalStarter = starters[0]
else
rivalStarter = starters[0]*NB_POKEMON+starters[1]
end
pbSet(250,rivalStarter)
$game_switches[840] = true
end
def setRivalStarterSpecific(rivalStarter)
pbSet(250,rivalStarter)
$game_switches[840] = true
end
class PokeBattle_Battle
CONST_BST_RANGE = 25 #unused. $game_variables[197] a la place
def randomize_opponent_party(party)
#return randomizedRivalFirstBattle(party) if $game_switches[46] && $game_switches[954]
newparty = []
for m in party
next if !m
newspecies = rand(PBSpecies.maxValue - 1) + 1
newBST = getBaseStats(newspecies)
originalBST = getBaseStats(m.species)
while !gymLeaderOk(newspecies) || bstOk(newspecies,m.species,$game_variables[197])
newspecies = rand(PBSpecies.maxValue - 1) + 1
newBST = getBaseStats(newspecies)
#originalBST = getBaseStats(m.species)
end
# Kernel.pbMessage(_INTL("OLD = {1}",newspecies))
m.species = newspecies
m.name = PBSpecies.getName(newspecies)
m.resetMoves
m.calcStats
#pbInitPokemon(m,m.species)
end
return party
end
def randomizedRivalFirstBattle(party)
return party if $game_switches[953] #full random
starter1 = $PokemonGlobal.psuedoBSTHash[1]
starter2 = $PokemonGlobal.psuedoBSTHash[4]
starter3 = $PokemonGlobal.psuedoBSTHash[7]
playerChoice = $game_variables[7]
for m in party
next if !m
case playerChoice
when 0 then newspecies = starter2*NB_POKEMON+starter3
when 1 then newspecies = starter1*NB_POKEMON+starter3
when 2 then newspecies = starter1*NB_POKEMON+starter2
else
end
m.species= newspecies
m.name = PBSpecies.getName(newspecies)
m.resetMoves
m.calcStats
end
return party
end
end
#######
# end of class
######
####methodes utilitaires
def getBaseStats(species)
basestatsum = $pkmn_dex[species][5][0] # HP
basestatsum +=$pkmn_dex[species][5][1] # Attack
basestatsum +=$pkmn_dex[species][5][2] # Defense
basestatsum +=$pkmn_dex[species][5][3] # Speed
basestatsum +=$pkmn_dex[species][5][4] # Special Attack
basestatsum +=$pkmn_dex[species][5][5] # Special Defense
return basestatsum
end
def bstOk(newspecies,oldPokemonSpecies,bst_range=50)
newBST = getBaseStats(newspecies)
originalBST = getBaseStats(oldPokemonSpecies)
return newBST < originalBST-bst_range || newBST > originalBST+bst_range
end
def gymLeaderOk(newspecies)
return true if $game_variables[152] == -1 #not in a gym
leaderType=getLeaderType()
if leaderType == nil
return true
else
return true if SpeciesHasType?(leaderType,newspecies)
end
return false
end
def getLeaderType()
currentGym = $game_variables[152]
if currentGym > $game_variables[151].length
return nil
else
typeIndex = $game_variables[151][currentGym]
type = PBTypes.getName(typeIndex)
end
return typeIndex
end
##Version alternatives de fonctions pour fonctionner avec numero de species
def SpeciesHasType?(type,species)
if type.is_a?(String) || type.is_a?(Symbol)
return isConst?(getSpeciesType1(species),PBTypes,type) || isConst?(getSpeciesType2(species),PBTypes,type)
else
return getSpeciesType1(species)==type || getSpeciesType2(species)==type
end
end
# Returns this Pokémon's first type.
def getSpeciesType1(species)
return $pkmn_dex[species][3]
end
# Returns this Pokémon's second type.
def getSpeciesType2(species)
return $pkmn_dex[species][4]
end
############
#summarize random options
def Kernel.sumRandomOptions()
answer = $game_switches[954] ? "On" : "Off"
stringOptions = "\nStarters: " << answer
answer = $game_switches[778] ? "On" : "Off"
stringOptions << "\nWild Pokémon: " << answer << " "
if $game_switches[777]
stringOptions << "(Area)"
else
stringOptions << "(Global)"
end
answer = $game_switches[987] ? "On" : "Off"
stringOptions << "\nTrainers: " << answer
answer = $game_switches[955] ? "On" : "Off"
stringOptions << "\nStatic encounters: " << answer
answer = $game_switches[780] ? "On" : "Off"
stringOptions << "\nGift Pokémon: " << answer
answer = $game_switches[958] ? "On" : "Off"
stringOptions << "\nItems: " << answer
answer = $game_switches[959] ? "On" : "Off"
stringOptions << "\nTMs: " << answer
return stringOptions
end
def countVisitedMaps
count = 0
for i in 0..$PokemonGlobal.visitedMaps.length
count +=1 if $PokemonGlobal.visitedMaps[i]
end
return count
end
def Kernel.sumGameStats()
stringStats = ""
stringStats << "Seen " << $Trainer.pokedexSeen.to_s << " Pokémon"
stringStats << "\nCaught " << $Trainer.pokedexOwned.to_s << " Pokémon"
stringStats << "\nBeaten the Elite Four " << $game_variables[174].to_s << " times"
stringStats << "\nFused " << $game_variables[126].to_s << " Pokémon"
stringStats << "\nRematched " << $game_variables[162].to_s << " Gym Leaders"
stringStats << "\nTook " << $PokemonGlobal.stepcount.to_s << " steps"
stringStats << "\nVisited " << countVisitedMaps.to_s << " different areas"
if $game_switches[910]
stringStats << "\nMade " << $game_variables[164].to_s << " Wonder Trades"
end
stringStats << "\nTipped $" << $game_variables[100].to_s << " to clowns"
stringStats << "\nDestroyed " << $game_variables[163].to_s << " sandcastles"
if $game_variables[43] > 0 || $game_variables[44] >0
stringStats << "\nWon $" << $game_variables[43].to_s << " against gamblers"
stringStats << "\nLost $" << $game_variables[44].to_s << " against gamblers"
end
stringStats << "\nSpent $" << $game_variables[225].to_s << " at hotels"
stringStats << "\nAccepted " << $game_variables[96].to_s << " quests"
stringStats << "\nCompleted " << $game_variables[98].to_s << " quests"
stringStats << "\nDiscovered " << $game_variables[193].to_s << " secrets"
if $game_switches[912]
stringStats << "\nDied " << $game_variables[191].to_s << " times in Pikachu's adventure"
if $game_variables[193] >= 1
stringStats << "\nCollected " << $game_variables[194].to_s << " coins with Pikachu"
end
end
return stringStats
end
def Kernel.pbRandomizeTM()
tmList = []
for item in $itemData
#machine=$ItemData[item][ITEMMACHINE]
#movename=PBMoves.getName(machine)
#Kernel.pbMessage(_INTL("It contained {1}.\1",item))
tmList << item if pbIsHiddenMachine?(item)
end
end
def getNewSpecies(oldSpecies,bst_range=50, ignoreRivalPlaceholder = false, maxDexNumber = PBSpecies.maxValue )
return oldSpecies if (oldSpecies == RIVAL_STARTER_PLACEHOLDER_SPECIES && !ignoreRivalPlaceholder)
return oldSpecies if oldSpecies >= NUM_ZAPMOLCUNO
newspecies = rand(maxDexNumber - 1) + 1
newBST = Kernel.getBaseStats(newspecies)
originalBST = Kernel.getBaseStats(oldSpecies)
while bstOk(newspecies,oldSpecies,bst_range)
newspecies = rand(maxDexNumber - 1) + 1
newBST = Kernel.getBaseStats(newspecies)
end
return newspecies
end
def getNewCustomSpecies(oldSpecies,customSpeciesList,bst_range=50, ignoreRivalPlaceholder = false)
return oldSpecies if (oldSpecies == RIVAL_STARTER_PLACEHOLDER_SPECIES && !ignoreRivalPlaceholder)
return oldSpecies if oldSpecies >= NUM_ZAPMOLCUNO
i = rand(customSpeciesList.length - 1) + 1
newspecies = customSpeciesList[i]
newBST = Kernel.getBaseStats(newspecies)
originalBST = Kernel.getBaseStats(oldSpecies)
while bstOk(newspecies,oldSpecies,bst_range)
i = rand(customSpeciesList.length - 1)#+1
newspecies = customSpeciesList[i]
newBST = Kernel.getBaseStats(newspecies)
end
return newspecies
end
def playShuffleSE(i)
if i % 40 == 0 || i == 0
pbSEPlay("Charm",60)
end
end
def Kernel.pbShuffleTrainers(bst_range = 50)
randomTrainersHash = Hash.new
trainers=load_data("Data/trainers.dat")
i=0
for trainer in trainers
for poke in trainer[3]
poke[TPSPECIES]=getNewSpecies(poke[TPSPECIES])
end
randomTrainersHash[i] = (trainer)
playShuffleSE(i)
i += 1
if i % 2 == 0
n = (i.to_f/trainers.length)*100
Kernel.pbMessageNoSound(_INTL("\\ts[]Shuffling trainers...\\n {1}%\\^",sprintf('%.2f', n),PBSpecies.maxValue))
end
#Kernel.pbMessage(_INTL("pushing trainer {1}: {2} ",i,trainer))
end
$PokemonGlobal.randomTrainersHash = randomTrainersHash
end
def Kernel.pbShuffleTrainersCustom()(bst_range = 50)
randomTrainersHash = Hash.new
Kernel.pbMessage(_INTL("Parsing custom sprites folder"))
customsList = getCustomSpeciesList()
Kernel.pbMessage(_INTL("{1} Pokémon found",customsList.length.to_s))
if customsList.length == 0
Kernel.pbMessage(_INTL("To use custom sprites, please place correctly named sprites in the /CustomBattlers folder. See readMe.txt for more information"))
Kernel.pbMessage(_INTL("Trainer Pokémon will include auto-generated sprites."))
return Kernel.pbShuffleTrainers(bst_range)
elsif customsList.length < 200
if Kernel.pbConfirmMessage(_INTL("Too few custom sprites were found. This will result in a very low Pokémon variety for trainers. Continue anyway?"))
bst_range=999
else
Kernel.pbMessage(_INTL("Trainer Pokémon will include auto-generated sprites."))
return Kernel.pbShuffleTrainers(bst_range)
end
end
##use regular shuffle if not enough sprites
trainers=load_data("Data/trainers.dat")
i=0
for trainer in trainers
for poke in trainer[3]
poke[TPSPECIES]=getNewCustomSpecies(poke[TPSPECIES],customsList)
end
randomTrainersHash[i] = (trainer)
playShuffleSE(i)
i += 1
if i % 2 == 0
n = (i.to_f/trainers.length)*100
Kernel.pbMessageNoSound(_INTL("\\ts[]Shuffling trainers (custom sprites only)...\\n {1}%\\^",sprintf('%.2f', n),PBSpecies.maxValue))
end
#Kernel.pbMessage(_INTL("pushing trainer {1}: {2} ",i,trainer))
end
$PokemonGlobal.randomTrainersHash = randomTrainersHash
end
#def getRandomCustomSprite()
# filesList = Dir["./Graphics/CustomBattlers/*"]
# i = rand(filesList.length-1)
# path = filesList[i]
# file = File.basename(path, ".*")
# splitPoke = file.split(".")
# head = splitPoke[0].to_i
# body = splitPoke[1].to_i
# return (body*NB_POKEMON)+head
#end
def getCustomSpeciesList()
filesList = Dir["./Graphics/CustomBattlers/*"]
speciesList = []
maxDexNumber = (NB_POKEMON * NB_POKEMON) + NB_POKEMON
maxVal = filesList.length-1
for i in 0..maxVal
path = filesList[i]
file = File.basename(path, ".*")
splitPoke = file.split(".")
head = splitPoke[0].to_i
body = splitPoke[1].to_i
fused = (body*NB_POKEMON)+head
if fused <= maxDexNumber && fused > 0
speciesList << fused
end
end
return speciesList
end
def Kernel.getBaseStats(species)
if $pkmn_dex[species] == nil
print species
end
basestatsum = $pkmn_dex[species][5][0] # HP
basestatsum +=$pkmn_dex[species][5][1] # Attack
basestatsum +=$pkmn_dex[species][5][2] # Defense
basestatsum +=$pkmn_dex[species][5][3] # Speed
basestatsum +=$pkmn_dex[species][5][4] # Special Attack
basestatsum +=$pkmn_dex[species][5][5] # Special Defense
return basestatsum
end
def Kernel.gymLeaderRematchHint()
hints = [
"I heard that Brock has a huge interest in Pokémon fossils. He donated a lot of fossils he excavated to the Pewter City Museum.",
"Misty is a pro at swimming. I heard she trains every single morning.",
"Did you know that Lt. Surge used the magnetic fields generated by his Pokémon to navigate his plane back when he was in the army. He still loves a good magnetic field.",
"Erika is a lover of nature. She loves going to parks to relax during the day.",
"Koga has been seen leaving Fuschia city in the evenings. The rumors say he's preparing for a new job somewhere else...",
"People say that Sabrina never sleeps. I wonder where she goes when she leaves her gym at night.",
"The hot-headed Blaine is a man of extremes. He likes to explore around his hometown during the day.",
"Giovanni is a mysterious man. I wonder where he goes in the evening. Probably somewhere as remote as possible to meditate in peace...",
"I heard that Whitney went to school in one of the towns near Goldenrod before becoming a Gym Leader. She kept in touch with her old teacher and she goes to visit sometimes in the evening.",
"Kurt is always on the lookout for Bug-type Pokémon. He goes hunting early in the morning.",
"Falkner rises up early in the morning. You can usually find him in high places.",
"Clair is a member of a famous clan of dragon masters. She goes to a special place to pray at night.",
"Chuck is a martial arts pro. I've seen him train with Saffron City's dojo master back in the days.",
"Morty is a mysterious man. He's been known to be one of the few people who dare enter Pokémon Tower at night.",
"Pryce is an ice-type expert who has been around for a long time. He used to train in the Ice Tunnel between Mahogany Town and Blackthorn City before it froze over.",
"Jasmine is on vacation in the Sevii Islands. She likes to rise up early to explore around the islands when no one's around."
]
arr = []
n=0
for i in 426..437
if !$game_switches[i]
arr.push(n)
end
n+=1
end
arr.push(508); arr.push(509); arr.push(510); arr.push(511);
n+=4
if arr.length > 0
return hints[arr[rand(arr.length)]]
end
return "You got every Gym Leader to come here. This place is more popular than ever!\nNow go and battle them!"
end
def getTrainerParty(trainer)
if $game_switches[47]
for poke in trainer[3]
inverseFusion(poke)
end
end
return trainer[3]
end
def inverseFusion(pokemon)
species=pokemon[TPSPECIES]
return pokemon if species <= CONST_NB_POKE
return pokemon if species > (CONST_NB_POKE * CONST_NB_POKE) + CONST_NB_POKE
body = getBasePokemonID(species,true)
head = getBasePokemonID(species,false)
newspecies = (head)*CONST_NB_POKE+body
pokemon[TPSPECIES] = newspecies
return pokemon
end
def addRandomHeldItems(trainerParty)
for poke in trainerParty
if poke.item == nil
poke.item = PBItems::ORANBERRY#PBItems.sample
end
end
end
def addHealingItem(items)
if $Trainer.numbadges < 1
items << PBItems::ORANBERRY
elsif $Trainer.numbadges <=2
items << PBItems::POTION
elsif $Trainer.numbadges <=4
items << PBItems::SUPERPOTION
elsif $Trainer.numbadges <=6
items << PBItems::FULLHEAL
items << PBItems::SUPERPOTION
elsif $Trainer.numbadges <= 8
items << PBItems::FULLHEAL
items << PBItems::HYPERPOTION
elsif $Trainer.numbadges >= 9
items << PBItems::FULLRESTORE
end
return items
end
#####Overload de pbLoadTrainer
def pbLoadTrainer(trainerid,trainername,partyid=0)
if trainerid.is_a?(String) || trainerid.is_a?(Symbol)
if !hasConst?(PBTrainers,trainerid)
raise _INTL("Trainer type does not exist ({1}, {2}, ID {3})",trainerid,trainername,partyid)
end
trainerid=getID(PBTrainers,trainerid)
end
success=false
items=[]
party=[]
opponent=nil
trainers=load_data("Data/trainers.dat")
trainerIndex=-1
for trainer in trainers
trainerIndex+=1
name=trainer[1]
thistrainerid=trainer[0]
thispartyid=trainer[4]
next if trainerid!=thistrainerid || name!=trainername || partyid!=thispartyid
items=trainer[2].clone
if $game_switches[666] #hard mode
items = addHealingItem(items)
end
name=pbGetMessageFromHash(MessageTypes::TrainerNames,name)
for i in RIVALNAMES
if isConst?(trainerid,PBTrainers,i[0]) && $game_variables[i[1]]!=0
name=$game_variables[i[1]]
end
end
opponent=PokeBattle_Trainer.new(name,thistrainerid)
opponent.setForeignID($Trainer) if $Trainer
#use le random Array si randomized starters (et pas 1ere rival battle)
isPlayingRandomized = $game_switches[987] && !$game_switches[46]
if isPlayingRandomized && $PokemonGlobal.randomTrainersHash[trainerIndex] == nil
Kernel.pbMessage(_INTL("The trainers need to be re-shuffled."))
Kernel.pbShuffleTrainers()
end
trainerParty = isPlayingRandomized ? $PokemonGlobal.randomTrainersHash[trainerIndex][3] : getTrainerParty(trainer)
isRematch = $game_switches[200]
rematchId = getRematchId(trainername,trainerid)
for poke in trainerParty
##
species=poke[TPSPECIES]
species = replaceRivalStarterIfNecessary(species)
level= $game_switches[666] ? (poke[TPLEVEL]*1.1).ceil : poke[TPLEVEL]
if isRematch
nbRematch = getNumberRematch(rematchId)
level = getRematchLevel(level,nbRematch)
species = evolveRematchPokemon(nbRematch,species)
end
pokemon=PokeBattle_Pokemon.new(species,level,opponent)
#pokemon.form=poke[TPFORM]
pokemon.resetMoves
pokemon.setItem( $game_switches[843] ? rand(PBItems.maxValue) : poke[TPITEM])
if poke[TPMOVE1]>0 || poke[TPMOVE2]>0 || poke[TPMOVE3]>0 || poke[TPMOVE4]>0
k=0
for move in [TPMOVE1,TPMOVE2,TPMOVE3,TPMOVE4]
pokemon.moves[k]=PBMove.new(poke[move])
k+=1
end
pokemon.moves.compact!
end
pokemon.setAbility(poke[TPABILITY])
pokemon.setGender(poke[TPGENDER])
if poke[TPSHINY] # if this is a shiny Pokémon
pokemon.makeShiny
else
pokemon.makeNotShiny
end
pokemon.setNature(poke[TPNATURE])
iv=poke[TPIV]
for i in 0...6
pokemon.iv[i]=iv&0x1F
pokemon.ev[i]=[85,level*3/2].min
end
pokemon.happiness=poke[TPHAPPINESS]
pokemon.name=poke[TPNAME] if poke[TPNAME] && poke[TPNAME]!=""
if poke[TPSHADOW] # if this is a Shadow Pokémon
pokemon.makeShadow rescue nil
pokemon.pbUpdateShadowMoves(true) rescue nil
pokemon.makeNotShiny
end
pokemon.ballused=poke[TPBALL]
pokemon.calcStats
party.push(pokemon)
end
success=true
break
end
return success ? [opponent,items,party] : nil
end
def getRematchId(trainername, trainerid)
return trainername + trainerid.to_s
end
def replaceRivalStarterIfNecessary(species)
if species == RIVAL_STARTER_PLACEHOLDER_SPECIES
if !$game_switches[840] || pbGet(250) == 0#not DEFINED_RIVAL_STARTER
fixRivalStarter()
end
rivalStarter = pbGet(250)
if rivalStarter > 0
species = pbGet(250)
end
end
return species
end
def fixRivalStarter()
#set starter baseform
if $PokemonGlobal.psuedoBSTHash == nil
psuedoHash = Hash.new
for i in 0..NB_POKEMON
psuedoHash[i] = i
end
$PokemonGlobal.psuedoBSTHash = psuedoHash
end
starterChoice = pbGet(7)
s1 = $PokemonGlobal.psuedoBSTHash[1]
s2 = $PokemonGlobal.psuedoBSTHash[4]
s3= $PokemonGlobal.psuedoBSTHash[7]
setRivalStarter(s3,s2,s1,starterChoice)
#evolve en fct des badges
rivalStarter = pbGet(250)
if $game_switches[68] #beat blue cerulean
rivalStarter = evolveBody(rivalStarter)
end
if $game_switches[89] #beat blue SS Anne
rivalStarter = evolveHead(rivalStarter)
end
if $game_switches[228] #beat silph co
rivalStarter = evolveBody(rivalStarter)
end
if $game_switches[11] #got badge 8
rivalStarter = evolveHead(rivalStarter)
end
if $game_switches[12] #beat league
rivalStarter = evolveBody(rivalStarter)
rivalStarter = evolveHead(rivalStarter)
end
#RIVAL_STARTER_IS_DEFINED
pbSet(250,rivalStarter)
$game_switches[840] = true
end

View File

@@ -0,0 +1,169 @@
class PokemonGlobalMetadata
attr_accessor :psuedoHash
attr_accessor :psuedoBSTHash
attr_accessor :pseudoBSTHashTrainers
attr_accessor :randomTrainersHash
alias random_init initialize
def initialize
random_init
@psuedoHash=nil
@psuedoBSTHash=nil
end
end
##############
# randomizer shuffle
# ##############
def Kernel.pbShuffleDex(range=50,type=0)
$game_switches[855] = true # Randomized at least once
#type 0: BST
#type 1: full random
#type: 2 by route (not implemented)
range = 1 if range == 0
# create hash
psuedoHash = Hash.new
psuedoBSTHash = Hash.new
#Create array of all pokemon dex numbers
pokeArray = []
monLimit = type == 1 ? PBSpecies.maxValue : NB_POKEMON-1
for i in 1..monLimit
pokeArray.push(i)
end
#randomize hash
pokeArrayRand = pokeArray.dup
pokeArrayRand.shuffle!
pokeArray.insert(0,nil)
######
#on remet arceus a la fin
pokeArray.push(NB_POKEMON)
# fill random hash
#random hash will have to be accessed by number, not internal name
for i in 1...pokeArrayRand.length
psuedoHash[i]=pokeArrayRand[i]
end
#use pokeArrayRand to fill in the BST hash also
#loop through the actual dex, and use the first mon in pokeArrayRand with
#BST in the same 100 range
for i in 1..NB_POKEMON-1#pas de arceus
baseStats=$pkmn_dex[i][5]
baseStat_target = 0
for k in 0...baseStats.length
baseStat_target+=baseStats[k]
end
baseStat_target = (baseStat_target/range).floor
for j in 1...pokeArrayRand.length
baseStats=$pkmn_dex[pokeArrayRand[j]][5]
baseStat_temp = 0
for l in 0...baseStats.length
baseStat_temp+=baseStats[l]
end
baseStat_temp = (baseStat_temp/range).floor
playShuffleSE(i)
#if a match, add to hash, remove from array, and cycle to next poke in dex
if (baseStat_temp == baseStat_target)
psuedoBSTHash[i]=pokeArrayRand[j]
pokeArrayRand.delete(pokeArrayRand[j])
if i % 2 == 0 && type == 1
n = (i.to_f/NB_POKEMON)*100
Kernel.pbMessageNoSound(_INTL("\\ts[]Shuffling wild Pokémon...\\n {1}%\\^",sprintf('%.2f', n),NB_POKEMON))
end
break
end
end
end
psuedoBSTHash[NB_POKEMON] = NB_POKEMON
#add hashes to global data
$PokemonGlobal.psuedoHash = psuedoHash
$PokemonGlobal.psuedoBSTHash = psuedoBSTHash
end
def isPartArceus(poke,type=0)
return true if poke == NB_POKEMON
if type == 1
return true if getBasePokemonID(poke,true) == NB_POKEMON
return true if getBasePokemonID(poke,false) == NB_POKEMON
end
return false
end
#ajoute x happiness a tous les party member
def Kernel.raisePartyHappiness(increment)
return
# for poke in $Trainer.party
# next if poke.isEgg?
# poke.happiness += increment
# end
end
def Kernel.pbShuffleDexTrainers()
# create hash
psuedoHash = Hash.new
psuedoBSTHash = Hash.new
#Create array of all pokemon dex numbers
pokeArray = []
for i in 1..PBSpecies.maxValue
pokeArray.push(i)
end
#randomize hash
pokeArrayRand = pokeArray.dup
pokeArrayRand.shuffle!
pokeArray.insert(0,nil)
# fill random hash
#random hash will have to be accessed by number, not internal name
for i in 1...pokeArrayRand.length
psuedoHash[i]=pokeArrayRand[i]
end
#use pokeArrayRand to fill in the BST hash also
#loop through the actual dex, and use the first mon in pokeArrayRand with
#BST in the same 100 range
for i in 1..PBSpecies.maxValue
if i % 20 == 0
n = (i.to_f/PBSpecies.maxValue)*100
#Kernel.pbMessage(_INTL("\\ts[]Shuffling...\\n {1}%\\^",sprintf('%.2f', n),PBSpecies.maxValue))
end
baseStats=$pkmn_dex[i][I]
baseStat_target = 0
for k in 0...baseStats.length
baseStat_target+=baseStats[k]
end
baseStat_target = (baseStat_target/50).floor
for j in 1...pokeArrayRand.length
baseStats=$pkmn_dex[pokeArrayRand[j]][5]
baseStat_temp = 0
for l in 0...baseStats.length
baseStat_temp+=baseStats[l]
end
baseStat_temp = (baseStat_temp/50).floor
#if a match, add to hash, remove from array, and cycle to next poke in dex
if baseStat_temp == baseStat_target
psuedoBSTHash[i]=pokeArrayRand[j]
pokeArrayRand.delete(pokeArrayRand[j])
break
end
end
end
#add hashes to global data0
#$PokemonGlobal.psuedoHash = psuedoHash
$PokemonGlobal.pseudoBSTHashTrainers = psuedoBSTHash
end

View File

@@ -0,0 +1,705 @@
=begin
#==============================================================================#
# Better Region Map #
# by Marin #
#==============================================================================#
# This region map is smoother and allows you to use region maps larger than #
# 480x320. #
# #
# This resource also comes with a new townmapgen.html to support for the #
# larger images. #
#==============================================================================#
# This region map does NOT support hidden islands such as Berth or Faraday. #
#==============================================================================#
# Please give credit when using this. #
#==============================================================================#
def pbBetterRegionMap(region = nil, show_player = true, can_fly = false)
if region == nil
mapData = pbGetMetadata($game_map.map_id,MetadataMapPosition)
if mapData != nil && mapData.length >= 1
region = mapData[0]
else
region = 0
end
end
scene = BetterRegionMap.new(region, show_player, can_fly)
return scene.flydata
end
class PokemonGlobalMetadata
attr_writer :regionMapSel
attr_writer :region
def regionMapSel
@regionMapSel ||= [0, 0]
return @regionMapSel
end
def region
@region ||= 0
return @region
end
end
class BetterRegionMap
CursorAnimateDelay = 12.0
CursorMoveSpeed = 4
TileWidth = 16.0
TileHeight = 16.0
MAP_MARGIN = 10
FlyPointAnimateDelay = 20.0
attr_reader :flydata
def initialize(region = nil, show_player = true, can_fly = false)
showBlk()
@region = 0#region || $PokemonGlobal.region
@show_player = show_player
@can_fly = can_fly
@data = load_data('Data/townmap.dat')[@region]
@viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z = 99999
@mapvp = Viewport.new(16,32,480,320)
@mapvp.z = 100000
@viewport2 = Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport2.z = 100001
@sprites = SpriteHash.new
@sprites["bg"] = Sprite.new(@viewport)
@sprites["bg"].bmp("Graphics/Pictures/mapbg")
@window = SpriteHash.new
@window["map"] = Sprite.new(@mapvp)
@window["map"].bmp("Graphics/Pictures/#{@data[1]}")
@sprites["cursor"] = Sprite.new(@viewport2)
@sprites["cursor"].bmp("Graphics/Pictures/mapCursor")
@sprites["cursor"].src_rect.width = @sprites["cursor"].bmp.height
@sprites["cursor"].x = 16 + TileWidth * $PokemonGlobal.regionMapSel[0]
@sprites["cursor"].y = 32 + TileHeight * $PokemonGlobal.regionMapSel[1]
@sprites["cursor"].z = 11
@sprites["cursor"].ox = (@sprites["cursor"].bmp.height - TileWidth) / 2.0
@sprites["cursor"].oy = @sprites["cursor"].ox
@window["player"] = Sprite.new(@mapvp)
if @show_player
player = nil
player = pbGetMetadata($game_map.map_id, MetadataMapPosition) if $game_map
if player && player[0] == @region
gender = $Trainer.gender.to_digits(3)
@window["player"].bmp("Graphics/Pictures/mapPlayer#{gender}")
@window["player"].x = TileWidth * player[1] + (TileWidth / 2.0)
@window["player"].y = TileHeight * player[2] + (TileHeight / 2.0)
@window["player"].center_origins
end
end
@sprites["txt"] = TextSprite.new(@viewport)
@sprites["arrowLeft"] = Sprite.new(@viewport2)
@sprites["arrowLeft"].bmp("Graphics/Pictures/mapArrowRight")
@sprites["arrowLeft"].mirror = true
@sprites["arrowLeft"].center_origins
@sprites["arrowLeft"].xyz = 12, Graphics.height / 2
@sprites["arrowRight"] = Sprite.new(@viewport2)
@sprites["arrowRight"].bmp("Graphics/Pictures/mapArrowRight")
@sprites["arrowRight"].center_origins
@sprites["arrowRight"].xyz = Graphics.width - 12, Graphics.height / 2
@sprites["arrowUp"] = Sprite.new(@viewport2)
@sprites["arrowUp"].bmp("Graphics/Pictures/mapArrowDown")
@sprites["arrowUp"].angle = 180
@sprites["arrowUp"].center_origins
@sprites["arrowUp"].xyz = Graphics.width / 2, 24
@sprites["arrowDown"] = Sprite.new(@viewport2)
@sprites["arrowDown"].bmp("Graphics/Pictures/mapArrowDown")
@sprites["arrowDown"].center_origins
@sprites["arrowDown"].xyz = Graphics.width / 2, Graphics.height - 24
update_text
@dirs = []
@mdirs = []
@i = 0
if can_fly
@spots = {}
n = 0
for x in 0...(@window["map"].bmp.width / TileWidth)
for y in 0...(@window["map"].bmp.height / TileHeight)
healspot = pbGetHealingSpot(x,y)
if healspot && $PokemonGlobal.visitedMaps[healspot[0]]
@window["point#{n}"] = Sprite.new(@mapvp)
@window["point#{n}"].bmp("Graphics/Pictures/mapFly")
@window["point#{n}"].src_rect.width = @window["point#{n}"].bmp.height
@window["point#{n}"].x = TileWidth * x + (TileWidth / 2)
@window["point#{n}"].y = TileHeight * y + (TileHeight / 2)
@window["point#{n}"].oy = @window["point#{n}"].bmp.height / 2.0
@window["point#{n}"].ox = @window["point#{n}"].oy
@spots[[x, y]] = healspot
n += 1
end
end
end
end
initWindowPosition(region)
#if region == nil
#end
hideBlk { update(false) }
main
end
def initWindowPosition(region=0)
x, y = 0
if region == 2 #sevii islands
x=-250
y=-200
elsif region == 1 #johto
x=0
y=0
else #kanto
x=-250
y=0
end
updateWindowPosition(x,y)
end
#@hor_count = position du pointer
def updateWindowPosition(x,y)
@window.x = x
@window.y = y
# @hor_count = 0#x
# @ver_count = 0#y
@sprites["cursor"].x = 16 + TileWidth * $PokemonGlobal.regionMapSel[0] + @window.x
@sprites["cursor"].y = 32 + TileWidth * $PokemonGlobal.regionMapSel[1] + @window.y
end
def pbGetHealingSpot(x,y)
return nil if !@data[2]
for loc in @data[2]
if loc[0] == x && loc[1] == y
if !loc[4] || !loc[5] || !loc[6]
return nil
else
return [loc[4],loc[5],loc[6]]
end
end
end
return nil
end
def main
loop do
update
if Input.press?(Input::RIGHT) && ![4,6].any? { |e| @dirs.include?(e) || @mdirs.include?(e) }
if @sprites["cursor"].x < 480
$PokemonGlobal.regionMapSel[0] += 1
@sx = @sprites["cursor"].x
@dirs << 6
elsif @window.x > -1 * (@window["map"].bmp.width - 480)
$PokemonGlobal.regionMapSel[0] += 1
@mx = @window.x
@mdirs << 6
end
end
if Input.press?(Input::LEFT) && ![4,6].any? { |e| @dirs.include?(e) || @mdirs.include?(e) }
if @sprites["cursor"].x > 16
$PokemonGlobal.regionMapSel[0] -= 1
@sx = @sprites["cursor"].x
@dirs << 4
elsif @window.x < 0
$PokemonGlobal.regionMapSel[0] -= 1
@mx = @window.x
@mdirs << 4
end
end
if Input.press?(Input::DOWN) && ![2,8].any? { |e| @dirs.include?(e) || @mdirs.include?(e) }
if @sprites["cursor"].y <= 320
$PokemonGlobal.regionMapSel[1] += 1
@sy = @sprites["cursor"].y
@dirs << 2
elsif @window.y > -1 * (@window["map"].bmp.height - 320)
$PokemonGlobal.regionMapSel[1] += 1
@my = @window.y
@mdirs << 2
end
end
if Input.press?(Input::UP) && ![2,8].any? { |e| @dirs.include?(e) || @mdirs.include?(e) }
if @sprites["cursor"].y > 32
$PokemonGlobal.regionMapSel[1] -= 1
@sy = @sprites["cursor"].y
@dirs << 8
elsif @window.y < 0
$PokemonGlobal.regionMapSel[1] -= 1
@my = @window.y
@mdirs << 8
end
end
if Input.trigger?(Input::C)
x, y = $PokemonGlobal.regionMapSel
if @spots && @spots[[x, y]]
@flydata = @spots[[x, y]]
break
end
end
break if Input.trigger?(Input::B)
end
dispose
end
def update(update_gfx = true)
@sprites["arrowLeft"].visible = @window.x < 0 -MAP_MARGIN
@sprites["arrowRight"].visible = @window.x > -1 * (@window["map"].bmp.width - 480) +MAP_MARGIN
@sprites["arrowUp"].visible = @window.y < 0 - MAP_MARGIN
@sprites["arrowDown"].visible = @window.y > -1 * (@window["map"].bmp.height - 320) +MAP_MARGIN
if update_gfx
Graphics.update
Input.update
end
@i += 1
if @i % CursorAnimateDelay == 0
@sprites["cursor"].src_rect.x += @sprites["cursor"].src_rect.width
@sprites["cursor"].src_rect.x = 0 if @sprites["cursor"].src_rect.x >= @sprites["cursor"].bmp.width
end
if @i % FlyPointAnimateDelay == 0
@window.keys.each do |e|
next unless e.to_s.starts_with?("point")
@window[e].src_rect.x += @window[e].src_rect.width
@window[e].src_rect.x = 0 if @window[e].src_rect.x >= @window[e].bmp.width
end
end
if @i % 2 == 0
case @i % 32
when 0...8
@sprites["arrowLeft"].x -= 1
@sprites["arrowRight"].x += 1
@sprites["arrowUp"].y -= 1
@sprites["arrowDown"].y += 1
when 8...24
@sprites["arrowLeft"].x += 1
@sprites["arrowRight"].x -= 1
@sprites["arrowUp"].y += 1
@sprites["arrowDown"].y -= 1
when 24...32
@sprites["arrowLeft"].x -= 1
@sprites["arrowRight"].x += 1
@sprites["arrowUp"].y -= 1
@sprites["arrowDown"].y += 1
end
end
# Cursor movement
if @dirs.include?(6)
@hor_count ||= 0
@hor_count += 1
update_text if @hor_count == (CursorMoveSpeed / 2.0).round
@sprites["cursor"].x = @sx + (TileWidth / CursorMoveSpeed.to_f) * @hor_count
if @hor_count == CursorMoveSpeed
@dirs.delete(6)
@hor_count = nil
@sx = nil
end
end
if @dirs.include?(4)
@hor_count ||= 0
@hor_count += 1
update_text if @hor_count == (CursorMoveSpeed / 2.0).round
@sprites["cursor"].x = @sx - (TileWidth / CursorMoveSpeed.to_f) * @hor_count
if @hor_count == CursorMoveSpeed
@dirs.delete(4)
@hor_count = nil
@sx = nil
end
end
if @dirs.include?(8)
@ver_count ||= 0
@ver_count += 1
update_text if @ver_count == (CursorMoveSpeed / 2.0).round
@sprites["cursor"].y = @sy - (TileHeight / CursorMoveSpeed.to_f) * @ver_count
if @ver_count == CursorMoveSpeed
@dirs.delete(8)
@ver_count = nil
@sy = nil
end
end
if @dirs.include?(2)
@ver_count ||= 0
@ver_count += 1
update_text if @ver_count == (CursorMoveSpeed / 2.0).round
@sprites["cursor"].y = @sy + (TileHeight / CursorMoveSpeed.to_f) * @ver_count
if @ver_count == CursorMoveSpeed
@dirs.delete(2)
@ver_count = nil
@sy = nil
end
end
# Map movement
if @mdirs.include?(6)
@hor_count ||= 0
@hor_count += 1
update_text if @hor_count == (CursorMoveSpeed / 2.0).round
@window.x = @mx - (TileWidth / CursorMoveSpeed.to_f) * @hor_count
if @hor_count == CursorMoveSpeed
@mdirs.delete(6)
@hor_count = nil
@mx = nil
end
end
if @mdirs.include?(4)
@hor_count ||= 0
@hor_count += 1
update_text if @hor_count == (CursorMoveSpeed / 2.0).round
@window.x = @mx + (TileWidth / CursorMoveSpeed.to_f) * @hor_count
if @hor_count == CursorMoveSpeed
@mdirs.delete(4)
@hor_count = nil
@mx = nil
end
end
if @mdirs.include?(8)
@ver_count ||= 0
@ver_count += 1
update_text if @ver_count == (CursorMoveSpeed / 2.0).round
@window.y = @my + (TileHeight / CursorMoveSpeed.to_f) * @ver_count
if @ver_count == CursorMoveSpeed
@mdirs.delete(8)
@ver_count = nil
@my = nil
end
end
if @mdirs.include?(2)
@ver_count ||= 0
@ver_count += 1
update_text if @ver_count == (CursorMoveSpeed / 2.0).round
@window.y = @my - (TileHeight / CursorMoveSpeed.to_f) * @ver_count
if @ver_count == CursorMoveSpeed
@mdirs.delete(2)
@ver_count = nil
@my = nil
end
end
end
def update_text
location = @data[2].find do |e|
e[0] == $PokemonGlobal.regionMapSel[0] &&
e[1] == $PokemonGlobal.regionMapSel[1]
end
text = ""
text = location[2] if location
poi = ""
poi = location[3] if location && location[3]
@sprites["txt"].draw([
[pbGetMessage(MessageTypes::RegionNames,@region), 16, 0, 0,
Color.new(255,255,255), Color.new(0,0,0)],
[text, 16, 354, 0, Color.new(255,255,255), Color.new(0,0,0)],
[poi, 496, 354, 1, Color.new(255,255,255), Color.new(0,0,0)]
], true)
end
def dispose
showBlk { update(false) }
@sprites.dispose
@window.dispose
@viewport.dispose
@viewport2.dispose
@mapvp.dispose
hideBlk
Input.update
end
end
#==============================================================================#
# Overwrites some old methods to use the new region map #
#==============================================================================#
#ItemHandlers::UseInField.add(:TOWNMAP,proc{|item|
# pbBetterRegionMap
# next 1
#})
class PokemonPartyScreen
def pbPokemonScreen
@scene.pbStartScene(@party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."),nil)
loop do
@scene.pbSetHelpText((@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
pkmnid = @scene.pbChoosePokemon(false, -1, 1)
break if (pkmnid.is_a?(Numeric) && pkmnid < 0) || (pkmnid.is_a?(Array) && pkmnid[1] < 0)
if pkmnid.is_a?(Array) && pkmnid[0] == 1 # Switch
@scene.pbSetHelpText(_INTL("Move to where?"))
oldpkmnid = pkmnid[1]
pkmnid = @scene.pbChoosePokemon(true, -1, 2)
if pkmnid >= 0 && pkmnid != oldpkmnid
pbSwitch(oldpkmnid, pkmnid)
end
next
end
pkmn = @party[pkmnid]
commands = []
cmdSummary = -1
cmdDebug = -1
cmdMoves = [-1,-1,-1,-1]
cmdSwitch = -1
cmdMail = -1
cmdItem = -1
# Build the commands
commands[cmdSummary = commands.length] = _INTL("Summary")
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
for i in 0...pkmn.moves.length
move = pkmn.moves[i]
# Check for hidden moves and add any that were found
if !pkmn.egg? && (isConst?(move.id,PBMoves,:MILKDRINK) ||
isConst?(move.id,PBMoves,:SOFTBOILED) ||
HiddenMoveHandlers.hasHandler(move.id))
commands[cmdMoves[i] = commands.length] = [PBMoves.getName(move.id),1]
end
end
commands[cmdSwitch = commands.length] = _INTL("Switch") if @party.length>1
if !pkmn.egg?
if pkmn.mail
commands[cmdMail = commands.length] = _INTL("Mail")
else
commands[cmdItem = commands.length] = _INTL("Item")
end
end
commands[commands.length] = _INTL("Cancel")
command = @scene.pbShowCommands(_INTL("Do what with {1}?",pkmn.name),commands)
havecommand = false
for i in 0...4
if cmdMoves[i] >= 0 && command == cmdMoves[i]
havecommand = true
if isConst?(pkmn.moves[i].id,PBMoves,:SOFTBOILED) ||
isConst?(pkmn.moves[i].id,PBMoves,:MILKDRINK)
amt = [(pkmn.totalhp/5).floor,1].max
if pkmn.hp <= amt
pbDisplay(_INTL("Not enough HP..."))
break
end
@scene.pbSetHelpText(_INTL("Use on which Pokémon?"))
oldpkmnid = pkmnid
loop do
@scene.pbPreSelect(oldpkmnid)
pkmnid = @scene.pbChoosePokemon(true, pkmnid)
break if pkmnid < 0
newpkmn = @party[pkmnid]
movename = PBMoves.getName(pkmn.moves[i].id)
if pkmnid == oldpkmnid
pbDisplay(_INTL("{1} can't use {2} on itself!",pkmn.name,movename))
elsif newpkmn.egg?
pbDisplay(_INTL("{1} can't be used on an Egg!",movename))
elsif newpkmn.hp == 0 || newpkmn.hp == newpkmn.totalhp
pbDisplay(_INTL("{1} can't be used on that Pokémon.",movename))
else
pkmn.hp -= amt
hpgain = pbItemRestoreHP(newpkmn,amt)
@scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",newpkmn.name,hpgain))
pbRefresh
end
break if pkmn.hp <= amt
end
@scene.pbSelect(oldpkmnid)
pbRefresh
break
elsif Kernel.pbCanUseHiddenMove?(pkmn,pkmn.moves[i].id)
if Kernel.pbConfirmUseHiddenMove(pkmn,pkmn.moves[i].id)
@scene.pbEndScene
if isConst?(pkmn.moves[i].id,PBMoves,:FLY)
###############################################
ret = pbBetterRegionMap(nil, true, true)
if ret
$PokemonTemp.flydata = ret
return [pkmn,pkmn.moves[i].id]
end
@scene.pbStartScene(@party,
(@party.length > 1) ? _INTL("Choose a Pokémon.") : _INTL("Choose Pokémon or cancel."))
break
###############################################
end
return [pkmn,pkmn.moves[i].id]
end
else
break
end
end
end
next if havecommand
if cmdSummary >= 0 && command == cmdSummary
@scene.pbSummary(pkmnid)
elsif cmdDebug >= 0 && command == cmdDebug
pbPokemonDebug(pkmn,pkmnid)
elsif cmdSwitch >= 0 && command == cmdSwitch
@scene.pbSetHelpText(_INTL("Move to where?"))
oldpkmnid = pkmnid
pkmnid = @scene.pbChoosePokemon(true)
if pkmnid >= 0 && pkmnid != oldpkmnid
pbSwitch(oldpkmnid, pkmnid)
end
elsif cmdMail >= 0 && command == cmdMail
command = @scene.pbShowCommands(_INTL("Do what with the mail?"),
[_INTL("Read"),_INTL("Take"),_INTL("Cancel")])
case command
when 0 # Read
pbFadeOutIn(99999){ pbDisplayMail(pkmn.mail,pkmn) }
when 1 # Take
if pbTakeItemFromPokemon(pkmn, self)
pbRefreshSingle(pkmnid)
end
end
elsif cmdItem >= 0 && command == cmdItem
itemcommands = []
cmdUseItem = -1
cmdGiveItem = -1
cmdTakeItem = -1
cmdMoveItem = -1
# Build the commands
itemcommands[cmdUseItem=itemcommands.length] = _INTL("Use")
itemcommands[cmdGiveItem=itemcommands.length] = _INTL("Give")
itemcommands[cmdTakeItem=itemcommands.length] = _INTL("Take") if pkmn.hasItem?
itemcommands[cmdMoveItem=itemcommands.length] = _INTL("Move") if pkmn.hasItem? && !pbIsMail?(pkmn.item)
itemcommands[itemcommands.length] = _INTL("Cancel")
command = @scene.pbShowCommands(_INTL("Do what with an item?"),itemcommands)
if cmdUseItem >= 0 && command == cmdUseItem # Use
item = @scene.pbUseItem($PokemonBag, pkmn)
if item>0
pbUseItemOnPokemon(item,pkmn,self)
pbRefreshSingle(pkmnid)
end
elsif cmdGiveItem >= 0 && command == cmdGiveItem # Give
item = @scene.pbChooseItem($PokemonBag)
if item > 0
if pbGiveItemToPokemon(item, pkmn, self, pkmnid)
pbRefreshSingle(pkmnid)
end
end
elsif cmdTakeItem >= 0 && command == cmdTakeItem # Take
if pbTakeItemFromPokemon(pkmn, self)
pbRefreshSingle(pkmnid)
end
elsif cmdMoveItem >= 0 && command == cmdMoveItem # Move
item = pkmn.item
itemname = PBItems.getName(item)
@scene.pbSetHelpText(_INTL("Move {1} to where?",itemname))
oldpkmnid = pkmnid
loop do
@scene.pbPreSelect(oldpkmnid)
pkmnid = @scene.pbChoosePokemon(true, pkmnid)
break if pkmnid < 0
newpkmn = @party[pkmnid]
if pkmnid == oldpkmnid
break
elsif newpkmn.egg?
pbDisplay(_INTL("Eggs can't hold items."))
elsif !newpkmn.hasItem?
newpkmn.setItem(item)
pkmn.setItem(0)
@scene.pbClearSwitching
pbRefresh
pbDisplay(_INTL("{1} was given the {2} to hold.",newpkmn.name,itemname))
break
elsif pbIsMail?(newpkmn.item)
pbDisplay(_INTL("{1}'s mail must be removed before giving it an item.",newpkmn.name))
else
newitem = newpkmn.item
newitemname = PBItems.getName(newitem)
if isConst?(newitem,PBItems,:LEFTOVERS)
pbDisplay(_INTL("{1} is already holding some {2}.\1",newpkmn.name,newitemname))
elsif ['a','e','i','o','u'].include?(newitemname[0,1].downcase)
pbDisplay(_INTL("{1} is already holding an {2}.\1",newpkmn.name,newitemname))
else
pbDisplay(_INTL("{1} is already holding a {2}.\1",newpkmn.name,newitemname))
end
if pbConfirm(_INTL("Would you like to switch the two items?"))
newpkmn.setItem(item)
pkmn.setItem(newitem)
@scene.pbClearSwitching
pbRefresh
pbDisplay(_INTL("{1} was given the {2} to hold.",newpkmn.name,itemname))
pbDisplay(_INTL("{1} was given the {2} to hold.",pkmn.name,newitemname))
break
end
end
end
end
end
end
@scene.pbEndScene
return nil
end
end
class PokemonReadyMenu
def pbStartReadyMenu(moves,items)
commands = [[], []] # Moves, items
for i in moves
commands[0].push([i[0], PBMoves.getName(i[0]), true, i[1]])
end
commands[0].sort! { |a,b| a[1] <=> b[1] }
for i in items
commands[1].push([i, PBItems.getName(i), false])
end
commands[1].sort! { |a,b| a[1] <=> b[1] }
@scene.pbStartScene(commands)
loop do
command = @scene.pbShowCommands
if command == -1
break
else
if command[0] == 0 # Use a move
move = commands[0][command[1]][0]
user = $Trainer.party[commands[0][command[1]][3]]
if isConst?(move,PBMoves,:FLY)
###############################################
pbHideMenu
ret = pbBetterRegionMap(nil, true, true)
pbShowMenu unless ret
###############################################
if ret
$PokemonTemp.flydata = ret
$game_temp.in_menu = false
Kernel.pbUseHiddenMove(user,move)
break
end
else
pbHideMenu
if Kernel.pbConfirmUseHiddenMove(user,move)
$game_temp.in_menu = false
Kernel.pbUseHiddenMove(user,move)
break
else
pbShowMenu
end
end
else # Use an item
item = commands[1][command[1]][0]
pbHideMenu
if ItemHandlers.triggerConfirmUseInField(item)
break if Kernel.pbUseKeyItemInField(item)
end
end
pbShowMenu
end
end
@scene.pbEndScene
end
end
=end

View File

@@ -0,0 +1,48 @@
def Kernel.pbDisplayText(message,xposition,yposition,z=nil)
@hud = []
# Draw the text
baseColor=Color.new(72,72,72)
shadowColor=Color.new(160,160,160)
sprite = BitmapSprite.new(Graphics.width,Graphics.height,@viewport1)
if z != nil
sprite.z=z
end
@hud.push(sprite)
text1=_INTL(message)
textPosition=[
[text1,xposition,yposition,2,baseColor,shadowColor],
]
pbSetSystemFont(@hud[-1].bitmap)
pbDrawTextPositions(@hud[0].bitmap,textPosition)
end
def Kernel.pbDisplayNumber(number,xposition,yposition)
@numT = []
# Draw the text
baseColor=Color.new(72,72,72)
shadowColor=Color.new(160,160,160)
@numT.push(BitmapSprite.new(Graphics.width,Graphics.height,@viewport1))
text1=_INTL(number.to_s)
textPosition=[
[text1,xposition,yposition,2,baseColor,shadowColor],
]
pbSetSystemFont(@numT[-1].bitmap)
pbDrawTextPositions(@numT[0].bitmap,textPosition)
end
def Kernel.pbClearNumber()
if @numT != nil then
for sprite in @numT
sprite.dispose
end
@numT.clear
end
end
def Kernel.pbClearText()
if @hud != nil then
for sprite in @hud
sprite.dispose
end
@hud.clear
end
end

View File

@@ -0,0 +1,321 @@
#IMPORTANT
#La méthode def pbCheckEvolution(pokemon,item=0)
#dans PokemonFusion (class PokemonFusionScene)
#a été modifiée et pour une raison ou une autre ca marche
#pas quand on la copie ici.
#Donc NE PAS OUBLIER DE LE COPIER AVEC
############################
# MODIFIED CODE SECTION #
###########################
#
# require PokeBattle_Scene_edited2
# PokemonFusion
#
NB_POKEMON = 420 #351 #aussi CONST_NB_POKE
def pbPokemonBitmapFile(species)
# Used by the Pokédex
# Load normal bitmap
#get body and head num
isFused = species > NB_POKEMON
if isFused
if species >= ZAPMOLCUNO_NB
path = getSpecialSpriteName(species) + ".png"
else
poke1 = getBodyID(species) #getBasePokemonID(species,true)
poke2 = getHeadID(species, poke1) #getBasePokemonID(species,false)
path = GetSpritePath(poke1, poke2, isFused)
end
else
path = GetSpritePath(species, species, false)
end
ret = sprintf(path) rescue nil
if !pbResolveBitmap(ret)
ret = "Graphics/Battlers/000.png"
end
return ret
end
def pbLoadPokemonBitmap(pokemon, species, back = false)
#species est utilisé par elitebattle mais ca sert a rien
return pbLoadPokemonBitmapSpecies(pokemon, pokemon.species, back)
end
def getEggBitmapPath(pokemon)
bitmapFileName = sprintf("Graphics/Battlers/Eggs/%s", getConstantName(PBSpecies, pokemon.species)) rescue nil
if !pbResolveBitmap(bitmapFileName)
if pokemon.species >= NUM_ZAPMOLCUNO
bitmapFileName = "Graphics/Battlers/Eggs/egg_base"
else
bitmapFileName = sprintf("Graphics/Battlers/Eggs/%03d", pokemon.species)
if !pbResolveBitmap(bitmapFileName)
bitmapFileName = sprintf("Graphics/Battlers/Eggs/000")
end
end
end
return bitmapFileName
end
def pbLoadPokemonBitmapSpecies(pokemon, species, back = false, scale = POKEMONSPRITESCALE)
ret = nil
pokemon = pokemon.pokemon if pokemon.respond_to?(:pokemon)
if pokemon.isEgg?
bitmapFileName = getEggBitmapPath(pokemon)
bitmapFileName = pbResolveBitmap(bitmapFileName)
elsif pokemon.species >= ZAPMOLCUNO_NB #zapmolcuno
bitmapFileName = getSpecialSpriteName(pokemon.species) #sprintf("Graphics/Battlers/special/144.145.146")
bitmapFileName = pbResolveBitmap(bitmapFileName)
else
#edited here
isFusion = species > NB_POKEMON
if isFusion
poke1 = getBodyID(species)
poke2 = getHeadID(species, poke1)
else
poke1 = species
poke2 = species
end
bitmapFileName = GetSpritePath(poke1, poke2, isFusion)
# Alter bitmap if supported
alterBitmap = (MultipleForms.getFunction(species, "alterBitmap") rescue nil)
end
if bitmapFileName && alterBitmap
animatedBitmap = AnimatedBitmap.new(bitmapFileName)
copiedBitmap = animatedBitmap.copy
animatedBitmap.dispose
copiedBitmap.each { |bitmap| alterBitmap.call(pokemon, bitmap) }
ret = copiedBitmap
elsif bitmapFileName
ret = AnimatedBitmap.new(bitmapFileName)
end
return ret
end
def getSpecialSpriteName(dexNum)
base_path = "Graphics/Battlers/special/"
case dexNum
when NUM_ZAPMOLCUNO..NUM_ZAPMOLCUNO + 1
path = sprintf(base_path + "144.145.146")
when NUM_ZAPMOLCUNO + 2
path = sprintf(base_path + "243.244.245")
when NUM_ZAPMOLCUNO + 3
path = sprintf(base_path +"340.341.342")
when NUM_ZAPMOLCUNO + 4
path = sprintf(base_path +"343.344.345")
when NUM_ZAPMOLCUNO + 5
path = sprintf(base_path +"349.350.351")
when NUM_ZAPMOLCUNO + 6
path = sprintf(base_path +"151.251.381")
#starters
when NUM_ZAPMOLCUNO + 7
path = sprintf(base_path +"3.6.9")
when NUM_ZAPMOLCUNO + 8
path = sprintf(base_path +"154.157.160")
when NUM_ZAPMOLCUNO + 9
path = sprintf(base_path +"278.281.284")
when NUM_ZAPMOLCUNO + 10
path = sprintf(base_path +"318.321.324")
else
path = sprintf(base_path + "000")
end
end
#######################
# NEW CODE SECTION #
#######################
DOSSIERCUSTOMSPRITES = "CustomBattlers"
BATTLERSPATH = "Battlers"
def GetSpritePath(poke1, poke2, isFused)
#Check if custom exists
spritename = GetSpriteName(poke1, poke2, isFused)
pathCustom = sprintf("Graphics/%s/%s.png", DOSSIERCUSTOMSPRITES, spritename)
pathReg = sprintf("Graphics/%s/%s/%s.png", BATTLERSPATH, poke2, spritename)
path = pbResolveBitmap(pathCustom) && $game_variables[196] == 0 ? pathCustom : pathReg
return path
end
def GetSpritePathForced(poke1, poke2, isFused)
#Check if custom exists
spritename = GetSpriteName(poke1, poke2, isFused)
pathCustom = sprintf("Graphics/%s/%s.png", DOSSIERCUSTOMSPRITES, spritename)
pathReg = sprintf("Graphics/%s/%s/%s.png", BATTLERSPATH, poke2, spritename)
path = pbResolveBitmap(pathCustom) ? pathCustom : pathReg
return path
end
def GetSpriteName(poke1, poke2, isFused)
ret = isFused ? sprintf("%d.%d", poke2, poke1) : sprintf("%d", poke2) rescue nil
return ret
end
#in: pokemon number
def Kernel.isPartPokemon(src, target)
return true if src == target
return false if src <= NB_POKEMON
bod = getBasePokemonID(src, true)
head = getBasePokemonID(src, false)
return bod == target || head == target
end
##EDITED HERE
#Retourne le pokemon de base
#param1 = int
#param2 = true pour body, false pour head
#return int du pokemon de base
def getBasePokemonID(pokemon, body = true)
cname = getConstantName(PBSpecies, pokemon) rescue nil
return pokemon if pokemon <= NB_POKEMON
return pokemon if cname == nil
arr = cname.split(/[B,H]/)
bod = arr[1]
head = arr[2]
return bod.to_i if body
return head.to_i
end
###################
## CONVERTER #
###################
def convertAllPokemon()
Kernel.pbMessage(_INTL("The game has detected that your previous savefile was from an earlier build of the game."))
Kernel.pbMessage(_INTL("In order to play this version, your Pokémon need to be converted to their new Pokédex numbers. "))
Kernel.pbMessage(_INTL("If you were playing Randomized mode, the trainers and wild Pokémon will also need to be reshuffled."))
if (Kernel.pbConfirmMessage(_INTL("Convert your Pokémon?")))
#get previous version
msgwindow = Kernel.pbCreateMessageWindow(nil)
msgwindow.text = "What is the last version of the game you played?"
choice = Kernel.pbShowCommands(msgwindow, [
"4.7 (September 2020)",
"4.5-4.6.2 (2019-2020)",
"4.2-4.4 (2019)",
"4.0-4.1 (2018-2019)",
"3.x or earlier (2015-2018)"], -1)
case choice
when 0
prev_total = 381
when 1
prev_total = 351
when 2
prev_total = 315
when 3
prev_total = 275
when 4
prev_total = 151
else
prev_total = 381
end
Kernel.pbDisposeMessageWindow(msgwindow)
pbEachPokemon { |poke, box|
if poke.species >= NB_POKEMON
pf = poke.species
pBody = (pf / prev_total).round
pHead = pf - (prev_total * pBody)
# Kernel.pbMessage(_INTL("pbod {1} pHead {2}, species: {3})",pBody,pHead,pf))
prev_max_value = (prev_total * prev_total) + prev_total
if pf >= prev_max_value
newSpecies = convertTripleFusion(pf, prev_max_value)
if newSpecies == nil
boxname = box == -1 ? "Party" : box
Kernel.pbMessage(_INTL("Invalid Pokémon detected in box {1}:\n num. {2}, {3} (lv. {4})", boxname, pf, poke.name, poke.level))
if (Kernel.pbConfirmMessage(_INTL("Delete Pokémon and continue?")))
poke = nil
next
else
Kernel.pbMessage(_INTL("Conversion cancelled. Please restart the game."))
Graphics.freeze
end
end
end
newSpecies = pBody * NB_POKEMON + pHead
poke.species = newSpecies
end
}
Kernel.initRandomTypeArray()
if $game_switches[987] #randomized trainers
Kernel.pbShuffleTrainers()
end
if $game_switches[956] #randomized pokemon
range = pbGet(197) == nil ? 25 : pbGet(197)
Kernel.pbShuffleDex(range, 1)
end
end
end
def convertTripleFusion(species, prev_max_value)
if prev_max_value == (351 * 351) + 351
case species
when 123553
return 145543
when 123554
return 145544
when 123555
return 145545
when 123556
return 145546
when 123557
return 145547
when 123558
return 145548
else
return nil
end
end
return nil
end
def convertTrainers()
if ($game_switches[987])
Kernel.pbShuffleTrainers()
end
end
def convertAllPokemonManually()
if (Kernel.pbConfirmMessage(_INTL("When you last played the game, where there any gen 2 Pokémon?")))
#4.0
prev_total = 315
else
#3.0
prev_total = 151
end
convertPokemon(prev_total)
end
def convertPokemon(prev_total = 275)
pbEachPokemon { |poke, box|
if poke.species >= NB_POKEMON
pf = poke.species
pBody = (pf / prev_total).round
pHead = pf - (prev_total * pBody)
newSpecies = pBody * NB_POKEMON + pHead
poke.species = newSpecies
end
}
end

View File

@@ -0,0 +1,105 @@
def pbAddPokemonID(pokemon, level = nil, seeform = true, dontRandomize = false)
return if !pokemon || !$Trainer
dontRandomize = true if $game_switches[3] #when choosing starters
if pbBoxesFull?
Kernel.pbMessage(_INTL("There's no more room for Pokémon!\1"))
Kernel.pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!"))
return false
end
if pokemon.is_a?(Integer) && level.is_a?(Integer)
pokemon = Pokemon.new(pokemon, level, $Trainer)
end
#random species if randomized gift pokemon & wild poke
if $game_switches[780] && $game_switches[778] && !dontRandomize
oldSpecies = pokemon.species
pokemon.species = $PokemonGlobal.psuedoBSTHash[oldSpecies]
end
speciesname = PBSpecies.getName(pokemon.species)
Kernel.pbMessage(_INTL("{1} obtained {2}!\\se[itemlevel]\1", $Trainer.name, speciesname))
pbNicknameAndStore(pokemon)
pbSeenForm(pokemon) if seeform
return true
end
def pbAddPokemonID(pokemon_id, level = 1, see_form = true, skip_randomize = false)
return false if !pokemon_id
if pbBoxesFull?
pbMessage(_INTL("There's no more room for Pokémon!\1"))
pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!"))
return false
end
if pokemon_id.is_a?(Integer) && level.is_a?(Integer)
pokemon = Pokemon.new(pokemon_id, level)
species_name = pokemon.speciesName
end
#random species if randomized gift pokemon & wild poke
if $game_switches[780] && $game_switches[778] && !skip_randomize
oldSpecies = pokemon.species
pokemon.species = $PokemonGlobal.psuedoBSTHash[oldSpecies]
end
pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $Trainer.name, species_name))
pbNicknameAndStore(pokemon)
$Trainer.pokedex.register(pokemon) if see_form
return true
end
def pbGenerateEgg(pokemon, text = "")
return false if !pokemon || !$Trainer # || $Trainer.party.length>=6
if pokemon.is_a?(String) || pokemon.is_a?(Symbol)
pokemon = getID(PBSpecies, pokemon)
end
if pokemon.is_a?(Integer)
pokemon = PokeBattle_Pokemon.new(pokemon, EGGINITIALLEVEL, $Trainer)
end
# Get egg steps
eggsteps = $pkmn_dex[pokemon.species][10]
# Set egg's details
pokemon.name = _INTL("Egg")
pokemon.eggsteps = eggsteps
pokemon.obtainText = text
pokemon.calcStats
# Add egg to party
Kernel.pbMessage(_INTL("Received a Pokémon egg!"))
if $Trainer.party.length < 6
$Trainer.party[$Trainer.party.length] = pokemon
else
$PokemonStorage.pbStoreCaught(pokemon)
Kernel.pbMessage(_INTL("The egg was transfered to the PC."))
end
#$Trainer.party[$Trainer.party.length]=pokemon
return true
end
def pbHasSpecies?(species)
if species.is_a?(String) || species.is_a?(Symbol)
species = getID(PBSpecies, species)
end
for pokemon in $Trainer.party
next if pokemon.isEgg?
return true if pokemon.species == species
end
return false
end
#Check if the Pokemon can learn a TM
def CanLearnMove(pokemon, move)
species = getID(PBSpecies, pokemon)
ret = false
return false if species <= 0
data = load_data("Data/tm.dat")
return false if !data[move]
return data[move].any? { |item| item == species }
end

View File

@@ -0,0 +1,650 @@
# Le eul but de cette clae et de pouvoir continuer à utilier le format PBTrainer::TRAINER quand on call la méthode de combat de dreeur
# pour ne pa à avoir à modifier tou le événement
#
module PBItems
REPEL = 1
SUPERREPEL = 2
MAXREPEL = 3
BLACKFLUTE = 4
WHITEFLUTE = 5
HONEY = 6
ESCAPEROPE = 7
REDSHARD = 8
YELLOWSHARD = 9
BLUESHARD = 10
GREENSHARD = 11
FIRESTONE = 12
THUNDERSTONE = 13
WATERSTONE = 14
LEAFSTONE = 15
MOONSTONE = 16
SUNSTONE = 17
DUSKSTONE = 18
DAWNSTONE = 19
SHINYSTONE = 20
REDAPRICORN = 21
YELLOWAPRICORN = 22
BLUEAPRICORN = 23
GREENAPRICORN = 24
PINKAPRICORN = 25
WHITEAPRICORN = 26
BLACKAPRICORN = 27
HELIXFOSSIL = 28
DOMEFOSSIL = 29
OLDAMBER = 30
ROOTFOSSIL = 31
CLAWFOSSIL = 32
SKULLFOSSIL = 33
ARMORFOSSIL = 34
COVERFOSSIL = 35
PLUMEFOSSIL = 36
PRETTYWING = 37
TINYMUSHROOM = 38
BIGMUSHROOM = 39
BALMMUSHROOM = 40
PEARL = 41
BIGPEARL = 42
PEARLSTRING = 43
STARDUST = 44
STARPIECE = 45
COMETSHARD = 46
NUGGET = 47
BIGNUGGET = 48
HEARTSCALE = 49
SLOWPOKETAIL = 50
RAREBONE = 51
RELICCOPPER = 52
RELICSILVER = 53
RELICGOLD = 54
RELICVASE = 55
RELICBAND = 56
RELICSTATUE = 57
RELICCROWN = 58
GROWTHMULCH = 59
DAMPMULCH = 60
STABLEMULCH = 61
GOOEYMULCH = 62
SHOALSALT = 63
SHOALSHELL = 64
ODDKEYSTONE = 65
AIRBALLOON = 66
BRIGHTPOWDER = 67
EVIOLITE = 68
FLOATSTONE = 69
DESTINYKNOT = 70
ROCKYHELMET = 71
EJECTBUTTON = 72
REDCARD = 73
SHEDSHELL = 74
SMOKEBALL = 75
LUCKYEGG = 76
EXPSHARE = 77
AMULETCOIN = 78
SOOTHEBELL = 79
CLEANSETAG = 80
CHOICEBAND = 81
CHOICESPECS = 82
CHOICESCARF = 83
HEATROCK = 84
DAMPROCK = 85
SMOOTHROCK = 86
ICYROCK = 87
LIGHTCLAY = 88
GRIPCLAW = 89
BINDINGBAND = 90
BIGROOT = 91
BLACKSLUDGE = 92
LEFTOVERS = 93
SHELLBELL = 94
MENTALHERB = 95
WHITEHERB = 96
POWERHERB = 97
ABSORBBULB = 98
CELLBATTERY = 99
LIFEORB = 100
EXPERTBELT = 101
METRONOME = 102
MUSCLEBAND = 103
WISEGLASSES = 104
RAZORCLAW = 105
SCOPELENS = 106
WIDELENS = 107
ZOOMLENS = 108
KINGSROCK = 109
RAZORFANG = 110
LAGGINGTAIL = 111
QUICKCLAW = 112
FOCUSBAND = 113
FOCUSSASH = 114
FLAMEORB = 115
TOXICORB = 116
STICKYBARB = 117
IRONBALL = 118
RINGTARGET = 119
MACHOBRACE = 120
POWERWEIGHT = 121
POWERBRACER = 122
POWERBELT = 123
POWERLENS = 124
POWERBAND = 125
POWERANKLET = 126
LAXINCENSE = 127
FULLINCENSE = 128
LUCKINCENSE = 129
PUREINCENSE = 130
SEAINCENSE = 131
WAVEINCENSE = 132
ROSEINCENSE = 133
ODDINCENSE = 134
ROCKINCENSE = 135
CHARCOAL = 136
MYSTICWATER = 137
MAGNET = 138
MIRACLESEED = 139
NEVERMELTICE = 140
BLACKBELT = 141
POISONBARB = 142
SOFTSAND = 143
SHARPBEAK = 144
TWISTEDSPOON = 145
SILVERPOWDER = 146
HARDSTONE = 147
SPELLTAG = 148
DRAGONFANG = 149
BLACKGLASSES = 150
METALCOAT = 151
SILKSCARF = 152
FLAMEPLATE = 153
SPLASHPLATE = 154
ZAPPLATE = 155
MEADOWPLATE = 156
ICICLEPLATE = 157
FISTPLATE = 158
TOXICPLATE = 159
EARTHPLATE = 160
SKYPLATE = 161
MINDPLATE = 162
INSECTPLATE = 163
STONEPLATE = 164
SPOOKYPLATE = 165
DRACOPLATE = 166
DREADPLATE = 167
IRONPLATE = 168
FIREGEM = 169
WATERGEM = 170
ELECTRICGEM = 171
GRASSGEM = 172
ICEGEM = 173
FIGHTINGGEM = 174
POISONGEM = 175
GROUNDGEM = 176
FLYINGGEM = 177
PSYCHICGEM = 178
BUGGEM = 179
ROCKGEM = 180
GHOSTGEM = 181
DRAGONGEM = 182
DARKGEM = 183
STEELGEM = 184
NORMALGEM = 185
LIGHTBALL = 186
LUCKYPUNCH = 187
METALPOWDER = 188
QUICKPOWDER = 189
THICKCLUB = 190
STICK = 191
SOULDEW = 192
DEEPSEATOOTH = 193
DEEPSEASCALE = 194
ADAMANTORB = 195
LUSTROUSORB = 196
GRISEOUSORB = 197
DOUSEDRIVE = 198
SHOCKDRIVE = 199
BURNDRIVE = 200
CHILLDRIVE = 201
EVERSTONE = 202
DRAGONSCALE = 203
UPGRADE = 204
DUBIOUSDISC = 205
PROTECTOR = 206
ELECTIRIZER = 207
MAGMARIZER = 208
REAPERCLOTH = 209
PRISMSCALE = 210
OVALSTONE = 211
REDSCARF = 212
BLUESCARF = 213
PINKSCARF = 214
GREENSCARF = 215
YELLOWSCARF = 216
POTION = 217
SUPERPOTION = 218
HYPERPOTION = 219
MAXPOTION = 220
FULLRESTORE = 221
SACREDASH = 222
AWAKENING = 223
ANTIDOTE = 224
BURNHEAL = 225
PARLYZHEAL = 226
ICEHEAL = 227
FULLHEAL = 228
LAVACOOKIE = 229
OLDGATEAU = 230
CASTELIACONE = 231
REVIVE = 232
MAXREVIVE = 233
BERRYJUICE = 234
RAGECANDYBAR = 235
SWEETHEART = 236
FRESHWATER = 237
SODAPOP = 238
LEMONADE = 239
MOOMOOMILK = 240
ENERGYPOWDER = 241
ENERGYROOT = 242
HEALPOWDER = 243
REVIVALHERB = 244
ETHER = 245
MAXETHER = 246
ELIXIR = 247
MAXELIXIR = 248
PPUP = 249
PPMAX = 250
HPUP = 251
PROTEIN = 252
IRON = 253
CALCIUM = 254
ZINC = 255
CARBOS = 256
HEALTHWING = 257
MUSCLEWING = 258
RESISTWING = 259
GENIUSWING = 260
CLEVERWING = 261
SWIFTWING = 262
RARECANDY = 263
MASTERBALL = 264
ULTRABALL = 265
GREATBALL = 266
POKEBALL = 267
SAFARIBALL = 268
SPORTBALL = 269
NETBALL = 270
DIVEBALL = 271
NESTBALL = 272
REPEATBALL = 273
TIMERBALL = 274
LUXURYBALL = 275
PREMIERBALL = 276
DUSKBALL = 277
HEALBALL = 278
QUICKBALL = 279
CHERISHBALL = 280
FASTBALL = 281
LEVELBALL = 282
LUREBALL = 283
HEAVYBALL = 284
LOVEBALL = 285
FRIENDBALL = 286
MOONBALL = 287
TM01 = 288
TM02 = 289
TM03 = 290
TM04 = 291
TM05 = 292
TM06 = 293
TM07 = 294
TM08 = 295
TM09 = 296
TM10 = 297
TM11 = 298
TM12 = 299
TM13 = 300
TM14 = 301
TM15 = 302
TM16 = 303
TM17 = 304
TM18 = 305
TM19 = 306
TM20 = 307
TM21 = 308
TM22 = 309
TM23 = 310
TM24 = 311
TM25 = 312
TM26 = 313
TM27 = 314
TM27 = 315
TM29 = 316
TM30 = 317
TM31 = 318
TM32 = 319
TM33 = 320
TM34 = 321
TM35 = 322
TM36 = 323
TM37 = 324
TM38 = 325
TM39 = 326
TM40 = 327
TM41 = 328
TM42 = 329
TM43 = 330
TM44 = 331
TM45 = 332
TM46 = 333
TM47 = 334
TM48 = 335
TM49 = 336
TM50 = 337
TM51 = 338
TM52 = 339
TM53 = 340
TM54 = 341
TM55 = 342
TM56 = 343
TM57 = 344
TM58 = 345
TM59 = 346
TM60 = 347
TM61 = 348
TM62 = 349
TM63 = 350
TM64 = 351
TM65 = 352
TM66 = 353
TM67 = 354
TM68 = 355
TM69 = 356
TM70 = 357
TM71 = 358
TM72 = 359
TM73 = 360
TM74 = 361
TM75 = 362
TM76 = 363
TM77 = 364
TM78 = 365
TM79 = 366
TM80 = 367
TM81 = 368
TM82 = 369
TM83 = 370
TM84 = 371
TM85 = 372
TM86 = 373
TM87 = 374
TM88 = 375
TM89 = 376
TM90 = 377
TM91 = 378
TM92 = 379
TM93 = 380
TM94 = 381
TM95 = 382
HM01 = 383
HM02 = 384
HM03 = 385
HM04 = 386
HM05 = 387
HM06 = 388
CHERIBERRY = 389
CHESTOBERRY = 390
PECHABERRY = 391
RAWSTBERRY = 392
ASPEARBERRY = 393
LEPPABERRY = 394
ORANBERRY = 395
PERSIMBERRY = 396
LUMBERRY = 397
SITRUSBERRY = 398
FIGYBERRY = 399
WIKIBERRY = 400
MAGOBERRY = 401
AGUAVBERRY = 402
IAPAPABERRY = 403
RAZZBERRY = 404
BLUKBERRY = 405
NANABBERRY = 406
WEPEARBERRY = 407
PINAPBERRY = 408
POMEGBERRY = 409
KELPSYBERRY = 410
QUALOTBERRY = 411
HONDEWBERRY = 412
GREPABERRY = 413
TAMATOBERRY = 414
CORNNBERRY = 415
MAGOSTBERRY = 416
RABUTABERRY = 417
NOMELBERRY = 418
SPELONBERRY = 419
PAMTREBERRY = 420
WATMELBERRY = 421
DURINBERRY = 422
BELUEBERRY = 423
OCCABERRY = 424
PASSHOBERRY = 425
WACANBERRY = 426
RINDOBERRY = 427
YACHEBERRY = 428
CHOPLEBERRY = 429
KEBIABERRY = 430
SHUCABERRY = 431
COBABERRY = 432
PAYAPABERRY = 433
TANGABERRY = 434
CHARTIBERRY = 435
KASIBBERRY = 436
HABANBERRY = 437
COLBURBERRY = 438
BABIRIBERRY = 439
CHILANBERRY = 440
LIECHIBERRY = 441
GANLONBERRY = 442
SALACBERRY = 443
PETAYABERRY = 444
APICOTBERRY = 445
LANSATBERRY = 446
STARFBERRY = 447
ENIGMABERRY = 448
MICLEBERRY = 449
CUSTAPBERRY = 450
JABOCABERRY = 451
ROWAPBERRY = 452
GRASSMAIL = 453
FLAMEMAIL = 454
BUBBLEMAIL = 455
BLOOMMAIL = 456
TUNNELMAIL = 457
STEELMAIL = 458
HEARTMAIL = 459
SNOWMAIL = 460
SPACEMAIL = 461
AIRMAIL = 462
MOSAICMAIL = 463
BRICKMAIL = 464
XATTACK = 465
XATTACK2 = 466
XATTACK3 = 467
XATTACK6 = 468
XDEFENSE = 469
XDEFENSE2 = 470
XDEFENSE3 = 471
XDEFENSE6 = 472
XSPATK = 473
XSPATK2 = 474
XSPATK3 = 475
XSPATK6 = 476
XSPDEF = 477
XSPDEF2 = 478
XSPDEF3 = 479
XSPDEF6 = 480
XSPEED = 481
XSPEED2 = 482
XSPEED3 = 483
XSPEED6 = 484
XACCURACY = 485
XACCURACY2 = 486
XACCURACY3 = 487
XACCURACY6 = 488
DIREHIT = 489
DIREHIT2 = 490
DIREHIT3 = 491
GUARDSPEC = 492
RESETURGE = 493
ABILITYURGE = 494
ITEMURGE = 495
ITEMDROP = 496
BLUEFLUTE = 497
YELLOWFLUTE = 498
REDFLUTE = 499
POKEDOLL = 500
FLUFFYTAIL = 501
POKETOY = 502
BICYCLE = 503
OLDROD = 504
GOODROD = 505
SUPERROD = 506
ITEMFINDER = 507
DOWSINGMACHINE = 508
POKERADAR = 509
TOWNMAP = 510
POKEFLUTE = 511
COINCASE = 512
SOOTSACK = 513
SILPHSCOPE = 514
DEVONSCOPE = 515
SQUIRTBOTTLE = 516
SPRAYDUCK = 517
WAILMERPAIL = 518
GRACIDEA = 519
AURORATICKET = 520
OLDSEAMAP = 521
DNASPLICERS = 522
REVEALGLASS = 523
OVALCHARM = 524
SHINYCHARM = 525
FUSIONREPEL = 526
SSTICKET = 527
COFFEE = 528
SKINNYLATTE = 529
HM07 = 530
HM08 = 531
KRABBYLEGS = 532
LOVELETTER = 533
MASTERBALLPROTO = 534
TM96 = 535
MACHETE = 536
PICKAXE = 537
LANTERN = 538
SURFBOARD = 539
TELEPORTER = 540
SCUBAGEAR = 541
LEVER = 542
DEBUGGER = 543
WOODENPLANKS = 544
BRICKS = 545
ROCKETID = 546
BEER = 547
SHOOTER = 548
SUPERSPLICERS = 549
SAFARISOUVENIR = 550
POKEDEX = 551
CARDKEY = 552
PIZZA = 553
CAPTAINSKEY = 554
GENDERBALL = 555
TRADEBALL = 556
ABILITYBALL = 557
VIRUSBALL = 558
SHINYBALL = 559
PERFECTBALL = 560
OLDBOOT = 561
INFINITESPLICERS = 562
EXPALL = 563
OAKSPARCEL = 564
POWERPLANTKEY = 565
DAMAGEUP = 566
ACCURACYUP = 567
MISTSTONE = 568
DEVOLUTIONSPRAY = 569
TRANSGENDERSTONE = 570
WHITEFLAG = 571
FAIRYGEM = 572
DREAMBALL = 573
TOXICBALL = 574
SPARKBALL = 575
SCORCHBALL = 576
FROSTBALL = 577
PUREBALL = 578
STATUSBALL = 579
CANDYBALL = 580
DNAREVERSER = 581
ROCKETMEAL = 582
FANCYMEAL = 583
INCUBATOR = 584
FIRECRACKER = 585
MANSIONKEY = 586
POISONMUSHROOM = 587
EXPALLOFF = 588
GASMASK = 589
MANKEYPAW = 590
ICEPICK = 591
RACEBIKE = 592
DIAMOND = 593
DIAMONDNECKLACE = 594
GOLDRING = 595
SEADRAFIN = 596
SACREDPOTION = 597
ABILITYCAPSULE = 598
MAGICBOOTS = 599
ANCIENTSTONE = 600
ICESTONE = 601
GSBALL = 602
MAGNETPASS = 603
SECRETCAPSULE = 604
ODDKEYSTONE_FULL = 605
DYNAMITE = 607
BERSERKGENE = 606
AZUREFLUTE = 608
MAGNETSTONE = 609
PIXIEPLATE = 610
OLDPENDANT = 611
BELLSPROUTSTATUE = 612
TM97 = 613
TM98 = 614
TM99 = 615
TM100 = 616
TM101 = 617
TM102 = 618
TM103 = 619
TM104 = 620
TM105 = 621
TM108 = 622
ROCKETBALL = 623
FUSIONBALL = 624
TM106 = 625
TM107 = 626
RUBY = 627
SAPPHIRE = 628
EMERALD = 629
NETWORKCHIP = 630
BANANA = 631
GOLDENBANANA = 632
DEMHARDMODE = 633
LIGHTSTONE = 634
DARKSTONE = 635
BRONZEEMBLEM = 636
SILVEREMBLEM = 637
GOLDEMBLEM = 638
HM09 = 639
HM10 = 640
CLIMBINGGEAR = 641
INCUBATOR_NORMAL = 642
JETPACK = 643
INFINITEREVERSERS = 644
INFINITESPLICERS = 645
end

View File

@@ -0,0 +1,120 @@
# Le seul but de cette classe est de pouvoir continuer à utiliser le format PBTrainers::TRAINER quand on call la méthode de combat de dresseur
# pour ne pas à avoir à modifier tous les événements
module PBTrainers
POKEMONTRAINER_Red = 0
POKEMONTRAINER_Leaf = 1
POKEMONTRAINER_Gold = 2
POKEMONTRAINER_May = 3
RIVAL1 = 4
RIVAL2 = 5
AROMALADY = 6
BEAUTY = 7
BIKER = 8
BIRDKEEPER = 9
BUGCATCHER = 10
BURGLAR = 11
CHANNELER = 12
CUEBALL = 13
ENGINEER = 14
FISHERMAN = 15
GAMBLER = 16
GENTLEMAN = 17
HIKER = 18
JUGGLER = 19
LADY = 20
PAINTER = 21
POKEMANIAC = 22
POKEMONBREEDER = 23
PROFESSOR = 24
ROCKER = 25
RUINMANIAC = 26
SAILOR = 27
SCIENTIST = 28
SUPERNERD = 29
TAMER = 30
BLACKBELT = 31
CRUSHGIRL = 32
CAMPER = 33
PICNICKER = 34
COOLTRAINER_M = 35
COOLTRAINER_F = 36
YOUNGSTER = 37
LASS = 38
POKEMONRANGER_M =
POKEMONRANGER_F = 40
PSYCHIC_M = 41
PSYCHIC_F = 42
SWIMMER_M = 43
SWIMMER_F = 44
SWIMMER2_M = 45
SWIMMER2_F = 46
TUBER_M = 47
TUBER_F = 48
TUBER2_M = 49
TUBER2_F = 50
COOLCOUPLE = 51
CRUSHKIN = 52
SISANDBRO = 53
TWINS = 54
YOUNGCOUPLE = 55
TEAMROCKET_M = 56
TEAMROCKET_F = 57
ROCKETBOSS = 58
LEADER_Brock = 59
LEADER_Misty = 60
LEADER_Surge = 61
LEADER_Erika = 62
LEADER_Koga = 63
LEADER_Sabrina = 64
LEADER_Blaine = 65
LEADER_Giovanni = 66
ELITEFOUR_Lorelei = 67
ELITEFOUR_Bruno = 68
ELITEFOUR_Agatha = 69
ELITEFOUR_Lance = 70
CHAMPION = 71
SOCIALITE = 72
BUGCATCHER_F = 73
MR_FUJI = 74
ROUGHNECK = 75
TEACHER = 76
PRESCHOOLER_M = 77
PRESCHOOLER_F = 78
HIPSTER = 79
HAUNTEDGIRL_YOUNG = 80
HAUNTEDGIRL = 81
CLOWN = 82
NURSE = 83
WORKER = 84
POKEMONTRAINER_RedB = 85
POKEMONTRAINER_RedG = 86
POKEMONTRAINER_RedY = 87
POKEMONTRAINER_LeafB = 88
POKEMONTRAINER_LeafG = 89
POKEMONTRAINER_LeafY = 90
COOLTRAINER_M = 91
COOLTRAINER_F = 92
ROBOT = 93
FARMER = 94
PYROMANIAC = 95
ROCKETEXEC_F = 96
ROCKETEXEC_M = 97
LEADER_Whitney = 98
LEADER_Kurt = 99
LEADER_Falkner = 100
LEADER_Clair = 101
MYSTICALMAN = 102
LEADER_Morty = 103
TEAMPLASMA_M = 104
TEAMPLASMA_F = 105
SCIENTIST_Colress = 106
LEADER_Pryce = 107
KIMONOGIRL = 108
SAGE = 109
PLAYER = 110
LEADER_Chuck = 111
LEADER_Jasmine = 112
POLICE = 113
SKIER_F = 114
end

View File

@@ -0,0 +1,126 @@
###################
## 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
next catchRate
})
BallHandlers::OnCatch.add(:TRADEBALL,proc{|ball,battle,pokemon|
pokemon.obtainMode = 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
next catchRate
})
BallHandlers::OnCatch.add(:ABILITYBALL,proc{|ball,battle,pokemon|
pokemon.setAbility(2)
})
#VIRUS BALL 27 - give pokerus
#catch rate: 40% pokeball
BallHandlers::ModifyCatchRate.add(:VIRUSBALL,proc{|ball,catchRate,battle,pokemon|
catchRate=(catchRate*0.4).floor
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
next catchRate
})
BallHandlers::OnCatch.add(:SHINYBALL,proc{|ball,battle,pokemon|
pokemon.makeShiny
})
#PERFECTBALL 29
#catch rate: 10% pokeball
BallHandlers::ModifyCatchRate.add(:PERFECTBALL,proc{|ball,catchRate,battle,pokemon|
catchRate=(catchRate*0.1).floor
next catchRate
})
BallHandlers::OnCatch.add(:PERFECTBALL,proc{|ball,battle,pokemon|
stat1 = rand(5)
stat2 = rand(5)
pokemon.iv[stat1]=31
pokemon.iv[stat2]=31
})
#DREAMBALL - endormi
BallHandlers::ModifyCatchRate.add(:DREAMBALL,proc{|ball,catchRate,battle,battler|
battler.status = PBStatuses::SLEEP
next catchRate
})
#TOXICBALL - empoisonné
BallHandlers::ModifyCatchRate.add(:TOXICBALL,proc{|ball,catchRate,battle,battler|
battler.status = PBStatuses::POISON
next catchRate
})
#SCORCHBALL - brulé
BallHandlers::ModifyCatchRate.add(:SCORCHBALL,proc{|ball,catchRate,battle,battler|
battler.status = PBStatuses::BURN
next catchRate
})
#FROSTBALL - frozen
BallHandlers::ModifyCatchRate.add(:FROSTBALL,proc{|ball,catchRate,battle,battler|
battler.status = PBStatuses::FROZEN
next catchRate
})
#SPARKBALL - paralizé
BallHandlers::ModifyCatchRate.add(:SPARKBALL,proc{|ball,catchRate,battle,battler|
battler.status = PBStatuses::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 fused
BallHandlers::ModifyCatchRate.add(:FUSIONBALL,proc{|ball,catchRate,battle,battler|
catchRate*=3 if battler.species > 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
})

View File

@@ -0,0 +1,3 @@
def pbGetCurrentRegion(defaultRegion = -1)
return -1
end

View File

@@ -0,0 +1,835 @@
class PBFusion
Unknown = 0 # Do not use
Happiness = 1
HappinessDay = 2
HappinessNight = 3
Level = 4
Trade = 5
TradeItem = 6
Item = 7
AttackGreater = 8
AtkDefEqual = 9
DefenseGreater = 10
Silcoon = 11
Cascoon = 12
Ninjask = 13
Shedinja = 14
Beauty = 15
ItemMale = 16
ItemFemale = 17
DayHoldItem = 18
NightHoldItem = 19
HasMove = 20
HasInParty = 21
LevelMale = 22
LevelFemale = 23
Location = 24
TradeSpecies = 25
Custom1 = 26
Custom2 = 27
Custom3 = 28
Custom4 = 29
Custom5 = 30
Custom6 = 31
Custom7 = 32
EVONAMES=["Unknown",
"Happiness","HappinessDay","HappinessNight","Level","Trade",
"TradeItem","Item","AttackGreater","AtkDefEqual","DefenseGreater",
"Silcoon","Cascoon","Ninjask","Shedinja","Beauty",
"ItemMale","ItemFemale","DayHoldItem","NightHoldItem","HasMove",
"HasInParty","LevelMale","LevelFemale","Location","TradeSpecies",
"Custom1","Custom2","Custom3","Custom4","Custom5","Custom6","Custom7"
]
# 0 = no parameter
# 1 = Positive integer
# 2 = Item internal name
# 3 = Move internal name
# 4 = Species internal name
# 5 = Type internal name
EVOPARAM=[0, # Unknown (do not use)
0,0,0,1,0, # Happiness, HappinessDay, HappinessNight, Level, Trade
2,2,1,1,1, # TradeItem, Item, AttackGreater, AtkDefEqual, DefenseGreater
1,1,1,1,1, # Silcoon, Cascoon, Ninjask, Shedinja, Beauty
2,2,2,2,3, # ItemMale, ItemFemale, DayHoldItem, NightHoldItem, HasMove
4,1,1,1,4, # HasInParty, LevelMale, LevelFemale, Location, TradeSpecies
1,1,1,1,1,1,1 # Custom 1-7
]
end
class SpriteMetafile
VIEWPORT = 0
TONE = 1
SRC_RECT = 2
VISIBLE = 3
X = 4
Y = 5
Z = 6
OX = 7
OY = 8
ZOOM_X = 9
ZOOM_Y = 10
ANGLE = 11
MIRROR = 12
BUSH_DEPTH = 13
OPACITY = 14
BLEND_TYPE = 15
COLOR = 16
FLASHCOLOR = 17
FLASHDURATION = 18
BITMAP = 19
def length
return @metafile.length
end
def [](i)
return @metafile[i]
end
def initialize(viewport=nil)
@metafile=[]
@values=[
viewport,
Tone.new(0,0,0,0),Rect.new(0,0,0,0),
true,
0,0,0,0,0,100,100,
0,false,0,255,0,
Color.new(0,0,0,0),Color.new(0,0,0,0),
0
]
end
def disposed?
return false
end
def dispose
end
def flash(color,duration)
if duration>0
@values[FLASHCOLOR]=color.clone
@values[FLASHDURATION]=duration
@metafile.push([FLASHCOLOR,color])
@metafile.push([FLASHDURATION,duration])
end
end
def x
return @values[X]
end
def x=(value)
@values[X]=value
@metafile.push([X,value])
end
def y
return @values[Y]
end
def y=(value)
@values[Y]=value
@metafile.push([Y,value])
end
def bitmap
return nil
end
def bitmap=(value)
if value && !value.disposed?
@values[SRC_RECT].set(0,0,value.width,value.height)
@metafile.push([SRC_RECT,@values[SRC_RECT].clone])
end
end
def src_rect
return @values[SRC_RECT]
end
def src_rect=(value)
@values[SRC_RECT]=value
@metafile.push([SRC_RECT,value])
end
def visible
return @values[VISIBLE]
end
def visible=(value)
@values[VISIBLE]=value
@metafile.push([VISIBLE,value])
end
def z
return @values[Z]
end
def z=(value)
@values[Z]=value
@metafile.push([Z,value])
end
def ox
return @values[OX]
end
def ox=(value)
@values[OX]=value
@metafile.push([OX,value])
end
def oy
return @values[OY]
end
def oy=(value)
@values[OY]=value
@metafile.push([OY,value])
end
def zoom_x
return @values[ZOOM_X]
end
def zoom_x=(value)
@values[ZOOM_X]=value
@metafile.push([ZOOM_X,value])
end
def zoom_y
return @values[ZOOM_Y]
end
def zoom_y=(value)
@values[ZOOM_Y]=value
@metafile.push([ZOOM_Y,value])
end
def angle
return @values[ANGLE]
end
def angle=(value)
@values[ANGLE]=value
@metafile.push([ANGLE,value])
end
def mirror
return @values[MIRROR]
end
def mirror=(value)
@values[MIRROR]=value
@metafile.push([MIRROR,value])
end
def bush_depth
return @values[BUSH_DEPTH]
end
def bush_depth=(value)
@values[BUSH_DEPTH]=value
@metafile.push([BUSH_DEPTH,value])
end
def opacity
return @values[OPACITY]
end
def opacity=(value)
@values[OPACITY]=value
@metafile.push([OPACITY,value])
end
def blend_type
return @values[BLEND_TYPE]
end
def blend_type=(value)
@values[BLEND_TYPE]=value
@metafile.push([BLEND_TYPE,value])
end
def color
return @values[COLOR]
end
def color=(value)
@values[COLOR]=value.clone
@metafile.push([COLOR,@values[COLOR]])
end
def tone
return @values[TONE]
end
def tone=(value)
@values[TONE]=value.clone
@metafile.push([TONE,@values[TONE]])
end
def update
@metafile.push([-1,nil])
end
end
class SpriteMetafilePlayer
def initialize(metafile,sprite=nil)
@metafile=metafile
@sprites=[]
@playing=false
@index=0
@sprites.push(sprite) if sprite
end
def add(sprite)
@sprites.push(sprite)
end
def playing?
return @playing
end
def play
@playing=true
@index=0
end
def update
if @playing
for j in @index...@metafile.length
@index=j+1
break if @metafile[j][0]<0
code=@metafile[j][0]
value=@metafile[j][1]
for sprite in @sprites
case code
when SpriteMetafile::X
sprite.x=value
when SpriteMetafile::Y
sprite.y=value
when SpriteMetafile::OX
sprite.ox=value
when SpriteMetafile::OY
sprite.oy=value
when SpriteMetafile::ZOOM_X
sprite.zoom_x=value
when SpriteMetafile::ZOOM_Y
sprite.zoom_y=value
when SpriteMetafile::SRC_RECT
sprite.src_rect=value
when SpriteMetafile::VISIBLE
sprite.visible=value
when SpriteMetafile::Z
sprite.z=value
# prevent crashes
when SpriteMetafile::ANGLE
sprite.angle=(value==180) ? 179.9 : value
when SpriteMetafile::MIRROR
sprite.mirror=value
when SpriteMetafile::BUSH_DEPTH
sprite.bush_depth=value
when SpriteMetafile::OPACITY
sprite.opacity=value
when SpriteMetafile::BLEND_TYPE
sprite.blend_type=value
when SpriteMetafile::COLOR
sprite.color=value
when SpriteMetafile::TONE
sprite.tone=value
end
end
end
@playing=false if @index==@metafile.length
end
end
end
def pbSaveSpriteState(sprite)
state=[]
return state if !sprite || sprite.disposed?
state[SpriteMetafile::BITMAP] = sprite.x
state[SpriteMetafile::X] = sprite.x
state[SpriteMetafile::Y] = sprite.y
state[SpriteMetafile::SRC_RECT] = sprite.src_rect.clone
state[SpriteMetafile::VISIBLE] = sprite.visible
state[SpriteMetafile::Z] = sprite.z
state[SpriteMetafile::OX] = sprite.ox
state[SpriteMetafile::OY] = sprite.oy
state[SpriteMetafile::ZOOM_X] = sprite.zoom_x
state[SpriteMetafile::ZOOM_Y] = sprite.zoom_y
state[SpriteMetafile::ANGLE] = sprite.angle
state[SpriteMetafile::MIRROR] = sprite.mirror
state[SpriteMetafile::BUSH_DEPTH] = sprite.bush_depth
state[SpriteMetafile::OPACITY] = sprite.opacity
state[SpriteMetafile::BLEND_TYPE] = sprite.blend_type
state[SpriteMetafile::COLOR] = sprite.color.clone
state[SpriteMetafile::TONE] = sprite.tone.clone
return state
end
def pbRestoreSpriteState(sprite,state)
return if !state || !sprite || sprite.disposed?
sprite.x = state[SpriteMetafile::X]
sprite.y = state[SpriteMetafile::Y]
sprite.src_rect = state[SpriteMetafile::SRC_RECT]
sprite.visible = state[SpriteMetafile::VISIBLE]
sprite.z = state[SpriteMetafile::Z]
sprite.ox = state[SpriteMetafile::OX]
sprite.oy = state[SpriteMetafile::OY]
sprite.zoom_x = state[SpriteMetafile::ZOOM_X]
sprite.zoom_y = state[SpriteMetafile::ZOOM_Y]
sprite.angle = state[SpriteMetafile::ANGLE]
sprite.mirror = state[SpriteMetafile::MIRROR]
sprite.bush_depth = state[SpriteMetafile::BUSH_DEPTH]
sprite.opacity = state[SpriteMetafile::OPACITY]
sprite.blend_type = state[SpriteMetafile::BLEND_TYPE]
sprite.color = state[SpriteMetafile::COLOR]
sprite.tone = state[SpriteMetafile::TONE]
end
def pbSaveSpriteStateAndBitmap(sprite)
return [] if !sprite || sprite.disposed?
state=pbSaveSpriteState(sprite)
state[SpriteMetafile::BITMAP]=sprite.bitmap
return state
end
def pbRestoreSpriteStateAndBitmap(sprite,state)
return if !state || !sprite || sprite.disposed?
sprite.bitmap=state[SpriteMetafile::BITMAP]
pbRestoreSpriteState(sprite,state)
return state
end
#####################
class PokemonFusionScene
private
def pbGenerateMetafiles(s1x,s1y,s2x,s2y,s3x,s3y,sxx,s3xx)
sprite=SpriteMetafile.new
sprite3=SpriteMetafile.new
sprite2=SpriteMetafile.new
sprite.opacity=255
sprite3.opacity=255
sprite2.opacity=0
sprite.ox=s1x
sprite.oy=s1y
sprite2.ox=s2x
sprite2.oy=s2y
sprite3.ox=s3x
sprite3.oy=s3y
sprite.x = sxx
sprite3.x=s3xx
red=10
green=5
blue=90
for j in 0...26
sprite.color.red= red
sprite.color.green=green
sprite.color.blue=blue
sprite.color.alpha=j*10
sprite.color=sprite.color
sprite3.color.red= red
sprite3.color.green=green
sprite3.color.blue=blue
sprite3.color.alpha=j*10
sprite3.color=sprite3.color
sprite2.color=sprite.color
sprite.update
sprite3.update
sprite2.update
end
anglechange=0
sevenseconds=Graphics.frame_rate*3 #actually 3 seconds
for j in 0...sevenseconds
sprite.angle+=anglechange
sprite.angle%=360
sprite3.angle+=anglechange
sprite3.angle%=360
anglechange+=5 if j%2==0
if j>=sevenseconds-50
sprite2.angle=sprite.angle
sprite2.opacity+=6
end
if sprite.x < sprite3.x && j >=20
sprite.x +=2
sprite3.x -= 2
else
#sprite.ox+=1
#sprite3.ox+=1
end
sprite.update
sprite3.update
sprite2.update
end
sprite.angle=360-sprite.angle
sprite3.angle=360-sprite.angle
sprite2.angle=360-sprite2.angle
for j in 0...sevenseconds
sprite2.angle+=anglechange
sprite2.angle%=360
anglechange-=5 if j%2==0
if j<50
sprite.angle=sprite2.angle
sprite.opacity-=6
sprite3.angle=sprite2.angle
sprite3.opacity-=6
end
sprite3.update
sprite.update
sprite2.update
end
for j in 0...26
sprite2.color.red=30
sprite2.color.green=230
sprite2.color.blue=55
sprite2.color.alpha=(26-j)*10
sprite2.color=sprite2.color
sprite.color=sprite2.color
sprite.update
sprite2.update
end
@metafile1=sprite
@metafile2=sprite2
@metafile3=sprite3
end
# Starts the evolution screen with the given Pokemon and new Pokemon species.
def pbStartScreen(pokemon1,pokemon2,newspecies)
@sprites={}
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@pokemon1=pokemon1
@pokemon2=pokemon2
@newspecies=newspecies
addBackgroundOrColoredPlane(@sprites,"background","evolutionbg",
Color.new(248,248,248),@viewport)
rsprite1=PokemonSprite.new(@viewport)
rsprite2=PokemonSprite.new(@viewport)
rsprite3 =PokemonSprite.new(@viewport)
rsprite1.setPokemonBitmap(@pokemon1,false)
rsprite3.setPokemonBitmap(@pokemon2,false)
rsprite2.setPokemonBitmapSpecies(@pokemon1,@newspecies,false)
rsprite1.ox=rsprite1.bitmap.width/2
rsprite1.oy=rsprite1.bitmap.height/2
rsprite3.ox=rsprite3.bitmap.width/2
rsprite3.oy=rsprite3.bitmap.height/2
rsprite2.ox=rsprite2.bitmap.width/2
rsprite2.oy=rsprite2.bitmap.height/2
rsprite2.x=Graphics.width/2
rsprite1.y=(Graphics.height-96)/2
rsprite3.y=(Graphics.height-96)/2
rsprite1.x=(Graphics.width/2)-100
rsprite3.x=(Graphics.width/2)+100
rsprite2.y=(Graphics.height-96)/2
rsprite2.opacity=0
@sprites["rsprite1"]=rsprite1
@sprites["rsprite2"]=rsprite2
@sprites["rsprite3"]=rsprite3
pbGenerateMetafiles(rsprite1.ox,rsprite1.oy,rsprite2.ox,rsprite2.oy,rsprite3.ox,rsprite3.oy,rsprite1.x,rsprite3.x)
@sprites["msgwindow"]=Kernel.pbCreateMessageWindow(@viewport)
pbFadeInAndShow(@sprites)
####FUSION MULTIPLIER
#####LEVELS
level1 = pokemon1.level
level2 = pokemon2.level
####LEVEL DIFFERENCE
if (level1 >= level2) then
avgLevel = (2*level1 + level2)/3
else
avgLevel = (2*level2 + level1)/3
end
####CAPTURE RATES
####Check success Poke 1
# if (fusionCheckSuccess (30, leveldiff, level1,fusionmultiplier)) then
# return 1
# else
# return 0
#end
####Check success Poke 2
# if (fusionCheckSuccess (30, leveldiff, level1,fusionmultiplier)) then
# return 1
# else
# return 0
# end
return 1
end
def averageFusionIvs()
for i in 0..@pokemon1.iv.length-1
poke1Iv = @pokemon1.iv[i]
poke2Iv = @pokemon2.iv[i]
@pokemon1.iv[i] = ((poke1Iv+poke2Iv)/2).floor
end
end
#unused. was meant for super splicers, but too broken
def setHighestFusionIvs()
for i in 0..@pokemon1.iv.length-1
iv1 = @pokemon1.iv[i]
iv2 = @pokemon2.iv[i]
@pokemon1.iv[i] = iv1 >= iv2 ? iv1 : iv2
end
end
# Closes the evolution screen.
def pbEndScreen
Kernel.pbDisposeMessageWindow(@sprites["msgwindow"])
pbFadeOutAndHide(@sprites)
pbDisposeSpriteHash(@sprites)
@viewport.dispose
end
# Opens the fusion screen
def pbFusionScreen(cancancel=false,superSplicer=false)
metaplayer1=SpriteMetafilePlayer.new(@metafile1,@sprites["rsprite1"])
metaplayer2=SpriteMetafilePlayer.new(@metafile2,@sprites["rsprite2"])
metaplayer3=SpriteMetafilePlayer.new(@metafile3,@sprites["rsprite3"])
metaplayer1.play
metaplayer2.play
metaplayer3.play
pbBGMStop()
pbPlayCry(@pokemon)
Kernel.pbMessageDisplay(@sprites["msgwindow"],
_INTL("The Pokémon are being fused!",@pokemon1.name))
Kernel.pbMessageWaitForInput(@sprites["msgwindow"],100,true)
pbPlayDecisionSE()
oldstate=pbSaveSpriteState(@sprites["rsprite1"])
oldstate2=pbSaveSpriteState(@sprites["rsprite2"])
oldstate3=pbSaveSpriteState(@sprites["rsprite3"])
pbBGMPlay("fusion")
canceled = false
noMoves=false
begin
metaplayer1.update
metaplayer2.update
metaplayer3.update
Graphics.update
Input.update
if Input.trigger?(Input::B) && Input.trigger?(Input::C)# && Input.trigger?(Input::A)# && cancancel
noMoves=true
pbSEPlay("buzzer")
Graphics.update
end
end while metaplayer1.playing? && metaplayer2.playing?
if canceled
pbBGMStop()
pbPlayCancelSE()
# Kernel.pbMessageDisplay(@sprites["msgwindow"],
@pbEndScreen
_INTL("Huh? The fusion was cancelled!")
else
frames=pbCryFrameLength(@newspecies)
pbBGMStop()
pbPlayCry(@newspecies)
frames.times do
Graphics.update
end
pbMEPlay("Voltorb Flip Win")
newspeciesname=PBSpecies.getName(@newspecies)
oldspeciesname=PBSpecies.getName(@pokemon1.species)
Kernel.pbMessageDisplay(@sprites["msgwindow"],
_INTL("\\se[]Congratulations! Your Pokémon were fused into {2}!\\wt[80]",@pokemon1.name,newspeciesname))
averageFusionIvs()
#add to pokedex
if ! $Trainer.owned[@newspecies]
$Trainer.seen[@newspecies]=true
$Trainer.owned[@newspecies]=true
pbSeenForm(@pokemon)
Kernel.pbMessageDisplay(@sprites["msgwindow"],
_INTL("{1}'s data was added to the Pokédex",newspeciesname))
@scene.pbShowPokedex(@newspecies)
end
#first check if hidden ability
hiddenAbility1 = @pokemon1.ability == @pokemon1.getAbilityList[0][-1]
hiddenAbility2 = @pokemon2.ability == @pokemon2.getAbilityList[0][-1]
#change species
@pokemon1.species=@newspecies
#Check moves for new species
movelist=@pokemon1.getMoveList
for i in movelist
if i[0]==@pokemon1.level
pbLearnMove(@pokemon1,i[1]) if !noMoves #(pokemon,move,ignoreifknown=true, byTM=false , quick =true)
end
end
#@pokemon1.ability = pbChooseAbility(@pokemon1,@pokemon2)
removeItem=false
if @pokemon2.isShiny? || @pokemon1.isShiny?
@pokemon1.makeShiny
end
#make it untraded, pour qu'on puisse le unfused après, même si un des 2 était traded
@pokemon1.obtainMode = 0
@pokemon1.setAbility(pbChooseAbility(@pokemon1,hiddenAbility1,hiddenAbility2))
if superSplicer
@pokemon1.setNature(pbChooseNature(@pokemon1.nature,@pokemon2.nature))
end
movelist=@pokemon2.moves
for k in movelist
if k.id != 0
pbLearnMove(@pokemon1,k.id,true,false,true) if !noMoves
end
end
pbSEPlay("Voltorb Flip Point")
@pokemon1.firstmoves=[]
@pokemon1.name=newspeciesname if @pokemon1.name==oldspeciesname
@pokemon1.level = setPokemonLevel(@pokemon1.level, @pokemon2.level,superSplicer)
@pokemon1.calcStats
@pokemon1.obtainMode = 0
end
end
end
def setPokemonLevel(pokemon1,pokemon2,superSplicers)
lv1 = @pokemon1.level
lv2 = @pokemon2.level
if superSplicers
if lv1 > lv2
return lv1
else
return lv2
end
else
if (lv1 >= lv2) then
return (2*lv1 + lv2)/3
else
return (2*lv2 + lv1)/3
end
end
return lv1
end
def pbShowPokedex(species)
pbFadeOutIn {
scene = PokemonPokedexInfo_Scene.new
screen = PokemonPokedexInfoScreen.new(scene)
screen.pbDexEntry(species)
}
end
def pbChooseAbility(poke,hidden1=false,hidden2=false)
abilityList = poke.getAbilityList
#pas sur de l'ordre pour les hidden (3 et 4) peut-être a inverser
#Mais les fusions ont tjrs 4 hidden abilities
#2. l'autre ability du poke 1
#3. l'autre ability du poke 2
#4. hidden du poke 1
#5. hidden du poke2
abID1 = hidden1 ? abilityList[0][4] : abilityList[0][0]
abID2 = hidden2 ? abilityList[0][5] : abilityList[0][1]
if (Kernel.pbMessage("Choose an ability.",[_INTL("{1}",PBAbilities.getName(abID1)),_INTL("{1}",PBAbilities.getName(abID2))],2))==0
return hidden1 ? 4 : 0
end
return hidden2 ? 5 : 1
end
#pas au point. renvoie tjrs la mm nature
def pbChooseNature(species1,species2)
nature1 = PBNatures.getName(species1)
nature2 = PBNatures.getName(species2)
if (Kernel.pbMessage("Choose a nature.",[_INTL("{1}",nature1),_INTL("{1}",nature2)],2))==0
return PBNatures.getNum(nature1)
else
return PBNatures.getNum(nature2)
end
end
#EDITED FOR GEN2
def fixEvolutionOverflow(retB,retH,oldSpecies)
#raise Exception.new("retB: " + retB.to_s + " retH: " + retH.to_s)
oldBody = getBasePokemonID(oldSpecies)
oldHead = getBasePokemonID(oldSpecies,false)
return -1 if isNegativeOrNull(retB) && isNegativeOrNull(retH)
return oldBody*NB_POKEMON+retH if isNegativeOrNull(retB) #only head evolves
return retB*NB_POKEMON + oldHead if isNegativeOrNull(retH) #only body evolves
return retB*NB_POKEMON+retH #both evolve
end

View File

@@ -0,0 +1,940 @@
##=##===========================================================================
##=## Easy Questing System - made by M3rein
##=##===========================================================================
##=## Create your own quests starting from line 72. Be aware of the following:
##=## * Every quest should have a unique ID;
##=## * Every quest should be unique (at least one field has to be different);
##=## * The "Name" field can't be very long;
##=## * The "Desc" field can be quite long;
##=## * The "NPC" field is JUST a name;
##=## * The "Sprite" field is the name of the sprite in "Graphics/Characters";
##=## * The "Location" field is JUST a name;
##=## * The "Color" field is a SYMBOL (starts with ':'). List under "pbColor";
##=## * The "Time" field can be a random string for it to be "?????" in-game;
##=## * The "Completed" field can be pre-set, but is normally only changed in-game
##=##===========================================================================
class Quest
attr_accessor :id
attr_accessor :name
attr_accessor :desc
attr_accessor :npc
attr_accessor :sprite
attr_accessor :location
attr_accessor :color
attr_accessor :time
attr_accessor :completed
def initialize(id, name, desc, npc, sprite, location, color = :WHITE, time = Time.now, completed = false)
self.id = id
self.name = name
self.desc = desc
self.npc = npc
self.sprite = sprite
self.location = location
self.color = self.npc == "Hotel Quests"? pbColor(:BLUE) :pbColor(color)
self.time = time
self.completed = completed
end
end
def pbColor(color)
# Mix your own colors: http://www.rapidtables.com/web/color/RGB_Color.htm
return Color.new(0,0,0) if color == :BLACK
return Color.new(255,115,115) if color == :LIGHTRED
return Color.new(245,11,11) if color == :RED
return Color.new(164,3,3) if color == :DARKRED
return Color.new(47,46,46) if color == :DARKGREY
return Color.new(100,92,92) if color == :LIGHTGREY
return Color.new(226,104,250) if color == :PINK
return Color.new(243,154,154) if color == :PINKTWO
return Color.new(255,160,50) if color == :GOLD
return Color.new(255,186,107) if color == :LIGHTORANGE
return Color.new(95,54,6) if color == :BROWN
return Color.new(122,76,24) if color == :LIGHTBROWN
return Color.new(255,246,152) if color == :LIGHTYELLOW
return Color.new(242,222,42) if color == :YELLOW
return Color.new(80,111,6) if color == :DARKGREEN
return Color.new(154,216,8) if color == :GREEN
return Color.new(197,252,70) if color == :LIGHTGREEN
return Color.new(74,146,91) if color == :FADEDGREEN
return Color.new(6,128,92) if color == :DARKLIGHTBLUE
return Color.new(18,235,170) if color == :LIGHTBLUE
return Color.new(139,247,215) if color == :SUPERLIGHTBLUE
return Color.new(35,203,255) if color == :BLUE
return Color.new(3,44,114) if color == :DARKBLUE
return Color.new(7,3,114) if color == :SUPERDARKBLUE
return Color.new(63,6,121) if color == :DARKPURPLE
return Color.new(113,16,209) if color == :PURPLE
return Color.new(219,183,37) if color == :ORANGE
return Color.new(255,255,255)
end
defaultQuestColor = :PURPLE
questBranchHotels = "Hotel Quests"
questBranchField = "Field Quests"
QUESTS = [
#Pewter hotel
Quest.new(0, "Mushroom Gathering", "A lady in Pewter City wants you to bring her 3 TinyMushroom from Viridian Forest to make a stew.", questBranchHotels, "BW (74)", "Pewter City", defaultQuestColor),
Quest.new(1, "Lost Medicine", "A youngster in Pewter City needs your help to find a lost Revive. He lost it by sitting on a bench somewhere in Pewter City.", questBranchHotels, "BW (19)", "Pewter City", defaultQuestColor),
Quest.new(2, "Bug Evolution", "A Bug Catcher in Pewter City wants you to show him a fully-evolved Bug Pokémon.", questBranchHotels, "BWBugCatcher_male", "Pewter City", defaultQuestColor),
#Cerulean hotel
Quest.new(3, "Playing Cupid", "A boy in Cerulean City wants you bring a love letter to a Pokémon Breeder named Maude. She's probably somewhere in one of the routes near Cerulean City", questBranchHotels, "BW (18)","Cerulean City", defaultQuestColor),
Quest.new(4, "Fishing for Sole", "A fisherman wants you to fish up an old boot. Hook it up with the old rod in any body of water.", questBranchHotels, "BW (71)","Cerulean City", defaultQuestColor),
Quest.new(5, "Johto Pokémon", "A woman in Cerulean City wants you to show her a Pokémon native to the Johto region.", questBranchHotels, "BW (37)","Cerulean City", defaultQuestColor),
#Route 24
Quest.new(6, "Field Research (Part 1)", "Professor Oak's aide wants you to catch an Abra.", questBranchField, "BW (82)","Route 24", defaultQuestColor),
Quest.new(7, "Field Research (Part 2)", "Professor Oak's aide wants you to encounter every Pokémon on Route 24.", questBranchField, "BW (82)","Route 24", defaultQuestColor),
Quest.new(8, "Field Research (Part 3)", "Professor Oak's aide wants you to catch a Buneary using the Pokéradar.", questBranchField, "BW (82)","Route 24", defaultQuestColor),
#Vermillion City
Quest.new(9, "Unusual Types 1", "A woman at the hotel wants you to show her a Water/Fire-type Pokémon", questBranchHotels, "BW (58)","Vermillion City", defaultQuestColor),
Quest.new(10, "Trainer House", "Earn 10 Trainer Points at the Trainer House in Viridian City", questBranchHotels, "BW (55)","Vermillion City", defaultQuestColor),
Quest.new(11, "Powering the Lighthouse", "Catch some Voltorb to power up the lighthouse", questBranchHotels, "BW (43)","Vermillion City", defaultQuestColor),
Quest.new(12, "Seafood Cocktail ", "Get some steamed Krabby legs from the S.S. Anne's kitchen and bring them back to the hotel before they get cold", questBranchHotels, "BW (36)","Vermillion City", defaultQuestColor),
Quest.new(13, "Building Materials ", "Get some wooden planks from Viridian City and some Bricks from Pewter City.", questBranchField, "BW (36)","Vermillion City", defaultQuestColor),
#Celadon City
Quest.new(14, "Sun or Moon", "Show the Pokémon that Eevee evolves when exposed to a Moon or Sun stone to help the scientist with her research.", questBranchHotels, "BW (82)","Celadon City", defaultQuestColor),
Quest.new(15, "For Whom the Bell Tolls", "Ring Lavender Town's bell when the time is right to reveal its secret.", questBranchHotels, "BW (40)","Lavender Town", defaultQuestColor),
Quest.new(16, "Hardboiled", "A lady wants you to give her an egg to make an omelette.", questBranchHotels, "BW (24)","Celadon City", defaultQuestColor),
Quest.new(17, "A stroll with Eevee!", "Walk Eevee around for a while until it gets tired.", questBranchField, "BW (37)","Celadon City", defaultQuestColor),
#Fuchsia City
Quest.new(18, "Cleaning up the Cycling Road", "Get rid of all the Pokémon dirtying up the Cycling Road.", questBranchHotels, "BW (77)","Fuchsia City", defaultQuestColor),
Quest.new(19, "Lost Pokémon!", "Find the lost Chansey's trainer!", questBranchHotels, "113","Fuchsia City", defaultQuestColor),
Quest.new(20, "Bicycle Race!", "Go meet the Cyclist at the bottom of Route 17 and beat her time up the Cycling Road!", questBranchHotels, "BW032","Cycling Road", defaultQuestColor),
#Crimson City
Quest.new(21, "Shellfish Rescue", "Put all the stranded Shellders back in the water on the route to Crimson City.", questBranchHotels, "BW (48)","Crimson City", defaultQuestColor),
Quest.new(22, "Fourth Round Rumble", "Defeat Jeanette and her high-level Bellsprout in a Pokémon Battle", questBranchHotels, "BW024","Crimson City", defaultQuestColor),
Quest.new(23, "Unusual Types 2", "A woman at the hotel wants you to show her a Normal/Ghost-type Pokémon", questBranchHotels, "BW (58)","Crimson City", defaultQuestColor),
#Saffron City
Quest.new(24, "Dancing Queen!", "Dance with the Copycat Girl!", questBranchField, "BW (24)","Saffron City (nightclub)", defaultQuestColor),
Quest.new(25, "Sinnoh Pokémon", "A woman wants you to show her a Pokémon native to the Sinnoh region.", questBranchHotels, "BW (37)","Saffron City", defaultQuestColor),
Quest.new(26, "Lost Puppies", "Find all of the missing Growlithe in the routes around Saffron City.", questBranchHotels, "BW (73)","Saffron City", defaultQuestColor),
Quest.new(27, "Invisible Pokémon", "Find an invisible Pokémon in the eastern part of Saffron City.", questBranchHotels, "BW (57)","Saffron City", defaultQuestColor),
Quest.new(28, "Bad to the Bone!", "Find a Rare Bone using Rock Smash.", questBranchHotels, "BW (72)","Saffron City", defaultQuestColor),
#Cinnabar Island
Quest.new(29, "Powder metallurgy", "The scientist at the hotel wants you to find some Metal Powder.", questBranchHotels, "BW (82)","Cinnabar Island", defaultQuestColor),
Quest.new(30, "Diamonds and Pearls", "Find a Diamond Necklace to save the man's marriage.", questBranchHotels, "BW (71)","Cinnabar Island", defaultQuestColor),
Quest.new(42, "Stolen artifact", "Recover a stolen vase from a burglar in the Pokémon Mansion", questBranchHotels, "BW (21)","Cinnabar Island", defaultQuestColor),
#Goldenrod City
Quest.new(31, "Hoenn Pokémon", "A woman wants you to show her a Pokémon native to the Hoenn region.", questBranchHotels, "BW (37)","Goldenrod City", defaultQuestColor),
Quest.new(32, "Safari Souvenir!", "Bring back a souvenir from the Fuchsia City Safari Zone", questBranchHotels, "BW (28)","Goldenrod City", defaultQuestColor),
#Violet City
Quest.new(33, "Defuse the Pinecones!", "Get rid of all the Pineco on Route 31 and Route 30", questBranchHotels, "BW (64)","Violet City", defaultQuestColor),
Quest.new(34, "Find Slowpoke's Tail!", "Find a SlowpokeTail in some flowers, somewhere around Violet City!", questBranchHotels, "BW (19)","Violet City", defaultQuestColor),
#Blackthorn City
Quest.new(35, "Dragon Evolution", "A Dragon Tamer in Blackthorn City wants you to show her a fully-evolved Dragon Pokémon.", questBranchHotels, "BW014","Blackthorn City", defaultQuestColor),
Quest.new(36, "Sunken Treasure!", "Find an old memorabilia on a sunken ship near Cinnabar Island.", questBranchHotels, "BW (28)","Blackthorn City", defaultQuestColor),
Quest.new(37, "The Largest Carp", "A fisherman wants you to fish up a Magikarp that's exceptionally high-level at Dragon's Den.", questBranchHotels, "BW (71)","Blackthorn City", defaultQuestColor),
#Ecruteak City
Quest.new(38, "Kalos Pokémon", "A woman wants you to show her a Pokémon native to the Kalos region.", questBranchHotels, "BW (37)","Ecruteak City", defaultQuestColor),
Quest.new(39, "Ghost Evolution", "A girl in Ecruteak City wants you to show her a fully-evolved Ghost Pokémon.", questBranchHotels, "BW014","Ecruteak City", defaultQuestColor),
#Kin Island
Quest.new(40, "Banana Slamma!", "Collect 30 bananas", questBranchHotels, "BW029","Kin Island", defaultQuestColor),
Quest.new(41, "Unova Pokémon", "A woman wants you to show her a Pokémon native to the Unova region.", questBranchHotels, "BW (37)","Kin Island", defaultQuestColor),
Quest.new(43, "Fallen Meteor", "Investigate a crater near Bond Bridge.", questBranchHotels, "BW009","Kin Island", defaultQuestColor),
Quest.new(44, "First Contact", "Find the missing pieces of a fallen alien spaceship", questBranchHotels, "BW (92)","Bond Bridge", questBranchField),
Quest.new(45, "First Contact (Part 2)", "Ask the sailor at Cinnabar Island's harbour to take you to the uncharted island where the spaceship might be located", questBranchHotels, "BW (92)","Bond Bridge", questBranchField),
#out of order quests
#42 (cinnabar)
]
class PokeBattle_Trainer
attr_accessor :quests
end
def pbAcceptNewQuest(id,bubblePosition=20)
return if isQuestAlreadyAccepted?(id)
$game_variables[96] += 1 #nb. quests accepted
$game_variables[97] += 1 #nb. quests active
title = QUESTS[id].name
description = QUESTS[id].desc
pbMEPlay("Voltorb Flip Win")
pbCallBub(1,bubblePosition)
Kernel.pbMessage("\\C[6]NEW QUEST: " + title)
pbCallBub(1,bubblePosition)
Kernel.pbMessage("\\C[1]" + description)
pbAddQuest(id)
end
def isQuestAlreadyAccepted?(id)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for quest in $Trainer.quests
return true if quest.id == id
end
return false
end
def finishQuest(id)
$game_variables[222] +=1 # karma
$game_variables[97] -=1 #nb. quests active
$game_variables[98] +=1 #nb. quests completed
pbSetQuest(id, true)
end
def pbCompletedQuest?(id)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for i in 0...$Trainer.quests.size
return true if $Trainer.quests[i].completed && $Trainer.quests[i].id == id
end
return false
end
def pbQuestlog
Questlog.new
end
def pbAddQuest(id)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in QUESTS
$Trainer.quests << q if q.id == id
end
end
def pbDeleteQuest(id)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in $Trainer.quests
$Trainer.quests.delete(q) if q.id == id
end
end
def pbSetQuest(id, completed)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in $Trainer.quests
q.completed = completed if q.id == id
end
end
def pbSetQuestName(id, name)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in $Trainer.quests
q.name = name if q.id == id
end
end
def pbSetQuestDesc(id, desc)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in $Trainer.quests
q.desc = desc if q.id == id
end
end
def pbSetQuestNPC(id, npc)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in $Trainer.quests
q.npc = npc if q.id == id
end
end
def pbSetQuestNPCSprite(id, sprite)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in $Trainer.quests
q.sprite = sprite if q.id == id
end
end
def pbSetQuestLocation(id, location)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in $Trainer.quests
q.location = location if q.id == id
end
end
def pbSetQuestColor(id, color)
$Trainer.quests = [] if $Trainer.quests.class == NilClass
for q in $Trainer.quests
q.color = pbColor(color) if q.id == id
end
end
class QuestSprite < IconSprite
attr_accessor :quest
end
class Questlog
def initialize
$Trainer.quests = [] if $Trainer.quests.class == NilClass
@page = 0
@sel_one = 0
@sel_two = 0
@scene = 0
@mode = 0
@box = 0
@completed = []
@ongoing = []
for q in $Trainer.quests
@ongoing << q if !q.completed
@completed << q if q.completed
end
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 99999
@sprites = {}
@sprites["main"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["main"].z = 1
@sprites["main"].opacity = 0
@main = @sprites["main"].bitmap
pbSetSystemFont(@main)
pbDrawOutlineText(@main,0,2-178,512,384,"Quest Log",Color.new(255,255,255),Color.new(0,0,0),1)
@sprites["bg0"] = IconSprite.new(0, 0, @viewport)
@sprites["bg0"].setBitmap("Graphics/Pictures/pokegearbg")
@sprites["bg0"].opacity = 0
for i in 0..1
@sprites["btn#{i}"] = IconSprite.new(0, 0, @viewport)
@sprites["btn#{i}"].setBitmap("Graphics/Pictures/EQI/questBtn")
@sprites["btn#{i}"].x = 84
@sprites["btn#{i}"].y = 130 + 56 * i
@sprites["btn#{i}"].src_rect.height = (@sprites["btn#{i}"].bitmap.height / 2).round
@sprites["btn#{i}"].src_rect.y = i == 0 ? (@sprites["btn#{i}"].bitmap.height / 2).round : 0
@sprites["btn#{i}"].opacity = 0
end
pbDrawOutlineText(@main,0,142-178,512,384,"Ongoing: " + @ongoing.size.to_s,Color.new(255,255,255),Color.new(0,0,0),1)
pbDrawOutlineText(@main,0,198-178,512,384,"Completed: " + @completed.size.to_s,Color.new(255,255,255),Color.new(0,0,0),1)
12.times do |i|
Graphics.update
@sprites["bg0"].opacity += 32 if i < 8
@sprites["btn0"].opacity += 32 if i > 3
@sprites["btn1"].opacity += 32 if i > 3
@sprites["main"].opacity += 64 if i > 7
end
pbUpdate
end
def pbUpdate
@frame = 0
loop do
@frame += 1
Graphics.update
Input.update
if @scene == 0
break if Input.trigger?(Input::B)
pbList(@sel_one) if Input.trigger?(Input::C)
pbSwitch(:DOWN) if Input.trigger?(Input::DOWN)
pbSwitch(:UP) if Input.trigger?(Input::UP)
end
if @scene == 1
pbMain if Input.trigger?(Input::B)
pbMove(:DOWN) if Input.trigger?(Input::DOWN)
pbMove(:UP) if Input.trigger?(Input::UP)
pbLoad(0) if Input.trigger?(Input::C)
pbArrows
end
if @scene == 2
pbList(@sel_one) if Input.trigger?(Input::B)
pbChar if @frame == 6 || @frame == 12 || @frame == 18
#pbLoad(1) if Input.trigger?(Input::RIGHT) && @page == 0
#pbLoad(2) if Input.trigger?(Input::LEFT) && @page == 1
end
@frame = 0 if @frame == 18
end
pbEnd
pbDisposeSpriteHash(@sprites)
@viewport.dispose
pbWait(1)
end
def pbArrows
if @frame == 2 || @frame == 4 || @frame == 14 || @frame == 16
@sprites["up"].y -= 1 rescue nil
@sprites["down"].y -= 1 rescue nil
elsif @frame == 6 || @frame == 8 || @frame == 10 || @frame == 12
@sprites["up"].y += 1 rescue nil
@sprites["down"].y += 1 rescue nil
end
end
def pbLoad(page)
return if @mode == 0 ? @ongoing.size == 0 : @completed.size == 0
quest = @mode == 0 ? @ongoing[@sel_two] : @completed[@sel_two]
pbWait(1)
if page == 0
@scene = 2
@sprites["bg1"] = IconSprite.new(0, 0, @viewport)
@sprites["bg1"].setBitmap("Graphics/Pictures/EQI/questPage1")
@sprites["bg1"].opacity = 0
@sprites["pager"] = IconSprite.new(0, 0, @viewport)
@sprites["pager"].setBitmap("Graphics/Pictures/EQI/questPager")
@sprites["pager"].x = 442
@sprites["pager"].y = 3
@sprites["pager"].z = 1
@sprites["pager"].opacity = 0
8.times do
Graphics.update
@sprites["up"].opacity -= 32
@sprites["down"].opacity -= 32
@sprites["main"].opacity -= 32
@sprites["bg1"].opacity += 32
@sprites["pager"].opacity =0
@sprites["char"].opacity -= 32 rescue nil
for i in 0...@ongoing.size
break if i > 5
@sprites["ongoing#{i}"].opacity -= 32 rescue nil
end
for i in 0...@completed.size
break if i > 5
@sprites["completed#{i}"].opacity -= 32 rescue nil
end
end
@sprites["up"].dispose
@sprites["down"].dispose
@sprites["char"] = IconSprite.new(0, 0, @viewport)
@sprites["char"].setBitmap("Graphics/Characters/#{quest.sprite}")
@sprites["char"].x = 62
@sprites["char"].y = 130
@sprites["char"].src_rect.height = (@sprites["char"].bitmap.height / 4).round
@sprites["char"].src_rect.width = (@sprites["char"].bitmap.width / 4).round
@sprites["char"].opacity = 0
@main.clear
@text.clear rescue nil
@text2.clear rescue nil
drawTextExMulti(@main,188,54,318,8,quest.desc,Color.new(255,255,255),Color.new(0,0,0))
pbDrawOutlineText(@main,188,162,512,384,quest.location,Color.new(255,172,115),Color.new(0,0,0))
pbDrawOutlineText(@main,10,-178,512,384,quest.name,quest.color,Color.new(0,0,0))
if !quest.completed
pbDrawOutlineText(@main,8,136,512,384,"Not Completed",pbColor(:LIGHTRED),Color.new(0,0,0))
else
pbDrawOutlineText(@main,8,136,512,384,"Completed",pbColor(:LIGHTBLUE),Color.new(0,0,0))
end
10.times do |i|
Graphics.update
@sprites["main"].opacity += 32
@sprites["char"].opacity += 32 if i > 1
end
elsif page == 1
@page = 1
@sprites["bg2"] = IconSprite.new(0, 0, @viewport)
@sprites["bg2"].setBitmap("Graphics/Pictures/EQI/questPage1")
@sprites["bg2"].x = 512
@sprites["pager2"] = IconSprite.new(0, 0, @viewport)
#@sprites["pager2"].setBitmap("Graphics/Pictures/EQI/questPager")
#@sprites["pager2"].x = 474 + 512
#@sprites["pager2"].y = 3
#@sprites["pager2"].z = 1
@sprites["char2"].dispose rescue nil
@sprites["char2"] = IconSprite.new(0, 0, @viewport)
@sprites["char2"].setBitmap("Graphics/Characters/#{quest.sprite}")
@sprites["char2"].x = 62 + 512
@sprites["char2"].y = 130
@sprites["char2"].z = 1
@sprites["char2"].src_rect.height = (@sprites["char2"].bitmap.height / 4).round
@sprites["char2"].src_rect.width = (@sprites["char2"].bitmap.width / 4).round
@sprites["text2"] = IconSprite.new(@viewport)
@sprites["text2"].bitmap = Bitmap.new(Graphics.width,Graphics.height)
@text2 = @sprites["text2"].bitmap
pbSetSystemFont(@text2)
pbDrawOutlineText(@text2,188,-122,512,384,"Quest received in:",Color.new(255,255,255),Color.new(0,0,0))
pbDrawOutlineText(@text2,188,-94,512,384,quest.location,Color.new(255,172,115),Color.new(0,0,0))
pbDrawOutlineText(@text2,188,-62,512,384,"Quest received at:",Color.new(255,255,255),Color.new(0,0,0))
time = quest.time.to_s
txt = time.split(' ')[1] + " " + time.split(' ')[2] + ", " + time.split(' ')[3].split(':')[0] + ":" + time.split(' ')[3].split(':')[1] rescue "?????"
pbDrawOutlineText(@text2,188,-36,512,384,txt,Color.new(255,172,115),Color.new(0,0,0))
pbDrawOutlineText(@text2,188,-4,512,384,"Quest received from:",Color.new(255,255,255),Color.new(0,0,0))
pbDrawOutlineText(@text2,188,22,512,384,quest.npc,Color.new(255,172,115),Color.new(0,0,0))
pbDrawOutlineText(@text2,188,162,512,384,"From " + quest.npc,Color.new(255,172,115),Color.new(0,0,0))
pbDrawOutlineText(@text2,10,-178,512,384,quest.name,quest.color,Color.new(0,0,0))
if !quest.completed
pbDrawOutlineText(@text2,8,136,512,384,"Not Completed",pbColor(:LIGHTRED),Color.new(0,0,0))
else
pbDrawOutlineText(@text2,8,136,512,384,"Completed",pbColor(:LIGHTBLUE),Color.new(0,0,0))
end
@sprites["text2"].x = 512
16.times do
Graphics.update
@sprites["bg1"].x -= (@sprites["bg1"].x + 526) * 0.2
@sprites["pager"].x -= (@sprites["pager"].x + 526) * 0.2 rescue nil
@sprites["char"].x -= (@sprites["char"].x + 526) * 0.2 rescue nil
@sprites["main"].x -= (@sprites["main"].x + 526) * 0.2
@sprites["text"].x -= (@sprites["text"].x + 526) * 0.2 rescue nil
@sprites["bg2"].x -= (@sprites["bg2"].x + 14) * 0.2
@sprites["pager2"].x -= (@sprites["pager2"].x - 459) * 0.2
@sprites["text2"].x -= (@sprites["text2"].x + 14) * 0.2
@sprites["char2"].x -= (@sprites["char2"].x - 47) * 0.2
end
@sprites["main"].x = 0
@main.clear
else
@page = 0
@sprites["bg1"] = IconSprite.new(0, 0, @viewport)
@sprites["bg1"].setBitmap("Graphics/Pictures/EQI/questPage1")
@sprites["bg1"].x = -512
@sprites["pager"] = IconSprite.new(0, 0, @viewport)
@sprites["pager"].setBitmap("Graphics/Pictures/EQI/questPager")
@sprites["pager"].x = 442 - 512
@sprites["pager"].y = 3
@sprites["pager"].z = 1
@sprites["text"] = IconSprite.new(@viewport)
@sprites["text"].bitmap = Bitmap.new(Graphics.width,Graphics.height)
@text = @sprites["text"].bitmap
pbSetSystemFont(@text)
@sprites["char"].dispose rescue nil
@sprites["char"] = IconSprite.new(0, 0, @viewport)
@sprites["char"].setBitmap("Graphics/Characters/#{quest.sprite}")
@sprites["char"].x = 62 - 512
@sprites["char"].y = 130
@sprites["char"].z = 1
@sprites["char"].src_rect.height = (@sprites["char"].bitmap.height / 4).round
@sprites["char"].src_rect.width = (@sprites["char"].bitmap.width / 4).round
drawTextExMulti(@text,188,54,318,8,quest.desc,Color.new(255,255,255),Color.new(0,0,0))
pbDrawOutlineText(@text,188,162,512,384,"From " + quest.npc,Color.new(255,172,115),Color.new(0,0,0))
pbDrawOutlineText(@text,10,-178,512,384,quest.name,quest.color,Color.new(0,0,0))
if !quest.completed
pbDrawOutlineText(@text,8,136,512,384,"Not Completed",pbColor(:LIGHTRED),Color.new(0,0,0))
else
pbDrawOutlineText(@text,8,136,512,384,"Completed",pbColor(:LIGHTBLUE),Color.new(0,0,0))
end
@sprites["text"].x = -512
16.times do
Graphics.update
@sprites["bg1"].x -= (@sprites["bg1"].x - 14) * 0.2
@sprites["pager"].x -= (@sprites["pager"].x - 457) * 0.2
@sprites["bg2"].x -= (@sprites["bg2"].x - 526) * 0.2
@sprites["pager2"].x -= (@sprites["pager2"].x - 526) * 0.2
@sprites["char2"].x -= (@sprites["char2"].x - 526) * 0.2
@sprites["text2"].x -= (@sprites["text2"].x - 526) * 0.2
@sprites["text"].x -= (@sprites["text"].x - 15) * 0.2
@sprites["char"].x -= (@sprites["char"].x - 76) * 0.2
end
end
end
def pbChar
@sprites["char"].src_rect.x += (@sprites["char"].bitmap.width / 4).round rescue nil
@sprites["char"].src_rect.x = 0 if @sprites["char"].src_rect.x >= @sprites["char"].bitmap.width rescue nil
@sprites["char2"].src_rect.x += (@sprites["char2"].bitmap.width / 4).round rescue nil
@sprites["char2"].src_rect.x = 0 if @sprites["char2"].src_rect.x >= @sprites["char2"].bitmap.width rescue nil
end
def pbMain
pbWait(1)
12.times do |i|
Graphics.update
@sprites["main"].opacity -= 32 rescue nil
@sprites["bg0"].opacity += 32 if @sprites["bg0"].opacity < 255
@sprites["bg1"].opacity -= 32 rescue nil if i > 3
@sprites["bg2"].opacity -= 32 rescue nil if i > 3
@sprites["pager"].opacity -= 32 rescue nil if i > 3
@sprites["pager2"].opacity -= 32 rescue nil if i > 3
@sprites["char"].opacity -= 32 rescue nil
@sprites["char2"].opacity -= 32 rescue nil
@sprites["text"].opacity -= 32 rescue nil
@sprites["up"].opacity -= 32
@sprites["down"].opacity -= 32
for j in 0...@ongoing.size
@sprites["ongoing#{j}"].opacity -= 32 rescue nil
end
for j in 0...@completed.size
@sprites["completed#{j}"].opacity -= 32 rescue nil
end
end
@sprites["up"].dispose
@sprites["down"].dispose
@main.clear
@text.clear rescue nil
@text2.clear rescue nil
@sel_two = 0
@scene = 0
pbDrawOutlineText(@main,0,2-178,512,384,"Quest Log",Color.new(255,255,255),Color.new(0,0,0),1)
pbDrawOutlineText(@main,0,142-178,512,384,"Ongoing: " + @ongoing.size.to_s,Color.new(255,255,255),Color.new(0,0,0),1)
pbDrawOutlineText(@main,0,198-178,512,384,"Completed: " + @completed.size.to_s,Color.new(255,255,255),Color.new(0,0,0),1)
12.times do |i|
Graphics.update
@sprites["bg0"].opacity += 32 if i < 8
@sprites["btn0"].opacity += 32 if i > 3
@sprites["btn1"].opacity += 32 if i > 3
@sprites["main"].opacity += 48 if i > 5
end
end
def pbSwitch(dir)
if dir == :DOWN
return if @sel_one == 1
@sprites["btn#{@sel_one}"].src_rect.y = 0
@sel_one += 1
@sprites["btn#{@sel_one}"].src_rect.y = (@sprites["btn#{@sel_one}"].bitmap.height / 2).round
else
return if @sel_one == 0
@sprites["btn#{@sel_one}"].src_rect.y = 0
@sel_one -= 1
@sprites["btn#{@sel_one}"].src_rect.y = (@sprites["btn#{@sel_one}"].bitmap.height / 2).round
end
end
def pbMove(dir)
pbWait(1)
if dir == :DOWN
return if @sel_two == @ongoing.size - 1 && @mode == 0
return if @sel_two == @completed.size - 1 && @mode == 1
return if @ongoing.size == 0 && @mode == 0
return if @completed.size == 0 && @mode == 1
@sprites["ongoing#{@box}"].src_rect.y = 0 if @mode == 0
@sprites["completed#{@box}"].src_rect.y = 0 if @mode == 1
@sel_two += 1
@box += 1
@box = 5 if @box > 5
@sprites["ongoing#{@box}"].src_rect.y = (@sprites["ongoing#{@box}"].bitmap.height / 2).round if @mode == 0
@sprites["completed#{@box}"].src_rect.y = (@sprites["completed#{@box}"].bitmap.height / 2).round if @mode == 1
if @box == 5
@main.clear
if @mode == 0
for i in 0...@ongoing.size
break if i > 5
j = (i==0 ? -5 : (i==1 ? -4 : (i==2 ? -3 : (i==3 ? -2 : (i==4 ? -1 : 0)))))
@sprites["ongoing#{i}"].quest = @ongoing[@sel_two+j]
pbDrawOutlineText(@main,11,-124+52*i,512,384,@ongoing[@sel_two+j].name,@ongoing[@sel_two+j].color,Color.new(0,0,0),1)
end
if @sprites["ongoing0"] != @ongoing[0]
@sprites["up"].visible = true
else
@sprites["up"].visible = false
end
if @sprites["ongoing5"] != @ongoing[@ongoing.size - 1]
@sprites["down"].visible = true
else
@sprites["down"].visible = false
end
pbDrawOutlineText(@main,0,2-178,512,384,"Ongoing Quests",Color.new(255,255,255),Color.new(0,0,0),1)
else
for i in 0...@completed.size
break if i > 5
j = (i==0 ? -5 : (i==1 ? -4 : (i==2 ? -3 : (i==3 ? -2 : (i==4 ? -1 : 0)))))
@sprites["completed#{i}"].quest = @completed[@sel_two+j]
pbDrawOutlineText(@main,11,-124+52*i,512,384,@completed[@sel_two+j].name,@completed[@sel_two+j].color,Color.new(0,0,0),1)
end
if @sprites["completed0"] != @completed[0]
@sprites["up"].visible = true
else
@sprites["up"].visible = false
end
if @sprites["completed5"] != @completed[@completed.size - 1]
@sprites["down"].visible = true
else
@sprites["down"].visible = false
end
pbDrawOutlineText(@main,0,2-178,512,384,"Completed Quests",Color.new(255,255,255),Color.new(0,0,0),1)
end
end
else
return if @sel_two == 0
return if @ongoing.size == 0 && @mode == 0
return if @completed.size == 0 && @mode == 1
@sprites["ongoing#{@box}"].src_rect.y = 0 if @mode == 0
@sprites["completed#{@box}"].src_rect.y = 0 if @mode == 1
@sel_two -= 1
@box -= 1
@box = 0 if @box < 0
@sprites["ongoing#{@box}"].src_rect.y = (@sprites["ongoing#{@box}"].bitmap.height / 2).round if @mode == 0
@sprites["completed#{@box}"].src_rect.y = (@sprites["completed#{@box}"].bitmap.height / 2).round if @mode == 1
if @box == 0
@main.clear
if @mode == 0
for i in 0...@ongoing.size
break if i > 5
@sprites["ongoing#{i}"].quest = @ongoing[@sel_two+i]
pbDrawOutlineText(@main,11,-124+52*i,512,384,@ongoing[@sel_two+i].name,@ongoing[@sel_two+i].color,Color.new(0,0,0),1)
end
if @sprites["ongoing5"] != @ongoing[0]
@sprites["up"].visible = true
else
@sprites["up"].visible = false
end
if @sprites["ongoing5"] != @ongoing[@ongoing.size - 1]
@sprites["down"].visible = true
else
@sprites["down"].visible = false
end
pbDrawOutlineText(@main,0,2-178,512,384,"Ongoing Quests",Color.new(255,255,255),Color.new(0,0,0),1)
else
for i in 0...@completed.size
break if i > 5
@sprites["completed#{i}"].quest = @completed[@sel_two+i]
pbDrawOutlineText(@main,11,-124+52*i,512,384,@completed[@sel_two+i].name,@completed[@sel_two+i].color,Color.new(0,0,0),1)
end
if @sprites["completed0"] != @completed[0]
@sprites["up"].visible = true
else
@sprites["up"].visible = false
end
if @sprites["completed5"] != @completed[@completed.size - 1]
@sprites["down"].visible = true
else
@sprites["down"].visible = false
end
pbDrawOutlineText(@main,0,2-178,512,384,"Completed Quests",Color.new(255,255,255),Color.new(0,0,0),1)
end
end
end
end
def pbList(id)
pbWait(1)
@sel_two = 0
@page = 0
@scene = 1
@mode = id
@box = 0
@sprites["up"] = IconSprite.new(0, 0, @viewport)
@sprites["up"].setBitmap("Graphics/Pictures/EQI/questArrow")
@sprites["up"].zoom_x = 1.25
@sprites["up"].zoom_y = 1.25
@sprites["up"].x = Graphics.width / 2
@sprites["up"].y = 36
@sprites["up"].z = 2
@sprites["up"].visible = false
@sprites["down"] = IconSprite.new(0, 0, @viewport)
@sprites["down"].setBitmap("Graphics/Pictures/EQI/questArrow")
@sprites["down"].zoom_x = 1.25
@sprites["down"].zoom_y = 1.25
@sprites["down"].x = Graphics.width / 2 + 21
@sprites["down"].y = 360
@sprites["down"].z = 2
@sprites["down"].angle = 180
@sprites["down"].visible = @mode == 0 ? @ongoing.size > 6 : @completed.size > 6
@sprites["down"].opacity = 0
10.times do |i|
Graphics.update
@sprites["btn0"].opacity -= 32 if i > 1
@sprites["btn1"].opacity -= 32 if i > 1
@sprites["main"].opacity -= 32 if i > 1
@sprites["bg1"].opacity -= 32 rescue nil if i > 1
@sprites["bg2"].opacity -= 32 rescue nil if i > 1
@sprites["pager"].opacity -= 32 rescue nil if i > 1
@sprites["pager2"].opacity -= 32 rescue nil if i > 1
@sprites["char"].opacity -= 32 rescue nil
@sprites["char2"].opacity -= 32 rescue nil
@sprites["text"].opacity -= 32 rescue nil if i > 1
@sprites["text2"].opacity -= 32 rescue nil if i > 1
end
@main.clear
@text.clear rescue nil
@text2.clear rescue nil
if id == 0
for i in 0...@ongoing.size
break if i > 5
@sprites["ongoing#{i}"] = QuestSprite.new(0, 0, @viewport)
@sprites["ongoing#{i}"].setBitmap("Graphics/Pictures/EQI/questBtn")
@sprites["ongoing#{i}"].quest = @ongoing[i]
@sprites["ongoing#{i}"].x = 94
@sprites["ongoing#{i}"].y = 42 + 52 * i
@sprites["ongoing#{i}"].src_rect.height = (@sprites["ongoing#{i}"].bitmap.height / 2).round
@sprites["ongoing#{i}"].src_rect.y = (@sprites["ongoing#{i}"].bitmap.height / 2).round if i == @sel_two
@sprites["ongoing#{i}"].opacity = 0
pbDrawOutlineText(@main,11,-124+52*i,512,384,@ongoing[i].name,@ongoing[i].color,Color.new(0,0,0),1)
end
pbDrawOutlineText(@main,0,0,512,384,"No ongoing quests",pbColor(:WHITE),pbColor(:BLACK),1) if @ongoing.size == 0
pbDrawOutlineText(@main,0,2-178,512,384,"Ongoing Quests",Color.new(255,255,255),Color.new(0,0,0),1)
12.times do |i|
Graphics.update
@sprites["main"].opacity += 32 if i < 8
for j in 0...@ongoing.size
break if j > 5
@sprites["ongoing#{j}"].opacity += 32 if i > 3
end
end
elsif id == 1
for i in 0...@completed.size
break if i > 5
@sprites["completed#{i}"] = QuestSprite.new(0, 0, @viewport)
@sprites["completed#{i}"].setBitmap("Graphics/Pictures/EQI/questBtn")
@sprites["completed#{i}"].x = 94
@sprites["completed#{i}"].y = 42 + 52 * i
@sprites["completed#{i}"].src_rect.height = (@sprites["completed#{i}"].bitmap.height / 2).round
@sprites["completed#{i}"].src_rect.y = (@sprites["completed#{i}"].bitmap.height / 2).round if i == @sel_two
@sprites["completed#{i}"].opacity = 0
pbDrawOutlineText(@main,11,-124+52*i,512,384,@completed[i].name,@completed[i].color,Color.new(0,0,0),1)
end
pbDrawOutlineText(@main,0,0,512,384,"No completed quests",pbColor(:WHITE),pbColor(:BLACK),1) if @completed.size == 0
pbDrawOutlineText(@main,0,2-178,512,384,"Completed Quests",Color.new(255,255,255),Color.new(0,0,0),1)
12.times do |i|
Graphics.update
@sprites["main"].opacity += 32 if i < 8
@sprites["down"].opacity += 32 if i > 3
for j in 0...@completed.size
break if j > 5
@sprites["completed#{j}"].opacity += 32 if i > 3
end
end
end
end
def pbEnd
12.times do |i|
Graphics.update
@sprites["bg0"].opacity -= 32 if i > 3
@sprites["btn0"].opacity -= 32
@sprites["btn1"].opacity -= 32
@sprites["main"].opacity -= 32
@sprites["char"].opacity -= 40 rescue nil
@sprites["char2"].opacity -= 40 rescue nil
end
end
end
#TODO: à terminer
def pbSynchronizeQuestLog()
########################
### Quest started ###
########################
#Pewter
pbAddQuest(0) if $game_switches[926]
pbAddQuest(1) if $game_switches[927]
#Cerulean
pbAddQuest(3) if $game_switches[931]
pbAddQuest(4) if $game_switches[942] || $game_self_switches[[462,7,"A"]]
#Vermillion
pbAddQuest(10) if $game_self_switches[[464,6,"A"]]
pbAddQuest(11) if $game_switches[945]
pbAddQuest(12) if $game_switches[929]
pbAddQuest(13) if $game_switches[175]
#Celadon
pbAddQuest(14) if $game_self_switches[[466,10,"A"]]
pbAddQuest(15) if $game_switches[185]
pbAddQuest(16) if $game_switches[946]
pbAddQuest(17) if $game_switches[172]
#Fuchsia
pbAddQuest(18) if $game_switches[941]
pbAddQuest(19) if $game_switches[943]
pbAddQuest(20) if $game_switches[949]
#Crimson
pbAddQuest(21) if $game_switches[940]
pbAddQuest(22) if $game_self_switches[[177,9,"A"]]
pbAddQuest(23) if $game_self_switches[[177,8,"A"]]
#Saffron
pbAddQuest(24) if $game_switches[932]
pbAddQuest(25) if $game_self_switches[[111,19,"A"]]
pbAddQuest(26) if $game_switches[948]
pbAddQuest(27) if $game_switches[339]
pbAddQuest(28) if $game_switches[300]
#Cinnabar
pbAddQuest(29) if $game_switches[904]
pbAddQuest(30) if $game_switches[903]
#Goldenrod
pbAddQuest(31) if $game_self_switches[[244,5,"A"]]
pbAddQuest(32) if $game_self_switches[[244,8,"A"]]
#Violet
pbSetQuest(33,true) if $game_switches[908]
pbSetQuest(34,true) if $game_switches[410]
#Blackthorn
pbSetQuest(35,true) if $game_self_switches[[332,10,"A"]]
pbSetQuest(36,true) if $game_self_switches[[332,8,"A"]]
pbSetQuest(37,true) if $game_self_switches[[332,5,"B"]]
#Ecruteak
pbSetQuest(38,true) if $game_self_switches[[576,9,"A"]]
pbSetQuest(39,true) if $game_self_switches[[576,8,"A"]]
#Kin
pbSetQuest(40,true) if $game_switches[526]
pbSetQuest(41,true) if $game_self_switches[[565,10,"A"]]
########################
### Quest finished ###
########################
#Pewter
pbSetQuest(0,true) if $game_self_switches[[460,5,"A"]]
pbSetQuest(1,true) if $game_self_switches[[460,7,"A"]] || $game_self_switches[[460,7,"B"]]
if $game_self_switches[[460,9,"A"]]
pbAddQuest(2)
pbSetQuest(2,true)
end
#Cerulean
if $game_self_switches[[462,8,"A"]]
pbAddQuest(5)
pbSetQuest(5,true)
end
pbSetQuest(3,true) if $game_switches[931] && !$game_switches[939]
pbSetQuest(4,true) if $game_self_switches[[462,7,"A"]]
#Vermillion
pbSetQuest(13,true) if $game_self_switches[[19,19,"B"]]
if $game_self_switches[[464,8,"A"]]
pbAddQuest(9)
pbSetQuest(9,true)
end
pbSetQuest(10,true) if $game_self_switches[[464,6,"B"]]
pbSetQuest(11,true) if $game_variables[145] >=1
pbSetQuest(12,true) if $game_self_switches[[464,5,"A"]]
#Celadon
pbSetQuest(14,true) if $game_self_switches[[466,10,"A"]]
pbSetQuest(15,true) if $game_switches[947]
pbSetQuest(16,true) if $game_self_switches[[466,9,"A"]]
pbSetQuest(17,true) if $game_self_switches[[509,5,"D"]]
#Fuchsia
pbSetQuest(18,true) if $game_self_switches[[478,6,"A"]]
pbSetQuest(19,true) if $game_self_switches[[478,8,"A"]]
pbSetQuest(20,true) if $game_switches[922]
#Crimson
pbSetQuest(21,true) if $game_self_switches[[177,5,"A"]]
pbSetQuest(22,true) if $game_self_switches[[177,9,"A"]]
pbSetQuest(23,true) if $game_self_switches[[177,8,"A"]]
#Saffron
pbSetQuest(24,true) if $game_switches[938]
pbSetQuest(25,true) if $game_self_switches[[111,19,"A"]]
pbSetQuest(26,true) if $game_self_switches[[111,9,"A"]]
pbSetQuest(27,true) if $game_switches[338]
pbSetQuest(28,true) if $game_self_switches[[111,18,"A"]]
#Cinnabar
pbSetQuest(29,true) if $game_self_switches[[136,5,"A"]]
pbSetQuest(30,true) if $game_self_switches[[136,8,"A"]]
#Goldenrod
pbSetQuest(31,true) if $game_self_switches[[244,5,"A"]]
pbSetQuest(32,true) if $game_self_switches[[244,8,"B"]]
#Violet
pbSetQuest(33,true) if $game_self_switches[[274,5,"A"]]
pbSetQuest(34,true) if $game_self_switches[[274,8,"A"]] || $game_self_switches[[274,8,"B"]]
#Blackthorn
pbSetQuest(35,true) if $game_self_switches[[332,10,"A"]]
pbSetQuest(36,true) if $game_switches[337]
pbSetQuest(37,true) if $game_self_switches[[332,5,"A"]]
#Ecruteak
pbSetQuest(38,true) if $game_self_switches[[576,9,"A"]]
pbSetQuest(39,true) if $game_self_switches[[576,8,"A"]]
#Kin
pbSetQuest(40,true) if $game_self_switches[[565,9,"A"]]
pbSetQuest(41,true) if $game_self_switches[[565,10,"A"]]
end

File diff suppressed because it is too large Load Diff