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
|
elsif $PokemonGlobal.bridge > 0 && terrain_tag_data.bridge
|
||||||
spriteZ = 1
|
spriteZ = 1
|
||||||
else
|
else
|
||||||
spriteZ = (priority==0) ? 0 : ypos+priority*32+32
|
spriteZ = calculate_sprite_priority(priority,ypos)
|
||||||
end
|
end
|
||||||
sprite.z = spriteZ
|
sprite.z = spriteZ
|
||||||
count += 2
|
count += 2
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def calculate_sprite_priority(priority,ypos)
|
||||||
|
begin
|
||||||
|
return (priority==0) ? 0 : ypos+priority*32+32
|
||||||
|
rescue
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def refresh_flash
|
def refresh_flash
|
||||||
if @flash_data && !@flash
|
if @flash_data && !@flash
|
||||||
@flash = CustomTilemapSprite.new(viewport)
|
@flash = CustomTilemapSprite.new(viewport)
|
||||||
|
|||||||
@@ -366,6 +366,7 @@ end
|
|||||||
# Battle Factory data
|
# Battle Factory data
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class BattleFactoryData
|
class BattleFactoryData
|
||||||
|
INITIAL_BST=350
|
||||||
def initialize(bcdata)
|
def initialize(bcdata)
|
||||||
@bcdata = bcdata
|
@bcdata = bcdata
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -25,11 +25,30 @@ def pbGetBTTrainers(challengeID)
|
|||||||
return []
|
return []
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbGetBTPokemon(challengeID)
|
def pbGetBTPokemon(challenge_id)
|
||||||
trlists = (load_data("Data/trainer_lists.dat") rescue [])
|
list=[]
|
||||||
trlists.each { |tr| return tr[1] if !tr[5] && tr[2].include?(challengeID) }
|
for i in 0..PBSpecies.maxValue
|
||||||
trlists.each { |tr| return tr[1] if tr[5] } # is default list
|
list << i
|
||||||
return []
|
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
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -154,10 +154,19 @@ def pbBattleFactoryPokemon(rules, win_count, swap_count, rentals)
|
|||||||
rnd = pokemonNumbers[0] + rand(pokemonNumbers[1] - pokemonNumbers[0] + 1)
|
rnd = pokemonNumbers[0] + rand(pokemonNumbers[1] - pokemonNumbers[0] + 1)
|
||||||
rndpoke = btpokemon[rnd]
|
rndpoke = btpokemon[rnd]
|
||||||
indvalue = (party.length < iv_threshold) ? ivs[0] : ivs[1]
|
indvalue = (party.length < iv_threshold) ? ivs[0] : ivs[1]
|
||||||
party.push(rndpoke.createPokemon(level, indvalue, nil))
|
party.push(createPokemon(rndpoke,level, indvalue, nil))
|
||||||
end
|
end
|
||||||
break if rules.ruleset.isValid?([].concat(party).concat(rentals))
|
break if rules.ruleset.isValid?([].concat(party).concat(rentals))
|
||||||
end
|
end
|
||||||
rules.ruleset.setNumberRange(old_min, old_max)
|
rules.ruleset.setNumberRange(old_min, old_max)
|
||||||
return party
|
return party
|
||||||
end
|
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)
|
# Vermillion City (19) - Route 11 (155)
|
||||||
19,East,0,155,West,5
|
19,East,0,155,West,5
|
||||||
# Secluded Path (65) - Vermillion City (19)
|
# Secluded Path (65) - Vermillion City (19)
|
||||||
65,East,21,19,West,0
|
#65,East,21,19,West,0
|
||||||
# Route 17 (146) - Route 18 (517)
|
# Route 17 (146) - Route 18 (517)
|
||||||
146,East,56,517,West,0
|
146,East,56,517,West,0
|
||||||
# Fuchsia City (472) - Route 18 (517)
|
# Fuchsia City (472) - Route 18 (517)
|
||||||
|
|||||||
Reference in New Issue
Block a user