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]
end
def list_all
return self::DATA
end
# @param tr_type [Symbol, String]
# @param tr_name [String]
# @param tr_version [Integer, nil]

View File

@@ -32,6 +32,11 @@ class Pokemon
return new(trainer.id, trainer.name, trainer.gender, trainer.language)
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.
# @param name [String] owner name
# @param gender [Integer] owner gender

View File

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

View File

@@ -61,20 +61,22 @@ def pbGenerateBattleTrainer(idxTrainer, rules)
if pokemonnumbers.length <= rules.ruleset.suggestedNumber
for n in pokemonnumbers
rndpoke = btpokemon[n]
pkmn = rndpoke.createPokemon(level, indvalues, opponent)
pkmn = rndpoke.createPokemon(rndpoke,level, indvalues, opponent)
opponent.party.push(pkmn)
end
return opponent
end
# There are more possible Pokémon than there are spaces available in the
# trainer's party; randomly choose Pokémon
#
minBst = pbGet(VAR_BATTLE_TOWER_MIN_BST)
maxBst = pbGet(VAR_BATTLE_TOWER_MAX_BST)
loop do
opponent.party.clear
while opponent.party.length < rules.ruleset.suggestedNumber
rnd = pokemonnumbers[rand(pokemonnumbers.length)]
rndpoke = btpokemon[rnd]
pkmn = rndpoke.createPokemon(level, indvalues, opponent)
opponent.party.push(pkmn)
rndpoke = getRandomPokemonSpecies(btpokemon,minBst,maxBst)
opponent.party.push(createPokemon(rndpoke,level, indvalues, nil))
end
break if rules.ruleset.isValid?(opponent.party)
end
@@ -170,3 +172,17 @@ def createPokemon(species, level, iv, trainer)
pkmn.calc_stats
return pkmn
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)
end
# 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
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
bst = 0
pkmn.baseStats.each_value { |s| bst += s }

View File

@@ -1006,7 +1006,7 @@ PokemonDebugMenuCommands.register("ownership", {
when 0 # Make player's
pkmn.owner = Pokemon::Owner.new_from_trainer($Trainer)
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
cmd2 = screen.pbShowCommands(_INTL("Set OT's 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
#try to get list from github
print "let's try it online bruh"
online_list = list_online_custom_sprites
return nil if !online_list
species_id_list = []

View File

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

View File

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

View File

@@ -53,8 +53,11 @@ end
# repo = "Aegide/custom-fusion-sprites"
# folder = "CustomBattlers"
def list_online_custom_sprites
repo = "infinitefusion/sprites"
folder = "CustomBattlers"
# repo = "infinitefusion/sprites"
# folder = "CustomBattlers"
repo = "Aegide/custom-fusion-sprites"
folder = "CustomBattlers"
api_url = "https://api.github.com/repos/#{repo}/contents/#{folder}"
response = HTTPLite.get(api_url)
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]
Pokemon = B19H20,17
Pokemon = B19H19,17
#----------------
[YOUNGSTER,Dan]