mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Updated to mkxp-z v2.1.1, renamed and rearranged some script files
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# Using mkxp-z v2.1.1 - https://gitlab.com/mkxp-z/mkxp-z/-/releases/v2.1.1
|
||||
$VERBOSE = nil
|
||||
Font.default_shadow = false if Font.respond_to?(:default_shadow)
|
||||
Graphics.frame_rate = 40
|
||||
|
||||
172
Data/Scripts/002b_TriggeredEvents/002_Event_FieldEvents.rb
Normal file
172
Data/Scripts/002b_TriggeredEvents/002_Event_FieldEvents.rb
Normal file
@@ -0,0 +1,172 @@
|
||||
#===============================================================================
|
||||
# This module stores events that can happen during the game. A procedure can
|
||||
# subscribe to an event by adding itself to the event. It will then be called
|
||||
# whenever the event occurs.
|
||||
#===============================================================================
|
||||
module Events
|
||||
@@OnMapCreate = Event.new
|
||||
@@OnMapUpdate = Event.new
|
||||
@@OnMapChange = Event.new
|
||||
@@OnMapChanging = Event.new
|
||||
@@OnMapSceneChange = Event.new
|
||||
@@OnSpritesetCreate = Event.new
|
||||
@@OnAction = Event.new
|
||||
@@OnStepTaken = Event.new
|
||||
@@OnLeaveTile = Event.new
|
||||
@@OnStepTakenFieldMovement = Event.new
|
||||
@@OnStepTakenTransferPossible = Event.new
|
||||
@@OnStartBattle = Event.new
|
||||
@@OnEndBattle = Event.new
|
||||
@@OnWildPokemonCreate = Event.new
|
||||
@@OnWildBattleOverride = Event.new
|
||||
@@OnWildBattleEnd = Event.new
|
||||
@@OnTrainerPartyLoad = Event.new
|
||||
@@OnChangeDirection = Event.new
|
||||
|
||||
# Fires whenever a map is created. Event handler receives two parameters: the
|
||||
# map (RPG::Map) and the tileset (RPG::Tileset)
|
||||
def self.onMapCreate; @@OnMapCreate; end
|
||||
def self.onMapCreate=(v); @@OnMapCreate = v; end
|
||||
|
||||
# Fires each frame during a map update.
|
||||
def self.onMapUpdate; @@OnMapUpdate; end
|
||||
def self.onMapUpdate=(v); @@OnMapUpdate = v; end
|
||||
|
||||
# Fires whenever one map is about to change to a different one. Event handler
|
||||
# receives the new map ID and the Game_Map object representing the new map.
|
||||
# When the event handler is called, $game_map still refers to the old map.
|
||||
def self.onMapChanging; @@OnMapChanging; end
|
||||
def self.onMapChanging=(v); @@OnMapChanging = v; end
|
||||
|
||||
# Fires whenever the player moves to a new map. Event handler receives the old
|
||||
# map ID or 0 if none. Also fires when the first map of the game is loaded
|
||||
def self.onMapChange; @@OnMapChange; end
|
||||
def self.onMapChange=(v); @@OnMapChange = v; end
|
||||
|
||||
# Fires whenever the map scene is regenerated and soon after the player moves
|
||||
# to a new map.
|
||||
# Parameters:
|
||||
# e[0] - Scene_Map object.
|
||||
# e[1] - Whether the player just moved to a new map (either true or false). If
|
||||
# false, some other code had called $scene.createSpritesets to
|
||||
# regenerate the map scene without transferring the player elsewhere
|
||||
def self.onMapSceneChange; @@OnMapSceneChange; end
|
||||
def self.onMapSceneChange=(v); @@OnMapSceneChange = v; end
|
||||
|
||||
# Fires whenever a spriteset is created.
|
||||
# Parameters:
|
||||
# e[0] - Spriteset being created. e[0].map is the map associated with the
|
||||
# spriteset (not necessarily the current map).
|
||||
# e[1] - Viewport used for tilemap and characters
|
||||
def self.onSpritesetCreate; @@OnSpritesetCreate; end
|
||||
def self.onSpritesetCreate=(v); @@OnSpritesetCreate = v; end
|
||||
|
||||
# Triggers when the player presses the Action button on the map.
|
||||
def self.onAction; @@OnAction; end
|
||||
def self.onAction=(v); @@OnAction = v; end
|
||||
|
||||
# Fires whenever the player takes a step.
|
||||
def self.onStepTaken; @@OnStepTaken; end
|
||||
def self.onStepTaken=(v); @@OnStepTaken = v; end
|
||||
|
||||
# Fires whenever the player or another event leaves a tile.
|
||||
# Parameters:
|
||||
# e[0] - Event that just left the tile.
|
||||
# e[1] - Map ID where the tile is located (not necessarily
|
||||
# the current map). Use "$MapFactory.getMap(e[1])" to
|
||||
# get the Game_Map object corresponding to that map.
|
||||
# e[2] - X-coordinate of the tile
|
||||
# e[3] - Y-coordinate of the tile
|
||||
def self.onLeaveTile; @@OnLeaveTile; end
|
||||
def self.onLeaveTile=(v); @@OnLeaveTile = v; end
|
||||
|
||||
# Fires whenever the player or another event enters a tile.
|
||||
# Parameters:
|
||||
# e[0] - Event that just entered a tile.
|
||||
def self.onStepTakenFieldMovement; @@OnStepTakenFieldMovement; end
|
||||
def self.onStepTakenFieldMovement=(v); @@OnStepTakenFieldMovement = v; end
|
||||
|
||||
# Fires whenever the player takes a step. The event handler may possibly move
|
||||
# the player elsewhere.
|
||||
# Parameters:
|
||||
# e[0] - Array that contains a single boolean value. If an event handler moves
|
||||
# the player to a new map, it should set this value to true. Other
|
||||
# event handlers should check this parameter's value.
|
||||
def self.onStepTakenTransferPossible; @@OnStepTakenTransferPossible; end
|
||||
def self.onStepTakenTransferPossible=(v); @@OnStepTakenTransferPossible = v; end
|
||||
|
||||
def self.onStartBattle; @@OnStartBattle; end
|
||||
def self.onStartBattle=(v); @@OnStartBattle = v; end
|
||||
|
||||
def self.onEndBattle; @@OnEndBattle; end
|
||||
def self.onEndBattle=(v); @@OnEndBattle = v; end
|
||||
|
||||
# Triggers whenever a wild Pokémon is created
|
||||
# Parameters:
|
||||
# e[0] - Pokémon being created
|
||||
def self.onWildPokemonCreate; @@OnWildPokemonCreate; end
|
||||
def self.onWildPokemonCreate=(v); @@OnWildPokemonCreate = v; end
|
||||
|
||||
# Triggers at the start of a wild battle. Event handlers can provide their
|
||||
# own wild battle routines to override the default behavior.
|
||||
def self.onWildBattleOverride; @@OnWildBattleOverride; end
|
||||
def self.onWildBattleOverride=(v); @@OnWildBattleOverride = v; end
|
||||
|
||||
# Triggers whenever a wild Pokémon battle ends
|
||||
# Parameters:
|
||||
# e[0] - Pokémon species
|
||||
# e[1] - Pokémon level
|
||||
# e[2] - Battle result (1-win, 2-loss, 3-escaped, 4-caught, 5-draw)
|
||||
def self.onWildBattleEnd; @@OnWildBattleEnd; end
|
||||
def self.onWildBattleEnd=(v); @@OnWildBattleEnd = v; end
|
||||
|
||||
# Triggers whenever an NPC trainer's Pokémon party is loaded
|
||||
# Parameters:
|
||||
# e[0] - Trainer
|
||||
# e[1] - Items possessed by the trainer
|
||||
# e[2] - Party
|
||||
def self.onTrainerPartyLoad; @@OnTrainerPartyLoad; end
|
||||
def self.onTrainerPartyLoad=(v); @@OnTrainerPartyLoad = v; end
|
||||
|
||||
# Fires whenever the player changes direction.
|
||||
def self.onChangeDirection; @@OnChangeDirection; end
|
||||
def self.onChangeDirection=(v); @@OnChangeDirection = v; end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
def pbOnSpritesetCreate(spriteset,viewport)
|
||||
Events.onSpritesetCreate.trigger(nil,spriteset,viewport)
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# This module stores encounter-modifying events that can happen during the game.
|
||||
# A procedure can subscribe to an event by adding itself to the event. It will
|
||||
# then be called whenever the event occurs.
|
||||
#===============================================================================
|
||||
module EncounterModifier
|
||||
@@procs = []
|
||||
@@procsEnd = []
|
||||
|
||||
def self.register(p)
|
||||
@@procs.push(p)
|
||||
end
|
||||
|
||||
def self.registerEncounterEnd(p)
|
||||
@@procsEnd.push(p)
|
||||
end
|
||||
|
||||
def self.trigger(encounter)
|
||||
for prc in @@procs
|
||||
encounter = prc.call(encounter)
|
||||
end
|
||||
return encounter
|
||||
end
|
||||
|
||||
def self.triggerEncounterEnd()
|
||||
for prc in @@procsEnd
|
||||
prc.call()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -134,3 +134,21 @@ class Game_Screen
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
def pbToneChangeAll(tone,duration)
|
||||
$game_screen.start_tone_change(tone,duration*Graphics.frame_rate/20)
|
||||
for picture in $game_screen.pictures
|
||||
picture.start_tone_change(tone,duration*Graphics.frame_rate/20) if picture
|
||||
end
|
||||
end
|
||||
|
||||
def pbShake(power,speed,frames)
|
||||
$game_screen.start_shake(power,speed,frames*Graphics.frame_rate/20)
|
||||
end
|
||||
|
||||
def pbFlash(color,frames)
|
||||
$game_screen.start_flash(color,frames*Graphics.frame_rate/20)
|
||||
end
|
||||
|
||||
@@ -439,3 +439,30 @@ class Game_Map
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
def pbScrollMap(direction,distance,speed)
|
||||
if speed==0
|
||||
case direction
|
||||
when 2 then $game_map.scroll_down(distance * Game_Map::REAL_RES_Y)
|
||||
when 4 then $game_map.scroll_left(distance * Game_Map::REAL_RES_X)
|
||||
when 6 then $game_map.scroll_right(distance * Game_Map::REAL_RES_X)
|
||||
when 8 then $game_map.scroll_up(distance * Game_Map::REAL_RES_Y)
|
||||
end
|
||||
else
|
||||
$game_map.start_scroll(direction, distance, speed)
|
||||
oldx = $game_map.display_x
|
||||
oldy = $game_map.display_y
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
break if !$game_map.scrolling?
|
||||
pbUpdateSceneMap
|
||||
break if $game_map.display_x==oldx && $game_map.display_y==oldy
|
||||
oldx = $game_map.display_x
|
||||
oldy = $game_map.display_y
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,6 +31,10 @@ class Game_Event < Game_Character
|
||||
def id; return @event.id; end
|
||||
def name; return @event.name; end
|
||||
|
||||
def set_starting
|
||||
@starting = true
|
||||
end
|
||||
|
||||
def clear_starting
|
||||
@starting = false
|
||||
end
|
||||
@@ -48,14 +48,6 @@ end
|
||||
|
||||
|
||||
|
||||
class Game_Event
|
||||
def set_starting
|
||||
@starting=true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def pbTestPass(follower,x,y,_direction=nil)
|
||||
return $MapFactory.isPassableStrict?(follower.map.map_id,x,y,follower)
|
||||
end
|
||||
@@ -120,9 +120,7 @@ GameData::Evolution.register({
|
||||
:id => :LevelNoWeather,
|
||||
:parameter => Integer,
|
||||
:level_up_proc => proc { |pkmn, parameter|
|
||||
if pkmn.level >= parameter && $game_screen
|
||||
next $game_screen.weather_type == :None
|
||||
end
|
||||
next pkmn.level >= parameter && $game_screen && $game_screen.weather_type == :None
|
||||
}
|
||||
})
|
||||
|
||||
@@ -130,9 +128,8 @@ GameData::Evolution.register({
|
||||
:id => :LevelSun,
|
||||
:parameter => Integer,
|
||||
:level_up_proc => proc { |pkmn, parameter|
|
||||
if pkmn.level >= parameter && $game_screen
|
||||
next GameData::Weather.get($game_screen.weather_type).category == :Sun
|
||||
end
|
||||
next pkmn.level >= parameter && $game_screen &&
|
||||
GameData::Weather.get($game_screen.weather_type).category == :Sun
|
||||
}
|
||||
})
|
||||
|
||||
@@ -140,9 +137,8 @@ GameData::Evolution.register({
|
||||
:id => :LevelRain,
|
||||
:parameter => Integer,
|
||||
:level_up_proc => proc { |pkmn, parameter|
|
||||
if pkmn.level >= parameter && $game_screen
|
||||
next [:Rain, :Fog].include?(GameData::Weather.get($game_screen.weather_type).category)
|
||||
end
|
||||
next pkmn.level >= parameter && $game_screen &&
|
||||
[:Rain, :Fog].include?(GameData::Weather.get($game_screen.weather_type).category)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -150,9 +146,8 @@ GameData::Evolution.register({
|
||||
:id => :LevelSnow,
|
||||
:parameter => Integer,
|
||||
:level_up_proc => proc { |pkmn, parameter|
|
||||
if pkmn.level >= parameter && $game_screen
|
||||
next GameData::Weather.get($game_screen.weather_type).category == :Hail
|
||||
end
|
||||
next pkmn.level >= parameter && $game_screen &&
|
||||
GameData::Weather.get($game_screen.weather_type).category == :Hail
|
||||
}
|
||||
})
|
||||
|
||||
@@ -160,9 +155,8 @@ GameData::Evolution.register({
|
||||
:id => :LevelSandstorm,
|
||||
:parameter => Integer,
|
||||
:level_up_proc => proc { |pkmn, parameter|
|
||||
if pkmn.level >= parameter && $game_screen
|
||||
next GameData::Weather.get($game_screen.weather_type).category == :Sandstorm
|
||||
end
|
||||
next pkmn.level >= parameter && $game_screen &&
|
||||
GameData::Weather.get($game_screen.weather_type).category == :Sandstorm
|
||||
}
|
||||
})
|
||||
|
||||
@@ -203,7 +197,7 @@ GameData::Evolution.register({
|
||||
:id => :LevelDarkInParty,
|
||||
:parameter => Integer,
|
||||
:level_up_proc => proc { |pkmn, parameter|
|
||||
next $Trainer.has_pokemon_of_type?(:DARK) if pkmn.level >= parameter
|
||||
next pkmn.level >= parameter && $Trainer.has_pokemon_of_type?(:DARK)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ module GameData
|
||||
if pkmn_data[:moves] && pkmn_data[:moves].length > 0
|
||||
pkmn_data[:moves].each { |move| pkmn.learn_move(move) }
|
||||
else
|
||||
pkmn.resetMoves
|
||||
pkmn.reset_moves
|
||||
end
|
||||
pkmn.ability_index = pkmn_data[:ability_flag]
|
||||
pkmn.gender = pkmn_data[:gender] || ((trainer.male?) ? 0 : 1)
|
||||
@@ -156,7 +156,7 @@ module GameData
|
||||
pkmn.shiny = false
|
||||
end
|
||||
pkmn.poke_ball = pbBallTypeToItem(pkmn_data[:poke_ball]).id if pkmn_data[:poke_ball]
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
end
|
||||
return trainer
|
||||
end
|
||||
|
||||
@@ -286,7 +286,7 @@ class PokeBattle_Battler
|
||||
#=============================================================================
|
||||
def pbUpdate(fullChange=false)
|
||||
return if !@pokemon
|
||||
@pokemon.calcStats
|
||||
@pokemon.calc_stats
|
||||
@level = @pokemon.level
|
||||
@hp = @pokemon.hp
|
||||
@totalhp = @pokemon.totalhp
|
||||
|
||||
@@ -94,7 +94,7 @@ class PokeBattle_Battle
|
||||
growth_rate = pkmn.growth_rate
|
||||
# Don't bother calculating if gainer is already at max Exp
|
||||
if pkmn.exp>=growth_rate.maximum_exp
|
||||
pkmn.calcStats # To ensure new EVs still have an effect
|
||||
pkmn.calc_stats # To ensure new EVs still have an effect
|
||||
return
|
||||
end
|
||||
isPartic = defeatedBattler.participants.include?(idxParty)
|
||||
@@ -188,7 +188,7 @@ class PokeBattle_Battle
|
||||
curLevel += 1
|
||||
if curLevel>newLevel
|
||||
# Gained all the Exp now, end the animation
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
battler.pbUpdate(false) if battler
|
||||
@scene.pbRefreshOne(battler.index) if battler
|
||||
break
|
||||
@@ -204,7 +204,7 @@ class PokeBattle_Battle
|
||||
if battler && battler.pokemon
|
||||
battler.pokemon.changeHappiness("levelup")
|
||||
end
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
battler.pbUpdate(false) if battler
|
||||
@scene.pbRefreshOne(battler.index) if battler
|
||||
pbDisplayPaused(_INTL("{1} grew to Lv. {2}!",pkmn.name,curLevel))
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
#===============================================================================
|
||||
# Location signpost
|
||||
#===============================================================================
|
||||
class LocationWindow
|
||||
def initialize(name)
|
||||
@window = Window_AdvancedTextPokemon.new(name)
|
||||
@window.resizeToFit(name,Graphics.width)
|
||||
@window.x = 0
|
||||
@window.y = -@window.height
|
||||
@window.viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
@window.viewport.z = 99999
|
||||
@currentmap = $game_map.map_id
|
||||
@frames = 0
|
||||
end
|
||||
|
||||
def disposed?
|
||||
@window.disposed?
|
||||
end
|
||||
|
||||
def dispose
|
||||
@window.dispose
|
||||
end
|
||||
|
||||
def update
|
||||
return if @window.disposed?
|
||||
@window.update
|
||||
if $game_temp.message_window_showing || @currentmap!=$game_map.map_id
|
||||
@window.dispose
|
||||
return
|
||||
end
|
||||
if @frames > Graphics.frame_rate * 2
|
||||
@window.y -= 4
|
||||
@window.dispose if @window.y+@window.height<0
|
||||
else
|
||||
@window.y += 4 if @window.y<0
|
||||
@frames += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Visibility circle in dark maps
|
||||
#===============================================================================
|
||||
class DarknessSprite < SpriteWrapper
|
||||
attr_reader :radius
|
||||
|
||||
def initialize(viewport=nil)
|
||||
super(viewport)
|
||||
@darkness = BitmapWrapper.new(Graphics.width,Graphics.height)
|
||||
@radius = radiusMin
|
||||
self.bitmap = @darkness
|
||||
self.z = 99998
|
||||
refresh
|
||||
end
|
||||
|
||||
def dispose
|
||||
@darkness.dispose
|
||||
super
|
||||
end
|
||||
|
||||
def radiusMin; return 64; end # Before using Flash
|
||||
def radiusMax; return 176; end # After using Flash
|
||||
|
||||
def radius=(value)
|
||||
@radius = value
|
||||
refresh
|
||||
end
|
||||
|
||||
def refresh
|
||||
@darkness.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0,255))
|
||||
cx = Graphics.width/2
|
||||
cy = Graphics.height/2
|
||||
cradius = @radius
|
||||
numfades = 5
|
||||
for i in 1..numfades
|
||||
for j in cx-cradius..cx+cradius
|
||||
diff2 = (cradius * cradius) - ((j - cx) * (j - cx))
|
||||
diff = Math.sqrt(diff2)
|
||||
@darkness.fill_rect(j,cy-diff,1,diff*2,Color.new(0,0,0,255.0*(numfades-i)/numfades))
|
||||
end
|
||||
cradius = (cradius*0.9).floor
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Light effects
|
||||
#===============================================================================
|
||||
class LightEffect
|
||||
def initialize(event,viewport=nil,map=nil,filename=nil)
|
||||
@light = IconSprite.new(0,0,viewport)
|
||||
if filename!=nil && filename!="" && pbResolveBitmap("Graphics/Pictures/"+filename)
|
||||
@light.setBitmap("Graphics/Pictures/"+filename)
|
||||
else
|
||||
@light.setBitmap("Graphics/Pictures/LE")
|
||||
end
|
||||
@light.z = 1000
|
||||
@event = event
|
||||
@map = (map) ? map : $game_map
|
||||
@disposed = false
|
||||
end
|
||||
|
||||
def disposed?
|
||||
return @disposed
|
||||
end
|
||||
|
||||
def dispose
|
||||
@light.dispose
|
||||
@map = nil
|
||||
@event = nil
|
||||
@disposed = true
|
||||
end
|
||||
|
||||
def update
|
||||
@light.update
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class LightEffect_Lamp < LightEffect
|
||||
def initialize(event,viewport=nil,map=nil)
|
||||
lamp = AnimatedBitmap.new("Graphics/Pictures/LE")
|
||||
@light = Sprite.new(viewport)
|
||||
@light.bitmap = Bitmap.new(128,64)
|
||||
src_rect = Rect.new(0, 0, 64, 64)
|
||||
@light.bitmap.blt(0, 0, lamp.bitmap, src_rect)
|
||||
@light.bitmap.blt(20, 0, lamp.bitmap, src_rect)
|
||||
@light.visible = true
|
||||
@light.z = 1000
|
||||
lamp.dispose
|
||||
@map = (map) ? map : $game_map
|
||||
@event = event
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class LightEffect_Basic < LightEffect
|
||||
def update
|
||||
return if !@light || !@event
|
||||
super
|
||||
@light.opacity = 100
|
||||
@light.ox = 32
|
||||
@light.oy = 48
|
||||
if (Object.const_defined?(:ScreenPosHelper) rescue false)
|
||||
@light.x = ScreenPosHelper.pbScreenX(@event)
|
||||
@light.y = ScreenPosHelper.pbScreenY(@event)
|
||||
@light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
|
||||
else
|
||||
@light.x = @event.screen_x
|
||||
@light.y = @event.screen_y
|
||||
@light.zoom_x = 1.0
|
||||
end
|
||||
@light.zoom_y = @light.zoom_x
|
||||
@light.tone = $game_screen.tone
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class LightEffect_DayNight < LightEffect
|
||||
def update
|
||||
return if !@light || !@event
|
||||
super
|
||||
shade = PBDayNight.getShade
|
||||
if shade>=144 # If light enough, call it fully day
|
||||
shade = 255
|
||||
elsif shade<=64 # If dark enough, call it fully night
|
||||
shade = 0
|
||||
else
|
||||
shade = 255-(255*(144-shade)/(144-64))
|
||||
end
|
||||
@light.opacity = 255-shade
|
||||
if @light.opacity>0
|
||||
@light.ox = 32
|
||||
@light.oy = 48
|
||||
if (Object.const_defined?(:ScreenPosHelper) rescue false)
|
||||
@light.x = ScreenPosHelper.pbScreenX(@event)
|
||||
@light.y = ScreenPosHelper.pbScreenY(@event)
|
||||
@light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
|
||||
@light.zoom_y = ScreenPosHelper.pbScreenZoomY(@event)
|
||||
else
|
||||
@light.x = @event.screen_x
|
||||
@light.y = @event.screen_y
|
||||
@light.zoom_x = 1.0
|
||||
@light.zoom_y = 1.0
|
||||
end
|
||||
@light.tone.set($game_screen.tone.red,
|
||||
$game_screen.tone.green,
|
||||
$game_screen.tone.blue,
|
||||
$game_screen.tone.gray)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
Events.onSpritesetCreate += proc { |_sender,e|
|
||||
spriteset = e[0] # Spriteset being created
|
||||
viewport = e[1] # Viewport used for tilemap and characters
|
||||
map = spriteset.map # Map associated with the spriteset (not necessarily the current map)
|
||||
for i in map.events.keys
|
||||
if map.events[i].name[/^outdoorlight\((\w+)\)$/i]
|
||||
filename = $~[1].to_s
|
||||
spriteset.addUserSprite(LightEffect_DayNight.new(map.events[i],viewport,map,filename))
|
||||
elsif map.events[i].name.downcase=="outdoorlight"
|
||||
spriteset.addUserSprite(LightEffect_DayNight.new(map.events[i],viewport,map))
|
||||
elsif map.events[i].name[/^light\((\w+)\)$/i]
|
||||
filename = $~[1].to_s
|
||||
spriteset.addUserSprite(LightEffect_Basic.new(map.events[i],viewport,map,filename))
|
||||
elsif map.events[i].name.downcase=="light"
|
||||
spriteset.addUserSprite(LightEffect_Basic.new(map.events[i],viewport,map))
|
||||
end
|
||||
end
|
||||
spriteset.addUserSprite(Particle_Engine.new(viewport,map))
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
#===============================================================================
|
||||
# Entering/exiting cave animations
|
||||
#===============================================================================
|
||||
def pbCaveEntranceEx(exiting)
|
||||
# Create bitmap
|
||||
sprite = BitmapSprite.new(Graphics.width,Graphics.height)
|
||||
sprite.z = 100000
|
||||
# Define values used for the animation
|
||||
totalFrames = (Graphics.frame_rate*0.4).floor
|
||||
increment = (255.0/totalFrames).ceil
|
||||
totalBands = 15
|
||||
bandheight = ((Graphics.height/2.0)-10)/totalBands
|
||||
bandwidth = ((Graphics.width/2.0)-12)/totalBands
|
||||
# Create initial array of band colors (black if exiting, white if entering)
|
||||
grays = Array.new(totalBands) { |i| (exiting) ? 0 : 255 }
|
||||
# Animate bands changing color
|
||||
totalFrames.times do |j|
|
||||
x = 0
|
||||
y = 0
|
||||
# Calculate color of each band
|
||||
for k in 0...totalBands
|
||||
next if k>=totalBands*j/totalFrames
|
||||
inc = increment
|
||||
inc *= -1 if exiting
|
||||
grays[k] -= inc
|
||||
grays[k] = 0 if grays[k]<0
|
||||
end
|
||||
# Draw gray rectangles
|
||||
rectwidth = Graphics.width
|
||||
rectheight = Graphics.height
|
||||
for i in 0...totalBands
|
||||
currentGray = grays[i]
|
||||
sprite.bitmap.fill_rect(Rect.new(x,y,rectwidth,rectheight),
|
||||
Color.new(currentGray,currentGray,currentGray))
|
||||
x += bandwidth
|
||||
y += bandheight
|
||||
rectwidth -= bandwidth*2
|
||||
rectheight -= bandheight*2
|
||||
end
|
||||
Graphics.update
|
||||
Input.update
|
||||
end
|
||||
# Set the tone at end of band animation
|
||||
if exiting
|
||||
pbToneChangeAll(Tone.new(255,255,255),0)
|
||||
else
|
||||
pbToneChangeAll(Tone.new(-255,-255,-255),0)
|
||||
end
|
||||
# Animate fade to white (if exiting) or black (if entering)
|
||||
for j in 0...totalFrames
|
||||
if exiting
|
||||
sprite.color = Color.new(255,255,255,j*increment)
|
||||
else
|
||||
sprite.color = Color.new(0,0,0,j*increment)
|
||||
end
|
||||
Graphics.update
|
||||
Input.update
|
||||
end
|
||||
# Set the tone at end of fading animation
|
||||
pbToneChangeAll(Tone.new(0,0,0),8)
|
||||
# Pause briefly
|
||||
(Graphics.frame_rate/10).times do
|
||||
Graphics.update
|
||||
Input.update
|
||||
end
|
||||
sprite.dispose
|
||||
end
|
||||
|
||||
def pbCaveEntrance
|
||||
pbSetEscapePoint
|
||||
pbCaveEntranceEx(false)
|
||||
end
|
||||
|
||||
def pbCaveExit
|
||||
pbEraseEscapePoint
|
||||
pbCaveEntranceEx(true)
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Blacking out animation
|
||||
#===============================================================================
|
||||
def pbStartOver(gameover=false)
|
||||
if pbInBugContest?
|
||||
pbBugContestStartOver
|
||||
return
|
||||
end
|
||||
$Trainer.heal_party
|
||||
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."))
|
||||
else
|
||||
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]You scurry back to a Pokémon Center, protecting your exhausted Pokémon from any further harm..."))
|
||||
end
|
||||
pbCancelVehicles
|
||||
pbRemoveDependencies
|
||||
$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
|
||||
$game_temp.player_new_direction = $PokemonGlobal.pokecenterDirection
|
||||
$scene.transfer_player if $scene.is_a?(Scene_Map)
|
||||
$game_map.refresh
|
||||
else
|
||||
homedata = GameData::Metadata.get.home
|
||||
if homedata && !pbRgssExists?(sprintf("Data/Map%03d.rxdata",homedata[0]))
|
||||
if $DEBUG
|
||||
pbMessage(_ISPRINTF("Can't find the map 'Map{1:03d}' in the Data folder. The game will resume at the player's position.",homedata[0]))
|
||||
end
|
||||
$Trainer.heal_party
|
||||
return
|
||||
end
|
||||
if gameover
|
||||
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, you scurry back home."))
|
||||
else
|
||||
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]You scurry back home, protecting your exhausted Pokémon from any further harm..."))
|
||||
end
|
||||
if homedata
|
||||
pbCancelVehicles
|
||||
pbRemoveDependencies
|
||||
$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]
|
||||
$game_temp.player_new_direction = homedata[3]
|
||||
$scene.transfer_player if $scene.is_a?(Scene_Map)
|
||||
$game_map.refresh
|
||||
else
|
||||
$Trainer.heal_party
|
||||
end
|
||||
end
|
||||
pbEraseEscapePoint
|
||||
end
|
||||
@@ -1,179 +1,3 @@
|
||||
#===============================================================================
|
||||
# This module stores encounter-modifying events that can happen during the game.
|
||||
# A procedure can subscribe to an event by adding itself to the event. It will
|
||||
# then be called whenever the event occurs.
|
||||
#===============================================================================
|
||||
module EncounterModifier
|
||||
@@procs = []
|
||||
@@procsEnd = []
|
||||
|
||||
def self.register(p)
|
||||
@@procs.push(p)
|
||||
end
|
||||
|
||||
def self.registerEncounterEnd(p)
|
||||
@@procsEnd.push(p)
|
||||
end
|
||||
|
||||
def self.trigger(encounter)
|
||||
for prc in @@procs
|
||||
encounter = prc.call(encounter)
|
||||
end
|
||||
return encounter
|
||||
end
|
||||
|
||||
def self.triggerEncounterEnd()
|
||||
for prc in @@procsEnd
|
||||
prc.call()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# This module stores events that can happen during the game. A procedure can
|
||||
# subscribe to an event by adding itself to the event. It will then be called
|
||||
# whenever the event occurs.
|
||||
#===============================================================================
|
||||
module Events
|
||||
@@OnMapCreate = Event.new
|
||||
@@OnMapUpdate = Event.new
|
||||
@@OnMapChange = Event.new
|
||||
@@OnMapChanging = Event.new
|
||||
@@OnMapSceneChange = Event.new
|
||||
@@OnSpritesetCreate = Event.new
|
||||
@@OnAction = Event.new
|
||||
@@OnStepTaken = Event.new
|
||||
@@OnLeaveTile = Event.new
|
||||
@@OnStepTakenFieldMovement = Event.new
|
||||
@@OnStepTakenTransferPossible = Event.new
|
||||
@@OnStartBattle = Event.new
|
||||
@@OnEndBattle = Event.new
|
||||
@@OnWildPokemonCreate = Event.new
|
||||
@@OnWildBattleOverride = Event.new
|
||||
@@OnWildBattleEnd = Event.new
|
||||
@@OnTrainerPartyLoad = Event.new
|
||||
@@OnChangeDirection = Event.new
|
||||
|
||||
# Fires whenever a map is created. Event handler receives two parameters: the
|
||||
# map (RPG::Map) and the tileset (RPG::Tileset)
|
||||
def self.onMapCreate; @@OnMapCreate; end
|
||||
def self.onMapCreate=(v); @@OnMapCreate = v; end
|
||||
|
||||
# Fires each frame during a map update.
|
||||
def self.onMapUpdate; @@OnMapUpdate; end
|
||||
def self.onMapUpdate=(v); @@OnMapUpdate = v; end
|
||||
|
||||
# Fires whenever one map is about to change to a different one. Event handler
|
||||
# receives the new map ID and the Game_Map object representing the new map.
|
||||
# When the event handler is called, $game_map still refers to the old map.
|
||||
def self.onMapChanging; @@OnMapChanging; end
|
||||
def self.onMapChanging=(v); @@OnMapChanging = v; end
|
||||
|
||||
# Fires whenever the player moves to a new map. Event handler receives the old
|
||||
# map ID or 0 if none. Also fires when the first map of the game is loaded
|
||||
def self.onMapChange; @@OnMapChange; end
|
||||
def self.onMapChange=(v); @@OnMapChange = v; end
|
||||
|
||||
# Fires whenever the map scene is regenerated and soon after the player moves
|
||||
# to a new map.
|
||||
# Parameters:
|
||||
# e[0] - Scene_Map object.
|
||||
# e[1] - Whether the player just moved to a new map (either true or false). If
|
||||
# false, some other code had called $scene.createSpritesets to
|
||||
# regenerate the map scene without transferring the player elsewhere
|
||||
def self.onMapSceneChange; @@OnMapSceneChange; end
|
||||
def self.onMapSceneChange=(v); @@OnMapSceneChange = v; end
|
||||
|
||||
# Fires whenever a spriteset is created.
|
||||
# Parameters:
|
||||
# e[0] - Spriteset being created. e[0].map is the map associated with the
|
||||
# spriteset (not necessarily the current map).
|
||||
# e[1] - Viewport used for tilemap and characters
|
||||
def self.onSpritesetCreate; @@OnSpritesetCreate; end
|
||||
def self.onSpritesetCreate=(v); @@OnSpritesetCreate = v; end
|
||||
|
||||
# Triggers when the player presses the Action button on the map.
|
||||
def self.onAction; @@OnAction; end
|
||||
def self.onAction=(v); @@OnAction = v; end
|
||||
|
||||
# Fires whenever the player takes a step.
|
||||
def self.onStepTaken; @@OnStepTaken; end
|
||||
def self.onStepTaken=(v); @@OnStepTaken = v; end
|
||||
|
||||
# Fires whenever the player or another event leaves a tile.
|
||||
# Parameters:
|
||||
# e[0] - Event that just left the tile.
|
||||
# e[1] - Map ID where the tile is located (not necessarily
|
||||
# the current map). Use "$MapFactory.getMap(e[1])" to
|
||||
# get the Game_Map object corresponding to that map.
|
||||
# e[2] - X-coordinate of the tile
|
||||
# e[3] - Y-coordinate of the tile
|
||||
def self.onLeaveTile; @@OnLeaveTile; end
|
||||
def self.onLeaveTile=(v); @@OnLeaveTile = v; end
|
||||
|
||||
# Fires whenever the player or another event enters a tile.
|
||||
# Parameters:
|
||||
# e[0] - Event that just entered a tile.
|
||||
def self.onStepTakenFieldMovement; @@OnStepTakenFieldMovement; end
|
||||
def self.onStepTakenFieldMovement=(v); @@OnStepTakenFieldMovement = v; end
|
||||
|
||||
# Fires whenever the player takes a step. The event handler may possibly move
|
||||
# the player elsewhere.
|
||||
# Parameters:
|
||||
# e[0] - Array that contains a single boolean value. If an event handler moves
|
||||
# the player to a new map, it should set this value to true. Other
|
||||
# event handlers should check this parameter's value.
|
||||
def self.onStepTakenTransferPossible; @@OnStepTakenTransferPossible; end
|
||||
def self.onStepTakenTransferPossible=(v); @@OnStepTakenTransferPossible = v; end
|
||||
|
||||
def self.onStartBattle; @@OnStartBattle; end
|
||||
def self.onStartBattle=(v); @@OnStartBattle = v; end
|
||||
|
||||
def self.onEndBattle; @@OnEndBattle; end
|
||||
def self.onEndBattle=(v); @@OnEndBattle = v; end
|
||||
|
||||
# Triggers whenever a wild Pokémon is created
|
||||
# Parameters:
|
||||
# e[0] - Pokémon being created
|
||||
def self.onWildPokemonCreate; @@OnWildPokemonCreate; end
|
||||
def self.onWildPokemonCreate=(v); @@OnWildPokemonCreate = v; end
|
||||
|
||||
# Triggers at the start of a wild battle. Event handlers can provide their
|
||||
# own wild battle routines to override the default behavior.
|
||||
def self.onWildBattleOverride; @@OnWildBattleOverride; end
|
||||
def self.onWildBattleOverride=(v); @@OnWildBattleOverride = v; end
|
||||
|
||||
# Triggers whenever a wild Pokémon battle ends
|
||||
# Parameters:
|
||||
# e[0] - Pokémon species
|
||||
# e[1] - Pokémon level
|
||||
# e[2] - Battle result (1-win, 2-loss, 3-escaped, 4-caught, 5-draw)
|
||||
def self.onWildBattleEnd; @@OnWildBattleEnd; end
|
||||
def self.onWildBattleEnd=(v); @@OnWildBattleEnd = v; end
|
||||
|
||||
# Triggers whenever an NPC trainer's Pokémon party is loaded
|
||||
# Parameters:
|
||||
# e[0] - Trainer
|
||||
# e[1] - Items possessed by the trainer
|
||||
# e[2] - Party
|
||||
def self.onTrainerPartyLoad; @@OnTrainerPartyLoad; end
|
||||
def self.onTrainerPartyLoad=(v); @@OnTrainerPartyLoad = v; end
|
||||
|
||||
# Fires whenever the player changes direction.
|
||||
def self.onChangeDirection; @@OnChangeDirection; end
|
||||
def self.onChangeDirection=(v); @@OnChangeDirection = v; end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def pbOnSpritesetCreate(spriteset,viewport)
|
||||
Events.onSpritesetCreate.trigger(nil,spriteset,viewport)
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Constant checks
|
||||
#===============================================================================
|
||||
@@ -809,147 +633,6 @@ end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Fishing
|
||||
#===============================================================================
|
||||
def pbFishingBegin
|
||||
$PokemonGlobal.fishing = true
|
||||
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
|
||||
if meta && meta[num] && meta[num]!=""
|
||||
charset = pbGetPlayerCharset(meta,num)
|
||||
4.times do |pattern|
|
||||
$game_player.setDefaultCharName(charset,patternb-pattern,true)
|
||||
(Graphics.frame_rate/20).times do
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def pbFishingEnd
|
||||
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
|
||||
if meta && meta[num] && meta[num]!=""
|
||||
charset = pbGetPlayerCharset(meta,num)
|
||||
4.times do |pattern|
|
||||
$game_player.setDefaultCharName(charset,patternb+pattern,true)
|
||||
(Graphics.frame_rate/20).times do
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
$PokemonGlobal.fishing = false
|
||||
end
|
||||
|
||||
def pbFishing(hasEncounter,rodType=1)
|
||||
speedup = ($Trainer.first_pokemon && [:STICKYHOLD, :SUCTIONCUPS].include?($Trainer.first_pokemon.ability_id))
|
||||
biteChance = 20+(25*rodType) # 45, 70, 95
|
||||
biteChance *= 1.5 if speedup # 67.5, 100, 100
|
||||
hookChance = 100
|
||||
oldpattern = $game_player.fullPattern
|
||||
pbFishingBegin
|
||||
msgWindow = pbCreateMessageWindow
|
||||
ret = false
|
||||
loop do
|
||||
time = 5+rand(6)
|
||||
time = [time,5+rand(6)].min if speedup
|
||||
message = ""
|
||||
time.times { message += ". " }
|
||||
if pbWaitMessage(msgWindow,time)
|
||||
pbFishingEnd
|
||||
$game_player.setDefaultCharName(nil,oldpattern)
|
||||
pbMessageDisplay(msgWindow,_INTL("Not even a nibble..."))
|
||||
break
|
||||
end
|
||||
if hasEncounter && rand(100)<biteChance
|
||||
$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
|
||||
$game_player.setDefaultCharName(nil,oldpattern)
|
||||
pbMessageDisplay(msgWindow,_INTL("The Pokémon got away..."))
|
||||
break
|
||||
end
|
||||
if Settings::FISHING_AUTO_HOOK || rand(100) < hookChance
|
||||
pbFishingEnd
|
||||
pbMessageDisplay(msgWindow,_INTL("Landed a Pokémon!")) if !Settings::FISHING_AUTO_HOOK
|
||||
$game_player.setDefaultCharName(nil,oldpattern)
|
||||
ret = true
|
||||
break
|
||||
end
|
||||
# biteChance += 15
|
||||
# hookChance += 15
|
||||
else
|
||||
pbFishingEnd
|
||||
$game_player.setDefaultCharName(nil,oldpattern)
|
||||
pbMessageDisplay(msgWindow,_INTL("Not even a nibble..."))
|
||||
break
|
||||
end
|
||||
end
|
||||
pbDisposeMessageWindow(msgWindow)
|
||||
return ret
|
||||
end
|
||||
|
||||
# Show waiting dots before a Pokémon bites
|
||||
def pbWaitMessage(msgWindow,time)
|
||||
message = ""
|
||||
periodTime = Graphics.frame_rate*4/10 # 0.4 seconds, 16 frames per dot
|
||||
(time+1).times do |i|
|
||||
message += ". " if i>0
|
||||
pbMessageDisplay(msgWindow,message,false)
|
||||
periodTime.times do
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
if Input.trigger?(Input::USE) || Input.trigger?(Input::BACK)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# A Pokémon is biting, reflex test to reel it in
|
||||
def pbWaitForInput(msgWindow,message,frames)
|
||||
pbMessageDisplay(msgWindow,message,false)
|
||||
numFrame = 0
|
||||
twitchFrame = 0
|
||||
twitchFrameTime = Graphics.frame_rate/10 # 0.1 seconds, 4 frames
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
# Twitch cycle: 1,0,1,0,0,0,0,0
|
||||
twitchFrame = (twitchFrame+1)%(twitchFrameTime*8)
|
||||
case twitchFrame%twitchFrameTime
|
||||
when 0, 2
|
||||
$game_player.pattern = 1
|
||||
else
|
||||
$game_player.pattern = 0
|
||||
end
|
||||
if Input.trigger?(Input::USE) || Input.trigger?(Input::BACK)
|
||||
$game_player.pattern = 0
|
||||
return true
|
||||
end
|
||||
break if !Settings::FISHING_AUTO_HOOK && numFrame > frames
|
||||
numFrame += 1
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Bridges, cave escape points, and setting the heal point
|
||||
#===============================================================================
|
||||
@@ -1005,7 +688,7 @@ def pbRegisterPartner(tr_type, tr_name, tr_id = 0)
|
||||
Events.onTrainerPartyLoad.trigger(nil, trainer)
|
||||
for i in trainer.party
|
||||
i.owner = Pokemon::Owner.new_from_trainer(trainer)
|
||||
i.calcStats
|
||||
i.calc_stats
|
||||
end
|
||||
$PokemonGlobal.partner = [tr_type, tr_name, trainer.id, trainer.party]
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
#===============================================================================
|
||||
# Battle start animation
|
||||
# Battle intro animation
|
||||
#===============================================================================
|
||||
def pbSceneStandby
|
||||
$scene.disposeSpritesets if $scene && $scene.is_a?(Scene_Map)
|
||||
@@ -125,6 +125,9 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
|
||||
$game_temp.in_battle = false
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Vs. battle intro animation
|
||||
#===============================================================================
|
||||
def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
|
||||
##### VS. animation, by Luka S.J. #####
|
||||
##### Tweaked by Maruno #####
|
||||
@@ -278,6 +281,9 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
|
||||
return false
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Override battle intro animation
|
||||
#===============================================================================
|
||||
# If you want to add a custom battle intro animation, copy the following alias
|
||||
# line and method into a new script section. Change the name of the alias part
|
||||
# ("__over1__") in your copied code in both places. Then add in your custom
|
||||
@@ -302,412 +308,3 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
|
||||
# animation was NOT shown.
|
||||
return __over1__pbBattleAnimationOverride(viewport,battletype,foe)
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Location signpost
|
||||
#===============================================================================
|
||||
class LocationWindow
|
||||
def initialize(name)
|
||||
@window = Window_AdvancedTextPokemon.new(name)
|
||||
@window.resizeToFit(name,Graphics.width)
|
||||
@window.x = 0
|
||||
@window.y = -@window.height
|
||||
@window.viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
@window.viewport.z = 99999
|
||||
@currentmap = $game_map.map_id
|
||||
@frames = 0
|
||||
end
|
||||
|
||||
def disposed?
|
||||
@window.disposed?
|
||||
end
|
||||
|
||||
def dispose
|
||||
@window.dispose
|
||||
end
|
||||
|
||||
def update
|
||||
return if @window.disposed?
|
||||
@window.update
|
||||
if $game_temp.message_window_showing || @currentmap!=$game_map.map_id
|
||||
@window.dispose
|
||||
return
|
||||
end
|
||||
if @frames > Graphics.frame_rate * 2
|
||||
@window.y -= 4
|
||||
@window.dispose if @window.y+@window.height<0
|
||||
else
|
||||
@window.y += 4 if @window.y<0
|
||||
@frames += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Visibility circle in dark maps
|
||||
#===============================================================================
|
||||
class DarknessSprite < SpriteWrapper
|
||||
attr_reader :radius
|
||||
|
||||
def initialize(viewport=nil)
|
||||
super(viewport)
|
||||
@darkness = BitmapWrapper.new(Graphics.width,Graphics.height)
|
||||
@radius = radiusMin
|
||||
self.bitmap = @darkness
|
||||
self.z = 99998
|
||||
refresh
|
||||
end
|
||||
|
||||
def dispose
|
||||
@darkness.dispose
|
||||
super
|
||||
end
|
||||
|
||||
def radiusMin; return 64; end # Before using Flash
|
||||
def radiusMax; return 176; end # After using Flash
|
||||
|
||||
def radius=(value)
|
||||
@radius = value
|
||||
refresh
|
||||
end
|
||||
|
||||
def refresh
|
||||
@darkness.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0,255))
|
||||
cx = Graphics.width/2
|
||||
cy = Graphics.height/2
|
||||
cradius = @radius
|
||||
numfades = 5
|
||||
for i in 1..numfades
|
||||
for j in cx-cradius..cx+cradius
|
||||
diff2 = (cradius * cradius) - ((j - cx) * (j - cx))
|
||||
diff = Math.sqrt(diff2)
|
||||
@darkness.fill_rect(j,cy-diff,1,diff*2,Color.new(0,0,0,255.0*(numfades-i)/numfades))
|
||||
end
|
||||
cradius = (cradius*0.9).floor
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Lights
|
||||
#===============================================================================
|
||||
class LightEffect
|
||||
def initialize(event,viewport=nil,map=nil,filename=nil)
|
||||
@light = IconSprite.new(0,0,viewport)
|
||||
if filename!=nil && filename!="" && pbResolveBitmap("Graphics/Pictures/"+filename)
|
||||
@light.setBitmap("Graphics/Pictures/"+filename)
|
||||
else
|
||||
@light.setBitmap("Graphics/Pictures/LE")
|
||||
end
|
||||
@light.z = 1000
|
||||
@event = event
|
||||
@map = (map) ? map : $game_map
|
||||
@disposed = false
|
||||
end
|
||||
|
||||
def disposed?
|
||||
return @disposed
|
||||
end
|
||||
|
||||
def dispose
|
||||
@light.dispose
|
||||
@map = nil
|
||||
@event = nil
|
||||
@disposed = true
|
||||
end
|
||||
|
||||
def update
|
||||
@light.update
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class LightEffect_Lamp < LightEffect
|
||||
def initialize(event,viewport=nil,map=nil)
|
||||
lamp = AnimatedBitmap.new("Graphics/Pictures/LE")
|
||||
@light = Sprite.new(viewport)
|
||||
@light.bitmap = Bitmap.new(128,64)
|
||||
src_rect = Rect.new(0, 0, 64, 64)
|
||||
@light.bitmap.blt(0, 0, lamp.bitmap, src_rect)
|
||||
@light.bitmap.blt(20, 0, lamp.bitmap, src_rect)
|
||||
@light.visible = true
|
||||
@light.z = 1000
|
||||
lamp.dispose
|
||||
@map = (map) ? map : $game_map
|
||||
@event = event
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class LightEffect_Basic < LightEffect
|
||||
def update
|
||||
return if !@light || !@event
|
||||
super
|
||||
@light.opacity = 100
|
||||
@light.ox = 32
|
||||
@light.oy = 48
|
||||
if (Object.const_defined?(:ScreenPosHelper) rescue false)
|
||||
@light.x = ScreenPosHelper.pbScreenX(@event)
|
||||
@light.y = ScreenPosHelper.pbScreenY(@event)
|
||||
@light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
|
||||
else
|
||||
@light.x = @event.screen_x
|
||||
@light.y = @event.screen_y
|
||||
@light.zoom_x = 1.0
|
||||
end
|
||||
@light.zoom_y = @light.zoom_x
|
||||
@light.tone = $game_screen.tone
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
class LightEffect_DayNight < LightEffect
|
||||
def update
|
||||
return if !@light || !@event
|
||||
super
|
||||
shade = PBDayNight.getShade
|
||||
if shade>=144 # If light enough, call it fully day
|
||||
shade = 255
|
||||
elsif shade<=64 # If dark enough, call it fully night
|
||||
shade = 0
|
||||
else
|
||||
shade = 255-(255*(144-shade)/(144-64))
|
||||
end
|
||||
@light.opacity = 255-shade
|
||||
if @light.opacity>0
|
||||
@light.ox = 32
|
||||
@light.oy = 48
|
||||
if (Object.const_defined?(:ScreenPosHelper) rescue false)
|
||||
@light.x = ScreenPosHelper.pbScreenX(@event)
|
||||
@light.y = ScreenPosHelper.pbScreenY(@event)
|
||||
@light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
|
||||
@light.zoom_y = ScreenPosHelper.pbScreenZoomY(@event)
|
||||
else
|
||||
@light.x = @event.screen_x
|
||||
@light.y = @event.screen_y
|
||||
@light.zoom_x = 1.0
|
||||
@light.zoom_y = 1.0
|
||||
end
|
||||
@light.tone.set($game_screen.tone.red,
|
||||
$game_screen.tone.green,
|
||||
$game_screen.tone.blue,
|
||||
$game_screen.tone.gray)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
Events.onSpritesetCreate += proc { |_sender,e|
|
||||
spriteset = e[0] # Spriteset being created
|
||||
viewport = e[1] # Viewport used for tilemap and characters
|
||||
map = spriteset.map # Map associated with the spriteset (not necessarily the current map)
|
||||
for i in map.events.keys
|
||||
if map.events[i].name[/^outdoorlight\((\w+)\)$/i]
|
||||
filename = $~[1].to_s
|
||||
spriteset.addUserSprite(LightEffect_DayNight.new(map.events[i],viewport,map,filename))
|
||||
elsif map.events[i].name.downcase=="outdoorlight"
|
||||
spriteset.addUserSprite(LightEffect_DayNight.new(map.events[i],viewport,map))
|
||||
elsif map.events[i].name[/^light\((\w+)\)$/i]
|
||||
filename = $~[1].to_s
|
||||
spriteset.addUserSprite(LightEffect_Basic.new(map.events[i],viewport,map,filename))
|
||||
elsif map.events[i].name.downcase=="light"
|
||||
spriteset.addUserSprite(LightEffect_Basic.new(map.events[i],viewport,map))
|
||||
end
|
||||
end
|
||||
spriteset.addUserSprite(Particle_Engine.new(viewport,map))
|
||||
}
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Entering/exiting cave animations
|
||||
#===============================================================================
|
||||
def pbCaveEntranceEx(exiting)
|
||||
# Create bitmap
|
||||
sprite = BitmapSprite.new(Graphics.width,Graphics.height)
|
||||
sprite.z = 100000
|
||||
# Define values used for the animation
|
||||
totalFrames = (Graphics.frame_rate*0.4).floor
|
||||
increment = (255.0/totalFrames).ceil
|
||||
totalBands = 15
|
||||
bandheight = ((Graphics.height/2.0)-10)/totalBands
|
||||
bandwidth = ((Graphics.width/2.0)-12)/totalBands
|
||||
# Create initial array of band colors (black if exiting, white if entering)
|
||||
grays = Array.new(totalBands) { |i| (exiting) ? 0 : 255 }
|
||||
# Animate bands changing color
|
||||
totalFrames.times do |j|
|
||||
x = 0
|
||||
y = 0
|
||||
# Calculate color of each band
|
||||
for k in 0...totalBands
|
||||
next if k>=totalBands*j/totalFrames
|
||||
inc = increment
|
||||
inc *= -1 if exiting
|
||||
grays[k] -= inc
|
||||
grays[k] = 0 if grays[k]<0
|
||||
end
|
||||
# Draw gray rectangles
|
||||
rectwidth = Graphics.width
|
||||
rectheight = Graphics.height
|
||||
for i in 0...totalBands
|
||||
currentGray = grays[i]
|
||||
sprite.bitmap.fill_rect(Rect.new(x,y,rectwidth,rectheight),
|
||||
Color.new(currentGray,currentGray,currentGray))
|
||||
x += bandwidth
|
||||
y += bandheight
|
||||
rectwidth -= bandwidth*2
|
||||
rectheight -= bandheight*2
|
||||
end
|
||||
Graphics.update
|
||||
Input.update
|
||||
end
|
||||
# Set the tone at end of band animation
|
||||
if exiting
|
||||
pbToneChangeAll(Tone.new(255,255,255),0)
|
||||
else
|
||||
pbToneChangeAll(Tone.new(-255,-255,-255),0)
|
||||
end
|
||||
# Animate fade to white (if exiting) or black (if entering)
|
||||
for j in 0...totalFrames
|
||||
if exiting
|
||||
sprite.color = Color.new(255,255,255,j*increment)
|
||||
else
|
||||
sprite.color = Color.new(0,0,0,j*increment)
|
||||
end
|
||||
Graphics.update
|
||||
Input.update
|
||||
end
|
||||
# Set the tone at end of fading animation
|
||||
pbToneChangeAll(Tone.new(0,0,0),8)
|
||||
# Pause briefly
|
||||
(Graphics.frame_rate/10).times do
|
||||
Graphics.update
|
||||
Input.update
|
||||
end
|
||||
sprite.dispose
|
||||
end
|
||||
|
||||
def pbCaveEntrance
|
||||
pbSetEscapePoint
|
||||
pbCaveEntranceEx(false)
|
||||
end
|
||||
|
||||
def pbCaveExit
|
||||
pbEraseEscapePoint
|
||||
pbCaveEntranceEx(true)
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Blacking out animation
|
||||
#===============================================================================
|
||||
def pbRxdataExists?(file)
|
||||
return pbRgssExists?(file+".rxdata")
|
||||
end
|
||||
|
||||
def pbStartOver(gameover=false)
|
||||
if pbInBugContest?
|
||||
pbBugContestStartOver
|
||||
return
|
||||
end
|
||||
$Trainer.heal_party
|
||||
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."))
|
||||
else
|
||||
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]You scurry back to a Pokémon Center, protecting your exhausted Pokémon from any further harm..."))
|
||||
end
|
||||
pbCancelVehicles
|
||||
pbRemoveDependencies
|
||||
$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
|
||||
$game_temp.player_new_direction = $PokemonGlobal.pokecenterDirection
|
||||
$scene.transfer_player if $scene.is_a?(Scene_Map)
|
||||
$game_map.refresh
|
||||
else
|
||||
homedata = GameData::Metadata.get.home
|
||||
if homedata && !pbRxdataExists?(sprintf("Data/Map%03d",homedata[0]))
|
||||
if $DEBUG
|
||||
pbMessage(_ISPRINTF("Can't find the map 'Map{1:03d}' in the Data folder. The game will resume at the player's position.",homedata[0]))
|
||||
end
|
||||
$Trainer.heal_party
|
||||
return
|
||||
end
|
||||
if gameover
|
||||
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, you scurry back home."))
|
||||
else
|
||||
pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]You scurry back home, protecting your exhausted Pokémon from any further harm..."))
|
||||
end
|
||||
if homedata
|
||||
pbCancelVehicles
|
||||
pbRemoveDependencies
|
||||
$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]
|
||||
$game_temp.player_new_direction = homedata[3]
|
||||
$scene.transfer_player if $scene.is_a?(Scene_Map)
|
||||
$game_map.refresh
|
||||
else
|
||||
$Trainer.heal_party
|
||||
end
|
||||
end
|
||||
pbEraseEscapePoint
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Various other screen effects
|
||||
#===============================================================================
|
||||
def pbToneChangeAll(tone,duration)
|
||||
$game_screen.start_tone_change(tone,duration*Graphics.frame_rate/20)
|
||||
for picture in $game_screen.pictures
|
||||
picture.start_tone_change(tone,duration*Graphics.frame_rate/20) if picture
|
||||
end
|
||||
end
|
||||
|
||||
def pbShake(power,speed,frames)
|
||||
$game_screen.start_shake(power,speed,frames*Graphics.frame_rate/20)
|
||||
end
|
||||
|
||||
def pbFlash(color,frames)
|
||||
$game_screen.start_flash(color,frames*Graphics.frame_rate/20)
|
||||
end
|
||||
|
||||
def pbScrollMap(direction,distance,speed)
|
||||
if speed==0
|
||||
case direction
|
||||
when 2 then $game_map.scroll_down(distance * Game_Map::REAL_RES_Y)
|
||||
when 4 then $game_map.scroll_left(distance * Game_Map::REAL_RES_X)
|
||||
when 6 then $game_map.scroll_right(distance * Game_Map::REAL_RES_X)
|
||||
when 8 then $game_map.scroll_up(distance * Game_Map::REAL_RES_Y)
|
||||
end
|
||||
else
|
||||
$game_map.start_scroll(direction, distance, speed)
|
||||
oldx = $game_map.display_x
|
||||
oldy = $game_map.display_y
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
break if !$game_map.scrolling?
|
||||
pbUpdateSceneMap
|
||||
break if $game_map.display_x==oldx && $game_map.display_y==oldy
|
||||
oldx = $game_map.display_x
|
||||
oldy = $game_map.display_y
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -23,8 +23,8 @@ Events.onWildPokemonCreate += proc { |_sender, e|
|
||||
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.calcStats
|
||||
pokemon.resetMoves
|
||||
pokemon.calc_stats
|
||||
pokemon.reset_moves
|
||||
end
|
||||
}
|
||||
|
||||
138
Data/Scripts/013_Overworld/005_Overworld_Fishing.rb
Normal file
138
Data/Scripts/013_Overworld/005_Overworld_Fishing.rb
Normal file
@@ -0,0 +1,138 @@
|
||||
#===============================================================================
|
||||
# Fishing
|
||||
#===============================================================================
|
||||
def pbFishingBegin
|
||||
$PokemonGlobal.fishing = true
|
||||
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
|
||||
if meta && meta[num] && meta[num]!=""
|
||||
charset = pbGetPlayerCharset(meta,num)
|
||||
4.times do |pattern|
|
||||
$game_player.setDefaultCharName(charset,patternb-pattern,true)
|
||||
(Graphics.frame_rate/20).times do
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def pbFishingEnd
|
||||
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
|
||||
if meta && meta[num] && meta[num]!=""
|
||||
charset = pbGetPlayerCharset(meta,num)
|
||||
4.times do |pattern|
|
||||
$game_player.setDefaultCharName(charset,patternb+pattern,true)
|
||||
(Graphics.frame_rate/20).times do
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
$PokemonGlobal.fishing = false
|
||||
end
|
||||
|
||||
def pbFishing(hasEncounter,rodType=1)
|
||||
speedup = ($Trainer.first_pokemon && [:STICKYHOLD, :SUCTIONCUPS].include?($Trainer.first_pokemon.ability_id))
|
||||
biteChance = 20+(25*rodType) # 45, 70, 95
|
||||
biteChance *= 1.5 if speedup # 67.5, 100, 100
|
||||
hookChance = 100
|
||||
oldpattern = $game_player.fullPattern
|
||||
pbFishingBegin
|
||||
msgWindow = pbCreateMessageWindow
|
||||
ret = false
|
||||
loop do
|
||||
time = 5+rand(6)
|
||||
time = [time,5+rand(6)].min if speedup
|
||||
message = ""
|
||||
time.times { message += ". " }
|
||||
if pbWaitMessage(msgWindow,time)
|
||||
pbFishingEnd
|
||||
$game_player.setDefaultCharName(nil,oldpattern)
|
||||
pbMessageDisplay(msgWindow,_INTL("Not even a nibble..."))
|
||||
break
|
||||
end
|
||||
if hasEncounter && rand(100)<biteChance
|
||||
$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
|
||||
$game_player.setDefaultCharName(nil,oldpattern)
|
||||
pbMessageDisplay(msgWindow,_INTL("The Pokémon got away..."))
|
||||
break
|
||||
end
|
||||
if Settings::FISHING_AUTO_HOOK || rand(100) < hookChance
|
||||
pbFishingEnd
|
||||
pbMessageDisplay(msgWindow,_INTL("Landed a Pokémon!")) if !Settings::FISHING_AUTO_HOOK
|
||||
$game_player.setDefaultCharName(nil,oldpattern)
|
||||
ret = true
|
||||
break
|
||||
end
|
||||
# biteChance += 15
|
||||
# hookChance += 15
|
||||
else
|
||||
pbFishingEnd
|
||||
$game_player.setDefaultCharName(nil,oldpattern)
|
||||
pbMessageDisplay(msgWindow,_INTL("Not even a nibble..."))
|
||||
break
|
||||
end
|
||||
end
|
||||
pbDisposeMessageWindow(msgWindow)
|
||||
return ret
|
||||
end
|
||||
|
||||
# Show waiting dots before a Pokémon bites
|
||||
def pbWaitMessage(msgWindow,time)
|
||||
message = ""
|
||||
periodTime = Graphics.frame_rate*4/10 # 0.4 seconds, 16 frames per dot
|
||||
(time+1).times do |i|
|
||||
message += ". " if i>0
|
||||
pbMessageDisplay(msgWindow,message,false)
|
||||
periodTime.times do
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
if Input.trigger?(Input::USE) || Input.trigger?(Input::BACK)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# A Pokémon is biting, reflex test to reel it in
|
||||
def pbWaitForInput(msgWindow,message,frames)
|
||||
pbMessageDisplay(msgWindow,message,false)
|
||||
numFrame = 0
|
||||
twitchFrame = 0
|
||||
twitchFrameTime = Graphics.frame_rate/10 # 0.1 seconds, 4 frames
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
# Twitch cycle: 1,0,1,0,0,0,0,0
|
||||
twitchFrame = (twitchFrame+1)%(twitchFrameTime*8)
|
||||
case twitchFrame%twitchFrameTime
|
||||
when 0, 2
|
||||
$game_player.pattern = 1
|
||||
else
|
||||
$game_player.pattern = 0
|
||||
end
|
||||
if Input.trigger?(Input::USE) || Input.trigger?(Input::BACK)
|
||||
$game_player.pattern = 0
|
||||
return true
|
||||
end
|
||||
break if !Settings::FISHING_AUTO_HOOK && numFrame > frames
|
||||
numFrame += 1
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -356,7 +356,7 @@ def pbDayCareGenerateEgg
|
||||
egg.happiness = 120
|
||||
egg.iv = ivs
|
||||
egg.moves = finalmoves
|
||||
egg.calcStats
|
||||
egg.calc_stats
|
||||
egg.obtain_text = _INTL("Day-Care Couple")
|
||||
egg.name = _INTL("Egg")
|
||||
egg.steps_to_hatch = egg.species_data.hatch_steps
|
||||
@@ -394,7 +394,7 @@ Events.onStepTaken += proc { |_sender,_e|
|
||||
oldlevel = pkmn.level
|
||||
pkmn.exp += 1 # Gain Exp
|
||||
next if pkmn.level==oldlevel
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
movelist = pkmn.getMoveList
|
||||
for i in movelist
|
||||
pkmn.learn_move(i[1]) if i[0]==pkmn.level # Learned a new move
|
||||
@@ -9,14 +9,6 @@ def pbLoadTrainer(tr_type, tr_name, tr_version = 0)
|
||||
return (trainer_data) ? trainer_data.to_trainer : nil
|
||||
end
|
||||
|
||||
def pbConvertTrainerData
|
||||
tr_type_names = []
|
||||
GameData::TrainerType.each { |t| tr_type_names[t.id_number] = t.real_name }
|
||||
MessageTypes.setMessages(MessageTypes::TrainerTypes, tr_type_names)
|
||||
Compiler.write_trainer_types
|
||||
Compiler.write_trainers
|
||||
end
|
||||
|
||||
def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
|
||||
party = []
|
||||
for i in 0...Settings::MAX_PARTY_SIZE
|
||||
@@ -66,6 +58,14 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
|
||||
return trainer
|
||||
end
|
||||
|
||||
def pbConvertTrainerData
|
||||
tr_type_names = []
|
||||
GameData::TrainerType.each { |t| tr_type_names[t.id_number] = t.real_name }
|
||||
MessageTypes.setMessages(MessageTypes::TrainerTypes, tr_type_names)
|
||||
Compiler.write_trainer_types
|
||||
Compiler.write_trainers
|
||||
end
|
||||
|
||||
def pbTrainerTypeCheck(trainer_type)
|
||||
return true if !$DEBUG
|
||||
return true if GameData::TrainerType.exists?(trainer_type)
|
||||
@@ -76,16 +76,6 @@ def pbTrainerTypeCheck(trainer_type)
|
||||
return false
|
||||
end
|
||||
|
||||
def pbGetFreeTrainerParty(tr_type, tr_name)
|
||||
tr_type_data = GameData::TrainerType.try_get(tr_type)
|
||||
raise _INTL("Trainer type {1} does not exist.", tr_type) if !tr_type_data
|
||||
tr_type = tr_type_data.id
|
||||
for i in 0...256
|
||||
return i if !GameData::Trainer.try_get(tr_type, tr_name, i)
|
||||
end
|
||||
return -1
|
||||
end
|
||||
|
||||
# Called from trainer events to ensure the trainer exists
|
||||
def pbTrainerCheck(tr_type, tr_name, max_battles, tr_version = 0)
|
||||
return true if !$DEBUG
|
||||
@@ -104,6 +94,16 @@ def pbTrainerCheck(tr_type, tr_name, max_battles, tr_version = 0)
|
||||
return true
|
||||
end
|
||||
|
||||
def pbGetFreeTrainerParty(tr_type, tr_name)
|
||||
tr_type_data = GameData::TrainerType.try_get(tr_type)
|
||||
raise _INTL("Trainer type {1} does not exist.", tr_type) if !tr_type_data
|
||||
tr_type = tr_type_data.id
|
||||
for i in 0...256
|
||||
return i if !GameData::Trainer.try_get(tr_type, tr_name, i)
|
||||
end
|
||||
return -1
|
||||
end
|
||||
|
||||
def pbMissingTrainer(tr_type, tr_name, tr_version)
|
||||
tr_type_data = GameData::TrainerType.try_get(tr_type)
|
||||
raise _INTL("Trainer type {1} does not exist.", tr_type) if !tr_type_data
|
||||
@@ -121,71 +121,3 @@ def pbMissingTrainer(tr_type, tr_name, tr_version)
|
||||
pbNewTrainer(tr_type, tr_name, tr_version) if cmd == 0
|
||||
return cmd
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Walking charset, for use in text entry screens and load game screen
|
||||
#===============================================================================
|
||||
class TrainerWalkingCharSprite < SpriteWrapper
|
||||
def initialize(charset,viewport=nil)
|
||||
super(viewport)
|
||||
@animbitmap = nil
|
||||
self.charset = charset
|
||||
@animframe = 0 # Current pattern
|
||||
@frame = 0 # Frame counter
|
||||
self.animspeed = 5 # Animation speed (frames per pattern)
|
||||
end
|
||||
|
||||
def charset=(value)
|
||||
@animbitmap.dispose if @animbitmap
|
||||
@animbitmap = nil
|
||||
bitmapFileName = sprintf("Graphics/Characters/%s",value)
|
||||
@charset = pbResolveBitmap(bitmapFileName)
|
||||
if @charset
|
||||
@animbitmap = AnimatedBitmap.new(@charset)
|
||||
self.bitmap = @animbitmap.bitmap
|
||||
self.src_rect.set(0,0,self.bitmap.width/4,self.bitmap.height/4)
|
||||
else
|
||||
self.bitmap = nil
|
||||
end
|
||||
end
|
||||
|
||||
def altcharset=(value) # Used for box icon in the naming screen
|
||||
@animbitmap.dispose if @animbitmap
|
||||
@animbitmap = nil
|
||||
@charset = pbResolveBitmap(value)
|
||||
if @charset
|
||||
@animbitmap = AnimatedBitmap.new(@charset)
|
||||
self.bitmap = @animbitmap.bitmap
|
||||
self.src_rect.set(0,0,self.bitmap.width/4,self.bitmap.height)
|
||||
else
|
||||
self.bitmap = nil
|
||||
end
|
||||
end
|
||||
|
||||
def animspeed=(value)
|
||||
@frameskip = value*Graphics.frame_rate/40
|
||||
end
|
||||
|
||||
def dispose
|
||||
@animbitmap.dispose if @animbitmap
|
||||
super
|
||||
end
|
||||
|
||||
def update
|
||||
@updating = true
|
||||
super
|
||||
if @animbitmap
|
||||
@animbitmap.update
|
||||
self.bitmap = @animbitmap.bitmap
|
||||
end
|
||||
@frame += 1
|
||||
if @frame>=@frameskip
|
||||
@animframe = (@animframe+1)%4
|
||||
self.src_rect.x = @animframe*@animbitmap.bitmap.width/4
|
||||
@frame -= @frameskip
|
||||
end
|
||||
@updating = false
|
||||
end
|
||||
end
|
||||
65
Data/Scripts/014_Trainers/004_Trainer_sprite.rb
Normal file
65
Data/Scripts/014_Trainers/004_Trainer_sprite.rb
Normal file
@@ -0,0 +1,65 @@
|
||||
#===============================================================================
|
||||
# Walking charset, for use in text entry screens and load game screen
|
||||
#===============================================================================
|
||||
class TrainerWalkingCharSprite < SpriteWrapper
|
||||
def initialize(charset,viewport=nil)
|
||||
super(viewport)
|
||||
@animbitmap = nil
|
||||
self.charset = charset
|
||||
@animframe = 0 # Current pattern
|
||||
@frame = 0 # Frame counter
|
||||
self.animspeed = 5 # Animation speed (frames per pattern)
|
||||
end
|
||||
|
||||
def charset=(value)
|
||||
@animbitmap.dispose if @animbitmap
|
||||
@animbitmap = nil
|
||||
bitmapFileName = sprintf("Graphics/Characters/%s",value)
|
||||
@charset = pbResolveBitmap(bitmapFileName)
|
||||
if @charset
|
||||
@animbitmap = AnimatedBitmap.new(@charset)
|
||||
self.bitmap = @animbitmap.bitmap
|
||||
self.src_rect.set(0,0,self.bitmap.width/4,self.bitmap.height/4)
|
||||
else
|
||||
self.bitmap = nil
|
||||
end
|
||||
end
|
||||
|
||||
def altcharset=(value) # Used for box icon in the naming screen
|
||||
@animbitmap.dispose if @animbitmap
|
||||
@animbitmap = nil
|
||||
@charset = pbResolveBitmap(value)
|
||||
if @charset
|
||||
@animbitmap = AnimatedBitmap.new(@charset)
|
||||
self.bitmap = @animbitmap.bitmap
|
||||
self.src_rect.set(0,0,self.bitmap.width/4,self.bitmap.height)
|
||||
else
|
||||
self.bitmap = nil
|
||||
end
|
||||
end
|
||||
|
||||
def animspeed=(value)
|
||||
@frameskip = value*Graphics.frame_rate/40
|
||||
end
|
||||
|
||||
def dispose
|
||||
@animbitmap.dispose if @animbitmap
|
||||
super
|
||||
end
|
||||
|
||||
def update
|
||||
@updating = true
|
||||
super
|
||||
if @animbitmap
|
||||
@animbitmap.update
|
||||
self.bitmap = @animbitmap.bitmap
|
||||
end
|
||||
@frame += 1
|
||||
if @frame>=@frameskip
|
||||
@animframe = (@animframe+1)%4
|
||||
self.src_rect.x = @animframe*@animbitmap.bitmap.width/4
|
||||
@frame -= @frameskip
|
||||
end
|
||||
@updating = false
|
||||
end
|
||||
end
|
||||
@@ -129,7 +129,7 @@ def pbChangeLevel(pkmn,newlevel,scene)
|
||||
spdefdiff = pkmn.spdef
|
||||
totalhpdiff = pkmn.totalhp
|
||||
pkmn.level = newlevel
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
scene.pbRefresh
|
||||
pbMessage(_INTL("{1} dropped to Lv. {2}!",pkmn.name,pkmn.level))
|
||||
attackdiff = pkmn.attack-attackdiff
|
||||
@@ -151,7 +151,7 @@ def pbChangeLevel(pkmn,newlevel,scene)
|
||||
totalhpdiff = pkmn.totalhp
|
||||
pkmn.level = newlevel
|
||||
pkmn.changeHappiness("vitamin")
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
scene.pbRefresh
|
||||
if scene.is_a?(PokemonPartyScreen)
|
||||
scene.pbDisplay(_INTL("{1} grew to Lv. {2}!",pkmn.name,pkmn.level))
|
||||
@@ -272,7 +272,7 @@ def pbJustRaiseEffortValues(pkmn, stat, evGain)
|
||||
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
|
||||
if evGain > 0
|
||||
pkmn.ev[stat] += evGain
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
end
|
||||
return evGain
|
||||
end
|
||||
@@ -287,7 +287,7 @@ def pbRaiseEffortValues(pkmn, stat, evGain = 10, ev_limit = true)
|
||||
evGain = evGain.clamp(0, Pokemon::EV_LIMIT - evTotal)
|
||||
if evGain > 0
|
||||
pkmn.ev[stat] += evGain
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
end
|
||||
return evGain
|
||||
end
|
||||
@@ -305,7 +305,7 @@ def pbRaiseHappinessAndLowerEV(pkmn,scene,stat,messages)
|
||||
if e
|
||||
pkmn.ev[stat] -= 10
|
||||
pkmn.ev[stat] = 0 if pkmn.ev[stat]<0
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
end
|
||||
scene.pbRefresh
|
||||
scene.pbDisplay(messages[2-(h ? 0 : 2)-(e ? 0 : 1)])
|
||||
|
||||
@@ -43,7 +43,7 @@ def pbPurify(pkmn, scene)
|
||||
end
|
||||
if newlevel == curlevel
|
||||
pkmn.exp = newexp
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
else
|
||||
pbChangeLevel(pkmn, newlevel, scene) # for convenience
|
||||
pkmn.exp = newexp
|
||||
|
||||
@@ -110,7 +110,7 @@ class Pokemon
|
||||
@forced_form = nil
|
||||
@level = nil # In case growth rate is different for the new species
|
||||
@ability = nil
|
||||
calcStats
|
||||
calc_stats
|
||||
end
|
||||
|
||||
# @param check_species [Integer, Symbol, String] id of the species to check for
|
||||
@@ -138,7 +138,7 @@ class Pokemon
|
||||
@ability = nil
|
||||
yield if block_given?
|
||||
MultipleForms.call("onSetForm", self, value, oldForm)
|
||||
calcStats
|
||||
calc_stats
|
||||
pbSeenForm(self)
|
||||
end
|
||||
|
||||
@@ -148,7 +148,7 @@ class Pokemon
|
||||
|
||||
def form_simple=(value)
|
||||
@form = value
|
||||
calcStats
|
||||
calc_stats
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -220,6 +220,7 @@ class Pokemon
|
||||
# Sets this Pokémon's status. See {GameData::Status} for all possible status effects.
|
||||
# @param value [Integer, Symbol, String] status to set
|
||||
def status=(value)
|
||||
return if !able?
|
||||
new_status = GameData::Status.try_get(value)
|
||||
if !new_status
|
||||
raise ArgumentError, _INTL('Attempted to set {1} as Pokémon status', value.class.name)
|
||||
@@ -454,7 +455,7 @@ class Pokemon
|
||||
def nature=(value)
|
||||
return if value && !GameData::Nature.exists?(value)
|
||||
@nature = (value) ? GameData::Nature.get(value).id : value
|
||||
calcStats if !@nature_for_stats
|
||||
calc_stats if !@nature_for_stats
|
||||
end
|
||||
|
||||
# Returns the calculated nature, taking into account things that change its
|
||||
@@ -474,7 +475,7 @@ class Pokemon
|
||||
def nature_for_stats=(value)
|
||||
return if value && !GameData::Nature.exists?(value)
|
||||
@nature_for_stats = (value) ? GameData::Nature.get(value).id : value
|
||||
calcStats
|
||||
calc_stats
|
||||
end
|
||||
|
||||
# Returns whether this Pokémon has a particular nature. If no value is given,
|
||||
@@ -565,7 +566,7 @@ class Pokemon
|
||||
end
|
||||
|
||||
# Sets this Pokémon's movelist to the default movelist it originally had.
|
||||
def resetMoves
|
||||
def reset_moves
|
||||
this_level = self.level
|
||||
# Find all level-up moves that self could have learned
|
||||
moveset = self.getMoveList
|
||||
@@ -987,7 +988,7 @@ class Pokemon
|
||||
end
|
||||
|
||||
# Recalculates this Pokémon's stats.
|
||||
def calcStats
|
||||
def calc_stats
|
||||
base_stats = self.baseStats
|
||||
this_level = self.level
|
||||
this_IV = self.calcIV
|
||||
@@ -1065,7 +1066,7 @@ class Pokemon
|
||||
@item = nil
|
||||
@mail = nil
|
||||
@moves = []
|
||||
resetMoves if withMoves
|
||||
reset_moves if withMoves
|
||||
@first_moves = []
|
||||
@ribbons = []
|
||||
@cool = 0
|
||||
@@ -1105,12 +1106,12 @@ class Pokemon
|
||||
@personalID = rand(2 ** 16) | rand(2 ** 16) << 16
|
||||
@hp = 1
|
||||
@totalhp = 1
|
||||
calcStats
|
||||
calc_stats
|
||||
if @form == 0 && recheck_form
|
||||
f = MultipleForms.call("getFormOnCreation", self)
|
||||
if f
|
||||
self.form = f
|
||||
resetMoves if withMoves
|
||||
reset_moves if withMoves
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -174,6 +174,7 @@ class Pokemon
|
||||
deprecated_method_alias :setItem, :item=, removal_in: 'v20'
|
||||
|
||||
deprecated_method_alias :healStatus, :heal_status, removal_in: 'v20'
|
||||
deprecated_method_alias :resetMoves, :reset_moves, removal_in: 'v20'
|
||||
deprecated_method_alias :pbLearnMove, :learn_move, removal_in: 'v20'
|
||||
deprecated_method_alias :pbDeleteMove, :forget_move, removal_in: 'v20'
|
||||
deprecated_method_alias :pbDeleteMoveAtIndex, :forget_move_at_index, removal_in: 'v20'
|
||||
@@ -182,6 +183,7 @@ class Pokemon
|
||||
deprecated_method_alias :pbRemoveFirstMove, :remove_first_move, removal_in: 'v20'
|
||||
deprecated_method_alias :pbClearFirstMoves, :clear_first_moves, removal_in: 'v20'
|
||||
deprecated_method_alias :pbUpdateShadowMoves, :update_shadow_moves, removal_in: 'v20'
|
||||
deprecated_method_alias :calcStats, :calc_stats, removal_in: 'v20'
|
||||
end
|
||||
|
||||
# (see Pokemon#initialize)
|
||||
|
||||
@@ -121,14 +121,14 @@ end
|
||||
|
||||
|
||||
class Scene_Intro
|
||||
def initialize(pics, splash = nil)
|
||||
@pics = pics
|
||||
@splash = splash
|
||||
end
|
||||
# Splash screen images that appear for a few seconds and then disappear.
|
||||
INTRO_SPLASHES = ['intro1']
|
||||
# The main title screen background image.
|
||||
TITLE_SCREEN = 'splash'
|
||||
|
||||
def main
|
||||
Graphics.transition(0)
|
||||
@eventscene = IntroEventScene.new(@pics,@splash)
|
||||
@eventscene = IntroEventScene.new(INTRO_SPLASHES, TITLE_SCREEN)
|
||||
@eventscene.main
|
||||
Graphics.freeze
|
||||
end
|
||||
@@ -58,6 +58,7 @@ Your credits go here.
|
||||
Your credits go here.
|
||||
|
||||
{INSERTS_PLUGIN_CREDITS_DO_NOT_REMOVE}
|
||||
|
||||
"Pokémon Essentials" was created by:
|
||||
Flameguru
|
||||
Poccil (Peter O.)
|
||||
@@ -70,15 +71,13 @@ Brother1440<s>Near Fantastica
|
||||
FL.<s>PinkMan
|
||||
Genzai Kawakami<s>Popper
|
||||
help-14<s>Rataime
|
||||
IceGod64<s>SoundSpawn
|
||||
Jacob O. Wobbrock<s>the__end
|
||||
KitsuneKouta<s>Venom12
|
||||
Lisa Anthony<s>Wachunga
|
||||
Luka S.J.<s>
|
||||
IceGod64<s>Savordez
|
||||
Jacob O. Wobbrock<s>SoundSpawn
|
||||
KitsuneKouta<s>the__end
|
||||
Lisa Anthony<s>Venom12
|
||||
Luka S.J.<s>Wachunga
|
||||
and everyone else who helped out
|
||||
|
||||
|
||||
|
||||
"mkxp-z" by:
|
||||
Roza
|
||||
Based on MKXP by Ancurio et al.
|
||||
@@ -586,7 +586,7 @@ class PokemonEvolutionScene
|
||||
# Modify Pokémon to make it evolved
|
||||
@pokemon.species = @newspecies
|
||||
@pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM)
|
||||
@pokemon.calcStats
|
||||
@pokemon.calc_stats
|
||||
# See and own evolved species
|
||||
$Trainer.set_seen(@newspecies)
|
||||
$Trainer.set_owned(@newspecies)
|
||||
@@ -611,7 +611,7 @@ class PokemonEvolutionScene
|
||||
new_pkmn.poke_ball = :POKEBALL
|
||||
new_pkmn.item = nil
|
||||
new_pkmn.clearAllRibbons
|
||||
new_pkmn.calcStats
|
||||
new_pkmn.calc_stats
|
||||
new_pkmn.heal
|
||||
# Add duplicate Pokémon to party
|
||||
$Trainer.party.push(new_pkmn)
|
||||
@@ -226,7 +226,7 @@ def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
||||
end
|
||||
yourPokemon.name = nickname
|
||||
yourPokemon.obtain_method = 2 # traded
|
||||
yourPokemon.resetMoves if resetmoves
|
||||
yourPokemon.reset_moves if resetmoves
|
||||
yourPokemon.record_first_moves
|
||||
$Trainer.set_seen(yourPokemon.species)
|
||||
$Trainer.set_owned(yourPokemon.species)
|
||||
@@ -374,7 +374,7 @@ def pbReceiveMysteryGift(id)
|
||||
gift=$Trainer.mystery_gifts[index]
|
||||
if gift[1]==0 # Pokémon
|
||||
gift[2].personalID = rand(2**16) | rand(2**16) << 16
|
||||
gift[2].calcStats
|
||||
gift[2].calc_stats
|
||||
time=pbGetTimeNow
|
||||
gift[2].timeReceived=time.getgm.to_i
|
||||
gift[2].obtain_method = 4 # Fateful encounter
|
||||
@@ -166,7 +166,7 @@ class PBPokemon
|
||||
ev.each { |stat| pokemon.ev[stat] = Pokemon::EV_LIMIT / ev.length }
|
||||
end
|
||||
GameData::Stat.each_main { |s| pokemon.iv[s.id] = iv }
|
||||
pokemon.calcStats
|
||||
pokemon.calc_stats
|
||||
return pokemon
|
||||
end
|
||||
end
|
||||
|
||||
@@ -60,14 +60,14 @@ class LevelAdjustment
|
||||
exp=adjustments[0][i]
|
||||
if exp && team1[i].exp!=exp
|
||||
team1[i].exp=exp
|
||||
team1[i].calcStats
|
||||
team1[i].calc_stats
|
||||
end
|
||||
end
|
||||
for i in 0...team2.length
|
||||
exp=adjustments[1][i]
|
||||
if exp && team2[i].exp!=exp
|
||||
team2[i].exp=exp
|
||||
team2[i].calcStats
|
||||
team2[i].calc_stats
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -90,7 +90,7 @@ class LevelAdjustment
|
||||
for i in 0...team1.length
|
||||
if team1[i].level!=adj1[i]
|
||||
team1[i].level=adj1[i]
|
||||
team1[i].calcStats
|
||||
team1[i].calc_stats
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -98,7 +98,7 @@ class LevelAdjustment
|
||||
for i in 0...team2.length
|
||||
if team2[i].level!=adj2[i]
|
||||
team2[i].level=adj2[i]
|
||||
team2[i].calcStats
|
||||
team2[i].calc_stats
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -849,7 +849,7 @@ def pbRuledBattle(team1,team2,rule)
|
||||
next if !p
|
||||
if p.level!=level
|
||||
p.level=level
|
||||
p.calcStats
|
||||
p.calc_stats
|
||||
end
|
||||
items1[i]=p.item_id
|
||||
trainer1.party.push(p)
|
||||
@@ -858,7 +858,7 @@ def pbRuledBattle(team1,team2,rule)
|
||||
next if !p
|
||||
if p.level!=level
|
||||
p.level=level
|
||||
p.calcStats
|
||||
p.calc_stats
|
||||
end
|
||||
items2[i]=p.item_id
|
||||
trainer2.party.push(p)
|
||||
|
||||
@@ -124,7 +124,7 @@ def pbAddForeignPokemon(pkmn, level = 1, owner_name = nil, nickname = nil, owner
|
||||
# Set nickname
|
||||
pkmn.name = nickname[0, Pokemon::MAX_NAME_SIZE]
|
||||
# Recalculate stats
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
if owner_name
|
||||
pbMessage(_INTL("\\me[Pkmn get]{1} received a Pokémon from {2}.\1", $Trainer.name, owner_name))
|
||||
else
|
||||
@@ -144,7 +144,7 @@ def pbGenerateEgg(pkmn, text = "")
|
||||
pkmn.name = _INTL("Egg")
|
||||
pkmn.steps_to_hatch = pkmn.species_data.hatch_steps
|
||||
pkmn.obtain_text = text
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
# Add egg to party
|
||||
$Trainer.party[$Trainer.party.length] = pkmn
|
||||
return true
|
||||
|
||||
@@ -208,7 +208,7 @@ PokemonDebugMenuCommands.register("setlevel", {
|
||||
_INTL("Set the Pokémon's level (max. {1}).", params.maxNumber), params) { screen.pbUpdate }
|
||||
if level != pkmn.level
|
||||
pkmn.level = level
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
screen.pbRefreshSingle(pkmnid)
|
||||
end
|
||||
end
|
||||
@@ -236,7 +236,7 @@ PokemonDebugMenuCommands.register("setexp", {
|
||||
_INTL("Set the Pokémon's Exp (range {1}-{2}).", minxp, maxxp - 1), params) { screen.pbUpdate }
|
||||
if newexp != pkmn.exp
|
||||
pkmn.exp = newexp
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
screen.pbRefreshSingle(pkmnid)
|
||||
end
|
||||
end
|
||||
@@ -290,7 +290,7 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
|
||||
GameData::Stat.get(ev_id[cmd2]).name, upperLimit), params) { screen.pbUpdate }
|
||||
if f != pkmn.ev[ev_id[cmd2]]
|
||||
pkmn.ev[ev_id[cmd2]] = f
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
screen.pbRefreshSingle(pkmnid)
|
||||
end
|
||||
else # (Max) Randomise all
|
||||
@@ -309,7 +309,7 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
|
||||
pkmn.ev[ev_id[r]] += addVal
|
||||
evTotalTarget -= addVal
|
||||
end
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
screen.pbRefreshSingle(pkmnid)
|
||||
end
|
||||
end
|
||||
@@ -340,18 +340,18 @@ PokemonDebugMenuCommands.register("hiddenvalues", {
|
||||
GameData::Stat.get(iv_id[cmd2]).name), params) { screen.pbUpdate }
|
||||
if f != pkmn.iv[iv_id[cmd2]]
|
||||
pkmn.iv[iv_id[cmd2]] = f
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
screen.pbRefreshSingle(pkmnid)
|
||||
end
|
||||
else # Randomise all
|
||||
GameData::Stat.each_main { |s| pkmn.iv[s.id] = rand(Pokemon::IV_STAT_LIMIT + 1) }
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
screen.pbRefreshSingle(pkmnid)
|
||||
end
|
||||
end
|
||||
when 2 # Randomise pID
|
||||
pkmn.personalID = rand(2 ** 16) | rand(2 ** 16) << 16
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
screen.pbRefreshSingle(pkmnid)
|
||||
end
|
||||
end
|
||||
@@ -535,7 +535,7 @@ PokemonDebugMenuCommands.register("resetmoves", {
|
||||
"name" => _INTL("Reset moves"),
|
||||
"always_show" => true,
|
||||
"effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen|
|
||||
pkmn.resetMoves
|
||||
pkmn.reset_moves
|
||||
screen.pbDisplay(_INTL("{1}'s moves were reset.", pkmn.name))
|
||||
screen.pbRefreshSingle(pkmnid)
|
||||
next false
|
||||
@@ -748,7 +748,7 @@ PokemonDebugMenuCommands.register("speciesform", {
|
||||
species = pbChooseSpeciesList(pkmn.species)
|
||||
if species && species != pkmn.species
|
||||
pkmn.species = species
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
pbSeenForm(pkmn) if !settingUpBattle
|
||||
screen.pbRefreshSingle(pkmnid)
|
||||
end
|
||||
@@ -984,7 +984,7 @@ PokemonDebugMenuCommands.register("setegg", {
|
||||
if !pkmn.egg? && (pbHasEgg?(pkmn.species) ||
|
||||
screen.pbConfirm(_INTL("{1} cannot legally be an egg. Make egg anyway?", pkmn.speciesName)))
|
||||
pkmn.level = Settings::EGG_LEVEL
|
||||
pkmn.calcStats
|
||||
pkmn.calc_stats
|
||||
pkmn.name = _INTL("Egg")
|
||||
pkmn.steps_to_hatch = pkmn.species_data.hatch_steps
|
||||
pkmn.hatched_map = 0
|
||||
|
||||
@@ -10,10 +10,7 @@ end
|
||||
|
||||
def pbCallTitle
|
||||
return Scene_DebugIntro.new if $DEBUG
|
||||
# First parameter is an array of images in the Titles directory without a file
|
||||
# extension, to show before the actual title screen. Second parameter is the
|
||||
# actual title screen filename, also in Titles with no extension.
|
||||
return Scene_Intro.new(['intro1'], 'splash')
|
||||
return Scene_Intro.new
|
||||
end
|
||||
|
||||
def mainFunction
|
||||
|
||||
56
mkxp.json
56
mkxp.json
@@ -20,21 +20,6 @@
|
||||
//
|
||||
// "rgssVersion": 1,
|
||||
|
||||
|
||||
// Request an OpenGL 4.1 context. This
|
||||
// introduces these minimum requirements
|
||||
// for GPUs:
|
||||
//
|
||||
// + NVIDIA 400 Series+
|
||||
// + AMD Radeon HD 5000+
|
||||
// + Intel HD Graphics 4000+
|
||||
//
|
||||
// If disabled, OpenGL 3.3 is used instead.
|
||||
// (default: disabled)
|
||||
//
|
||||
// "openGL4": false,
|
||||
|
||||
|
||||
// Create a debug context and log
|
||||
// OpenGL debug information to the console
|
||||
// (default: disabled)
|
||||
@@ -172,7 +157,7 @@
|
||||
// Set the base path of the game to '/path/to/game'
|
||||
// (default: executable directory)
|
||||
//
|
||||
// "gameFolder": "/path/to/game",
|
||||
// "gameFolder": ".",
|
||||
|
||||
|
||||
// Use either right or left Alt + Enter to toggle
|
||||
@@ -188,12 +173,6 @@
|
||||
// "enableReset": true,
|
||||
|
||||
|
||||
// Allow symlinks for game assets to be followed
|
||||
// (default: disabled)
|
||||
//
|
||||
// "allowSymlinks": false,
|
||||
|
||||
|
||||
// Names of the input buttons in the F1 key bindings
|
||||
// window. This only affects the names displayed
|
||||
// there, and won't enable those names as Input
|
||||
@@ -202,6 +181,13 @@
|
||||
"b": "Back",
|
||||
"a": "Special"},
|
||||
|
||||
|
||||
// Allow symlinks for game assets to be followed
|
||||
// (default: disabled)
|
||||
//
|
||||
// "allowSymlinks": false,
|
||||
|
||||
|
||||
// Organisation / company and application / game
|
||||
// name to build the directory path where mkxp
|
||||
// will store game specific data (eg. key bindings).
|
||||
@@ -307,6 +293,32 @@
|
||||
// "rubyLoadpath": ["/usr/lib64/ruby/",
|
||||
// "/usr/local/share/ruby/site_ruby"],
|
||||
|
||||
// Determines whether JIT is enabled. This probably
|
||||
// won't work unless you also have the header file
|
||||
// that it needs. Only works with Ruby 2.6 or higher.
|
||||
// (default: false)
|
||||
//
|
||||
// "JITEnable": false,
|
||||
|
||||
// Determines what level of verbosity to use when
|
||||
// logging JIT events. Starts at 0, which is next
|
||||
// to nothing. Set it higher to see more.
|
||||
// (default: 0)
|
||||
//
|
||||
// "JITVerboseLevel": 0,
|
||||
|
||||
// Determines how many compiled methods that Ruby
|
||||
// will keep in its cache.
|
||||
// (default: 100)
|
||||
//
|
||||
// "JITMaxCache": 100,
|
||||
|
||||
// Determines how many times a function has to be
|
||||
// called before it is compiled.
|
||||
// (default: 10000)
|
||||
//
|
||||
// "JITMinCalls": 10000,
|
||||
|
||||
|
||||
// SoundFont to use for midi playback (via fluidsynth)
|
||||
// (default: none)
|
||||
|
||||
Reference in New Issue
Block a user