6.4 update (minus sprites)

This commit is contained in:
infinitefusion
2024-12-21 09:43:11 -05:00
parent f70c2cfde4
commit 1e325366d2
1717 changed files with 140299 additions and 27845 deletions

View File

@@ -283,7 +283,7 @@ module RPG
weather_type = (is_new_sprite) ? @target_type : @type
# Update visibility/position/opacity of sprite
if @weatherTypes[weather_type][0].category == :Rain && (index % 2) != 0 # Splash
sprite.opacity = (lifetimes[index] < 0.2) ? 255 : 0 # 0.2 seconds
sprite.opacity = (lifetimes[index] < 0.4) ? 255 : 0 # 0.2 seconds
else
dist_x = @weatherTypes[weather_type][0].particle_delta_x * delta_t
dist_y = @weatherTypes[weather_type][0].particle_delta_y * delta_t
@@ -321,6 +321,7 @@ module RPG
end
def update_tile_position(sprite, index)
return if $PokemonSystem.on_mobile
return if !sprite || !sprite.bitmap || !sprite.visible
sprite.x = (@ox + @tile_x + (index % @tiles_wide) * sprite.bitmap.width).round
sprite.y = (@oy + @tile_y + (index / @tiles_wide) * sprite.bitmap.height).round

View File

@@ -84,14 +84,26 @@ end
def pbStartOver(gameover=false)
$game_variables[VAR_CURRENT_GYM_TYPE]=-1
$game_switches[SWITCH_LOCK_PLAYER_MOVEMENT]=false
$game_switches[SWITCH_TEAMED_WITH_ERIKA_SEWERS]=false
clear_all_images()
$game_player.set_opacity(255)
$game_system.menu_disabled=false
if pbInBugContest?
pbBugContestStartOver
return
end
$Trainer.heal_party
if isOnPinkanIsland()
if $game_switches[SWITCH_PINKAN_SIDE_POLICE]
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]Hey, are you okay over there? Let me take you back to the dock."))
else
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]Hey, are you okay over there? Let me take you back to the beach."))
end
pinkanIslandWarpToStart()
return
end
if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId>=0
if gameover
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, you scurry back to a Pokémon Center."))

View File

@@ -303,7 +303,10 @@ Events.onMapChange += proc { |_sender, e|
$game_screen.weather(:None, 0, 0)
next
end
$game_screen.weather(new_weather[0], 9, 0) if rand(100) < new_weather[1]
echoln new_weather
$game_screen.weather(new_weather[0], 3, 0) if rand(100) < new_weather[1]
}
# Events.onMapChange += proc { |_sender, e|
@@ -596,7 +599,8 @@ def pbMoveRoute(event, commands, waitComplete = false)
return route
end
def pbWait(numFrames)
def
pbWait(numFrames)
numFrames.times do
Graphics.update
Input.update
@@ -816,19 +820,24 @@ def pbItemBall(item, quantity = 1, item_name = "", canRandom = true)
move = item.move
if $PokemonBag.pbStoreItem(item, quantity) # If item can be picked up
meName = (item.is_key_item?) ? "Key item get" : "Item get"
text_color = item.is_key_item? ? "\\c[3]" : "\\c[1]"
if item == :LEFTOVERS
pbMessage(_INTL("\\me[{1}]You found some \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
elsif item.is_machine? # TM or HM
pbMessage(_INTL("\\me[{1}]You found \\c[1]{2} {3}\\c[0]!\\wtnp[30]", meName, itemname, GameData::Move.get(move).name))
elsif quantity > 1
pbMessage(_INTL("\\me[{1}]You found {2} \\c[1]{3}\\c[0]!\\wtnp[30]", meName, quantity, itemname))
pbMessage(_INTL("\\me[{1}]You found {2} #{text_color}{3}\\c[0]!\\wtnp[30]", meName, quantity, itemname))
elsif itemname.starts_with_vowel?
pbMessage(_INTL("\\me[{1}]You found an \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
pbMessage(_INTL("\\me[{1}]You found an #{text_color}{2}\\c[0]!\\wtnp[30]", meName, itemname))
else
pbMessage(_INTL("\\me[{1}]You found a \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
pbMessage(_INTL("\\me[{1}]You found a #{text_color}{2}\\c[0]!\\wtnp[30]", meName, itemname))
end
pbMessage(_INTL("You put the {1} away\\nin the <icon=bagPocket{2}>\\c[1]{3} Pocket\\c[0].",
itemname, pocket, PokemonBag.pocketNames()[pocket]))
promptRegisterItem(item)
updatePinkanBerryDisplay()
return true
end
# Can't add the item
@@ -874,28 +883,40 @@ def pbReceiveItem(item, quantity = 1, item_name = "", music = nil, canRandom = t
pocket = item.pocket
move = item.move
meName = (item.is_key_item?) ? "Key item get" : "Item get"
text_color = item.is_key_item? ? "\\c[3]" : "\\c[1]"
if item == :LEFTOVERS
pbMessage(_INTL("\\me[{1}]You obtained some \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
elsif item.is_machine? # TM or HM
if $game_switches[SWITCH_RANDOMIZE_GYMS_SEPARATELY] && $game_switches[SWITCH_RANDOMIZED_GYM_TYPES] && $game_variables[VAR_CURRENT_GYM_TYPE] > -1
item = randomizeGymTM(item)
item = GameData::Item.get(randomizeGymTM(item))
end
pbMessage(_INTL("\\me[{1}]You obtained \\c[1]{2} {3}\\c[0]!\\wtnp[30]", meName, itemname, GameData::Move.get(move).name))
elsif quantity > 1
pbMessage(_INTL("\\me[{1}]You obtained {2} \\c[1]{3}\\c[0]!\\wtnp[30]", meName, quantity, itemname))
pbMessage(_INTL("\\me[{1}]You obtained {2} #{text_color}{3}\\c[0]!\\wtnp[30]", meName, quantity, itemname))
elsif itemname.starts_with_vowel?
pbMessage(_INTL("\\me[{1}]You obtained an \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
pbMessage(_INTL("\\me[{1}]You obtained an #{text_color}{2}\\c[0]!\\wtnp[30]", meName, itemname))
else
pbMessage(_INTL("\\me[{1}]You obtained a \\c[1]{2}\\c[0]!\\wtnp[30]", meName, itemname))
pbMessage(_INTL("\\me[{1}]You obtained a #{text_color}{2}\\c[0]!\\wtnp[30]", meName, itemname))
end
promptRegisterItem(item)
if $PokemonBag.pbStoreItem(item, quantity) # If item can be added
pbMessage(_INTL("You put the {1} away\\nin the <icon=bagPocket{2}>\\c[1]{3} Pocket\\c[0].",
itemname, pocket, PokemonBag.pocketNames()[pocket]))
updatePinkanBerryDisplay()
return true
end
return false # Can't add the item
end
def promptRegisterItem(item)
if item.is_key_item? && pbCanRegisterItem?(item)
if pbConfirmMessage(_INTL("Would you like to register the \\c[3]{1}\\c[0] in the quick actions menu?",item.name))
$PokemonBag.pbRegisterItem(item)
pbMessage(_INTL("\\se[{1}]The \\c[3]{2}\\c[0] was registered!", "GUI trainer card open", item.name))
end
end
end
def randomizeGymTM(old_item)
gym_index = pbGet(VAR_CURRENT_GYM_TYPE)
type_id = pbGet(VAR_GYM_TYPES_ARRAY)[gym_index]

View File

@@ -749,6 +749,7 @@ Events.onEndBattle += proc { |_sender,e|
pbPickup(pkmn)
pbHoneyGather(pkmn)
end
pickUpTypeItemSetBonus()
when 2, 5 # Lose, draw
if !canLose
$game_system.bgm_unpause

View File

@@ -15,6 +15,7 @@ class PokemonEncounters
@step_chances = {}
@encounter_tables = {}
encounter_data = getEncounterMode().get(map_ID, $PokemonGlobal.encounter_version)
encounter_data = GameData::Encounter.get(map_ID, $PokemonGlobal.encounter_version) if !encounter_data
if encounter_data
encounter_data.step_chances.each { |type, value| @step_chances[type] = value }
@encounter_tables = Marshal.load(Marshal.dump(encounter_data.types))
@@ -22,6 +23,7 @@ class PokemonEncounters
end
def getEncounterMode()
mode = GameData::Encounter
if $game_switches && $game_switches[SWITCH_MODERN_MODE]
mode = GameData::EncounterModern
@@ -29,6 +31,7 @@ class PokemonEncounters
if $game_switches && $game_switches[SWITCH_RANDOM_WILD] && $game_switches[SWITCH_RANDOM_WILD_AREA]
mode= GameData::EncounterRandom
end
echoln mode
return mode
end
@@ -253,12 +256,17 @@ class PokemonEncounters
def encounter_type
time = pbGetTimeNow
ret = nil
terrain_tag = $game_map.terrain_tag($game_player.x, $game_player.y)
if $PokemonGlobal.surfing
ret = find_valid_encounter_type_for_time(:Water, time)
else # Land/Cave (can have both in the same map)
if has_land_encounters? && $game_map.terrain_tag($game_player.x, $game_player.y).land_wild_encounters
ret = :BugContest if pbInBugContest? && has_encounter_type?(:BugContest)
ret = find_valid_encounter_type_for_time(:Land, time) if !ret
baseType = :Land #default grass
baseType = :Land1 if terrain_tag == :Grass_alt1
baseType = :Land2 if terrain_tag == :Grass_alt2
baseType = :Land3 if terrain_tag == :Grass_alt3
ret = find_valid_encounter_type_for_time(baseType, time) if !ret
end
if !ret && has_cave_encounters?
ret = find_valid_encounter_type_for_time(:Cave, time)

View File

@@ -14,20 +14,20 @@ Events.onWildPokemonCreate += proc { |_sender, e|
end
}
# Used in the random dungeon map. Makes the levels of all wild Pokémon in that
# map depend on the levels of Pokémon in the player's party.
# This is a simple method, and can/should be modified to account for evolutions
# and other such details. Of course, you don't HAVE to use this code.
Events.onWildPokemonCreate += proc { |_sender, e|
pokemon = e[0]
if $game_map.map_id == 51
new_level = pbBalancedLevel($Trainer.party) - 4 + rand(5) # For variety
new_level = new_level.clamp(1, GameData::GrowthRate.max_level)
pokemon.level = new_level
pokemon.calc_stats
pokemon.reset_moves
end
}
# # Used in the random dungeon map. Makes the levels of all wild Pokémon in that
# # map depend on the levels of Pokémon in the player's party.
# # This is a simple method, and can/should be modified to account for evolutions
# # and other such details. Of course, you don't HAVE to use this code.
# Events.onWildPokemonCreate += proc { |_sender, e|
# pokemon = e[0]
# if $game_map.map_id == 0
# new_level = pbBalancedLevel($Trainer.party) - 4 + rand(5) # For variety
# new_level = new_level.clamp(1, GameData::GrowthRate.max_level)
# pokemon.level = new_level
# pokemon.calc_stats
# pokemon.reset_moves
# end
# }
# This is the basis of a trainer modifier. It works both for trainers loaded
# when you battle them, and for partner trainers when they are registered.

View File

@@ -57,6 +57,7 @@ class PokemonGlobalMetadata
attr_accessor :safesave
#Trainers rematch
attr_accessor :rematchedTrainers
attr_accessor :questRewardsObtained
def initialize
# Movement
@@ -114,6 +115,7 @@ class PokemonGlobalMetadata
@pokerusTime = nil
# Save file
@safesave = false
@questRewardsObtained = []
end
# @deprecated Use {Player#character_ID} instead. This alias is slated to be removed in v20.

View File

@@ -59,7 +59,7 @@ def pbHiddenMoveEvent
end
def pbCheckHiddenMoveBadge(badge = -1, showmsg = true)
return true if badge < 0 # No badge requirement
return true if badge < 0 || isOnPinkanIsland() # No badge requirement
return true if $DEBUG
if (Settings::FIELD_MOVES_COUNT_BADGES) ? $Trainer.badge_count >= badge : $Trainer.badges[badge]
return true
@@ -931,9 +931,14 @@ Events.onAction += proc { |_sender, _e|
Events.onAction += proc { |_sender, _e|
next if !$game_player.pbFacingTerrainTag.trashcan
if $PokemonGlobal.stepcount % 25 == 0
pbMessage(_INTL("Woah! A Pokémon jumped out of the trashcan!"))
pbWildBattle(:TRUBBISH, 10)
$PokemonGlobal.stepcount += 1
if !hatUnlocked?(HAT_CARDBOARD_BOX) && rand(2) == 0
obtainHat(HAT_CARDBOARD_BOX)
$PokemonGlobal.stepcount += 1
else
pbMessage(_INTL("Woah! A Pokémon jumped out of the trashcan!"))
pbWildBattle(:TRUBBISH, 10)
$PokemonGlobal.stepcount += 1
end
end
}

View File

@@ -72,7 +72,7 @@ def pbFishing(hasEncounter,rodType=1)
break
end
itemChance = rand((rodType)*4)
itemChance = rand((rodType)*5)
if itemChance<=1
#ITEM
items = [:PEARL,
@@ -84,7 +84,20 @@ def pbFishing(hasEncounter,rodType=1)
:PEARL,
:WATERGEM
]
Kernel.pbItemBall(items[rand(items.size)],1,nil,false)
hats = [
HAT_SLOWKING_SHELL,
]
hatChance = rand(5)
if true#hatChance == 0
hat = hats.sample
if !hasHat?(hat)
obtainHat(hat)
else
Kernel.pbItemBall(items[rand(items.size)],1,nil,false)
end
else
Kernel.pbItemBall(items[rand(items.size)],1,nil,false)
end
Kernel.pbDisposeMessageWindow(msgWindow)
pbFishingEnd
$game_player.setDefaultCharName(nil,oldpattern)