diff --git a/Data/Actors.rxdata b/Data/Actors.rxdata index 41edc8e26..7967a5432 100644 Binary files a/Data/Actors.rxdata and b/Data/Actors.rxdata differ diff --git a/Data/Animations.rxdata b/Data/Animations.rxdata index 826e1e8a6..8e67182ba 100644 Binary files a/Data/Animations.rxdata and b/Data/Animations.rxdata differ diff --git a/Data/Armors.rxdata b/Data/Armors.rxdata index 901f2bb2b..2249bec14 100644 Binary files a/Data/Armors.rxdata and b/Data/Armors.rxdata differ diff --git a/Data/CommonEvents.rxdata b/Data/CommonEvents.rxdata index 907609ba6..bf3ff50fc 100644 Binary files a/Data/CommonEvents.rxdata and b/Data/CommonEvents.rxdata differ diff --git a/Data/Enemies.rxdata b/Data/Enemies.rxdata index be622f513..004ee903d 100644 Binary files a/Data/Enemies.rxdata and b/Data/Enemies.rxdata differ diff --git a/Data/Items.rxdata b/Data/Items.rxdata index fe767fa0b..3e62ba6d2 100644 Binary files a/Data/Items.rxdata and b/Data/Items.rxdata differ diff --git a/Data/Map407.rxdata b/Data/Map407.rxdata index c113e7a23..4d494ebcd 100644 Binary files a/Data/Map407.rxdata and b/Data/Map407.rxdata differ diff --git a/Data/Map744.rxdata b/Data/Map744.rxdata index 54bd8c0df..f2a527d45 100644 Binary files a/Data/Map744.rxdata and b/Data/Map744.rxdata differ diff --git a/Data/Map788.rxdata b/Data/Map788.rxdata index b8481bd72..8b677d0e7 100644 Binary files a/Data/Map788.rxdata and b/Data/Map788.rxdata differ diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata index dee433ae9..72ca33123 100644 Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ diff --git a/Data/Scripts/050_AddOns/GeneralUtils.rb b/Data/Scripts/050_AddOns/GeneralUtils.rb index e518c6705..81d5ff810 100644 --- a/Data/Scripts/050_AddOns/GeneralUtils.rb +++ b/Data/Scripts/050_AddOns/GeneralUtils.rb @@ -157,6 +157,7 @@ def isTripleFusion?(num) return num >= Settings::ZAPMOLCUNO_NB end + def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3) if customPokeList.length == 0 customPokeList = getCustomSpeciesList(false ) diff --git a/Data/Scripts/050_AddOns/GuessPokemonQuiz.rb b/Data/Scripts/050_AddOns/GuessPokemonQuiz.rb new file mode 100644 index 000000000..f7f4bcf8e --- /dev/null +++ b/Data/Scripts/050_AddOns/GuessPokemonQuiz.rb @@ -0,0 +1,156 @@ +class FusionQuiz + + # + # Possible difficulties: + # + # :REGULAR -> 4 options choice + # + # :ADVANCED -> List of all pokemon + # + def initialize(difficulty = :REGULAR) + @sprites = {} + + @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) + + @difficulty = difficulty + @customs_list = getCustomSpeciesList(true, false) + @selected_pokemon = nil + @head_id = nil + @body_id = nil + @choices = [] + + @score = 0 + end + + def start_quiz_round() + pick_random_pokemon() + show_fusion_picture(true) + + #QUESTION 1 + new_question(500, "What Pokémon is this fusion's body?",@body_id,true) + pbMessage("Next question!") + new_question(500,"What Pokémon is this fusion's head?", @head_id,true) + @viewport.dispose + + show_fusion_picture(false ) + #QUESTION 1 + new_question(200, "What Pokémon is this fusion's body?",@body_id,true) + pbMessage("Next question!") + new_question(200,"What Pokémon is this fusion's head?", @head_id,true) + @viewport.dispose + + end + + + def new_question(points_value,question, answer_id, should_generate_new_choices) + answer_name = getPokemon(answer_id).real_name + answered_correctly = give_answer(question,answer_id,should_generate_new_choices) + award_points(points_value) if answered_correctly + question_answer_followup_dialog(answered_correctly,answer_name,points_value,true) + end + + + + def award_points(nb_points) + @score += nb_points + end + + def question_answer_followup_dialog(answered_correctly,correct_answer, points_awarded_if_win, other_chance_later=false) + pbMessage("And the correct answer was...") + pbMessage("...") + pbMessage(_INTL("{1}!",correct_answer)) + if answered_correctly + pbMessage("That's a correct answer!") + pbMessage(_INTL("You're awarded {1} points your answer. Your current score is {2}",points_awarded_if_win,@score.to_s)) + else + pbMessage("Unfortunately, you didn't get the answer right. ") + pbMessage("But you'll get another chance later!") if other_chance_later + end + end + + + def show_fusion_picture(obscured = false) + picturePath = get_fusion_sprite_path(@head_id, @body_id) + bitmap = AnimatedBitmap.new(picturePath) + bitmap.scale_bitmap(Settings::FRONTSPRITE_SCALE) + previewwindow = PictureWindow.new(bitmap) + previewwindow.y = 30 + previewwindow.x = 100 + previewwindow.z = 100000 + if obscured + previewwindow.picture.pbSetColor(255, 255, 255, 200) + end + end + + def pick_random_pokemon(save_in_variable = 1) + random_pokemon = getRandomCustomFusionForIntro(true, @customs_list) + @head_id = random_pokemon[0] + @body_id = random_pokemon[1] + @selected_pokemon = getSpeciesIdForFusion(@head_id, @body_id) + pbSet(save_in_variable, @selected_pokemon) + end + + def give_answer(prompt_message,answer_id,should_generate_new_choices) + question_answered=false + answer_pokemon_name = getPokemon(answer_id).real_name + + while !question_answered + if @difficulty == :ADVANCED + player_answer = prompt_pick_answer_advanced(prompt_message,answer_id) + else + player_answer = prompt_pick_answer_regular(prompt_message,answer_id,should_generate_new_choices) + end + confirmed = pbMessage("Is that your final answer?",["Yes","No"]) + if confirmed==0 + question_answered=true + end + end + return player_answer == answer_pokemon_name + end + + def get_random_pokemon_from_same_egg_group(pokemon,previous_choices) + egg_groups = getPokemonEggGroups(pokemon) + while true + new_pokemon = rand(NB_POKEMON+1) + new_pokemon_egg_groups = getPokemonEggGroups(new_pokemon) + if (egg_groups & new_pokemon_egg_groups).any? && !previous_choices.include?(new_pokemon) + return new_pokemon + end + end + end + + def prompt_pick_answer_regular(prompt_message,real_answer,should_new_choices) + commands = should_new_choices ? generate_new_choices(real_answer) : @choices + chosen = pbMessage(prompt_message,commands) + #chosen = pbChooseList(commands, 0, nil, 1) + return commands[chosen] + end + + def generate_new_choices(real_answer) + choices = [] + choices << real_answer + choices << get_random_pokemon_from_same_egg_group(real_answer,choices) + choices << get_random_pokemon_from_same_egg_group(real_answer,choices) + choices << get_random_pokemon_from_same_egg_group(real_answer,choices) + + commands = [] + choices.each do |dex_num, i| + species = getPokemon(dex_num) + commands.push(species.real_name) + end + @choices = commands + return commands.shuffle + end + + + def prompt_pick_answer_advanced(prompt_message,answer) + choices.each do |dex_num, i| + species = getPokemon(dex_num) + commands.push([i, species.real_name, species.real_name]) + end + pbMessage(prompt_message) + #chosen = pbChooseList(commands, 0, nil, 1) + + end + +end diff --git a/Data/Scripts/050_AddOns/SpriteCreditsUtils.rb b/Data/Scripts/050_AddOns/SpriteCreditsUtils.rb index 951061de0..55a50f1b4 100644 --- a/Data/Scripts/050_AddOns/SpriteCreditsUtils.rb +++ b/Data/Scripts/050_AddOns/SpriteCreditsUtils.rb @@ -140,7 +140,7 @@ def generateCurrentGalleryBattle(level = nil, number_of_pokemon = 3) selected_battlers_idx = possible_battlers.sample(number_of_pokemon) party = [] - selected_battlers_idx.each { |species| + selected_battlers_idx.each { |species|00 party << Pokemon.new(species, level) } customTrainerBattle(spriter_name, @@ -159,6 +159,7 @@ def generateArtGallery(nbSpritesDisplayed = 6, saveArtistNameInVariable = 1, sav featuredArtist = artistName ? artistName : getRandomSpriteArtist(creditsMap, nbSpritesDisplayed) if featuredArtist if !creditsMap[featuredArtist] #try again if issue + artistName = getRandomSpriteArtist(creditsMap, nbSpritesDisplayed) return generateArtGallery(nbSpritesDisplayed,saveSpritesInVariable,saveSpritesInVariable,saveSpritesInVariable,artistName) end featuredSprites = creditsMap[featuredArtist].shuffle.take(nbSpritesDisplayed) diff --git a/Data/Skills.rxdata b/Data/Skills.rxdata index a45219f5e..61cba7ea2 100644 Binary files a/Data/Skills.rxdata and b/Data/Skills.rxdata differ diff --git a/Data/States.rxdata b/Data/States.rxdata index 868d49e59..0f9b4ae5d 100644 Binary files a/Data/States.rxdata and b/Data/States.rxdata differ diff --git a/Data/System.rxdata b/Data/System.rxdata index f52b4428a..7ee3841cf 100644 Binary files a/Data/System.rxdata and b/Data/System.rxdata differ diff --git a/Data/Tilesets.rxdata b/Data/Tilesets.rxdata index 328f9c904..3aeb3d610 100644 Binary files a/Data/Tilesets.rxdata and b/Data/Tilesets.rxdata differ diff --git a/Data/Weapons.rxdata b/Data/Weapons.rxdata index c7ea19a7a..d9bd35260 100644 Binary files a/Data/Weapons.rxdata and b/Data/Weapons.rxdata differ