battle tower stuff

This commit is contained in:
infinitefusion
2023-03-04 15:54:45 -05:00
parent 64cd9bc9fa
commit c29e428f90
49 changed files with 69 additions and 21 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Data/Map786.rxdata Normal file

Binary file not shown.

BIN
Data/Map787.rxdata Normal file

Binary file not shown.

BIN
Data/Map789.rxdata Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -59,6 +59,10 @@ module GameData
return self::DATA[key] return self::DATA[key]
end end
def list_all
return self::DATA
end
# @param tr_type [Symbol, String] # @param tr_type [Symbol, String]
# @param tr_name [String] # @param tr_name [String]
# @param tr_version [Integer, nil] # @param tr_version [Integer, nil]

View File

@@ -32,6 +32,11 @@ class Pokemon
return new(trainer.id, trainer.name, trainer.gender, trainer.language) return new(trainer.id, trainer.name, trainer.gender, trainer.language)
end end
def self.new_from_trainer_data(trainer)
validate trainer => [GameData::Trainer]
return new(trainer.id, trainer.name, 2, 2)
end
# Returns an Owner object with a foreign ID. # Returns an Owner object with a foreign ID.
# @param name [String] owner name # @param name [String] owner name
# @param gender [Integer] owner gender # @param gender [Integer] owner gender

View File

@@ -25,16 +25,20 @@ def pbGetBTTrainers(challengeID)
return [] return []
end end
def pbGetBTPokemon(challenge_id) def listAllPokemon
customsOnly = !$game_switches[SWITCH_BATTLE_FACTORY_INCLUDE_ALL]
if customsOnly
return getCustomSpeciesList()
end
list=[] list=[]
for i in 0..PBSpecies.maxValue for i in 0..PBSpecies.maxValue
list << i list << i
end end
return list return list
end
def pbGetBTPokemon(challenge_id)
customsOnly = !$game_switches[SWITCH_BATTLE_FACTORY_INCLUDE_ALL]
if customsOnly
return getCustomSpeciesList()
end
return listAllPokemon
@@ -106,12 +110,12 @@ def pbBattleChallengeGraphic(event)
bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge) bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge)
filename = GameData::TrainerType.charset_filename_brief((bttrainers[nextTrainer][0] rescue nil)) filename = GameData::TrainerType.charset_filename_brief((bttrainers[nextTrainer][0] rescue nil))
begin begin
filename = "NPC 01" if nil_or_empty?(filename) filename = "NPCpbAddForeignPokemon 01" if nil_or_empty?(filename)
bitmap = AnimatedBitmap.new("Graphics/Characters/" + filename) bitmap = AnimatedBitmap.new("Graphics/Characters/" + filename)
bitmap.dispose bitmap.dispose
event.character_name = filename event.character_name = filename
rescue rescue
event.character_name = "NPC 01" event.character_name = "BWClerk"
end end
end end

View File

@@ -61,20 +61,22 @@ def pbGenerateBattleTrainer(idxTrainer, rules)
if pokemonnumbers.length <= rules.ruleset.suggestedNumber if pokemonnumbers.length <= rules.ruleset.suggestedNumber
for n in pokemonnumbers for n in pokemonnumbers
rndpoke = btpokemon[n] rndpoke = btpokemon[n]
pkmn = rndpoke.createPokemon(level, indvalues, opponent) pkmn = rndpoke.createPokemon(rndpoke,level, indvalues, opponent)
opponent.party.push(pkmn) opponent.party.push(pkmn)
end end
return opponent return opponent
end end
# There are more possible Pokémon than there are spaces available in the # There are more possible Pokémon than there are spaces available in the
# trainer's party; randomly choose Pokémon # trainer's party; randomly choose Pokémon
#
minBst = pbGet(VAR_BATTLE_TOWER_MIN_BST)
maxBst = pbGet(VAR_BATTLE_TOWER_MAX_BST)
loop do loop do
opponent.party.clear opponent.party.clear
while opponent.party.length < rules.ruleset.suggestedNumber while opponent.party.length < rules.ruleset.suggestedNumber
rnd = pokemonnumbers[rand(pokemonnumbers.length)] rndpoke = getRandomPokemonSpecies(btpokemon,minBst,maxBst)
rndpoke = btpokemon[rnd]
pkmn = rndpoke.createPokemon(level, indvalues, opponent) opponent.party.push(createPokemon(rndpoke,level, indvalues, nil))
opponent.party.push(pkmn)
end end
break if rules.ruleset.isValid?(opponent.party) break if rules.ruleset.isValid?(opponent.party)
end end
@@ -170,3 +172,17 @@ def createPokemon(species, level, iv, trainer)
pkmn.calc_stats pkmn.calc_stats
return pkmn return pkmn
end end
#list is a list of dex numbers of possible choices
def getRandomPokemonSpecies(list=[],minBST=0,maxBST=1000)
if list == []
list = listAllPokemon
end
bst=-1
while (bst < minBST || bst > maxBST)
chosenPokemon = list.sample
bst = calcBaseStatsSum(chosenPokemon)
end
return chosenPokemon
end

View File

@@ -9,9 +9,14 @@ class StandardRestriction
return true if [:TRUANT, :SLOWSTART].include?(a) return true if [:TRUANT, :SLOWSTART].include?(a)
end end
# Certain named species are not banned # Certain named species are not banned
return true if [:DRAGONITE, :SALAMENCE, :TYRANITAR].include?(pkmn.species) return true if pkmn.isFusionOf(:DRAGONITE)
return true if pkmn.isFusionOf(:SALAMENCE)
return true if pkmn.isFusionOf(:TYRANITAR)
# Certain named species are banned # Certain named species are banned
return false if [:WYNAUT, :WOBBUFFET].include?(pkmn.species) return false if pkmn.isFusionOf(:WYNAUT)
return false if pkmn.isFusionOf(:WOBBUFFET)
# Species with total base stat 600 or more are banned # Species with total base stat 600 or more are banned
bst = 0 bst = 0
pkmn.baseStats.each_value { |s| bst += s } pkmn.baseStats.each_value { |s| bst += s }

View File

@@ -1006,7 +1006,7 @@ PokemonDebugMenuCommands.register("ownership", {
when 0 # Make player's when 0 # Make player's
pkmn.owner = Pokemon::Owner.new_from_trainer($Trainer) pkmn.owner = Pokemon::Owner.new_from_trainer($Trainer)
when 1 # Set OT's name when 1 # Set OT's name
pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, Settings::MAX_PLAYER_NAME_SIZE) pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, Settings::MAX_PLAYER_NAME_SIZE+10)
when 2 # Set OT's gender when 2 # Set OT's gender
cmd2 = screen.pbShowCommands(_INTL("Set OT's gender."), cmd2 = screen.pbShowCommands(_INTL("Set OT's gender."),
[_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender) [_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender)

View File

@@ -430,7 +430,6 @@ def getCustomSpeciesList(allowOnline=true)
if speciesList.length <= 200 && allowOnline if speciesList.length <= 200 && allowOnline
#try to get list from github #try to get list from github
print "let's try it online bruh"
online_list = list_online_custom_sprites online_list = list_online_custom_sprites
return nil if !online_list return nil if !online_list
species_id_list = [] species_id_list = []

View File

@@ -119,6 +119,10 @@ VAR_SHINY_HUE_OFFSET=275
VAR_CURRENT_HIDDEN_MAP = 226 VAR_CURRENT_HIDDEN_MAP = 226
VAR_FUSE_COUNTER = 126 VAR_FUSE_COUNTER = 126
VAR_BATTLE_TOWER_MIN_BST = 257
VAR_BATTLE_TOWER_MAX_BST = 258
#Randomizer #Randomizer
VAR_RANDOMIZER_WILD_POKE_BST=197 VAR_RANDOMIZER_WILD_POKE_BST=197
VAR_RANDOMIZER_TRAINER_BST=195 VAR_RANDOMIZER_TRAINER_BST=195

View File

@@ -96,7 +96,7 @@ def get_random_battle_lounge_egg_group
end end
GENERIC_PRIZES_MULTI = [:HEARTSCALE, :HEARTSCALE,:HEARTSCALE,:HEARTSCALE,:HEARTSCALE, GENERIC_PRIZES_MULTI = [:HEARTSCALE, :HEARTSCALE,:HEARTSCALE,:HEARTSCALE,:HEARTSCALE,
:LEMONADE, :PERFECTBALL, :BOOSTBALL, :LEMONADE, :PERFECTBALL, :TRADEBALL,
:GENDERBALL, :ABILITYBALL, :VIRUSBALL, :SHINYBALL, :RARECANDY] :GENDERBALL, :ABILITYBALL, :VIRUSBALL, :SHINYBALL, :RARECANDY]
GENERIC_PRIZES_SINGLE = [:RARECANDY, :RARECANDY, :PPUP, :EJECTBUTTON, :FOCUSBAND, :FOCUSSASH, GENERIC_PRIZES_SINGLE = [:RARECANDY, :RARECANDY, :PPUP, :EJECTBUTTON, :FOCUSBAND, :FOCUSSASH,
:RESETURGE, :ABILITYURGE, :ITEMURGE, :ITEMDROP, :HPUP, :INCUBATOR, :LUCKYEGG] :RESETURGE, :ABILITYURGE, :ITEMURGE, :ITEMDROP, :HPUP, :INCUBATOR, :LUCKYEGG]

View File

@@ -53,8 +53,11 @@ end
# repo = "Aegide/custom-fusion-sprites" # repo = "Aegide/custom-fusion-sprites"
# folder = "CustomBattlers" # folder = "CustomBattlers"
def list_online_custom_sprites def list_online_custom_sprites
repo = "infinitefusion/sprites" # repo = "infinitefusion/sprites"
folder = "CustomBattlers" # folder = "CustomBattlers"
repo = "Aegide/custom-fusion-sprites"
folder = "CustomBattlers"
api_url = "https://api.github.com/repos/#{repo}/contents/#{folder}" api_url = "https://api.github.com/repos/#{repo}/contents/#{folder}"
response = HTTPLite.get(api_url) response = HTTPLite.get(api_url)
return HTTPLite::JSON.parse(response[:body]).map { |file| file['name'] } return HTTPLite::JSON.parse(response[:body]).map { |file| file['name'] }

View File

@@ -0,0 +1,8 @@
def getBlackMarketOriginalTrainer
randomTrainer = GameData::Trainer.list_all.values.sample
return randomTrainer
# trainer = NPCTrainer.new("", randomTrainer.id)
# return trainer
end

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -1223,7 +1223,7 @@ Pokemon = B95H43,17
#------------------ #------------------
[YOUNGSTER,Joey] [YOUNGSTER,Joey]
Pokemon = B19H20,17 Pokemon = B19H19,17
#---------------- #----------------
[YOUNGSTER,Dan] [YOUNGSTER,Dan]