wip generic triple fusions

This commit is contained in:
infinitefusion
2023-06-11 15:14:53 -04:00
parent 9e77256c2a
commit 341273b206
16 changed files with 24068 additions and 12485 deletions

View File

@@ -47,6 +47,26 @@ def pbAddPokemonID(pokemon_id, level = 1, see_form = true, skip_randomize = fals
return true
end
def addNewTripleFusion(pokemon1,pokemon2,pokemon3,level = 1)
return if !pokemon1
return if !pokemon2
return if !pokemon3
if pbBoxesFull?
pbMessage(_INTL("There's no more room for Pokémon!\1"))
pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!"))
return false
end
pokemon = TripleFusion.new(pokemon1,pokemon2,pokemon3,level)
pbMessage(_INTL("{1} obtained {2}!\\me[Pkmn get]\\wtnp[80]\1", $Trainer.name, pokemon.name))
pbNicknameAndStore(pokemon)
#$Trainer.pokedex.register(pokemon)
return true
end
def pbHasSpecies?(species)
if species.is_a?(String) || species.is_a?(Symbol)
id = getID(PBSpecies, species)

View File

@@ -0,0 +1,64 @@
class TripleFusion < Pokemon
attr_reader :species1
attr_reader :species2
attr_reader :species3
def initialize(species1, species2,species3, level, owner = $Trainer, withMoves = true, recheck_form = true)
@species1=species1
@species2=species2
@species3=species3
@species1_data = GameData::Species.get(@species1)
@species2_data = GameData::Species.get(@species2)
@species3_data = GameData::Species.get(@species3)
@species_name = generate_triple_fusion_name()
super(:ZAPMOLTICUNO,level,owner,withMoves,recheck_form)
end
def baseStats
ret = {}
GameData::Stat.each_main do |s|
stat1 = @species1_data.base_stats[s.id]
stat2 = @species2_data.base_stats[s.id]
stat3 = @species3_data.base_stats[s.id]
ret[s.id] = (stat1 + stat2 + stat3) / 3
end
return ret
end
def name
return (nicknamed?) ? @name : @species_name
end
def generate_triple_fusion_name()
part1 = split_string_with_syllables(@species1_data.name)[0]
part2 = split_string_with_syllables(@species2_data.name)[1]
part3 = split_string_with_syllables(@species3_data.name)[2]
return _INTL("{1}{2}{3}",part1,part2,part3).capitalize!
end
def split_string_with_syllables(name)
syllable_pattern = /[bcdfghjklmnpqrstvwxyz]*[aeiou]+[bcdfghjklmnpqrstvwxyz]*/
syllables = name.downcase.scan(syllable_pattern)
first_syllable= syllables.first
last_syllable = syllables.last
if syllables.length > 1
middle_syllable = syllables[1]
else
middle_syllable = first_syllable.downcase
end
last_syllable.nil? ? first_syllable : last_syllable
return [first_syllable,middle_syllable,last_syllable]
end
end