Moved all settings into module Settings

This commit is contained in:
Maruno17
2021-02-01 21:03:58 +00:00
parent 923844fdc7
commit 1209b804e9
88 changed files with 848 additions and 839 deletions

View File

@@ -193,7 +193,7 @@ Events.onMapUpdate += proc { |_sender,_e|
# Returns whether the Poké Center should explain Pokérus to the player, if a
# healed Pokémon has it.
def pbPokerus?
return false if $game_switches[SEEN_POKERUS_SWITCH]
return false if $game_switches[Settings::SEEN_POKERUS_SWITCH]
for i in $Trainer.party
return true if i.pokerusStage==1
end
@@ -274,7 +274,7 @@ Events.onStepTaken += proc {
Events.onStepTakenTransferPossible += proc { |_sender,e|
handled = e[0]
next if handled[0]
if $PokemonGlobal.stepcount%4==0 && POISON_IN_FIELD
if $PokemonGlobal.stepcount%4==0 && Settings::POISON_IN_FIELD
flashed = false
for i in $Trainer.able_party
if i.status==PBStatuses::POISON && !i.hasAbility?(:IMMUNITY)
@@ -282,8 +282,8 @@ Events.onStepTakenTransferPossible += proc { |_sender,e|
$game_screen.start_flash(Color.new(255,0,0,128), 4)
flashed = true
end
i.hp -= 1 if i.hp>1 || POISON_FAINT_IN_FIELD
if i.hp==1 && !POISON_FAINT_IN_FIELD
i.hp -= 1 if i.hp>1 || Settings::POISON_FAINT_IN_FIELD
if i.hp==1 && !Settings::POISON_FAINT_IN_FIELD
i.status = PBStatuses::NONE
pbMessage(_INTL("{1} survived the poisoning.\\nThe poison faded away!\1",i.name))
next
@@ -341,7 +341,7 @@ Events.onStepTakenFieldMovement += proc { |_sender,e|
if $scene.is_a?(Scene_Map)
currentTag = pbGetTerrainTag(event)
if PBTerrain.isJustGrass?(pbGetTerrainTag(event,true)) # Won't show if under bridge
$scene.spriteset.addUserAnimation(GRASS_ANIMATION_ID,event.x,event.y,true,1)
$scene.spriteset.addUserAnimation(Settings::GRASS_ANIMATION_ID,event.x,event.y,true,1)
elsif event==$game_player
if currentTag==PBTerrain::WaterfallCrest
# Descend waterfall, but only if this event is the player
@@ -470,9 +470,11 @@ Events.onMapSceneChange += proc { |_sender, e|
if mapChanged && map_metadata && map_metadata.announce_location
nosignpost = false
if $PokemonGlobal.mapTrail[1]
for i in 0...NO_SIGNPOSTS.length / 2
nosignpost = true if NO_SIGNPOSTS[2 * i] == $PokemonGlobal.mapTrail[1] && NO_SIGNPOSTS[2 * i + 1] == $game_map.map_id
nosignpost = true if NO_SIGNPOSTS[2 * i + 1] == $PokemonGlobal.mapTrail[1] && NO_SIGNPOSTS[2 * i] == $game_map.map_id
for i in 0...Settings::NO_SIGNPOSTS.length / 2
nosignpost = true if Settings::NO_SIGNPOSTS[2 * i] == $PokemonGlobal.mapTrail[1] &&
Settings::NO_SIGNPOSTS[2 * i + 1] == $game_map.map_id
nosignpost = true if Settings::NO_SIGNPOSTS[2 * i + 1] == $PokemonGlobal.mapTrail[1] &&
Settings::NO_SIGNPOSTS[2 * i] == $game_map.map_id
break if nosignpost
end
mapinfos = load_data("Data/MapInfos.rxdata")
@@ -769,7 +771,7 @@ end
def pbLedge(_xOffset,_yOffset)
if PBTerrain.isLedge?(pbFacingTerrainTag)
if pbJumpToward(2,true)
$scene.spriteset.addUserAnimation(DUST_ANIMATION_ID,$game_player.x,$game_player.y,true,1)
$scene.spriteset.addUserAnimation(Settings::DUST_ANIMATION_ID,$game_player.x,$game_player.y,true,1)
$game_player.increase_steps
$game_player.check_event_trigger_here([1,2])
end
@@ -868,7 +870,7 @@ end
#===============================================================================
def pbFishingBegin
$PokemonGlobal.fishing = true
if !pbCommonEvent(FISHING_BEGIN_COMMON_EVENT)
if !pbCommonEvent(Settings::FISHING_BEGIN_COMMON_EVENT)
patternb = 2*$game_player.direction - 1
meta = GameData::Metadata.get_player($PokemonGlobal.playerID)
num = ($PokemonGlobal.surfing) ? 7 : 6
@@ -887,7 +889,7 @@ def pbFishingBegin
end
def pbFishingEnd
if !pbCommonEvent(FISHING_END_COMMON_EVENT)
if !pbCommonEvent(Settings::FISHING_END_COMMON_EVENT)
patternb = 2*($game_player.direction - 2)
meta = GameData::Metadata.get_player($PokemonGlobal.playerID)
num = ($PokemonGlobal.surfing) ? 7 : 6
@@ -927,7 +929,7 @@ def pbFishing(hasEncounter,rodType=1)
break
end
if hasEncounter && rand(100)<biteChance
$scene.spriteset.addUserAnimation(EXCLAMATION_ANIMATION_ID,$game_player.x,$game_player.y,true,3)
$scene.spriteset.addUserAnimation(Settings::EXCLAMATION_ANIMATION_ID,$game_player.x,$game_player.y,true,3)
frames = Graphics.frame_rate - rand(Graphics.frame_rate/2) # 0.5-1 second
if !pbWaitForInput(msgWindow,message+_INTL("\r\nOh! A bite!"),frames)
pbFishingEnd
@@ -935,9 +937,9 @@ def pbFishing(hasEncounter,rodType=1)
pbMessageDisplay(msgWindow,_INTL("The Pokémon got away..."))
break
end
if FISHING_AUTO_HOOK || rand(100)<hookChance
if Settings::FISHING_AUTO_HOOK || rand(100) < hookChance
pbFishingEnd
pbMessageDisplay(msgWindow,_INTL("Landed a Pokémon!")) if !FISHING_AUTO_HOOK
pbMessageDisplay(msgWindow,_INTL("Landed a Pokémon!")) if !Settings::FISHING_AUTO_HOOK
$game_player.setDefaultCharName(nil,oldpattern)
ret = true
break
@@ -996,7 +998,7 @@ def pbWaitForInput(msgWindow,message,frames)
$game_player.pattern = 0
return true
end
break if !FISHING_AUTO_HOOK && numFrame>frames
break if !Settings::FISHING_AUTO_HOOK && numFrame > frames
numFrame += 1
end
return false

View File

@@ -640,7 +640,7 @@ def pbStartOver(gameover=false)
end
pbCancelVehicles
pbRemoveDependencies
$game_switches[STARTING_OVER_SWITCH] = true
$game_switches[Settings::STARTING_OVER_SWITCH] = true
$game_temp.player_new_map_id = $PokemonGlobal.pokecenterMapId
$game_temp.player_new_x = $PokemonGlobal.pokecenterX
$game_temp.player_new_y = $PokemonGlobal.pokecenterY
@@ -664,7 +664,7 @@ def pbStartOver(gameover=false)
if homedata
pbCancelVehicles
pbRemoveDependencies
$game_switches[STARTING_OVER_SWITCH] = true
$game_switches[Settings::STARTING_OVER_SWITCH] = true
$game_temp.player_new_map_id = homedata[0]
$game_temp.player_new_x = homedata[1]
$game_temp.player_new_y = homedata[2]

View File

@@ -161,7 +161,7 @@ def pbPrepareBattle(battle)
if GameData::MapMetadata.exists?($game_map.map_id) &&
GameData::MapMetadata.get($game_map.map_id).battle_environment == PBEnvironment::Cave
battle.time = 2 # This makes Dusk Balls work properly in caves
elsif TIME_SHADING
elsif Settings::TIME_SHADING
timeNow = pbGetTimeNow
if PBDayNight.isNight?(timeNow); battle.time = 2
elsif PBDayNight.isEvening?(timeNow); battle.time = 1
@@ -487,7 +487,7 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech=nil,
# If there is exactly 1 other triggered trainer event, and this trainer has
# 6 or fewer Pokémon, record this trainer for a double battle caused by the
# other triggered trainer event
if otherEvent.length == 1 && trainer.party.length <= MAX_PARTY_SIZE
if otherEvent.length == 1 && trainer.party.length <= Settings::MAX_PARTY_SIZE
trainer.lose_text = endSpeech if endSpeech && !endSpeech.empty?
$PokemonTemp.waitingTrainer = [trainer, thisEvent.id]
return false
@@ -579,7 +579,7 @@ end
Events.onEndBattle += proc { |_sender,e|
decision = e[0]
canLose = e[1]
if CHECK_EVOLUTION_AFTER_ALL_BATTLES || (decision!=2 && decision!=5) # not a loss or a draw
if Settings::CHECK_EVOLUTION_AFTER_ALL_BATTLES || (decision!=2 && decision!=5) # not a loss or a draw
if $PokemonTemp.evolutionLevels
pbEvolutionCheck($PokemonTemp.evolutionLevels)
$PokemonTemp.evolutionLevels = nil
@@ -603,7 +603,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 && !CHECK_EVOLUTION_FOR_FAINTED_POKEMON)
next if !pkmn || (pkmn.hp==0 && !Settings::CHECK_EVOLUTION_FOR_FAINTED_POKEMON)
next if currentLevels[i] && pkmn.level==currentLevels[i]
newSpecies = pbCheckEvolution(pkmn)
next if !newSpecies

View File

@@ -216,7 +216,7 @@ class PokemonEncounters
# with modifiers applied, divided by 180.
encount = @step_chances[enc_type].to_f
encount *= 0.8 if $PokemonGlobal.bicycle
if !FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
if !Settings::FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
encount /= 2 if $PokemonMap.blackFluteUsed
encount *= 1.5 if $PokemonMap.whiteFluteUsed
end
@@ -253,7 +253,7 @@ class PokemonEncounters
return false if !enc_data
# Repel
if !ignore_repel && $PokemonGlobal.repel > 0 && !pbPokeRadarOnShakingGrass
first_pkmn = (REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.first_pokemon : $Trainer.first_able_pokemon
first_pkmn = (Settings::REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.first_pokemon : $Trainer.first_able_pokemon
return false if first_pkmn && enc_data[1] < first_pkmn.level
end
# Some abilities make wild encounters less likely if the wild Pokémon is
@@ -391,7 +391,7 @@ class PokemonEncounters
break
end
# Get the chosen species and level
level = rand(encounter[2], encounter[3])
level = rand(encounter[2]..encounter[3])
# Some abilities alter the level of the wild Pokémon
if first_pkmn
case first_pkmn.ability_id
@@ -400,11 +400,11 @@ class PokemonEncounters
end
end
# Black Flute and White Flute alter the level of the wild Pokémon
if FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
if Settings::FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
if $PokemonMap.blackFluteUsed
level = [level + rand(1, 4), PBExperience.maxLevel].min
level = [level + rand(1..4), PBExperience.maxLevel].min
elsif $PokemonMap.whiteFluteUsed
level = [level - rand(1, 4), 1].max
level = [level - rand(1..4), 1].max
end
end
# Return [species, level]
@@ -441,7 +441,7 @@ class PokemonEncounters
break
end
# Return [species, level]
level = rand(encounter[2], encounter[3])
level = rand(encounter[2]..encounter[3])
return [encounter[1], level]
end
end
@@ -477,9 +477,7 @@ def pbGenerateWildPokemon(species,level,isRoamer=false)
end
end
# Give Pokérus
if rand(65536)<POKERUS_CHANCE
genwildpoke.givePokerus
end
genwildpoke.givePokerus if rand(65536) < Settings::POKERUS_CHANCE
# Change wild Pokémon's gender/nature depending on the lead party Pokémon's
# ability
if first_pkmn

View File

@@ -8,7 +8,7 @@
# Make all wild Pokémon shiny while a certain Switch is ON (see Settings).
Events.onWildPokemonCreate += proc { |_sender, e|
pokemon = e[0]
if $game_switches[SHINY_WILD_POKEMON_SWITCH]
if $game_switches[Settings::SHINY_WILD_POKEMON_SWITCH]
pokemon.shiny = true
end
}

View File

@@ -27,9 +27,9 @@ end
# Gets the roaming areas for a particular Pokémon.
def pbRoamingAreas(idxRoamer)
# [species ID, level, Game Switch, encounter type, battle BGM, area maps hash]
roamData = ROAMING_SPECIES[idxRoamer]
roamData = Settings::ROAMING_SPECIES[idxRoamer]
return roamData[5] if roamData && roamData[5]
return ROAMING_AREAS
return Settings::ROAMING_AREAS
end
# Puts a roamer in a completely random map available to it.
@@ -45,14 +45,14 @@ def pbRoamPokemon
# Start all roamers off in random maps
if !$PokemonGlobal.roamPosition
$PokemonGlobal.roamPosition = {}
for i in 0...ROAMING_SPECIES.length
for i in 0...Settings::ROAMING_SPECIES.length
next if !GameData::Species.exists?(i[0])
keys = pbRoamingAreas(i).keys
$PokemonGlobal.roamPosition[i] = keys[rand(keys.length)]
end
end
# Roam each Pokémon in turn
for i in 0...ROAMING_SPECIES.length
for i in 0...Settings::ROAMING_SPECIES.length
pbRoamPokemonOne(i)
end
end
@@ -61,7 +61,7 @@ end
# currently possible to encounter it (i.e. its Game Switch is off).
def pbRoamPokemonOne(idxRoamer)
# [species ID, level, Game Switch, encounter type, battle BGM, area maps hash]
roamData = ROAMING_SPECIES[idxRoamer]
roamData = Settings::ROAMING_SPECIES[idxRoamer]
return if roamData[2]>0 && !$game_switches[roamData[2]] # Game Switch is off
return if !GameData::Species.exists?(roamData[0])
# Get hash of area patrolled by the roaming Pokémon
@@ -151,7 +151,7 @@ EncounterModifier.register(proc { |encounter|
currentRegion = pbGetCurrentRegion
currentMapName = pbGetMessage(MessageTypes::MapNames, $game_map.map_id)
possible_roamers = []
ROAMING_SPECIES.each_with_index do |data, i|
Settings::ROAMING_SPECIES.each_with_index do |data, i|
# data = [species, level, Game Switch, roamer method, battle BGM, area maps hash]
next if !GameData::Species.exists?(data[0])
next if data[2] > 0 && !$game_switches[data[2]] # Isn't roaming

View File

@@ -85,8 +85,8 @@ module DungeonMaze
paintTile(dungeon, xDst, yDst, tile, rotation)
return false if rand(100) < 30
# Generate a randomly placed room
width = rand(MINWIDTH, MAXWIDTH)
height = rand(MINHEIGHT, MAXHEIGHT)
width = rand(MINWIDTH..MAXWIDTH)
height = rand(MINHEIGHT..MAXHEIGHT)
return false if width <= 0 || height <= 0
centerX = TILE_WIDTH / 2 + rand(5) - 2
centerY = TILE_HEIGHT / 2 + rand(5) - 2

View File

@@ -55,7 +55,7 @@ end
def pbCheckHiddenMoveBadge(badge=-1,showmsg=true)
return true if badge<0 # No badge requirement
return true if $DEBUG
if (FIELD_MOVES_COUNT_BADGES) ? $Trainer.badge_count >= badge : $Trainer.badges[badge]
if (Settings::FIELD_MOVES_COUNT_BADGES) ? $Trainer.badge_count >= badge : $Trainer.badges[badge]
return true
end
pbMessage(_INTL("Sorry, a new Badge is required.")) if showmsg
@@ -188,7 +188,7 @@ end
def pbCut
move = :CUT
movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(BADGE_FOR_CUT,false) || (!$DEBUG && !movefinder)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT,false) || (!$DEBUG && !movefinder)
pbMessage(_INTL("This tree looks like it can be cut down."))
return false
end
@@ -203,7 +203,7 @@ def pbCut
end
HiddenMoveHandlers::CanUseMove.add(:CUT,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_CUT,showmsg)
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT,showmsg)
facingEvent = $game_player.pbFacingEvent
if !facingEvent || facingEvent.name.downcase!="tree"
pbMessage(_INTL("Can't use that here.")) if showmsg
@@ -298,7 +298,7 @@ def pbDive
return false if !map_metadata || !map_metadata.dive_map_id
move = :DIVE
movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder)
pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater."))
return false
end
@@ -334,7 +334,7 @@ def pbSurfacing
return if !surface_map_id
move = :DIVE
movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder)
pbMessage(_INTL("Light is filtering down from above. A Pokémon may be able to surface here."))
return false
end
@@ -390,7 +390,7 @@ Events.onAction += proc { |_sender, _e|
}
HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,showmsg)
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,showmsg)
if $PokemonGlobal.diving
surface_map_id = nil
GameData::MapMetadata.each do |map_data|
@@ -455,7 +455,7 @@ HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon|
# Flash
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:FLASH,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_FLASH,showmsg)
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLASH,showmsg)
if !GameData::MapMetadata.exists?($game_map.map_id) ||
!GameData::MapMetadata.get($game_map.map_id).dark_map
pbMessage(_INTL("Can't use that here.")) if showmsg
@@ -492,7 +492,7 @@ HiddenMoveHandlers::UseMove.add(:FLASH,proc { |move,pokemon|
# Fly
#===============================================================================
HiddenMoveHandlers::CanUseMove.add(:FLY,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_FLY,showmsg)
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLY,showmsg)
if $game_player.pbHasDependentEvents?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false
@@ -600,7 +600,7 @@ end
def pbRockSmash
move = :ROCKSMASH
movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(BADGE_FOR_ROCKSMASH,false) || (!$DEBUG && !movefinder)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH,false) || (!$DEBUG && !movefinder)
pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it."))
return false
end
@@ -614,7 +614,7 @@ def pbRockSmash
end
HiddenMoveHandlers::CanUseMove.add(:ROCKSMASH,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_ROCKSMASH,showmsg)
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH,showmsg)
facingEvent = $game_player.pbFacingEvent
if !facingEvent || facingEvent.name.downcase!="rock"
pbMessage(_INTL("Can't use that here.")) if showmsg
@@ -647,7 +647,7 @@ def pbStrength
end
move = :STRENGTH
movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(BADGE_FOR_STRENGTH,false) || (!$DEBUG && !movefinder)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH,false) || (!$DEBUG && !movefinder)
pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
return false
end
@@ -669,7 +669,7 @@ Events.onAction += proc { |_sender,_e|
}
HiddenMoveHandlers::CanUseMove.add(:STRENGTH,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_STRENGTH,showmsg)
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH,showmsg)
if $PokemonMap.strengthUsed
pbMessage(_INTL("Strength is already being used.")) if showmsg
next false
@@ -696,7 +696,7 @@ def pbSurf
return false if $game_player.pbHasDependentEvents?
move = :SURF
movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder)
return false
end
if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?"))
@@ -765,7 +765,7 @@ Events.onAction += proc { |_sender,_e|
}
HiddenMoveHandlers::CanUseMove.add(:SURF,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_SURF,showmsg)
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,showmsg)
if $PokemonGlobal.surfing
pbMessage(_INTL("You're already surfing.")) if showmsg
next false
@@ -948,7 +948,7 @@ end
def pbWaterfall
move = :WATERFALL
movefinder = $Trainer.get_pokemon_with_move(move)
if !pbCheckHiddenMoveBadge(BADGE_FOR_WATERFALL,false) || (!$DEBUG && !movefinder)
if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL,false) || (!$DEBUG && !movefinder)
pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
return false
end
@@ -972,7 +972,7 @@ Events.onAction += proc { |_sender,_e|
}
HiddenMoveHandlers::CanUseMove.add(:WATERFALL,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_WATERFALL,showmsg)
next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL,showmsg)
if pbFacingTerrainTag!=PBTerrain::Waterfall
pbMessage(_INTL("Can't use that here.")) if showmsg
next false

View File

@@ -266,7 +266,7 @@ class BerryPlantSprite
@event.character_name="Object ball"
end
if @oldstage!=berryData[0] && berryData.length>6 # Gen 4 growth mechanisms
$scene.spriteset.addUserAnimation(PLANT_SPARKLE_ANIMATION_ID,@event.x,@event.y,false,1) if $scene.spriteset
$scene.spriteset.addUserAnimation(Settings::PLANT_SPARKLE_ANIMATION_ID,@event.x,@event.y,false,1) if $scene.spriteset
end
end
@oldstage=berryData[0]
@@ -280,7 +280,7 @@ def pbBerryPlant
thisEvent=interp.get_character(0)
berryData=interp.getVariable
if !berryData
if NEW_BERRY_PLANTS
if Settings::NEW_BERRY_PLANTS
berryData=[0,nil,0,0,0,0,0,0]
else
berryData=[0,nil,false,0,0,0]
@@ -298,7 +298,7 @@ def pbBerryPlant
berry=berryData[1]
case berryData[0]
when 0 # empty
if NEW_BERRY_PLANTS
if Settings::NEW_BERRY_PLANTS
# Gen 4 planting mechanics
if !berryData[7] || berryData[7]==0 # No mulch used yet
cmd=pbMessage(_INTL("It's soft, earthy soil."),[
@@ -421,7 +421,7 @@ def pbBerryPlant
when 3 # X taller
pbMessage(_INTL("The {1} plant is growing bigger.",GameData::Item.get(berry).name))
when 4 # X flowering
if NEW_BERRY_PLANTS
if Settings::NEW_BERRY_PLANTS
pbMessage(_INTL("This {1} plant is in bloom!",GameData::Item.get(berry).name))
else
case berryData[4]
@@ -475,7 +475,7 @@ def pbBerryPlant
end
pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the <icon=bagPocket{3}>\\c[1]{4}\\c[0] Pocket.\1",
$Trainer.name,itemname,pocket,PokemonBag.pocketNames()[pocket]))
if NEW_BERRY_PLANTS
if Settings::NEW_BERRY_PLANTS
pbMessage(_INTL("The soil returned to its soft and earthy state."))
berryData=[0,nil,0,0,0,0,0,0]
else
@@ -502,7 +502,7 @@ def pbBerryPlant
end
interp.setVariable(berryData)
pbMessage(_INTL("{1} watered the plant.\\wtnp[40]",$Trainer.name))
if NEW_BERRY_PLANTS
if Settings::NEW_BERRY_PLANTS
pbMessage(_INTL("There! All happy!"))
else
pbMessage(_INTL("The plant seemed to be delighted."))
@@ -538,7 +538,7 @@ def pbPickBerry(berry, qty = 1)
pocket = berry.pocket
pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the <icon=bagPocket{3}>\\c[1]{4}\\c[0] Pocket.\1",
$Trainer.name,itemname,pocket,PokemonBag.pocketNames()[pocket]))
if NEW_BERRY_PLANTS
if Settings::NEW_BERRY_PLANTS
pbMessage(_INTL("The soil returned to its soft and earthy state."))
berryData=[0,nil,0,0,0,0,0,0]
else

View File

@@ -186,7 +186,7 @@ def pbDayCareGenerateEgg
end
end
# Generate egg
egg = Pokemon.new(babyspecies,EGG_LEVEL)
egg = Pokemon.new(babyspecies, Settings::EGG_LEVEL)
# Randomise personal ID
pid = rand(65536)
pid |= (rand(65536)<<16)
@@ -217,7 +217,7 @@ def pbDayCareGenerateEgg
# Initial Moves
initialmoves = egg.getMoveList
for k in initialmoves
if k[0]<=EGG_LEVEL
if k[0] <= Settings::EGG_LEVEL
moves.push(k[1])
elsif mother.hasMove?(k[1]) && father.hasMove?(k[1])
othermoves.push(k[1])
@@ -228,7 +228,7 @@ def pbDayCareGenerateEgg
moves.push(move)
end
# Inheriting Machine Moves
if BREEDING_CAN_INHERIT_MACHINE_MOVES
if Settings::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 BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER
if Settings::BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER
babyEggMoves.each { |m| moves.push(m) if movemother.hasMove?(m) }
end
# Volt Tackle
@@ -361,7 +361,7 @@ def pbDayCareGenerateEgg
egg.obtain_text = _INTL("Day-Care Couple")
egg.name = _INTL("Egg")
egg.steps_to_hatch = egg.species_data.hatch_steps
egg.givePokerus if rand(65536)<POKERUS_CHANCE
egg.givePokerus if rand(65536) < Settings::POKERUS_CHANCE
# Add egg to party
$Trainer.party[$Trainer.party.length] = egg
end

View File

@@ -79,7 +79,7 @@ module PBDayNight
# tone for the current time of day.
def self.getTone
@cachedTone = Tone.new(0,0,0) if !@cachedTone
return @cachedTone if !TIME_SHADING
return @cachedTone if !Settings::TIME_SHADING
if !@dayNightToneLastUpdate ||
Graphics.frame_count-@dayNightToneLastUpdate>=Graphics.frame_rate*30
getToneInternal
@@ -117,7 +117,7 @@ end
def pbDayNightTint(object)
return if !$scene.is_a?(Scene_Map)
if TIME_SHADING && GameData::MapMetadata.exists?($game_map.map_id) &&
if Settings::TIME_SHADING && GameData::MapMetadata.exists?($game_map.map_id) &&
GameData::MapMetadata.get($game_map.map_id).outdoor_map
tone = PBDayNight.getTone
object.tone.set(tone.red,tone.green,tone.blue,tone.gray)