Update 6.8

This commit is contained in:
chardub
2026-07-10 15:42:06 -04:00
parent 5b85e72cb2
commit 6a6f126a18
7871 changed files with 493194 additions and 224826 deletions
@@ -1,32 +1,39 @@
def setDialogIconOff(eventId=nil)
eventId = @event_id if !eventId
event = $game_map.events[eventId]
return unless event
event.setDialogIconManualOffValue(true)
event.setTradeIconManualOffValue(true)
event.setTutorIconManualOffValue(true)
end
def setDialogIconOn(eventId=nil)
eventId = @event_id if !eventId
event = $game_map.events[eventId]
return unless event
event.setDialogIconManualOffValue(false)
event.setTradeIconManualOffValue(false)
event.setTutorIconManualOffValue(false)
end
class Game_Event < Game_Character
#set from analyzing the event's content at load
attr_accessor :show_quest_icon
attr_accessor :show_dialog_icon
attr_accessor :show_trade_icon
attr_accessor :show_tutor_icon
#set manually from inside the event when triggered
attr_accessor :quest_icon_manual_off
attr_accessor :dialog_icon_manual_off
attr_accessor :trade_icon_manual_off
attr_accessor :tutor_icon_manual_off
QUEST_NPC_TRIGGER = "questNPC"
MAPS_WITH_NO_ICONS = [] #Maps in which the game shouldn't try to look for quest icons(e.g. maps with a lot of events - mostly for possible performance issues)
DIALOG_ICON_COMMENT_TRIGGER=["dialogIcon"]
QUEST_ICON_COMMENT_TRIGGER=["questIcon"] #Only when it can't be defined in the event's name (multiple page - only one is quest giver)
TRADE_ICON_COMMENT_TRIGGER=["tradeIcon"]
MOVE_TUTOR_ICON_COMMENT_TRIGGER=["tutorIcon"]
alias eventQuestIcon_init initialize
def initialize(map_id, event, map=nil)
@@ -34,6 +41,19 @@ class Game_Event < Game_Character
addQuestMarkersToSprite unless MAPS_WITH_NO_ICONS.include?($game_map.map_id)
end
alias _orig_start start
def start
setDialogIconManualOffValue(true)
setQuestIconManualOffValue(true)
_orig_start
end
alias eventQuestIcon_refresh refresh
def refresh
eventQuestIcon_refresh
addQuestMarkersToSprite
end
def setDialogIconManualOffValue(value)
@dialog_icon_manual_off=value
@show_dialog_icon = !@dialog_icon_manual_off
@@ -47,28 +67,37 @@ class Game_Event < Game_Character
@show_trade_icon = !@trade_icon_manual_off
end
def setTutorIconManualOffValue(value)
@tutor_icon_manual_off=value
@show_tutor_icon = !@tutor_icon_manual_off
end
def addQuestMarkersToSprite()
@show_quest_icon = detectQuestSwitch(self) && !@quest_icon_manual_off
@show_quest_icon = (detectQuestSwitch(self) || detectQuestIcon(self)) && !@quest_icon_manual_off
@show_dialog_icon = detectDialogueIcon(self) && !@dialog_icon_manual_off
@show_trade_icon = detectTradeIcon(self) && !@trade_icon_manual_off
@show_tutor_icon = detectTutorIcon(self) && !@tutor_icon_manual_off
end
def detectDialogueIcon(event)
return nil if !validateEventIsCompatibleWithIcons(event)
page = pbGetActiveEventPage(event)
first_command = page.list[0]
return nil if !(first_command.code == 108 || first_command.code == 408)
comments = first_command.parameters
return comments.any? { |str| DIALOG_ICON_COMMENT_TRIGGER.include?(str) }
return detectCommentCommand(DIALOG_ICON_COMMENT_TRIGGER,event)
end
def detectTradeIcon(event)
return nil if !validateEventIsCompatibleWithIcons(event)
page = pbGetActiveEventPage(event)
first_command = page.list[0]
return nil if !(first_command.code == 108 || first_command.code == 408)
comments = first_command.parameters
return comments.any? { |str| TRADE_ICON_COMMENT_TRIGGER.include?(str) }
return detectCommentCommand(TRADE_ICON_COMMENT_TRIGGER,event)
end
def detectQuestIcon(event)
return nil if !validateEventIsCompatibleWithIcons(event)
return detectCommentCommand(QUEST_ICON_COMMENT_TRIGGER,event)
end
def detectTutorIcon(event)
return nil if !validateEventIsCompatibleWithIcons(event)
return detectCommentCommand(MOVE_TUTOR_ICON_COMMENT_TRIGGER,event)
end
def detectQuestSwitch(event)
@@ -86,6 +115,7 @@ class Game_Event < Game_Character
def validateEventIsCompatibleWithIcons(event)
return false if event.is_a?(Game_Player)
return false if event.erased
return false unless event.visible?
page = pbGetActiveEventPage(event)
return false unless page
return false if page.graphic.character_name.empty?
@@ -98,9 +128,10 @@ end
class Sprite_Character
DIALOGUE_ICON_NAME = "Graphics/Pictures/Quests/dialogIcon"
QUEST_ICON_NAME = "Graphics/Pictures/Quests/questIcon"
TRADE_ICON_NAME = "Graphics/Pictures/Quests/tradeIcon"
DIALOGUE_ICON_NAME = "Graphics/Pictures/NPCIcons/dialogIcon"
QUEST_ICON_NAME = "Graphics/Pictures/NPCIcons/questIcon"
TRADE_ICON_NAME = "Graphics/Pictures/NPCIcons/tradeIcon"
TUTOR_ICON_NAME = "Graphics/Pictures/NPCIcons/tutorIcon"
attr_accessor :questIcon
alias questIcon_init initialize
@@ -115,6 +146,9 @@ class Sprite_Character
if character.is_a?(Game_Event) && character.show_trade_icon
addQuestMarkerToSprite(:TRADE_ICON)
end
if character.is_a?(Game_Event) && character.show_tutor_icon
addQuestMarkerToSprite(:TUTOR_ICON)
end
#addQuestMarkersToSprite(character) unless MAPS_WITH_NO_ICONS.include?($game_map.map_id)
end
@@ -137,7 +171,22 @@ class Sprite_Character
end
def updateGameEvent
removeQuestIcon if !@character.show_dialog_icon && !@character.show_quest_icon && !@character.show_trade_icon
if !@character.show_dialog_icon &&
!@character.show_quest_icon &&
!@character.show_trade_icon &&
!@character.show_tutor_icon
removeQuestIcon
elsif !@questIcon
if @character.show_dialog_icon
addQuestMarkerToSprite(:DIALOG_ICON)
elsif @character.show_quest_icon
addQuestMarkerToSprite(:QUEST_ICON)
elsif @character.show_trade_icon
addQuestMarkerToSprite(:TRADE_ICON)
elsif @character.show_tutor_icon
addQuestMarkerToSprite(:TUTOR_ICON)
end
end
positionQuestIndicator if @questIcon
end
@@ -153,10 +202,6 @@ class Sprite_Character
# Event name must contain questNPC(x) for a quest icon to be displayed
# Where x is the quest ID
# if the quest has not already been accepted, the quest marker will be shown
#type: :QUEST_ICON, :DIALOG_ICON
def addQuestMarkerToSprite(iconType)
removeQuestIcon if @questIcon
@@ -168,6 +213,8 @@ class Sprite_Character
iconPath = DIALOGUE_ICON_NAME
when :TRADE_ICON
iconPath = TRADE_ICON_NAME
when :TUTOR_ICON
iconPath = TUTOR_ICON_NAME
end
return if !iconPath
@questIcon.bmp(iconPath)
@@ -193,6 +240,7 @@ class Sprite_Character
def removeQuestIcon()
@questIcon.dispose if @questIcon
@questIcon = nil
@character.show_quest_icon = false if @character.is_a?(Game_Event)
end
end
File diff suppressed because it is too large Load Diff
@@ -1,7 +1,8 @@
#
# Rewards given by hotel questman after a certain nb. of completed quests
#
QUEST_REWARDS = [
QUEST_REWARDS = Settings::KANTO ? [
# Kanto quest rewards
QuestReward.new(1, :HM08, 1, _INTL("This HM will allow you to illuminate dark caves and should help you to progress in your journey!")),
QuestReward.new(5, :AMULETCOIN, 1, _INTL("This item will allows you to get twice the money in a battle if the Pokémon holding it took part in it!")),
QuestReward.new(10, :LANTERN, 1, _INTL("This will allow you to illuminate caves without having to use a HM! Practical, isn't it?")),
@@ -10,4 +11,15 @@ QUEST_REWARDS = [
QuestReward.new(30, :MISTSTONE, 1, _INTL("This rare stone can evolve any Pokémon, regardless of their level or evolution method. Use it wisely!"), true),
QuestReward.new(50, :GSBALL, 1, _INTL("This mysterious ball is rumored to be the key to call upon the protector of Ilex Forest. It's a precious relic.")),
QuestReward.new(60, :MASTERBALL, 1, _INTL("This rare ball can catch any Pokémon. Don't waste it!"), true),
]
] : [
# Hoenn quest rewards
QuestReward.new(2, :AMULETCOIN, 1, _INTL("This doubles the money you get in Pokémon battles. Maybe it'll help finance the show!")),
QuestReward.new(5, :INCUBATOR, 1, _INTL("The note that came with it said that it allows you to hatch an egg instantly!")),
QuestReward.new(10, :ITEMFINDER, 1, _INTL("There's a note with it. If there's a hidden item anywhere near you, that little thing will react to tell you.")),
QuestReward.new(15, :INCUBATOR, 3, _INTL("Looks like they sent even more of these incubators for hatching Eggs. There must be a high-profile Pokémon breeder that's a fan of the show!")),
QuestReward.new(20, :SLEEPINGBAG, 1, _INTL("There's a note with it. This deluxe sleeping bag will allow you to sleep anywhere you want. It's so comfortable that you can sleep in it for hours!")),
QuestReward.new(25, :LINKINGCORD, 1, _INTL("Apparently, this strange cable triggers the evolution of Pokémon that typically evolve via trade. I know you'll put it to good use!")),
QuestReward.new(50, :MISTSTONE, 1, _INTL("This rare stone can evolve any Pokémon, regardless of their level or evolution method. Use it wisely!"), true),
QuestReward.new(60, :GSBALL, 1, _INTL("This mysterious ball is rumored to be the key to call upon the protector of Ilex Forest. It's a precious relic.")),
QuestReward.new(70, :MASTERBALL, 1, _INTL("This rare ball can catch any Pokémon. Don't waste it!"), true),
]
@@ -29,4 +29,30 @@ end
def player_has_quest_journal?
return $PokemonBag.pbHasItem?(:DEVONSCOPE) || $PokemonBag.pbHasItem?(:NOTEBOOK)
end
def count_nb_quests(stage,var_nb_total=1,var_nb_remaining=2, var_nb_relative_to_last_stage=3)
nb_quests_for_next_reward = QUEST_REWARDS[stage].nb_quests
nb_quests_completed = get_completed_quests(false).length
nb_remaining = nb_quests_for_next_reward - nb_quests_completed
diff_with_last_stage = -1
diff_with_last_stage = nb_quests_for_next_reward - QUEST_REWARDS[stage-1].nb_quests if stage >= 1
pbSet(var_nb_total,nb_quests_for_next_reward)
pbSet(var_nb_remaining,nb_remaining)
pbSet(var_nb_relative_to_last_stage,diff_with_last_stage)
end
def enough_quest_for_reward?(stage)
return true
nb_quests_for_next_reward = QUEST_REWARDS[stage].nb_quests
return get_completed_quests(false).length >= nb_quests_for_next_reward
end
def receiveQuestReward(stage)
item = QUEST_REWARDS[stage].item
quantity =QUEST_REWARDS[stage].quantity
pbReceiveItem(item, quantity)
reward_message = QUEST_REWARDS[stage].description
pbCallBub(2,@event_id)
pbMessage(reward_message)
end
@@ -1,26 +1,86 @@
def define_quest(quest_id,quest_type,quest_name,quest_description,quest_location,npc_sprite)
case quest_type
when :HOTEL_QUEST
text_color = HotelQuestColor
when :FIELD_QUEST
text_color = FieldQuestColor
when :LEGENDARY_QUEST
text_color = LegendaryQuestColor
when :ROCKET_QUEST
text_color = TRQuestColor
MainQuestColor = :GREEN
HotelQuestColor = :GOLD
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
attr_accessor :type
attr_accessor :location_map_id
def name
return _INTL(@name)
end
new_quest = Quest.new(quest_id, quest_name, quest_description, npc_sprite, quest_location, quest_location, text_color)
def desc
return _INTL(@desc)
end
def location
return _INTL(@location)
end
def initialize(id, name, desc, sprite, location, color = :WHITE, time = Time.now, completed = false, map_id=nil)
self.id = id
self.name = name
self.desc = desc
self.npc = npc
self.sprite = sprite
self.location = location
self.color = pbColor(color)
self.time = time
self.completed = completed
self.location_map_id = map_id
end
end
def default_color
return pbColor(get_quest_color(@type))
end
def get_quest_color(quest_type)
case quest_type
when :MAIN_QUEST
return MainQuestColor
when :HOTEL_QUEST
return HotelQuestColor
when :FIELD_QUEST
return FieldQuestColor
when :LEGENDARY_QUEST
return LegendaryQuestColor
when :ROCKET_QUEST
return TRQuestColor
when :MAGMA_QUEST
return MagmaQuestColor
when :AQUA_QUEST
return AquaQuestColor
else
return :WHITE
end
end
def define_quest(quest_id,quest_type,quest_name,quest_description,quest_location,npc_sprite,map_id=nil)
text_color = get_quest_color(quest_type)
new_quest = Quest.new(quest_id, quest_name, quest_description, npc_sprite, quest_location, text_color,Time.now,false,map_id)
new_quest.type= quest_type
QUESTS[quest_id] = new_quest
end
QUESTS = {
#Pokemart
"pokemart_johto" => Quest.new("pokemart_johto", _INTL("Johto Pokémon"), _INTL("A traveler in the PokéMart wants you to show him a Pokémon native to the Johto region."), "traveler_johto", _INTL("Cerulean City"), HotelQuestColor),
"pokemart_hoenn" => Quest.new("pokemart_hoenn", _INTL("Hoenn Pokémon"), _INTL("A traveler in the PokéMart you to show him a Pokémon native to the Hoenn region."), "traveler_hoenn", _INTL("Vermillion City"), HotelQuestColor),
"pokemart_johto" => Quest.new("pokemart_johto", _INTL("Johto Pokémon"), _INTL("A traveler in the Poké Mart wants you to show him a Pokémon native to the Johto region."), "traveler_johto", _INTL("Cerulean City"), HotelQuestColor),
"pokemart_hoenn" => Quest.new("pokemart_hoenn", _INTL("Hoenn Pokémon"), _INTL("A traveler in the Poké Mart you to show him a Pokémon native to the Hoenn region."), "traveler_hoenn", _INTL("Vermillion City"), HotelQuestColor),
"pokemart_sinnoh" => Quest.new("pokemart_sinnoh", _INTL("Sinnoh Pokémon"), _INTL("A traveler in the Department Center wants you to show him a Pokémon native to the Sinnoh region."), "traveler_sinnoh", _INTL("Celadon City"), HotelQuestColor),
"pokemart_unova" => Quest.new( "pokemart_unova", _INTL("Unova Pokémon"), _INTL("A traveler in the PokéMart wants you to show him a Pokémon native to the Unova region."), "traveler_unova", _INTL("Fuchsia City"), HotelQuestColor),
"pokemart_kalos" => Quest.new("pokemart_kalos", _INTL("Kalos Pokémon"), _INTL("A traveler in the PokéMart wants you to show him a Pokémon native to the Kalos region."), "traveler_kalos", _INTL("Saffron City"), HotelQuestColor),
"pokemart_alola" => Quest.new("pokemart_alola", _INTL("Alola Pokémon"), _INTL("A traveler in the PokéMart wants you to show him a Pokémon native to the Alola region."), "traveler_alola", _INTL("Cinnabar Island"), HotelQuestColor),
"pokemart_unova" => Quest.new( "pokemart_unova", _INTL("Unova Pokémon"), _INTL("A traveler in the Poké Mart wants you to show him a Pokémon native to the Unova region."), "traveler_unova", _INTL("Fuchsia City"), HotelQuestColor),
"pokemart_kalos" => Quest.new("pokemart_kalos", _INTL("Kalos Pokémon"), _INTL("A traveler in the Poké Mart wants you to show him a Pokémon native to the Kalos region."), "traveler_kalos", _INTL("Saffron City"), HotelQuestColor),
"pokemart_alola" => Quest.new("pokemart_alola", _INTL("Alola Pokémon"), _INTL("A traveler in the Poké Mart wants you to show him a Pokémon native to the Alola region."), "traveler_alola", _INTL("Cinnabar Island"), HotelQuestColor),
#Pewter hotel
@@ -28,7 +88,7 @@ QUESTS = {
"pewter_2" =>Quest.new("pewter_2", _INTL("Lost Medicine"), _INTL("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."), "BW (19)", _INTL("Pewter City"), HotelQuestColor),
"pewter_3" =>Quest.new("pewter_3", _INTL("Bug Evolution "), _INTL("A Bug Catcher in Pewter City wants you to show him a fully-evolved Bug Pokémon."), "BWBugCatcher_male", _INTL("Pewter City"), HotelQuestColor),
"pewter_field_1" => Quest.new("pewter_field_1", _INTL("Nectar garden"), _INTL("An old man wants you to bring differently colored flowers for the city's garden."), "BW (039)", _INTL("Pewter City"), FieldQuestColor),
"pewter_field_2" => Quest.new("pewter_field_2", _INTL("I Choose You!"), _INTL("A Pikachu in the PokéMart has lost its official Pokémon League Hat. Find one and give it to the Pikachu!"), "YOUNGSTER_LeagueHat", _INTL("Pewter City"), FieldQuestColor),
"pewter_field_2" => Quest.new("pewter_field_2", _INTL("I Choose You!"), _INTL("A Pikachu in the Poké Mart has lost its official Pokémon League Hat. Find one and give it to the Pikachu!"), "YOUNGSTER_LeagueHat", _INTL("Pewter City"), FieldQuestColor),
"pewter_field_3" => Quest.new("pewter_field_3", _INTL("Prehistoric Amber!"), _INTL("Meetup with a scientist in Viridian Forest to look for prehistoric amber."), "BW (82)", _INTL("Pewter City"), FieldQuestColor),
#Cerulean hotel
@@ -127,11 +187,37 @@ QUESTS = {
# HOENN QUESTS ##
# ################
## MAIN QUESTS
define_quest("main_dad",:MAIN_QUEST,_INTL("Visit Dad!"), _INTL("Go visit your Dad at his Gym in Petalburg Town!"),_INTL("Petalburg City"),"NPC_Hoenn_Leader_Norman",MAP_PETALBURG)
define_quest("main_wally",:MAIN_QUEST,_INTL("Catching Tutoring"), _INTL("Catch a wild Pokémon for Wally."),_INTL("Petalburg City"),"NPC_Hoenn_Wally",MAP_PETALBURG)
define_quest("main_gym_1",:MAIN_QUEST,_INTL("The Pokémon Gym Challenge"), _INTL("Challenge Roxanne in Rustboro City to obtain your first Gym Badge."),_INTL("Rustboro City"),"NPC_Hoenn_Leader_Roxanne",MAP_RUSTBORO)
define_quest("main_gym_2",:MAIN_QUEST,_INTL("The Pokémon Gym Challenge"), _INTL("Challenge Brawly in Dewford Town to obtain your second Gym Badge."),_INTL("Dewford Town"),"NPC_Hoenn_Leader_Brawly",MAP_DEWFORD)
define_quest("main_gym_3",:MAIN_QUEST,_INTL("The Pokémon Gym Challenge"), _INTL("Challenge Wattson in Mauville City to obtain your third Gym Badge."),_INTL("Mauville City"),"NPC_Hoenn_Leader_Wattson",MAP_MAUVILLE)
define_quest("main_gym_4",:MAIN_QUEST,_INTL("The Pokémon Gym Challenge"), _INTL("Challenge Flannery in Lavaridge Town to obtain your fourth Gym Badge."),_INTL("Lavaridge Town"),"NPC_Hoenn_Leader_Flannery",MAP_LAVARIDGE)
define_quest("main_gym_5",:MAIN_QUEST,_INTL("The Pokémon Gym Challenge"), _INTL("Challenge Norman in Petalburg City to obtain your fifth Gym Badge."),_INTL("Petalburg Town"),"NPC_Hoenn_Leader_Norman",MAP_PETALBURG)
define_quest("main_gym_6",:MAIN_QUEST,_INTL("The Pokémon Gym Challenge"), _INTL("Challenge Winona in Fortree City to obtain your sixth Gym Badge."),_INTL("Fortree City"),"NPC_Hoenn_Leader_Winona",MAP_FORTREE)
define_quest("main_gym_7",:MAIN_QUEST,_INTL("The Pokémon Gym Challenge"), _INTL("Challenge Tate & Liza in Mossdeep City to obtain your seventh Gym Badge."),_INTL("Mossdeep City"),"NPC_Hoenn_Leader_TateLiza",MAP_MOSSDEEP)
define_quest("main_gym_8",:MAIN_QUEST,_INTL("The Pokémon Gym Challenge"), _INTL("Challenge Wallace in Sootopolis City to obtain your final Gym Badge."),_INTL("Sootopolis City"),"NPC_Hoenn_Leader_Wallace",MAP_SOOTOPOLIS)
define_quest("main_league",:MAIN_QUEST,_INTL("Pokémon League Challenge"), _INTL("Collect all 8 Gym Badges and take part in the Pokémon League!"),_INTL("Hoenn"),"NPC_Hoenn_GymMan",MAP_LEAGUE)
define_quest("main_stolen_parts",:MAIN_QUEST,_INTL("Stolen Package"), _INTL("Recover a package stolen by Team Magma!"),_INTL("Rustboro City"),"NPC_Hoenn_MrStone")
define_quest("main_steven_letter",:MAIN_QUEST,_INTL("Steven's Letter"), _INTL("Deliver a letter from the Devon Corp. president to Steven in Granite Cave. "),_INTL("Granite Cave"),"NPC_Hoenn_MrStone",MAP_DEWFORD)
define_quest("main_devon_parts",:MAIN_QUEST,_INTL("Devon Parts Delivery"), _INTL("Deliver the Devon Parts to the Shipyard in Slateport City."),_INTL("Slateport City"),"NPC_Hoenn_MrStone",MAP_SLATEPORT)
#SIDE QUESTS
define_quest("template",:FIELD_QUEST,_INTL("Template Quest"), _INTL("Don't forget to change the quest ID if you copy paste this!"),_INTL("Unknown"),"000")
#route 102
define_quest("route_102_rematch",:FIELD_QUEST,_INTL("Trainer Rematches"), _INTL("A lass you battled wants to switch up her team and rematch you!"),_INTL("Route 102"),"NPC_Hoenn_Lass")
#Petalburg Town
define_quest("petalburg_berry",:FIELD_QUEST,_INTL("Berry Contest"), _INTL("Take part in the berry-growing contest in Petalburg Town!"),_INTL("Petalburg Town"),"NPC_Hoenn_Breeder_F")
#Route 116
define_quest("route116_glasses",:FIELD_QUEST,_INTL("Lost glasses"), _INTL("A trainer has lost their glasses, help him find them!"),_INTL("Route 116"),"NPC_Hoenn_BugManiac")
define_quest("route116_glasses",:FIELD_QUEST,_INTL("Lost glasses"), _INTL("A trainer has lost their glasses, help him find them!"),_INTL("Route 116"),"NPC_Hoenn_Collector_NoGlasses")
#Route 104 (South)
define_quest("route104_rivalWeather",:FIELD_QUEST,_INTL("Weather Watch"), _INTL("Help your rival with fieldwork and find a Pokémon that only appears when it's windy!"),_INTL("Route 104"),"rival")
@@ -142,9 +228,69 @@ define_quest("petalburgwoods_spores",:FIELD_QUEST,_INTL("Spores Harvest"), _INTL
#Route 104 (North)
define_quest("route104_oricorio",:FIELD_QUEST,_INTL("Special Flowery Grass"), _INTL("Find an Oricorio in the flowery grass behind the flower shop."),_INTL("Route 104"),"NPC_Hoenn_AromaLady")
define_quest("route104_oricorio_forms",:FIELD_QUEST,_INTL("Nectar Flowers"), _INTL("Find all 4 types of nectar flowers to transform Oricorio."),_INTL("Route 104"),"NPC_Hoenn_AromaLady")
define_quest("route104_allergic",:FIELD_QUEST,_INTL("The Allergic Rich Boy"), _INTL("An allergy-ridden rich boy is looking for a flowery Pokémon to give to his girlfriend."),_INTL("Route 104"),"NPC_Hoenn_RichBoy")
#Route 115
define_quest("route115_secretBase",:FIELD_QUEST,_INTL("Your Very Own Secret Base!"), _INTL("Talk to Aarune near his secret base to learn how to make your own."),_INTL("Route 115"),"NPC_Hoenn_AromaLady")
#Rustboro
define_quest("rustboro_whismur",:FIELD_QUEST,_INTL("Volume Booster!"), _INTL("Find a Wingull to fuse with a Whismur to make it louder."),_INTL("Rustboro City"),"NPC_schoolgirl")
define_quest("rustboro_shiny",:FIELD_QUEST,_INTL("A Green Marill?"), _INTL("A child claims they've seen a green Marill by the pond on Route 104. Go investigate!"),_INTL("Rustboro City"),"NPC_preschooler_m")
define_quest("rustboro_trash",:FIELD_QUEST,_INTL("Clean Up the Beach!"), _INTL("Help the ranger clean-up the beach behind the Devon Corp. building."),_INTL("Rustboro City"),"NPC_Hoenn_Ranger_M")
define_quest("rustboro_fusion",:FIELD_QUEST,_INTL("Wild Fusion Study"), _INTL("Help a scientist gather data by getting wild Pokémon to fuse before a battle 3 different times."),_INTL("Rustboro City"),"NPC_scientist_m")
#Dewford
define_quest("dewford_fishing",:FIELD_QUEST,_INTL("The Angler's Rite of Passage"), _INTL("It's tradition to fish a Skrelp near Dewford Town as a rite of passage. Find one and show it to the fisherman!"),_INTL("Dewford Town"),"NPC_Hoenn_Fisherman")
#Slateport
define_quest("slateport_team_aqua",:AQUA_QUEST,_INTL("Join Team Aqua!"), _INTL("Archie invited you to join Team Aqua. Go meet them at their camp on Slateport Beach if you so choose."),_INTL("Slateport City"),"NPC_Hoenn_Aqua_Archie",MAP_AQUA_CAMP)
define_quest("slateport_team_magma",:MAGMA_QUEST,_INTL("Join Team Magma!"), _INTL("Maxie invited you to join Team Magma. Go meet them at their camp, North of Slateport if you so choose."),_INTL("Slateport City"),"NPC_Hoenn_Magma_Maxie",MAP_MAGMA_CAMP)
# Route 109
define_quest("route109_tanning",:FIELD_QUEST,_INTL("Soaking in the sun"), _INTL("Sit in a beach chair until your suntan is on point!"),_INTL("Route 109"),"NPC_Hoenn_Triathlete_F")
define_quest("route109_seahouse",:FIELD_QUEST,_INTL("Hot Battles at the Seashore House"), _INTL("Defeat all of the trainers in the Seashore House!"),_INTL("Route 109"),"NPC_Hoenn_Fisherman")
define_quest("route109_beachball",:FIELD_QUEST,_INTL("Find a New Beach Ball!"), _INTL("Replace the popped beach ball of the kids playing on the beach"),_INTL("Route 109"),"NPC_Hoenn_Tuber_M")
#Team Magma - Route 103
define_quest("magma_camp_attack",:MAGMA_QUEST,_INTL("Under Attack!"), _INTL("Defend the Team Magma Camp against Team Aqua!"),_INTL("Magma Camp"),"NPC_Hoenn_Magma_Exec_M")
define_quest("magma_slugma_eggs",:MAGMA_QUEST,_INTL("Egg Hunt!"), _INTL("Collect Slugma Eggs with Tabitha."),_INTL("Cliffside Sanctuary"),"NPC_Hoenn_Magma_Exec_M")
define_quest("magma_help_grunts",:MAGMA_QUEST,_INTL("Grunt Work!"), _INTL("Help 3 grunts in the Team Magma Camp, then report back to Tabitha!"),_INTL("Magma Camp"),"NPC_Hoenn_Magma_Exec_M")
define_quest("magma_numel",:MAGMA_QUEST,_INTL("Anti-Water Training!"), _INTL("Fuse Numel to make it resistant Water-type attacks."),_INTL("Magma Camp"),"NPC_Hoenn_Magma_Grunt_M")
define_quest("magma_graffiti",:MAGMA_QUEST,_INTL("Painting the Town Red"), _INTL("Team Aqua painted their logo on various walls in Slateport City. Cover them up with the Team Magma logo instead!"),_INTL("Magma Camp"),"NPC_Hoenn_Magma_Grunt_F")
define_quest("magma_song",:MAGMA_QUEST,_INTL("The Magma Theme Song"), _INTL("Help compose lyrics to the official Team Magma theme song!"),_INTL("Magma Camp"),"NPC_Hoenn_Magma_Grunt_F")
#Team Aqua - Route 108
define_quest("aqua_camp_attack",:AQUA_QUEST,_INTL("Under Attack!"), _INTL("Defend the Team Aqua Camp against Team Magma!"),_INTL("Aqua Camp"),"NPC_Hoenn_Aqua_Exec_F")
define_quest("aqua_wailmer_eggs",:AQUA_QUEST,_INTL("Egg Hunt!"), _INTL("Collect Wailmer Eggs for Shelly."),_INTL("Route 108"),"NPC_Hoenn_Aqua_Exec_F")
define_quest("aqua_help_grunts",:AQUA_QUEST,_INTL("Grunt Work!"), _INTL("Help 3 grunts in the Team Aqua Camp, then report back to Shelly!"),_INTL("Aqua Camp"),"NPC_Hoenn_Aqua_Exec_F")
define_quest("aqua_carvanha",:AQUA_QUEST,_INTL("Just Add Water!"), _INTL("You were given two Zubats and a Geodude. Fuse all three of them into Water-type Pokémon."),_INTL("Aqua Camp"),"NPC_Hoenn_Aqua_Grunt_F")
define_quest("aqua_graffiti",:AQUA_QUEST,_INTL("Painting the Town Blue"), _INTL("Team Magma painted their logo on various walls in Slateport City. Cover them up with the Team Aqua logo instead!"),_INTL("Aqua Camp"),"NPC_Hoenn_Aqua_Grunt_M")
define_quest("aqua_song",:AQUA_QUEST,_INTL("The Aqua Theme Song"), _INTL("Help compose lyrics to the official Team Aqua theme song!"),_INTL("Aqua Camp"),"NPC_Hoenn_Aqua_Grunt_F")
#Route 110
define_quest("route110_bike",:FIELD_QUEST,_INTL("Cycling Road Time Trial"), _INTL("Go through the Cycling Road as fast as possible. You'll be penalized if you hit the walls!"),_INTL("Route 110"),"NPC_Hoenn_Triathlete_M_bike")
#Mauville
define_quest("mauville_quests_1",:FIELD_QUEST,_INTL("Associate Producer! - Episode 1"), _INTL("You've been hired as an associate producer on a TV show! Complete 2 quests to help write the second season of the show."),_INTL("Mauville TV"),"NPC_Hoenn_Collector")
define_quest("mauville_quests_2",:FIELD_QUEST,_INTL("Associate Producer! - Episode 2"), _INTL("You've been hired as an associate producer on a TV show! Complete 5 quests to help write the second season of the show."),_INTL("Mauville TV"),"NPC_Hoenn_Collector")
define_quest("mauville_quests_3",:FIELD_QUEST,_INTL("Associate Producer! - Episode 3"), _INTL("You've been hired as an associate producer on a TV show! Complete 10 quests to help write the second season of the show."),_INTL("Mauville TV"),"NPC_Hoenn_Collector")
define_quest("mauville_quests_4",:FIELD_QUEST,_INTL("Associate Producer! - Episode 4"), _INTL("You've been hired as an associate producer on a TV show! Complete 15 quests to help write the second season of the show."),_INTL("Mauville TV"),"NPC_Hoenn_Collector")
define_quest("mauville_quests_5",:FIELD_QUEST,_INTL("Associate Producer! - Episode 5"), _INTL("You've been hired as an associate producer on a TV show! Complete 20 quests to help write the second season of the show."),_INTL("Mauville TV"),"NPC_Hoenn_Collector")
define_quest("mauville_quests_6",:FIELD_QUEST,_INTL("Associate Producer! - Episode 6"), _INTL("You've been hired as an associate producer on a TV show! Complete 25 quests to help write the second season of the show."),_INTL("Mauville TV"),"NPC_Hoenn_Collector")
define_quest("mauville_quests_7",:FIELD_QUEST,_INTL("Associate Producer! - Episode 7"), _INTL("You've been hired as an associate producer on a TV show! Complete 30 quests to help write the second season of the show."),_INTL("Mauville TV"),"NPC_Hoenn_Collector")
define_quest("mauville_magma",:MAGMA_QUEST,_INTL("The Element of Surprise!"), _INTL("Catch a Tynamo in the waters near New Mauville to catch Team Aqua by surprise."),_INTL("Mauville City"),"NPC_Hoenn_Magma_Grunt_M")
define_quest("mauville_aqua",:AQUA_QUEST,_INTL("The Element of Surprise!"), _INTL("Catch a Tynamo in the waters near New Mauville to catch Team Magma by surprise."),_INTL("Mauville City"),"NPC_Hoenn_Aqua_Grunt_M")
#Route 111
define_quest("route111_winstrate",:FIELD_QUEST,_INTL("The Winstrate Family"), _INTL("Defeat all 4 members of the Winstrate family in back-to-back battles."),_INTL("Route 111"),"NPC_Hoenn_Pokefan_M")
#Verdanturf
define_quest("verdanturf_shroomish",:FIELD_QUEST,_INTL("A Lost Shroomish"), _INTL("A girl lost her Shroomish and needs your help to find it."),_INTL("Verdanturf Town"),"NPC_Hoenn_Schoolgirl")
define_quest("verdanturf_nurse",:FIELD_QUEST,_INTL("The Bored Nurse"), _INTL("The Pokémon Center's nurse challenged you to a battle. Meet her in the meadow behind the Pokémon Center."),_INTL("Verdanturf Town"),"NPC_nurse")
#Rusturf Tunnel
define_quest("rusturf_trumpet",:FIELD_QUEST,_INTL("Uproar in B Flat"), _INTL("A trumpet player is cornered in Rusturf Tunnel. Find a way to help him!"),_INTL("Rusturf Tunnel"),"NPC_Hoenn_trumpet_playing")
define_quest("evergrande_trumpet",:FIELD_QUEST,_INTL("The Trumpet Festival!"), _INTL("Find the 4 Trumpet Brothers and join the Trumpet Festival in Evergrande City."),_INTL("Evergrande City"),"NPC_Hoenn_trumpet_playing",MAP_EVERGRANDE)
@@ -0,0 +1,915 @@
##=============================================================================
## Easy Questing System - Refactored with Extensible Mode System
## Original by M3rein
# Refactored using by Claude
# Adapted for Pokemon Infinite Fusion by chardub
##=============================================================================
## Main entry point for the quest log
##=============================================================================
def pbQuestlog
ensure_quests_repaired
loop do
if $Trainer&.pokenav&.last_opened_quest_mode == :LIST || Settings::KANTO
ql = Questlog.new
break unless ql.switch_to_map
$Trainer&.pokenav&.last_opened_quest_mode = :MAP
else
qm = showQuestMap
break unless qm&.reopen_map
$Trainer&.pokenav&.last_opened_quest_mode = :LIST
end
end
end
def ensure_quests_repaired
return if $Trainer.quests_repaired
fix_quest_ids
$Trainer.quests_repaired = true
end
##=============================================================================
## QuestSprite - Sprite class for quest list items
##=============================================================================
class QuestSprite < IconSprite
attr_accessor :quest
end
##=============================================================================
## QuestMode - Base class for quest filtering modes
##=============================================================================
class QuestCategory
attr_reader :name, :button_text
attr_accessor :last_index
def initialize(name, button_text)
@name = name
@button_text = button_text
@last_index = 0
end
# Override this method to define filtering logic
def filter_quests(all_quests)
raise NotImplementedError, "Subclasses must implement filter_quests"
end
# Override to customize empty message
def empty_message
"No quests"
end
# Override to customize title
def title
@name
end
end
##=============================================================================
## Built-in Quest Modes
##=============================================================================
class CompletedQuestMode < QuestCategory
def initialize
super("Completed Quests", "Completed")
end
def button_path
return "Graphics/Pictures/eqi/quest_button_complete"
end
def filter_quests(all_quests)
all_quests.select { |q| q.completed }
end
def empty_message
_INTL("No completed quests")
end
end
class MainQuestMode < QuestCategory
def initialize
super("Main Quests", "Main Quests")
end
def button_path
return "Graphics/Pictures/eqi/quest_button_main"
end
def filter_quests(all_quests)
return all_quests.select { |q| !q.completed && q.type == :MAIN_QUEST }
end
def empty_message
_INTL("No ongoing main quests")
end
end
class SideQuestMode < QuestCategory
def initialize
super("Side Quests", "Side Quests")
end
def button_path
return "Graphics/Pictures/eqi/quest_button_side"
end
def filter_quests(all_quests)
return all_quests.select { |q| !q.completed && q.type != :MAIN_QUEST }
end
def empty_message
_INTL("No side quests")
end
end
# class LocationQuestMode < QuestMode
# attr_reader :location
#
# def initialize(location)
# @location = location
# super("#{location} Quests", location)
# end
#
# def filter_quests(all_quests)
# return all_quests.select { |q| !q.completed && q.location.include?(@location) }
# end
#
# def empty_message
# _INTL("No quests in {1}", @location)
# end
# end
##=============================================================================
## Questlog - Main quest interface controller (Refactored)
##=============================================================================
class Questlog
attr_reader :switch_to_map
# Scene constants
SCENE_MAIN = 0
SCENE_LIST = 1
SCENE_DETAIL = 2
# UI constants
MAX_VISIBLE_QUESTS = 6
FADE_SPEED = 32
ANIMATION_FRAMES = 12
CHAR_ANIMATION_INTERVAL = 6
def initialize(open_quest: nil, from_map: false)
@from_map = from_map
@switch_to_map = false
initialize_data
initialize_modes
initialize_viewport
if open_quest
create_sprites(false)
setup_open_quest(open_quest)
else
create_sprites(false)
animate_intro
end
main_loop
cleanup
end
private
##---------------------------------------------------------------------------
## Initialization
##---------------------------------------------------------------------------
def setup_open_quest(quest)
@skip_menu = true
# Find which mode contains this quest
@current_mode = @modes.find { |mode| mode.filter_quests($Trainer.quests).include?(quest) }
# Fall back to first mode if not found (e.g. completed quests shown via direct open)
@current_mode ||= @modes.first
@filtered_quests = @current_mode.filter_quests($Trainer.quests)
@quest_list_menu_index = @filtered_quests.index(quest) || 0
@box = 0
# Jump straight to detail view
@scene = SCENE_DETAIL
create_detail_background
create_character_sprite("char", quest, 62, 130)
draw_quest_details(quest)
animate_detail_in
end
def initialize_data
$Trainer.quests = [] if $Trainer.quests.nil?
@page = 0
@main_menu_index = 0
@quest_list_menu_index = 0
@scene = SCENE_MAIN
@current_mode = nil
@box = 0 # Visible quest index (0-5)
@frame = 0
@filtered_quests = []
@scroll_timer = 12 # Cooldown counter for holding up/down
@scroll_delay = 6 # Frames to wait before repeating movement
fix_broken_TR_quests
end
def initialize_modes
# Register all available modes here
@modes = []
@modes << MainQuestMode.new if Settings::HOENN
@modes << SideQuestMode.new
@modes << CompletedQuestMode.new
# You can dynamically add location-based modes:
# @modes << LocationQuestMode.new("Cerulean City")
# @modes << LocationQuestMode.new("Viridian Forest")
end
def initialize_viewport
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@viewport.z = 100002
@sprites = {}
end
def create_sprites(main_page = true)
create_main_bitmap
create_background
create_mode_buttons #if main_page
draw_main_text
end
def create_main_bitmap
@sprites["main"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["main"].z = 1
@sprites["main"].opacity = 0
@main = @sprites["main"].bitmap
pbSetSystemFont(@main)
end
def create_background
@sprites["bg0"] = IconSprite.new(0, 0, @viewport)
bg_path = isDarkMode ?
"Graphics/Pictures/Pokegear/bg_dark" :
"Graphics/Pictures/Pokegear/bg"
@sprites["bg0"].setBitmap(bg_path)
@sprites["bg0"].opacity = 0
end
def create_mode_buttons
default_button_path = "Graphics/Pictures/eqi/quest_button"
@modes.size.times do |i|
@sprites["btn#{i}"] = IconSprite.new(0, 0, @viewport)
button_path = @modes[i].button_path
if button_path
@sprites["btn#{i}"].setBitmap(button_path)
else
@sprites["btn#{i}"].setBitmap(default_button_path)
end
@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
end
def draw_main_text
pbDrawOutlineText(@main, -160, 8, 512, 384, _INTL("Quest Log"),
Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
if can_switch_mode?
pbDrawOutlineText(@main, 160, 8, 512, 384, _INTL("L/R : MAP"),
Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
end
# Draw button labels and quest counts
@modes.each_with_index do |mode, i|
quest_count = mode.filter_quests($Trainer.quests).size
y_pos = 142 + (56 * i)
pbDrawOutlineText(@main, 0, y_pos, 512, 384,
_INTL("{1}: {2}", mode.button_text, quest_count),
Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
end
end
def animate_intro
ANIMATION_FRAMES.times do |i|
Graphics.update
@sprites["bg0"]&.opacity += FADE_SPEED if i < 8
# Fade in all mode buttons
@modes.size.times do |j|
@sprites["btn#{j}"]&.opacity += FADE_SPEED if i > 3
end
@sprites["main"]&.opacity += 64 if i > 7
end
end
##---------------------------------------------------------------------------
## Main Loop
##---------------------------------------------------------------------------
def main_loop
@frame = 0
loop do
@frame += 1
Graphics.update
Input.update
break if handle_input
@frame = 0 if @frame == 18
end
end
def handle_input
case @scene
when SCENE_MAIN
return handle_main_input
when SCENE_LIST
return handle_list_input
when SCENE_DETAIL
return handle_detail_input
end
return false
end
def handle_main_input
if (Input.trigger?(Input::L) || Input.trigger?(Input::R)) && can_switch_mode?
@switch_to_map = true
pbSEPlay("GUI storage show party panel")
$Trainer&.pokenav&.last_opened_quest_mode = :MAP
return true
end
return true if Input.trigger?(Input::B)
if Input.trigger?(Input::C)
show_quest_list(@main_menu_index)
end
if @scroll_timer > 0
@scroll_timer -= 1
else
if Input.press?(Input::DOWN)
switch_button(:DOWN)
@scroll_timer = @scroll_delay
elsif Input.press?(Input::UP)
switch_button(:UP)
@scroll_timer = @scroll_delay
end
end
false
end
def can_switch_mode?
return Settings::HOENN && (@scene != SCENE_DETAIL)
end
def handle_list_input
if (Input.trigger?(Input::L) || Input.trigger?(Input::R)) && can_switch_mode?
@switch_to_map = true
return true
end
if Input.trigger?(Input::B)
return_to_main
elsif Input.trigger?(Input::C)
show_quest_detail
else
handle_scroll_input
end
animate_arrows
return false
end
def handle_scroll_input
# Only scroll when timer allows
if @scroll_timer > 0
@scroll_timer -= 1
return
end
if Input.press?(Input::DOWN)
move_selection(:DOWN)
@scroll_timer = @scroll_delay
elsif Input.press?(Input::UP)
move_selection(:UP)
@scroll_timer = @scroll_delay
end
end
def handle_detail_input
if Input.trigger?(Input::B)
return true
end
animate_character if [6, 12, 18].include?(@frame)
return false
end
##---------------------------------------------------------------------------
## Navigation
##---------------------------------------------------------------------------
def update_button_selection(index, selected)
return unless @sprites["btn#{index}"]
height = (@sprites["btn#{index}"].bitmap.height / 2).round
@sprites["btn#{index}"].src_rect.y = selected ? height : 0
end
def switch_button(dir)
max_index = @modes.size - 1
if dir == :DOWN
return if @main_menu_index >= max_index
update_button_selection(@main_menu_index, false)
@main_menu_index += 1
update_button_selection(@main_menu_index, true)
else
return if @main_menu_index <= 0
update_button_selection(@main_menu_index, false)
@main_menu_index -= 1
update_button_selection(@main_menu_index, true)
end
end
def move_selection(dir)
return if @filtered_quests.empty?
if dir == :DOWN
return if @quest_list_menu_index == @filtered_quests.size - 1
deselect_current_quest
@quest_list_menu_index += 1
@box += 1
@box = 5 if @box > 5
select_current_quest
refresh_quest_list if @box == 5
else
return if @quest_list_menu_index == 0
deselect_current_quest
@quest_list_menu_index -= 1
@box -= 1
@box = 0 if @box < 0
select_current_quest
refresh_quest_list if @box == 0
end
#pbWait(4)
end
def deselect_current_quest
@sprites["quest#{@box}"].src_rect.y = 0 if @sprites["quest#{@box}"]
end
def select_current_quest
if @sprites["quest#{@box}"]
@sprites["quest#{@box}"].src_rect.y = (@sprites["quest#{@box}"].bitmap.height / 2).round
end
end
##---------------------------------------------------------------------------
## Scene Transitions
##---------------------------------------------------------------------------
def return_to_main
pbWait(1)
dispose_quest_list_sprites
fade_to_main
reset_list_state
redraw_main_screen
animate_main_return
end
def fade_to_main
ANIMATION_FRAMES.times do |i|
Graphics.update
fade_sprites_out(i)
end
dispose_list_sprites
clear_bitmaps
end
def fade_sprites_out(index)
@sprites["main"].opacity -= FADE_SPEED if @sprites["main"]
@sprites["bg0"].opacity += FADE_SPEED if @sprites["bg0"].opacity < 255
if index > 3
@sprites["bg1"].opacity -= FADE_SPEED if @sprites["bg1"]
@sprites["bg2"].opacity -= FADE_SPEED if @sprites["bg2"]
@sprites["pager"].opacity -= FADE_SPEED if @sprites["pager"]
@sprites["pager2"].opacity -= FADE_SPEED if @sprites["pager2"]
end
@sprites["char"].opacity -= FADE_SPEED if @sprites["char"]
@sprites["char2"].opacity -= FADE_SPEED if @sprites["char2"]
@sprites["text"].opacity -= FADE_SPEED if @sprites["text"]
@sprites["up"].opacity -= FADE_SPEED if @sprites["up"]
@sprites["down"].opacity -= FADE_SPEED if @sprites["down"]
fade_quest_sprites
end
def fade_quest_sprites
MAX_VISIBLE_QUESTS.times do |i|
@sprites["quest#{i}"].opacity -= FADE_SPEED if @sprites["quest#{i}"]
end
end
def dispose_list_sprites
@sprites["up"].dispose if @sprites["up"]
@sprites["down"].dispose if @sprites["down"]
end
def clear_bitmaps
@main.clear if @main
@text.clear if @text
@text2.clear if @text2
end
def reset_list_state
@scene = SCENE_MAIN
end
def redraw_main_screen
pbDrawOutlineText(@main, 0, 2, 512, 384, _INTL("Quest Log"),
Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
@modes.each_with_index do |mode, i|
quest_count = mode.filter_quests($Trainer.quests).size
y_pos = 142 + (56 * i)
pbDrawOutlineText(@main, 0, y_pos, 512, 384,
_INTL("{1}: {2}", mode.button_text, quest_count),
Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
end
end
def animate_main_return
ANIMATION_FRAMES.times do |i|
Graphics.update
@sprites["bg0"].opacity += FADE_SPEED if i < 8
@modes.size.times do |j|
@sprites["btn#{j}"].opacity += FADE_SPEED if i > 3
end
@sprites["main"].opacity += 48 if i > 5
end
end
##---------------------------------------------------------------------------
## Quest List Display
##---------------------------------------------------------------------------
def show_quest_list(mode_index)
pbWait(2)
@scene = SCENE_LIST
@current_mode = @modes[mode_index]
@quest_list_menu_index = @current_mode.last_index
@box = [@quest_list_menu_index, MAX_VISIBLE_QUESTS - 1].min
@filtered_quests = @current_mode.filter_quests($Trainer.quests)
create_arrow_sprites
fade_to_list
clear_bitmaps
display_quest_list
end
def create_arrow_sprites
@sprites["up"] = create_arrow(36, false)
@sprites["down"] = create_arrow(360, true)
@sprites["down"].visible = @filtered_quests.size > MAX_VISIBLE_QUESTS
@sprites["down"].opacity = 0
end
def create_arrow(y_pos, flip)
arrow = IconSprite.new(0, 0, @viewport)
arrow.setBitmap("Graphics/Pictures/EQI/quest_arrow")
arrow.zoom_x = 1.25
arrow.zoom_y = 1.25
arrow.x = Graphics.width / 2 + (flip ? 21 : 0)
arrow.y = y_pos
arrow.z = 2
arrow.angle = flip ? 180 : 0
arrow.visible = false
arrow
end
def fade_to_list
10.times do |i|
Graphics.update
if i > 1
@modes.size.times do |j|
@sprites["btn#{j}"].opacity -= FADE_SPEED
end
@sprites["main"].opacity -= FADE_SPEED
fade_detail_sprites
end
end
end
def fade_detail_sprites
@sprites["bg1"].opacity -= FADE_SPEED if @sprites["bg1"]
@sprites["bg2"].opacity -= FADE_SPEED if @sprites["bg2"]
@sprites["pager"].opacity -= FADE_SPEED if @sprites["pager"]
@sprites["pager2"].opacity -= FADE_SPEED if @sprites["pager2"]
@sprites["char"].opacity -= FADE_SPEED if @sprites["char"]
@sprites["char2"].opacity -= FADE_SPEED if @sprites["char2"]
@sprites["text"].opacity -= FADE_SPEED if @sprites["text"]
@sprites["text2"].opacity -= FADE_SPEED if @sprites["text2"]
end
def display_quest_list
[@filtered_quests.size, MAX_VISIBLE_QUESTS].min.times do |i|
create_quest_sprite(i, @filtered_quests[i])
draw_quest_name_on_main(i, @filtered_quests[i])
end
if @filtered_quests.empty?
pbDrawOutlineText(@main, 0, 175, 512, 384, @current_mode.empty_message,
pbColor(:WHITE), pbColor(:BLACK), 1)
end
pbDrawOutlineText(@main, 0, 2, 512, 384, @current_mode.title,
Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
animate_quest_list
end
def create_quest_sprite(index, quest)
sprite_key = "quest#{index}"
@sprites[sprite_key] = QuestSprite.new(0, 0, @viewport)
sprite = @sprites[sprite_key]
sprite.setBitmap("Graphics/Pictures/EQI/quest_button")
sprite.quest = quest
sprite.x = 94
sprite.y = 42 + 52 * index
sprite.src_rect.height = (sprite.bitmap.height / 2).round
sprite.src_rect.y = (sprite.bitmap.height / 2).round if index == @quest_list_menu_index
sprite.opacity = 0
draw_quest_name_on_main(index, quest)
set_quest_list_sprite(index,quest)
end
def draw_quest_name_on_main(index, quest)
y_pos = get_cell_y_position(index)
pbDrawOutlineText(@main, 11, y_pos, 512, 384,
quest.name,
quest.default_color,
Color.new(0, 0, 0),
1)
end
def get_cell_y_position(index)
56 + (52 * index)
end
def animate_quest_list
ANIMATION_FRAMES.times do |i|
Graphics.update
@sprites["main"].opacity += FADE_SPEED if i < 8
@sprites["down"].opacity += FADE_SPEED if i > 3
[@filtered_quests.size, MAX_VISIBLE_QUESTS].min.times do |j|
@sprites["quest#{j}"].opacity += FADE_SPEED if i > 3
@sprites["quest_icon#{j}"].opacity += FADE_SPEED if i > 3 # Fade in icon
end
end
end
def set_quest_list_sprite(index, quest)
quest_button = @sprites["quest#{index}"]
icon_key = "quest_icon#{index}"
if @sprites[icon_key]
sprite = @sprites[icon_key]
sprite.setBitmap("Graphics/Characters/#{quest.sprite}")
sprite.x = quest_button.x - 64
sprite.y = quest_button.y - 20
sprite.src_rect.width = (sprite.bitmap.width / 4).round
sprite.src_rect.height = (sprite.bitmap.height / 4).round
sprite.src_rect.x = 0
sprite.src_rect.y = 0
sprite.visible = true
else
create_character_sprite(icon_key, quest, quest_button.x - 64, quest_button.y - 20)
end
end
def refresh_quest_list
@main.clear if @main
MAX_VISIBLE_QUESTS.times do |i|
quest_index = @quest_list_menu_index - @box + i
next if quest_index < 0 || quest_index >= @filtered_quests.size
quest = @filtered_quests[quest_index]
# Update the quest button
sprite = @sprites["quest#{i}"]
sprite.quest = quest if sprite
sprite.src_rect.y = (i == @box ? (sprite.bitmap.height / 2).round : 0) if sprite
draw_quest_name_on_main(i, quest)
set_quest_list_sprite(i, quest)
end
# Update arrow visibility
@sprites["up"].visible = @quest_list_menu_index > 0
@sprites["down"].visible = @quest_list_menu_index < @filtered_quests.size - 1
# Redraw the title
pbDrawOutlineText(@main, 0, 2, 512, 384, @current_mode.title,
Color.new(255, 255, 255), Color.new(0, 0, 0), 1)
end
##---------------------------------------------------------------------------
## Quest Detail Display
##---------------------------------------------------------------------------
def dispose_quest_list_sprites
MAX_VISIBLE_QUESTS.times do |i|
if @sprites["quest#{i}"]
@sprites["quest#{i}"].dispose
@sprites.delete("quest#{i}")
end
if @sprites["quest_icon#{i}"]
@sprites["quest_icon#{i}"].dispose
@sprites.delete("quest_icon#{i}")
end
end
end
def show_quest_detail
return if @filtered_quests.empty?
@current_mode.last_index = @quest_list_menu_index
dispose_quest_list_sprites
quest = @filtered_quests[@quest_list_menu_index]
pbWait(1)
@scene = SCENE_DETAIL
create_detail_background
fade_to_detail
create_character_sprite("char", quest, 62, 130)
draw_quest_details(quest)
animate_detail_in
end
def create_detail_background
@sprites["bg1"] = IconSprite.new(0, 0, @viewport)
@sprites["bg1"].setBitmap("Graphics/Pictures/EQI/quest_page1")
@sprites["bg1"].opacity = 0
@sprites["pager"] = IconSprite.new(0, 0, @viewport)
@sprites["pager"].setBitmap("Graphics/Pictures/EQI/quest_pager")
@sprites["pager"].x = 442
@sprites["pager"].y = 3
@sprites["pager"].z = 1
@sprites["pager"].opacity = 0
end
def fade_to_detail
8.times do
Graphics.update
@sprites["up"]&.opacity -= FADE_SPEED
@sprites["down"]&.opacity -= FADE_SPEED
@sprites["main"]&.opacity -= FADE_SPEED
@sprites["bg1"]&.opacity += FADE_SPEED if @sprites["bg1"]
@sprites["pager"]&.opacity = 0 if @sprites["pager"]
@sprites["char"]&.opacity -= FADE_SPEED if @sprites["char"]
fade_quest_list_sprites
end
@sprites["up"]&.dispose
@sprites["down"]&.dispose
end
def fade_quest_list_sprites
MAX_VISIBLE_QUESTS.times do |i|
@sprites["quest#{i}"].opacity -= FADE_SPEED if @sprites["quest#{i}"]
end
end
def create_character_sprite(spriteId,quest,x,y, max_height=nil)
@sprites[spriteId] = IconSprite.new(0, 0, @viewport)
@sprites[spriteId].setBitmap("Graphics/Characters/#{quest.sprite}")
@sprites[spriteId].x = x
@sprites[spriteId].y = y
@sprites[spriteId].src_rect.height = max_height ? max_height : (@sprites[spriteId].bitmap.height / 4).round
@sprites[spriteId].src_rect.width = (@sprites[spriteId].bitmap.width / 4).round
@sprites[spriteId].opacity = 0
end
def draw_quest_details(quest)
@main.clear if @main
@text.clear if @text
@text2.clear if @text2
pbDrawOutlineText(@main, 188, 54, 512, 384, quest.name,
Color.new(255, 172, 115), Color.new(0, 0, 0))
drawTextExMulti(@main, 188, 84, 318, 8, quest.desc,
Color.new(255, 255, 255), Color.new(0, 0, 0))
pbDrawOutlineText(@main, 188, 330, 512, 384, quest.location,
Color.new(255, 172, 115), Color.new(0, 0, 0))
draw_completion_status(quest)
end
def draw_completion_status(quest)
if quest.completed
pbDrawOutlineText(@main, 8, 315, 512, 384, _INTL("Completed"),
pbColor(:LIGHTBLUE), Color.new(0, 0, 0))
else
pbDrawOutlineText(@main, 8, 315, 512, 384, _INTL("Not Completed"),
pbColor(:LIGHTRED), Color.new(0, 0, 0))
end
end
def animate_detail_in
10.times do |i|
Graphics.update
@sprites["bg0"].opacity += FADE_SPEED
@sprites["main"].opacity += FADE_SPEED
@sprites["bg1"].opacity += FADE_SPEED if @sprites["bg1"]
@sprites["char"].opacity += FADE_SPEED if i > 1
end
end
##---------------------------------------------------------------------------
## Animations
##---------------------------------------------------------------------------
def animate_arrows
return unless @sprites["up"] && !@sprites["up"].disposed?
return unless @sprites["down"] && !@sprites["down"].disposed?
if [2, 4, 14, 16].include?(@frame)
@sprites["up"].y -= 1
@sprites["down"].y -= 1
elsif [6, 8, 10, 12].include?(@frame)
@sprites["up"].y += 1
@sprites["down"].y += 1
end
end
def animate_character
["char", "char2"].each do |char_key|
next unless @sprites[char_key]
sprite = @sprites[char_key]
sprite.src_rect.x += (sprite.bitmap.width / 4).round
sprite.src_rect.x = 0 if sprite.src_rect.x >= sprite.bitmap.width
end
end
##---------------------------------------------------------------------------
## Cleanup
##---------------------------------------------------------------------------
def cleanup
if @switch_to_map
showBlk(1) # instant black
else
ANIMATION_FRAMES.times do |i|
Graphics.update
@sprites["bg0"].opacity -= FADE_SPEED if @sprites["bg0"] && i > 3
@sprites["bg1"].opacity -= FADE_SPEED if @sprites["bg1"] && i > 3
@sprites["pager"].opacity -= FADE_SPEED if @sprites["pager"] && i > 3
@modes.size.times do |j|
@sprites["btn#{j}"].opacity -= FADE_SPEED if @sprites["btn#{j}"]
end
@sprites["main"].opacity -= FADE_SPEED if @sprites["main"]
@sprites["char"].opacity -= 40 if @sprites["char"]
@sprites["char2"].opacity -= 40 if @sprites["char2"]
end
end
pbDisposeSpriteHash(@sprites)
@viewport.dispose
pbWait(1)
end
end
@@ -53,7 +53,7 @@ def registeel_ice_press_switch(letter)
pbSet(VAR_REGI_PUZZLE_SWITCH_PRESSED, order)
if order == solution
echoln "OK"
pbSEPlay("Evolution start", nil, 130)
pbMEPlay("evolution_start", nil, 130)
elsif order.length >= solution.length
registeel_ice_reset_switches()
end
@@ -98,4 +98,4 @@ def regirock_steel_move_boulder()
pbSEPlay("Entering Door")
pbSetSelfSwitch(switch_event.id, "A", true) if switch_event
end
end
end
@@ -1,9 +1,16 @@
TEAM_ROCKET_CLOTHES = [CLOTHES_TEAM_ROCKET_MALE, CLOTHES_TEAM_ROCKET_FEMALE, CLOTHES_ROCKET_WHITE_M, CLOTHES_ROCKET_WHITE_F]
def isWearingTeamRocketOutfit()
return false if !$game_switches[SWITCH_JOINED_TEAM_ROCKET]
return (isWearingClothes(CLOTHES_TEAM_ROCKET_MALE) || isWearingClothes(CLOTHES_TEAM_ROCKET_FEMALE)) && isWearingHat(HAT_TEAM_ROCKET)
wearing_rocket_clothes = false
TEAM_ROCKET_CLOTHES.each do |clothes|
wearing_rocket_clothes = true if isWearingClothes(clothes)
end
return wearing_rocket_clothes && isWearingHat(HAT_TEAM_ROCKET)
end
def isWearingFavoriteOutfit()
favorites = {
hat: $Trainer.favorite_hat,
@@ -72,8 +79,8 @@ def finishTRQuest(id, status, silent = false)
return if pbCompletedQuest?(id)
pbMEPlay("Register phone") if status == :SUCCESS && !silent
pbMEPlay("Voltorb Flip Game Over") if status == :FAILURE && !silent
Kernel.pbMessage("\\C[2]Mission completed!") if status == :SUCCESS && !silent
Kernel.pbMessage("\\C[2]Mission Failed...") if status == :FAILURE && !silent
Kernel.pbMessage(_INTL("\\C[2]Mission completed!")) if status == :SUCCESS && !silent
Kernel.pbMessage(_INTL("\\C[2]Mission Failed...")) if status == :FAILURE && !silent
$game_variables[VAR_KARMA] -= 5 # karma
$game_variables[VAR_NB_ROCKET_MISSIONS] += 1 #nb. quests completed
@@ -377,4 +384,4 @@ def resetPinkanIsland()
$game_self_switches[[map_id, event.id, "D"]] = false
end
end
end
end