mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-03-10 18:32:01 +00:00
update 6.7
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# nerf: remove x kg from each generated pokemon
|
||||
|
||||
def generate_weight_contest_entries(species, level, resultsVariable, nerf = 0)
|
||||
# echoln "Generating Pokemon"
|
||||
pokemon1 = pbGenerateWildPokemon(species, level) # Pokemon.new(species,level)
|
||||
pokemon2 = pbGenerateWildPokemon(species, level) # Pokemon.new(species,level)
|
||||
new_weights = []
|
||||
new_weights << calculate_pokemon_weight(pokemon1, nerf)
|
||||
new_weights << calculate_pokemon_weight(pokemon2, nerf)
|
||||
echoln new_weights
|
||||
echoln "(nerfed by -#{nerf})"
|
||||
pbSet(resultsVariable, new_weights.max)
|
||||
|
||||
end
|
||||
@@ -0,0 +1,32 @@
|
||||
def pbRelearnEggMoveScreen(pkmn)
|
||||
retval = true
|
||||
pbFadeOutIn {
|
||||
scene = MoveRelearner_Scene.new
|
||||
screen = MoveRelearnerScreen.new(scene)
|
||||
retval = screen.pbStartScreenEgg(pkmn)
|
||||
}
|
||||
return retval
|
||||
end
|
||||
|
||||
class MoveRelearnerScreen
|
||||
def pbStartScreenEgg(pkmn)
|
||||
baby = pbGetBabySpecies(pkmn.species)
|
||||
moves = pbGetSpeciesEggMoves(baby)
|
||||
|
||||
@scene.pbStartScene(pkmn, moves)
|
||||
loop do
|
||||
move = @scene.pbChooseMove
|
||||
if move
|
||||
if @scene.pbConfirm(_INTL("Teach {1}?", GameData::Move.get(move).name))
|
||||
if pbLearnMove(pkmn, move)
|
||||
@scene.pbEndScene
|
||||
return true
|
||||
end
|
||||
end
|
||||
elsif @scene.pbConfirm(_INTL("Give up trying to teach a new move to {1}?", pkmn.name))
|
||||
@scene.pbEndScene
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,69 @@
|
||||
def fossilsGuyBattle(level = 20, end_message = "")
|
||||
team = getFossilsGuyTeam(level)
|
||||
customTrainerBattle("Miguel",
|
||||
:SUPERNERD,
|
||||
team,
|
||||
level,
|
||||
end_message
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
def getFossilsGuyTeam(level)
|
||||
base_poke_evolution_level = 20
|
||||
fossils_evolution_level_1 = 30
|
||||
fossils_evolution_level_2 = 50
|
||||
|
||||
fossils = []
|
||||
base_poke = level <= base_poke_evolution_level ? :B88H109 : :B89H110
|
||||
team = []
|
||||
team << Pokemon.new(base_poke, level)
|
||||
|
||||
# Mt. Moon fossil
|
||||
if $game_switches[SWITCH_PICKED_HELIC_FOSSIL]
|
||||
fossils << :KABUTO if level < fossils_evolution_level_1
|
||||
fossils << :KABUTOPS if level >= fossils_evolution_level_1
|
||||
elsif $game_switches[SWITCH_PICKED_DOME_FOSSIL]
|
||||
fossils << :OMANYTE if level < fossils_evolution_level_1
|
||||
fossils << :OMASTAR if level >= fossils_evolution_level_1
|
||||
end
|
||||
|
||||
# S.S. Anne fossil
|
||||
if $game_switches[SWITCH_PICKED_LILEEP_FOSSIL]
|
||||
fossils << :ANORITH if level < fossils_evolution_level_1
|
||||
fossils << :ARMALDO if level >= fossils_evolution_level_1
|
||||
|
||||
elsif $game_switches[SWITCH_PICKED_ANORITH_FOSSIL]
|
||||
fossils << :LILEEP if level < fossils_evolution_level_1
|
||||
fossils << :CRADILY if level >= fossils_evolution_level_1
|
||||
end
|
||||
# Celadon fossil
|
||||
if $game_switches[SWITCH_PICKED_ARMOR_FOSSIL]
|
||||
fossils << :CRANIDOS if level < fossils_evolution_level_2
|
||||
fossils << :RAMPARDOS if level >= fossils_evolution_level_2
|
||||
|
||||
elsif $game_switches[SWITCH_PICKED_SKULL_FOSSIL]
|
||||
fossils << :SHIELDON if level < fossils_evolution_level_2
|
||||
fossils << :BASTIODON if level >= fossils_evolution_level_2
|
||||
end
|
||||
|
||||
skip_next = false
|
||||
for index in 0..fossils.length
|
||||
if index == fossils.length - 1
|
||||
team << Pokemon.new(fossils[index], level)
|
||||
else
|
||||
if skip_next
|
||||
skip_next = false
|
||||
next
|
||||
end
|
||||
head_poke = fossils[index]
|
||||
body_poke = fossils[index + 1]
|
||||
if head_poke && body_poke
|
||||
newPoke = getFusionSpecies(dexNum(body_poke), dexNum(head_poke))
|
||||
team << Pokemon.new(newPoke, level)
|
||||
skip_next = true
|
||||
end
|
||||
end
|
||||
end
|
||||
return team
|
||||
end
|
||||
205
Data/Scripts/052_InfiniteFusion/Gameplay/NPCs/FusionMoveTutor.rb
Normal file
205
Data/Scripts/052_InfiniteFusion/Gameplay/NPCs/FusionMoveTutor.rb
Normal file
@@ -0,0 +1,205 @@
|
||||
def pbSpecialTutor(pokemon,legendaries=false)
|
||||
retval = true
|
||||
tutorUtil = FusionTutorService.new(pokemon)
|
||||
pbFadeOutIn {
|
||||
scene = MoveRelearner_Scene.new
|
||||
screen = MoveRelearnerScreen.new(scene)
|
||||
moves = tutorUtil.getCompatibleMoves(legendaries)
|
||||
if !moves.empty?
|
||||
retval = screen.pbStartScreen(pokemon, moves)
|
||||
else
|
||||
return false
|
||||
end
|
||||
}
|
||||
return retval
|
||||
end
|
||||
|
||||
def pbShowRareTutorFullList(includeLegendaries = false)
|
||||
tutorUtil = FusionTutorService.new(nil)
|
||||
tutorUtil.setShowList(true)
|
||||
pbFadeOutIn {
|
||||
scene = MoveRelearner_Scene.new
|
||||
screen = MoveRelearnerScreen.new(scene)
|
||||
moves = tutorUtil.getCompatibleMoves(includeLegendaries)
|
||||
screen.pbStartScreen(nil, moves)
|
||||
}
|
||||
return false
|
||||
end
|
||||
|
||||
def pbCheckRareTutorCompatibleMoves(pokemon, includeLeshgendaries)
|
||||
tutorUtil = FusionTutorService.new(pokemon)
|
||||
return tutorUtil.has_compatible_move(includeLeshgendaries)
|
||||
end
|
||||
|
||||
def showRandomRareMoveConditionExample(legendary = false)
|
||||
example = legendary ? getlegendaryConditionExample : getRegularConditionExample
|
||||
text = "For example, " + example
|
||||
pbMessage(text)
|
||||
end
|
||||
|
||||
def getRegularConditionExample()
|
||||
list = [
|
||||
_INTL("a Sandslash fusion which has the electric type will be able to learn the move Zing Zap."),
|
||||
_INTL("any Pokémon that is both Flying and Fighting type will be able to learn the move Flying Press."),
|
||||
_INTL("the move Shadow Bone can only be learned by ghost-type Marowak fusions."),
|
||||
_INTL("any Pokémon that is both Ghost and Grass type will be able to learn the move Trick or Treat."),
|
||||
_INTL("the move Forest's Curse can only be learned by Ghost/Grass typed Pokémon."),
|
||||
_INTL("a grass-type fusion of a spiky Pokémon such as Jolteon will be able to learn the move Spiky Shield."),
|
||||
_INTL("only a ground-type fusion of Grimer or Muk will be able to learn the move Shore Up."),
|
||||
_INTL("any ice-type fusion that can already learn the move Crabhammer will also be able to learn the move Ice Hammer."),
|
||||
_INTL("only water-type fusions of a ninja-like Pokémon such as Ninjask or Zoroark will be able to learn the move Water Shuriken."),
|
||||
]
|
||||
return list.sample
|
||||
end
|
||||
|
||||
def getlegendaryConditionExample()
|
||||
list = [
|
||||
_INTL("any Rotom fusion that can already learn the move Thunder Punch can also be taught the move Plasma Fists."),
|
||||
_INTL("only an Electric-type fusion of a legendary Ice-type Pokémon will be able to learn the move Freeze Shock."),
|
||||
_INTL("only a Fire-type fusion of a legendary Ice-type Pokémon will be able to learn the move Ice Burn."),
|
||||
_INTL("any Pokémon that is both Flying and Dark type will be able to learn the move Oblivion Wing."),
|
||||
_INTL("a ground-type fusion of a spiky Pokémon such as Ferrothorn will be able to learn the move Thousand Arrows."),
|
||||
_INTL("any steel-type Pokémon that can already learn the move Double Slap will be able to learn Double Iron Bash."),
|
||||
_INTL("any Pokémon that is both Fairy and Rock type will be able to learn the move Diamond Storm."),
|
||||
_INTL("any water-type Pokémon that can already learn the move Eruption can also be taught the move Steam Eruption"),
|
||||
]
|
||||
return list.sample
|
||||
end
|
||||
|
||||
class FusionTutorService
|
||||
|
||||
def has_compatible_move(include_legendaries = false)
|
||||
return !getCompatibleMoves(include_legendaries).empty?
|
||||
end
|
||||
|
||||
def initialize(pokemon)
|
||||
@pokemon = pokemon
|
||||
@show_full_list = false
|
||||
end
|
||||
|
||||
def setShowList(value)
|
||||
@show_full_list = value
|
||||
end
|
||||
|
||||
#todo: these moves
|
||||
# DRAGONHAMMER
|
||||
# FIRELASH
|
||||
# BEAKBLAST
|
||||
# CHATTER
|
||||
# LEAFAGE
|
||||
# HEADCHARGE
|
||||
# HYPERSPACEHOLE
|
||||
# HOLDBACK
|
||||
# CELEBRATE
|
||||
# HEARTSWAP
|
||||
|
||||
def getCompatibleMoves(includeLegendaries = false)
|
||||
compatibleMoves = []
|
||||
#normal moves
|
||||
if !includeLegendaries
|
||||
compatibleMoves << :ATTACKORDER if is_fusion_of([:BEEDRILL])
|
||||
# compatibleMoves << :FIRSTIMPRESSION if is_fusion_of([:SCYTHER, :SCIZOR, :PINSIR, :FARFETCHD, :TRAPINCH, :VIBRAVA, :FLYGON, :KABUTOPS, :ARMALDO])
|
||||
compatibleMoves << :POLLENPUFF if is_fusion_of([:BUTTERFREE, :CELEBI, :VILEPLUME, :PARASECT, :BRELOOM])
|
||||
compatibleMoves << :LUNGE if is_fusion_of([:SPINARAK, :ARIADOS, :JOLTIK, :GALVANTULA, :VENOMOTH, :VOLCARONA, :PINSIR, :PARASECT, :LEDIAN, :DODUO, :DODRIO, :STANTLER])
|
||||
compatibleMoves << :DEFENDORDER if is_fusion_of([:BEEDRILL])
|
||||
compatibleMoves << :HEALORDER if is_fusion_of([:BEEDRILL])
|
||||
compatibleMoves << :POWDER if is_fusion_of([:BUTTERFREE, :VENOMOTH, :VOLCARONA, :PARASECT, :BRELOOM])
|
||||
compatibleMoves << :TAILGLOW if is_fusion_of([:MAREEP, :FLAAFFY, :AMPHAROS, :LANTURN, :ZEKROM, :RESHIRAM])
|
||||
compatibleMoves << :DARKESTLARIAT if is_fusion_of([:SNORLAX, :REGIGIGAS, :POLIWRATH, :MACHAMP, :ELECTIVIRE, :DUSKNOIR, :SWAMPERT, :KROOKODILE, :GOLURK])
|
||||
compatibleMoves << :PARTINGSHOT if is_fusion_of([:MEOWTH, :PERSIAN, :SANDILE, :KROKOROK, :KROOKODILE, :UMBREON])
|
||||
compatibleMoves << :TOPSYTURVY if is_fusion_of([:HITMONTOP, :WOBBUFFET])
|
||||
# compatibleMoves << :CLANGINGSCALES if is_fusion_of([:EKANS, :ARBOK, :GARCHOMP, :FLYGON, :HAXORUS])
|
||||
compatibleMoves << :ZINGZAP if is_fusion_of([:PICHU, :PIKACHU, :RAICHU, :VOLTORB, :ELECTRODE]) || (is_fusion_of([:SANDSLASH, :GOLEM]) && hasType(:ELECTRIC))
|
||||
compatibleMoves << :PARABOLICCHARGE if is_fusion_of([:PICHU, :PIKACHU, :RAICHU, :MAGNEMITE, :MAGNETON, :MAGNEZONE, :MAREEP, :FLAAFFY, :AMPHAROS, :ELEKID, :ELECTABUZZ, :ELECTIVIRE, :ZAPDOS, :CHINCHOU, :LANTURN, :RAIKOU, :KLINK, :KLANG, :KLINKLANG, :ROTOM, :STUNFISK])
|
||||
compatibleMoves << :ELECTRIFY if is_fusion_of([:KLINK, :KLANG, :KLINKLANG]) || hasType(:ELECTRIC)
|
||||
compatibleMoves << :AROMATICMIST if is_fusion_of([:WEEZING, :BULBASAUR, :IVYSAUR, :VENUSAUR, :CHIKORITA, :BAYLEEF, :MEGANIUM, :GLOOM, :VILEPLUME, :BELLOSSOM, :ROSELIA, :ROSERADE])
|
||||
compatibleMoves << :FLORALHEALING if is_fusion_of([:SUNFLORA, :BELLOSSOM, :ROSELIA, :ROSERADE])
|
||||
#compatibleMoves << :FLYINGPRESS if is_fusion_of([:TORCHIC, :COMBUSKEN, :BLAZIKEN, :FARFETCHD, :HERACROSS]) || (hasType(:FLYING) && hasType(:FIGHTING))
|
||||
compatibleMoves << :MATBLOCK if is_fusion_of([:MACHOP, :MACHOKE, :MACHAMP, :TYROGUE, :HITMONLEE, :HITMONCHAN, :HITMONTOP])
|
||||
compatibleMoves << :MINDBLOWN if is_fusion_of([:VOLTORB, :ELECTRODE, :EXEGGUTOR])
|
||||
compatibleMoves << :SHELLTRAP if is_fusion_of([:MAGCARGO, :FORRETRESS])
|
||||
compatibleMoves << :HEATCRASH if is_fusion_of([:BLAZIKEN, :RESHIRAM, :GROUDON, :CHARIZARD, :GOLURK, :REGIGIGAS, :RHYDON, :RHYPERIOR, :SNORLAX])
|
||||
compatibleMoves << :SHADOWBONE if is_fusion_of([:MAROWAK]) && hasType(:GHOST)
|
||||
compatibleMoves << :SPIRITSHACKLE if is_fusion_of([:BANETTE, :SPIRITOMB, :DUSKNOIR, :SHEDINJA, :COFAGRIGUS])
|
||||
compatibleMoves << :TRICKORTREAT if (hasType(:GRASS) && hasType(:GHOST)) || is_fusion_of([:GASTLY, :HAUNTER, :GENGAR, :MIMIKYU, :ZORUA, :ZOROARK])
|
||||
compatibleMoves << :TROPKICK if is_fusion_of([:HITMONLEE, :HITMONTOP, :ROSERADE]) || (hasType(:GRASS) && hasType(:FIGHTING))
|
||||
#compatibleMoves << :NEEDLEARM if is_fusion_of([:FERROTHORN])
|
||||
#compatibleMoves << :FORESTSCURSE if (hasType(:GRASS) && hasType(:GHOST))
|
||||
#compatibleMoves << :SPIKYSHIELD if is_fusion_of([:FERROSEED, :FERROTHORN]) || (is_fusion_of([:SANDSLASH, :JOLTEON, :CLOYSTER]) && hasType(:GRASS))
|
||||
compatibleMoves << :STRENGTHSAP if is_fusion_of([:ODDISH, :GLOOM, :VILEPLUME, :BELLOSSOM, :HOPPIP, :SKIPLOOM, :JUMPLUFF, :BELLSPROUT, :WEEPINBELL, :VICTREEBEL, :PARAS, :PARASECT, :DRIFBLIM, :BRELOOM])
|
||||
#compatibleMoves << :SHOREUP if is_fusion_of([:GRIMER, :MUK]) && hasType(:GROUND)
|
||||
compatibleMoves << :ICEHAMMER if (canLearnMove(:CRABHAMMER) || canLearnMove(:GRASSHAMMER) || canLearnMove(:HAMMERARM)) && hasType(:ICE)
|
||||
compatibleMoves << :MULTIATTACK if is_fusion_of([:ARCEUS, :MEW, :GENESECT])
|
||||
# compatibleMoves << :REVELATIONDANCE if is_fusion_of([:KECLEON, :BELLOSSOM, :CLEFAIRY, :CLEFABLE, :CLEFFA])
|
||||
#compatibleMoves << :BANEFULBUNKER if is_fusion_of([:TENTACOOL, :TENTACRUEL, :NIDORINA, :NIDORINO, :NIDOQUEEN, :NIDOKING, :GRIMER, :MUK, :QWILFISH])
|
||||
compatibleMoves << :INSTRUCT if is_fusion_of([:CHIMCHAR, :MONFERNO, :INFERNAPE, :KADABRA, :ALAKAZAM, :SLOWKING])
|
||||
compatibleMoves << :PSYCHICTERRAIN if hasType(:PSYCHIC)
|
||||
#compatibleMoves << :GRASSYTERRAIN if hasType(:GRASS)
|
||||
compatibleMoves << :MISTYTERRAIN if hasType(:FAIRY)
|
||||
compatibleMoves << :SPEEDSWAP if is_fusion_of([:PIKACHU, :RAICHU, :ABRA, :KADABRA, :ALAKAZAM, :PORYGON, :PORYGON2, :PORYGONZ, :MEWTWO, :MEW, :JOLTIK, :GALVANTULA])
|
||||
#compatibleMoves << :ACCELEROCK if is_fusion_of([:AERODACTYL, :KABUTOPS, :ANORITH, :ARMALDO])
|
||||
#compatibleMoves << :ANCHORSHOT if (is_fusion_of([:EMPOLEON, :STEELIX, :BELDUM, :METANG, :METAGROSS, :KLINK, :KLINKLANG, :KLANG, :ARON, :LAIRON, :AGGRON]) && hasType(:WATER)) || (is_fusion_of([:LAPRAS, :WAILORD, :KYOGRE]) && hasType(:STEEL))
|
||||
compatibleMoves << :SPARKLINGARIA if (is_fusion_of([:JYNX, :JIGGLYPUFF, :WIGGLYTUFF]) && hasType(:WATER)) || is_fusion_of([:LAPRAS])
|
||||
#compatibleMoves << :WATERSHURIKEN if is_fusion_of([:NINJASK, :LUCARIO, :ZOROARK, :BISHARP]) && hasType(:WATER)
|
||||
end
|
||||
if includeLegendaries
|
||||
#legendary moves (only available after a certain trigger, maybe a different npc)
|
||||
compatibleMoves << :HYPERSPACEFURY if is_fusion_of([:GIRATINA, :PALKIA, :DIALGA, :ARCEUS])
|
||||
compatibleMoves << :COREENFORCER if is_fusion_of([:GIRATINA, :PALKIA, :DIALGA, :RAYQUAZA])
|
||||
compatibleMoves << :PLASMAFISTS if is_fusion_of([:ELECTABUZZ, :ELECTIVIRE, :ZEKROM]) || (is_fusion_of([:ROTOM]) && canLearnMove(:THUNDERPUNCH))
|
||||
compatibleMoves << :LIGHTOFRUIN if is_fusion_of([:ARCEUS, :MEW, :CELEBI, :JIRACHI])
|
||||
compatibleMoves << :FLEURCANNON if is_fusion_of([:GARDEVOIR, :GALLADE, :SYLVEON, :WIGGLYTUFF])
|
||||
compatibleMoves << :NATURESMADNESS if is_fusion_of([:CELEBI, :KYOGRE, :GROUDON, :ABSOL])
|
||||
compatibleMoves << :GEOMANCY if is_fusion_of([:CELEBI])
|
||||
compatibleMoves << :VCREATE if is_fusion_of([:ENTEI, :HOOH, :TYPHLOSION])
|
||||
compatibleMoves << :MAGMASTORM if is_fusion_of([:MAGCARGO, :TYPHLOSION, :MAGMORTAR, :MAGMAR, :ENTEI, :GROUDON]) || canLearnMove(:ERUPTION)
|
||||
compatibleMoves << :SEARINGSHOT if is_fusion_of([:MAGMORTAR])
|
||||
compatibleMoves << :OBLIVIONWING if is_fusion_of([:MURKROW, :HONCHKROW]) || (hasType(:DARK) && hasType(:FLYING))
|
||||
compatibleMoves << :MOONGEISTBEAM if (is_fusion_of([:CLEFFA, :CLEFAIRY, :CLEFABLE]) && hasType(:DARK)) || is_fusion_of([:DARKRAI, :MISDREAVUS, :MISMAGIUS])
|
||||
compatibleMoves << :SPECTRALTHIEF if is_fusion_of([:HAUNTER, :GENGAR, :BANETTE, :GIRATINA, :HONEDGE, :DOUBLADE, :AEGISLASH])
|
||||
compatibleMoves << :SEEDFLARE if is_fusion_of([:JUMPLUFF, :SUNFLORA])
|
||||
compatibleMoves << :LANDSWRATH if is_fusion_of([:GROUDON])
|
||||
compatibleMoves << :THOUSANDARROWS if is_fusion_of([:SANDSLASH, :JOLTEON, :FERROTHORN]) && hasType(:GROUND)
|
||||
compatibleMoves << :THOUSANDWAVES if is_fusion_of([:STUNFISK, :QUAGSIRE, :SWAMPERT])
|
||||
compatibleMoves << :FREEZESHOCK if is_fusion_of([:KYUREM, :ARTICUNO]) && hasType(:ELECTRIC)
|
||||
compatibleMoves << :ICEBURN if is_fusion_of([:KYUREM, :ARTICUNO]) && hasType(:FIRE)
|
||||
#compatibleMoves << :RELICSONG if is_fusion_of([:JYNX, :LAPRAS, :JIGGLYPUFF, :WIGGLYTUFF, :MISDREAVUS, :MISMAGIUS])
|
||||
compatibleMoves << :HAPPYHOUR if is_fusion_of([:MEOWTH, :JIRACHI, :DELIBIRD, :MUNCHLAX, :SNORLAX, :PIKACHU, :RAICHU])
|
||||
compatibleMoves << :HOLDHANDS if is_fusion_of([:CHARMANDER, :BULBASAUR, :SQUIRTLE, :PIKACHU, :TOGEPI])
|
||||
#compatibleMoves << :PRISMATICLASER if is_fusion_of([:LANTURN, :AMPHAROS, :HOOH, :DEOXYS, :MEWTWO, :MEW]) && hasType(:PSYCHIC)
|
||||
#compatibleMoves << :PHOTONGEYSER if is_fusion_of([:LANTURN, :AMPHAROS, :HOOH, :MEW, :MEWTWO, :DEOXYS]) && hasType(:PSYCHIC)
|
||||
# compatibleMoves << :LUNARDANCE if is_fusion_of([:CLEFAIRY, :CLEFABLE, :STARYU, :STARMIE])
|
||||
#compatibleMoves << :DIAMONDSTORM if ((hasType(:FAIRY) && hasType(:ROCK)) || (hasType(:ROCK) && hasType(:STEEL))) || is_fusion_of([:DIALGA, :STEELIX])
|
||||
compatibleMoves << :SUNSTEELSTRIKE if is_fusion_of([:CHARIZARD, :VOLCARONA, :FLAREON, :NINETALES, :ENTEI, :HOOH, :RAPIDASH]) && hasType(:STEEL)
|
||||
compatibleMoves << :DOUBLEIRONBASH if canLearnMove(:DOUBLESLAP) && hasType(:STEEL)
|
||||
compatibleMoves << :STEAMERUPTION if canLearnMove(:ERUPTION) && hasType(:WATER)
|
||||
compatibleMoves << :SECRETSWORD if is_fusion_of([:HONEDGE, :DOUBLADE, :AEGISLASH, :GALLADE, :FARFETCHD, :ABSOL, :BISHARP])
|
||||
end
|
||||
return compatibleMoves
|
||||
end
|
||||
|
||||
def is_fusion_of(pokemonList)
|
||||
return true if @show_full_list
|
||||
is_species = false
|
||||
for fusionPokemon in pokemonList
|
||||
if @pokemon.isFusionOf(fusionPokemon)
|
||||
is_species = true
|
||||
end
|
||||
end
|
||||
return is_species
|
||||
end
|
||||
|
||||
def hasType(type)
|
||||
return true if @show_full_list
|
||||
return @pokemon.hasType?(type)
|
||||
end
|
||||
|
||||
def canLearnMove(move)
|
||||
return true if @show_full_list
|
||||
return @pokemon.compatible_with_move?(move)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,335 @@
|
||||
class FusionQuiz
|
||||
|
||||
#
|
||||
# Possible difficulties:
|
||||
#
|
||||
# :REGULAR -> 4 options choice
|
||||
#
|
||||
# :ADVANCED -> List of all pokemon
|
||||
#
|
||||
def initialize(difficulty = :REGULAR)
|
||||
@sprites = {}
|
||||
|
||||
|
||||
@previewwindow = nil
|
||||
@difficulty = difficulty
|
||||
@customs_list = getCustomSpeciesList(true, false)
|
||||
@selected_pokemon = nil
|
||||
@head_id = nil
|
||||
@body_id = nil
|
||||
@body_choices = []
|
||||
@head_choices = []
|
||||
@abandonned = false
|
||||
@score = 0
|
||||
@current_streak = 0
|
||||
@streak_multiplier = 0.15
|
||||
end
|
||||
|
||||
|
||||
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
|
||||
pbMessage(_INTL("Get ready! Here comes the first round!"))
|
||||
else
|
||||
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"])
|
||||
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"])
|
||||
if prompt_quit
|
||||
@abandonned = true
|
||||
break
|
||||
end
|
||||
end
|
||||
round_multiplier += round_multiplier_increase
|
||||
else
|
||||
pbMessage(_INTL("This concludes our quiz! You've cumulated {1} points in total.", @score))
|
||||
pbMessage(_INTL("Thanks for playing with us today!"))
|
||||
end
|
||||
end
|
||||
end_quiz()
|
||||
end
|
||||
|
||||
def end_quiz()
|
||||
hide_fusion_picture
|
||||
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)
|
||||
dispose
|
||||
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 = []
|
||||
|
||||
#OBSCURED
|
||||
correct_answers << new_question(calculate_points_awarded(base_points_q1, round_multiplier), _INTL("Which Pokémon is this fusion's body?"), @body_id, nil, true, :BODY)
|
||||
pbMessage(_INTL("Next question!"))
|
||||
correct_answers << new_question(calculate_points_awarded(base_points_q2, round_multiplier), _INTL("Which Pokémon is this fusion's head?"), @head_id, nil, true, :HEAD)
|
||||
|
||||
#NON-OBSCURED
|
||||
if !correct_answers[0] || !correct_answers[1]
|
||||
show_fusion_picture(false)
|
||||
pbMessage(_INTL("Okay, now's your chance to make up for the points you missed!"))
|
||||
if !correct_answers[0] #1st question redemption
|
||||
new_question(calculate_points_awarded(base_points_q1_redemption, round_multiplier), "Which Pokémon is this fusion's body?", @body_id, @body_choices, false, :BODY)
|
||||
if !correct_answers[1]
|
||||
pbMessage(_INTL("Next question!"))
|
||||
end
|
||||
end
|
||||
|
||||
if !correct_answers[1] #2nd question redemption
|
||||
new_question(calculate_points_awarded(base_points_q2_redemption, round_multiplier), "Which Pokémon is this fusion's head?", @head_id, @head_choices, false, :HEAD)
|
||||
end
|
||||
else
|
||||
pbSEPlay("Applause", 80)
|
||||
pbMessage(_INTL("Wow! A perfect round! You get {1} more points!", perfect_round_points))
|
||||
show_fusion_picture(false, 100)
|
||||
pbMessage(_INTL("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, choices, other_chance_later,question_type)
|
||||
points_value = points_value.to_i
|
||||
answer_name = getPokemon(answer_id).real_name
|
||||
answered_correctly = give_answer(question, answer_id, choices,question_type)
|
||||
award_points(points_value) if answered_correctly
|
||||
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)
|
||||
if !other_chance_later
|
||||
pbMessage(_INTL("And the correct answer was..."))
|
||||
pbMessage("...")
|
||||
pbMessage("#{correct_answer}!")
|
||||
end
|
||||
|
||||
if answered_correctly
|
||||
pbSEPlay("itemlevel", 80)
|
||||
increase_streak
|
||||
pbMessage(_INTL("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))
|
||||
else
|
||||
pbSEPlay("buzzer", 80)
|
||||
break_streak
|
||||
pbMessage(_INTL("Unfortunately, that was a wrong answer."))
|
||||
pbMessage(_INTL("But you'll get another chance at it!")) if other_chance_later
|
||||
end
|
||||
end
|
||||
|
||||
def current_streak_dialog()
|
||||
return if @current_streak ==0
|
||||
streak_base_worth= @difficulty == :REGULAR ? 25 : 100
|
||||
if @current_streak % 4 == 0
|
||||
extra_points = (@current_streak/4)*streak_base_worth
|
||||
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
|
||||
pbMessage(_INTL("Here's {1} extra points for maintaining a streak!",extra_points))
|
||||
award_points(extra_points)
|
||||
end
|
||||
end
|
||||
|
||||
def show_fusion_picture(obscured = false, x = nil, y = nil)
|
||||
hide_fusion_picture()
|
||||
spriteLoader = BattleSpriteLoader.new
|
||||
bitmap = spriteLoader.load_fusion_sprite(@head_id, @body_id)
|
||||
bitmap.scale_bitmap(Settings::FRONTSPRITE_SCALE)
|
||||
@previewwindow = PictureWindow.new(bitmap)
|
||||
@previewwindow.y = y ? y : 30
|
||||
@previewwindow.x = x ? x : (@difficulty == :ADVANCED ? 275 : 100)
|
||||
@previewwindow.z = 100000
|
||||
if obscured
|
||||
@previewwindow.picture.pbSetColor(255, 255, 255, 200)
|
||||
end
|
||||
end
|
||||
|
||||
def hide_fusion_picture()
|
||||
@previewwindow.dispose if @previewwindow
|
||||
end
|
||||
|
||||
def pick_random_pokemon(save_in_variable = 1)
|
||||
random_pokemon = getRandomCustomFusion(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, choices,question_type=:BODY)
|
||||
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, choices,question_type)
|
||||
end
|
||||
confirmed = pbMessage(_INTL("Is this your final answer?"), [_INTL("Yes"), _INTL("No")])
|
||||
if confirmed == 0
|
||||
question_answered = true
|
||||
else
|
||||
should_generate_new_choices = false
|
||||
end
|
||||
end
|
||||
return player_answer == answer_pokemon_name
|
||||
end
|
||||
|
||||
def get_random_pokemon_from_same_egg_group(pokemon, amount_required)
|
||||
pokemon = ::GameData::Species.get(pokemon)
|
||||
egg_groups = getPokemonEggGroups(pokemon)
|
||||
|
||||
# Get a list all pokemon in the same egg group
|
||||
matching_egg_group = []
|
||||
for num in 1..NB_POKEMON
|
||||
next if pokemon.id_number == num
|
||||
next if matching_egg_group.include?(num)
|
||||
new_pokemon = ::GameData::Species.get(num)
|
||||
new_pokemon_egg_groups = getPokemonEggGroups(new_pokemon)
|
||||
matching_egg_group << num if (egg_groups & new_pokemon_egg_groups).any?
|
||||
end
|
||||
|
||||
# Select random pokemon from the list
|
||||
matching_egg_group.shuffle!
|
||||
choices = []
|
||||
for index in 1..amount_required
|
||||
if matching_egg_group[index].nil?
|
||||
# If there's not enough pokemon in the list (e.g. for Ditto), get anything
|
||||
new_pokemon = rand(1..NB_POKEMON) until !choices.include?(new_pokemon) && new_pokemon != pokemon.id_number
|
||||
choices << new_pokemon
|
||||
else
|
||||
choices << matching_egg_group[index]
|
||||
end
|
||||
end
|
||||
|
||||
return choices
|
||||
end
|
||||
|
||||
def prompt_pick_answer_regular(prompt_message, real_answer, choices, question_type=:BODY)
|
||||
if choices && choices.is_a?(Array)
|
||||
commands = choices.shuffle
|
||||
else
|
||||
commands = generate_new_choices(real_answer,question_type)
|
||||
end
|
||||
chosen = pbMessage(prompt_message, commands)
|
||||
return commands[chosen]
|
||||
end
|
||||
|
||||
def generate_new_choices(real_answer,question_type=:BODY)
|
||||
choices = []
|
||||
choices << real_answer
|
||||
choices.push(*get_random_pokemon_from_same_egg_group(real_answer, 3))
|
||||
|
||||
commands = []
|
||||
choices.each do |dex_num, i|
|
||||
species = getPokemon(dex_num)
|
||||
commands.push(species.real_name)
|
||||
end
|
||||
if question_type == :BODY
|
||||
@body_choices = commands
|
||||
else
|
||||
@head_choices = commands
|
||||
end
|
||||
return commands.shuffle
|
||||
end
|
||||
|
||||
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])
|
||||
end
|
||||
pbMessage(prompt_message)
|
||||
return pbChooseList(commands, 0, nil, 1)
|
||||
end
|
||||
|
||||
def get_score
|
||||
return @score
|
||||
end
|
||||
|
||||
def player_abandonned
|
||||
return @abandonned
|
||||
end
|
||||
|
||||
def dispose
|
||||
@previewwindow.dispose
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user