mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
battle factory
This commit is contained in:
@@ -507,13 +507,21 @@ class CustomTilemap
|
||||
elsif $PokemonGlobal.bridge > 0 && terrain_tag_data.bridge
|
||||
spriteZ = 1
|
||||
else
|
||||
spriteZ = (priority==0) ? 0 : ypos+priority*32+32
|
||||
spriteZ = calculate_sprite_priority(priority,ypos)
|
||||
end
|
||||
sprite.z = spriteZ
|
||||
count += 2
|
||||
return count
|
||||
end
|
||||
|
||||
def calculate_sprite_priority(priority,ypos)
|
||||
begin
|
||||
return (priority==0) ? 0 : ypos+priority*32+32
|
||||
rescue
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
def refresh_flash
|
||||
if @flash_data && !@flash
|
||||
@flash = CustomTilemapSprite.new(viewport)
|
||||
|
||||
@@ -366,6 +366,7 @@ end
|
||||
# Battle Factory data
|
||||
#===============================================================================
|
||||
class BattleFactoryData
|
||||
INITIAL_BST=350
|
||||
def initialize(bcdata)
|
||||
@bcdata = bcdata
|
||||
end
|
||||
|
||||
@@ -25,11 +25,30 @@ def pbGetBTTrainers(challengeID)
|
||||
return []
|
||||
end
|
||||
|
||||
def pbGetBTPokemon(challengeID)
|
||||
trlists = (load_data("Data/trainer_lists.dat") rescue [])
|
||||
trlists.each { |tr| return tr[1] if !tr[5] && tr[2].include?(challengeID) }
|
||||
trlists.each { |tr| return tr[1] if tr[5] } # is default list
|
||||
return []
|
||||
def pbGetBTPokemon(challenge_id)
|
||||
list=[]
|
||||
for i in 0..PBSpecies.maxValue
|
||||
list << i
|
||||
end
|
||||
return list
|
||||
# list=[]
|
||||
# while list.length <= target_size
|
||||
# list << generate_random_species(max_bst)
|
||||
# end
|
||||
# return list
|
||||
end
|
||||
|
||||
def generate_random_species(max_bst)
|
||||
additional_bst = $game_variables[120]
|
||||
species=0
|
||||
bonus = 0
|
||||
while (species==0) # Loop Start
|
||||
bonus+= 5 #+ de chance de pogner un bon poke a chaque loop (permet d'eviter infinite loop)
|
||||
species=rand(PBSpecies.maxValue)+1
|
||||
bst = calcBaseStats(species)
|
||||
species=0 if bst > max_bst+additional_bst
|
||||
end
|
||||
return species
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
|
||||
@@ -154,10 +154,19 @@ def pbBattleFactoryPokemon(rules, win_count, swap_count, rentals)
|
||||
rnd = pokemonNumbers[0] + rand(pokemonNumbers[1] - pokemonNumbers[0] + 1)
|
||||
rndpoke = btpokemon[rnd]
|
||||
indvalue = (party.length < iv_threshold) ? ivs[0] : ivs[1]
|
||||
party.push(rndpoke.createPokemon(level, indvalue, nil))
|
||||
party.push(createPokemon(rndpoke,level, indvalue, nil))
|
||||
end
|
||||
break if rules.ruleset.isValid?([].concat(party).concat(rentals))
|
||||
end
|
||||
rules.ruleset.setNumberRange(old_min, old_max)
|
||||
return party
|
||||
end
|
||||
|
||||
|
||||
def createPokemon(species, level, iv, trainer)
|
||||
pkmn = Pokemon.new(species, level, trainer)
|
||||
pkmn.personalID = rand(2 ** 16) | rand(2 ** 16) << 16
|
||||
GameData::Stat.each_main { |s| pkmn.iv[s.id] = iv }
|
||||
pkmn.calc_stats
|
||||
return pkmn
|
||||
end
|
||||
@@ -15,7 +15,7 @@
|
||||
# Vermillion City (19) - Route 11 (155)
|
||||
19,East,0,155,West,5
|
||||
# Secluded Path (65) - Vermillion City (19)
|
||||
65,East,21,19,West,0
|
||||
#65,East,21,19,West,0
|
||||
# Route 17 (146) - Route 18 (517)
|
||||
146,East,56,517,West,0
|
||||
# Fuchsia City (472) - Route 18 (517)
|
||||
|
||||
Reference in New Issue
Block a user