Rearranged settings

This commit is contained in:
Maruno17
2021-01-02 21:08:47 +00:00
parent 63e257323b
commit d4a7de4bdd
38 changed files with 626 additions and 593 deletions

View File

@@ -578,7 +578,7 @@ end
Events.onEndBattle += proc { |_sender,e|
decision = e[0]
canLose = e[1]
if NEWEST_BATTLE_MECHANICS || (decision!=2 && decision!=5) # not a loss or a draw
if CHECK_EVOLUTION_AFTER_ALL_BATTLES || (decision!=2 && decision!=5) # not a loss or a draw
if $PokemonTemp.evolutionLevels
pbEvolutionCheck($PokemonTemp.evolutionLevels)
$PokemonTemp.evolutionLevels = nil
@@ -602,7 +602,7 @@ Events.onEndBattle += proc { |_sender,e|
def pbEvolutionCheck(currentLevels)
for i in 0...currentLevels.length
pkmn = $Trainer.party[i]
next if !pkmn || (pkmn.hp==0 && !NEWEST_BATTLE_MECHANICS)
next if !pkmn || (pkmn.hp==0 && !CHECK_EVOLUTION_FOR_FAINTED_POKEMON)
next if currentLevels[i] && pkmn.level==currentLevels[i]
newSpecies = pbCheckEvolution(pkmn)
next if !newSpecies

View File

@@ -297,11 +297,11 @@ class PokemonEncounters
end
end
# Black Flute and White Flute alter the level of the wild Pokémon
if NEWEST_BATTLE_MECHANICS
if FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
if $PokemonMap.blackFluteUsed
level = [level+1+rand(3),PBExperience.maxLevel].min
level = [level + 1 + rand(4), PBExperience.maxLevel].min
elsif $PokemonMap.whiteFluteUsed
level = [level-1-rand(3),1].max
level = [level - 1 - rand(4), 1].max
end
end
# Return [species, level]
@@ -329,7 +329,7 @@ class PokemonEncounters
# increase precision).
encount = @density[enctype]*16
encount *= 0.8 if $PokemonGlobal.bicycle
if !NEWEST_BATTLE_MECHANICS
if !FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
if $PokemonMap.blackFluteUsed
encount /= 2
elsif $PokemonMap.whiteFluteUsed
@@ -382,7 +382,7 @@ class PokemonEncounters
return false if $DEBUG && Input.press?(Input::CTRL)
if !pbPokeRadarOnShakingGrass
if $PokemonGlobal.repel>0 || repel
firstPkmn = (NEWEST_BATTLE_MECHANICS) ? $Trainer.firstPokemon : $Trainer.firstAblePokemon
firstPkmn = (REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.firstPokemon : $Trainer.firstAblePokemon
return false if firstPkmn && encounter[1]<firstPkmn.level
end
end

View File

@@ -374,19 +374,15 @@ end
Events.onAction += proc { |_sender, _e|
if $PokemonGlobal.diving
if DIVING_SURFACE_ANYWHERE
surface_map_id = nil
GameData::MapMetadata.each do |map_data|
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id
surface_map_id = map_data.id
break
end
if surface_map_id &&
PBTerrain.isDeepWater?($MapFactory.getTerrainTag(surface_map_id, $game_player.x, $game_player.y))
pbSurfacing
else
surface_map_id = nil
GameData::MapMetadata.each do |map_data|
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id
surface_map_id = map_data.id
break
end
if surface_map_id &&
PBTerrain.isDeepWater?($MapFactory.getTerrainTag(surface_map_id, $game_player.x, $game_player.y))
pbSurfacing
end
end
else
pbDive if PBTerrain.isDeepWater?($game_player.terrain_tag)
@@ -396,7 +392,6 @@ Events.onAction += proc { |_sender, _e|
HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,showmsg)
if $PokemonGlobal.diving
next true if DIVING_SURFACE_ANYWHERE
surface_map_id = nil
GameData::MapMetadata.each do |map_data|
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id

View File

@@ -228,7 +228,7 @@ def pbDayCareGenerateEgg
moves.push(move)
end
# Inheriting Machine Moves
if !NEWEST_BATTLE_MECHANICS
if BREEDING_CAN_INHERIT_MACHINE_MOVES
GameData::Item.each do |i|
atk = i.move
next if !atk
@@ -242,7 +242,7 @@ def pbDayCareGenerateEgg
if movefather.male?
babyEggMoves.each { |m| moves.push(m) if movefather.hasMove?(m) }
end
if NEWEST_BATTLE_MECHANICS
if BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER
babyEggMoves.each { |m| moves.push(m) if movemother.hasMove?(m) }
end
# Volt Tackle
@@ -293,8 +293,7 @@ def pbDayCareGenerateEgg
end
r = (r+1)%2
end
limit = (NEWEST_BATTLE_MECHANICS && (mother.hasItem?(:DESTINYKNOT) ||
father.hasItem?(:DESTINYKNOT))) ? 5 : 3
limit = (mother.hasItem?(:DESTINYKNOT) || father.hasItem?(:DESTINYKNOT)) ? 5 : 3
loop do
freestats = []
PBStats.eachStat { |s| freestats.push(s) if !ivinherit.include?(s) }
@@ -307,11 +306,12 @@ def pbDayCareGenerateEgg
break if num>=limit
end
# Inheriting nature
newnatures = []
newnatures.push(mother.nature) if mother.hasItem?(:EVERSTONE)
newnatures.push(father.nature) if father.hasItem?(:EVERSTONE)
if newnatures.length>0
egg.setNature(newnatures[rand(newnatures.length)])
new_natures = []
new_natures.push(mother.nature) if mother.hasItem?(:EVERSTONE)
new_natures.push(father.nature) if father.hasItem?(:EVERSTONE)
if new_natures.length > 0
new_nature = (new_natures.length == 1) ? new_natures[0] : new_natures[rand(new_natures.length)]
egg.setNature(new_nature)
end
# Masuda method and Shiny Charm
shinyretries = 0
@@ -324,26 +324,34 @@ def pbDayCareGenerateEgg
end
end
# Inheriting ability from the mother
if !ditto0 && !ditto1
if mother.hasHiddenAbility?
egg.setAbility(mother.abilityIndex) if rand(10)<6
else
if rand(10)<8
if !ditto0 || !ditto1
parent = (ditto0) ? father : mother # The non-Ditto
if parent.hasHiddenAbility?
egg.setAbility(parent.abilityIndex) if rand(100) < 60
elsif !ditto0 && !ditto1
if rand(100) < 80
egg.setAbility(mother.abilityIndex)
else
egg.setAbility((mother.abilityIndex+1)%2)
egg.setAbility((mother.abilityIndex + 1) % 2)
end
end
elsif !(ditto0 && ditto1) && NEWEST_BATTLE_MECHANICS
parent = (!ditto0) ? mother : father
if parent.hasHiddenAbility?
egg.setAbility(parent.abilityIndex) if rand(10)<6
end
end
# Inheriting Poké Ball from the mother
if mother.female? &&
![:MASTERBALL, :CHERISHBALL].include?(pbBallTypeToItem(mother.ballused).id)
egg.ballused = mother.ballused
# Inheriting Poké Ball from the mother (or father if it's same species as mother)
if !ditto0 || !ditto1
possible_balls = []
if mother.species == father.species
possible_balls.push(mother.ballused)
possible_balls.push(father.ballused)
else
possible_balls.push(pkmn0.ballused) if pkmn0.female? || ditto1
possible_balls.push(pkmn1.ballused) if pkmn1.female? || ditto0
end
possible_balls.delete(pbGetBallType(:MASTERBALL)) # Can't inherit this Ball
possible_balls.delete(pbGetBallType(:CHERISHBALL)) # Can't inherit this Ball
if possible_balls.length > 0
egg.ballused = possible_balls[0]
egg.ballused = possible_balls[rand(possible_balls.length)] if possible_balls.length > 1
end
end
# Set all stats
egg.happiness = 120