mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Entering TR HQ after Team Rocket has disbanded automatically completes any unfinished quests
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -759,7 +759,7 @@ def give_date_specific_hats()
|
|||||||
current_date = Time.new
|
current_date = Time.new
|
||||||
if (current_date.day == 24 || current_date.day == 25) && current_date.month == 12
|
if (current_date.day == 24 || current_date.day == 25) && current_date.month == 12
|
||||||
if !$Trainer.unlocked_hats.include?(HAT_SANTA)
|
if !$Trainer.unlocked_hats.include?(HAT_SANTA)
|
||||||
pbCallBub(2,@event_id,true)
|
pbCallBub(2, @event_id, true)
|
||||||
pbMessage("Hi! We're giving out a special hat today for the holidays season. Enjoy!")
|
pbMessage("Hi! We're giving out a special hat today for the holidays season. Enjoy!")
|
||||||
obtainHat(HAT_SANTA)
|
obtainHat(HAT_SANTA)
|
||||||
end
|
end
|
||||||
@@ -851,7 +851,6 @@ def replaceFusionSpecies(pokemon, speciesToChange, newSpecies)
|
|||||||
echoln currentBody
|
echoln currentBody
|
||||||
echoln currentHead
|
echoln currentHead
|
||||||
|
|
||||||
|
|
||||||
return if !should_update_body && !should_update_head
|
return if !should_update_body && !should_update_head
|
||||||
|
|
||||||
newSpeciesBody = should_update_body ? newSpecies : currentBody
|
newSpeciesBody = should_update_body ? newSpecies : currentBody
|
||||||
@@ -897,14 +896,22 @@ end
|
|||||||
#@formatter:off
|
#@formatter:off
|
||||||
def get_constellation_variable(pokemon)
|
def get_constellation_variable(pokemon)
|
||||||
case pokemon
|
case pokemon
|
||||||
when :IVYSAUR; return VAR_CONSTELLATION_IVYSAUR
|
when :IVYSAUR;
|
||||||
when :WARTORTLE; return VAR_CONSTELLATION_WARTORTLE
|
return VAR_CONSTELLATION_IVYSAUR
|
||||||
when :ARCANINE; return VAR_CONSTELLATION_ARCANINE
|
when :WARTORTLE;
|
||||||
when :MACHOKE; return VAR_CONSTELLATION_MACHOKE
|
return VAR_CONSTELLATION_WARTORTLE
|
||||||
when :RAPIDASH; return VAR_CONSTELLATION_RAPIDASH
|
when :ARCANINE;
|
||||||
when :GYARADOS; return VAR_CONSTELLATION_GYARADOS
|
return VAR_CONSTELLATION_ARCANINE
|
||||||
when :ARTICUNO; return VAR_CONSTELLATION_ARTICUNO
|
when :MACHOKE;
|
||||||
when :MEW; return VAR_CONSTELLATION_MEW
|
return VAR_CONSTELLATION_MACHOKE
|
||||||
|
when :RAPIDASH;
|
||||||
|
return VAR_CONSTELLATION_RAPIDASH
|
||||||
|
when :GYARADOS;
|
||||||
|
return VAR_CONSTELLATION_GYARADOS
|
||||||
|
when :ARTICUNO;
|
||||||
|
return VAR_CONSTELLATION_ARTICUNO
|
||||||
|
when :MEW;
|
||||||
|
return VAR_CONSTELLATION_MEW
|
||||||
# when :POLITOED; return VAR_CONSTELLATION_POLITOED
|
# when :POLITOED; return VAR_CONSTELLATION_POLITOED
|
||||||
# when :URSARING; return VAR_CONSTELLATION_URSARING
|
# when :URSARING; return VAR_CONSTELLATION_URSARING
|
||||||
# when :LUGIA; return VAR_CONSTELLATION_LUGIA
|
# when :LUGIA; return VAR_CONSTELLATION_LUGIA
|
||||||
@@ -917,6 +924,7 @@ def get_constellation_variable(pokemon)
|
|||||||
# when :ARCEUS; return VAR_CONSTELLATION_ARCEUS
|
# when :ARCEUS; return VAR_CONSTELLATION_ARCEUS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#@formatter:on
|
#@formatter:on
|
||||||
|
|
||||||
def promptCaughtPokemonAction(pokemon)
|
def promptCaughtPokemonAction(pokemon)
|
||||||
@@ -1398,7 +1406,7 @@ def get_mart_exclusive_items(city)
|
|||||||
return items_list
|
return items_list
|
||||||
end
|
end
|
||||||
|
|
||||||
def calculate_pokemon_weight(pokemon,nerf=0)
|
def calculate_pokemon_weight(pokemon, nerf = 0)
|
||||||
|
|
||||||
base_weight = pokemon.weight
|
base_weight = pokemon.weight
|
||||||
ivs = []
|
ivs = []
|
||||||
@@ -1426,18 +1434,18 @@ def calculate_pokemon_weight(pokemon,nerf=0)
|
|||||||
|
|
||||||
# Cap the weight between min and max values
|
# Cap the weight between min and max values
|
||||||
weight = [[weight, min_weight].max, max_weight].min
|
weight = [[weight, min_weight].max, max_weight].min
|
||||||
weight -= nerf if weight- nerf > min_weight
|
weight -= nerf if weight - nerf > min_weight
|
||||||
return weight.round(2) # Round to 2 decimal places
|
return weight.round(2) # Round to 2 decimal places
|
||||||
end
|
end
|
||||||
|
|
||||||
#nerf: remove x kg from each generated pokemon
|
#nerf: remove x kg from each generated pokemon
|
||||||
def generate_weight_contest_entries(species, level, resultsVariable,nerf=0)
|
def generate_weight_contest_entries(species, level, resultsVariable, nerf = 0)
|
||||||
#echoln "Generating Pokemon"
|
#echoln "Generating Pokemon"
|
||||||
pokemon1 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
|
pokemon1 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
|
||||||
pokemon2 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
|
pokemon2 = pbGenerateWildPokemon(species, level) #Pokemon.new(species,level)
|
||||||
new_weights = []
|
new_weights = []
|
||||||
new_weights << calculate_pokemon_weight(pokemon1,nerf)
|
new_weights << calculate_pokemon_weight(pokemon1, nerf)
|
||||||
new_weights << calculate_pokemon_weight(pokemon2,nerf)
|
new_weights << calculate_pokemon_weight(pokemon2, nerf)
|
||||||
echoln new_weights
|
echoln new_weights
|
||||||
echoln "(nerfed by -#{nerf})"
|
echoln "(nerfed by -#{nerf})"
|
||||||
pbSet(resultsVariable, new_weights.max)
|
pbSet(resultsVariable, new_weights.max)
|
||||||
@@ -1493,8 +1501,6 @@ def isPlayerFemale()
|
|||||||
return pbGet(VAR_TRAINER_GENDER) == GENDER_FEMALE
|
return pbGet(VAR_TRAINER_GENDER) == GENDER_FEMALE
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def optionsMenu(options = [], cmdIfCancel = -1, startingOption = 0)
|
def optionsMenu(options = [], cmdIfCancel = -1, startingOption = 0)
|
||||||
cmdIfCancel = -1 if !cmdIfCancel
|
cmdIfCancel = -1 if !cmdIfCancel
|
||||||
result = pbShowCommands(nil, options, cmdIfCancel, startingOption)
|
result = pbShowCommands(nil, options, cmdIfCancel, startingOption)
|
||||||
@@ -1529,13 +1535,12 @@ QUEST_REWARDS = [
|
|||||||
QuestReward.new(10, :LANTERN, 1, "This will allow you to illuminate caves without having to use a HM! Practical, isn't it?"),
|
QuestReward.new(10, :LANTERN, 1, "This will allow you to illuminate caves without having to use a HM! Practical, isn't it?"),
|
||||||
QuestReward.new(15, :LINKINGCORD, 3, "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(15, :LINKINGCORD, 3, "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(20, :SLEEPINGBAG, 1, "This handy item will allow you to sleep anywhere you want. You won't even need hotels anymore!"),
|
QuestReward.new(20, :SLEEPINGBAG, 1, "This handy item will allow you to sleep anywhere you want. You won't even need hotels anymore!"),
|
||||||
QuestReward.new(30, :MISTSTONE, 1, "This rare stone can evolve any Pokémon, regardless of their level or evolution method. Use it wisely!",true),
|
QuestReward.new(30, :MISTSTONE, 1, "This rare stone can evolve any Pokémon, regardless of their level or evolution method. Use it wisely!", true),
|
||||||
QuestReward.new(50, :GSBALL, 1, "This mysterious ball is rumored to be the key to call upon the protector of Ilex Forest. It's a precious relic."),
|
QuestReward.new(50, :GSBALL, 1, "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, "This rare ball can catch any Pokémon. Don't waste it!",true),
|
QuestReward.new(60, :MASTERBALL, 1, "This rare ball can catch any Pokémon. Don't waste it!", true),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def turnEventTowardsEvent(turning, turnedTowards)
|
||||||
def turnEventTowardsEvent(turning,turnedTowards)
|
|
||||||
event_x = turnedTowards.x
|
event_x = turnedTowards.x
|
||||||
event_y = turnedTowards.y
|
event_y = turnedTowards.y
|
||||||
if turning.x < event_x
|
if turning.x < event_x
|
||||||
@@ -1563,8 +1568,7 @@ def turnPlayerTowardsEvent(event)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def displaySpriteWindowWithMessage(pif_sprite, message = "", x = 0, y = 0, z = 0)
|
||||||
def displaySpriteWindowWithMessage(pif_sprite, message = "", x = 0, y = 0,z=0)
|
|
||||||
spriteLoader = BattleSpriteLoader.new
|
spriteLoader = BattleSpriteLoader.new
|
||||||
sprite_bitmap = spriteLoader.load_pif_sprite_directly(pif_sprite)
|
sprite_bitmap = spriteLoader.load_pif_sprite_directly(pif_sprite)
|
||||||
pictureWindow = PictureWindow.new(sprite_bitmap.bitmap)
|
pictureWindow = PictureWindow.new(sprite_bitmap.bitmap)
|
||||||
@@ -1586,13 +1590,12 @@ def select_any_pokemon()
|
|||||||
return pbChooseList(commands, 0, nil, 1)
|
return pbChooseList(commands, 0, nil, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
SWITCH_SS_ANNE_DEPARTED = 88
|
||||||
SWITCH_SS_ANNE_DEPARTED=88
|
SWITCH_SNORLAX_GONE_ROUTE_12 = 110
|
||||||
SWITCH_SNORLAX_GONE_ROUTE_12=110
|
|
||||||
SWITCH_TELEPORT_NPC = 122
|
SWITCH_TELEPORT_NPC = 122
|
||||||
SWITCH_GOT_DIVE=317
|
SWITCH_GOT_DIVE = 317
|
||||||
SWITCH_GOT_ROCK_CLIMB=661
|
SWITCH_GOT_ROCK_CLIMB = 661
|
||||||
SWITCH_GOT_WATERFALL=388
|
SWITCH_GOT_WATERFALL = 388
|
||||||
|
|
||||||
def fixMissedHMs()
|
def fixMissedHMs()
|
||||||
#Flash
|
#Flash
|
||||||
@@ -1641,7 +1644,6 @@ def fixMissedHMs()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def fixFinishedRocketQuests()
|
def fixFinishedRocketQuests()
|
||||||
fix_broken_TR_quests()
|
fix_broken_TR_quests()
|
||||||
|
|
||||||
@@ -1656,23 +1658,23 @@ def fixFinishedRocketQuests()
|
|||||||
|
|
||||||
nb_cerulean_missions = pbGet(var_tr_missions_cerulean)
|
nb_cerulean_missions = pbGet(var_tr_missions_cerulean)
|
||||||
|
|
||||||
finishTRQuest("tr_cerulean_1",:SUCCESS,true) if nb_cerulean_missions >= 1 && !pbCompletedQuest?("tr_cerulean_1")
|
finishTRQuest("tr_cerulean_1", :SUCCESS, true) if nb_cerulean_missions >= 1 && !pbCompletedQuest?("tr_cerulean_1")
|
||||||
echoln pbCompletedQuest?("tr_cerulean_1")
|
echoln pbCompletedQuest?("tr_cerulean_1")
|
||||||
finishTRQuest("tr_cerulean_2",:SUCCESS,true) if nb_cerulean_missions >= 2 && !pbCompletedQuest?("tr_cerulean_2")
|
finishTRQuest("tr_cerulean_2", :SUCCESS, true) if nb_cerulean_missions >= 2 && !pbCompletedQuest?("tr_cerulean_2")
|
||||||
finishTRQuest("tr_cerulean_3",:SUCCESS,true) if nb_cerulean_missions >= 3 && !pbCompletedQuest?("tr_cerulean_3")
|
finishTRQuest("tr_cerulean_3", :SUCCESS, true) if nb_cerulean_missions >= 3 && !pbCompletedQuest?("tr_cerulean_3")
|
||||||
finishTRQuest("tr_cerulean_4",:SUCCESS,true) if $game_switches[switch_tr_mission_cerulean_4] && !pbCompletedQuest?("tr_cerulean_4")
|
finishTRQuest("tr_cerulean_4", :SUCCESS, true) if $game_switches[switch_tr_mission_cerulean_4] && !pbCompletedQuest?("tr_cerulean_4")
|
||||||
|
|
||||||
finishTRQuest("tr_celadon_1",:SUCCESS,true) if $game_switches[switch_tr_mission_celadon_1] && !pbCompletedQuest?("tr_celadon_1")
|
finishTRQuest("tr_celadon_1", :SUCCESS, true) if $game_switches[switch_tr_mission_celadon_1] && !pbCompletedQuest?("tr_celadon_1")
|
||||||
finishTRQuest("tr_celadon_2",:SUCCESS,true) if $game_switches[switch_tr_mission_celadon_2] && !pbCompletedQuest?("tr_celadon_2")
|
finishTRQuest("tr_celadon_2", :SUCCESS, true) if $game_switches[switch_tr_mission_celadon_2] && !pbCompletedQuest?("tr_celadon_2")
|
||||||
finishTRQuest("tr_celadon_3",:SUCCESS,true) if $game_switches[switch_tr_mission_celadon_3] && !pbCompletedQuest?("tr_celadon_3")
|
finishTRQuest("tr_celadon_3", :SUCCESS, true) if $game_switches[switch_tr_mission_celadon_3] && !pbCompletedQuest?("tr_celadon_3")
|
||||||
finishTRQuest("tr_celadon_4",:SUCCESS,true) if $game_switches[switch_tr_mission_celadon_4] && !pbCompletedQuest?("tr_celadon_4")
|
finishTRQuest("tr_celadon_4", :SUCCESS, true) if $game_switches[switch_tr_mission_celadon_4] && !pbCompletedQuest?("tr_celadon_4")
|
||||||
|
|
||||||
finishTRQuest("tr_pinkan",:SUCCESS,true) if $game_switches[switch_pinkan_done] && !pbCompletedQuest?("tr_pinkan")
|
finishTRQuest("tr_pinkan", :SUCCESS, true) if $game_switches[switch_pinkan_done] && !pbCompletedQuest?("tr_pinkan")
|
||||||
end
|
end
|
||||||
|
|
||||||
def fix_broken_TR_quests()
|
def fix_broken_TR_quests()
|
||||||
for trainer_quest in $Trainer.quests
|
for trainer_quest in $Trainer.quests
|
||||||
if trainer_quest.id ==0 #tr quests were all set to ID 0 instead of their real ID in v 6.4.0
|
if trainer_quest.id == 0 #tr quests were all set to ID 0 instead of their real ID in v 6.4.0
|
||||||
for rocket_quest_id in TR_QUESTS.keys
|
for rocket_quest_id in TR_QUESTS.keys
|
||||||
rocket_quest = TR_QUESTS[rocket_quest_id]
|
rocket_quest = TR_QUESTS[rocket_quest_id]
|
||||||
next if !rocket_quest
|
next if !rocket_quest
|
||||||
@@ -1682,4 +1684,18 @@ end
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def failAllIncompleteRocketQuests()
|
||||||
|
for trainer_quest in $Trainer.quests
|
||||||
|
finishTRQuest("tr_cerulean_1", :FAILURE) if trainer_quest.id == "tr_cerulean_1" && !pbCompletedQuest?("tr_cerulean_1")
|
||||||
|
finishTRQuest("tr_cerulean_2", :FAILURE) if trainer_quest.id == "tr_cerulean_2" && !pbCompletedQuest?("tr_cerulean_2")
|
||||||
|
finishTRQuest("tr_cerulean_3", :FAILURE) if trainer_quest.id == "tr_cerulean_3" && !pbCompletedQuest?("tr_cerulean_3")
|
||||||
|
finishTRQuest("tr_cerulean_4", :FAILURE) if trainer_quest.id == "tr_cerulean_4" && !pbCompletedQuest?("tr_cerulean_4")
|
||||||
|
|
||||||
|
finishTRQuest("tr_celadon_1", :FAILURE) if trainer_quest.id == "tr_celadon_1" && !pbCompletedQuest?("tr_celadon_1")
|
||||||
|
finishTRQuest("tr_celadon_2", :FAILURE) if trainer_quest.id == "tr_celadon_2" && !pbCompletedQuest?("tr_celadon_2")
|
||||||
|
finishTRQuest("tr_celadon_3", :FAILURE) if trainer_quest.id == "tr_celadon_3" && !pbCompletedQuest?("tr_celadon_3")
|
||||||
|
finishTRQuest("tr_celadon_4", :FAILURE) if trainer_quest.id == "tr_celadon_4" && !pbCompletedQuest?("tr_celadon_4")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
Binary file not shown.
Reference in New Issue
Block a user