From 28c91aec12703786930eae1fcce1d24d5c9bb766 Mon Sep 17 00:00:00 2001 From: infinitefusion Date: Sun, 2 Jul 2023 14:22:09 -0400 Subject: [PATCH] Adds streak system to fusion quiz + tracks statistics --- Data/Map246.rxdata | Bin 15140 -> 15153 bytes Data/Map247.rxdata | Bin 25200 -> 26594 bytes Data/Map744.rxdata | Bin 7830 -> 7813 bytes Data/Scripts/049_Compatibility/Constants.rb | 3 + Data/Scripts/050_AddOns/DisplayText.rb | 4 +- Data/Scripts/050_AddOns/GuessPokemonQuiz.rb | 203 +++++++++++++------- Data/System.rxdata | Bin 27931 -> 27991 bytes 7 files changed, 134 insertions(+), 76 deletions(-) diff --git a/Data/Map246.rxdata b/Data/Map246.rxdata index a5135fca1451f3cce29c99dd240683b600ecc72c..eb1ab9ba19409eaa3d50bd7a142a8d388547ec9a 100644 GIT binary patch literal 15153 zcmeHO-E$jP6_;&T$+8{CN!s)yO|BK%*uioAl_uG3h-}%4Mf_D+PMXFY&sw^cZoJy7 z?yl^ped1$)Cps_;JistK(w0Ah8J_q9fF~#~z*Aucm|>Y`pbsdgtfi)F5!7A4cw0^@0B(3skr+~G#GOc_(- zNmDP=#Od4IC{WYl1(IS;P3=imn3FF-g_B7K+St_DUKdhWxhirFBfq;^Dyd0wEb<5RAkifN}GM5}6dj+^x5 z2>$(%|FY#f6tW)e42x*bu#S(trV8uxinv$O!y>HXU+hH|hYyOZ|7(9J?OAsiF-Gf` z=3ydUKM{Z?&&>jJ7&o~}>Ug-&scK4odqO>(w0BW46B|3a!3t^hOwy*t)`nZUkuN2b zX@JkY9Y>WZew*=nn;qR^`ldm#q>B1D8|udEdm!o86CItY-+MLWNE33T0<&lyC$h1{ z9;HDNp>&H^9V&Ua2sFrIK};K{a|KI1{YOE4s1O9k-e#2wN}2{`TeL!TC#Uu$9g7u< z)Pl)@1P-li=q4*eoipxuTNZt%O3i$Y#h`N0(kmsF=j!=pXm7jU^+GjX(eprk*70xX zCSL*q=7E13!aO4IeMNWR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!^4f111B^%$sk!V#p@!-H8_PLoMtde1IHMQ)4wwe zQgoVNU^;MCqW5X8$tWc10vw}Z=NO!?!3DZXGnhgNE;?{YfoY8Vg3A?CzOiKGt@hkk zXv|eQEL0&w=WLdKat!h{xJK{IFo>D*{C&%sfdUPgMHz}XjP$v#1ipFXQ)G@$h^3Y* zhNzDFB1l7j{=x9#4m{xm`Aq@3)X@$#ebyzO4k2dxBZK#0KYJ^tu&YAc&Df$2@pfa#b0Ywi?_t0jhdNDF^uRR8rF g$ri_Z|)a9y-WMzkF95B-QL|cQ7FWU8~D_GWTW+@zKJgw|Kj`1Ka9K#$BOG)&)0W% z>h!|4wi%xv-Q(XzmsM4PP))QT9EC_t<{za3-#k`npa2sLPFXOi!f6I)%9?mx1f>db z6k&?NG;KJ`AVI5h3^aP2x8QowlWDq_Gf$3{4Cg*Q&5c-(?y2HKlY<*B2p&LCB*51sq5EU5A8| zC~$M^{RqtP)I@?Wi19{S14$T+PiluN5L*g5@ihV3(2~bYB3sx=k2^)&3USAYTf{&Y zcceD!lz!ikzK`|Pekk{F=s{&~Ry}KU!23P;xUx}D&w6Ca_ z^SoPQr?aT&@4{|2wr0)+I8LE List of all pokemon # def initialize(difficulty = :REGULAR) - @sprites = {} + @sprites = {} - @previewwindow=nil + + @previewwindow = nil @difficulty = difficulty @customs_list = getCustomSpeciesList(true, false) @selected_pokemon = nil @head_id = nil @body_id = nil @choices = [] - @abandonned=false + @abandonned = false @score = 0 + @current_streak = 0 + @streak_multiplier = 0.15 end - def start_quiz(nb_rounds=3) + + def start_quiz(nb_rounds = 3) + nb_games_played= pbGet(VAR_STAT_FUSION_QUIZ_NB_TIMES) + pbSet(VAR_STAT_FUSION_QUIZ_NB_TIMES,nb_games_played+1) + round_multiplier = 1 round_multiplier_increase = 0.1 - for i in 1..nb_rounds if i == nb_rounds pbMessage(_INTL("Get ready! Here comes the final round!")) - elsif i ==1 + elsif i == 1 pbMessage(_INTL("Get ready! Here comes the first round!")) else - pbMessage(_INTL("Get ready! Here comes round {1}!",i)) + pbMessage(_INTL("Get ready! Here comes round {1}!", i)) end start_quiz_new_round(round_multiplier) - - rounds_left = nb_rounds-i - if rounds_left >0 - pbMessage(_INTL("That's it for round {1}. You've cumulated {2} points so far.",i,@score)) - prompt_next_round = pbMessage(_INTL("Are you ready to move on to the next round?",i),["Yes","No"]) + rounds_left = nb_rounds - i + if rounds_left > 0 + pbMessage(_INTL("That's it for round {1}. You've cumulated {2} points so far.", i, @score)) + prompt_next_round = pbMessage(_INTL("Are you ready to move on to the next round?", i), ["Yes", "No"]) if prompt_next_round != 0 - prompt_quit = pbMessage(_INTL("You still have {1} rounds to go. You'll only keep your points if you finish all {2} rounds. Do you really want to quit now?",rounds_left,nb_rounds),["Yes","No"]) + prompt_quit = pbMessage(_INTL("You still have {1} rounds to go. You'll only keep your points if you finish all {2} rounds. Do you really want to quit now?", rounds_left, nb_rounds), ["Yes", "No"]) if prompt_quit - @abandonned=true + @abandonned = true return end end round_multiplier += round_multiplier_increase else - pbMessage(_INTL("That concludes our quiz! You've cumulated {1} points in total.",@score)) + pbMessage(_INTL("That concludes our quiz! You've cumulated {1} points in total.", @score)) pbMessage("Thanks for playing with us today!") end end - - + end_quiz() end - def start_quiz_new_round(round_multiplier=1) - if @difficulty == :ADVANCED - base_points_q1=500 - base_points_q1_redemption=200 - base_points_q2=600 - base_points_q2_redemption=200 - perfect_round_points=100 - else - base_points_q1=300 - base_points_q1_redemption=100 - base_points_q2=400 - base_points_q2_redemption=100 - perfect_round_points=50 - end + def end_quiz() + Kernel.pbClearText() + previous_highest = pbGet(VAR_STAT_FUSION_QUIZ_HIGHEST_SCORE) + pbSet(VAR_STAT_FUSION_QUIZ_HIGHEST_SCORE,@score) if @score > previous_highest + previous_total = pbGet(VAR_STAT_FUSION_QUIZ_TOTAL_PTS) + pbSet(VAR_STAT_FUSION_QUIZ_TOTAL_PTS,previous_total+@score) + end + + def start_quiz_new_round(round_multiplier = 1) + if @difficulty == :ADVANCED + base_points_q1 = 500 + base_points_q1_redemption = 200 + base_points_q2 = 600 + base_points_q2_redemption = 200 + perfect_round_points = 100 + else + base_points_q1 = 300 + base_points_q1_redemption = 100 + base_points_q2 = 400 + base_points_q2_redemption = 100 + perfect_round_points = 50 + end pick_random_pokemon() show_fusion_picture(true) - correct_answers=[] + correct_answers = [] #OBSCURED - correct_answers << new_question(base_points_q1*round_multiplier, "Which Pokémon is this fusion's body?",@body_id,true,true ) + correct_answers << new_question(calculate_points_awarded(base_points_q1, round_multiplier), "Which Pokémon is this fusion's body?", @body_id, true, true) pbMessage("Next question!") - correct_answers << new_question(base_points_q2*round_multiplier,"Which Pokémon is this fusion's head?", @head_id,true,true ) + correct_answers << new_question(calculate_points_awarded(base_points_q2, round_multiplier), "Which Pokémon is this fusion's head?", @head_id, true, true) #NON-OBSCURED if !correct_answers[0] || !correct_answers[1] - show_fusion_picture(false ) + show_fusion_picture(false) pbMessage("Okay, now's your chance to make up for the points you missed!") if !correct_answers[0] #1st question redemption - new_question(base_points_q1_redemption*round_multiplier, "Which Pokémon is this fusion's body?",@body_id,true,false ) + new_question(calculate_points_awarded(base_points_q1_redemption, round_multiplier), "Which Pokémon is this fusion's body?", @body_id, true, false) if !correct_answers[1] pbMessage("Next question!") end end if !correct_answers[1] #2nd question redemption - new_question(base_points_q2_redemption*round_multiplier,"Which Pokémon is this fusion's head?", @head_id,true,false ) + new_question(calculate_points_awarded(base_points_q2_redemption, round_multiplier), "Which Pokémon is this fusion's head?", @head_id, true, false) end - else - pbSEPlay("Applause",80) - pbMessage(_INTL("Wow! A perfect round! You get {1} more points!",perfect_round_points)) - show_fusion_picture(false,100 ) + else + pbSEPlay("Applause", 80) + pbMessage(_INTL("Wow! A perfect round! You get {1} more points!", perfect_round_points)) + show_fusion_picture(false, 100) pbMessage("Let's see what this Pokémon looked like!") - end + current_streak_dialog() hide_fusion_picture() end + def calculate_points_awarded(base_points, round_multiplier) + points = base_points * round_multiplier + if @current_streak > 0 + current_streak_multiplier = (@current_streak * @streak_multiplier) - @streak_multiplier + points += points * current_streak_multiplier + #p (base_points * round_multiplier) + #p (points * current_streak_multiplier) + end + return points + end - def new_question(points_value,question, answer_id, should_generate_new_choices, other_chance_later) - points_value=points_value.to_i + def new_question(points_value, question, answer_id, should_generate_new_choices, other_chance_later) + points_value = points_value.to_i answer_name = getPokemon(answer_id).real_name - answered_correctly = give_answer(question,answer_id,should_generate_new_choices) + 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,other_chance_later) + question_answer_followup_dialog(answered_correctly, answer_name, points_value, other_chance_later) return answered_correctly end + def increase_streak + @current_streak += 1 + refresh_streak_ui() + end + def break_streak + @current_streak = 0 + refresh_streak_ui() + end + + def refresh_streak_ui() + shadow_color = Color.new(160,160,160) + base_color_low_streak = Color.new(72,72,72) + base_color_medium_streak = Color.new(213,254,205) + base_color_high_streak = Color.new(100,232,96) + + streak_color= base_color_low_streak + streak_color = base_color_medium_streak if @current_streak >= 2 + streak_color = base_color_high_streak if @current_streak >= 4 + + message = _INTL("Streak: {1}",@current_streak) + Kernel.pbClearText() + Kernel.pbDisplayText(message,420,340,nil,streak_color) + 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) + def question_answer_followup_dialog(answered_correctly, correct_answer, points_awarded_if_win, other_chance_later = false) if !other_chance_later pbMessage("And the correct answer was...") pbMessage("...") - pbMessage(_INTL("{1}!",correct_answer)) + pbMessage(_INTL("{1}!", correct_answer)) end if answered_correctly - pbSEPlay("itemlevel",80) + pbSEPlay("itemlevel", 80) + increase_streak pbMessage("That's a correct answer!") - pbMessage(_INTL("You're awarded {1} points for your answer. Your current score is {2}",points_awarded_if_win,@score.to_s)) + pbMessage(_INTL("You're awarded {1} points for your answer. Your current score is {2}", points_awarded_if_win, @score.to_s)) else - pbSEPlay("buzzer",80) - pbMessage("Unfortunately, that was a wong answer.") + pbSEPlay("buzzer", 80) + break_streak + pbMessage("Unfortunately, that was a wrong answer.") pbMessage("But you'll get another chance!") if other_chance_later end end + def current_streak_dialog() + return if @current_streak ==0 + if @current_streak % 4 == 0 + if @current_streak >= 8 + pbMessage(_INTL("That's {1} correct answers in a row. You're on a roll!", @current_streak)) + else + pbMessage(_INTL("That's {1} correct answers in a row. You're doing great!", @current_streak)) + end + end + end - def show_fusion_picture(obscured = false,x=nil, y=nil) + def show_fusion_picture(obscured = false, x = nil, y = nil) hide_fusion_picture() 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 = y ? y : 30 - @previewwindow.x = x ? x : (@difficulty==:ADVANCED ? 275 : 100) + @previewwindow.x = x ? x : (@difficulty == :ADVANCED ? 275 : 100) @previewwindow.z = 100000 if obscured @previewwindow.picture.pbSetColor(255, 255, 255, 200) @@ -169,30 +226,30 @@ class FusionQuiz pbSet(save_in_variable, @selected_pokemon) end - def give_answer(prompt_message,answer_id,should_generate_new_choices) - question_answered=false + 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) + 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) + player_answer = prompt_pick_answer_regular(prompt_message, answer_id, should_generate_new_choices) end - confirmed = pbMessage("Is this your final answer?",["Yes","No"]) - if confirmed==0 - question_answered=true + confirmed = pbMessage("Is this your final answer?", ["Yes", "No"]) + if confirmed == 0 + question_answered = true else - should_generate_new_choices=false + should_generate_new_choices = false end end return player_answer == answer_pokemon_name end - def get_random_pokemon_from_same_egg_group(pokemon,previous_choices) + def get_random_pokemon_from_same_egg_group(pokemon, previous_choices) egg_groups = getPokemonEggGroups(pokemon) while true - new_pokemon = rand(1,NB_POKEMON)+1 + new_pokemon = rand(1, 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 @@ -200,18 +257,18 @@ class FusionQuiz end end - def prompt_pick_answer_regular(prompt_message,real_answer,should_new_choices) + def prompt_pick_answer_regular(prompt_message, real_answer, should_new_choices) commands = should_new_choices ? generate_new_choices(real_answer) : @choices.shuffle - chosen = pbMessage(prompt_message,commands) + chosen = pbMessage(prompt_message, commands) 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) + 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| @@ -222,18 +279,16 @@ class FusionQuiz return commands.shuffle end - - def prompt_pick_answer_advanced(prompt_message,answer) + def prompt_pick_answer_advanced(prompt_message, answer) commands = [] for dex_num in 1..NB_POKEMON species = getPokemon(dex_num) - commands.push([dex_num-1, species.real_name, species.real_name]) + commands.push([dex_num - 1, species.real_name, species.real_name]) end pbMessage(prompt_message) - return pbChooseList(commands, 0, nil, 1) + return pbChooseList(commands, 0, nil, 1) end - def get_score return @score end diff --git a/Data/System.rxdata b/Data/System.rxdata index 2c9eea9ec80a5270faaaa59bcd823736d915e2fe..80b93e6b3b031fbe6965c4ef928c5e47341a01ec 100644 GIT binary patch delta 102 zcmbPzi}Cs`#tk_V?n<)7C5a{RX{E)P`FVk*nN?Ns8JX!Bsl_Eq5*RXhNlMZff+hJS ci8+(YCHAwZFXUv|Y$eGQ$oOruZPq;|07tPX5dZ)H delta 42 ycmcb9i*fcX#tk_V+@4AdY}Q;MN(@R2lQ&E3XGuD*&%C)zk|~h!$L7kcdrSZ<;|@Lm