mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-06-15 00:04:12 +00:00
More tweaks from the Rubocop overlord
This commit is contained in:
@@ -17,9 +17,10 @@ def pbGetExceptionMessage(e, _script = "")
|
||||
return e.event_message.dup if e.is_a?(EventScriptError) # Message with map/event ID generated elsewhere
|
||||
emessage = e.message.dup
|
||||
emessage.force_encoding(Encoding::UTF_8)
|
||||
if e.is_a?(Hangup)
|
||||
case e
|
||||
when Hangup
|
||||
emessage = "The script is taking too long. The game will restart."
|
||||
elsif e.is_a?(Errno::ENOENT)
|
||||
when Errno::ENOENT
|
||||
filename = emessage.sub("No such file or directory - ", "")
|
||||
emessage = "File #{filename} not found."
|
||||
end
|
||||
|
||||
@@ -67,7 +67,7 @@ module FileInputMixin
|
||||
self.pos = 0
|
||||
offset = fgetdw >> 3
|
||||
return 0 if index >= offset
|
||||
self.pos = index * 8 + 4
|
||||
self.pos = (index * 8) + 4
|
||||
return fgetdw
|
||||
end
|
||||
|
||||
|
||||
@@ -412,7 +412,8 @@ class Messages
|
||||
|
||||
def self.writeObject(f, msgs, secname, origMessages = nil)
|
||||
return if !msgs
|
||||
if msgs.is_a?(Array)
|
||||
case msgs
|
||||
when Array
|
||||
f.write("[#{secname}]\r\n")
|
||||
for j in 0...msgs.length
|
||||
next if nil_or_empty?(msgs[j])
|
||||
@@ -427,7 +428,7 @@ class Messages
|
||||
f.write(origValue + "\r\n")
|
||||
f.write(value + "\r\n")
|
||||
end
|
||||
elsif msgs.is_a?(OrderedHash)
|
||||
when OrderedHash
|
||||
f.write("[#{secname}]\r\n")
|
||||
keys = msgs.keys
|
||||
for key in keys
|
||||
|
||||
@@ -212,11 +212,12 @@ module PluginManager
|
||||
dependencies = value
|
||||
dependencies = [dependencies] if !dependencies.is_a?(Array) || !dependencies[0].is_a?(Array)
|
||||
for dep in value
|
||||
if dep.is_a?(String) # "plugin name"
|
||||
case dep
|
||||
when String # "plugin name"
|
||||
if !self.installed?(dep)
|
||||
self.error("Plugin '#{name}' requires plugin '#{dep}' to be installed above it.")
|
||||
end
|
||||
elsif dep.is_a?(Array)
|
||||
when Array
|
||||
case dep.size
|
||||
when 1 # ["plugin name"]
|
||||
if dep[0].is_a?(String)
|
||||
@@ -428,8 +429,8 @@ module PluginManager
|
||||
return 1 if !c2
|
||||
return 1 if c1.to_i(16) > c2.to_i(16)
|
||||
return -1 if c1.to_i(16) < c2.to_i(16)
|
||||
else
|
||||
return -1 if c2
|
||||
elsif c2
|
||||
return -1
|
||||
end
|
||||
end
|
||||
return 0
|
||||
|
||||
@@ -7,7 +7,7 @@ class SpriteAnimation
|
||||
end
|
||||
|
||||
%w[
|
||||
x y ox oy viewport flash src_rect opacity tone
|
||||
x y ox oy viewport flash src_rect opacity tone
|
||||
].each_with_index do |s, _i|
|
||||
eval <<-__END__
|
||||
|
||||
@@ -187,7 +187,7 @@ class SpriteAnimation
|
||||
sprite_y = self.viewport.rect.height - 160
|
||||
end
|
||||
else
|
||||
sprite_x = self.x - self.ox + self.src_rect.width / 2
|
||||
sprite_x = self.x - self.ox + (self.src_rect.width / 2)
|
||||
sprite_y = self.y - self.oy
|
||||
sprite_y += self.src_rect.height / 2 if position == 1
|
||||
sprite_y += self.src_rect.height if position == 2
|
||||
@@ -370,7 +370,7 @@ module RPG
|
||||
@_damage_sprite.ox = 80
|
||||
@_damage_sprite.oy = 20
|
||||
@_damage_sprite.x = self.x
|
||||
@_damage_sprite.y = self.y - self.oy / 2
|
||||
@_damage_sprite.y = self.y - (self.oy / 2)
|
||||
@_damage_sprite.z = 3000
|
||||
@_damage_duration = 40
|
||||
end
|
||||
@@ -450,7 +450,7 @@ module RPG
|
||||
super
|
||||
if @_whiten_duration > 0
|
||||
@_whiten_duration -= 1
|
||||
self.color.alpha = 128 - (16 - @_whiten_duration) * 10
|
||||
self.color.alpha = 128 - ((16 - @_whiten_duration) * 10)
|
||||
end
|
||||
if @_appear_duration > 0
|
||||
@_appear_duration -= 1
|
||||
@@ -458,11 +458,11 @@ module RPG
|
||||
end
|
||||
if @_escape_duration > 0
|
||||
@_escape_duration -= 1
|
||||
self.opacity = 256 - (32 - @_escape_duration) * 10
|
||||
self.opacity = 256 - ((32 - @_escape_duration) * 10)
|
||||
end
|
||||
if @_collapse_duration > 0
|
||||
@_collapse_duration -= 1
|
||||
self.opacity = 256 - (48 - @_collapse_duration) * 6
|
||||
self.opacity = 256 - ((48 - @_collapse_duration) * 6)
|
||||
end
|
||||
if @_damage_duration > 0
|
||||
@_damage_duration -= 1
|
||||
@@ -476,7 +476,7 @@ module RPG
|
||||
when 28..33
|
||||
@_damage_sprite.y += 4
|
||||
end
|
||||
@_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
|
||||
@_damage_sprite.opacity = 256 - ((12 - @_damage_duration) * 32)
|
||||
if @_damage_duration == 0
|
||||
dispose_damage
|
||||
end
|
||||
|
||||
@@ -57,8 +57,8 @@ class Scene_Map
|
||||
if playingBGM && map.autoplay_bgm
|
||||
if (PBDayNight.isNight? rescue false)
|
||||
pbBGMFade(0.8) if playingBGM.name != map.bgm.name && playingBGM.name != map.bgm.name + "_n"
|
||||
else
|
||||
pbBGMFade(0.8) if playingBGM.name != map.bgm.name
|
||||
elsif playingBGM.name != map.bgm.name
|
||||
pbBGMFade(0.8)
|
||||
end
|
||||
end
|
||||
if playingBGS && map.autoplay_bgs
|
||||
|
||||
@@ -452,8 +452,8 @@ class Interpreter
|
||||
$game_temp.mart_prices[item][0] = buy_price if buy_price > 0
|
||||
if sell_price >= 0 # 0=can't sell
|
||||
$game_temp.mart_prices[item][1] = sell_price * 2
|
||||
else
|
||||
$game_temp.mart_prices[item][1] = buy_price if buy_price > 0
|
||||
elsif buy_price > 0
|
||||
$game_temp.mart_prices[item][1] = buy_price
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -952,8 +952,8 @@ class Interpreter
|
||||
sscene = PokemonEntryScene.new
|
||||
sscreen = PokemonEntry.new(sscene)
|
||||
$game_actors[@parameters[0]].name = sscreen.pbStartScreen(
|
||||
_INTL("Enter {1}'s name.", $game_actors[@parameters[0]].name),
|
||||
1, @parameters[1], $game_actors[@parameters[0]].name
|
||||
_INTL("Enter {1}'s name.", $game_actors[@parameters[0]].name),
|
||||
1, @parameters[1], $game_actors[@parameters[0]].name
|
||||
)
|
||||
}
|
||||
end
|
||||
|
||||
@@ -97,15 +97,15 @@ class Game_Screen
|
||||
end
|
||||
if @fadein_duration && @fadein_duration >= 1
|
||||
d = @fadein_duration
|
||||
@brightness = (@brightness * (d - 1) + 255) / d
|
||||
@brightness = ((@brightness * (d - 1)) + 255) / d
|
||||
@fadein_duration -= 1
|
||||
end
|
||||
if @tone_duration >= 1
|
||||
d = @tone_duration
|
||||
@tone.red = (@tone.red * (d - 1) + @tone_target.red) / d
|
||||
@tone.green = (@tone.green * (d - 1) + @tone_target.green) / d
|
||||
@tone.blue = (@tone.blue * (d - 1) + @tone_target.blue) / d
|
||||
@tone.gray = (@tone.gray * (d - 1) + @tone_target.gray) / d
|
||||
@tone.red = ((@tone.red * (d - 1)) + @tone_target.red) / d
|
||||
@tone.green = ((@tone.green * (d - 1)) + @tone_target.green) / d
|
||||
@tone.blue = ((@tone.blue * (d - 1)) + @tone_target.blue) / d
|
||||
@tone.gray = ((@tone.gray * (d - 1)) + @tone_target.gray) / d
|
||||
@tone_duration -= 1
|
||||
end
|
||||
if @flash_duration >= 1
|
||||
|
||||
@@ -131,19 +131,19 @@ class Game_Picture
|
||||
def update
|
||||
if @duration >= 1
|
||||
d = @duration
|
||||
@x = (@x * (d - 1) + @target_x) / d
|
||||
@y = (@y * (d - 1) + @target_y) / d
|
||||
@zoom_x = (@zoom_x * (d - 1) + @target_zoom_x) / d
|
||||
@zoom_y = (@zoom_y * (d - 1) + @target_zoom_y) / d
|
||||
@opacity = (@opacity * (d - 1) + @target_opacity) / d
|
||||
@x = ((@x * (d - 1)) + @target_x) / d
|
||||
@y = ((@y * (d - 1)) + @target_y) / d
|
||||
@zoom_x = ((@zoom_x * (d - 1)) + @target_zoom_x) / d
|
||||
@zoom_y = ((@zoom_y * (d - 1)) + @target_zoom_y) / d
|
||||
@opacity = ((@opacity * (d - 1)) + @target_opacity) / d
|
||||
@duration -= 1
|
||||
end
|
||||
if @tone_duration >= 1
|
||||
d = @tone_duration
|
||||
@tone.red = (@tone.red * (d - 1) + @tone_target.red) / d
|
||||
@tone.green = (@tone.green * (d - 1) + @tone_target.green) / d
|
||||
@tone.blue = (@tone.blue * (d - 1) + @tone_target.blue) / d
|
||||
@tone.gray = (@tone.gray * (d - 1) + @tone_target.gray) / d
|
||||
@tone.red = ((@tone.red * (d - 1)) + @tone_target.red) / d
|
||||
@tone.green = ((@tone.green * (d - 1)) + @tone_target.green) / d
|
||||
@tone.blue = ((@tone.blue * (d - 1)) + @tone_target.blue) / d
|
||||
@tone.gray = ((@tone.gray * (d - 1)) + @tone_target.gray) / d
|
||||
@tone_duration -= 1
|
||||
end
|
||||
if @rotate_speed != 0
|
||||
|
||||
@@ -147,7 +147,7 @@ class Game_Map
|
||||
|
||||
def passable?(x, y, d, self_event = nil)
|
||||
return false if !valid?(x, y)
|
||||
bit = (1 << (d / 2 - 1)) & 0x0f
|
||||
bit = (1 << ((d / 2) - 1)) & 0x0f
|
||||
for event in events.values
|
||||
next if event.tile_id <= 0
|
||||
next if event == self_event
|
||||
@@ -224,7 +224,7 @@ class Game_Map
|
||||
end
|
||||
|
||||
def playerPassable?(x, y, d, self_event = nil)
|
||||
bit = (1 << (d / 2 - 1)) & 0x0f
|
||||
bit = (1 << ((d / 2) - 1)) & 0x0f
|
||||
for i in [2, 1, 0]
|
||||
tile_id = data[x, y, i]
|
||||
terrain = GameData::TerrainTag.try_get(@terrain_tags[tile_id])
|
||||
@@ -323,7 +323,7 @@ class Game_Map
|
||||
return if @display_x == value
|
||||
@display_x = value
|
||||
if metadata&.snap_edges
|
||||
max_x = (self.width - Graphics.width * 1.0 / TILE_WIDTH) * REAL_RES_X
|
||||
max_x = (self.width - (Graphics.width.to_f / TILE_WIDTH)) * REAL_RES_X
|
||||
@display_x = [0, [@display_x, max_x].min].max
|
||||
end
|
||||
$map_factory.setMapsInRange if $map_factory
|
||||
@@ -333,7 +333,7 @@ class Game_Map
|
||||
return if @display_y == value
|
||||
@display_y = value
|
||||
if metadata&.snap_edges
|
||||
max_y = (self.height - Graphics.height * 1.0 / TILE_HEIGHT) * REAL_RES_Y
|
||||
max_y = (self.height - (Graphics.height.to_f / TILE_HEIGHT)) * REAL_RES_Y
|
||||
@display_y = [0, [@display_y, max_y].min].max
|
||||
end
|
||||
$map_factory.setMapsInRange if $map_factory
|
||||
@@ -378,7 +378,7 @@ class Game_Map
|
||||
end
|
||||
|
||||
def start_fog_opacity_change(opacity, duration)
|
||||
@fog_opacity_target = opacity * 1.0
|
||||
@fog_opacity_target = opacity.to_f
|
||||
@fog_opacity_duration = duration
|
||||
if @fog_opacity_duration == 0
|
||||
@fog_opacity = @fog_opacity_target
|
||||
@@ -437,15 +437,15 @@ class Game_Map
|
||||
if @fog_tone_duration >= 1
|
||||
d = @fog_tone_duration
|
||||
target = @fog_tone_target
|
||||
@fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
|
||||
@fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
|
||||
@fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
|
||||
@fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
|
||||
@fog_tone.red = ((@fog_tone.red * (d - 1)) + target.red) / d
|
||||
@fog_tone.green = ((@fog_tone.green * (d - 1)) + target.green) / d
|
||||
@fog_tone.blue = ((@fog_tone.blue * (d - 1)) + target.blue) / d
|
||||
@fog_tone.gray = ((@fog_tone.gray * (d - 1)) + target.gray) / d
|
||||
@fog_tone_duration -= 1
|
||||
end
|
||||
if @fog_opacity_duration >= 1
|
||||
d = @fog_opacity_duration
|
||||
@fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
|
||||
@fog_opacity = ((@fog_opacity * (d - 1)) + @fog_opacity_target) / d
|
||||
@fog_opacity_duration -= 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -87,12 +87,12 @@ class Interpreter
|
||||
print 'Map Autoscroll: invalid speed (1-6 only)'
|
||||
return command_skip
|
||||
end
|
||||
center_x = (Graphics.width / 2 - Game_Map::TILE_WIDTH / 2) * 4 # X coordinate in the center of the screen
|
||||
center_y = (Graphics.height / 2 - Game_Map::TILE_HEIGHT / 2) * 4 # Y coordinate in the center of the screen
|
||||
max_x = ($game_map.width - Graphics.width * 1.0 / Game_Map::TILE_WIDTH) * 4 * Game_Map::TILE_WIDTH
|
||||
max_y = ($game_map.height - Graphics.height * 1.0 / Game_Map::TILE_HEIGHT) * 4 * Game_Map::TILE_HEIGHT
|
||||
count_x = ($game_map.display_x - [0, [x * Game_Map::REAL_RES_X - center_x, max_x].min].max) / Game_Map::REAL_RES_X
|
||||
count_y = ($game_map.display_y - [0, [y * Game_Map::REAL_RES_Y - center_y, max_y].min].max) / Game_Map::REAL_RES_Y
|
||||
center_x = ((Graphics.width / 2) - (Game_Map::TILE_WIDTH / 2)) * 4 # X coordinate in the center of the screen
|
||||
center_y = ((Graphics.height / 2) - (Game_Map::TILE_HEIGHT / 2)) * 4 # Y coordinate in the center of the screen
|
||||
max_x = ($game_map.width - (Graphics.width.to_f / Game_Map::TILE_WIDTH)) * 4 * Game_Map::TILE_WIDTH
|
||||
max_y = ($game_map.height - (Graphics.height.to_f / Game_Map::TILE_HEIGHT)) * 4 * Game_Map::TILE_HEIGHT
|
||||
count_x = ($game_map.display_x - [0, [(x * Game_Map::REAL_RES_X) - center_x, max_x].min].max) / Game_Map::REAL_RES_X
|
||||
count_y = ($game_map.display_y - [0, [(y * Game_Map::REAL_RES_Y) - center_y, max_y].min].max) / Game_Map::REAL_RES_Y
|
||||
if !@diag
|
||||
@diag = true
|
||||
dir = nil
|
||||
@@ -148,20 +148,20 @@ end
|
||||
class Game_Map
|
||||
def scroll_downright(distance)
|
||||
@display_x = [@display_x + distance,
|
||||
(self.width - Graphics.width * 1.0 / TILE_WIDTH) * REAL_RES_X].min
|
||||
(self.width - (Graphics.width.to_f / TILE_WIDTH)) * REAL_RES_X].min
|
||||
@display_y = [@display_y + distance,
|
||||
(self.height - Graphics.height * 1.0 / TILE_HEIGHT) * REAL_RES_Y].min
|
||||
(self.height - (Graphics.height.to_f / TILE_HEIGHT)) * REAL_RES_Y].min
|
||||
end
|
||||
|
||||
def scroll_downleft(distance)
|
||||
@display_x = [@display_x - distance, 0].max
|
||||
@display_y = [@display_y + distance,
|
||||
(self.height - Graphics.height * 1.0 / TILE_HEIGHT) * REAL_RES_Y].min
|
||||
(self.height - (Graphics.height.to_f / TILE_HEIGHT)) * REAL_RES_Y].min
|
||||
end
|
||||
|
||||
def scroll_upright(distance)
|
||||
@display_x = [@display_x + distance,
|
||||
(self.width - Graphics.width * 1.0 / TILE_WIDTH) * REAL_RES_X].min
|
||||
(self.width - (Graphics.width.to_f / TILE_WIDTH)) * REAL_RES_X].min
|
||||
@display_y = [@display_y - distance, 0].max
|
||||
end
|
||||
|
||||
|
||||
@@ -122,8 +122,8 @@ class PokemonMapFactory
|
||||
for conn in conns[id]
|
||||
if conn[0] == id
|
||||
mapA = getMap(conn[0])
|
||||
newdispx = (conn[4] - conn[1]) * Game_Map::REAL_RES_X + mapA.display_x
|
||||
newdispy = (conn[5] - conn[2]) * Game_Map::REAL_RES_Y + mapA.display_y
|
||||
newdispx = ((conn[4] - conn[1]) * Game_Map::REAL_RES_X) + mapA.display_x
|
||||
newdispy = ((conn[5] - conn[2]) * Game_Map::REAL_RES_Y) + mapA.display_y
|
||||
if hasMap?(conn[3]) || MapFactoryHelper.mapInRangeById?(conn[3], newdispx, newdispy)
|
||||
mapB = getMap(conn[3])
|
||||
mapB.display_x = newdispx if mapB.display_x != newdispx
|
||||
@@ -131,8 +131,8 @@ class PokemonMapFactory
|
||||
end
|
||||
else
|
||||
mapA = getMap(conn[3])
|
||||
newdispx = (conn[1] - conn[4]) * Game_Map::REAL_RES_X + mapA.display_x
|
||||
newdispy = (conn[2] - conn[5]) * Game_Map::REAL_RES_Y + mapA.display_y
|
||||
newdispx = ((conn[1] - conn[4]) * Game_Map::REAL_RES_X) + mapA.display_x
|
||||
newdispy = ((conn[2] - conn[5]) * Game_Map::REAL_RES_Y) + mapA.display_y
|
||||
if hasMap?(conn[0]) || MapFactoryHelper.mapInRangeById?(conn[0], newdispx, newdispy)
|
||||
mapB = getMap(conn[0])
|
||||
mapB.display_x = newdispx if mapB.display_x != newdispx
|
||||
@@ -204,8 +204,8 @@ class PokemonMapFactory
|
||||
if !($DEBUG && Input.press?(Input::CTRL))
|
||||
return false if !map.passableStrict?(x, y, 0, thisEvent)
|
||||
end
|
||||
else
|
||||
return false if !map.passableStrict?(x, y, 0, thisEvent)
|
||||
elsif !map.passableStrict?(x, y, 0, thisEvent)
|
||||
return false
|
||||
end
|
||||
for event in map.events.values
|
||||
next if event == thisEvent || !event.at_coordinate?(x, y)
|
||||
@@ -488,8 +488,8 @@ module MapFactoryHelper
|
||||
dispy = map.display_y
|
||||
return false if dispx >= (map.width + range) * Game_Map::REAL_RES_X
|
||||
return false if dispy >= (map.height + range) * Game_Map::REAL_RES_Y
|
||||
return false if dispx <= -(Graphics.width + range * Game_Map::TILE_WIDTH) * Game_Map::X_SUBPIXELS
|
||||
return false if dispy <= -(Graphics.height + range * Game_Map::TILE_HEIGHT) * Game_Map::Y_SUBPIXELS
|
||||
return false if dispx <= -(Graphics.width + (range * Game_Map::TILE_WIDTH)) * Game_Map::X_SUBPIXELS
|
||||
return false if dispy <= -(Graphics.height + (range * Game_Map::TILE_HEIGHT)) * Game_Map::Y_SUBPIXELS
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -498,8 +498,8 @@ module MapFactoryHelper
|
||||
dims = MapFactoryHelper.getMapDims(id)
|
||||
return false if dispx >= (dims[0] + range) * Game_Map::REAL_RES_X
|
||||
return false if dispy >= (dims[1] + range) * Game_Map::REAL_RES_Y
|
||||
return false if dispx <= -(Graphics.width + range * Game_Map::TILE_WIDTH) * Game_Map::X_SUBPIXELS
|
||||
return false if dispy <= -(Graphics.height + range * Game_Map::TILE_HEIGHT) * Game_Map::Y_SUBPIXELS
|
||||
return false if dispx <= -(Graphics.width + (range * Game_Map::TILE_WIDTH)) * Game_Map::X_SUBPIXELS
|
||||
return false if dispy <= -(Graphics.height + (range * Game_Map::TILE_HEIGHT)) * Game_Map::Y_SUBPIXELS
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -142,7 +142,7 @@ class Game_Character
|
||||
# 4 => 64 # 1.6 seconds
|
||||
# 5 => 30 # 0.75 seconds
|
||||
# 6 => 0 # 0 seconds, i.e. continuous movement
|
||||
self.move_frequency_real = (40 - val * 2) * (6 - val)
|
||||
self.move_frequency_real = (40 - (val * 2)) * (6 - val)
|
||||
end
|
||||
|
||||
def move_frequency_real
|
||||
@@ -318,7 +318,7 @@ class Game_Character
|
||||
else
|
||||
jump_fraction = ((@jump_distance_left / @jump_distance) - 0.5).abs # 0.5 to 0 to 0.5
|
||||
end
|
||||
ret += @jump_peak * (4 * jump_fraction**2 - 1)
|
||||
ret += @jump_peak * ((4 * (jump_fraction**2)) - 1)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
@@ -328,7 +328,7 @@ class Game_Character
|
||||
z = screen_y_ground
|
||||
if @tile_id > 0
|
||||
begin
|
||||
return z + self.map.priorities[@tile_id] * 32
|
||||
return z + (self.map.priorities[@tile_id] * 32)
|
||||
rescue
|
||||
raise "Event's graphic is an out-of-range tile (event #{@id}, map #{self.map.map_id})"
|
||||
end
|
||||
@@ -405,8 +405,8 @@ class Game_Character
|
||||
end
|
||||
|
||||
def move_type_toward_player
|
||||
sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0)
|
||||
sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0)
|
||||
sx = @x + (@width / 2.0) - ($game_player.x + ($game_player.width / 2.0))
|
||||
sy = @y - (@height / 2.0) - ($game_player.y - ($game_player.height / 2.0))
|
||||
if sx.abs + sy.abs >= 20
|
||||
move_random
|
||||
return
|
||||
@@ -662,8 +662,8 @@ class Game_Character
|
||||
end
|
||||
|
||||
def move_toward_player
|
||||
sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0)
|
||||
sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0)
|
||||
sx = @x + (@width / 2.0) - ($game_player.x + ($game_player.width / 2.0))
|
||||
sy = @y - (@height / 2.0) - ($game_player.y - ($game_player.height / 2.0))
|
||||
return if sx == 0 && sy == 0
|
||||
abs_sx = sx.abs
|
||||
abs_sy = sy.abs
|
||||
@@ -684,8 +684,8 @@ class Game_Character
|
||||
end
|
||||
|
||||
def move_away_from_player
|
||||
sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0)
|
||||
sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0)
|
||||
sx = @x + (@width / 2.0) - ($game_player.x + ($game_player.width / 2.0))
|
||||
sy = @y - (@height / 2.0) - ($game_player.y - ($game_player.height / 2.0))
|
||||
return if sx == 0 && sy == 0
|
||||
abs_sx = sx.abs
|
||||
abs_sy = sy.abs
|
||||
@@ -737,7 +737,7 @@ class Game_Character
|
||||
end
|
||||
@x = @x + x_plus
|
||||
@y = @y + y_plus
|
||||
real_distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus)
|
||||
real_distance = Math.sqrt((x_plus * x_plus) + (y_plus * y_plus))
|
||||
distance = [1, real_distance].max
|
||||
@jump_peak = distance * Game_Map::TILE_HEIGHT * 3 / 8 # 3/4 of tile for ledge jumping
|
||||
@jump_distance = [x_plus.abs * Game_Map::REAL_RES_X, y_plus.abs * Game_Map::REAL_RES_Y].max
|
||||
@@ -824,8 +824,8 @@ class Game_Character
|
||||
end
|
||||
|
||||
def turn_toward_player
|
||||
sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0)
|
||||
sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0)
|
||||
sx = @x + (@width / 2.0) - ($game_player.x + ($game_player.width / 2.0))
|
||||
sy = @y - (@height / 2.0) - ($game_player.y - ($game_player.height / 2.0))
|
||||
return if sx == 0 && sy == 0
|
||||
if sx.abs > sy.abs
|
||||
(sx > 0) ? turn_left : turn_right
|
||||
@@ -835,8 +835,8 @@ class Game_Character
|
||||
end
|
||||
|
||||
def turn_away_from_player
|
||||
sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0)
|
||||
sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0)
|
||||
sx = @x + (@width / 2.0) - ($game_player.x + ($game_player.width / 2.0))
|
||||
sy = @y - (@height / 2.0) - ($game_player.y - ($game_player.height / 2.0))
|
||||
return if sx == 0 && sy == 0
|
||||
if sx.abs > sy.abs
|
||||
(sx > 0) ? turn_right : turn_left
|
||||
|
||||
@@ -110,7 +110,7 @@ class Game_Event < Game_Character
|
||||
return false if !ontime
|
||||
now = pbGetTimeNow
|
||||
elapsed = (now.to_i - ontime) / 86400
|
||||
elapsed += 1 if (now.to_i - ontime) % 86400 > (now.hour * 3600 + now.min * 60 + now.sec)
|
||||
elapsed += 1 if (now.to_i - ontime) % 86400 > ((now.hour * 3600) + (now.min * 60) + now.sec)
|
||||
return elapsed >= days
|
||||
end
|
||||
|
||||
@@ -249,9 +249,9 @@ class Game_Event < Game_Character
|
||||
return true if @move_route_forcing
|
||||
return true if @event.name[/update/i]
|
||||
range = 2 # Number of tiles
|
||||
return false if self.screen_x - @sprite_size[0] / 2 > Graphics.width + range * Game_Map::TILE_WIDTH
|
||||
return false if self.screen_x + @sprite_size[0] / 2 < -range * Game_Map::TILE_WIDTH
|
||||
return false if self.screen_y_ground - @sprite_size[1] > Graphics.height + range * Game_Map::TILE_HEIGHT
|
||||
return false if self.screen_x - (@sprite_size[0] / 2) > Graphics.width + (range * Game_Map::TILE_WIDTH)
|
||||
return false if self.screen_x + (@sprite_size[0] / 2) < -range * Game_Map::TILE_WIDTH
|
||||
return false if self.screen_y_ground - @sprite_size[1] > Graphics.height + (range * Game_Map::TILE_HEIGHT)
|
||||
return false if self.screen_y_ground < -range * Game_Map::TILE_HEIGHT
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -10,8 +10,8 @@ class Game_Player < Game_Character
|
||||
attr_accessor :charsetData
|
||||
attr_accessor :encounter_count
|
||||
|
||||
SCREEN_CENTER_X = (Settings::SCREEN_WIDTH / 2 - Game_Map::TILE_WIDTH / 2) * Game_Map::X_SUBPIXELS
|
||||
SCREEN_CENTER_Y = (Settings::SCREEN_HEIGHT / 2 - Game_Map::TILE_HEIGHT / 2) * Game_Map::Y_SUBPIXELS
|
||||
SCREEN_CENTER_X = ((Settings::SCREEN_WIDTH / 2) - (Game_Map::TILE_WIDTH / 2)) * Game_Map::X_SUBPIXELS
|
||||
SCREEN_CENTER_Y = ((Settings::SCREEN_HEIGHT / 2) - (Game_Map::TILE_HEIGHT / 2)) * Game_Map::Y_SUBPIXELS
|
||||
|
||||
@@bobFrameSpeed = 1.0 / 15
|
||||
|
||||
@@ -157,7 +157,7 @@ class Game_Player < Game_Character
|
||||
end
|
||||
@x = @x + x_plus
|
||||
@y = @y + y_plus
|
||||
real_distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus)
|
||||
real_distance = Math.sqrt((x_plus * x_plus) + (y_plus * y_plus))
|
||||
distance = [1, real_distance].max
|
||||
@jump_peak = distance * Game_Map::TILE_HEIGHT * 3 / 8 # 3/4 of tile for ledge jumping
|
||||
@jump_distance = [x_plus.abs * Game_Map::REAL_RES_X, y_plus.abs * Game_Map::REAL_RES_Y].max
|
||||
@@ -287,8 +287,8 @@ class Game_Player < Game_Character
|
||||
# * Set Map Display Position to Center of Screen
|
||||
#-----------------------------------------------------------------------------
|
||||
def center(x, y)
|
||||
self.map.display_x = x * Game_Map::REAL_RES_X - SCREEN_CENTER_X
|
||||
self.map.display_y = y * Game_Map::REAL_RES_Y - SCREEN_CENTER_Y
|
||||
self.map.display_x = (x * Game_Map::REAL_RES_X) - SCREEN_CENTER_X
|
||||
self.map.display_y = (y * Game_Map::REAL_RES_Y) - SCREEN_CENTER_Y
|
||||
end
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -164,7 +164,7 @@ class Game_Follower < Game_Event
|
||||
return false if !this_map || !this_map.valid?(x, y)
|
||||
return true if @through
|
||||
passed_tile_checks = false
|
||||
bit = (1 << (direction / 2 - 1)) & 0x0f
|
||||
bit = (1 << ((direction / 2) - 1)) & 0x0f
|
||||
# Check all events for ones using tiles as graphics, and see if they're passable
|
||||
for event in this_map.events.values
|
||||
next if event.tile_id < 0 || event.through || !event.at_coordinate?(x, y)
|
||||
|
||||
@@ -38,8 +38,8 @@ class Sprite_Timer
|
||||
@timer.text = _ISPRINTF("<ac>{1:02d}:{2:02d}", min, sec)
|
||||
end
|
||||
@timer.update
|
||||
else
|
||||
@timer.visible = false if @timer
|
||||
elsif @timer
|
||||
@timer.visible = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -117,7 +117,7 @@ class Sprite_Character < RPG::Sprite
|
||||
self.oy = @ch
|
||||
else
|
||||
@charbitmap = AnimatedBitmap.new(
|
||||
'Graphics/Characters/' + @character_name, @character_hue
|
||||
'Graphics/Characters/' + @character_name, @character_hue
|
||||
)
|
||||
RPG::Cache.retain('Graphics/Characters/', @character_name, @character_hue) if @character == $game_player
|
||||
@charbitmapAnimated = true
|
||||
|
||||
@@ -57,10 +57,10 @@ class Sprite_Reflection
|
||||
y += @height * 16
|
||||
width = @rsprite.src_rect.width
|
||||
height = @rsprite.src_rect.height
|
||||
@sprite.x = x + width / 2
|
||||
@sprite.y = y + height + height / 2
|
||||
@sprite.x = x + (width / 2)
|
||||
@sprite.y = y + height + (height / 2)
|
||||
@sprite.ox = width / 2
|
||||
@sprite.oy = height / 2 - 2 # Hard-coded 2 pixel shift up
|
||||
@sprite.oy = (height / 2) - 2 # Hard-coded 2 pixel shift up
|
||||
@sprite.oy -= @rsprite.character.bob_height * 2
|
||||
@sprite.z = -50 # Still water is -100, map is 0 and above
|
||||
@sprite.z += 1 if @event == $game_player
|
||||
|
||||
@@ -63,8 +63,8 @@ class Sprite_SurfBase
|
||||
sy = ((@event.direction - 2) / 2) * ch
|
||||
@sprite.src_rect.set(sx, sy, cw, ch)
|
||||
if $game_temp.surf_base_coords
|
||||
@sprite.x = ($game_temp.surf_base_coords[0] * Game_Map::REAL_RES_X - @event.map.display_x + 3) / 4 + (Game_Map::TILE_WIDTH / 2)
|
||||
@sprite.y = ($game_temp.surf_base_coords[1] * Game_Map::REAL_RES_Y - @event.map.display_y + 3) / 4 + (Game_Map::TILE_HEIGHT / 2) + 16
|
||||
@sprite.x = ((($game_temp.surf_base_coords[0] * Game_Map::REAL_RES_X) - @event.map.display_x + 3) / 4) + (Game_Map::TILE_WIDTH / 2)
|
||||
@sprite.y = ((($game_temp.surf_base_coords[1] * Game_Map::REAL_RES_Y) - @event.map.display_y + 3) / 4) + (Game_Map::TILE_HEIGHT / 2) + 16
|
||||
else
|
||||
@sprite.x = @rsprite.x
|
||||
@sprite.y = @rsprite.y
|
||||
|
||||
@@ -9,7 +9,7 @@ class ClippableSprite < Sprite_Character
|
||||
def update
|
||||
super
|
||||
@_src_rect = self.src_rect
|
||||
tmright = @tilemap.map_data.xsize * Game_Map::TILE_WIDTH - @tilemap.ox
|
||||
tmright = (@tilemap.map_data.xsize * Game_Map::TILE_WIDTH) - @tilemap.ox
|
||||
echoln "x=#{self.x},ox=#{self.ox},tmright=#{tmright},tmox=#{@tilemap.ox}"
|
||||
if @tilemap.ox - self.ox < -self.x
|
||||
# clipped on left
|
||||
|
||||
@@ -18,9 +18,9 @@ class AnimationSprite < RPG::Sprite
|
||||
end
|
||||
|
||||
def setCoords
|
||||
self.x = ((@tileX * Game_Map::REAL_RES_X - @map.display_x) / Game_Map::X_SUBPIXELS).ceil
|
||||
self.x = (((@tileX * Game_Map::REAL_RES_X) - @map.display_x) / Game_Map::X_SUBPIXELS).ceil
|
||||
self.x += Game_Map::TILE_WIDTH / 2
|
||||
self.y = ((@tileY * Game_Map::REAL_RES_Y - @map.display_y) / Game_Map::Y_SUBPIXELS).ceil
|
||||
self.y = (((@tileY * Game_Map::REAL_RES_Y) - @map.display_y) / Game_Map::Y_SUBPIXELS).ceil
|
||||
self.y += Game_Map::TILE_HEIGHT
|
||||
end
|
||||
|
||||
|
||||
@@ -9,23 +9,23 @@ class Particle_Engine
|
||||
@disposed = false
|
||||
@firsttime = true
|
||||
@effects = {
|
||||
# PinkMan's Effects
|
||||
"fire" => Particle_Engine::Fire,
|
||||
"smoke" => Particle_Engine::Smoke,
|
||||
"teleport" => Particle_Engine::Teleport,
|
||||
"spirit" => Particle_Engine::Spirit,
|
||||
"explosion" => Particle_Engine::Explosion,
|
||||
"aura" => Particle_Engine::Aura,
|
||||
# BlueScope's Effects
|
||||
"soot" => Particle_Engine::Soot,
|
||||
"sootsmoke" => Particle_Engine::SootSmoke,
|
||||
"rocket" => Particle_Engine::Rocket,
|
||||
"fixteleport" => Particle_Engine::FixedTeleport,
|
||||
"smokescreen" => Particle_Engine::Smokescreen,
|
||||
"flare" => Particle_Engine::Flare,
|
||||
"splash" => Particle_Engine::Splash,
|
||||
# By Peter O.
|
||||
"starteleport" => Particle_Engine::StarTeleport
|
||||
# PinkMan's Effects
|
||||
"fire" => Particle_Engine::Fire,
|
||||
"smoke" => Particle_Engine::Smoke,
|
||||
"teleport" => Particle_Engine::Teleport,
|
||||
"spirit" => Particle_Engine::Spirit,
|
||||
"explosion" => Particle_Engine::Explosion,
|
||||
"aura" => Particle_Engine::Aura,
|
||||
# BlueScope's Effects
|
||||
"soot" => Particle_Engine::Soot,
|
||||
"sootsmoke" => Particle_Engine::SootSmoke,
|
||||
"rocket" => Particle_Engine::Rocket,
|
||||
"fixteleport" => Particle_Engine::FixedTeleport,
|
||||
"smokescreen" => Particle_Engine::Smokescreen,
|
||||
"flare" => Particle_Engine::Flare,
|
||||
"splash" => Particle_Engine::Splash,
|
||||
# By Peter O.
|
||||
"starteleport" => Particle_Engine::StarTeleport
|
||||
}
|
||||
end
|
||||
|
||||
@@ -261,9 +261,9 @@ class ParticleEffect_Event < ParticleEffect
|
||||
@real_y = newRealY
|
||||
if @opacityvar > 0 && @viewport
|
||||
opac = 255.0 / @opacityvar
|
||||
minX = opac * (-@xgravity * 1.0 / @slowdown).floor + @startingx
|
||||
maxX = opac * (@xgravity * 1.0 / @slowdown).floor + @startingx
|
||||
minY = opac * (-@ygravity * 1.0 / @slowdown).floor + @startingy
|
||||
minX = (opac * (-@xgravity.to_f / @slowdown).floor) + @startingx
|
||||
maxX = (opac * (@xgravity.to_f / @slowdown).floor) + @startingx
|
||||
minY = (opac * (-@ygravity.to_f / @slowdown).floor) + @startingy
|
||||
maxY = @startingy
|
||||
minX -= @bmwidth
|
||||
minY -= @bmheight
|
||||
@@ -309,14 +309,12 @@ class ParticleEffect_Event < ParticleEffect
|
||||
@particlex[i] = 0.0
|
||||
@particley[i] = 0.0
|
||||
end
|
||||
else
|
||||
if @opacity[i] <= 0
|
||||
@opacity[i] = 250
|
||||
@particles[i].y = @startingy + @yoffset
|
||||
@particles[i].x = @startingx + @xoffset
|
||||
@particlex[i] = 0.0
|
||||
@particley[i] = 0.0
|
||||
end
|
||||
elsif @opacity[i] <= 0
|
||||
@opacity[i] = 250
|
||||
@particles[i].y = @startingy + @yoffset
|
||||
@particles[i].x = @startingx + @xoffset
|
||||
@particlex[i] = 0.0
|
||||
@particley[i] = 0.0
|
||||
end
|
||||
calcParticlePos(i)
|
||||
if @randomhue == 1
|
||||
@@ -333,11 +331,11 @@ class ParticleEffect_Event < ParticleEffect
|
||||
def calcParticlePos(i)
|
||||
@leftright = rand(2)
|
||||
if @leftright == 1
|
||||
xo = -@xgravity * 1.0 / @slowdown
|
||||
xo = -@xgravity.to_f / @slowdown
|
||||
else
|
||||
xo = @xgravity * 1.0 / @slowdown
|
||||
xo = @xgravity.to_f / @slowdown
|
||||
end
|
||||
yo = -@ygravity * 1.0 / @slowdown
|
||||
yo = -@ygravity.to_f / @slowdown
|
||||
@particlex[i] += xo
|
||||
@particley[i] += yo
|
||||
@particlex[i] -= @__offsetx
|
||||
|
||||
@@ -47,23 +47,23 @@ def getCubicPoint2(src, t)
|
||||
x1 = src[6]
|
||||
y1 = src[7]
|
||||
|
||||
x1 = cx1 + (x1 - cx1) * t
|
||||
x0 = x0 + (cx0 - x0) * t
|
||||
cx0 = cx0 + (cx1 - cx0) * t
|
||||
cx1 = cx0 + (x1 - cx0) * t
|
||||
cx0 = x0 + (cx0 - x0) * t
|
||||
cx = cx0 + (cx1 - cx0) * t
|
||||
x1 = cx1 + ((x1 - cx1) * t)
|
||||
x0 = x0 + ((cx0 - x0) * t)
|
||||
cx0 = cx0 + ((cx1 - cx0) * t)
|
||||
cx1 = cx0 + ((x1 - cx0) * t)
|
||||
cx0 = x0 + ((cx0 - x0) * t)
|
||||
cx = cx0 + ((cx1 - cx0) * t)
|
||||
# a = x1 - 3 * cx1 + 3 * cx0 - x0
|
||||
# b = 3 * (cx1 - 2 * cx0 + x0)
|
||||
# c = 3 * (cx0 - x0)
|
||||
# d = x0
|
||||
# cx = a*t*t*t + b*t*t + c*t + d
|
||||
y1 = cy1 + (y1 - cy1) * t
|
||||
y0 = y0 + (cy0 - y0) * t
|
||||
cy0 = cy0 + (cy1 - cy0) * t
|
||||
cy1 = cy0 + (y1 - cy0) * t
|
||||
cy0 = y0 + (cy0 - y0) * t
|
||||
cy = cy0 + (cy1 - cy0) * t
|
||||
y1 = cy1 + ((y1 - cy1) * t)
|
||||
y0 = y0 + ((cy0 - y0) * t)
|
||||
cy0 = cy0 + ((cy1 - cy0) * t)
|
||||
cy1 = cy0 + ((y1 - cy0) * t)
|
||||
cy0 = y0 + ((cy0 - y0) * t)
|
||||
cy = cy0 + ((cy1 - cy0) * t)
|
||||
# a = y1 - 3 * cy1 + 3 * cy0 - y0
|
||||
# b = 3 * (cy1 - 2 * cy0 + y0)
|
||||
# c = 3 * (cy0 - y0)
|
||||
@@ -121,11 +121,12 @@ class PictureEx
|
||||
end
|
||||
|
||||
def callback(cb)
|
||||
if cb.is_a?(Proc)
|
||||
case cb
|
||||
when Proc
|
||||
cb.call(self)
|
||||
elsif cb.is_a?(Array)
|
||||
when Array
|
||||
cb[0].method(cb[1]).call(self)
|
||||
elsif cb.is_a?(Method)
|
||||
when Method
|
||||
cb.call(self)
|
||||
end
|
||||
end
|
||||
@@ -390,31 +391,31 @@ class PictureEx
|
||||
dur = (process[2] == 0) ? 1 : process[2] # Total duration of process
|
||||
case process[0]
|
||||
when Processes::XY, Processes::DeltaXY
|
||||
@x = process[5] + fra * (process[7] - process[5]) / dur
|
||||
@y = process[6] + fra * (process[8] - process[6]) / dur
|
||||
@x = process[5] + (fra * (process[7] - process[5]) / dur)
|
||||
@y = process[6] + (fra * (process[8] - process[6]) / dur)
|
||||
when Processes::Curve
|
||||
@x, @y = getCubicPoint2(process[5], fra.to_f / dur)
|
||||
when Processes::Z
|
||||
@z = process[5] + fra * (process[6] - process[5]) / dur
|
||||
@z = process[5] + (fra * (process[6] - process[5]) / dur)
|
||||
when Processes::Zoom
|
||||
@zoom_x = process[5] + fra * (process[7] - process[5]) / dur
|
||||
@zoom_y = process[6] + fra * (process[8] - process[6]) / dur
|
||||
@zoom_x = process[5] + (fra * (process[7] - process[5]) / dur)
|
||||
@zoom_y = process[6] + (fra * (process[8] - process[6]) / dur)
|
||||
when Processes::Angle
|
||||
@angle = process[5] + fra * (process[6] - process[5]) / dur
|
||||
@angle = process[5] + (fra * (process[6] - process[5]) / dur)
|
||||
when Processes::Tone
|
||||
@tone.red = process[5].red + fra * (process[6].red - process[5].red) / dur
|
||||
@tone.green = process[5].green + fra * (process[6].green - process[5].green) / dur
|
||||
@tone.blue = process[5].blue + fra * (process[6].blue - process[5].blue) / dur
|
||||
@tone.gray = process[5].gray + fra * (process[6].gray - process[5].gray) / dur
|
||||
@tone.red = process[5].red + (fra * (process[6].red - process[5].red) / dur)
|
||||
@tone.green = process[5].green + (fra * (process[6].green - process[5].green) / dur)
|
||||
@tone.blue = process[5].blue + (fra * (process[6].blue - process[5].blue) / dur)
|
||||
@tone.gray = process[5].gray + (fra * (process[6].gray - process[5].gray) / dur)
|
||||
when Processes::Color
|
||||
@color.red = process[5].red + fra * (process[6].red - process[5].red) / dur
|
||||
@color.green = process[5].green + fra * (process[6].green - process[5].green) / dur
|
||||
@color.blue = process[5].blue + fra * (process[6].blue - process[5].blue) / dur
|
||||
@color.alpha = process[5].alpha + fra * (process[6].alpha - process[5].alpha) / dur
|
||||
@color.red = process[5].red + (fra * (process[6].red - process[5].red) / dur)
|
||||
@color.green = process[5].green + (fra * (process[6].green - process[5].green) / dur)
|
||||
@color.blue = process[5].blue + (fra * (process[6].blue - process[5].blue) / dur)
|
||||
@color.alpha = process[5].alpha + (fra * (process[6].alpha - process[5].alpha) / dur)
|
||||
when Processes::Hue
|
||||
@hue = (process[6] - process[5]).to_f / dur
|
||||
when Processes::Opacity
|
||||
@opacity = process[5] + fra * (process[6] - process[5]) / dur
|
||||
@opacity = process[5] + (fra * (process[6] - process[5]) / dur)
|
||||
when Processes::Visible
|
||||
@visible = process[5]
|
||||
when Processes::BlendType
|
||||
|
||||
@@ -51,26 +51,26 @@ class Interpolator
|
||||
|
||||
def update
|
||||
if @tweening
|
||||
t = (@step * 1.0) / @frames
|
||||
t = @step.to_f / @frames
|
||||
for i in 0...@tweensteps.length
|
||||
item = @tweensteps[i]
|
||||
next if !item
|
||||
case i
|
||||
when ZOOM_X
|
||||
@sprite.zoom_x = item[0] + item[1] * t
|
||||
@sprite.zoom_x = item[0] + (item[1] * t)
|
||||
when ZOOM_Y
|
||||
@sprite.zoom_y = item[0] + item[1] * t
|
||||
@sprite.zoom_y = item[0] + (item[1] * t)
|
||||
when X
|
||||
@sprite.x = item[0] + item[1] * t
|
||||
@sprite.x = item[0] + (item[1] * t)
|
||||
when Y
|
||||
@sprite.y = item[0] + item[1] * t
|
||||
@sprite.y = item[0] + (item[1] * t)
|
||||
when OPACITY
|
||||
@sprite.opacity = item[0] + item[1] * t
|
||||
@sprite.opacity = item[0] + (item[1] * t)
|
||||
when COLOR
|
||||
@sprite.color = Color.new(item[0].red + item[1].red * t,
|
||||
item[0].green + item[1].green * t,
|
||||
item[0].blue + item[1].blue * t,
|
||||
item[0].alpha + item[1].alpha * t)
|
||||
@sprite.color = Color.new(item[0].red + (item[1].red * t),
|
||||
item[0].green + (item[1].green * t),
|
||||
item[0].blue + (item[1].blue * t),
|
||||
item[0].alpha + (item[1].alpha * t))
|
||||
end
|
||||
end
|
||||
@step += 1
|
||||
@@ -108,19 +108,19 @@ class RectInterpolator
|
||||
|
||||
def update
|
||||
return if done?
|
||||
t = (@curframe * 1.0 / @frames)
|
||||
t = @curframe.to_f / @frames
|
||||
x1 = @oldrect.x
|
||||
x2 = @newrect.x
|
||||
x = x1 + t * (x2 - x1)
|
||||
x = x1 + (t * (x2 - x1))
|
||||
y1 = @oldrect.y
|
||||
y2 = @newrect.y
|
||||
y = y1 + t * (y2 - y1)
|
||||
y = y1 + (t * (y2 - y1))
|
||||
rx1 = @oldrect.x + @oldrect.width
|
||||
rx2 = @newrect.x + @newrect.width
|
||||
rx = rx1 + t * (rx2 - rx1)
|
||||
rx = rx1 + (t * (rx2 - rx1))
|
||||
ry1 = @oldrect.y + @oldrect.height
|
||||
ry2 = @newrect.y + @newrect.height
|
||||
ry = ry1 + t * (ry2 - ry1)
|
||||
ry = ry1 + (t * (ry2 - ry1))
|
||||
minx = x < rx ? x : rx
|
||||
maxx = x > rx ? x : rx
|
||||
miny = y < ry ? y : ry
|
||||
@@ -157,13 +157,13 @@ class PointInterpolator
|
||||
|
||||
def update
|
||||
return if done?
|
||||
t = (@curframe * 1.0 / @frames)
|
||||
t = @curframe.to_f / @frames
|
||||
rx1 = @oldx
|
||||
rx2 = @newx
|
||||
@x = rx1 + t * (rx2 - rx1)
|
||||
@x = rx1 + (t * (rx2 - rx1))
|
||||
ry1 = @oldy
|
||||
ry2 = @newy
|
||||
@y = ry1 + t * (ry2 - ry1)
|
||||
@y = ry1 + (t * (ry2 - ry1))
|
||||
@curframe += 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -372,7 +372,7 @@ class TilemapRenderer
|
||||
if tile_id < true_tileset_start_id
|
||||
filename = ""
|
||||
if tile_id < TILESET_START_ID # Real autotiles
|
||||
filename = map.autotile_names[tile_id / TILES_PER_AUTOTILE - 1]
|
||||
filename = map.autotile_names[(tile_id / TILES_PER_AUTOTILE) - 1]
|
||||
elsif tile_id < single_autotile_start_id # Large extra autotiles
|
||||
filename = extra_autotile_arrays[0][(tile_id - TILESET_START_ID) / TILES_PER_AUTOTILE]
|
||||
else # Single extra autotiles
|
||||
@@ -406,8 +406,8 @@ class TilemapRenderer
|
||||
|
||||
# x and y are the positions of tile within @tiles, not a map x/y
|
||||
def refresh_tile_coordinates(tile, x, y)
|
||||
tile.x = x * DISPLAY_TILE_WIDTH - @pixel_offset_x
|
||||
tile.y = y * DISPLAY_TILE_HEIGHT - @pixel_offset_y
|
||||
tile.x = (x * DISPLAY_TILE_WIDTH) - @pixel_offset_x
|
||||
tile.y = (y * DISPLAY_TILE_HEIGHT) - @pixel_offset_y
|
||||
end
|
||||
|
||||
def refresh_tile_z(tile, map, y, layer, tile_id)
|
||||
@@ -417,7 +417,7 @@ class TilemapRenderer
|
||||
tile.z = 0
|
||||
else
|
||||
priority = tile.priority
|
||||
tile.z = (priority == 0) ? 0 : y * DISPLAY_TILE_HEIGHT + priority * 32 + 32
|
||||
tile.z = (priority == 0) ? 0 : (y * DISPLAY_TILE_HEIGHT) + (priority * 32) + 32
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class TilemapRenderer
|
||||
TILESET_WIDTH = SOURCE_TILE_WIDTH * TILESET_TILES_PER_ROW
|
||||
# Looks useless, but covers weird numbers given to mkxp.json or a funky driver
|
||||
MAX_TEX_SIZE = (Bitmap.max_size / 1024) * 1024
|
||||
MAX_TEX_SIZE_BOOSTED = MAX_TEX_SIZE**2 / TILESET_WIDTH
|
||||
MAX_TEX_SIZE_BOOSTED = (MAX_TEX_SIZE**2) / TILESET_WIDTH
|
||||
|
||||
module_function
|
||||
|
||||
@@ -49,7 +49,7 @@ class TilemapRenderer
|
||||
def getWrappedRect(src_rect)
|
||||
ret = Rect.new(0, 0, 0, 0)
|
||||
col = (src_rect.y / MAX_TEX_SIZE.to_f).floor
|
||||
ret.x = col * TILESET_WIDTH + src_rect.x.clamp(0, TILESET_WIDTH)
|
||||
ret.x = (col * TILESET_WIDTH) + src_rect.x.clamp(0, TILESET_WIDTH)
|
||||
ret.y = src_rect.y % MAX_TEX_SIZE
|
||||
ret.width = src_rect.width.clamp(0, TILESET_WIDTH - src_rect.x)
|
||||
ret.height = src_rect.height.clamp(0, MAX_TEX_SIZE)
|
||||
@@ -70,8 +70,8 @@ class TilemapRenderer
|
||||
# FIXME: won't work on heights longer than two columns, but nobody should need
|
||||
# more than 32k pixels high at once anyway
|
||||
side = {
|
||||
:a => MAX_TEX_SIZE - srcrect_mod.y,
|
||||
:b => srcrect_mod.height - MAX_TEX_SIZE + srcrect_mod.y
|
||||
:a => MAX_TEX_SIZE - srcrect_mod.y,
|
||||
:b => srcrect_mod.height - MAX_TEX_SIZE + srcrect_mod.y
|
||||
}
|
||||
dest.blt(destX, destY, src, Rect.new(srcrect_mod.x, srcrect_mod.y, srcrect_mod.width, side[:a]))
|
||||
dest.blt(destX, destY + side[:a], src, Rect.new(srcrect_mod.x + TILESET_WIDTH, 0, srcrect_mod.width, side[:b]))
|
||||
|
||||
@@ -36,11 +36,11 @@ class TilemapRenderer
|
||||
SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT))
|
||||
when 2 # Top right corner
|
||||
new_bitmap.blt(dest_x, dest_y, bitmap,
|
||||
Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 4,
|
||||
Rect.new(SOURCE_TILE_WIDTH + (frame * SOURCE_TILE_WIDTH * 3), SOURCE_TILE_HEIGHT * 4,
|
||||
SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT))
|
||||
when 4 # Bottom right corner
|
||||
new_bitmap.blt(dest_x, dest_y, bitmap,
|
||||
Rect.new(SOURCE_TILE_WIDTH + frame * SOURCE_TILE_WIDTH * 3, SOURCE_TILE_HEIGHT * 5,
|
||||
Rect.new(SOURCE_TILE_WIDTH + (frame * SOURCE_TILE_WIDTH * 3), SOURCE_TILE_HEIGHT * 5,
|
||||
SOURCE_TILE_WIDTH, SOURCE_TILE_HEIGHT))
|
||||
when 8 # Bottom left corner
|
||||
new_bitmap.blt(dest_x, dest_y, bitmap,
|
||||
|
||||
@@ -89,7 +89,7 @@ class TileDrawingHelper
|
||||
|
||||
def bltSmallAutotile(bitmap, x, y, cxTile, cyTile, id, frame)
|
||||
return if id >= 384 || frame < 0 || !@autotiles
|
||||
autotile = @autotiles[id / 48 - 1]
|
||||
autotile = @autotiles[(id / 48) - 1]
|
||||
return if !autotile || autotile.disposed?
|
||||
cxTile = [cxTile / 2, 1].max
|
||||
cyTile = [cyTile / 2, 1].max
|
||||
@@ -104,8 +104,8 @@ class TileDrawingHelper
|
||||
src = Rect.new(0, 0, 0, 0)
|
||||
for i in 0...4
|
||||
tile_position = tiles[i] - 1
|
||||
src.set(tile_position % 6 * 16 + anim, tile_position / 6 * 16, 16, 16)
|
||||
bitmap.stretch_blt(Rect.new(i % 2 * cxTile + x, i / 2 * cyTile + y, cxTile, cyTile),
|
||||
src.set((tile_position % 6 * 16) + anim, tile_position / 6 * 16, 16, 16)
|
||||
bitmap.stretch_blt(Rect.new((i % 2 * cxTile) + x, (i / 2 * cyTile) + y, cxTile, cyTile),
|
||||
autotile, src)
|
||||
end
|
||||
end
|
||||
@@ -180,9 +180,9 @@ def bltMinimapAutotile(dstBitmap, x, y, srcBitmap, id)
|
||||
src = Rect.new(0, 0, 0, 0)
|
||||
for i in 0...4
|
||||
tile_position = tiles[i] - 1
|
||||
src.set(tile_position % 6 * cxTile + anim,
|
||||
src.set((tile_position % 6 * cxTile) + anim,
|
||||
tile_position / 6 * cyTile, cxTile, cyTile)
|
||||
dstBitmap.blt(i % 2 * cxTile + x, i / 2 * cyTile + y, srcBitmap, src)
|
||||
dstBitmap.blt((i % 2 * cxTile) + x, (i / 2 * cyTile) + y, srcBitmap, src)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -146,9 +146,10 @@ module MessageConfig
|
||||
def self.pbTryFonts(*args)
|
||||
for a in args
|
||||
next if !a
|
||||
if a.is_a?(String)
|
||||
case a
|
||||
when String
|
||||
return a if Font.exist?(a)
|
||||
elsif a.is_a?(Array)
|
||||
when Array
|
||||
for aa in a
|
||||
ret = MessageConfig.pbTryFonts(aa)
|
||||
return ret if ret != ""
|
||||
@@ -177,7 +178,7 @@ end
|
||||
def pbBottomLeftLines(window, lines, width = nil)
|
||||
window.x = 0
|
||||
window.width = width ? width : Graphics.width
|
||||
window.height = (window.borderY rescue 32) + lines * 32
|
||||
window.height = (window.borderY rescue 32) + (lines * 32)
|
||||
window.y = Graphics.height - window.height
|
||||
end
|
||||
|
||||
@@ -230,7 +231,7 @@ end
|
||||
|
||||
# internal function
|
||||
def pbRepositionMessageWindow(msgwindow, linecount = 2)
|
||||
msgwindow.height = 32 * linecount + msgwindow.borderY
|
||||
msgwindow.height = (32 * linecount) + msgwindow.borderY
|
||||
msgwindow.y = (Graphics.height) - (msgwindow.height)
|
||||
if $game_system
|
||||
case $game_system.message_position
|
||||
@@ -278,10 +279,10 @@ def isDarkBackground(background, rect = nil)
|
||||
return true if rect.width <= 0 || rect.height <= 0
|
||||
xSeg = (rect.width / 16)
|
||||
xLoop = (xSeg == 0) ? 1 : 16
|
||||
xStart = (xSeg == 0) ? rect.x + (rect.width / 2) : rect.x + xSeg / 2
|
||||
xStart = (xSeg == 0) ? rect.x + (rect.width / 2) : rect.x + (xSeg / 2)
|
||||
ySeg = (rect.height / 16)
|
||||
yLoop = (ySeg == 0) ? 1 : 16
|
||||
yStart = (ySeg == 0) ? rect.y + (rect.height / 2) : rect.y + ySeg / 2
|
||||
yStart = (ySeg == 0) ? rect.y + (rect.height / 2) : rect.y + (ySeg / 2)
|
||||
count = 0
|
||||
y = yStart
|
||||
r = g = b = 0
|
||||
@@ -303,7 +304,7 @@ def isDarkBackground(background, rect = nil)
|
||||
r /= count
|
||||
g /= count
|
||||
b /= count
|
||||
return (r * 0.299 + g * 0.587 + b * 0.114) < 160
|
||||
return ((r * 0.299) + (g * 0.587) + (b * 0.114)) < 160
|
||||
end
|
||||
|
||||
def isDarkWindowskin(windowskin)
|
||||
@@ -316,7 +317,7 @@ def isDarkWindowskin(windowskin)
|
||||
return isDarkBackground(windowskin, Rect.new(32, 16, 16, 16))
|
||||
else
|
||||
clr = windowskin.get_pixel(windowskin.width / 2, windowskin.height / 2)
|
||||
return (clr.red * 0.299 + clr.green * 0.587 + clr.blue * 0.114) < 160
|
||||
return ((clr.red * 0.299) + (clr.green * 0.587) + (clr.blue * 0.114)) < 160
|
||||
end
|
||||
end
|
||||
|
||||
@@ -328,20 +329,20 @@ def getSkinColor(windowskin, color, isDarkSkin)
|
||||
windowskin.width != 128 || windowskin.height != 128
|
||||
# Base color, shadow color (these are reversed on dark windowskins)
|
||||
textcolors = [
|
||||
"0070F8", "78B8E8", # 1 Blue
|
||||
"E82010", "F8A8B8", # 2 Red
|
||||
"60B048", "B0D090", # 3 Green
|
||||
"48D8D8", "A8E0E0", # 4 Cyan
|
||||
"D038B8", "E8A0E0", # 5 Magenta
|
||||
"E8D020", "F8E888", # 6 Yellow
|
||||
"A0A0A8", "D0D0D8", # 7 Grey
|
||||
"F0F0F8", "C8C8D0", # 8 White
|
||||
"9040E8", "B8A8E0", # 9 Purple
|
||||
"F89818", "F8C898", # 10 Orange
|
||||
colorToRgb32(MessageConfig::DARK_TEXT_MAIN_COLOR),
|
||||
colorToRgb32(MessageConfig::DARK_TEXT_SHADOW_COLOR), # 11 Dark default
|
||||
colorToRgb32(MessageConfig::LIGHT_TEXT_MAIN_COLOR),
|
||||
colorToRgb32(MessageConfig::LIGHT_TEXT_SHADOW_COLOR) # 12 Light default
|
||||
"0070F8", "78B8E8", # 1 Blue
|
||||
"E82010", "F8A8B8", # 2 Red
|
||||
"60B048", "B0D090", # 3 Green
|
||||
"48D8D8", "A8E0E0", # 4 Cyan
|
||||
"D038B8", "E8A0E0", # 5 Magenta
|
||||
"E8D020", "F8E888", # 6 Yellow
|
||||
"A0A0A8", "D0D0D8", # 7 Grey
|
||||
"F0F0F8", "C8C8D0", # 8 White
|
||||
"9040E8", "B8A8E0", # 9 Purple
|
||||
"F89818", "F8C898", # 10 Orange
|
||||
colorToRgb32(MessageConfig::DARK_TEXT_MAIN_COLOR),
|
||||
colorToRgb32(MessageConfig::DARK_TEXT_SHADOW_COLOR), # 11 Dark default
|
||||
colorToRgb32(MessageConfig::LIGHT_TEXT_MAIN_COLOR),
|
||||
colorToRgb32(MessageConfig::LIGHT_TEXT_SHADOW_COLOR) # 12 Light default
|
||||
]
|
||||
if color == 0 || color > textcolors.length / 2 # No special colour, use default
|
||||
if isDarkSkin # Dark background, light text
|
||||
@@ -352,14 +353,14 @@ def getSkinColor(windowskin, color, isDarkSkin)
|
||||
end
|
||||
# Special colour as listed above
|
||||
if isDarkSkin && color != 12 # Dark background, light text
|
||||
return sprintf("<c3=%s,%s>", textcolors[2 * (color - 1) + 1], textcolors[2 * (color - 1)])
|
||||
return sprintf("<c3=%s,%s>", textcolors[(2 * (color - 1)) + 1], textcolors[2 * (color - 1)])
|
||||
end
|
||||
# Light background, dark text
|
||||
return sprintf("<c3=%s,%s>", textcolors[2 * (color - 1)], textcolors[2 * (color - 1) + 1])
|
||||
return sprintf("<c3=%s,%s>", textcolors[2 * (color - 1)], textcolors[(2 * (color - 1)) + 1])
|
||||
else # VX windowskin
|
||||
color = 0 if color >= 32
|
||||
x = 64 + (color % 8) * 8
|
||||
y = 96 + (color / 8) * 8
|
||||
x = 64 + ((color % 8) * 8)
|
||||
y = 96 + ((color / 8) * 8)
|
||||
pixel = windowskin.get_pixel(x, y)
|
||||
return shadowctagFromColor(pixel)
|
||||
end
|
||||
@@ -441,10 +442,10 @@ def pbSrcOver(dstColor, srcColor)
|
||||
cg = dstColor.green * dstColor.alpha / 255
|
||||
cb = dstColor.blue * dstColor.alpha / 255
|
||||
ica = 255 - dstColor.alpha
|
||||
a = 255 - (iea * ica) / 255
|
||||
r = (iea * cr) / 255 + er
|
||||
g = (iea * cg) / 255 + eg
|
||||
b = (iea * cb) / 255 + eb
|
||||
a = 255 - ((iea * ica) / 255)
|
||||
r = ((iea * cr) / 255) + er
|
||||
g = ((iea * cg) / 255) + eg
|
||||
b = ((iea * cb) / 255) + eb
|
||||
r = (a == 0) ? 0 : r * 255 / a
|
||||
g = (a == 0) ? 0 : g * 255 / a
|
||||
b = (a == 0) ? 0 : b * 255 / a
|
||||
|
||||
@@ -78,12 +78,12 @@ class Window
|
||||
def initialize(viewport = nil)
|
||||
@sprites = {}
|
||||
@spritekeys = [
|
||||
"back",
|
||||
"corner0", "side0", "scroll0",
|
||||
"corner1", "side1", "scroll1",
|
||||
"corner2", "side2", "scroll2",
|
||||
"corner3", "side3", "scroll3",
|
||||
"cursor", "contents", "pause"
|
||||
"back",
|
||||
"corner0", "side0", "scroll0",
|
||||
"corner1", "side1", "scroll1",
|
||||
"corner2", "side2", "scroll2",
|
||||
"corner3", "side3", "scroll3",
|
||||
"cursor", "contents", "pause"
|
||||
]
|
||||
@sidebitmaps = [nil, nil, nil, nil]
|
||||
@cursorbitmap = nil
|
||||
@@ -444,10 +444,10 @@ class Window
|
||||
cursorX = trimX
|
||||
cursorY = trimY + 64
|
||||
sideRects = [
|
||||
Rect.new(trimX + 16, trimY + 0, 32, 16),
|
||||
Rect.new(trimX, trimY + 16, 16, 32),
|
||||
Rect.new(trimX + 48, trimY + 16, 16, 32),
|
||||
Rect.new(trimX + 16, trimY + 48, 32, 16)
|
||||
Rect.new(trimX + 16, trimY + 0, 32, 16),
|
||||
Rect.new(trimX, trimY + 16, 16, 32),
|
||||
Rect.new(trimX + 48, trimY + 16, 16, 32),
|
||||
Rect.new(trimX + 16, trimY + 48, 32, 16)
|
||||
]
|
||||
if @width > 32 && @height > 32
|
||||
@sprites["contents"].src_rect.set(@ox, @oy, @width - 32, @height - 32)
|
||||
@@ -455,15 +455,15 @@ class Window
|
||||
@sprites["contents"].src_rect.set(0, 0, 0, 0)
|
||||
end
|
||||
pauseRects = [
|
||||
trimX + 32, trimY + 64,
|
||||
trimX + 48, trimY + 64,
|
||||
trimX + 32, trimY + 80,
|
||||
trimX + 48, trimY + 80
|
||||
trimX + 32, trimY + 64,
|
||||
trimX + 48, trimY + 64,
|
||||
trimX + 32, trimY + 80,
|
||||
trimX + 48, trimY + 80
|
||||
]
|
||||
pauseWidth = 16
|
||||
pauseHeight = 16
|
||||
@sprites["pause"].src_rect.set(pauseRects[@pauseframe * 2],
|
||||
pauseRects[@pauseframe * 2 + 1],
|
||||
pauseRects[(@pauseframe * 2) + 1],
|
||||
pauseWidth,
|
||||
pauseHeight)
|
||||
@sprites["pause"].x = @x + (@width / 2) - (pauseWidth / 2)
|
||||
@@ -486,13 +486,13 @@ class Window
|
||||
@sprites["side2"].y = @y + 16
|
||||
@sprites["side3"].x = @x + 16
|
||||
@sprites["side3"].y = @y + @height - 16
|
||||
@sprites["scroll0"].x = @x + @width / 2 - 8
|
||||
@sprites["scroll0"].x = @x + (@width / 2) - 8
|
||||
@sprites["scroll0"].y = @y + 8
|
||||
@sprites["scroll1"].x = @x + 8
|
||||
@sprites["scroll1"].y = @y + @height / 2 - 8
|
||||
@sprites["scroll1"].y = @y + (@height / 2) - 8
|
||||
@sprites["scroll2"].x = @x + @width - 16
|
||||
@sprites["scroll2"].y = @y + @height / 2 - 8
|
||||
@sprites["scroll3"].x = @x + @width / 2 - 8
|
||||
@sprites["scroll2"].y = @y + (@height / 2) - 8
|
||||
@sprites["scroll3"].x = @x + (@width / 2) - 8
|
||||
@sprites["scroll3"].y = @y + @height - 16
|
||||
@sprites["back"].x = @x + 2
|
||||
@sprites["back"].y = @y + 2
|
||||
@@ -503,18 +503,18 @@ class Window
|
||||
height = @cursor_rect.height
|
||||
if width > 0 && height > 0
|
||||
cursorrects = [
|
||||
# sides
|
||||
Rect.new(cursorX + 2, cursorY + 0, 28, 2),
|
||||
Rect.new(cursorX + 0, cursorY + 2, 2, 28),
|
||||
Rect.new(cursorX + 30, cursorY + 2, 2, 28),
|
||||
Rect.new(cursorX + 2, cursorY + 30, 28, 2),
|
||||
# corners
|
||||
Rect.new(cursorX + 0, cursorY + 0, 2, 2),
|
||||
Rect.new(cursorX + 30, cursorY + 0, 2, 2),
|
||||
Rect.new(cursorX + 0, cursorY + 30, 2, 2),
|
||||
Rect.new(cursorX + 30, cursorY + 30, 2, 2),
|
||||
# back
|
||||
Rect.new(cursorX + 2, cursorY + 2, 28, 28)
|
||||
# sides
|
||||
Rect.new(cursorX + 2, cursorY + 0, 28, 2),
|
||||
Rect.new(cursorX + 0, cursorY + 2, 2, 28),
|
||||
Rect.new(cursorX + 30, cursorY + 2, 2, 28),
|
||||
Rect.new(cursorX + 2, cursorY + 30, 28, 2),
|
||||
# corners
|
||||
Rect.new(cursorX + 0, cursorY + 0, 2, 2),
|
||||
Rect.new(cursorX + 30, cursorY + 0, 2, 2),
|
||||
Rect.new(cursorX + 0, cursorY + 30, 2, 2),
|
||||
Rect.new(cursorX + 30, cursorY + 30, 2, 2),
|
||||
# back
|
||||
Rect.new(cursorX + 2, cursorY + 2, 28, 28)
|
||||
]
|
||||
margin = 2
|
||||
fullmargin = 4
|
||||
@@ -575,7 +575,7 @@ class Window
|
||||
opn = @openness / 255.0
|
||||
for k in @spritekeys
|
||||
sprite = @sprites[k]
|
||||
ratio = (@height <= 0) ? 0 : (sprite.y - @y) * 1.0 / @height
|
||||
ratio = (@height <= 0) ? 0 : (sprite.y - @y) / @height.to_f
|
||||
sprite.zoom_y = opn
|
||||
sprite.oy = 0
|
||||
sprite.y = (@y + (@height / 2.0) + (@height * ratio * opn) - (@height / 2 * opn)).floor
|
||||
|
||||
@@ -55,12 +55,12 @@ class SpriteWindow < Window
|
||||
def initialize(viewport = nil)
|
||||
@sprites = {}
|
||||
@spritekeys = [
|
||||
"back",
|
||||
"corner0", "side0", "scroll0",
|
||||
"corner1", "side1", "scroll1",
|
||||
"corner2", "side2", "scroll2",
|
||||
"corner3", "side3", "scroll3",
|
||||
"cursor", "contents", "pause"
|
||||
"back",
|
||||
"corner0", "side0", "scroll0",
|
||||
"corner1", "side1", "scroll1",
|
||||
"corner2", "side2", "scroll2",
|
||||
"corner3", "side3", "scroll3",
|
||||
"cursor", "contents", "pause"
|
||||
]
|
||||
@viewport = viewport
|
||||
@sidebitmaps = [nil, nil, nil, nil]
|
||||
@@ -578,25 +578,21 @@ class SpriteWindow < Window
|
||||
@sprites["scroll2"].src_rect.set(trimX + 40, trimY + 24, 8, 16) # right
|
||||
cursorX = trimX
|
||||
cursorY = trimY + 64
|
||||
sideRects = [
|
||||
Rect.new(trimX + 16, trimY + 0, 32, 16),
|
||||
Rect.new(trimX, trimY + 16, 16, 32),
|
||||
Rect.new(trimX + 48, trimY + 16, 16, 32),
|
||||
Rect.new(trimX + 16, trimY + 48, 32, 16)
|
||||
]
|
||||
pauseRects = [
|
||||
trimX + 32, trimY + 64,
|
||||
trimX + 48, trimY + 64,
|
||||
trimX + 32, trimY + 80,
|
||||
trimX + 48, trimY + 80
|
||||
]
|
||||
sideRects = [Rect.new(trimX + 16, trimY + 0, 32, 16),
|
||||
Rect.new(trimX, trimY + 16, 16, 32),
|
||||
Rect.new(trimX + 48, trimY + 16, 16, 32),
|
||||
Rect.new(trimX + 16, trimY + 48, 32, 16)]
|
||||
pauseRects = [trimX + 32, trimY + 64,
|
||||
trimX + 48, trimY + 64,
|
||||
trimX + 32, trimY + 80,
|
||||
trimX + 48, trimY + 80]
|
||||
pauseWidth = 16
|
||||
pauseHeight = 16
|
||||
@sprites["pause"].src_rect.set(
|
||||
pauseRects[@pauseframe * 2],
|
||||
pauseRects[@pauseframe * 2 + 1],
|
||||
pauseWidth, pauseHeight
|
||||
)
|
||||
pauseRects[@pauseframe * 2],
|
||||
pauseRects[(@pauseframe * 2) + 1],
|
||||
pauseWidth, pauseHeight
|
||||
)
|
||||
end
|
||||
else
|
||||
trimStartX = @trim[0]
|
||||
@@ -621,10 +617,10 @@ class SpriteWindow < Window
|
||||
backRect = Rect.new(@skinrect.x, @skinrect.y, @skinrect.width, @skinrect.height)
|
||||
blindsRect = nil
|
||||
sideRects = [
|
||||
Rect.new(startX, 0, @skinrect.width, startY), # side0 (top)
|
||||
Rect.new(0, startY, startX, @skinrect.height), # side1 (left)
|
||||
Rect.new(cx, startY, endX, @skinrect.height), # side2 (right)
|
||||
Rect.new(startX, cy, @skinrect.width, endY) # side3 (bottom)
|
||||
Rect.new(startX, 0, @skinrect.width, startY), # side0 (top)
|
||||
Rect.new(0, startY, startX, @skinrect.height), # side1 (left)
|
||||
Rect.new(cx, startY, endX, @skinrect.height), # side2 (right)
|
||||
Rect.new(startX, cy, @skinrect.width, endY) # side3 (bottom)
|
||||
]
|
||||
end
|
||||
end
|
||||
@@ -664,13 +660,13 @@ class SpriteWindow < Window
|
||||
@sprites["side2"].y = @y + startY
|
||||
@sprites["side3"].x = @x + startX
|
||||
@sprites["side3"].y = @y + @height - endY
|
||||
@sprites["scroll0"].x = @x + @width / 2 - 8
|
||||
@sprites["scroll0"].x = @x + (@width / 2) - 8
|
||||
@sprites["scroll0"].y = @y + 8
|
||||
@sprites["scroll1"].x = @x + 8
|
||||
@sprites["scroll1"].y = @y + @height / 2 - 8
|
||||
@sprites["scroll1"].y = @y + (@height / 2) - 8
|
||||
@sprites["scroll2"].x = @x + @width - 16
|
||||
@sprites["scroll2"].y = @y + @height / 2 - 8
|
||||
@sprites["scroll3"].x = @x + @width / 2 - 8
|
||||
@sprites["scroll2"].y = @y + (@height / 2) - 8
|
||||
@sprites["scroll3"].x = @x + (@width / 2) - 8
|
||||
@sprites["scroll3"].y = @y + @height - 16
|
||||
@sprites["cursor"].x = @x + startX + @cursor_rect.x
|
||||
@sprites["cursor"].y = @y + startY + @cursor_rect.y
|
||||
@@ -691,18 +687,18 @@ class SpriteWindow < Window
|
||||
height = @cursor_rect.height
|
||||
if width > 0 && height > 0
|
||||
cursorrects = [
|
||||
# sides
|
||||
Rect.new(cursorX + 2, cursorY + 0, 28, 2),
|
||||
Rect.new(cursorX + 0, cursorY + 2, 2, 28),
|
||||
Rect.new(cursorX + 30, cursorY + 2, 2, 28),
|
||||
Rect.new(cursorX + 2, cursorY + 30, 28, 2),
|
||||
# corners
|
||||
Rect.new(cursorX + 0, cursorY + 0, 2, 2),
|
||||
Rect.new(cursorX + 30, cursorY + 0, 2, 2),
|
||||
Rect.new(cursorX + 0, cursorY + 30, 2, 2),
|
||||
Rect.new(cursorX + 30, cursorY + 30, 2, 2),
|
||||
# back
|
||||
Rect.new(cursorX + 2, cursorY + 2, 28, 28)
|
||||
# sides
|
||||
Rect.new(cursorX + 2, cursorY + 0, 28, 2),
|
||||
Rect.new(cursorX + 0, cursorY + 2, 2, 28),
|
||||
Rect.new(cursorX + 30, cursorY + 2, 2, 28),
|
||||
Rect.new(cursorX + 2, cursorY + 30, 28, 2),
|
||||
# corners
|
||||
Rect.new(cursorX + 0, cursorY + 0, 2, 2),
|
||||
Rect.new(cursorX + 30, cursorY + 0, 2, 2),
|
||||
Rect.new(cursorX + 0, cursorY + 30, 2, 2),
|
||||
Rect.new(cursorX + 30, cursorY + 30, 2, 2),
|
||||
# back
|
||||
Rect.new(cursorX + 2, cursorY + 2, 28, 28)
|
||||
]
|
||||
margin = 2
|
||||
fullmargin = 4
|
||||
@@ -789,7 +785,7 @@ class SpriteWindow < Window
|
||||
opn = @openness / 255.0
|
||||
for k in @spritekeys
|
||||
sprite = @sprites[k]
|
||||
ratio = (@height <= 0) ? 0 : (sprite.y - @y) * 1.0 / @height
|
||||
ratio = (@height <= 0) ? 0 : (sprite.y - @y) / @height.to_f
|
||||
sprite.zoom_y = opn
|
||||
sprite.zoom_x = 1.0
|
||||
sprite.oy = 0
|
||||
@@ -845,8 +841,8 @@ class SpriteWindow_Base < SpriteWindow
|
||||
end
|
||||
|
||||
def __setWindowskin(skin)
|
||||
if skin && (skin.width == 192 && skin.height == 128) || # RPGXP Windowskin
|
||||
(skin.width == 128 && skin.height == 128) # RPGVX Windowskin
|
||||
if skin && ((skin.width == 192 && skin.height == 128) || # RPGXP Windowskin
|
||||
(skin.width == 128 && skin.height == 128)) # RPGVX Windowskin
|
||||
self.skinformat = 0
|
||||
else
|
||||
self.skinformat = 1
|
||||
|
||||
@@ -621,7 +621,7 @@ class Window_InputNumberPokemon < SpriteWindow_Base
|
||||
@sign = false
|
||||
@negative = false
|
||||
super(0, 0, 32, 32)
|
||||
self.width = digits_max * 24 + 8 + self.borderX
|
||||
self.width = (digits_max * 24) + 8 + self.borderX
|
||||
self.height = 32 + self.borderY
|
||||
colors = getDefaultTextColors(self.windowskin)
|
||||
@baseColor = colors[0]
|
||||
@@ -644,16 +644,16 @@ class Window_InputNumberPokemon < SpriteWindow_Base
|
||||
value = 0 if !value.is_a?(Numeric)
|
||||
if @sign
|
||||
@negative = (value < 0)
|
||||
@number = [value.abs, 10**@digits_max - 1].min
|
||||
@number = [value.abs, (10**@digits_max) - 1].min
|
||||
else
|
||||
@number = [[value, 0].max, 10**@digits_max - 1].min
|
||||
@number = [[value, 0].max, (10**@digits_max) - 1].min
|
||||
end
|
||||
refresh
|
||||
end
|
||||
|
||||
def sign=(value)
|
||||
@sign = value
|
||||
self.width = @digits_max * 24 + 8 + self.borderX + (@sign ? 24 : 0)
|
||||
self.width = (@digits_max * 24) + 8 + self.borderX + (@sign ? 24 : 0)
|
||||
@index = (@digits_max - 1) + (@sign ? 1 : 0)
|
||||
refresh
|
||||
end
|
||||
@@ -717,9 +717,9 @@ class Window_InputNumberPokemon < SpriteWindow_Base
|
||||
|
||||
def textHelper(x, y, text, i)
|
||||
textwidth = self.contents.text_size(text).width
|
||||
pbDrawShadowText(self.contents, x + (12 - textwidth / 2), y, textwidth + 4, 32, text, @baseColor, @shadowColor)
|
||||
pbDrawShadowText(self.contents, x + (12 - (textwidth / 2)), y, textwidth + 4, 32, text, @baseColor, @shadowColor)
|
||||
if @index == i && @active && @frame / 15 == 0
|
||||
self.contents.fill_rect(x + (12 - textwidth / 2), y + 30, textwidth, 2, @baseColor)
|
||||
self.contents.fill_rect(x + (12 - (textwidth / 2)), y + 30, textwidth, 2, @baseColor)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -825,9 +825,9 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
||||
item > self.top_item + self.page_item_max
|
||||
return Rect.new(0, 0, 0, 0)
|
||||
else
|
||||
cursor_width = (self.width - self.borderX - (@column_max - 1) * @column_spacing) / @column_max
|
||||
cursor_width = (self.width - self.borderX - ((@column_max - 1) * @column_spacing)) / @column_max
|
||||
x = item % @column_max * (cursor_width + @column_spacing)
|
||||
y = item / @column_max * @row_height - @virtualOy
|
||||
y = (item / @column_max * @row_height) - @virtualOy
|
||||
return Rect.new(x, y, cursor_width, @row_height)
|
||||
end
|
||||
end
|
||||
@@ -946,7 +946,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
||||
# End of code
|
||||
cursor_width = (self.width - self.borderX) / @column_max
|
||||
x = self.index % @column_max * (cursor_width + @column_spacing)
|
||||
y = self.index / @column_max * @row_height - @virtualOy
|
||||
y = (self.index / @column_max * @row_height) - @virtualOy
|
||||
self.cursor_rect.set(x, y, cursor_width, @row_height)
|
||||
self.refresh if dorefresh || force
|
||||
end
|
||||
@@ -992,8 +992,8 @@ module UpDownArrowMixin
|
||||
def adjustForZoom(sprite)
|
||||
sprite.zoom_x = self.zoom_x
|
||||
sprite.zoom_y = self.zoom_y
|
||||
sprite.x = sprite.x * self.zoom_x + self.offset_x / self.zoom_x
|
||||
sprite.y = sprite.y * self.zoom_y + self.offset_y / self.zoom_y
|
||||
sprite.x = (sprite.x * self.zoom_x) + (self.offset_x / self.zoom_x)
|
||||
sprite.y = (sprite.y * self.zoom_y) + (self.offset_y / self.zoom_y)
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -1093,7 +1093,7 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
|
||||
end
|
||||
# Store suggested width and height of window
|
||||
dims[0] = [self.borderX + 1,
|
||||
(width * self.columns) + self.borderX + (self.columns - 1) * self.columnSpacing].max
|
||||
(width * self.columns) + self.borderX + ((self.columns - 1) * self.columnSpacing)].max
|
||||
dims[1] = [self.borderY + 1, windowheight].max
|
||||
dims[1] = [dims[1], Graphics.height].min
|
||||
end
|
||||
|
||||
@@ -94,12 +94,13 @@ class PictureWindow < SpriteWindow_Base
|
||||
def setBitmap(pathOrBitmap, hue = 0)
|
||||
clearBitmaps
|
||||
if pathOrBitmap != nil && pathOrBitmap != ""
|
||||
if pathOrBitmap.is_a?(Bitmap)
|
||||
case pathOrBitmap
|
||||
when Bitmap
|
||||
@_iconbitmap = pathOrBitmap
|
||||
self.contents = @_iconbitmap
|
||||
self.width = @_iconbitmap.width + self.borderX
|
||||
self.height = @_iconbitmap.height + self.borderY
|
||||
elsif pathOrBitmap.is_a?(AnimatedBitmap)
|
||||
when AnimatedBitmap
|
||||
@_iconbitmap = pathOrBitmap
|
||||
self.contents = @_iconbitmap.bitmap
|
||||
self.width = @_iconbitmap.bitmap.width + self.borderX
|
||||
|
||||
@@ -48,35 +48,35 @@ def rgbToColor(param)
|
||||
case param.length
|
||||
when 8 # 32-bit hex
|
||||
return Color.new(
|
||||
(baseint >> 24) & 0xFF,
|
||||
(baseint >> 16) & 0xFF,
|
||||
(baseint >> 8) & 0xFF,
|
||||
(baseint) & 0xFF
|
||||
(baseint >> 24) & 0xFF,
|
||||
(baseint >> 16) & 0xFF,
|
||||
(baseint >> 8) & 0xFF,
|
||||
(baseint) & 0xFF
|
||||
)
|
||||
when 6 # 24-bit hex
|
||||
return Color.new(
|
||||
(baseint >> 16) & 0xFF,
|
||||
(baseint >> 8) & 0xFF,
|
||||
(baseint) & 0xFF
|
||||
(baseint >> 16) & 0xFF,
|
||||
(baseint >> 8) & 0xFF,
|
||||
(baseint) & 0xFF
|
||||
)
|
||||
when 4 # 16-bit hex
|
||||
return Color.new(
|
||||
((baseint) & 0x1F) << 3,
|
||||
((baseint >> 5) & 0x1F) << 3,
|
||||
((baseint >> 10) & 0x1F) << 3
|
||||
((baseint) & 0x1F) << 3,
|
||||
((baseint >> 5) & 0x1F) << 3,
|
||||
((baseint >> 10) & 0x1F) << 3
|
||||
)
|
||||
when 1 # Color number
|
||||
i = param.to_i
|
||||
return Font.default_color if i >= 8
|
||||
return [
|
||||
Color.new(255, 255, 255, 255),
|
||||
Color.new(128, 128, 255, 255),
|
||||
Color.new(255, 128, 128, 255),
|
||||
Color.new(128, 255, 128, 255),
|
||||
Color.new(128, 255, 255, 255),
|
||||
Color.new(255, 128, 255, 255),
|
||||
Color.new(255, 255, 128, 255),
|
||||
Color.new(192, 192, 192, 255)
|
||||
Color.new(255, 255, 255, 255),
|
||||
Color.new(128, 128, 255, 255),
|
||||
Color.new(255, 128, 128, 255),
|
||||
Color.new(128, 255, 128, 255),
|
||||
Color.new(128, 255, 255, 255),
|
||||
Color.new(255, 128, 255, 255),
|
||||
Color.new(255, 255, 128, 255),
|
||||
Color.new(192, 192, 192, 255)
|
||||
][i]
|
||||
else
|
||||
return Font.default_color
|
||||
@@ -86,9 +86,9 @@ end
|
||||
def Rgb16ToColor(param)
|
||||
baseint = param.to_i(16)
|
||||
return Color.new(
|
||||
((baseint) & 0x1F) << 3,
|
||||
((baseint >> 5) & 0x1F) << 3,
|
||||
((baseint >> 10) & 0x1F) << 3
|
||||
((baseint) & 0x1F) << 3,
|
||||
((baseint >> 5) & 0x1F) << 3,
|
||||
((baseint >> 10) & 0x1F) << 3
|
||||
)
|
||||
end
|
||||
|
||||
@@ -98,9 +98,9 @@ def getContrastColor(color)
|
||||
g = color.green
|
||||
b = color.blue
|
||||
yuv = [
|
||||
r * 0.299 + g * 0.587 + b * 0.114,
|
||||
r * -0.1687 + g * -0.3313 + b * 0.500 + 0.5,
|
||||
r * 0.500 + g * -0.4187 + b * -0.0813 + 0.5
|
||||
(r * 0.299) + (g * 0.587) + (b * 0.114),
|
||||
(r * -0.1687) + (g * -0.3313) + (b * 0.500) + 0.5,
|
||||
(r * 0.500) + (g * -0.4187) + (b * -0.0813) + 0.5
|
||||
]
|
||||
if yuv[0] < 127.5
|
||||
yuv[0] += (255 - yuv[0]) / 2
|
||||
@@ -108,10 +108,10 @@ def getContrastColor(color)
|
||||
yuv[0] = yuv[0] / 2
|
||||
end
|
||||
return Color.new(
|
||||
yuv[0] + 1.4075 * (yuv[2] - 0.5),
|
||||
yuv[0] - 0.3455 * (yuv[1] - 0.5) - 0.7169 * (yuv[2] - 0.5),
|
||||
yuv[0] + 1.7790 * (yuv[1] - 0.5),
|
||||
color.alpha
|
||||
yuv[0] + (1.4075 * (yuv[2] - 0.5)),
|
||||
yuv[0] - (0.3455 * (yuv[1] - 0.5)) - (0.7169 * (yuv[2] - 0.5)),
|
||||
yuv[0] + (1.7790 * (yuv[1] - 0.5)),
|
||||
color.alpha
|
||||
)
|
||||
end
|
||||
|
||||
@@ -198,7 +198,7 @@ def getFormattedTextFast(bitmap, xDst, yDst, widthDst, heightDst, text, lineheig
|
||||
if textchars[position] == "\n"
|
||||
if newlineBreaks # treat newline as break
|
||||
havenl = true
|
||||
characters.push(["\n", x, y * lineheight + yDst, 0, lineheight, false, false,
|
||||
characters.push(["\n", x, (y * lineheight) + yDst, 0, lineheight, false, false,
|
||||
false, colorclone, nil, false, false, "", 8, position, nil, 0])
|
||||
y += 1
|
||||
x = 0
|
||||
@@ -224,18 +224,16 @@ def getFormattedTextFast(bitmap, xDst, yDst, widthDst, heightDst, text, lineheig
|
||||
# Push character
|
||||
if heightDst < 0 || yStart < yDst + heightDst
|
||||
havenl = true if isWaitChar(textchars[position])
|
||||
characters.push([
|
||||
textchars[position],
|
||||
x + xStart, texty, width + 2, lineheight,
|
||||
false, bold, italic, colorclone, nil, false, false,
|
||||
defaultfontname, bitmap.font.size, position, nil, 0
|
||||
])
|
||||
characters.push([textchars[position],
|
||||
x + xStart, texty, width + 2, lineheight,
|
||||
false, bold, italic, colorclone, nil, false, false,
|
||||
defaultfontname, bitmap.font.size, position, nil, 0])
|
||||
end
|
||||
x += width
|
||||
if !explicitBreaksOnly && x + 2 > widthDst && lastword[1] != 0 &&
|
||||
(!hadnonspace || !hadspace)
|
||||
havenl = true
|
||||
characters.insert(lastword[0], ["\n", x, y * lineheight + yDst, 0, lineheight,
|
||||
characters.insert(lastword[0], ["\n", x, (y * lineheight) + yDst, 0, lineheight,
|
||||
false, false, false, colorclone, nil, false, false, "", 8, position])
|
||||
lastword[0] += 1
|
||||
y += 1
|
||||
@@ -626,7 +624,7 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
|
||||
end
|
||||
nextline.times do
|
||||
havenl = true
|
||||
characters.push(["\n", x, y * lineheight + yDst, 0, lineheight, false, false, false,
|
||||
characters.push(["\n", x, (y * lineheight) + yDst, 0, lineheight, false, false, false,
|
||||
defaultcolors[0], defaultcolors[1], false, false, "", 8, position, nil, 0])
|
||||
charactersInternal.push([alignment, y, 0])
|
||||
y += 1
|
||||
@@ -640,7 +638,7 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
|
||||
if newlineBreaks
|
||||
if nextline == 0
|
||||
havenl = true
|
||||
characters.push(["\n", x, y * lineheight + yDst, 0, lineheight, false, false, false,
|
||||
characters.push(["\n", x, (y * lineheight) + yDst, 0, lineheight, false, false, false,
|
||||
defaultcolors[0], defaultcolors[1], false, false, "", 8, position, nil, 0])
|
||||
charactersInternal.push([alignment, y, 0])
|
||||
y += 1
|
||||
@@ -675,22 +673,20 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
|
||||
if heightDst < 0 || texty < yDst + heightDst
|
||||
havenl = true if !graphic && isWaitChar(textchars[position])
|
||||
extraspace = (!graphic && italiccount > 0) ? 2 + (width / 2) : 2
|
||||
characters.push([
|
||||
graphic || textchars[position],
|
||||
x + xStart, texty, width + extraspace, lineheight,
|
||||
graphic ? true : false,
|
||||
(boldcount > 0), (italiccount > 0), colors[0], colors[1],
|
||||
(underlinecount > 0), (strikecount > 0), fontname, fontsize,
|
||||
position, graphicRect,
|
||||
((outlinecount > 0) ? 1 : 0) + ((outline2count > 0) ? 2 : 0)
|
||||
])
|
||||
characters.push([graphic || textchars[position],
|
||||
x + xStart, texty, width + extraspace, lineheight,
|
||||
graphic ? true : false,
|
||||
(boldcount > 0), (italiccount > 0), colors[0], colors[1],
|
||||
(underlinecount > 0), (strikecount > 0), fontname, fontsize,
|
||||
position, graphicRect,
|
||||
((outlinecount > 0) ? 1 : 0) + ((outline2count > 0) ? 2 : 0)])
|
||||
charactersInternal.push([alignment, y, xStart, textchars[position], extraspace])
|
||||
end
|
||||
x += width
|
||||
if !explicitBreaksOnly && x + 2 > widthDst && lastword[1] != 0 &&
|
||||
(!hadnonspace || !hadspace)
|
||||
havenl = true
|
||||
characters.insert(lastword[0], ["\n", x, y * lineheight + yDst, 0, lineheight,
|
||||
characters.insert(lastword[0], ["\n", x, (y * lineheight) + yDst, 0, lineheight,
|
||||
false, false, false,
|
||||
defaultcolors[0], defaultcolors[1],
|
||||
false, false, "", 8, position, nil])
|
||||
@@ -1045,8 +1041,8 @@ def drawSingleFormattedChar(bitmap, ch)
|
||||
end
|
||||
bitmap.font.color = ch[8] if bitmap.font.color != ch[8]
|
||||
bitmap.draw_text(ch[1] + offset, ch[2] + offset, ch[3], ch[4], ch[0])
|
||||
else
|
||||
bitmap.font.color = ch[8] if bitmap.font.color != ch[8]
|
||||
elsif bitmap.font.color != ch[8]
|
||||
bitmap.font.color = ch[8]
|
||||
end
|
||||
if ch[10] # underline
|
||||
bitmap.fill_rect(ch[1], ch[2] + ch[4] - 4 - [(ch[4] - bitmap.font.size) / 2, 0].max - 2,
|
||||
|
||||
@@ -224,10 +224,9 @@ class FaceWindowVX < SpriteWindow_Base
|
||||
@faceIndex = faceinfo[1].to_i
|
||||
@facebitmaptmp = AnimatedBitmap.new(facefile)
|
||||
@facebitmap = BitmapWrapper.new(96, 96)
|
||||
@facebitmap.blt(0, 0, @facebitmaptmp.bitmap, Rect.new(
|
||||
(@faceIndex % 4) * 96,
|
||||
(@faceIndex / 4) * 96, 96, 96
|
||||
))
|
||||
@facebitmap.blt(0, 0, @facebitmaptmp.bitmap,
|
||||
Rect.new((@faceIndex % 4) * 96, (@faceIndex / 4) * 96, 96, 96)
|
||||
)
|
||||
self.contents = @facebitmap
|
||||
end
|
||||
|
||||
@@ -235,10 +234,9 @@ class FaceWindowVX < SpriteWindow_Base
|
||||
super
|
||||
if @facebitmaptmp.totalFrames > 1
|
||||
@facebitmaptmp.update
|
||||
@facebitmap.blt(0, 0, @facebitmaptmp.bitmap, Rect.new(
|
||||
(@faceIndex % 4) * 96,
|
||||
(@faceIndex / 4) * 96, 96, 96
|
||||
))
|
||||
@facebitmap.blt(0, 0, @facebitmaptmp.bitmap,
|
||||
Rect.new((@faceIndex % 4) * 96, (@faceIndex / 4) * 96, 96, 96)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -581,7 +579,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
|
||||
if atTop
|
||||
msgwindow.y = -msgwindow.height * signWaitCount / signWaitTime
|
||||
else
|
||||
msgwindow.y = Graphics.height - msgwindow.height * (signWaitTime - signWaitCount) / signWaitTime
|
||||
msgwindow.y = Graphics.height - (msgwindow.height * (signWaitTime - signWaitCount) / signWaitTime)
|
||||
end
|
||||
end
|
||||
for i in 0...controls.length
|
||||
@@ -627,7 +625,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
|
||||
msgwindow.y = Graphics.height - msgwindow.height
|
||||
msgback.y = msgwindow.y if msgback
|
||||
pbPositionNearMsgWindow(facewindow, msgwindow, :left)
|
||||
msgwindow.y = Graphics.height - msgwindow.height * (signWaitTime - signWaitCount) / signWaitTime
|
||||
msgwindow.y = Graphics.height - (msgwindow.height * (signWaitTime - signWaitCount) / signWaitTime)
|
||||
when "ts" # Change text speed
|
||||
msgwindow.textspeed = (param == "") ? -999 : param.to_i
|
||||
when "." # Wait 0.25 seconds
|
||||
@@ -662,8 +660,8 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
|
||||
if msgwindow.busy?
|
||||
pbPlayDecisionSE if msgwindow.pausing?
|
||||
msgwindow.resume
|
||||
else
|
||||
break if signWaitCount == 0
|
||||
elsif signWaitCount == 0
|
||||
break
|
||||
end
|
||||
end
|
||||
pbUpdateSceneMap
|
||||
@@ -692,7 +690,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
|
||||
if atTop
|
||||
msgwindow.y = -msgwindow.height * i / signWaitTime
|
||||
else
|
||||
msgwindow.y = Graphics.height - msgwindow.height * (signWaitTime - i) / signWaitTime
|
||||
msgwindow.y = Graphics.height - (msgwindow.height * (signWaitTime - i) / signWaitTime)
|
||||
end
|
||||
Graphics.update
|
||||
Input.update
|
||||
|
||||
@@ -453,10 +453,7 @@ class Window_MultilineTextEntry < SpriteWindow_Base
|
||||
totalColumns = getColumnsInLine(@cursorLine)
|
||||
@cursorColumn = totalColumns if @cursorColumn > totalColumns
|
||||
@cursorColumn = 0 if @cursorColumn < 0 # totalColumns can be 0
|
||||
updateCursorPos(
|
||||
oldCursorLine != @cursorLine ||
|
||||
oldCursorColumn != @cursorColumn
|
||||
)
|
||||
updateCursorPos(oldCursorLine != @cursorLine || oldCursorColumn != @cursorColumn)
|
||||
# echoln ["aftermoving",@cursorLine,@cursorColumn]
|
||||
end
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ def getPlayTime2(filename)
|
||||
data = fgetdw.call(file)
|
||||
return -1 if data != 0x61746164 # "data"
|
||||
datasize = fgetdw.call(file)
|
||||
time = (datasize * 1.0) / bytessec
|
||||
time = datasize.to_f / bytessec
|
||||
return time
|
||||
when 0x5367674F # "OggS"
|
||||
file.pos = 0
|
||||
|
||||
@@ -178,7 +178,7 @@ module Transitions
|
||||
sprite_height = @overworld_bitmap.height / NUM_SPRITES_Y
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
@sprites[idx_sprite] = new_sprite(i * sprite_width, j * sprite_height, @overworld_bitmap)
|
||||
@sprites[idx_sprite].src_rect.set(i * sprite_width, j * sprite_height, sprite_width, sprite_height)
|
||||
end
|
||||
@@ -189,7 +189,7 @@ module Transitions
|
||||
@start_y = []
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
@start_y[idx_sprite] = @sprites[idx_sprite].y
|
||||
@timings[idx_sprite] = 0.5 + rand
|
||||
end
|
||||
@@ -199,7 +199,7 @@ module Transitions
|
||||
def update_anim
|
||||
proportion = @timer / @duration
|
||||
@sprites.each_with_index do |sprite, i|
|
||||
sprite.y = @start_y[i] + Graphics.height * @timings[i] * proportion * proportion
|
||||
sprite.y = @start_y[i] + (Graphics.height * @timings[i] * proportion * proportion)
|
||||
sprite.opacity = 255 * (1 - proportion)
|
||||
end
|
||||
end
|
||||
@@ -219,7 +219,7 @@ module Transitions
|
||||
sprite_height = @overworld_bitmap.height / NUM_SPRITES_Y
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
@sprites[idx_sprite] = new_sprite((i + 0.5) * sprite_width, (j + 0.5) * sprite_height,
|
||||
@overworld_bitmap, sprite_width / 2, sprite_height / 2)
|
||||
@sprites[idx_sprite].src_rect.set(i * sprite_width, j * sprite_height, sprite_width, sprite_height)
|
||||
@@ -230,10 +230,10 @@ module Transitions
|
||||
def update_anim
|
||||
proportion = @timer / @duration
|
||||
@sprites.each_with_index do |sprite, i|
|
||||
sprite.zoom_x = 1.0 * (1 - proportion)
|
||||
sprite.zoom_x = (1 - proportion).to_f
|
||||
sprite.zoom_y = sprite.zoom_x
|
||||
if @parameters[0] # Rotation
|
||||
direction = (1 - 2 * ((i / NUM_SPRITES_X + i % NUM_SPRITES_X) % 2))
|
||||
direction = (1 - (2 * (((i / NUM_SPRITES_X) + (i % NUM_SPRITES_X)) % 2)))
|
||||
sprite.angle = direction * 360 * 2 * proportion
|
||||
end
|
||||
end
|
||||
@@ -258,7 +258,7 @@ module Transitions
|
||||
sprite_height = @overworld_bitmap.height / NUM_SPRITES_Y
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
@sprites[idx_sprite] = new_sprite((i + 0.5) * sprite_width, (j + 0.5) * sprite_height,
|
||||
@overworld_bitmap, sprite_width / 2, sprite_height / 2)
|
||||
@sprites[idx_sprite].src_rect.set(i * sprite_width, j * sprite_height, sprite_width, sprite_height)
|
||||
@@ -272,17 +272,17 @@ module Transitions
|
||||
vague = (@parameters[0] || 9.6) * SPEED
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
spr = @sprites[idx_sprite]
|
||||
@start_positions[idx_sprite] = [spr.x, spr.y]
|
||||
dx = spr.x - Graphics.width / 2
|
||||
dy = spr.y - Graphics.height / 2
|
||||
dx = spr.x - (Graphics.width / 2)
|
||||
dy = spr.y - (Graphics.height / 2)
|
||||
move_x = move_y = 0
|
||||
if dx == 0 && dy == 0
|
||||
move_x = (dx == 0) ? rand_sign * vague : dx * SPEED * 1.5
|
||||
move_y = (dy == 0) ? rand_sign * vague : dy * SPEED * 1.5
|
||||
else
|
||||
radius = Math.sqrt(dx**2 + dy**2)
|
||||
radius = Math.sqrt((dx**2) + (dy**2))
|
||||
move_x = dx * vague / radius
|
||||
move_y = dy * vague / radius
|
||||
end
|
||||
@@ -296,8 +296,8 @@ module Transitions
|
||||
def update_anim
|
||||
proportion = @timer / @duration
|
||||
@sprites.each_with_index do |sprite, i|
|
||||
sprite.x = @start_positions[i][0] + @move_vectors[i][0] * proportion
|
||||
sprite.y = @start_positions[i][1] + @move_vectors[i][1] * proportion
|
||||
sprite.x = @start_positions[i][0] + (@move_vectors[i][0] * proportion)
|
||||
sprite.y = @start_positions[i][1] + (@move_vectors[i][1] * proportion)
|
||||
sprite.opacity = 384 * (1 - proportion)
|
||||
end
|
||||
end
|
||||
@@ -331,7 +331,7 @@ module Transitions
|
||||
end
|
||||
for j in 0...num_stripes_y
|
||||
for i in 0...num_stripes_x
|
||||
idx_sprite = j * num_stripes_x + i
|
||||
idx_sprite = (j * num_stripes_x) + i
|
||||
@sprites[idx_sprite] = new_sprite(i * sprite_width, j * sprite_height, @overworld_bitmap)
|
||||
@sprites[idx_sprite].src_rect.set(i * sprite_width, j * sprite_height, sprite_width, sprite_height)
|
||||
end
|
||||
@@ -367,7 +367,7 @@ module Transitions
|
||||
|
||||
def update_anim
|
||||
proportion = @timer / @duration
|
||||
@overworld_sprite.zoom_x = 1.0 + 7.0 * proportion
|
||||
@overworld_sprite.zoom_x = 1 + (7 * proportion)
|
||||
@overworld_sprite.zoom_y = @overworld_sprite.zoom_x
|
||||
@overworld_sprite.opacity = 255 * (1 - proportion)
|
||||
end
|
||||
@@ -410,7 +410,7 @@ module Transitions
|
||||
|
||||
def update_anim
|
||||
proportion = @timer / @duration
|
||||
inv_proportion = 1 / (1 + proportion * (MAX_PIXELLATION_FACTOR - 1))
|
||||
inv_proportion = 1 / (1 + (proportion * (MAX_PIXELLATION_FACTOR - 1)))
|
||||
new_size_rect = Rect.new(0, 0, @overworld_bitmap.width * inv_proportion,
|
||||
@overworld_bitmap.height * inv_proportion)
|
||||
# Take all of buffer_original, shrink it and put it into buffer_temp
|
||||
@@ -420,7 +420,7 @@ module Transitions
|
||||
@overworld_bitmap.stretch_blt(Rect.new(0, 0, @overworld_bitmap.width, @overworld_bitmap.height),
|
||||
@buffer_temp, new_size_rect)
|
||||
if @timer >= @start_black_fade
|
||||
@overworld_sprite.opacity = 255 * (1 - (@timer - @start_black_fade) / (@duration - @start_black_fade))
|
||||
@overworld_sprite.opacity = 255 * (1 - ((@timer - @start_black_fade) / (@duration - @start_black_fade)))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -466,7 +466,7 @@ module Transitions
|
||||
def initialize_sprites
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
if idx_sprite >= TOTAL_SPRITES / 2
|
||||
sprite_x = ((j.odd?) ? i : (NUM_SPRITES_X - i - 1)) * @black_bitmap.width
|
||||
else
|
||||
@@ -485,7 +485,7 @@ module Transitions
|
||||
time_between_zooms = (@duration - TIME_TO_ZOOM) * 2 / (TOTAL_SPRITES - 1)
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
idx_from_start = (idx_sprite >= TOTAL_SPRITES / 2) ? TOTAL_SPRITES - 1 - idx_sprite : idx_sprite
|
||||
@timings[idx_sprite] = time_between_zooms * idx_from_start
|
||||
end
|
||||
@@ -534,9 +534,9 @@ module Transitions
|
||||
def initialize_sprites
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
@sprites[idx_sprite] = new_sprite((i * @bitmap.width + @bitmap.width / 2) * @zoom_x_target,
|
||||
(j * @bitmap.height + @bitmap.height / 2) * @zoom_y_target,
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
@sprites[idx_sprite] = new_sprite(((i * @bitmap.width) + (@bitmap.width / 2)) * @zoom_x_target,
|
||||
((j * @bitmap.height) + (@bitmap.height / 2)) * @zoom_y_target,
|
||||
@bitmap, @bitmap.width / 2, @bitmap.height / 2)
|
||||
@sprites[idx_sprite].visible = false
|
||||
end
|
||||
@@ -546,16 +546,16 @@ module Transitions
|
||||
def set_up_timings
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_from_start = j * NUM_SPRITES_X + i # Top left -> bottom right
|
||||
idx_from_start = (j * NUM_SPRITES_X) + i # Top left -> bottom right
|
||||
case @parameters[0] # Origin
|
||||
when 1 # Top right -> bottom left
|
||||
idx_from_start = j * NUM_SPRITES_X + NUM_SPRITES_X - i - 1
|
||||
idx_from_start = (j * NUM_SPRITES_X) + NUM_SPRITES_X - i - 1
|
||||
when 2 # Bottom left -> top right
|
||||
idx_from_start = TOTAL_SPRITES - 1 - (j * NUM_SPRITES_X + NUM_SPRITES_X - i - 1)
|
||||
idx_from_start = TOTAL_SPRITES - 1 - ((j * NUM_SPRITES_X) + NUM_SPRITES_X - i - 1)
|
||||
when 3 # Bottom right -> top left
|
||||
idx_from_start = TOTAL_SPRITES - 1 - idx_from_start
|
||||
end
|
||||
dist = i + j.to_f * (NUM_SPRITES_X - 1) / (NUM_SPRITES_Y - 1)
|
||||
dist = i + (j.to_f * (NUM_SPRITES_X - 1) / (NUM_SPRITES_Y - 1))
|
||||
@timings[idx_from_start] = (dist / ((NUM_SPRITES_X - 1) * 2)) * (@duration - TIME_TO_ZOOM)
|
||||
end
|
||||
end
|
||||
@@ -641,16 +641,16 @@ module Transitions
|
||||
# Make overworld wave strips oscillate
|
||||
amplitude = MAX_WAVE_AMPLITUDE * [@timer / 0.1, 1].min # Build up to max in 0.1 seconds
|
||||
@sprites.each_with_index do |sprite, i|
|
||||
sprite.x = amplitude * Math.sin(@timer * WAVE_SPEED + i * WAVE_SPACING)
|
||||
sprite.x = amplitude * Math.sin((@timer * WAVE_SPEED) + (i * WAVE_SPACING))
|
||||
end
|
||||
# Move bubbles sprite up and oscillate side to side
|
||||
@bubbles_sprite.x = (Graphics.width - @bubble_bitmap.width) / 2
|
||||
@bubbles_sprite.x += MAX_BUBBLE_AMPLITUDE * Math.sin(@timer * BUBBLES_WAVE_SPEED)
|
||||
@bubbles_sprite.y = Graphics.height * (1 - @timer * 1.2)
|
||||
@bubbles_sprite.y = Graphics.height * (1 - (@timer * 1.2))
|
||||
# Move splash sprite up
|
||||
if @timer >= @splash_rising_start
|
||||
proportion = (@timer - @splash_rising_start) / (@duration - @splash_rising_start)
|
||||
@splash_sprite.y = Graphics.height * (1 - proportion * 2)
|
||||
@splash_sprite.y = Graphics.height * (1 - (proportion * 2))
|
||||
end
|
||||
# Move black sprite up
|
||||
if @timer >= @black_rising_start
|
||||
@@ -680,15 +680,15 @@ module Transitions
|
||||
# Balls that roll across the screen
|
||||
@ball_sprites = []
|
||||
for i in 0...2
|
||||
x = (1 - i) * Graphics.width + (1 - i * 2) * @ball_bitmap.width / 2
|
||||
y = (Graphics.height + (i * 2 - 1) * @ball_bitmap.width) / 2
|
||||
x = ((1 - i) * Graphics.width) + ((1 - (i * 2)) * @ball_bitmap.width / 2)
|
||||
y = (Graphics.height + (((i * 2) - 1) * @ball_bitmap.width)) / 2
|
||||
@ball_sprites[i] = new_sprite(x, y, @ball_bitmap,
|
||||
@ball_bitmap.width / 2, @ball_bitmap.height / 2)
|
||||
@ball_sprites[i].z = 2
|
||||
end
|
||||
# Black foreground sprites
|
||||
for i in 0...2
|
||||
@sprites[i] = new_sprite((1 - i * 2) * Graphics.width, i * Graphics.height / 2, @black_bitmap)
|
||||
@sprites[i] = new_sprite((1 - (i * 2)) * Graphics.width, i * Graphics.height / 2, @black_bitmap)
|
||||
@sprites[i].z = 1
|
||||
end
|
||||
@sprites[2] = new_sprite(0, Graphics.height / 2, @black_bitmap, 0, @black_bitmap.height / 2)
|
||||
@@ -718,8 +718,8 @@ module Transitions
|
||||
proportion = @timer / @ball_roll_end
|
||||
total_distance = Graphics.width + @ball_bitmap.width
|
||||
@ball_sprites.each_with_index do |sprite, i|
|
||||
sprite.x = @ball_start_x[i] + (2 * i - 1) * (total_distance * proportion)
|
||||
sprite.angle = (2 * i - 1) * 360 * proportion * 2
|
||||
sprite.x = @ball_start_x[i] + (((2 * i) - 1) * (total_distance * proportion))
|
||||
sprite.angle = ((2 * i) - 1) * 360 * proportion * 2
|
||||
end
|
||||
else
|
||||
proportion = (@timer - @ball_roll_end) / (@duration - @ball_roll_end)
|
||||
@@ -728,11 +728,11 @@ module Transitions
|
||||
@ball_sprites.each { |s| s.visible = false }
|
||||
end
|
||||
# Zoom in overworld sprite
|
||||
@overworld_sprite.zoom_x = 1.0 + proportion * proportion # Ends at 2x zoom
|
||||
@overworld_sprite.zoom_x = 1.0 + (proportion * proportion) # Ends at 2x zoom
|
||||
@overworld_sprite.zoom_y = @overworld_sprite.zoom_x
|
||||
# Slide first two black bars across
|
||||
@sprites[0].x = Graphics.width * (1 - proportion * proportion)
|
||||
@sprites[1].x = Graphics.width * (proportion * proportion - 1)
|
||||
@sprites[0].x = Graphics.width * (1 - (proportion * proportion))
|
||||
@sprites[1].x = Graphics.width * ((proportion * proportion) - 1)
|
||||
# Expand third black bar
|
||||
@sprites[2].zoom_y = 2.0 * proportion * proportion # Ends at 2x zoom
|
||||
end
|
||||
@@ -820,10 +820,10 @@ module Transitions
|
||||
# Split overworld/ball apart, move blackness in following them
|
||||
proportion = (@timer - @slide_start) / (@duration - @slide_start)
|
||||
@overworld_sprites.each_with_index do |sprite, i|
|
||||
sprite.x = (0.5 + (i * 2 - 1) * proportion * proportion) * Graphics.width
|
||||
sprite.zoom_x = 1.0 + proportion * proportion # Ends at 2x zoom
|
||||
sprite.x = (0.5 + (((i * 2) - 1) * proportion * proportion)) * Graphics.width
|
||||
sprite.zoom_x = 1.0 + (proportion * proportion) # Ends at 2x zoom
|
||||
sprite.zoom_y = sprite.zoom_x
|
||||
@black_sprites[i].x = sprite.x + (1 - i * 2) * Graphics.width / 2
|
||||
@black_sprites[i].x = sprite.x + ((1 - (i * 2)) * Graphics.width / 2)
|
||||
@ball_sprites[i].x = sprite.x
|
||||
end
|
||||
end
|
||||
@@ -859,7 +859,7 @@ module Transitions
|
||||
# Black squares
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
@sprites[idx_sprite] = new_sprite(i * @black_bitmap.width * @zoom_x_target,
|
||||
j * @black_bitmap.height * @zoom_y_target, @black_bitmap)
|
||||
@sprites[idx_sprite].visible = false
|
||||
@@ -868,7 +868,7 @@ module Transitions
|
||||
# Falling balls
|
||||
@ball_sprites = []
|
||||
for i in 0...3
|
||||
@ball_sprites[i] = new_sprite(Graphics.width / 2 + (i - 1) * 160,
|
||||
@ball_sprites[i] = new_sprite((Graphics.width / 2) + ((i - 1) * 160),
|
||||
-@ball_bitmap.height - BALL_START_Y_OFFSETS[i],
|
||||
@ball_bitmap, @ball_bitmap.width / 2, @ball_bitmap.height / 2)
|
||||
@ball_sprites[i].z = 2
|
||||
@@ -882,8 +882,8 @@ module Transitions
|
||||
for j in 0...NUM_SPRITES_Y
|
||||
row_offset = NUM_SPRITES_Y - j - 1
|
||||
for i in 0...NUM_SPRITES_X
|
||||
idx_sprite = j * NUM_SPRITES_X + i
|
||||
@timings[idx_sprite] = period * (row_offset * NUM_SPRITES_X + appear_order[i]) / TOTAL_SPRITES
|
||||
idx_sprite = (j * NUM_SPRITES_X) + i
|
||||
@timings[idx_sprite] = period * ((row_offset * NUM_SPRITES_X) + appear_order[i]) / TOTAL_SPRITES
|
||||
@timings[idx_sprite] += @black_appear_start
|
||||
end
|
||||
end
|
||||
@@ -906,7 +906,7 @@ module Transitions
|
||||
proportion = @timer / @black_appear_start
|
||||
@ball_sprites.each_with_index do |sprite, i|
|
||||
sprite.y = -@ball_bitmap.height - BALL_START_Y_OFFSETS[i]
|
||||
sprite.y += (Graphics.height + BALL_START_Y_OFFSETS.max + @ball_bitmap.height * 2) * proportion
|
||||
sprite.y += (Graphics.height + BALL_START_Y_OFFSETS.max + (@ball_bitmap.height * 2)) * proportion
|
||||
sprite.angle = 1.5 * 360 * proportion * ([1, -1][(i == 2) ? 0 : 1])
|
||||
end
|
||||
else
|
||||
@@ -921,7 +921,7 @@ module Transitions
|
||||
end
|
||||
# Zoom in overworld sprite
|
||||
proportion = (@timer - @black_appear_start) / (@duration - @black_appear_start)
|
||||
@overworld_sprite.zoom_x = 1.0 + proportion * proportion # Ends at 2x zoom
|
||||
@overworld_sprite.zoom_x = 1.0 + (proportion * proportion) # Ends at 2x zoom
|
||||
@overworld_sprite.zoom_y = @overworld_sprite.zoom_x
|
||||
end
|
||||
end
|
||||
@@ -977,7 +977,7 @@ module Transitions
|
||||
if @timer <= @ball_appear_end
|
||||
# Make ball drop down and zoom in
|
||||
proportion = @timer / @ball_appear_end
|
||||
@ball_sprite.y = -@ball_bitmap.height / 2 + (Graphics.height + @ball_bitmap.height * 3) * proportion * proportion
|
||||
@ball_sprite.y = (-@ball_bitmap.height / 2) + ((Graphics.height + (@ball_bitmap.height * 3)) * proportion * proportion)
|
||||
@ball_sprite.angle = -1.5 * 360 * proportion
|
||||
@ball_sprite.zoom_x = 3 * proportion * proportion
|
||||
@ball_sprite.zoom_y = @ball_sprite.zoom_x
|
||||
@@ -986,10 +986,10 @@ module Transitions
|
||||
# Black curve and blackness descends
|
||||
proportion = (@timer - @ball_appear_end) / (@duration - @ball_appear_end)
|
||||
@sprites.each do |sprite|
|
||||
sprite.y = -@curve_bitmap.height + (Graphics.height + @curve_bitmap.height) * proportion
|
||||
sprite.y = -@curve_bitmap.height + ((Graphics.height + @curve_bitmap.height) * proportion)
|
||||
end
|
||||
# Zoom in overworld sprite
|
||||
@overworld_sprite.zoom_x = 1.0 + proportion * proportion # Ends at 2x zoom
|
||||
@overworld_sprite.zoom_x = 1.0 + (proportion * proportion) # Ends at 2x zoom
|
||||
@overworld_sprite.zoom_y = @overworld_sprite.zoom_x
|
||||
end
|
||||
end
|
||||
@@ -1024,7 +1024,7 @@ module Transitions
|
||||
# Ball sprites
|
||||
@ball_sprites = []
|
||||
for i in 0...3
|
||||
@ball_sprites[i] = new_sprite((2 * i + 1) * Graphics.width / 6,
|
||||
@ball_sprites[i] = new_sprite(((2 * i) + 1) * Graphics.width / 6,
|
||||
BALL_OFFSETS[i] * Graphics.height,
|
||||
@ball_bitmap, @ball_bitmap.width / 2, @ball_bitmap.height / 2)
|
||||
@ball_sprites[i].z = 4
|
||||
@@ -1062,13 +1062,13 @@ module Transitions
|
||||
# Make overworld wave strips oscillate
|
||||
amplitude = MAX_WAVE_AMPLITUDE * [@timer / 0.1, 1].min # Build up to max in 0.1 seconds
|
||||
@sprites.each_with_index do |sprite, i|
|
||||
sprite.x = (1 - (i % 2) * 2) * amplitude * Math.sin(@timer * WAVE_SPEED + i * WAVE_SPACING)
|
||||
sprite.x = (1 - ((i % 2) * 2)) * amplitude * Math.sin((@timer * WAVE_SPEED) + (i * WAVE_SPACING))
|
||||
end
|
||||
# Move balls and trailing blackness up
|
||||
if @timer >= @ball_rising_start
|
||||
proportion = (@timer - @ball_rising_start) / (@duration - @ball_rising_start)
|
||||
@ball_sprites.each_with_index do |sprite, i|
|
||||
sprite.y = BALL_OFFSETS[i] * Graphics.height - Graphics.height * 3.5 * proportion
|
||||
sprite.y = (BALL_OFFSETS[i] * Graphics.height) - (Graphics.height * 3.5 * proportion)
|
||||
sprite.angle = [-1, -1, 1][i] * 360 * 2 * proportion
|
||||
@black_trail_sprites[i].y = sprite.y
|
||||
@black_trail_sprites[i].y = 0 if @black_trail_sprites[i].y < 0
|
||||
@@ -1133,7 +1133,7 @@ module Transitions
|
||||
# Make overworld wave strips oscillate
|
||||
amplitude = MAX_WAVE_AMPLITUDE * [@timer / 0.1, 1].min # Build up to max in 0.1 seconds
|
||||
@sprites.each_with_index do |sprite, i|
|
||||
sprite.x = (1 - (i % 2) * 2) * amplitude * Math.sin(@timer * WAVE_SPEED + i * WAVE_SPACING)
|
||||
sprite.x = (1 - ((i % 2) * 2)) * amplitude * Math.sin((@timer * WAVE_SPEED) + (i * WAVE_SPACING))
|
||||
end
|
||||
if @timer <= @ball_appear_end
|
||||
# Fade in ball while spinning
|
||||
@@ -1208,11 +1208,11 @@ module Transitions
|
||||
if @timer <= @ball_appear_end
|
||||
# Balls fly out from centre of screen
|
||||
proportion = @timer / @ball_appear_end
|
||||
ball_travel_x = (Graphics.width + @ball_bitmap.width * 2) / 2
|
||||
ball_travel_y = (Graphics.height + @ball_bitmap.height * 2) / 2
|
||||
ball_travel_x = (Graphics.width + (@ball_bitmap.width * 2)) / 2
|
||||
ball_travel_y = (Graphics.height + (@ball_bitmap.height * 2)) / 2
|
||||
@ball_sprites.each_with_index do |sprite, i|
|
||||
sprite.x = Graphics.width / 2 + [0, 1, 0, -1][i] * ball_travel_x * proportion if i.odd?
|
||||
sprite.y = Graphics.height / 2 + [1, 0, -1, 0][i] * ball_travel_y * proportion if i.even?
|
||||
sprite.x = (Graphics.width / 2) + ([0, 1, 0, -1][i] * ball_travel_x * proportion) if i.odd?
|
||||
sprite.y = (Graphics.height / 2) + ([1, 0, -1, 0][i] * ball_travel_y * proportion) if i.even?
|
||||
end
|
||||
else
|
||||
# Black wedges expand to fill screen
|
||||
|
||||
@@ -207,13 +207,14 @@ module GameData
|
||||
# @return [Boolean] whether other represents the same thing as this thing
|
||||
def ==(other)
|
||||
return false if other.nil?
|
||||
if other.is_a?(Symbol)
|
||||
case other
|
||||
when Symbol
|
||||
return @id == other
|
||||
elsif other.is_a?(self.class)
|
||||
when self.class
|
||||
return @id == other.id
|
||||
elsif other.is_a?(String)
|
||||
when String
|
||||
return @id == other.to_sym
|
||||
elsif other.is_a?(Integer)
|
||||
when Integer
|
||||
return @id_number == other
|
||||
end
|
||||
return false
|
||||
|
||||
@@ -133,7 +133,7 @@ GameData::GrowthRate.register({
|
||||
765275, 804997, 834809, 877201, 908905, 954084, 987754, 1035837, 1071552, 1122660,
|
||||
1160499, 1214753, 1254796, 1312322, 1354652, 1415577, 1460276, 1524731, 1571884, 1640000],
|
||||
:exp_formula => proc { |level|
|
||||
rate = [82 - (level - 100) / 2.0, 40].max
|
||||
rate = [82 - ((level - 100) / 2.0), 40].max
|
||||
next (level**4) * rate / 5000
|
||||
}
|
||||
})
|
||||
@@ -152,7 +152,7 @@ GameData::GrowthRate.register({
|
||||
360838, 377197, 394045, 411388, 429235, 447591, 466464, 485862, 505791, 526260,
|
||||
547274, 568841, 590969, 613664, 636935, 660787, 685228, 710266, 735907, 762160,
|
||||
789030, 816525, 844653, 873420, 902835, 932903, 963632, 995030, 1027103, 1059860],
|
||||
:exp_formula => proc { |level| next ((level**3) * 6 / 5) - 15 * (level**2) + 100 * level - 140 }
|
||||
:exp_formula => proc { |level| next ((level**3) * 6 / 5) - (15 * (level**2)) + (100 * level) - 140 }
|
||||
})
|
||||
|
||||
GameData::GrowthRate.register({
|
||||
|
||||
@@ -149,44 +149,44 @@ module GameData
|
||||
return false if species == :ARCEUS && ability != :MULTITYPE
|
||||
return false if species == :SILVALLY && ability != :RKSSYSTEM
|
||||
combos = {
|
||||
:ARCEUS => [:FISTPLATE, :FIGHTINIUMZ,
|
||||
:SKYPLATE, :FLYINIUMZ,
|
||||
:TOXICPLATE, :POISONIUMZ,
|
||||
:EARTHPLATE, :GROUNDIUMZ,
|
||||
:STONEPLATE, :ROCKIUMZ,
|
||||
:INSECTPLATE, :BUGINIUMZ,
|
||||
:SPOOKYPLATE, :GHOSTIUMZ,
|
||||
:IRONPLATE, :STEELIUMZ,
|
||||
:FLAMEPLATE, :FIRIUMZ,
|
||||
:SPLASHPLATE, :WATERIUMZ,
|
||||
:MEADOWPLATE, :GRASSIUMZ,
|
||||
:ZAPPLATE, :ELECTRIUMZ,
|
||||
:MINDPLATE, :PSYCHIUMZ,
|
||||
:ICICLEPLATE, :ICIUMZ,
|
||||
:DRACOPLATE, :DRAGONIUMZ,
|
||||
:DREADPLATE, :DARKINIUMZ,
|
||||
:PIXIEPLATE, :FAIRIUMZ],
|
||||
:SILVALLY => [:FIGHTINGMEMORY,
|
||||
:FLYINGMEMORY,
|
||||
:POISONMEMORY,
|
||||
:GROUNDMEMORY,
|
||||
:ROCKMEMORY,
|
||||
:BUGMEMORY,
|
||||
:GHOSTMEMORY,
|
||||
:STEELMEMORY,
|
||||
:FIREMEMORY,
|
||||
:WATERMEMORY,
|
||||
:GRASSMEMORY,
|
||||
:ELECTRICMEMORY,
|
||||
:PSYCHICMEMORY,
|
||||
:ICEMEMORY,
|
||||
:DRAGONMEMORY,
|
||||
:DARKMEMORY,
|
||||
:FAIRYMEMORY],
|
||||
:GIRATINA => [:GRISEOUSORB],
|
||||
:GENESECT => [:BURNDRIVE, :CHILLDRIVE, :DOUSEDRIVE, :SHOCKDRIVE],
|
||||
:KYOGRE => [:BLUEORB],
|
||||
:GROUDON => [:REDORB]
|
||||
:ARCEUS => [:FISTPLATE, :FIGHTINIUMZ,
|
||||
:SKYPLATE, :FLYINIUMZ,
|
||||
:TOXICPLATE, :POISONIUMZ,
|
||||
:EARTHPLATE, :GROUNDIUMZ,
|
||||
:STONEPLATE, :ROCKIUMZ,
|
||||
:INSECTPLATE, :BUGINIUMZ,
|
||||
:SPOOKYPLATE, :GHOSTIUMZ,
|
||||
:IRONPLATE, :STEELIUMZ,
|
||||
:FLAMEPLATE, :FIRIUMZ,
|
||||
:SPLASHPLATE, :WATERIUMZ,
|
||||
:MEADOWPLATE, :GRASSIUMZ,
|
||||
:ZAPPLATE, :ELECTRIUMZ,
|
||||
:MINDPLATE, :PSYCHIUMZ,
|
||||
:ICICLEPLATE, :ICIUMZ,
|
||||
:DRACOPLATE, :DRAGONIUMZ,
|
||||
:DREADPLATE, :DARKINIUMZ,
|
||||
:PIXIEPLATE, :FAIRIUMZ],
|
||||
:SILVALLY => [:FIGHTINGMEMORY,
|
||||
:FLYINGMEMORY,
|
||||
:POISONMEMORY,
|
||||
:GROUNDMEMORY,
|
||||
:ROCKMEMORY,
|
||||
:BUGMEMORY,
|
||||
:GHOSTMEMORY,
|
||||
:STEELMEMORY,
|
||||
:FIREMEMORY,
|
||||
:WATERMEMORY,
|
||||
:GRASSMEMORY,
|
||||
:ELECTRICMEMORY,
|
||||
:PSYCHICMEMORY,
|
||||
:ICEMEMORY,
|
||||
:DRAGONMEMORY,
|
||||
:DARKMEMORY,
|
||||
:FAIRYMEMORY],
|
||||
:GIRATINA => [:GRISEOUSORB],
|
||||
:GENESECT => [:BURNDRIVE, :CHILLDRIVE, :DOUSEDRIVE, :SHOCKDRIVE],
|
||||
:KYOGRE => [:BLUEORB],
|
||||
:GROUDON => [:REDORB]
|
||||
}
|
||||
return combos[species] && combos[species].include?(@id)
|
||||
end
|
||||
|
||||
@@ -311,8 +311,8 @@ module GameData
|
||||
evos.each do |evo|
|
||||
if check_method.is_a?(Array)
|
||||
next if !check_method.include?(evo[2])
|
||||
else
|
||||
next if evo[2] != check_method
|
||||
elsif evo[2] != check_method
|
||||
next
|
||||
end
|
||||
return true if check_param.nil? || evo[3] == check_param
|
||||
end
|
||||
|
||||
@@ -66,18 +66,16 @@ module GameData
|
||||
|
||||
def apply_metrics_to_sprite(sprite, index, shadow = false)
|
||||
if shadow
|
||||
if (index & 1) == 1 # Foe Pokémon
|
||||
if (index & 1) == 1 # Foe Pokémon
|
||||
sprite.x += @shadow_x * 2
|
||||
end
|
||||
else
|
||||
if (index & 1) == 0 # Player's Pokémon
|
||||
sprite.x += @back_sprite[0] * 2
|
||||
sprite.y += @back_sprite[1] * 2
|
||||
else # Foe Pokémon
|
||||
sprite.x += @front_sprite[0] * 2
|
||||
sprite.y += @front_sprite[1] * 2
|
||||
sprite.y -= @front_sprite_altitude * 2
|
||||
end
|
||||
elsif (index & 1) == 0 # Player's Pokémon
|
||||
sprite.x += @back_sprite[0] * 2
|
||||
sprite.y += @back_sprite[1] * 2
|
||||
else # Foe Pokémon
|
||||
sprite.x += @front_sprite[0] * 2
|
||||
sprite.y += @front_sprite[1] * 2
|
||||
sprite.y -= @front_sprite_altitude * 2
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -141,12 +141,12 @@ class Battle
|
||||
@priorityTrickRoom = false
|
||||
@choices = []
|
||||
@megaEvolution = [
|
||||
[-1] * (@player ? @player.length : 1),
|
||||
[-1] * (@opponent ? @opponent.length : 1)
|
||||
[-1] * (@player ? @player.length : 1),
|
||||
[-1] * (@opponent ? @opponent.length : 1)
|
||||
]
|
||||
@initialItems = [
|
||||
Array.new(@party1.length) { |i| (@party1[i]) ? @party1[i].item_id : nil },
|
||||
Array.new(@party2.length) { |i| (@party2[i]) ? @party2[i].item_id : nil }
|
||||
Array.new(@party1.length) { |i| (@party1[i]) ? @party1[i].item_id : nil },
|
||||
Array.new(@party2.length) { |i| (@party2[i]) ? @party2[i].item_id : nil }
|
||||
]
|
||||
@recycleItems = [Array.new(@party1.length, nil), Array.new(@party2.length, nil)]
|
||||
@belch = [Array.new(@party1.length, false), Array.new(@party2.length, false)]
|
||||
@@ -202,7 +202,7 @@ class Battle
|
||||
end
|
||||
|
||||
def maxBattlerIndex
|
||||
return (pbSideSize(0) > pbSideSize(1)) ? (pbSideSize(0) - 1) * 2 : pbSideSize(1) * 2 - 1
|
||||
return (pbSideSize(0) > pbSideSize(1)) ? (pbSideSize(0) - 1) * 2 : (pbSideSize(1) * 2) - 1
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -282,7 +282,7 @@ class Battle
|
||||
def pbNumPositions(side, idxTrainer)
|
||||
ret = 0
|
||||
for i in 0...pbSideSize(side)
|
||||
t = pbGetOwnerIndexFromBattlerIndex(i * 2 + side)
|
||||
t = pbGetOwnerIndexFromBattlerIndex((i * 2) + side)
|
||||
next if t != idxTrainer
|
||||
ret += 1
|
||||
end
|
||||
|
||||
@@ -49,7 +49,7 @@ class Battle
|
||||
requireds = []
|
||||
# Find out how many Pokémon each trainer on side needs to have
|
||||
for i in 0...@sideSizes[side]
|
||||
idxTrainer = pbGetOwnerIndexFromBattlerIndex(i * 2 + side)
|
||||
idxTrainer = pbGetOwnerIndexFromBattlerIndex((i * 2) + side)
|
||||
requireds[idxTrainer] = 0 if requireds[idxTrainer].nil?
|
||||
requireds[idxTrainer] += 1
|
||||
end
|
||||
@@ -119,10 +119,10 @@ class Battle
|
||||
# Set up wild Pokémon
|
||||
if side == 1 && wildBattle?
|
||||
pbParty(1).each_with_index do |pkmn, idxPkmn|
|
||||
pbCreateBattler(2 * idxPkmn + side, pkmn, idxPkmn)
|
||||
pbCreateBattler((2 * idxPkmn) + side, pkmn, idxPkmn)
|
||||
# Changes the Pokémon's form upon entering battle (if it should)
|
||||
@peer.pbOnEnteringBattle(self, @battlers[2 * idxPkmn + side], pkmn, true)
|
||||
pbSetSeen(@battlers[2 * idxPkmn + side])
|
||||
@peer.pbOnEnteringBattle(self, @battlers[(2 * idxPkmn) + side], pkmn, true)
|
||||
pbSetSeen(@battlers[(2 * idxPkmn) + side])
|
||||
@usedInBattle[side][idxPkmn] = true
|
||||
end
|
||||
next
|
||||
@@ -132,7 +132,7 @@ class Battle
|
||||
requireds = []
|
||||
# Find out how many Pokémon each trainer on side needs to have
|
||||
for i in 0...@sideSizes[side]
|
||||
idxTrainer = pbGetOwnerIndexFromBattlerIndex(i * 2 + side)
|
||||
idxTrainer = pbGetOwnerIndexFromBattlerIndex((i * 2) + side)
|
||||
requireds[idxTrainer] = 0 if requireds[idxTrainer].nil?
|
||||
requireds[idxTrainer] += 1
|
||||
end
|
||||
@@ -143,7 +143,7 @@ class Battle
|
||||
ret[side][idxTrainer] = []
|
||||
eachInTeam(side, idxTrainer) do |pkmn, idxPkmn|
|
||||
next if !pkmn.able?
|
||||
idxBattler = 2 * battlerNumber + side
|
||||
idxBattler = (2 * battlerNumber) + side
|
||||
pbCreateBattler(idxBattler, pkmn, idxPkmn)
|
||||
ret[side][idxTrainer].push(idxBattler)
|
||||
battlerNumber += 1
|
||||
|
||||
@@ -125,7 +125,7 @@ class Battle
|
||||
# Scale the gained Exp based on the gainer's level (or not)
|
||||
if Settings::SCALED_EXP_FORMULA
|
||||
exp /= 5
|
||||
levelAdjust = (2 * level + 10.0) / (pkmn.level + level + 10.0)
|
||||
levelAdjust = ((2 * level) + 10.0) / (pkmn.level + level + 10.0)
|
||||
levelAdjust = levelAdjust**5
|
||||
levelAdjust = Math.sqrt(levelAdjust)
|
||||
exp *= levelAdjust
|
||||
|
||||
@@ -116,8 +116,8 @@ class Battle
|
||||
@scene.pbPartyScreen(idxBattler, canCancel) { |idxParty, partyScene|
|
||||
if checkLaxOnly
|
||||
next false if !pbCanSwitchLax?(idxBattler, idxParty, partyScene)
|
||||
else
|
||||
next false if !pbCanSwitch?(idxBattler, idxParty, partyScene)
|
||||
elsif !pbCanSwitch?(idxBattler, idxParty, partyScene)
|
||||
next false
|
||||
end
|
||||
if shouldRegister
|
||||
next false if idxParty < 0 || !pbRegisterSwitch(idxBattler, idxParty)
|
||||
|
||||
@@ -53,9 +53,9 @@ class Battle::Battler
|
||||
# Stat up animation and message
|
||||
@battle.pbCommonAnimation("StatUp", self) if showAnim
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} rose!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} rose sharply!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} rose drastically!", pbThis, GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} rose!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} rose sharply!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} rose drastically!", pbThis, GameData::Stat.get(stat).name)
|
||||
]
|
||||
@battle.pbDisplay(arrStatTexts[[increment - 1, 2].min])
|
||||
# Trigger abilities upon stat gain
|
||||
@@ -77,15 +77,15 @@ class Battle::Battler
|
||||
@battle.pbCommonAnimation("StatUp", self) if showAnim
|
||||
if user.index == @index
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} sharply raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} drastically raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} sharply raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} drastically raised its {3}!", pbThis, cause, GameData::Stat.get(stat).name)
|
||||
]
|
||||
else
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} sharply raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} drastically raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} sharply raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} drastically raised {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name)
|
||||
]
|
||||
end
|
||||
@battle.pbDisplay(arrStatTexts[[increment - 1, 2].min])
|
||||
@@ -218,9 +218,9 @@ class Battle::Battler
|
||||
# Stat down animation and message
|
||||
@battle.pbCommonAnimation("StatDown", self) if showAnim
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} fell!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly fell!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely fell!", pbThis, GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} fell!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly fell!", pbThis, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely fell!", pbThis, GameData::Stat.get(stat).name)
|
||||
]
|
||||
@battle.pbDisplay(arrStatTexts[[increment - 1, 2].min])
|
||||
# Trigger abilities upon stat loss
|
||||
@@ -259,15 +259,15 @@ class Battle::Battler
|
||||
@battle.pbCommonAnimation("StatDown", self) if showAnim
|
||||
if user.index == @index
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely lowered its {3}!", pbThis, cause, GameData::Stat.get(stat).name)
|
||||
]
|
||||
else
|
||||
arrStatTexts = [
|
||||
_INTL("{1}'s {2} lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name)
|
||||
_INTL("{1}'s {2} lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} harshly lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name),
|
||||
_INTL("{1}'s {2} severely lowered {3}'s {4}!", user.pbThis, cause, pbThis(true), GameData::Stat.get(stat).name)
|
||||
]
|
||||
end
|
||||
@battle.pbDisplay(arrStatTexts[[increment - 1, 2].min])
|
||||
|
||||
@@ -119,13 +119,10 @@ class Battle::Battler
|
||||
else
|
||||
pbRaiseStatStageByCause(stat, increment, self, abilityName)
|
||||
end
|
||||
elsif Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
pbThis, abilityName, move.name))
|
||||
end
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", pbThis, abilityName, move.name))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
end
|
||||
@@ -149,13 +146,10 @@ class Battle::Battler
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} restored its HP.", pbThis, abilityName))
|
||||
end
|
||||
elsif Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
pbThis, abilityName, move.name))
|
||||
end
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", pbThis, abilityName, move.name))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
end
|
||||
|
||||
@@ -298,12 +298,10 @@ class Battle::Move
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} landed a critical hit, wishing to be praised!", user.pbThis))
|
||||
end
|
||||
elsif numTargets > 1
|
||||
@battle.pbDisplay(_INTL("A critical hit on {1}!", target.pbThis(true)))
|
||||
else
|
||||
if numTargets > 1
|
||||
@battle.pbDisplay(_INTL("A critical hit on {1}!", target.pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("A critical hit!"))
|
||||
end
|
||||
@battle.pbDisplay(_INTL("A critical hit!"))
|
||||
end
|
||||
end
|
||||
# Effectiveness message, for moves with 1 hit
|
||||
|
||||
@@ -283,7 +283,7 @@ class Battle::Move
|
||||
baseDmg = [(baseDmg * multipliers[:base_damage_multiplier]).round, 1].max
|
||||
atk = [(atk * multipliers[:attack_multiplier]).round, 1].max
|
||||
defense = [(defense * multipliers[:defense_multiplier]).round, 1].max
|
||||
damage = (((2.0 * user.level / 5 + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = ((((2.0 * user.level / 5) + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = [(damage * multipliers[:final_damage_multiplier]).round, 1].max
|
||||
target.damageState.calcDamage = damage
|
||||
end
|
||||
|
||||
@@ -130,7 +130,7 @@ class Battle::Move::MultiStatUpMove < Battle::Move
|
||||
showAnim = true
|
||||
for i in 0...@statUp.length / 2
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[i * 2 + 1], user, showAnim)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
@@ -140,7 +140,7 @@ class Battle::Move::MultiStatUpMove < Battle::Move
|
||||
showAnim = true
|
||||
for i in 0...@statUp.length / 2
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[i * 2 + 1], user, showAnim)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
@@ -156,7 +156,7 @@ class Battle::Move::StatDownMove < Battle::Move
|
||||
showAnim = true
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user, showAnim)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
@@ -255,7 +255,7 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move
|
||||
showMirrorArmorSplash = true
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user,
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user,
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
showAnim = false
|
||||
end
|
||||
|
||||
@@ -440,14 +440,14 @@ class Battle::Move::LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2 < Battle::Move
|
||||
showAnim = true
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user, showAnim)
|
||||
if user.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
showAnim = true
|
||||
for i in 0...@statUp.length / 2
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[i * 2 + 1], user, showAnim)
|
||||
if user.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
@@ -1385,7 +1385,7 @@ class Battle::Move::LowerPoisonedTargetAtkSpAtkSpd1 < Battle::Move
|
||||
showMirrorArmorSplash = true
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user,
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user,
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
showAnim = false
|
||||
end
|
||||
|
||||
@@ -379,13 +379,13 @@ class Battle::Move::RandomPowerDoublePowerIfTargetUnderground < Battle::Move
|
||||
def pbOnStartUse(user, targets)
|
||||
baseDmg = [10, 30, 50, 70, 90, 110, 150]
|
||||
magnitudes = [
|
||||
4,
|
||||
5, 5,
|
||||
6, 6, 6, 6,
|
||||
7, 7, 7, 7, 7, 7,
|
||||
8, 8, 8, 8,
|
||||
9, 9,
|
||||
10
|
||||
4,
|
||||
5, 5,
|
||||
6, 6, 6, 6,
|
||||
7, 7, 7, 7, 7, 7,
|
||||
8, 8, 8, 8,
|
||||
9, 9,
|
||||
10
|
||||
]
|
||||
magni = magnitudes[@battle.pbRandom(magnitudes.length)]
|
||||
@magnitudeDmg = baseDmg[magni - 4]
|
||||
@@ -710,11 +710,9 @@ class Battle::Move::StartWeakenElectricMoves < Battle::Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
else
|
||||
if @battle.allBattlers.any? { |b| b.effects[PBEffects::MudSport] }
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
elsif @battle.allBattlers.any? { |b| b.effects[PBEffects::MudSport] }
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -739,11 +737,9 @@ class Battle::Move::StartWeakenFireMoves < Battle::Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
else
|
||||
if @battle.allBattlers.any? { |b| b.effects[PBEffects::WaterSport] }
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
elsif @battle.allBattlers.any? { |b| b.effects[PBEffects::WaterSport] }
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -1359,7 +1355,7 @@ def pbHiddenPower(pkmn)
|
||||
power |= (iv[:SPEED] & 2) << 2
|
||||
power |= (iv[:SPECIAL_ATTACK] & 2) << 3
|
||||
power |= (iv[:SPECIAL_DEFENSE] & 2) << 4
|
||||
power = powerMin + (powerMax - powerMin) * power / 63
|
||||
power = powerMin + ((powerMax - powerMin) * power / 63)
|
||||
end
|
||||
return [type, power]
|
||||
end
|
||||
@@ -1372,41 +1368,41 @@ class Battle::Move::TypeAndPowerDependOnUserBerry < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@typeArray = {
|
||||
:NORMAL => [:CHILANBERRY],
|
||||
:FIRE => [:CHERIBERRY, :BLUKBERRY, :WATMELBERRY, :OCCABERRY],
|
||||
:WATER => [:CHESTOBERRY, :NANABBERRY, :DURINBERRY, :PASSHOBERRY],
|
||||
:ELECTRIC => [:PECHABERRY, :WEPEARBERRY, :BELUEBERRY, :WACANBERRY],
|
||||
:GRASS => [:RAWSTBERRY, :PINAPBERRY, :RINDOBERRY, :LIECHIBERRY],
|
||||
:ICE => [:ASPEARBERRY, :POMEGBERRY, :YACHEBERRY, :GANLONBERRY],
|
||||
:FIGHTING => [:LEPPABERRY, :KELPSYBERRY, :CHOPLEBERRY, :SALACBERRY],
|
||||
:POISON => [:ORANBERRY, :QUALOTBERRY, :KEBIABERRY, :PETAYABERRY],
|
||||
:GROUND => [:PERSIMBERRY, :HONDEWBERRY, :SHUCABERRY, :APICOTBERRY],
|
||||
:FLYING => [:LUMBERRY, :GREPABERRY, :COBABERRY, :LANSATBERRY],
|
||||
:PSYCHIC => [:SITRUSBERRY, :TAMATOBERRY, :PAYAPABERRY, :STARFBERRY],
|
||||
:BUG => [:FIGYBERRY, :CORNNBERRY, :TANGABERRY, :ENIGMABERRY],
|
||||
:ROCK => [:WIKIBERRY, :MAGOSTBERRY, :CHARTIBERRY, :MICLEBERRY],
|
||||
:GHOST => [:MAGOBERRY, :RABUTABERRY, :KASIBBERRY, :CUSTAPBERRY],
|
||||
:DRAGON => [:AGUAVBERRY, :NOMELBERRY, :HABANBERRY, :JABOCABERRY],
|
||||
:DARK => [:IAPAPABERRY, :SPELONBERRY, :COLBURBERRY, :ROWAPBERRY, :MARANGABERRY],
|
||||
:STEEL => [:RAZZBERRY, :PAMTREBERRY, :BABIRIBERRY],
|
||||
:FAIRY => [:ROSELIBERRY, :KEEBERRY]
|
||||
:NORMAL => [:CHILANBERRY],
|
||||
:FIRE => [:CHERIBERRY, :BLUKBERRY, :WATMELBERRY, :OCCABERRY],
|
||||
:WATER => [:CHESTOBERRY, :NANABBERRY, :DURINBERRY, :PASSHOBERRY],
|
||||
:ELECTRIC => [:PECHABERRY, :WEPEARBERRY, :BELUEBERRY, :WACANBERRY],
|
||||
:GRASS => [:RAWSTBERRY, :PINAPBERRY, :RINDOBERRY, :LIECHIBERRY],
|
||||
:ICE => [:ASPEARBERRY, :POMEGBERRY, :YACHEBERRY, :GANLONBERRY],
|
||||
:FIGHTING => [:LEPPABERRY, :KELPSYBERRY, :CHOPLEBERRY, :SALACBERRY],
|
||||
:POISON => [:ORANBERRY, :QUALOTBERRY, :KEBIABERRY, :PETAYABERRY],
|
||||
:GROUND => [:PERSIMBERRY, :HONDEWBERRY, :SHUCABERRY, :APICOTBERRY],
|
||||
:FLYING => [:LUMBERRY, :GREPABERRY, :COBABERRY, :LANSATBERRY],
|
||||
:PSYCHIC => [:SITRUSBERRY, :TAMATOBERRY, :PAYAPABERRY, :STARFBERRY],
|
||||
:BUG => [:FIGYBERRY, :CORNNBERRY, :TANGABERRY, :ENIGMABERRY],
|
||||
:ROCK => [:WIKIBERRY, :MAGOSTBERRY, :CHARTIBERRY, :MICLEBERRY],
|
||||
:GHOST => [:MAGOBERRY, :RABUTABERRY, :KASIBBERRY, :CUSTAPBERRY],
|
||||
:DRAGON => [:AGUAVBERRY, :NOMELBERRY, :HABANBERRY, :JABOCABERRY],
|
||||
:DARK => [:IAPAPABERRY, :SPELONBERRY, :COLBURBERRY, :ROWAPBERRY, :MARANGABERRY],
|
||||
:STEEL => [:RAZZBERRY, :PAMTREBERRY, :BABIRIBERRY],
|
||||
:FAIRY => [:ROSELIBERRY, :KEEBERRY]
|
||||
}
|
||||
@damageArray = {
|
||||
60 => [:CHERIBERRY, :CHESTOBERRY, :PECHABERRY, :RAWSTBERRY, :ASPEARBERRY,
|
||||
:LEPPABERRY, :ORANBERRY, :PERSIMBERRY, :LUMBERRY, :SITRUSBERRY,
|
||||
:FIGYBERRY, :WIKIBERRY, :MAGOBERRY, :AGUAVBERRY, :IAPAPABERRY,
|
||||
:RAZZBERRY, :OCCABERRY, :PASSHOBERRY, :WACANBERRY, :RINDOBERRY,
|
||||
:YACHEBERRY, :CHOPLEBERRY, :KEBIABERRY, :SHUCABERRY, :COBABERRY,
|
||||
:PAYAPABERRY, :TANGABERRY, :CHARTIBERRY, :KASIBBERRY, :HABANBERRY,
|
||||
:COLBURBERRY, :BABIRIBERRY, :CHILANBERRY, :ROSELIBERRY],
|
||||
70 => [:BLUKBERRY, :NANABBERRY, :WEPEARBERRY, :PINAPBERRY, :POMEGBERRY,
|
||||
:KELPSYBERRY, :QUALOTBERRY, :HONDEWBERRY, :GREPABERRY, :TAMATOBERRY,
|
||||
:CORNNBERRY, :MAGOSTBERRY, :RABUTABERRY, :NOMELBERRY, :SPELONBERRY,
|
||||
:PAMTREBERRY],
|
||||
80 => [:WATMELBERRY, :DURINBERRY, :BELUEBERRY, :LIECHIBERRY, :GANLONBERRY,
|
||||
:SALACBERRY, :PETAYABERRY, :APICOTBERRY, :LANSATBERRY, :STARFBERRY,
|
||||
:ENIGMABERRY, :MICLEBERRY, :CUSTAPBERRY, :JABOCABERRY, :ROWAPBERRY,
|
||||
:KEEBERRY, :MARANGABERRY]
|
||||
60 => [:CHERIBERRY, :CHESTOBERRY, :PECHABERRY, :RAWSTBERRY, :ASPEARBERRY,
|
||||
:LEPPABERRY, :ORANBERRY, :PERSIMBERRY, :LUMBERRY, :SITRUSBERRY,
|
||||
:FIGYBERRY, :WIKIBERRY, :MAGOBERRY, :AGUAVBERRY, :IAPAPABERRY,
|
||||
:RAZZBERRY, :OCCABERRY, :PASSHOBERRY, :WACANBERRY, :RINDOBERRY,
|
||||
:YACHEBERRY, :CHOPLEBERRY, :KEBIABERRY, :SHUCABERRY, :COBABERRY,
|
||||
:PAYAPABERRY, :TANGABERRY, :CHARTIBERRY, :KASIBBERRY, :HABANBERRY,
|
||||
:COLBURBERRY, :BABIRIBERRY, :CHILANBERRY, :ROSELIBERRY],
|
||||
70 => [:BLUKBERRY, :NANABBERRY, :WEPEARBERRY, :PINAPBERRY, :POMEGBERRY,
|
||||
:KELPSYBERRY, :QUALOTBERRY, :HONDEWBERRY, :GREPABERRY, :TAMATOBERRY,
|
||||
:CORNNBERRY, :MAGOSTBERRY, :RABUTABERRY, :NOMELBERRY, :SPELONBERRY,
|
||||
:PAMTREBERRY],
|
||||
80 => [:WATMELBERRY, :DURINBERRY, :BELUEBERRY, :LIECHIBERRY, :GANLONBERRY,
|
||||
:SALACBERRY, :PETAYABERRY, :APICOTBERRY, :LANSATBERRY, :STARFBERRY,
|
||||
:ENIGMABERRY, :MICLEBERRY, :CUSTAPBERRY, :JABOCABERRY, :ROWAPBERRY,
|
||||
:KEEBERRY, :MARANGABERRY]
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1469,23 +1465,23 @@ class Battle::Move::TypeDependsOnUserPlate < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@itemTypes = {
|
||||
:FISTPLATE => :FIGHTING,
|
||||
:SKYPLATE => :FLYING,
|
||||
:TOXICPLATE => :POISON,
|
||||
:EARTHPLATE => :GROUND,
|
||||
:STONEPLATE => :ROCK,
|
||||
:INSECTPLATE => :BUG,
|
||||
:SPOOKYPLATE => :GHOST,
|
||||
:IRONPLATE => :STEEL,
|
||||
:FLAMEPLATE => :FIRE,
|
||||
:SPLASHPLATE => :WATER,
|
||||
:MEADOWPLATE => :GRASS,
|
||||
:ZAPPLATE => :ELECTRIC,
|
||||
:MINDPLATE => :PSYCHIC,
|
||||
:ICICLEPLATE => :ICE,
|
||||
:DRACOPLATE => :DRAGON,
|
||||
:DREADPLATE => :DARK,
|
||||
:PIXIEPLATE => :FAIRY
|
||||
:FISTPLATE => :FIGHTING,
|
||||
:SKYPLATE => :FLYING,
|
||||
:TOXICPLATE => :POISON,
|
||||
:EARTHPLATE => :GROUND,
|
||||
:STONEPLATE => :ROCK,
|
||||
:INSECTPLATE => :BUG,
|
||||
:SPOOKYPLATE => :GHOST,
|
||||
:IRONPLATE => :STEEL,
|
||||
:FLAMEPLATE => :FIRE,
|
||||
:SPLASHPLATE => :WATER,
|
||||
:MEADOWPLATE => :GRASS,
|
||||
:ZAPPLATE => :ELECTRIC,
|
||||
:MINDPLATE => :PSYCHIC,
|
||||
:ICICLEPLATE => :ICE,
|
||||
:DRACOPLATE => :DRAGON,
|
||||
:DREADPLATE => :DARK,
|
||||
:PIXIEPLATE => :FAIRY
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1509,23 +1505,23 @@ class Battle::Move::TypeDependsOnUserMemory < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@itemTypes = {
|
||||
:FIGHTINGMEMORY => :FIGHTING,
|
||||
:FLYINGMEMORY => :FLYING,
|
||||
:POISONMEMORY => :POISON,
|
||||
:GROUNDMEMORY => :GROUND,
|
||||
:ROCKMEMORY => :ROCK,
|
||||
:BUGMEMORY => :BUG,
|
||||
:GHOSTMEMORY => :GHOST,
|
||||
:STEELMEMORY => :STEEL,
|
||||
:FIREMEMORY => :FIRE,
|
||||
:WATERMEMORY => :WATER,
|
||||
:GRASSMEMORY => :GRASS,
|
||||
:ELECTRICMEMORY => :ELECTRIC,
|
||||
:PSYCHICMEMORY => :PSYCHIC,
|
||||
:ICEMEMORY => :ICE,
|
||||
:DRAGONMEMORY => :DRAGON,
|
||||
:DARKMEMORY => :DARK,
|
||||
:FAIRYMEMORY => :FAIRY
|
||||
:FIGHTINGMEMORY => :FIGHTING,
|
||||
:FLYINGMEMORY => :FLYING,
|
||||
:POISONMEMORY => :POISON,
|
||||
:GROUNDMEMORY => :GROUND,
|
||||
:ROCKMEMORY => :ROCK,
|
||||
:BUGMEMORY => :BUG,
|
||||
:GHOSTMEMORY => :GHOST,
|
||||
:STEELMEMORY => :STEEL,
|
||||
:FIREMEMORY => :FIRE,
|
||||
:WATERMEMORY => :WATER,
|
||||
:GRASSMEMORY => :GRASS,
|
||||
:ELECTRICMEMORY => :ELECTRIC,
|
||||
:PSYCHICMEMORY => :PSYCHIC,
|
||||
:ICEMEMORY => :ICE,
|
||||
:DRAGONMEMORY => :DRAGON,
|
||||
:DARKMEMORY => :DARK,
|
||||
:FAIRYMEMORY => :FAIRY
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1549,10 +1545,10 @@ class Battle::Move::TypeDependsOnUserDrive < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@itemTypes = {
|
||||
:SHOCKDRIVE => :ELECTRIC,
|
||||
:BURNDRIVE => :FIRE,
|
||||
:CHILLDRIVE => :ICE,
|
||||
:DOUSEDRIVE => :WATER
|
||||
:SHOCKDRIVE => :ELECTRIC,
|
||||
:BURNDRIVE => :FIRE,
|
||||
:CHILLDRIVE => :ICE,
|
||||
:DOUSEDRIVE => :WATER
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -677,63 +677,63 @@ class Battle::Move::UseLastMoveUsed < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
# Struggle, Belch
|
||||
"Struggle",
|
||||
"FailsIfUserNotConsumedBerry", # Belch # Not listed on Bulbapedia
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard # Not listed on Bulbapedia
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard # Not listed on Bulbapedia
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat (this move)
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power # Not listed on Bulbapedia
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
# Struggle, Belch
|
||||
"Struggle",
|
||||
"FailsIfUserNotConsumedBerry", # Belch # Not listed on Bulbapedia
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard # Not listed on Bulbapedia
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard # Not listed on Bulbapedia
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat (this move)
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power # Not listed on Bulbapedia
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
]
|
||||
if Settings::MECHANICS_GENERATION >= 6
|
||||
@moveBlacklist += [
|
||||
# Target-switching moves
|
||||
"SwitchOutTargetStatusMove", # Roar, Whirlwind
|
||||
"SwitchOutTargetDamagingMove" # Circle Throw, Dragon Tail
|
||||
# Target-switching moves
|
||||
"SwitchOutTargetStatusMove", # Roar, Whirlwind
|
||||
"SwitchOutTargetDamagingMove" # Circle Throw, Dragon Tail
|
||||
]
|
||||
end
|
||||
end
|
||||
@@ -793,18 +793,18 @@ class Battle::Move::UseMoveTargetIsAboutToUse < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
]
|
||||
end
|
||||
|
||||
@@ -897,83 +897,83 @@ class Battle::Move::UseRandomMove < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"FlinchTargetFailsIfUserNotAsleep", # Snore
|
||||
"TargetActsNext", # After You
|
||||
"TargetActsLast", # Quash
|
||||
"TargetUsesItsLastUsedMoveAgain", # Instruct
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
"FlinchTargetFailsIfUserNotAsleep", # Snore
|
||||
"TargetActsNext", # After You
|
||||
"TargetActsLast", # Quash
|
||||
"TargetUsesItsLastUsedMoveAgain", # Instruct
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
]
|
||||
@moveBlacklistSignatures = [
|
||||
:SNARL,
|
||||
# Signature moves
|
||||
:DIAMONDSTORM, # Diancie (Gen 6)
|
||||
:FLEURCANNON, # Magearna (Gen 7)
|
||||
:FREEZESHOCK, # Black Kyurem (Gen 5)
|
||||
:HYPERSPACEFURY, # Hoopa Unbound (Gen 6)
|
||||
:HYPERSPACEHOLE, # Hoopa Confined (Gen 6)
|
||||
:ICEBURN, # White Kyurem (Gen 5)
|
||||
:LIGHTOFRUIN, # Eternal Flower Floette (Gen 6)
|
||||
:MINDBLOWN, # Blacephalon (Gen 7)
|
||||
:PHOTONGEYSER, # Necrozma (Gen 7)
|
||||
:PLASMAFISTS, # Zeraora (Gen 7)
|
||||
:RELICSONG, # Meloetta (Gen 5)
|
||||
:SECRETSWORD, # Keldeo (Gen 5)
|
||||
:SPECTRALTHIEF, # Marshadow (Gen 7)
|
||||
:STEAMERUPTION, # Volcanion (Gen 6)
|
||||
:TECHNOBLAST, # Genesect (Gen 5)
|
||||
:THOUSANDARROWS, # Zygarde (Gen 6)
|
||||
:THOUSANDWAVES, # Zygarde (Gen 6)
|
||||
:VCREATE # Victini (Gen 5)
|
||||
:SNARL,
|
||||
# Signature moves
|
||||
:DIAMONDSTORM, # Diancie (Gen 6)
|
||||
:FLEURCANNON, # Magearna (Gen 7)
|
||||
:FREEZESHOCK, # Black Kyurem (Gen 5)
|
||||
:HYPERSPACEFURY, # Hoopa Unbound (Gen 6)
|
||||
:HYPERSPACEHOLE, # Hoopa Confined (Gen 6)
|
||||
:ICEBURN, # White Kyurem (Gen 5)
|
||||
:LIGHTOFRUIN, # Eternal Flower Floette (Gen 6)
|
||||
:MINDBLOWN, # Blacephalon (Gen 7)
|
||||
:PHOTONGEYSER, # Necrozma (Gen 7)
|
||||
:PLASMAFISTS, # Zeraora (Gen 7)
|
||||
:RELICSONG, # Meloetta (Gen 5)
|
||||
:SECRETSWORD, # Keldeo (Gen 5)
|
||||
:SPECTRALTHIEF, # Marshadow (Gen 7)
|
||||
:STEAMERUPTION, # Volcanion (Gen 6)
|
||||
:TECHNOBLAST, # Genesect (Gen 5)
|
||||
:THOUSANDARROWS, # Zygarde (Gen 6)
|
||||
:THOUSANDWAVES, # Zygarde (Gen 6)
|
||||
:VCREATE # Victini (Gen 5)
|
||||
]
|
||||
end
|
||||
|
||||
@@ -1012,82 +1012,82 @@ class Battle::Move::UseRandomMoveFromUserParty < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard # Not listed on Bulbapedia
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard # Not listed on Bulbapedia
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
# "UseMoveDependingOnEnvironment", # Nature Power # See below
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Target-switching moves
|
||||
# "SwitchOutTargetStatusMove", # Roar, Whirlwind # See below
|
||||
"SwitchOutTargetDamagingMove", # Circle Throw, Dragon Tail
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Counter moves
|
||||
"CounterPhysicalDamage", # Counter
|
||||
"CounterSpecialDamage", # Mirror Coat
|
||||
"CounterDamagePlusHalf", # Metal Burst # Not listed on Bulbapedia
|
||||
# Helping Hand, Feint (always blacklisted together, don't know why)
|
||||
"PowerUpAllyMove", # Helping Hand
|
||||
"RemoveProtections", # Feint
|
||||
# Protection moves
|
||||
"ProtectUser", # Detect, Protect
|
||||
"ProtectUserSideFromPriorityMoves", # Quick Guard # Not listed on Bulbapedia
|
||||
"ProtectUserSideFromMultiTargetDamagingMoves", # Wide Guard # Not listed on Bulbapedia
|
||||
"UserEnduresFaintingThisTurn", # Endure
|
||||
"ProtectUserSideFromDamagingMovesIfUserFirstTurn", # Mat Block
|
||||
"ProtectUserSideFromStatusMoves", # Crafty Shield # Not listed on Bulbapedia
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
# "UseMoveDependingOnEnvironment", # Nature Power # See below
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Move-redirecting and stealing moves
|
||||
"BounceBackProblemCausingStatusMoves", # Magic Coat # Not listed on Bulbapedia
|
||||
"StealAndUseBeneficialStatusMove", # Snatch
|
||||
"RedirectAllMovesToUser", # Follow Me, Rage Powder
|
||||
"RedirectAllMovesToTarget", # Spotlight
|
||||
# Set up effects that trigger upon KO
|
||||
"ReduceAttackerMovePPTo0IfUserFaints", # Grudge # Not listed on Bulbapedia
|
||||
"AttackerFaintsIfUserFaints", # Destiny Bond
|
||||
# Target-switching moves
|
||||
# "SwitchOutTargetStatusMove", # Roar, Whirlwind # See below
|
||||
"SwitchOutTargetDamagingMove", # Circle Throw, Dragon Tail
|
||||
# Held item-moving moves
|
||||
"UserTakesTargetItem", # Covet, Thief
|
||||
"UserTargetSwapItems", # Switcheroo, Trick
|
||||
"TargetTakesUserItem", # Bestow
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs", # Beak Blast
|
||||
# Event moves that do nothing
|
||||
"DoesNothingFailsIfNoAlly", # Hold Hands
|
||||
"DoesNothingCongratulations" # Celebrate
|
||||
]
|
||||
if Settings::MECHANICS_GENERATION >= 6
|
||||
@moveBlacklist += [
|
||||
# Moves that call other moves
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind # Not listed on Bulbapedia
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade # Not listed on Bulbapedia
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock # Not listed on Bulbapedia
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn # Not listed on Bulbapedia
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack # Not listed on Bulbapedia
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash # Not listed on Bulbapedia
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force/Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy # Not listed on Bulbapedia
|
||||
# Target-switching moves
|
||||
"SwitchOutTargetStatusMove" # Roar, Whirlwind
|
||||
# Moves that call other moves
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind # Not listed on Bulbapedia
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade # Not listed on Bulbapedia
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock # Not listed on Bulbapedia
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn # Not listed on Bulbapedia
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack # Not listed on Bulbapedia
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash # Not listed on Bulbapedia
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force/Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy # Not listed on Bulbapedia
|
||||
# Target-switching moves
|
||||
"SwitchOutTargetStatusMove" # Roar, Whirlwind
|
||||
]
|
||||
end
|
||||
end
|
||||
@@ -1127,41 +1127,41 @@ class Battle::Move::UseRandomUserMoveIfAsleep < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"MultiTurnAttackPreventSleeping", # Uproar
|
||||
"MultiTurnAttackBideThenReturnDoubleDamage", # Bide
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle # Not listed on Bulbapedia
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset (except Transform)
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power # Not listed on Bulbapedia
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force/Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
"MultiTurnAttackPreventSleeping", # Uproar
|
||||
"MultiTurnAttackBideThenReturnDoubleDamage", # Bide
|
||||
# Struggle, Belch
|
||||
"Struggle", # Struggle # Not listed on Bulbapedia
|
||||
"FailsIfUserNotConsumedBerry", # Belch
|
||||
# Moves that affect the moveset (except Transform)
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power # Not listed on Bulbapedia
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force/Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
]
|
||||
end
|
||||
|
||||
@@ -1220,13 +1220,13 @@ class Battle::Move::ReplaceMoveThisBattleWithTargetLastMoveUsed < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"UseRandomMove", # Metronome
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget" # Transform
|
||||
"UseRandomMove", # Metronome
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget" # Transform
|
||||
]
|
||||
end
|
||||
|
||||
@@ -1271,9 +1271,9 @@ class Battle::Move::ReplaceMoveWithTargetLastMoveUsed < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch (this move)
|
||||
# Struggle
|
||||
"Struggle" # Struggle
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch (this move)
|
||||
# Struggle
|
||||
"Struggle" # Struggle
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
@@ -545,44 +545,44 @@ class Battle::Move::TargetUsesItsLastUsedMoveAgain < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"MultiTurnAttackBideThenReturnDoubleDamage", # Bide
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"TargetUsesItsLastUsedMoveAgain", # Instruct (this move)
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Moves that require a recharge turn
|
||||
"AttackAndSkipNextTurn", # Hyper Beam
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force, Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
"MultiTurnAttackBideThenReturnDoubleDamage", # Bide
|
||||
"ProtectUserFromDamagingMovesKingsShield", # King's Shield
|
||||
"TargetUsesItsLastUsedMoveAgain", # Instruct (this move)
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove", # Metronome
|
||||
# Moves that require a recharge turn
|
||||
"AttackAndSkipNextTurn", # Hyper Beam
|
||||
# Two-turn attacks
|
||||
"TwoTurnAttack", # Razor Wind
|
||||
"TwoTurnAttackOneTurnInSun", # Solar Beam, Solar Blade
|
||||
"TwoTurnAttackParalyzeTarget", # Freeze Shock
|
||||
"TwoTurnAttackBurnTarget", # Ice Burn
|
||||
"TwoTurnAttackFlinchTarget", # Sky Attack
|
||||
"TwoTurnAttackChargeRaiseUserDefense1", # Skull Bash
|
||||
"TwoTurnAttackInvulnerableInSky", # Fly
|
||||
"TwoTurnAttackInvulnerableUnderground", # Dig
|
||||
"TwoTurnAttackInvulnerableUnderwater", # Dive
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget", # Bounce
|
||||
"TwoTurnAttackInvulnerableRemoveProtections", # Shadow Force, Phantom Force
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct", # Sky Drop
|
||||
"AllBattlersLoseHalfHPUserSkipsNextTurn", # Shadow Half
|
||||
"TwoTurnAttackRaiseUserSpAtkSpDefSpd2", # Geomancy
|
||||
# Moves that start focussing at the start of the round
|
||||
"FailsIfUserDamagedThisTurn", # Focus Punch
|
||||
"UsedAfterUserTakesPhysicalDamage", # Shell Trap
|
||||
"BurnAttackerBeforeUserActs" # Beak Blast
|
||||
]
|
||||
end
|
||||
|
||||
@@ -771,26 +771,26 @@ class Battle::Move::DisableTargetUsingDifferentMove < Battle::Move
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@moveBlacklist = [
|
||||
"DisableTargetUsingDifferentMove", # Encore
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Moves that call other moves (see also below)
|
||||
"UseLastMoveUsedByTarget" # Mirror Move
|
||||
"DisableTargetUsingDifferentMove", # Encore
|
||||
# Struggle
|
||||
"Struggle", # Struggle
|
||||
# Moves that affect the moveset
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"TransformUserIntoTarget", # Transform
|
||||
# Moves that call other moves (see also below)
|
||||
"UseLastMoveUsedByTarget" # Mirror Move
|
||||
]
|
||||
if Settings::MECHANICS_GENERATION >= 7
|
||||
@moveBlacklist += [
|
||||
# Moves that call other moves
|
||||
# "UseLastMoveUsedByTarget", # Mirror Move # See above
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove" # Metronome
|
||||
# Moves that call other moves
|
||||
# "UseLastMoveUsedByTarget", # Mirror Move # See above
|
||||
"UseLastMoveUsed", # Copycat
|
||||
"UseMoveTargetIsAboutToUse", # Me First
|
||||
"UseMoveDependingOnEnvironment", # Nature Power
|
||||
"UseRandomUserMoveIfAsleep", # Sleep Talk
|
||||
"UseRandomMoveFromUserParty", # Assist
|
||||
"UseRandomMove" # Metronome
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -64,11 +64,11 @@ class Battle::Scene
|
||||
# Shift depending on index (no shifting needed for sideSize of 1)
|
||||
case sideSize
|
||||
when 2
|
||||
ret[0] += [-48, 48, 32, -32][2 * index + side]
|
||||
ret[1] += [ 0, 0, 0, -16][2 * index + side]
|
||||
ret[0] += [-48, 48, 32, -32][(2 * index) + side]
|
||||
ret[1] += [ 0, 0, 0, -16][(2 * index) + side]
|
||||
when 3
|
||||
ret[0] += [-80, 80, 0, 0, 80, -80][2 * index + side]
|
||||
ret[1] += [ 0, 0, 0, -8, 0, -16][2 * index + side]
|
||||
ret[0] += [-80, 80, 0, 0, 80, -80][(2 * index) + side]
|
||||
ret[1] += [ 0, 0, 0, -8, 0, -16][(2 * index) + side]
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
@@ -83,7 +83,7 @@ class Battle::Scene
|
||||
# Wild battle, so set up the Pokémon sprite(s) accordingly
|
||||
if @battle.wildBattle?
|
||||
@battle.pbParty(1).each_with_index do |pkmn, i|
|
||||
index = i * 2 + 1
|
||||
index = (i * 2) + 1
|
||||
pbChangePokemon(index, pkmn)
|
||||
pkmnSprite = @sprites["pokemon_#{index}"]
|
||||
pkmnSprite.tone = Tone.new(-80, -80, -80)
|
||||
|
||||
@@ -6,11 +6,11 @@ class Battle::Scene
|
||||
def pbCommandMenu(idxBattler, firstAction)
|
||||
shadowTrainer = (GameData::Type.exists?(:SHADOW) && @battle.trainerBattle?)
|
||||
cmds = [
|
||||
_INTL("What will\n{1} do?", @battle.battlers[idxBattler].name),
|
||||
_INTL("Fight"),
|
||||
_INTL("Bag"),
|
||||
_INTL("Pokémon"),
|
||||
(shadowTrainer) ? _INTL("Call") : (firstAction) ? _INTL("Run") : _INTL("Cancel")
|
||||
_INTL("What will\n{1} do?", @battle.battlers[idxBattler].name),
|
||||
_INTL("Fight"),
|
||||
_INTL("Bag"),
|
||||
_INTL("Pokémon"),
|
||||
(shadowTrainer) ? _INTL("Call") : (firstAction) ? _INTL("Run") : _INTL("Cancel")
|
||||
]
|
||||
ret = pbCommandMenuEx(idxBattler, cmds, (shadowTrainer) ? 2 : (firstAction) ? 0 : 1)
|
||||
ret = 4 if ret == 3 && shadowTrainer # Convert "Run" to "Call"
|
||||
|
||||
@@ -28,7 +28,7 @@ class Battle::Scene
|
||||
# shiny animation(s)
|
||||
# Set up data box animation
|
||||
for i in 0...@battle.sideSizes[1]
|
||||
idxBattler = 2 * i + 1
|
||||
idxBattler = (2 * i) + 1
|
||||
next if !@battle.battlers[idxBattler]
|
||||
dataBoxAnim = Animation::DataBoxAppear.new(@sprites, @viewport, idxBattler)
|
||||
@animations.push(dataBoxAnim)
|
||||
@@ -43,7 +43,7 @@ class Battle::Scene
|
||||
# Show shiny animation for wild Pokémon
|
||||
if @battle.showAnims
|
||||
for i in 0...@battle.sideSizes[1]
|
||||
idxBattler = 2 * i + 1
|
||||
idxBattler = (2 * i) + 1
|
||||
next if !@battle.battlers[idxBattler] || !@battle.battlers[idxBattler].shiny?
|
||||
if Settings::SUPER_SHINY && @battle.battlers[idxBattler].super_shiny?
|
||||
pbCommonAnimation("SuperShiny", @battle.battlers[idxBattler])
|
||||
@@ -58,13 +58,14 @@ class Battle::Scene
|
||||
# Animates a party lineup appearing for the given side
|
||||
#=============================================================================
|
||||
def pbShowPartyLineup(side, fullAnim = false)
|
||||
@animations.push(Animation::LineupAppear.new(
|
||||
@sprites, @viewport, side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim
|
||||
))
|
||||
if !fullAnim
|
||||
while inPartyAnimation?
|
||||
pbUpdate
|
||||
end
|
||||
@animations.push(
|
||||
Animation::LineupAppear.new(@sprites, @viewport, side,
|
||||
@battle.pbParty(side), @battle.pbPartyStarts(side),
|
||||
fullAnim)
|
||||
)
|
||||
return if fullAnim
|
||||
while inPartyAnimation?
|
||||
pbUpdate
|
||||
end
|
||||
end
|
||||
|
||||
@@ -298,13 +299,13 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
def pbLevelUp(pkmn, _battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed)
|
||||
pbTopRightWindow(
|
||||
_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
|
||||
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
|
||||
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)
|
||||
_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
|
||||
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
|
||||
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)
|
||||
)
|
||||
pbTopRightWindow(
|
||||
_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)
|
||||
_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)
|
||||
)
|
||||
end
|
||||
|
||||
@@ -541,7 +542,7 @@ class Battle::Scene
|
||||
end
|
||||
animPlayer.setLineTransform(
|
||||
FOCUSUSER_X, FOCUSUSER_Y, FOCUSTARGET_X, FOCUSTARGET_Y,
|
||||
oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2
|
||||
oldUserX, oldUserY - (userHeight / 2), oldTargetX, oldTargetY - (targetHeight / 2)
|
||||
)
|
||||
# Play the animation
|
||||
animPlayer.start
|
||||
|
||||
@@ -106,11 +106,11 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
|
||||
USE_GRAPHICS = true
|
||||
# Lists of which button graphics to use in different situations/types of battle.
|
||||
MODES = [
|
||||
[0, 2, 1, 3], # 0 = Regular battle
|
||||
[0, 2, 1, 9], # 1 = Regular battle with "Cancel" instead of "Run"
|
||||
[0, 2, 1, 4], # 2 = Regular battle with "Call" instead of "Run"
|
||||
[5, 7, 6, 3], # 3 = Safari Zone
|
||||
[0, 8, 1, 3] # 4 = Bug Catching Contest
|
||||
[0, 2, 1, 3], # 0 = Regular battle
|
||||
[0, 2, 1, 9], # 1 = Regular battle with "Cancel" instead of "Run"
|
||||
[0, 2, 1, 4], # 2 = Regular battle with "Call" instead of "Run"
|
||||
[5, 7, 6, 3], # 3 = Safari Zone
|
||||
[0, 8, 1, 3] # 4 = Bug Catching Contest
|
||||
]
|
||||
|
||||
def initialize(viewport, z)
|
||||
@@ -137,7 +137,7 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
|
||||
button = SpriteWrapper.new(viewport)
|
||||
button.bitmap = @buttonBitmap.bitmap
|
||||
button.x = self.x + Graphics.width - 260
|
||||
button.x += (i.even? ? 0 : @buttonBitmap.width / 2 - 4)
|
||||
button.x += (i.even? ? 0 : (@buttonBitmap.width / 2) - 4)
|
||||
button.y = self.y + 6
|
||||
button.y += (((i / 2) == 0) ? 0 : BUTTON_HEIGHT - 4)
|
||||
button.src_rect.width = @buttonBitmap.width / 2
|
||||
@@ -218,10 +218,10 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
TYPE_ICON_HEIGHT = 28
|
||||
# Text colours of PP of selected move
|
||||
PP_COLORS = [
|
||||
Color.new(248, 72, 72), Color.new(136, 48, 48), # Red, zero PP
|
||||
Color.new(248, 136, 32), Color.new(144, 72, 24), # Orange, 1/4 of total PP or less
|
||||
Color.new(248, 192, 0), Color.new(144, 104, 0), # Yellow, 1/2 of total PP or less
|
||||
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR # Black, more than 1/2 of total PP
|
||||
Color.new(248, 72, 72), Color.new(136, 48, 48), # Red, zero PP
|
||||
Color.new(248, 136, 32), Color.new(144, 72, 24), # Orange, 1/4 of total PP or less
|
||||
Color.new(248, 192, 0), Color.new(144, 104, 0), # Yellow, 1/2 of total PP or less
|
||||
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR # Black, more than 1/2 of total PP
|
||||
]
|
||||
|
||||
def initialize(viewport, z)
|
||||
@@ -247,7 +247,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
button = SpriteWrapper.new(viewport)
|
||||
button.bitmap = @buttonBitmap.bitmap
|
||||
button.x = self.x + 4
|
||||
button.x += (i.even? ? 0 : @buttonBitmap.width / 2 - 4)
|
||||
button.x += (i.even? ? 0 : (@buttonBitmap.width / 2) - 4)
|
||||
button.y = self.y + 6
|
||||
button.y += (((i / 2) == 0) ? 0 : BUTTON_HEIGHT - 4)
|
||||
button.src_rect.width = @buttonBitmap.width / 2
|
||||
@@ -278,7 +278,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
@megaButton = SpriteWrapper.new(viewport)
|
||||
@megaButton.bitmap = @megaEvoBitmap.bitmap
|
||||
@megaButton.x = self.x + 120
|
||||
@megaButton.y = self.y - @megaEvoBitmap.height / 2
|
||||
@megaButton.y = self.y - (@megaEvoBitmap.height / 2)
|
||||
@megaButton.src_rect.height = @megaEvoBitmap.height / 2
|
||||
addSprite("megaButton", @megaButton)
|
||||
# Create Shift button
|
||||
@@ -354,7 +354,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
textPos = []
|
||||
@buttons.each_with_index do |button, i|
|
||||
next if !@visibility["button_#{i}"]
|
||||
x = button.x - self.x + button.src_rect.width / 2
|
||||
x = button.x - self.x + (button.src_rect.width / 2)
|
||||
y = button.y - self.y + 2
|
||||
moveNameBase = TEXT_BASE_COLOR
|
||||
if GET_MOVE_TEXT_COLOR_FROM_MOVE_BUTTON && moves[i].display_type(@battler)
|
||||
@@ -414,7 +414,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
ppFraction = [(4.0 * move.pp / move.total_pp).ceil, 3].min
|
||||
textPos = []
|
||||
textPos.push([_INTL("PP: {1}/{2}", move.pp, move.total_pp),
|
||||
448, 44, 2, PP_COLORS[ppFraction * 2], PP_COLORS[ppFraction * 2 + 1]])
|
||||
448, 44, 2, PP_COLORS[ppFraction * 2], PP_COLORS[(ppFraction * 2) + 1]])
|
||||
pbDrawTextPositions(@infoOverlay.bitmap, textPos)
|
||||
end
|
||||
end
|
||||
@@ -454,11 +454,11 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
|
||||
# Lists of which button graphics to use in different situations/types of battle.
|
||||
MODES = [
|
||||
[0, 2, 1, 3], # 0 = Regular battle
|
||||
[0, 2, 1, 9], # 1 = Regular battle with "Cancel" instead of "Run"
|
||||
[0, 2, 1, 4], # 2 = Regular battle with "Call" instead of "Run"
|
||||
[5, 7, 6, 3], # 3 = Safari Zone
|
||||
[0, 8, 1, 3] # 4 = Bug Catching Contest
|
||||
[0, 2, 1, 3], # 0 = Regular battle
|
||||
[0, 2, 1, 9], # 1 = Regular battle with "Cancel" instead of "Run"
|
||||
[0, 2, 1, 4], # 2 = Regular battle with "Call" instead of "Run"
|
||||
[5, 7, 6, 3], # 3 = Safari Zone
|
||||
[0, 8, 1, 3] # 4 = Bug Catching Contest
|
||||
]
|
||||
CMD_BUTTON_WIDTH_SMALL = 170
|
||||
TEXT_BASE_COLOR = Color.new(240, 248, 224)
|
||||
@@ -467,7 +467,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
def initialize(viewport, z, sideSizes)
|
||||
super(viewport)
|
||||
@sideSizes = sideSizes
|
||||
maxIndex = (@sideSizes[0] > @sideSizes[1]) ? (@sideSizes[0] - 1) * 2 : @sideSizes[1] * 2 - 1
|
||||
maxIndex = (@sideSizes[0] > @sideSizes[1]) ? (@sideSizes[0] - 1) * 2 : (@sideSizes[1] * 2) - 1
|
||||
@smallButtons = (@sideSizes.max > 2)
|
||||
self.x = 0
|
||||
self.y = Graphics.height - 96
|
||||
@@ -483,7 +483,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
# NOTE: Battler indexes go from left to right from the perspective of
|
||||
# that side's trainer, so inc is different for each side for the
|
||||
# same value of i/2.
|
||||
inc = (i.even?) ? i / 2 : numButtons - 1 - i / 2
|
||||
inc = (i.even?) ? i / 2 : numButtons - 1 - (i / 2)
|
||||
button = SpriteWrapper.new(viewport)
|
||||
button.bitmap = @buttonBitmap.bitmap
|
||||
button.src_rect.width = (@smallButtons) ? CMD_BUTTON_WIDTH_SMALL : @buttonBitmap.width / 2
|
||||
@@ -536,7 +536,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
sel ||= (@mode == 1)
|
||||
buttonType = (i.even?) ? 1 : 2
|
||||
end
|
||||
buttonType = 2 * buttonType + ((@smallButtons) ? 1 : 0)
|
||||
buttonType = (2 * buttonType) + ((@smallButtons) ? 1 : 0)
|
||||
button.src_rect.x = (sel) ? @buttonBitmap.width / 2 : 0
|
||||
button.src_rect.y = buttonType * BUTTON_HEIGHT
|
||||
button.z = self.z + ((sel) ? 3 : 2)
|
||||
@@ -546,7 +546,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
|
||||
textpos = []
|
||||
@buttons.each_with_index do |button, i|
|
||||
next if !button || nil_or_empty?(@texts[i])
|
||||
x = button.x - self.x + button.src_rect.width / 2
|
||||
x = button.x - self.x + (button.src_rect.width / 2)
|
||||
y = button.y - self.y + 2
|
||||
textpos.push([@texts[i], x, y, 2, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR])
|
||||
end
|
||||
|
||||
@@ -96,7 +96,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
|
||||
@contents = BitmapWrapper.new(@databoxBitmap.width, @databoxBitmap.height)
|
||||
self.bitmap = @contents
|
||||
self.visible = false
|
||||
self.z = 150 + ((@battler.index) / 2) * 5
|
||||
self.z = 150 + ((@battler.index / 2) * 5)
|
||||
pbSetSystemFont(self.bitmap)
|
||||
end
|
||||
|
||||
@@ -538,9 +538,9 @@ class Battle::Scene::BattlerSprite < RPG::Sprite
|
||||
return if !@_iconBitmap
|
||||
pbSetOrigin
|
||||
if @index.even?
|
||||
self.z = 50 + 5 * @index / 2
|
||||
self.z = 50 + (5 * @index / 2)
|
||||
else
|
||||
self.z = 50 - 5 * (@index + 1) / 2
|
||||
self.z = 50 - (5 * (@index + 1) / 2)
|
||||
end
|
||||
# Set original position
|
||||
p = Battle::Scene.pbBattlerPosition(@index, @sideSize)
|
||||
|
||||
@@ -102,7 +102,7 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
ball.setVisible(7, true)
|
||||
ballStartX = traSprite.x
|
||||
ballStartX -= ball.totalDuration * (Graphics.width / (2 * 16)) if !safariThrow
|
||||
ballStartY = traSprite.y - traSprite.bitmap.height / 2
|
||||
ballStartY = traSprite.y - (traSprite.bitmap.height / 2)
|
||||
return ballStartX, ballStartY
|
||||
end
|
||||
# Back sprite is animated, make the Poké Ball track the trainer's hand
|
||||
@@ -166,13 +166,13 @@ module Battle::Scene::Animation::BallAnimationMixin
|
||||
# throw). Instead, that throw animation and initialDelay are designed
|
||||
# to make sure the Ball's trajectory starts at the same position.
|
||||
ball.setVisible(delay, true)
|
||||
a = 2 * startY - 4 * midY + 2 * endY
|
||||
b = 4 * midY - 3 * startY - endY
|
||||
a = (2 * startY) - (4 * midY) + (2 * endY)
|
||||
b = (4 * midY) - (3 * startY) - endY
|
||||
c = startY
|
||||
for i in 1..duration
|
||||
t = i.to_f / duration # t ranges from 0 to 1
|
||||
x = startX + (endX - startX) * t # Linear in t
|
||||
y = a * t**2 + b * t + c # Quadratic in t
|
||||
t = i.to_f / duration # t ranges from 0 to 1
|
||||
x = startX + ((endX - startX) * t) # Linear in t
|
||||
y = (a * (t**2)) + (b * t) + c # Quadratic in t
|
||||
ball.moveXY(delay + i - 1, 1, x, y)
|
||||
end
|
||||
createBallTumbling(ball, delay, duration)
|
||||
|
||||
@@ -28,7 +28,7 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
|
||||
end
|
||||
else # Wild battle
|
||||
@battle.pbParty(1).each_with_index do |_pkmn, i|
|
||||
idxBattler = 2 * i + 1
|
||||
idxBattler = (2 * i) + 1
|
||||
makeSlideSprite("pokemon_#{idxBattler}", -1, appearTime, PictureOrigin::Bottom)
|
||||
end
|
||||
end
|
||||
@@ -71,7 +71,7 @@ class Battle::Scene::Animation::Intro2 < Battle::Scene::Animation
|
||||
|
||||
def createProcesses
|
||||
for i in 0...@sideSize
|
||||
idxBattler = 2 * i + 1
|
||||
idxBattler = (2 * i) + 1
|
||||
next if !@sprites["pokemon_#{idxBattler}"]
|
||||
battler = addSprite(@sprites["pokemon_#{idxBattler}"], PictureOrigin::Bottom)
|
||||
battler.moveTone(0, 4, Tone.new(0, 0, 0, 0))
|
||||
@@ -112,7 +112,7 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation
|
||||
ballY = barY - 30
|
||||
barX -= bar.bitmap.width
|
||||
end
|
||||
ballXdiff = 32 * (1 - 2 * @side)
|
||||
ballXdiff = 32 * (1 - (2 * @side))
|
||||
bar.x = barX
|
||||
bar.y = barY
|
||||
bar.opacity = 255
|
||||
@@ -155,7 +155,7 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation
|
||||
bar.moveDelta(0, 8, -dir * Graphics.width / 2, 0)
|
||||
delay = bar.totalDuration
|
||||
for i in 0...Battle::Scene::NUM_BALLS
|
||||
createBall(i, (@fullAnim) ? delay + i * 2 : 0, dir)
|
||||
createBall(i, (@fullAnim) ? delay + (i * 2) : 0, dir)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -287,7 +287,7 @@ class Battle::Scene::Animation::TrainerAppear < Battle::Scene::Animation
|
||||
# Make new trainer sprite move on-screen
|
||||
if @sprites["trainer_#{@idxTrainer + 1}"]
|
||||
trainerX, trainerY = Battle::Scene.pbTrainerPosition(1)
|
||||
trainerX += 64 + Graphics.width / 4
|
||||
trainerX += 64 + (Graphics.width / 4)
|
||||
newTrainer = addSprite(@sprites["trainer_#{@idxTrainer + 1}"], PictureOrigin::Bottom)
|
||||
newTrainer.setVisible(delay, true)
|
||||
newTrainer.setXY(delay, trainerX, trainerY)
|
||||
@@ -342,7 +342,7 @@ class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation
|
||||
for i in 0...Battle::Scene::NUM_BALLS
|
||||
next if !@sprites["partyBall_0_#{i}"] || !@sprites["partyBall_0_#{i}"].visible
|
||||
partyBall = addSprite(@sprites["partyBall_0_#{i}"])
|
||||
partyBall.moveDelta(delay + 2 * i, 16, -Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveDelta(delay + (2 * i), 16, -Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveOpacity(delay, 12, 0)
|
||||
partyBall.setVisible(delay + 12, false)
|
||||
partyBall.setOpacity(delay + 12, 255)
|
||||
@@ -387,7 +387,7 @@ class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
|
||||
for i in 0...Battle::Scene::NUM_BALLS
|
||||
next if !@sprites["partyBall_1_#{i}"] || !@sprites["partyBall_1_#{i}"].visible
|
||||
partyBall = addSprite(@sprites["partyBall_1_#{i}"])
|
||||
partyBall.moveDelta(delay + 2 * i, 16, Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveDelta(delay + (2 * i), 16, Graphics.width, 0) if @fullAnim
|
||||
partyBall.moveOpacity(delay, 12, 0)
|
||||
partyBall.setVisible(delay + 12, false)
|
||||
partyBall.setOpacity(delay + 12, 255)
|
||||
@@ -782,12 +782,12 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
||||
d = [1, 2, 4, 8][i] # Fraction of the starting height each bounce rises to
|
||||
delay -= t if i == 0
|
||||
if i > 0
|
||||
ball.setZoomXY(delay, 100 + 5 * (5 - i), 100 - 5 * (5 - i)) # Squish
|
||||
ball.setZoomXY(delay, 100 + (5 * (5 - i)), 100 - (5 * (5 - i))) # Squish
|
||||
ball.moveZoom(delay, 2, 100) # Unsquish
|
||||
ball.moveXY(delay, t, ballEndX, ballGroundY - (ballGroundY - ballEndY) / d)
|
||||
ball.moveXY(delay, t, ballEndX, ballGroundY - ((ballGroundY - ballEndY) / d))
|
||||
end
|
||||
ball.moveXY(delay + t, t, ballEndX, ballGroundY)
|
||||
ball.setSE(delay + 2 * t, "Battle ball drop", 100 - i * 7)
|
||||
ball.setSE(delay + (2 * t), "Battle ball drop", 100 - (i * 7))
|
||||
delay = ball.totalDuration
|
||||
end
|
||||
battler.setXY(ball.totalDuration, ballEndX, ballGroundY)
|
||||
@@ -795,9 +795,9 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
||||
delay = ball.totalDuration + 12
|
||||
for i in 0...[@numShakes, 3].min
|
||||
ball.setSE(delay, "Battle ball shake")
|
||||
ball.moveXY(delay, 2, ballEndX - 2 * (4 - i), ballGroundY)
|
||||
ball.moveXY(delay, 2, ballEndX - (2 * (4 - i)), ballGroundY)
|
||||
ball.moveAngle(delay, 2, 5 * (4 - i)) # positive means counterclockwise
|
||||
ball.moveXY(delay + 2, 4, ballEndX + 2 * (4 - i), ballGroundY)
|
||||
ball.moveXY(delay + 2, 4, ballEndX + (2 * (4 - i)), ballGroundY)
|
||||
ball.moveAngle(delay + 2, 4, -5 * (4 - i)) # negative means clockwise
|
||||
ball.moveXY(delay + 6, 2, ballEndX, ballGroundY)
|
||||
ball.moveAngle(delay + 6, 2, 0)
|
||||
|
||||
@@ -29,24 +29,24 @@ class Battle::AI
|
||||
pkmn = battler.pokemon
|
||||
# Item categories
|
||||
hpItems = {
|
||||
:POTION => 20,
|
||||
:SUPERPOTION => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 60 : 50,
|
||||
:HYPERPOTION => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 120 : 200,
|
||||
:MAXPOTION => 999,
|
||||
:BERRYJUICE => 20,
|
||||
:SWEETHEART => 20,
|
||||
:FRESHWATER => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 30 : 50,
|
||||
:SODAPOP => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 50 : 60,
|
||||
:LEMONADE => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 70 : 80,
|
||||
:MOOMOOMILK => 100,
|
||||
:ORANBERRY => 10,
|
||||
:SITRUSBERRY => battler.totalhp / 4,
|
||||
:ENERGYPOWDER => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 60 : 50,
|
||||
:ENERGYROOT => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 120 : 200
|
||||
:POTION => 20,
|
||||
:SUPERPOTION => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 60 : 50,
|
||||
:HYPERPOTION => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 120 : 200,
|
||||
:MAXPOTION => 999,
|
||||
:BERRYJUICE => 20,
|
||||
:SWEETHEART => 20,
|
||||
:FRESHWATER => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 30 : 50,
|
||||
:SODAPOP => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 50 : 60,
|
||||
:LEMONADE => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 70 : 80,
|
||||
:MOOMOOMILK => 100,
|
||||
:ORANBERRY => 10,
|
||||
:SITRUSBERRY => battler.totalhp / 4,
|
||||
:ENERGYPOWDER => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 60 : 50,
|
||||
:ENERGYROOT => (Settings::REBALANCED_HEALING_ITEM_AMOUNTS) ? 120 : 200
|
||||
}
|
||||
hpItems[:RAGECANDYBAR] = 20 if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
fullRestoreItems = [
|
||||
:FULLRESTORE
|
||||
:FULLRESTORE
|
||||
]
|
||||
oneStatusItems = [ # Preferred over items that heal all status problems
|
||||
:AWAKENING, :CHESTOBERRY, :BLUEFLUTE,
|
||||
@@ -56,43 +56,43 @@ class Battle::AI
|
||||
:ICEHEAL, :ASPEARBERRY
|
||||
]
|
||||
allStatusItems = [
|
||||
:FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE,
|
||||
:SHALOURSABLE, :BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY, :HEALPOWDER
|
||||
:FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE,
|
||||
:SHALOURSABLE, :BIGMALASADA, :PEWTERCRUNCHIES, :LUMBERRY, :HEALPOWDER
|
||||
]
|
||||
allStatusItems.push(:RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
xItems = {
|
||||
:XATTACK => [:ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XATTACK2 => [:ATTACK, 2],
|
||||
:XATTACK3 => [:ATTACK, 3],
|
||||
:XATTACK6 => [:ATTACK, 6],
|
||||
:XDEFENSE => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFENSE2 => [:DEFENSE, 2],
|
||||
:XDEFENSE3 => [:DEFENSE, 3],
|
||||
:XDEFENSE6 => [:DEFENSE, 6],
|
||||
:XDEFEND => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFEND2 => [:DEFENSE, 2],
|
||||
:XDEFEND3 => [:DEFENSE, 3],
|
||||
:XDEFEND6 => [:DEFENSE, 6],
|
||||
:XSPATK => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPATK2 => [:SPECIAL_ATTACK, 2],
|
||||
:XSPATK3 => [:SPECIAL_ATTACK, 3],
|
||||
:XSPATK6 => [:SPECIAL_ATTACK, 6],
|
||||
:XSPECIAL => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPECIAL2 => [:SPECIAL_ATTACK, 2],
|
||||
:XSPECIAL3 => [:SPECIAL_ATTACK, 3],
|
||||
:XSPECIAL6 => [:SPECIAL_ATTACK, 6],
|
||||
:XSPDEF => [:SPECIAL_DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPDEF2 => [:SPECIAL_DEFENSE, 2],
|
||||
:XSPDEF3 => [:SPECIAL_DEFENSE, 3],
|
||||
:XSPDEF6 => [:SPECIAL_DEFENSE, 6],
|
||||
:XSPEED => [:SPEED, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPEED2 => [:SPEED, 2],
|
||||
:XSPEED3 => [:SPEED, 3],
|
||||
:XSPEED6 => [:SPEED, 6],
|
||||
:XACCURACY => [:ACCURACY, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XACCURACY2 => [:ACCURACY, 2],
|
||||
:XACCURACY3 => [:ACCURACY, 3],
|
||||
:XACCURACY6 => [:ACCURACY, 6]
|
||||
:XATTACK => [:ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XATTACK2 => [:ATTACK, 2],
|
||||
:XATTACK3 => [:ATTACK, 3],
|
||||
:XATTACK6 => [:ATTACK, 6],
|
||||
:XDEFENSE => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFENSE2 => [:DEFENSE, 2],
|
||||
:XDEFENSE3 => [:DEFENSE, 3],
|
||||
:XDEFENSE6 => [:DEFENSE, 6],
|
||||
:XDEFEND => [:DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFEND2 => [:DEFENSE, 2],
|
||||
:XDEFEND3 => [:DEFENSE, 3],
|
||||
:XDEFEND6 => [:DEFENSE, 6],
|
||||
:XSPATK => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPATK2 => [:SPECIAL_ATTACK, 2],
|
||||
:XSPATK3 => [:SPECIAL_ATTACK, 3],
|
||||
:XSPATK6 => [:SPECIAL_ATTACK, 6],
|
||||
:XSPECIAL => [:SPECIAL_ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPECIAL2 => [:SPECIAL_ATTACK, 2],
|
||||
:XSPECIAL3 => [:SPECIAL_ATTACK, 3],
|
||||
:XSPECIAL6 => [:SPECIAL_ATTACK, 6],
|
||||
:XSPDEF => [:SPECIAL_DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPDEF2 => [:SPECIAL_DEFENSE, 2],
|
||||
:XSPDEF3 => [:SPECIAL_DEFENSE, 3],
|
||||
:XSPDEF6 => [:SPECIAL_DEFENSE, 6],
|
||||
:XSPEED => [:SPEED, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPEED2 => [:SPEED, 2],
|
||||
:XSPEED3 => [:SPEED, 3],
|
||||
:XSPEED6 => [:SPEED, 6],
|
||||
:XACCURACY => [:ACCURACY, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XACCURACY2 => [:ACCURACY, 2],
|
||||
:XACCURACY3 => [:ACCURACY, 3],
|
||||
:XACCURACY6 => [:ACCURACY, 6]
|
||||
}
|
||||
losthp = battler.totalhp - battler.hp
|
||||
preferFullRestore = (battler.hp <= battler.totalhp * 2 / 3 &&
|
||||
|
||||
@@ -176,18 +176,15 @@ class Battle::AI
|
||||
miss = false if user.hasActiveAbility?(:NOGUARD) || target.hasActiveAbility?(:NOGUARD)
|
||||
if miss && pbRoughStat(user, :SPEED, skill) > pbRoughStat(target, :SPEED, skill)
|
||||
# Knows what can get past semi-invulnerability
|
||||
if target.effects[PBEffects::SkyDrop] >= 0
|
||||
if target.effects[PBEffects::SkyDrop] >= 0 ||
|
||||
target.inTwoTurnAttack?("TwoTurnAttackInvulnerableInSky",
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget",
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct")
|
||||
miss = false if move.hitsFlyingTargets?
|
||||
else
|
||||
if target.inTwoTurnAttack?("TwoTurnAttackInvulnerableInSky",
|
||||
"TwoTurnAttackInvulnerableInSkyParalyzeTarget",
|
||||
"TwoTurnAttackInvulnerableInSkyTargetCannotAct")
|
||||
miss = false if move.hitsFlyingTargets?
|
||||
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground")
|
||||
miss = false if move.hitsDiggingTargets?
|
||||
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderwater")
|
||||
miss = false if move.hitsDivingTargets?
|
||||
end
|
||||
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderground")
|
||||
miss = false if move.hitsDiggingTargets?
|
||||
elsif target.inTwoTurnAttack?("TwoTurnAttackInvulnerableUnderwater")
|
||||
miss = false if move.hitsDivingTargets?
|
||||
end
|
||||
end
|
||||
score -= 80 if miss
|
||||
|
||||
@@ -28,10 +28,8 @@ class Battle::AI
|
||||
score -= 50
|
||||
end
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "SleepTargetNextTurn"
|
||||
@@ -63,10 +61,8 @@ class Battle::AI
|
||||
score += 10 if pbRoughStat(target, :SPECIAL_DEFENSE, skill) > 100
|
||||
score -= 40 if target.hasActiveAbility?([:GUTS, :MARVELSCALE, :TOXICBOOST])
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "ParalyzeTarget", "ParalyzeTargetIfNotTypeImmune",
|
||||
@@ -89,10 +85,8 @@ class Battle::AI
|
||||
if skill >= PBTrainerAI.highSkill
|
||||
score -= 40 if target.hasActiveAbility?([:GUTS, :MARVELSCALE, :QUICKFEET])
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "BurnTarget", "BurnFlinchTarget", "TwoTurnAttackBurnTarget"
|
||||
@@ -101,10 +95,8 @@ class Battle::AI
|
||||
if skill >= PBTrainerAI.highSkill
|
||||
score -= 40 if target.hasActiveAbility?([:GUTS, :MARVELSCALE, :QUICKFEET, :FLAREBOOST])
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "FreezeTarget", "FreezeTargetAlwaysHitsInHail", "FreezeFlinchTarget"
|
||||
@@ -113,10 +105,8 @@ class Battle::AI
|
||||
if skill >= PBTrainerAI.highSkill
|
||||
score -= 20 if target.hasActiveAbility?(:MARVELSCALE)
|
||||
end
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "FlinchTarget"
|
||||
@@ -159,10 +149,8 @@ class Battle::AI
|
||||
when "ConfuseTarget", "ConfuseTargetAlwaysHitsInRainHitsTargetInSky"
|
||||
if target.pbCanConfuse?(user, false)
|
||||
score += 30
|
||||
else
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
elsif skill >= PBTrainerAI.mediumSkill
|
||||
score -= 90 if move.statusMove?
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "AttractTarget"
|
||||
@@ -274,8 +262,8 @@ class Battle::AI
|
||||
else
|
||||
score -= user.stages[:DEFENSE] * 20
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:DEFENSE] < 0
|
||||
elsif user.stages[:DEFENSE] < 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserSpeed1"
|
||||
@@ -290,8 +278,8 @@ class Battle::AI
|
||||
score += 30 if aspeed < ospeed && aspeed * 2 > ospeed
|
||||
end
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:SPEED] < 0
|
||||
elsif user.stages[:SPEED] < 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserSpAtk1"
|
||||
@@ -341,8 +329,8 @@ class Battle::AI
|
||||
else
|
||||
score -= user.stages[:SPECIAL_DEFENSE] * 20
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:SPECIAL_DEFENSE] < 0
|
||||
elsif user.stages[:SPECIAL_DEFENSE] < 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserEvasion1"
|
||||
@@ -352,8 +340,8 @@ class Battle::AI
|
||||
else
|
||||
score -= user.stages[:EVASION] * 10
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:EVASION] < 0
|
||||
elsif user.stages[:EVASION] < 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserCriticalHitRate2"
|
||||
@@ -363,8 +351,8 @@ class Battle::AI
|
||||
else
|
||||
score += 30
|
||||
end
|
||||
else
|
||||
score += 30 if user.effects[PBEffects::FocusEnergy] < 2
|
||||
elsif user.effects[PBEffects::FocusEnergy] < 2
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseUserAtkDef1"
|
||||
@@ -858,15 +846,15 @@ class Battle::AI
|
||||
when "RaiseTargetSpAtk1ConfuseTarget"
|
||||
if !target.pbCanConfuse?(user, false)
|
||||
score -= 90
|
||||
else
|
||||
score += 30 if target.stages[:SPECIAL_ATTACK] < 0
|
||||
elsif target.stages[:SPECIAL_ATTACK] < 0
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseTargetAttack2ConfuseTarget"
|
||||
if !target.pbCanConfuse?(user, false)
|
||||
score -= 90
|
||||
else
|
||||
score += 30 if target.stages[:ATTACK] < 0
|
||||
elsif target.stages[:ATTACK] < 0
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetAttack1"
|
||||
@@ -909,8 +897,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:DEFENSE] * 20
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:DEFENSE] > 0
|
||||
elsif target.stages[:DEFENSE] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetSpeed1", "LowerTargetSpeed1WeakerInGrassyTerrain"
|
||||
@@ -925,8 +913,8 @@ class Battle::AI
|
||||
score += 30 if aspeed < ospeed && aspeed * 2 > ospeed
|
||||
end
|
||||
end
|
||||
else
|
||||
score += 20 if user.stages[:SPEED] > 0
|
||||
elsif user.stages[:SPEED] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetSpAtk1"
|
||||
@@ -969,8 +957,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:SPECIAL_DEFENSE] * 20
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:SPECIAL_DEFENSE] > 0
|
||||
elsif target.stages[:SPECIAL_DEFENSE] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetAccuracy1", "LowerTargetAccuracy2", "LowerTargetAccuracy3"
|
||||
@@ -980,8 +968,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:ACCURACY] * 10
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:ACCURACY] > 0
|
||||
elsif target.stages[:ACCURACY] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetEvasion1", "LowerTargetEvasion2", "LowerTargetEvasion3"
|
||||
@@ -991,8 +979,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:EVASION] * 10
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:EVASION] > 0
|
||||
elsif target.stages[:EVASION] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetEvasion1RemoveSideEffects"
|
||||
@@ -1002,8 +990,8 @@ class Battle::AI
|
||||
else
|
||||
score += target.stages[:EVASION] * 10
|
||||
end
|
||||
else
|
||||
score += 20 if target.stages[:EVASION] > 0
|
||||
elsif target.stages[:EVASION] > 0
|
||||
score += 20
|
||||
end
|
||||
score += 30 if target.pbOwnSide.effects[PBEffects::AuroraVeil] > 0 ||
|
||||
target.pbOwnSide.effects[PBEffects::Reflect] > 0 ||
|
||||
@@ -1294,10 +1282,10 @@ class Battle::AI
|
||||
#---------------------------------------------------------------------------
|
||||
when "ReplaceMoveThisBattleWithTargetLastMoveUsed"
|
||||
moveBlacklist = [
|
||||
"Struggle", # Struggle
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"UseRandomMove" # Metronome
|
||||
"Struggle", # Struggle
|
||||
"ReplaceMoveThisBattleWithTargetLastMoveUsed", # Mimic
|
||||
"ReplaceMoveWithTargetLastMoveUsed", # Sketch
|
||||
"UseRandomMove" # Metronome
|
||||
]
|
||||
if user.effects[PBEffects::Transform] || !target.lastRegularMoveUsed
|
||||
score -= 90
|
||||
@@ -1316,8 +1304,8 @@ class Battle::AI
|
||||
#---------------------------------------------------------------------------
|
||||
when "ReplaceMoveWithTargetLastMoveUsed"
|
||||
moveBlacklist = [
|
||||
"Struggle", # Struggle
|
||||
"ReplaceMoveWithTargetLastMoveUsed" # Sketch
|
||||
"Struggle", # Struggle
|
||||
"ReplaceMoveWithTargetLastMoveUsed" # Sketch
|
||||
]
|
||||
if user.effects[PBEffects::Transform] || !target.lastRegularMoveUsed
|
||||
score -= 90
|
||||
@@ -1393,25 +1381,25 @@ class Battle::AI
|
||||
end
|
||||
if !new_type
|
||||
envtypes = {
|
||||
:None => :NORMAL,
|
||||
:Grass => :GRASS,
|
||||
:TallGrass => :GRASS,
|
||||
:MovingWater => :WATER,
|
||||
:StillWater => :WATER,
|
||||
:Puddle => :WATER,
|
||||
:Underwater => :WATER,
|
||||
:Cave => :ROCK,
|
||||
:Rock => :GROUND,
|
||||
:Sand => :GROUND,
|
||||
:Forest => :BUG,
|
||||
:ForestGrass => :BUG,
|
||||
:Snow => :ICE,
|
||||
:Ice => :ICE,
|
||||
:Volcano => :FIRE,
|
||||
:Graveyard => :GHOST,
|
||||
:Sky => :FLYING,
|
||||
:Space => :DRAGON,
|
||||
:UltraSpace => :PSYCHIC
|
||||
:None => :NORMAL,
|
||||
:Grass => :GRASS,
|
||||
:TallGrass => :GRASS,
|
||||
:MovingWater => :WATER,
|
||||
:StillWater => :WATER,
|
||||
:Puddle => :WATER,
|
||||
:Underwater => :WATER,
|
||||
:Cave => :ROCK,
|
||||
:Rock => :GROUND,
|
||||
:Sand => :GROUND,
|
||||
:Forest => :BUG,
|
||||
:ForestGrass => :BUG,
|
||||
:Snow => :ICE,
|
||||
:Ice => :ICE,
|
||||
:Volcano => :FIRE,
|
||||
:Graveyard => :GHOST,
|
||||
:Sky => :FLYING,
|
||||
:Space => :DRAGON,
|
||||
:UltraSpace => :PSYCHIC
|
||||
}
|
||||
new_type = envtypes[@battle.environment]
|
||||
new_type = nil if !GameData::Type.exists?(new_type)
|
||||
@@ -1918,15 +1906,15 @@ class Battle::AI
|
||||
score -= 90
|
||||
elsif skill >= PBTrainerAI.mediumSkill && target.pbHasType?(:GRASS)
|
||||
score -= 90
|
||||
else
|
||||
score += 60 if user.turnCount == 0
|
||||
elsif user.turnCount == 0
|
||||
score += 60
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "HealUserByHalfOfDamageDone"
|
||||
if skill >= PBTrainerAI.highSkill && target.hasActiveAbility?(:LIQUIDOOZE)
|
||||
score -= 70
|
||||
else
|
||||
score += 20 if user.hp <= user.totalhp / 2
|
||||
elsif user.hp <= user.totalhp / 2
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "HealUserByHalfOfDamageDoneIfTargetAsleep"
|
||||
@@ -1934,16 +1922,15 @@ class Battle::AI
|
||||
score -= 100
|
||||
elsif skill >= PBTrainerAI.highSkill && target.hasActiveAbility?(:LIQUIDOOZE)
|
||||
score -= 70
|
||||
else
|
||||
score += 20 if user.hp <= user.totalhp / 2
|
||||
elsif user.hp <= user.totalhp / 2
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "HealTargetHalfOfTotalHP"
|
||||
if user.opposes?(target)
|
||||
score -= 100
|
||||
else
|
||||
score += 20 if target.hp < target.totalhp / 2 &&
|
||||
target.effects[PBEffects::Substitute] == 0
|
||||
elsif target.hp < target.totalhp / 2 && target.effects[PBEffects::Substitute] == 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "UserFaintsExplosive"
|
||||
@@ -1979,8 +1966,8 @@ class Battle::AI
|
||||
when "StartPerishCountsForAllBattlers"
|
||||
if @battle.pbAbleNonActiveCount(user.idxOwnSide) == 0
|
||||
score -= 90
|
||||
else
|
||||
score -= 90 if target.effects[PBEffects::PerishSong] > 0
|
||||
elsif target.effects[PBEffects::PerishSong] > 0
|
||||
score -= 90
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "ReduceAttackerMovePPTo0IfUserFaints"
|
||||
@@ -2125,13 +2112,11 @@ class Battle::AI
|
||||
when "TargetTakesUserItem"
|
||||
if !user.item || target.item
|
||||
score -= 90
|
||||
elsif user.hasActiveItem?([:FLAMEORB, :TOXICORB, :STICKYBARB, :IRONBALL,
|
||||
:CHOICEBAND, :CHOICESCARF, :CHOICESPECS])
|
||||
score += 50
|
||||
else
|
||||
if user.hasActiveItem?([:FLAMEORB, :TOXICORB, :STICKYBARB, :IRONBALL,
|
||||
:CHOICEBAND, :CHOICESCARF, :CHOICESPECS])
|
||||
score += 50
|
||||
else
|
||||
score -= 80
|
||||
end
|
||||
score -= 80
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "UserConsumeTargetBerry", "DestroyTargetBerryOrGem"
|
||||
@@ -2160,8 +2145,8 @@ class Battle::AI
|
||||
when "StartNegateHeldItems"
|
||||
if @battle.field.effects[PBEffects::MagicRoom] > 0
|
||||
score -= 90
|
||||
else
|
||||
score += 30 if !user.item && target.item
|
||||
elsif !user.item && target.item
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RecoilQuarterOfDamageDealt"
|
||||
@@ -2245,39 +2230,30 @@ class Battle::AI
|
||||
when "AddSpikesToFoeSide"
|
||||
if user.pbOpposingSide.effects[PBEffects::Spikes] >= 3
|
||||
score -= 90
|
||||
elsif user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
score -= 90 # Opponent can't switch in any Pokemon
|
||||
else
|
||||
if user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
# Opponent can't switch in any Pokemon
|
||||
score -= 90
|
||||
else
|
||||
score += 10 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
score += [40, 26, 13][user.pbOpposingSide.effects[PBEffects::Spikes]]
|
||||
end
|
||||
score += 10 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
score += [40, 26, 13][user.pbOpposingSide.effects[PBEffects::Spikes]]
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "AddToxicSpikesToFoeSide"
|
||||
if user.pbOpposingSide.effects[PBEffects::ToxicSpikes] >= 2
|
||||
score -= 90
|
||||
elsif user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
score -= 90 # Opponent can't switch in any Pokemon
|
||||
else
|
||||
if user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
# Opponent can't switch in any Pokemon
|
||||
score -= 90
|
||||
else
|
||||
score += 8 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
score += [26, 13][user.pbOpposingSide.effects[PBEffects::ToxicSpikes]]
|
||||
end
|
||||
score += 8 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
score += [26, 13][user.pbOpposingSide.effects[PBEffects::ToxicSpikes]]
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "AddStealthRocksToFoeSide"
|
||||
if user.pbOpposingSide.effects[PBEffects::StealthRock]
|
||||
score -= 90
|
||||
elsif user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
score -= 90 # Opponent can't switch in any Pokemon
|
||||
else
|
||||
if user.allOpposing.none? { |b| @battle.pbCanChooseNonActive?(b.index) }
|
||||
# Opponent can't switch in any Pokemon
|
||||
score -= 90
|
||||
else
|
||||
score += 10 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
end
|
||||
score += 10 * @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "GrassPledge"
|
||||
@@ -2360,10 +2336,9 @@ class Battle::AI
|
||||
score += avg / 2
|
||||
if user.effects[PBEffects::Stockpile] >= 3
|
||||
score -= 80
|
||||
else
|
||||
# More preferable if user also has Spit Up/Swallow
|
||||
score += 20 if user.pbHasMoveFunction?("PowerDependsOnUserStockpile",
|
||||
"HealUserDependingOnUserStockpile") # Spit Up, Swallow
|
||||
elsif user.pbHasMoveFunction?("PowerDependsOnUserStockpile",
|
||||
"HealUserDependingOnUserStockpile") # Spit Up, Swallow
|
||||
score += 20 # More preferable if user also has Spit Up/Swallow
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "PowerDependsOnUserStockpile"
|
||||
@@ -2557,8 +2532,8 @@ class Battle::AI
|
||||
when "HoopaRemoveProtectionsBypassSubstituteLowerUserDef1"
|
||||
if !user.isSpecies?(:HOOPA) || user.form != 1
|
||||
score -= 100
|
||||
else
|
||||
score += 20 if target.stages[:DEFENSE] > 0
|
||||
elsif target.stages[:DEFENSE] > 0
|
||||
score += 20
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "LowerTargetSpAtk2", "LowerTargetSpAtk3"
|
||||
@@ -2657,8 +2632,8 @@ class Battle::AI
|
||||
ospeed = pbRoughStat(target, :SPEED, skill)
|
||||
if aspeed > ospeed
|
||||
score -= 90
|
||||
else
|
||||
score += 30 if target.pbHasMoveType?(:FIRE)
|
||||
elsif target.pbHasMoveType?(:FIRE)
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "ProtectUserSideFromDamagingMovesIfUserFirstTurn"
|
||||
@@ -2715,8 +2690,8 @@ class Battle::AI
|
||||
when "HealUserByThreeQuartersOfDamageDone"
|
||||
if skill >= PBTrainerAI.highSkill && target.hasActiveAbility?(:LIQUIDOOZE)
|
||||
score -= 80
|
||||
else
|
||||
score += 40 if user.hp <= user.totalhp / 2
|
||||
elsif user.hp <= user.totalhp / 2
|
||||
score += 40
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "RaiseTargetAttack1"
|
||||
@@ -2776,8 +2751,8 @@ class Battle::AI
|
||||
when "CureTargetBurn"
|
||||
if target.opposes?(user)
|
||||
score -= 40 if target.status == :BURN
|
||||
else
|
||||
score += 40 if target.status == :BURN
|
||||
elsif target.status == :BURN
|
||||
score += 40
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "CureTargetStatusHealUserHalfOfTotalHP"
|
||||
|
||||
@@ -562,7 +562,7 @@ class Battle::AI
|
||||
baseDmg = [(baseDmg * multipliers[:base_damage_multiplier]).round, 1].max
|
||||
atk = [(atk * multipliers[:attack_multiplier]).round, 1].max
|
||||
defense = [(defense * multipliers[:defense_multiplier]).round, 1].max
|
||||
damage = (((2.0 * user.level / 5 + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = ((((2.0 * user.level / 5) + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = [(damage * multipliers[:final_damage_multiplier]).round, 1].max
|
||||
# "AI-specific calculations below"
|
||||
# Increased critical hit rates
|
||||
|
||||
@@ -154,7 +154,7 @@ module Battle::CatchAndStoreMixin
|
||||
# First half of the shakes calculation
|
||||
a = battler.totalhp
|
||||
b = battler.hp
|
||||
x = ((3 * a - 2 * b) * catch_rate.to_f) / (3 * a)
|
||||
x = (((3 * a) - (2 * b)) * catch_rate.to_f) / (3 * a)
|
||||
# Calculation modifiers
|
||||
if battler.status == :SLEEP || battler.status == :FROZEN
|
||||
x *= 2.5
|
||||
|
||||
@@ -45,8 +45,8 @@ end
|
||||
def repositionY(x1, y1, x2, y2, tx, ty)
|
||||
dx = x2 - x1
|
||||
dy = y2 - y1
|
||||
x = x1 + tx * dx.to_f
|
||||
y = y1 + ty * dy.to_f
|
||||
x = x1 + (tx * dx.to_f)
|
||||
y = y1 + (ty * dy.to_f)
|
||||
return [x, y]
|
||||
end
|
||||
|
||||
@@ -134,10 +134,10 @@ def pbConvertRPGAnimation(animation)
|
||||
end
|
||||
if animation.position == 3 # Screen
|
||||
point = transformPoint(
|
||||
-160, 80, 160, -80,
|
||||
Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y,
|
||||
Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y,
|
||||
data[j, 1], data[j, 2]
|
||||
-160, 80, 160, -80,
|
||||
Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y,
|
||||
Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y,
|
||||
data[j, 1], data[j, 2]
|
||||
)
|
||||
cel = pbCreateCel(point[0], point[1], data[j, 0])
|
||||
else
|
||||
@@ -219,11 +219,9 @@ class RPG::Animation
|
||||
timing = RPG::Animation::Timing.new
|
||||
othertiming = otherAnim.timings[i]
|
||||
timing.frame = frame + othertiming.frame
|
||||
timing.se = RPG::AudioFile.new(
|
||||
othertiming.se.name.clone,
|
||||
othertiming.se.volume,
|
||||
othertiming.se.pitch
|
||||
)
|
||||
timing.se = RPG::AudioFile.new(othertiming.se.name.clone,
|
||||
othertiming.se.volume,
|
||||
othertiming.se.pitch)
|
||||
timing.flash_scope = othertiming.flash_scope
|
||||
timing.flash_color = othertiming.flash_color.clone
|
||||
timing.flash_duration = othertiming.flash_duration
|
||||
@@ -571,20 +569,20 @@ class PBAnimation < Array
|
||||
next if frame < i.frame || frame > i.frame + i.duration
|
||||
fraction = (frame - i.frame).to_f / i.duration
|
||||
if bgGraphic.bitmap != nil
|
||||
bgGraphic.ox = oldbg[0] - (i.bgX - oldbg[0]) * fraction if i.bgX != nil
|
||||
bgGraphic.oy = oldbg[1] - (i.bgY - oldbg[1]) * fraction if i.bgY != nil
|
||||
bgGraphic.opacity = oldbg[2] + (i.opacity - oldbg[2]) * fraction if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldbg[3].red + (i.colorRed - oldbg[3].red) * fraction : oldbg[3].red
|
||||
cg = (i.colorGreen != nil) ? oldbg[3].green + (i.colorGreen - oldbg[3].green) * fraction : oldbg[3].green
|
||||
cb = (i.colorBlue != nil) ? oldbg[3].blue + (i.colorBlue - oldbg[3].blue) * fraction : oldbg[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + (i.colorAlpha - oldbg[3].alpha) * fraction : oldbg[3].alpha
|
||||
bgGraphic.ox = oldbg[0] - ((i.bgX - oldbg[0]) * fraction) if i.bgX != nil
|
||||
bgGraphic.oy = oldbg[1] - ((i.bgY - oldbg[1]) * fraction) if i.bgY != nil
|
||||
bgGraphic.opacity = oldbg[2] + ((i.opacity - oldbg[2]) * fraction) if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldbg[3].red + ((i.colorRed - oldbg[3].red) * fraction) : oldbg[3].red
|
||||
cg = (i.colorGreen != nil) ? oldbg[3].green + ((i.colorGreen - oldbg[3].green) * fraction) : oldbg[3].green
|
||||
cb = (i.colorBlue != nil) ? oldbg[3].blue + ((i.colorBlue - oldbg[3].blue) * fraction) : oldbg[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + ((i.colorAlpha - oldbg[3].alpha) * fraction) : oldbg[3].alpha
|
||||
bgGraphic.color = Color.new(cr, cg, cb, ca)
|
||||
else
|
||||
bgColor.opacity = oldbg[2] + (i.opacity - oldbg[2]) * fraction if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldbg[3].red + (i.colorRed - oldbg[3].red) * fraction : oldbg[3].red
|
||||
cg = (i.colorGreen != nil) ? oldbg[3].green + (i.colorGreen - oldbg[3].green) * fraction : oldbg[3].green
|
||||
cb = (i.colorBlue != nil) ? oldbg[3].blue + (i.colorBlue - oldbg[3].blue) * fraction : oldbg[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + (i.colorAlpha - oldbg[3].alpha) * fraction : oldbg[3].alpha
|
||||
bgColor.opacity = oldbg[2] + ((i.opacity - oldbg[2]) * fraction) if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldbg[3].red + ((i.colorRed - oldbg[3].red) * fraction) : oldbg[3].red
|
||||
cg = (i.colorGreen != nil) ? oldbg[3].green + ((i.colorGreen - oldbg[3].green) * fraction) : oldbg[3].green
|
||||
cb = (i.colorBlue != nil) ? oldbg[3].blue + ((i.colorBlue - oldbg[3].blue) * fraction) : oldbg[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + ((i.colorAlpha - oldbg[3].alpha) * fraction) : oldbg[3].alpha
|
||||
bgColor.color = Color.new(cr, cg, cb, ca)
|
||||
end
|
||||
when 4
|
||||
@@ -592,20 +590,20 @@ class PBAnimation < Array
|
||||
next if frame < i.frame || frame > i.frame + i.duration
|
||||
fraction = (frame - i.frame).to_f / i.duration
|
||||
if foGraphic.bitmap != nil
|
||||
foGraphic.ox = oldfo[0] - (i.bgX - oldfo[0]) * fraction if i.bgX != nil
|
||||
foGraphic.oy = oldfo[1] - (i.bgY - oldfo[1]) * fraction if i.bgY != nil
|
||||
foGraphic.opacity = oldfo[2] + (i.opacity - oldfo[2]) * fraction if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldfo[3].red + (i.colorRed - oldfo[3].red) * fraction : oldfo[3].red
|
||||
cg = (i.colorGreen != nil) ? oldfo[3].green + (i.colorGreen - oldfo[3].green) * fraction : oldfo[3].green
|
||||
cb = (i.colorBlue != nil) ? oldfo[3].blue + (i.colorBlue - oldfo[3].blue) * fraction : oldfo[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldfo[3].alpha + (i.colorAlpha - oldfo[3].alpha) * fraction : oldfo[3].alpha
|
||||
foGraphic.ox = oldfo[0] - ((i.bgX - oldfo[0]) * fraction) if i.bgX != nil
|
||||
foGraphic.oy = oldfo[1] - ((i.bgY - oldfo[1]) * fraction) if i.bgY != nil
|
||||
foGraphic.opacity = oldfo[2] + ((i.opacity - oldfo[2]) * fraction) if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldfo[3].red + ((i.colorRed - oldfo[3].red) * fraction) : oldfo[3].red
|
||||
cg = (i.colorGreen != nil) ? oldfo[3].green + ((i.colorGreen - oldfo[3].green) * fraction) : oldfo[3].green
|
||||
cb = (i.colorBlue != nil) ? oldfo[3].blue + ((i.colorBlue - oldfo[3].blue) * fraction) : oldfo[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldfo[3].alpha + ((i.colorAlpha - oldfo[3].alpha) * fraction) : oldfo[3].alpha
|
||||
foGraphic.color = Color.new(cr, cg, cb, ca)
|
||||
else
|
||||
foColor.opacity = oldfo[2] + (i.opacity - oldfo[2]) * fraction if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldfo[3].red + (i.colorRed - oldfo[3].red) * fraction : oldfo[3].red
|
||||
cg = (i.colorGreen != nil) ? oldfo[3].green + (i.colorGreen - oldfo[3].green) * fraction : oldfo[3].green
|
||||
cb = (i.colorBlue != nil) ? oldfo[3].blue + (i.colorBlue - oldfo[3].blue) * fraction : oldfo[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldfo[3].alpha + (i.colorAlpha - oldfo[3].alpha) * fraction : oldfo[3].alpha
|
||||
foColor.opacity = oldfo[2] + ((i.opacity - oldfo[2]) * fraction) if i.opacity != nil
|
||||
cr = (i.colorRed != nil) ? oldfo[3].red + ((i.colorRed - oldfo[3].red) * fraction) : oldfo[3].red
|
||||
cg = (i.colorGreen != nil) ? oldfo[3].green + ((i.colorGreen - oldfo[3].green) * fraction) : oldfo[3].green
|
||||
cb = (i.colorBlue != nil) ? oldfo[3].blue + ((i.colorBlue - oldfo[3].blue) * fraction) : oldfo[3].blue
|
||||
ca = (i.colorAlpha != nil) ? oldfo[3].alpha + ((i.colorAlpha - oldfo[3].alpha) * fraction) : oldfo[3].alpha
|
||||
foColor.color = Color.new(cr, cg, cb, ca)
|
||||
end
|
||||
end
|
||||
@@ -648,16 +646,16 @@ def pbSpriteSetAnimFrame(sprite, frame, user = nil, target = nil, inEditor = fal
|
||||
sprite.zoom_x = frame[AnimFrame::ZOOMX] / 100.0
|
||||
sprite.zoom_y = frame[AnimFrame::ZOOMY] / 100.0
|
||||
sprite.color.set(
|
||||
frame[AnimFrame::COLORRED],
|
||||
frame[AnimFrame::COLORGREEN],
|
||||
frame[AnimFrame::COLORBLUE],
|
||||
frame[AnimFrame::COLORALPHA]
|
||||
frame[AnimFrame::COLORRED],
|
||||
frame[AnimFrame::COLORGREEN],
|
||||
frame[AnimFrame::COLORBLUE],
|
||||
frame[AnimFrame::COLORALPHA]
|
||||
)
|
||||
sprite.tone.set(
|
||||
frame[AnimFrame::TONERED],
|
||||
frame[AnimFrame::TONEGREEN],
|
||||
frame[AnimFrame::TONEBLUE],
|
||||
frame[AnimFrame::TONEGRAY]
|
||||
frame[AnimFrame::TONERED],
|
||||
frame[AnimFrame::TONEGREEN],
|
||||
frame[AnimFrame::TONEBLUE],
|
||||
frame[AnimFrame::TONEGRAY]
|
||||
)
|
||||
sprite.ox = sprite.src_rect.width / 2
|
||||
sprite.oy = sprite.src_rect.height / 2
|
||||
|
||||
@@ -925,13 +925,11 @@ Battle::AbilityEffects::MoveImmunity.add(:FLASHFIRE,
|
||||
battle.pbDisplay(_INTL("The power of {1}'s Fire-type moves rose because of its {2}!",
|
||||
target.pbThis(true), target.abilityName))
|
||||
end
|
||||
elsif Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("It doesn't affect {1}...", target.pbThis(true)))
|
||||
else
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("It doesn't affect {1}...", target.pbThis(true)))
|
||||
else
|
||||
battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
target.pbThis, target.abilityName, move.name))
|
||||
end
|
||||
battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
target.pbThis, target.abilityName, move.name))
|
||||
end
|
||||
battle.pbHideAbilitySplash(target)
|
||||
end
|
||||
@@ -2604,8 +2602,8 @@ Battle::AbilityEffects::OnSwitchIn.add(:ANTICIPATION,
|
||||
next if Effectiveness.ineffective?(eff)
|
||||
next if !Effectiveness.super_effective?(eff) &&
|
||||
!["OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"].include?(m.function)
|
||||
else
|
||||
next if !["OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"].include?(m.function)
|
||||
elsif !["OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"].include?(m.function)
|
||||
next
|
||||
end
|
||||
found = true
|
||||
break
|
||||
@@ -2857,8 +2855,8 @@ Battle::AbilityEffects::OnSwitchIn.add(:INTIMIDATE,
|
||||
check_item = true
|
||||
if b.hasActiveAbility?(:CONTRARY)
|
||||
check_item = false if b.statStageAtMax?(:ATTACK)
|
||||
else
|
||||
check_item = false if b.statStageAtMin?(:ATTACK)
|
||||
elsif b.statStageAtMin?(:ATTACK)
|
||||
check_item = false
|
||||
end
|
||||
check_ability = b.pbLowerAttackStatStageIntimidate(battler)
|
||||
b.pbAbilitiesOnIntimidated if check_ability
|
||||
|
||||
@@ -922,7 +922,7 @@ Battle::ItemEffects::DamageCalcFromUser.copy(:METALCOAT, :IRONPLATE)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.add(:METRONOME,
|
||||
proc { |item, user, target, move, mults, baseDmg, type|
|
||||
met = 1 + 0.2 * [user.effects[PBEffects::Metronome], 5].min
|
||||
met = 1 + (0.2 * [user.effects[PBEffects::Metronome], 5].min)
|
||||
mults[:final_damage_multiplier] *= met
|
||||
}
|
||||
)
|
||||
@@ -1030,10 +1030,8 @@ Battle::ItemEffects::DamageCalcFromUser.add(:SOULDEW,
|
||||
next if !user.isSpecies?(:LATIAS) && !user.isSpecies?(:LATIOS)
|
||||
if Settings::SOUL_DEW_POWERS_UP_TYPES
|
||||
mults[:final_damage_multiplier] *= 1.2 if [:DRAGON, :PSYCHIC].include?(type)
|
||||
else
|
||||
if move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
elsif move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
@@ -113,7 +113,7 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
|
||||
traSprite = @sprites["player_1"]
|
||||
ballPos = Battle::Scene.pbBattlerPosition(@battler.index, batSprite.sideSize)
|
||||
ballStartX = traSprite.x
|
||||
ballStartY = traSprite.y - traSprite.bitmap.height / 2
|
||||
ballStartY = traSprite.y - (traSprite.bitmap.height / 2)
|
||||
ballMidX = 0 # Unused in arc calculation
|
||||
ballMidY = 122
|
||||
ballEndX = ballPos[0] - 40
|
||||
@@ -178,11 +178,11 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
|
||||
batSprite = @sprites["pokemon_#{@battler.index}"]
|
||||
traSprite = @sprites["player_1"]
|
||||
ballStartX = traSprite.x
|
||||
ballStartY = traSprite.y - traSprite.bitmap.height / 2
|
||||
ballStartY = traSprite.y - (traSprite.bitmap.height / 2)
|
||||
ballMidX = 0 # Unused in arc calculation
|
||||
ballMidY = 122
|
||||
ballEndX = batSprite.x
|
||||
ballEndY = batSprite.y - batSprite.bitmap.height / 2
|
||||
ballEndY = batSprite.y - (batSprite.bitmap.height / 2)
|
||||
# Set up trainer sprite
|
||||
trainer = addSprite(traSprite, PictureOrigin::Bottom)
|
||||
# Set up bait sprite
|
||||
@@ -242,13 +242,12 @@ class Battle::Scene
|
||||
end
|
||||
|
||||
def pbSafariCommandMenu(index)
|
||||
pbCommandMenuEx(index, [
|
||||
_INTL("What will\n{1} throw?", @battle.pbPlayer.name),
|
||||
_INTL("Ball"),
|
||||
_INTL("Bait"),
|
||||
_INTL("Rock"),
|
||||
_INTL("Run")
|
||||
], 3)
|
||||
pbCommandMenuEx(index,
|
||||
[_INTL("What will\n{1} throw?", @battle.pbPlayer.name),
|
||||
_INTL("Ball"),
|
||||
_INTL("Bait"),
|
||||
_INTL("Rock"),
|
||||
_INTL("Run")], 3)
|
||||
end
|
||||
|
||||
def pbThrowBait
|
||||
@@ -324,10 +323,8 @@ class SafariBattle
|
||||
@player = [player]
|
||||
@party2 = party2
|
||||
@sideSizes = [1, 1]
|
||||
@battlers = [
|
||||
Battle::FakeBattler.new(self, 0),
|
||||
Battle::FakeBattler.new(self, 1)
|
||||
]
|
||||
@battlers = [Battle::FakeBattler.new(self, 0),
|
||||
Battle::FakeBattler.new(self, 1)]
|
||||
@rules = {}
|
||||
@ballCount = 0
|
||||
end
|
||||
|
||||
@@ -45,13 +45,12 @@ class BugContestBattle < Battle
|
||||
end
|
||||
|
||||
def pbCommandMenu(idxBattler, _firstAction)
|
||||
return @scene.pbCommandMenuEx(idxBattler, [
|
||||
_INTL("Sport Balls: {1}", @ballCount),
|
||||
_INTL("Fight"),
|
||||
_INTL("Ball"),
|
||||
_INTL("Pokémon"),
|
||||
_INTL("Run")
|
||||
], 4)
|
||||
return @scene.pbCommandMenuEx(idxBattler,
|
||||
[_INTL("Sport Balls: {1}", @ballCount),
|
||||
_INTL("Fight"),
|
||||
_INTL("Ball"),
|
||||
_INTL("Pokémon"),
|
||||
_INTL("Run")], 4)
|
||||
end
|
||||
|
||||
def pbConsumeItemInBag(_item, _idxBattler)
|
||||
|
||||
@@ -241,15 +241,15 @@ class Battle::Scene
|
||||
window.contents.clear
|
||||
pbSetSystemFont(window.contents)
|
||||
textpos = [
|
||||
[battler1.name, 64, -6, 2, Color.new(248, 0, 0), Color.new(208, 208, 200)],
|
||||
[_INTL("VS"), 144, -6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[battler2.name, 224, -6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Mind"), 144, 42, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Skill"), 144, 74, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Body"), 144, 106, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[sprintf("%d", total1), 64, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Judgment"), 144, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[sprintf("%d", total2), 224, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)]
|
||||
[battler1.name, 64, -6, 2, Color.new(248, 0, 0), Color.new(208, 208, 200)],
|
||||
[_INTL("VS"), 144, -6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[battler2.name, 224, -6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Mind"), 144, 42, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Skill"), 144, 74, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Body"), 144, 106, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[sprintf("%d", total1), 64, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[_INTL("Judgment"), 144, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
|
||||
[sprintf("%d", total2), 224, 154, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)]
|
||||
]
|
||||
pbDrawTextPositions(window.contents, textpos)
|
||||
images = []
|
||||
|
||||
@@ -245,8 +245,8 @@ module RPG
|
||||
return
|
||||
end
|
||||
if @weatherTypes[weather_type][0].category == :Rain && index.odd? # Splash
|
||||
sprite.x = @ox - sprite.bitmap.width + rand(Graphics.width + sprite.bitmap.width * 2)
|
||||
sprite.y = @oy - sprite.bitmap.height + rand(Graphics.height + sprite.bitmap.height * 2)
|
||||
sprite.x = @ox - sprite.bitmap.width + rand(Graphics.width + (sprite.bitmap.width * 2))
|
||||
sprite.y = @oy - sprite.bitmap.height + rand(Graphics.height + (sprite.bitmap.height * 2))
|
||||
lifetimes[index] = (rand(30...50)) * 0.01 # 0.3-0.5 seconds
|
||||
else
|
||||
x_speed = @weatherTypes[weather_type][0].particle_delta_x
|
||||
@@ -255,14 +255,14 @@ module RPG
|
||||
if gradient.abs >= 1
|
||||
# Position sprite to the right of the screen
|
||||
sprite.x = @ox + Graphics.width + rand(Graphics.width)
|
||||
sprite.y = @oy + Graphics.height - rand(Graphics.height + sprite.bitmap.height - Graphics.width / gradient)
|
||||
distance_to_cover = sprite.x - @ox - Graphics.width / 2 + sprite.bitmap.width + rand(Graphics.width * 8 / 5)
|
||||
sprite.y = @oy + Graphics.height - rand(Graphics.height + sprite.bitmap.height - (Graphics.width / gradient))
|
||||
distance_to_cover = sprite.x - @ox - (Graphics.width / 2) + sprite.bitmap.width + rand(Graphics.width * 8 / 5)
|
||||
lifetimes[index] = (distance_to_cover.to_f / x_speed).abs
|
||||
else
|
||||
# Position sprite to the top of the screen
|
||||
sprite.x = @ox - sprite.bitmap.width + rand(Graphics.width + sprite.bitmap.width - gradient * Graphics.height)
|
||||
sprite.x = @ox - sprite.bitmap.width + rand(Graphics.width + sprite.bitmap.width - (gradient * Graphics.height))
|
||||
sprite.y = @oy - sprite.bitmap.height - rand(Graphics.height)
|
||||
distance_to_cover = @oy - sprite.y + Graphics.height / 2 + rand(Graphics.height * 8 / 5)
|
||||
distance_to_cover = @oy - sprite.y + (Graphics.height / 2) + rand(Graphics.height * 8 / 5)
|
||||
lifetimes[index] = (distance_to_cover.to_f / y_speed).abs
|
||||
end
|
||||
end
|
||||
@@ -333,8 +333,8 @@ module RPG
|
||||
|
||||
def update_tile_position(sprite, index)
|
||||
return if !sprite || !sprite.bitmap || !sprite.visible
|
||||
sprite.x = @tile_x.round + (index % @tiles_wide) * sprite.bitmap.width
|
||||
sprite.y = @tile_y.round + (index / @tiles_wide) * sprite.bitmap.height
|
||||
sprite.x = @tile_x.round + ((index % @tiles_wide) * sprite.bitmap.width)
|
||||
sprite.y = @tile_y.round + ((index / @tiles_wide) * sprite.bitmap.height)
|
||||
sprite.x += @tiles_wide * sprite.bitmap.width if sprite.x - @ox < -sprite.bitmap.width
|
||||
sprite.y -= @tiles_tall * sprite.bitmap.height if sprite.y - @oy > Graphics.height
|
||||
sprite.visible = true
|
||||
@@ -372,10 +372,10 @@ module RPG
|
||||
@fade_time < [FADE_NEW_TONE_END - @time_shift, 0].max
|
||||
weather_max = @target_max
|
||||
fract = (@fade_time - [FADE_NEW_TONE_START - @time_shift, 0].max) / (FADE_NEW_TONE_END - FADE_NEW_TONE_START)
|
||||
tone_red = @target_tone.red + (1 - fract) * (@old_tone.red - @target_tone.red)
|
||||
tone_green = @target_tone.green + (1 - fract) * (@old_tone.green - @target_tone.green)
|
||||
tone_blue = @target_tone.blue + (1 - fract) * (@old_tone.blue - @target_tone.blue)
|
||||
tone_gray = @target_tone.gray + (1 - fract) * (@old_tone.gray - @target_tone.gray)
|
||||
tone_red = @target_tone.red + ((1 - fract) * (@old_tone.red - @target_tone.red))
|
||||
tone_green = @target_tone.green + ((1 - fract) * (@old_tone.green - @target_tone.green))
|
||||
tone_blue = @target_tone.blue + ((1 - fract) * (@old_tone.blue - @target_tone.blue))
|
||||
tone_gray = @target_tone.gray + ((1 - fract) * (@old_tone.gray - @target_tone.gray))
|
||||
else
|
||||
tone_red = @viewport.tone.red
|
||||
tone_green = @viewport.tone.green
|
||||
|
||||
@@ -153,12 +153,12 @@ class LightEffect_Basic < LightEffect
|
||||
super
|
||||
if (Object.const_defined?(:ScreenPosHelper) rescue false)
|
||||
@light.x = ScreenPosHelper.pbScreenX(@event)
|
||||
@light.y = ScreenPosHelper.pbScreenY(@event) - Game_Map::TILE_HEIGHT / 2
|
||||
@light.y = ScreenPosHelper.pbScreenY(@event) - (Game_Map::TILE_HEIGHT / 2)
|
||||
@light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
|
||||
@light.zoom_y = @light.zoom_x
|
||||
else
|
||||
@light.x = @event.screen_x
|
||||
@light.y = @event.screen_y - Game_Map::TILE_HEIGHT / 2
|
||||
@light.y = @event.screen_y - (Game_Map::TILE_HEIGHT / 2)
|
||||
end
|
||||
@light.tone = $game_screen.tone
|
||||
end
|
||||
@@ -188,12 +188,12 @@ class LightEffect_DayNight < LightEffect
|
||||
if @light.opacity > 0
|
||||
if (Object.const_defined?(:ScreenPosHelper) rescue false)
|
||||
@light.x = ScreenPosHelper.pbScreenX(@event)
|
||||
@light.y = ScreenPosHelper.pbScreenY(@event) - Game_Map::TILE_HEIGHT / 2
|
||||
@light.y = ScreenPosHelper.pbScreenY(@event) - (Game_Map::TILE_HEIGHT / 2)
|
||||
@light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
|
||||
@light.zoom_y = ScreenPosHelper.pbScreenZoomY(@event)
|
||||
else
|
||||
@light.x = @event.screen_x
|
||||
@light.y = @event.screen_y - Game_Map::TILE_HEIGHT / 2
|
||||
@light.y = @event.screen_y - (Game_Map::TILE_HEIGHT / 2)
|
||||
end
|
||||
@light.tone.set($game_screen.tone.red,
|
||||
$game_screen.tone.green,
|
||||
|
||||
@@ -286,8 +286,8 @@ Events.onMapSceneChange += proc { |_sender, e|
|
||||
if $PokemonGlobal.mapTrail[1]
|
||||
for i in 0...Settings::NO_SIGNPOSTS.length / 2
|
||||
nosignpost = true if Settings::NO_SIGNPOSTS[2 * i] == $PokemonGlobal.mapTrail[1] &&
|
||||
Settings::NO_SIGNPOSTS[2 * i + 1] == $game_map.map_id
|
||||
nosignpost = true if Settings::NO_SIGNPOSTS[2 * i + 1] == $PokemonGlobal.mapTrail[1] &&
|
||||
Settings::NO_SIGNPOSTS[(2 * i) + 1] == $game_map.map_id
|
||||
nosignpost = true if Settings::NO_SIGNPOSTS[(2 * i) + 1] == $PokemonGlobal.mapTrail[1] &&
|
||||
Settings::NO_SIGNPOSTS[2 * i] == $game_map.map_id
|
||||
break if nosignpost
|
||||
end
|
||||
@@ -378,7 +378,7 @@ def pbEventCanReachPlayer?(event, player, distance)
|
||||
end
|
||||
if real_distance > 0
|
||||
real_distance.times do |i|
|
||||
return false if !event.can_move_from_coordinate?(event.x + i * delta_x, event.y + i * delta_y, event.direction)
|
||||
return false if !event.can_move_from_coordinate?(event.x + (i * delta_x), event.y + (i * delta_y), event.direction)
|
||||
end
|
||||
end
|
||||
return true
|
||||
|
||||
@@ -182,8 +182,8 @@ def pbGetEnvironment
|
||||
tile_environment = terrainTag.battle_environment
|
||||
if ret == :Forest && [:Grass, :TallGrass].include?(tile_environment)
|
||||
ret = :ForestGrass
|
||||
else
|
||||
ret = tile_environment if tile_environment
|
||||
elsif tile_environment
|
||||
ret = tile_environment
|
||||
end
|
||||
return ret
|
||||
end
|
||||
@@ -383,13 +383,14 @@ def pbTrainerBattleCore(*args)
|
||||
foeParty = []
|
||||
foePartyStarts = []
|
||||
for arg in args
|
||||
if arg.is_a?(NPCTrainer)
|
||||
case arg
|
||||
when NPCTrainer
|
||||
foeTrainers.push(arg)
|
||||
foePartyStarts.push(foeParty.length)
|
||||
arg.party.each { |pkmn| foeParty.push(pkmn) }
|
||||
foeEndSpeeches.push(arg.lose_text)
|
||||
foeItems.push(arg.items)
|
||||
elsif arg.is_a?(Array) # [trainer type, trainer name, ID, speech (optional)]
|
||||
when Array # [trainer type, trainer name, ID, speech (optional)]
|
||||
trainer = pbLoadTrainer(arg[0], arg[1], arg[2])
|
||||
pbMissingTrainer(arg[0], arg[1], arg[2]) if !trainer
|
||||
return 0 if !trainer
|
||||
@@ -530,8 +531,8 @@ def pbDoubleTrainerBattle(trainerID1, trainerName1, trainerPartyID1, endSpeech1,
|
||||
setBattleRule("double")
|
||||
# Perform the battle
|
||||
decision = pbTrainerBattleCore(
|
||||
[trainerID1, trainerName1, trainerPartyID1, endSpeech1],
|
||||
[trainerID2, trainerName2, trainerPartyID2, endSpeech2]
|
||||
[trainerID1, trainerName1, trainerPartyID1, endSpeech1],
|
||||
[trainerID2, trainerName2, trainerPartyID2, endSpeech2]
|
||||
)
|
||||
# Return true if the player won the battle, and false if any other result
|
||||
return (decision == 1)
|
||||
@@ -547,9 +548,9 @@ def pbTripleTrainerBattle(trainerID1, trainerName1, trainerPartyID1, endSpeech1,
|
||||
setBattleRule("triple")
|
||||
# Perform the battle
|
||||
decision = pbTrainerBattleCore(
|
||||
[trainerID1, trainerName1, trainerPartyID1, endSpeech1],
|
||||
[trainerID2, trainerName2, trainerPartyID2, endSpeech2],
|
||||
[trainerID3, trainerName3, trainerPartyID3, endSpeech3]
|
||||
[trainerID1, trainerName1, trainerPartyID1, endSpeech1],
|
||||
[trainerID2, trainerName2, trainerPartyID2, endSpeech2],
|
||||
[trainerID3, trainerName3, trainerPartyID3, endSpeech3]
|
||||
)
|
||||
# Return true if the player won the battle, and false if any other result
|
||||
return (decision == 1)
|
||||
@@ -644,38 +645,38 @@ def pbPickup(pkmn)
|
||||
return unless rand(100) < 10 # 10% chance
|
||||
# Common items to find (9 items from this list are added to the pool)
|
||||
pickupList = pbDynamicItemList(
|
||||
:POTION,
|
||||
:ANTIDOTE,
|
||||
:SUPERPOTION,
|
||||
:GREATBALL,
|
||||
:REPEL,
|
||||
:ESCAPEROPE,
|
||||
:FULLHEAL,
|
||||
:HYPERPOTION,
|
||||
:ULTRABALL,
|
||||
:REVIVE,
|
||||
:RARECANDY,
|
||||
:SUNSTONE,
|
||||
:MOONSTONE,
|
||||
:HEARTSCALE,
|
||||
:FULLRESTORE,
|
||||
:MAXREVIVE,
|
||||
:PPUP,
|
||||
:MAXELIXIR
|
||||
:POTION,
|
||||
:ANTIDOTE,
|
||||
:SUPERPOTION,
|
||||
:GREATBALL,
|
||||
:REPEL,
|
||||
:ESCAPEROPE,
|
||||
:FULLHEAL,
|
||||
:HYPERPOTION,
|
||||
:ULTRABALL,
|
||||
:REVIVE,
|
||||
:RARECANDY,
|
||||
:SUNSTONE,
|
||||
:MOONSTONE,
|
||||
:HEARTSCALE,
|
||||
:FULLRESTORE,
|
||||
:MAXREVIVE,
|
||||
:PPUP,
|
||||
:MAXELIXIR
|
||||
)
|
||||
# Rare items to find (2 items from this list are added to the pool)
|
||||
pickupListRare = pbDynamicItemList(
|
||||
:HYPERPOTION,
|
||||
:NUGGET,
|
||||
:KINGSROCK,
|
||||
:FULLRESTORE,
|
||||
:ETHER,
|
||||
:IRONBALL,
|
||||
:DESTINYKNOT,
|
||||
:ELIXIR,
|
||||
:DESTINYKNOT,
|
||||
:LEFTOVERS,
|
||||
:DESTINYKNOT
|
||||
:HYPERPOTION,
|
||||
:NUGGET,
|
||||
:KINGSROCK,
|
||||
:FULLRESTORE,
|
||||
:ETHER,
|
||||
:IRONBALL,
|
||||
:DESTINYKNOT,
|
||||
:ELIXIR,
|
||||
:DESTINYKNOT,
|
||||
:LEFTOVERS,
|
||||
:DESTINYKNOT
|
||||
)
|
||||
return if pickupList.length < 18
|
||||
return if pickupListRare.length < 11
|
||||
@@ -709,7 +710,7 @@ end
|
||||
def pbHoneyGather(pkmn)
|
||||
return if !GameData::Item.exists?(:HONEY)
|
||||
return if pkmn.egg? || !pkmn.hasAbility?(:HONEYGATHER) || pkmn.hasItem?
|
||||
chance = 5 + ((pkmn.level - 1) / 10) * 5
|
||||
chance = 5 + (((pkmn.level - 1) / 10) * 5)
|
||||
return unless rand(100) < chance
|
||||
pkmn.item = :HONEY
|
||||
end
|
||||
|
||||
@@ -155,7 +155,7 @@ def pbBattleAnimation(bgm = nil, battletype = 0, foe = nil)
|
||||
Input.update
|
||||
pbUpdateSceneMap
|
||||
timer += Graphics.delta_s
|
||||
viewport.color.alpha = 255 * (1 - timer / 0.4)
|
||||
viewport.color.alpha = 255 * (1 - (timer / 0.4))
|
||||
break if viewport.color.alpha <= 0
|
||||
end
|
||||
viewport.dispose
|
||||
@@ -267,9 +267,9 @@ SpecialBattleIntroAnimations.register("vs_animation", 50, # Priority 50
|
||||
flash.opacity -= 52 * 20 / Graphics.frame_rate if flash.opacity > 0
|
||||
bar1.ox -= 32 * 20 / Graphics.frame_rate
|
||||
bar2.ox += 32 * 20 / Graphics.frame_rate
|
||||
if i >= animTime / 2 && i < slideInTime + animTime / 2
|
||||
player.x = xoffset * (i + 1 - slideInTime - animTime / 2) / slideInTime
|
||||
trainer.x = xoffset * (slideInTime - i - 1 + animTime / 2) / slideInTime
|
||||
if i >= animTime / 2 && i < slideInTime + (animTime / 2)
|
||||
player.x = xoffset * (i + 1 - slideInTime - (animTime / 2)) / slideInTime
|
||||
trainer.x = xoffset * (slideInTime - i - 1 + (animTime / 2)) / slideInTime
|
||||
end
|
||||
pbWait(1)
|
||||
end
|
||||
@@ -283,10 +283,10 @@ SpecialBattleIntroAnimations.register("vs_animation", 50, # Priority 50
|
||||
trainer.tone = Tone.new(0, 0, 0)
|
||||
trainername = foe[0].name
|
||||
textpos = [
|
||||
[$player.name, Graphics.width / 4, (Graphics.height / 1.5) + 4, 2,
|
||||
Color.new(248, 248, 248), Color.new(72, 72, 72)],
|
||||
[trainername, (Graphics.width / 4) + (Graphics.width / 2), (Graphics.height / 1.5) + 4, 2,
|
||||
Color.new(248, 248, 248), Color.new(72, 72, 72)]
|
||||
[$player.name, Graphics.width / 4, (Graphics.height / 1.5) + 4, 2,
|
||||
Color.new(248, 248, 248), Color.new(72, 72, 72)],
|
||||
[trainername, (Graphics.width / 4) + (Graphics.width / 2), (Graphics.height / 1.5) + 4, 2,
|
||||
Color.new(248, 248, 248), Color.new(72, 72, 72)]
|
||||
]
|
||||
pbDrawTextPositions(overlay.bitmap, textpos)
|
||||
# Fade out flash, shudder Vs logo and expand it, and then fade to black
|
||||
|
||||
@@ -114,7 +114,7 @@ class PokemonEncounters
|
||||
return true if pbPokeRadarOnShakingGrass
|
||||
# Get base encounter chance and minimum steps grace period
|
||||
encounter_chance = @step_chances[enc_type].to_f
|
||||
min_steps_needed = (8 - encounter_chance / 10).clamp(0, 8).to_f
|
||||
min_steps_needed = (8 - (encounter_chance / 10)).clamp(0, 8).to_f
|
||||
# Apply modifiers to the encounter chance and the minimum steps amount
|
||||
if triggered_by_step
|
||||
encounter_chance += @chance_accumulator / 200
|
||||
@@ -168,7 +168,7 @@ class PokemonEncounters
|
||||
# after a previous wild encounter
|
||||
if triggered_by_step && @step_count < min_steps_needed
|
||||
@step_count += 1
|
||||
return false if rand(100) >= encounter_chance * 5 / (@step_chances[enc_type] + @chance_accumulator / 200)
|
||||
return false if rand(100) >= encounter_chance * 5 / (@step_chances[enc_type] + (@chance_accumulator / 200))
|
||||
end
|
||||
# Decide whether the wild encounter should actually happen
|
||||
return true if rand(100) < encounter_chance
|
||||
@@ -429,7 +429,7 @@ def pbGenerateWildPokemon(species, level, isRoamer = false)
|
||||
shiny_retries.times do
|
||||
break if genwildpoke.shiny?
|
||||
genwildpoke.shiny = nil # Make it recalculate shininess
|
||||
genwildpoke.personalID = rand(2**16) | rand(2**16) << 16
|
||||
genwildpoke.personalID = rand(2**16) | (rand(2**16) << 16)
|
||||
end
|
||||
end
|
||||
# Give Pokérus
|
||||
|
||||
@@ -138,19 +138,19 @@ end
|
||||
def moonphase(time = nil) # in UTC
|
||||
time = pbGetTimeNow if !time
|
||||
transitions = [
|
||||
1.8456618033125,
|
||||
5.5369854099375,
|
||||
9.2283090165625,
|
||||
12.9196326231875,
|
||||
16.6109562298125,
|
||||
20.3022798364375,
|
||||
23.9936034430625,
|
||||
27.6849270496875
|
||||
1.8456618033125,
|
||||
5.5369854099375,
|
||||
9.2283090165625,
|
||||
12.9196326231875,
|
||||
16.6109562298125,
|
||||
20.3022798364375,
|
||||
23.9936034430625,
|
||||
27.6849270496875
|
||||
]
|
||||
yy = time.year - ((12 - time.mon) / 10.0).floor
|
||||
j = (365.25 * (4712 + yy)).floor + (((time.mon + 9) % 12) * 30.6 + 0.5).floor + time.day + 59
|
||||
j = (365.25 * (4712 + yy)).floor + ((((time.mon + 9) % 12) * 30.6) + 0.5).floor + time.day + 59
|
||||
j -= (((yy / 100.0) + 49).floor * 0.75).floor - 38 if j > 2299160
|
||||
j += (((time.hour * 60) + time.min * 60) + time.sec) / 86400.0
|
||||
j += (((time.hour * 60) + (time.min * 60)) + time.sec) / 86400.0
|
||||
v = (j - 2451550.1) / 29.530588853
|
||||
v = ((v - v.floor) + (v < 0 ? 1 : 0))
|
||||
ag = v * 29.53
|
||||
@@ -164,22 +164,22 @@ end
|
||||
# 0 is Aries, 11 is Pisces. Month is 1 if January, and so on.
|
||||
def zodiac(month, day)
|
||||
time = [
|
||||
3, 21, 4, 19, # Aries
|
||||
4, 20, 5, 20, # Taurus
|
||||
5, 21, 6, 20, # Gemini
|
||||
6, 21, 7, 20, # Cancer
|
||||
7, 23, 8, 22, # Leo
|
||||
8, 23, 9, 22, # Virgo
|
||||
9, 23, 10, 22, # Libra
|
||||
10, 23, 11, 21, # Scorpio
|
||||
11, 22, 12, 21, # Sagittarius
|
||||
12, 22, 1, 19, # Capricorn
|
||||
1, 20, 2, 18, # Aquarius
|
||||
2, 19, 3, 20 # Pisces
|
||||
3, 21, 4, 19, # Aries
|
||||
4, 20, 5, 20, # Taurus
|
||||
5, 21, 6, 20, # Gemini
|
||||
6, 21, 7, 20, # Cancer
|
||||
7, 23, 8, 22, # Leo
|
||||
8, 23, 9, 22, # Virgo
|
||||
9, 23, 10, 22, # Libra
|
||||
10, 23, 11, 21, # Scorpio
|
||||
11, 22, 12, 21, # Sagittarius
|
||||
12, 22, 1, 19, # Capricorn
|
||||
1, 20, 2, 18, # Aquarius
|
||||
2, 19, 3, 20 # Pisces
|
||||
]
|
||||
for i in 0...12
|
||||
return i if month == time[i * 4] && day >= time[i * 4 + 1]
|
||||
return i if month == time[i * 4 + 2] && day <= time[i * 4 + 3]
|
||||
return i if month == time[i * 4] && day >= time[(i * 4) + 1]
|
||||
return i if month == time[(i * 4) + 2] && day <= time[(i * 4) + 3]
|
||||
end
|
||||
return 0
|
||||
end
|
||||
@@ -212,13 +212,13 @@ def pbIsWeekday(wdayVariable, *arg)
|
||||
end
|
||||
if wdayVariable > 0
|
||||
$game_variables[wdayVariable] = [
|
||||
_INTL("Sunday"),
|
||||
_INTL("Monday"),
|
||||
_INTL("Tuesday"),
|
||||
_INTL("Wednesday"),
|
||||
_INTL("Thursday"),
|
||||
_INTL("Friday"),
|
||||
_INTL("Saturday")
|
||||
_INTL("Sunday"),
|
||||
_INTL("Monday"),
|
||||
_INTL("Tuesday"),
|
||||
_INTL("Wednesday"),
|
||||
_INTL("Thursday"),
|
||||
_INTL("Friday"),
|
||||
_INTL("Saturday")
|
||||
][wday]
|
||||
$game_map.need_refresh = true if $game_map
|
||||
end
|
||||
@@ -258,8 +258,7 @@ def pbGetMonthName(month)
|
||||
end
|
||||
|
||||
def pbGetAbbrevMonthName(month)
|
||||
return ["",
|
||||
_INTL("Jan."),
|
||||
return [_INTL("Jan."),
|
||||
_INTL("Feb."),
|
||||
_INTL("Mar."),
|
||||
_INTL("Apr."),
|
||||
@@ -270,7 +269,7 @@ def pbGetAbbrevMonthName(month)
|
||||
_INTL("Sep."),
|
||||
_INTL("Oct."),
|
||||
_INTL("Nov."),
|
||||
_INTL("Dec.")][month]
|
||||
_INTL("Dec.")][month - 1]
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
@@ -287,12 +286,10 @@ def pbIsSeason(seasonVariable, *arg)
|
||||
ret = true if wd == thisseason
|
||||
end
|
||||
if seasonVariable > 0
|
||||
$game_variables[seasonVariable] = [
|
||||
_INTL("Spring"),
|
||||
_INTL("Summer"),
|
||||
_INTL("Autumn"),
|
||||
_INTL("Winter")
|
||||
][thisseason]
|
||||
$game_variables[seasonVariable] = [_INTL("Spring"),
|
||||
_INTL("Summer"),
|
||||
_INTL("Autumn"),
|
||||
_INTL("Winter")][thisseason]
|
||||
$game_map.need_refresh = true if $game_map
|
||||
end
|
||||
return ret
|
||||
|
||||
@@ -89,9 +89,9 @@ def pbHiddenMoveAnimation(pokemon)
|
||||
end
|
||||
strobebitmap.dispose
|
||||
interp = RectInterpolator.new(
|
||||
Rect.new(0, Graphics.height / 2, Graphics.width, 0),
|
||||
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
|
||||
Graphics.frame_rate / 4
|
||||
Rect.new(0, Graphics.height / 2, Graphics.width, 0),
|
||||
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
|
||||
Graphics.frame_rate / 4
|
||||
)
|
||||
ptinterp = nil
|
||||
phase = 1
|
||||
@@ -109,9 +109,9 @@ def pbHiddenMoveAnimation(pokemon)
|
||||
if interp.done?
|
||||
phase = 2
|
||||
ptinterp = PointInterpolator.new(
|
||||
Graphics.width + (sprite.bitmap.width / 2), bg.bitmap.height / 2,
|
||||
Graphics.width / 2, bg.bitmap.height / 2,
|
||||
Graphics.frame_rate * 4 / 10
|
||||
Graphics.width + (sprite.bitmap.width / 2), bg.bitmap.height / 2,
|
||||
Graphics.width / 2, bg.bitmap.height / 2,
|
||||
Graphics.frame_rate * 4 / 10
|
||||
)
|
||||
end
|
||||
when 2 # Slide Pokémon sprite in from right to centre
|
||||
@@ -129,9 +129,9 @@ def pbHiddenMoveAnimation(pokemon)
|
||||
if frames > Graphics.frame_rate * 3 / 4
|
||||
phase = 4
|
||||
ptinterp = PointInterpolator.new(
|
||||
Graphics.width / 2, bg.bitmap.height / 2,
|
||||
-(sprite.bitmap.width / 2), bg.bitmap.height / 2,
|
||||
Graphics.frame_rate * 4 / 10
|
||||
Graphics.width / 2, bg.bitmap.height / 2,
|
||||
-(sprite.bitmap.width / 2), bg.bitmap.height / 2,
|
||||
Graphics.frame_rate * 4 / 10
|
||||
)
|
||||
frames = 0
|
||||
end
|
||||
@@ -143,9 +143,9 @@ def pbHiddenMoveAnimation(pokemon)
|
||||
phase = 5
|
||||
sprite.visible = false
|
||||
interp = RectInterpolator.new(
|
||||
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
|
||||
Rect.new(0, Graphics.height / 2, Graphics.width, 0),
|
||||
Graphics.frame_rate / 4
|
||||
Rect.new(0, (Graphics.height - bg.bitmap.height) / 2, Graphics.width, bg.bitmap.height),
|
||||
Rect.new(0, Graphics.height / 2, Graphics.width, 0),
|
||||
Graphics.frame_rate / 4
|
||||
)
|
||||
end
|
||||
when 5 # Shrink viewport height from full to zero
|
||||
@@ -159,15 +159,15 @@ def pbHiddenMoveAnimation(pokemon)
|
||||
strobe.ox = strobe.viewport.rect.x
|
||||
strobe.oy = strobe.viewport.rect.y
|
||||
if !strobe.visible # Initial placement of strobes
|
||||
randomY = 16 * (1 + rand(bg.bitmap.height / 16 - 2))
|
||||
strobe.y = randomY + (Graphics.height - bg.bitmap.height) / 2
|
||||
randomY = 16 * (1 + rand((bg.bitmap.height / 16) - 2))
|
||||
strobe.y = randomY + ((Graphics.height - bg.bitmap.height) / 2)
|
||||
strobe.x = rand(Graphics.width)
|
||||
strobe.visible = true
|
||||
elsif strobe.x < Graphics.width # Move strobe right
|
||||
strobe.x += strobeSpeed
|
||||
else # Strobe is off the screen, reposition it to the left of the screen
|
||||
randomY = 16 * (1 + rand(bg.bitmap.height / 16 - 2))
|
||||
strobe.y = randomY + (Graphics.height - bg.bitmap.height) / 2
|
||||
randomY = 16 * (1 + rand((bg.bitmap.height / 16) - 2))
|
||||
strobe.y = randomY + ((Graphics.height - bg.bitmap.height) / 2)
|
||||
strobe.x = -strobe.bitmap.width - rand(Graphics.width / 4)
|
||||
end
|
||||
end
|
||||
@@ -236,15 +236,13 @@ def pbSmashEvent(event)
|
||||
elsif event.name[/smashrock/i]
|
||||
pbSEPlay("Rock Smash", 80)
|
||||
end
|
||||
pbMoveRoute(event, [
|
||||
PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnLeft,
|
||||
PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnRight,
|
||||
PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnUp,
|
||||
PBMoveRoute::Wait, 2
|
||||
])
|
||||
pbMoveRoute(event, [PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnLeft,
|
||||
PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnRight,
|
||||
PBMoveRoute::Wait, 2,
|
||||
PBMoveRoute::TurnUp,
|
||||
PBMoveRoute::Wait, 2])
|
||||
pbWait(Graphics.frame_rate * 4 / 10)
|
||||
event.erase
|
||||
$PokemonMap.addErasedEvent(event.id) if $PokemonMap
|
||||
@@ -397,8 +395,8 @@ Events.onAction += proc { |_sender, _e|
|
||||
$map_factory.getTerrainTag(surface_map_id, $game_player.x, $game_player.y).can_dive
|
||||
pbSurfacing
|
||||
end
|
||||
else
|
||||
pbDive if $game_player.terrain_tag.can_dive
|
||||
elsif $game_player.terrain_tag.can_dive
|
||||
pbDive
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
@@ -84,15 +84,12 @@ class BerryPlantData
|
||||
data = GameData::BerryPlant.get(@berry_id)
|
||||
if @new_mechanics
|
||||
return [data.maximum_yield * (5 - @yield_penalty) / 5, data.minimum_yield].max
|
||||
else
|
||||
if @watering_count > 0
|
||||
ret = (data.maximum_yield - data.minimum_yield) * (@watering_count - 1)
|
||||
ret += rand(1 + data.maximum_yield - data.minimum_yield)
|
||||
return (ret / 4) + data.minimum_yield
|
||||
else
|
||||
return data.minimum_yield
|
||||
end
|
||||
elsif @watering_count > 0
|
||||
ret = (data.maximum_yield - data.minimum_yield) * (@watering_count - 1)
|
||||
ret += rand(1 + data.maximum_yield - data.minimum_yield)
|
||||
return (ret / 4) + data.minimum_yield
|
||||
end
|
||||
return data.minimum_yield
|
||||
end
|
||||
|
||||
# Old mechanics only update a plant when its map is loaded. New mechanics
|
||||
@@ -138,7 +135,7 @@ class BerryPlantData
|
||||
# Update how long plant has been alive for
|
||||
old_growth_stage = @growth_stage
|
||||
@time_alive = new_time_alive
|
||||
@growth_stage = 1 + @time_alive / time_per_stage
|
||||
@growth_stage = 1 + (@time_alive / time_per_stage)
|
||||
@growth_stage += 1 if replanted? # Replants start at stage 2
|
||||
@time_last_updated = time_now.to_i
|
||||
# Record watering (old mechanics), and apply drying out per hour (new mechanics)
|
||||
|
||||
@@ -244,7 +244,7 @@ class DayCare
|
||||
shiny_retries.times do
|
||||
break if egg.shiny?
|
||||
egg.shiny = nil # Make it recalculate shininess
|
||||
egg.personalID = rand(2**16) | rand(2**16) << 16
|
||||
egg.personalID = rand(2**16) | (rand(2**16) << 16)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ module RandomDungeonGenerator
|
||||
def paint_corridor(tile, x, y, width, height)
|
||||
for j in 0...height
|
||||
for i in 0...width
|
||||
tile[(y + j) * CELL_WIDTH + (x + i)] = DungeonTile::CORRIDOR
|
||||
tile[((y + j) * CELL_WIDTH) + (x + i)] = DungeonTile::CORRIDOR
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -129,25 +129,25 @@ module RandomDungeonGenerator
|
||||
when TURN_NONE
|
||||
for y in 0...CELL_HEIGHT
|
||||
for x in 0...CELL_WIDTH
|
||||
dungeon[x + dstX, y + dstY] = tile_layout[y * CELL_WIDTH + x]
|
||||
dungeon[x + dstX, y + dstY] = tile_layout[(y * CELL_WIDTH) + x]
|
||||
end
|
||||
end
|
||||
when TURN_LEFT
|
||||
for y in 0...CELL_HEIGHT
|
||||
for x in 0...CELL_WIDTH
|
||||
dungeon[y + dstX, CELL_WIDTH - 1 - x + dstY] = tile_layout[y * CELL_WIDTH + x]
|
||||
dungeon[y + dstX, CELL_WIDTH - 1 - x + dstY] = tile_layout[(y * CELL_WIDTH) + x]
|
||||
end
|
||||
end
|
||||
when TURN_RIGHT
|
||||
for y in 0...CELL_HEIGHT
|
||||
for x in 0...CELL_WIDTH
|
||||
dungeon[CELL_HEIGHT - 1 - y + dstX, x + dstY] = tile_layout[y * CELL_WIDTH + x]
|
||||
dungeon[CELL_HEIGHT - 1 - y + dstX, x + dstY] = tile_layout[(y * CELL_WIDTH) + x]
|
||||
end
|
||||
end
|
||||
when TURN_BACK
|
||||
for y in 0...CELL_HEIGHT
|
||||
for x in 0...CELL_WIDTH
|
||||
dungeon[CELL_WIDTH - 1 - x + dstX, CELL_HEIGHT - 1 - y + dstY] = tile_layout[y * CELL_WIDTH + x]
|
||||
dungeon[CELL_WIDTH - 1 - x + dstX, CELL_HEIGHT - 1 - y + dstY] = tile_layout[(y * CELL_WIDTH) + x]
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -164,8 +164,8 @@ module RandomDungeonGenerator
|
||||
width = rand(ROOM_MIN_WIDTH..ROOM_MAX_WIDTH)
|
||||
height = rand(ROOM_MIN_HEIGHT..ROOM_MAX_HEIGHT)
|
||||
return false if width <= 0 || height <= 0
|
||||
centerX = CELL_WIDTH / 2 + rand(5) - 2
|
||||
centerY = CELL_HEIGHT / 2 + rand(5) - 2
|
||||
centerX = (CELL_WIDTH / 2) + rand(5) - 2
|
||||
centerY = (CELL_HEIGHT / 2) + rand(5) - 2
|
||||
x = centerX - (width / 2)
|
||||
y = centerY - (height / 2)
|
||||
rect = [x, y, width, height]
|
||||
@@ -244,17 +244,17 @@ module RandomDungeonGenerator
|
||||
|
||||
def getVisited(x, y)
|
||||
return false if x < 0 || y < 0 || x >= cellWidth || x >= cellHeight
|
||||
return (@cells[y * cellWidth + x] & EdgeMasks::VISITED) != 0
|
||||
return (@cells[(y * cellWidth) + x] & EdgeMasks::VISITED) != 0
|
||||
end
|
||||
|
||||
def setVisited(x, y)
|
||||
return if x < 0 || y < 0 || x >= cellWidth || x >= cellHeight
|
||||
@cells[y * cellWidth + x] |= EdgeMasks::VISITED
|
||||
@cells[(y * cellWidth) + x] |= EdgeMasks::VISITED
|
||||
end
|
||||
|
||||
def clearVisited(x, y)
|
||||
return if x < 0 || y < 0 || x >= cellWidth || x >= cellHeight
|
||||
@cells[y * cellWidth + x] &= ~EdgeMasks::VISITED
|
||||
@cells[(y * cellWidth) + x] &= ~EdgeMasks::VISITED
|
||||
end
|
||||
|
||||
def clearAllCells
|
||||
@@ -265,12 +265,12 @@ module RandomDungeonGenerator
|
||||
|
||||
def getEdgeNode(x, y, edge)
|
||||
return false if x < 0 || y < 0 || x >= nodeWidth || y >= nodeHeight
|
||||
return @nodes[y * nodeWidth + x].getEdge(edge)
|
||||
return @nodes[(y * nodeWidth) + x].getEdge(edge)
|
||||
end
|
||||
|
||||
def setEdgeNode(x, y, edge)
|
||||
return if x < 0 || x >= nodeWidth || y < 0 || y >= nodeHeight
|
||||
@nodes[y * nodeWidth + x].setEdge(edge)
|
||||
@nodes[(y * nodeWidth) + x].setEdge(edge)
|
||||
e = 0
|
||||
nx = x
|
||||
ny = y
|
||||
@@ -291,7 +291,7 @@ module RandomDungeonGenerator
|
||||
return
|
||||
end
|
||||
return if nx < 0 || ny < 0 || nx >= nodeWidth || ny >= nodeHeight
|
||||
@nodes[ny * nodeWidth + nx].setEdge(e)
|
||||
@nodes[(ny * nodeWidth) + nx].setEdge(e)
|
||||
end
|
||||
|
||||
def setAllEdges
|
||||
@@ -302,7 +302,7 @@ module RandomDungeonGenerator
|
||||
|
||||
def clearEdgeNode(x, y, edge)
|
||||
return if x < 0 || x >= nodeWidth || y < 0 || y >= nodeHeight
|
||||
@nodes[y * nodeWidth + x].clearEdge(edge)
|
||||
@nodes[(y * nodeWidth) + x].clearEdge(edge)
|
||||
e = 0
|
||||
nx = x
|
||||
ny = y
|
||||
@@ -323,7 +323,7 @@ module RandomDungeonGenerator
|
||||
raise ArgumentError.new
|
||||
end
|
||||
return if nx < 0 || ny < 0 || nx >= nodeWidth || ny >= nodeHeight
|
||||
@nodes[ny * nodeWidth + nx].clearEdge(e)
|
||||
@nodes[(ny * nodeWidth) + nx].clearEdge(e)
|
||||
end
|
||||
|
||||
def clearAllEdges
|
||||
@@ -334,7 +334,7 @@ module RandomDungeonGenerator
|
||||
|
||||
def isBlockedNode?(x, y)
|
||||
return false if x < 0 || y < 0 || x >= nodeWidth || y >= nodeHeight
|
||||
return @nodes[y * nodeWidth + x].isBlocked?
|
||||
return @nodes[(y * nodeWidth) + x].isBlocked?
|
||||
end
|
||||
|
||||
def getEdgePattern(x, y)
|
||||
@@ -483,22 +483,22 @@ module RandomDungeonGenerator
|
||||
end
|
||||
|
||||
def [](x, y)
|
||||
return @array[y * @width + x]
|
||||
return @array[(y * @width) + x]
|
||||
end
|
||||
|
||||
def []=(x, y, value)
|
||||
@array[y * @width + x] = value
|
||||
@array[(y * @width) + x] = value
|
||||
end
|
||||
|
||||
def value(x, y)
|
||||
return DungeonTile::VOID if x < 0 || y < 0 || x >= @width || y >= @height
|
||||
return @array[y * @width + x]
|
||||
return @array[(y * @width) + x]
|
||||
end
|
||||
|
||||
# Unused
|
||||
def get(x, y)
|
||||
return false if x < 0 || y < 0 || x >= @width || y >= @height
|
||||
return @array[y * @width + x] != DungeonTile::VOID
|
||||
return @array[(y * @width) + x] != DungeonTile::VOID
|
||||
end
|
||||
|
||||
# Unused
|
||||
@@ -553,8 +553,8 @@ module RandomDungeonGenerator
|
||||
|
||||
def generate
|
||||
self.clear
|
||||
maxWidth = @width - BUFFER_X * 2
|
||||
maxHeight = @height - BUFFER_Y * 2
|
||||
maxWidth = @width - (BUFFER_X * 2)
|
||||
maxHeight = @height - (BUFFER_Y * 2)
|
||||
cellWidth = DungeonMaze::CELL_WIDTH
|
||||
cellHeight = DungeonMaze::CELL_HEIGHT
|
||||
return if maxWidth < 0 || maxHeight < 0
|
||||
@@ -576,7 +576,7 @@ module RandomDungeonGenerator
|
||||
for x in 0...maxWidth / cellWidth
|
||||
pattern = maze.getEdgePattern(x, y)
|
||||
next if !DungeonMaze.paint_cell_contents(
|
||||
self, BUFFER_X + x * cellWidth, BUFFER_Y + y * cellHeight,
|
||||
self, BUFFER_X + (x * cellWidth), BUFFER_Y + (y * cellHeight),
|
||||
corridor_patterns[pattern], DungeonMaze::TURN_NONE
|
||||
)
|
||||
roomcount += 1
|
||||
@@ -605,7 +605,7 @@ module RandomDungeonGenerator
|
||||
for j in 0...map.height
|
||||
nb = TileDrawingHelper.tableNeighbors(tbl, i, j)
|
||||
tile = TileDrawingHelper::NEIGHBORS_TO_AUTOTILE_INDEX[nb]
|
||||
map.data[i, j, 0] = tile + 48 * (tbl[i, j])
|
||||
map.data[i, j, 0] = tile + (48 * (tbl[i, j]))
|
||||
map.data[i, j, 1] = 0
|
||||
map.data[i, j, 2] = 0
|
||||
end
|
||||
@@ -638,8 +638,8 @@ module RandomDungeonGenerator
|
||||
# @param x_cells [Integer] the number of cells wide the dungeon will be
|
||||
# @param y_cells [Intenger] the number of cells tall the dungeon will be
|
||||
def self.generate_test_dungeon(x_cells = 4, y_cells = 4)
|
||||
dungeon = Dungeon.new(Dungeon::BUFFER_X * 2 + DungeonMaze::CELL_WIDTH * x_cells,
|
||||
Dungeon::BUFFER_Y * 2 + DungeonMaze::CELL_HEIGHT * y_cells)
|
||||
dungeon = Dungeon.new((Dungeon::BUFFER_X * 2) + (DungeonMaze::CELL_WIDTH * x_cells),
|
||||
(Dungeon::BUFFER_Y * 2) + (DungeonMaze::CELL_HEIGHT * y_cells))
|
||||
dungeon.generate
|
||||
echoln dungeon.write
|
||||
end
|
||||
|
||||
@@ -319,7 +319,7 @@ def pbGainExpFromExpCandy(pkmn, base_amt, qty, scene)
|
||||
if qty > 1
|
||||
(qty - 1).times { pkmn.changeHappiness("vitamin") }
|
||||
end
|
||||
pbChangeExp(pkmn, pkmn.exp + base_amt * qty, scene)
|
||||
pbChangeExp(pkmn, pkmn.exp + (base_amt * qty), scene)
|
||||
scene.pbHardRefresh
|
||||
return true
|
||||
end
|
||||
@@ -351,10 +351,8 @@ def pbBattleHPItem(pkmn, battler, restoreHP, scene)
|
||||
if battler.pbRecoverHP(restoreHP) > 0
|
||||
scene.pbDisplay(_INTL("{1}'s HP was restored.", battler.pbThis))
|
||||
end
|
||||
else
|
||||
if pbItemRestoreHP(pkmn, restoreHP) > 0
|
||||
scene.pbDisplay(_INTL("{1}'s HP was restored.", pkmn.name))
|
||||
end
|
||||
elsif pbItemRestoreHP(pkmn, restoreHP) > 0
|
||||
scene.pbDisplay(_INTL("{1}'s HP was restored.", pkmn.name))
|
||||
end
|
||||
return true
|
||||
end
|
||||
@@ -814,35 +812,27 @@ def pbGiveItemToPokemon(item, pkmn, scene, pkmnid = 0)
|
||||
if scene.pbConfirm(_INTL("Would you like to switch the two items?"))
|
||||
$bag.remove(item)
|
||||
if !$bag.add(pkmn.item)
|
||||
if !$bag.add(item)
|
||||
raise _INTL("Could't re-store deleted item in Bag somehow")
|
||||
end
|
||||
raise _INTL("Couldn't re-store deleted item in Bag somehow") if !$bag.add(item)
|
||||
scene.pbDisplay(_INTL("The Bag is full. The Pokémon's item could not be removed."))
|
||||
else
|
||||
if GameData::Item.get(item).is_mail?
|
||||
if pbWriteMail(item, pkmn, pkmnid, scene)
|
||||
pkmn.item = item
|
||||
scene.pbDisplay(_INTL("Took the {1} from {2} and gave it the {3}.", olditemname, pkmn.name, newitemname))
|
||||
return true
|
||||
else
|
||||
if !$bag.add(item)
|
||||
raise _INTL("Couldn't re-store deleted item in Bag somehow")
|
||||
end
|
||||
end
|
||||
else
|
||||
elsif GameData::Item.get(item).is_mail?
|
||||
if pbWriteMail(item, pkmn, pkmnid, scene)
|
||||
pkmn.item = item
|
||||
scene.pbDisplay(_INTL("Took the {1} from {2} and gave it the {3}.", olditemname, pkmn.name, newitemname))
|
||||
return true
|
||||
elsif !$bag.add(item)
|
||||
raise _INTL("Couldn't re-store deleted item in Bag somehow")
|
||||
end
|
||||
else
|
||||
pkmn.item = item
|
||||
scene.pbDisplay(_INTL("Took the {1} from {2} and gave it the {3}.", olditemname, pkmn.name, newitemname))
|
||||
return true
|
||||
end
|
||||
end
|
||||
else
|
||||
if !GameData::Item.get(item).is_mail? || pbWriteMail(item, pkmn, pkmnid, scene)
|
||||
$bag.remove(item)
|
||||
pkmn.item = item
|
||||
scene.pbDisplay(_INTL("{1} is now holding the {2}.", pkmn.name, newitemname))
|
||||
return true
|
||||
end
|
||||
elsif !GameData::Item.get(item).is_mail? || pbWriteMail(item, pkmn, pkmnid, scene)
|
||||
$bag.remove(item)
|
||||
pkmn.item = item
|
||||
scene.pbDisplay(_INTL("{1} is now holding the {2}.", pkmn.name, newitemname))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -943,11 +943,13 @@ ItemHandlers::UseOnPokemonMaximum.add(:POMEGBERRY, proc { |item, pkmn|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:POMEGBERRY, proc { |item, qty, pkmn, scene|
|
||||
next pbRaiseHappinessAndLowerEV(pkmn, scene, :HP, qty, [
|
||||
_INTL("{1} adores you! Its base HP fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base HP can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base HP fell!", pkmn.name)
|
||||
])
|
||||
next pbRaiseHappinessAndLowerEV(
|
||||
pkmn, scene, :HP, qty, [
|
||||
_INTL("{1} adores you! Its base HP fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base HP can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base HP fell!", pkmn.name)
|
||||
]
|
||||
)
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemonMaximum.add(:KELPSYBERRY, proc { |item, pkmn|
|
||||
@@ -955,11 +957,13 @@ ItemHandlers::UseOnPokemonMaximum.add(:KELPSYBERRY, proc { |item, pkmn|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:KELPSYBERRY, proc { |item, qty, pkmn, scene|
|
||||
next pbRaiseHappinessAndLowerEV(pkmn, scene, :ATTACK, qty, [
|
||||
_INTL("{1} adores you! Its base Attack fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Attack can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Attack fell!", pkmn.name)
|
||||
])
|
||||
next pbRaiseHappinessAndLowerEV(
|
||||
pkmn, scene, :ATTACK, qty, [
|
||||
_INTL("{1} adores you! Its base Attack fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Attack can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Attack fell!", pkmn.name)
|
||||
]
|
||||
)
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemonMaximum.add(:QUALOTBERRY, proc { |item, pkmn|
|
||||
@@ -967,11 +971,13 @@ ItemHandlers::UseOnPokemonMaximum.add(:QUALOTBERRY, proc { |item, pkmn|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:QUALOTBERRY, proc { |item, qty, pkmn, scene|
|
||||
next pbRaiseHappinessAndLowerEV(pkmn, scene, :DEFENSE, qty, [
|
||||
_INTL("{1} adores you! Its base Defense fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Defense can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Defense fell!", pkmn.name)
|
||||
])
|
||||
next pbRaiseHappinessAndLowerEV(
|
||||
pkmn, scene, :DEFENSE, qty, [
|
||||
_INTL("{1} adores you! Its base Defense fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Defense can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Defense fell!", pkmn.name)
|
||||
]
|
||||
)
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemonMaximum.add(:HONDEWBERRY, proc { |item, pkmn|
|
||||
@@ -979,11 +985,13 @@ ItemHandlers::UseOnPokemonMaximum.add(:HONDEWBERRY, proc { |item, pkmn|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:HONDEWBERRY, proc { |item, qty, pkmn, scene|
|
||||
next pbRaiseHappinessAndLowerEV(pkmn, scene, :SPECIAL_ATTACK, qty, [
|
||||
_INTL("{1} adores you! Its base Special Attack fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Special Attack can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Special Attack fell!", pkmn.name)
|
||||
])
|
||||
next pbRaiseHappinessAndLowerEV(
|
||||
pkmn, scene, :SPECIAL_ATTACK, qty, [
|
||||
_INTL("{1} adores you! Its base Special Attack fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Special Attack can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Special Attack fell!", pkmn.name)
|
||||
]
|
||||
)
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemonMaximum.add(:GREPABERRY, proc { |item, pkmn|
|
||||
@@ -991,11 +999,13 @@ ItemHandlers::UseOnPokemonMaximum.add(:GREPABERRY, proc { |item, pkmn|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:GREPABERRY, proc { |item, qty, pkmn, scene|
|
||||
next pbRaiseHappinessAndLowerEV(pkmn, scene, :SPECIAL_DEFENSE, qty, [
|
||||
_INTL("{1} adores you! Its base Special Defense fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Special Defense can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Special Defense fell!", pkmn.name)
|
||||
])
|
||||
next pbRaiseHappinessAndLowerEV(
|
||||
pkmn, scene, :SPECIAL_DEFENSE, qty, [
|
||||
_INTL("{1} adores you! Its base Special Defense fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Special Defense can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Special Defense fell!", pkmn.name)
|
||||
]
|
||||
)
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemonMaximum.add(:TAMATOBERRY, proc { |item, pkmn|
|
||||
@@ -1003,11 +1013,13 @@ ItemHandlers::UseOnPokemonMaximum.add(:TAMATOBERRY, proc { |item, pkmn|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:TAMATOBERRY, proc { |item, qty, pkmn, scene|
|
||||
next pbRaiseHappinessAndLowerEV(pkmn, scene, :SPEED, qty, [
|
||||
_INTL("{1} adores you! Its base Speed fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Speed can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Speed fell!", pkmn.name)
|
||||
])
|
||||
next pbRaiseHappinessAndLowerEV(
|
||||
pkmn, scene, :SPEED, qty, [
|
||||
_INTL("{1} adores you! Its base Speed fell!", pkmn.name),
|
||||
_INTL("{1} became more friendly. Its base Speed can't go lower.", pkmn.name),
|
||||
_INTL("{1} became more friendly. However, its base Speed fell!", pkmn.name)
|
||||
]
|
||||
)
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:ABILITYCAPSULE, proc { |item, qty, pkmn, scene|
|
||||
|
||||
@@ -49,8 +49,8 @@ ItemHandlers::CanUseInBattle.addIf(proc { |item| GameData::Item.get(item).is_pok
|
||||
if battle.pbOpposingBattlerCount > 1 && !(GameData::Item.get(item).is_snag_ball? && battle.trainerBattle?)
|
||||
if battle.pbOpposingBattlerCount == 2
|
||||
scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are two Pokémon!")) if showMessages
|
||||
else
|
||||
scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are more than one Pokémon!")) if showMessages
|
||||
elsif showMessages
|
||||
scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are more than one Pokémon!"))
|
||||
end
|
||||
next false
|
||||
end
|
||||
|
||||
@@ -150,7 +150,7 @@ Events.onMapUpdate += proc { |_sender, _e|
|
||||
next if !num[0] || num.length != 8 # if not visible or not a trainer
|
||||
# Reset time to next can-battle if necessary
|
||||
if num[4] == 0
|
||||
num[3] = 20 * 60 + rand(20 * 60) # 20-40 minutes
|
||||
num[3] = rand(20...40) * 60 # 20-40 minutes
|
||||
num[4] = 1
|
||||
end
|
||||
# Count down time to next can-battle
|
||||
|
||||
@@ -66,11 +66,11 @@ def pbPokeRadarHighlightGrass(showmessage = true)
|
||||
if r <= (i + 1) * 2
|
||||
x = $game_player.x - i - 1 + r
|
||||
y = $game_player.y - i - 1
|
||||
elsif r <= (i + 1) * 6 - 2
|
||||
elsif r <= ((i + 1) * 6) - 2
|
||||
x = [$game_player.x + i + 1, $game_player.x - i - 1][r % 2]
|
||||
y = $game_player.y - i + ((r - 1 - (i + 1) * 2) / 2).floor
|
||||
y = $game_player.y - i + ((r - 1 - ((i + 1) * 2)) / 2).floor
|
||||
else
|
||||
x = $game_player.x - i + r - (i + 1) * 6
|
||||
x = $game_player.x - i + r - ((i + 1) * 6)
|
||||
y = $game_player.y + i + 1
|
||||
end
|
||||
# Add tile to grasses array if it's a valid grass tile
|
||||
@@ -81,7 +81,7 @@ def pbPokeRadarHighlightGrass(showmessage = true)
|
||||
# Choose a rarity for the grass (0=normal, 1=rare, 2=shiny)
|
||||
s = (rand(100) < 25) ? 1 : 0
|
||||
if $game_temp.poke_radar_data && $game_temp.poke_radar_data[2] > 0
|
||||
v = [(65536 / Settings::SHINY_POKEMON_CHANCE) - [$game_temp.poke_radar_data[2], 40].min * 200, 200].max
|
||||
v = [(65536 / Settings::SHINY_POKEMON_CHANCE) - ([$game_temp.poke_radar_data[2], 40].min * 200), 200].max
|
||||
v = (65536 / v.to_f).ceil
|
||||
s = 2 if rand(65536) < v
|
||||
end
|
||||
@@ -164,7 +164,7 @@ EncounterModifier.register(proc { |encounter|
|
||||
$game_temp.poke_radar_data[3].each { |g| rarity = g[3] if g[2] == ring }
|
||||
if $game_temp.poke_radar_data[2] > 0 # Chain count, i.e. is chaining
|
||||
if rarity == 2 ||
|
||||
rand(100) < 58 + ring * 10 + ([$game_temp.poke_radar_data[2], 40].min / 4) + ($game_temp.poke_radar_data[4] ? 10 : 0)
|
||||
rand(100) < 58 + (ring * 10) + ([$game_temp.poke_radar_data[2], 40].min / 4) + ($game_temp.poke_radar_data[4] ? 10 : 0)
|
||||
# Continue the chain
|
||||
encounter = [$game_temp.poke_radar_data[0], $game_temp.poke_radar_data[1]]
|
||||
$game_temp.force_single_battle = true
|
||||
@@ -186,8 +186,8 @@ EncounterModifier.register(proc { |encounter|
|
||||
encounter = pbPokeRadarGetEncounter(rarity)
|
||||
$game_temp.force_single_battle = true
|
||||
end
|
||||
else # Encounter triggered by stepping in non-rustling grass
|
||||
pbPokeRadarCancel if encounter
|
||||
elsif encounter # Encounter triggered by stepping in non-rustling grass
|
||||
pbPokeRadarCancel
|
||||
end
|
||||
next encounter
|
||||
})
|
||||
|
||||
@@ -61,55 +61,55 @@ end
|
||||
|
||||
def pbSpindaSpots(pkmn, bitmap)
|
||||
spot1 = [
|
||||
[0, 0, 1, 1, 1, 1, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[0, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 0, 1, 1, 1, 1, 0, 0]
|
||||
[0, 0, 1, 1, 1, 1, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[0, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 0, 1, 1, 1, 1, 0, 0]
|
||||
]
|
||||
spot2 = [
|
||||
[0, 0, 1, 1, 1, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[0, 1, 1, 1, 1, 1, 0],
|
||||
[0, 0, 1, 1, 1, 0, 0]
|
||||
[0, 0, 1, 1, 1, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1],
|
||||
[0, 1, 1, 1, 1, 1, 0],
|
||||
[0, 0, 1, 1, 1, 0, 0]
|
||||
]
|
||||
spot3 = [
|
||||
[0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
|
||||
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
|
||||
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
|
||||
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0]
|
||||
[0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
|
||||
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
|
||||
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
|
||||
[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0]
|
||||
]
|
||||
spot4 = [
|
||||
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0],
|
||||
[0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
|
||||
[0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0]
|
||||
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0],
|
||||
[0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
|
||||
[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0],
|
||||
[0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0]
|
||||
]
|
||||
id = pkmn.personalID
|
||||
h = (id >> 28) & 15
|
||||
@@ -215,11 +215,11 @@ MultipleForms.register(:CHERRIM, {
|
||||
MultipleForms.register(:ROTOM, {
|
||||
"onSetForm" => proc { |pkmn, form, oldForm|
|
||||
form_moves = [
|
||||
:OVERHEAT, # Heat (microwave oven)
|
||||
:HYDROPUMP, # Wash (washing machine)
|
||||
:BLIZZARD, # Frost (refrigerator)
|
||||
:AIRSLASH, # Fan (electric fan)
|
||||
:LEAFSTORM # Mow (lawn mower)
|
||||
:OVERHEAT, # Heat (microwave oven)
|
||||
:HYDROPUMP, # Wash (washing machine)
|
||||
:BLIZZARD, # Frost (refrigerator)
|
||||
:AIRSLASH, # Fan (electric fan)
|
||||
:LEAFSTORM # Mow (lawn mower)
|
||||
]
|
||||
# Find a known move that should be forgotten
|
||||
old_move_index = -1
|
||||
@@ -277,23 +277,23 @@ MultipleForms.register(:ARCEUS, {
|
||||
"getForm" => proc { |pkmn|
|
||||
next nil if !pkmn.hasAbility?(:MULTITYPE)
|
||||
typeArray = {
|
||||
1 => [:FISTPLATE, :FIGHTINIUMZ],
|
||||
2 => [:SKYPLATE, :FLYINIUMZ],
|
||||
3 => [:TOXICPLATE, :POISONIUMZ],
|
||||
4 => [:EARTHPLATE, :GROUNDIUMZ],
|
||||
5 => [:STONEPLATE, :ROCKIUMZ],
|
||||
6 => [:INSECTPLATE, :BUGINIUMZ],
|
||||
7 => [:SPOOKYPLATE, :GHOSTIUMZ],
|
||||
8 => [:IRONPLATE, :STEELIUMZ],
|
||||
10 => [:FLAMEPLATE, :FIRIUMZ],
|
||||
11 => [:SPLASHPLATE, :WATERIUMZ],
|
||||
12 => [:MEADOWPLATE, :GRASSIUMZ],
|
||||
13 => [:ZAPPLATE, :ELECTRIUMZ],
|
||||
14 => [:MINDPLATE, :PSYCHIUMZ],
|
||||
15 => [:ICICLEPLATE, :ICIUMZ],
|
||||
16 => [:DRACOPLATE, :DRAGONIUMZ],
|
||||
17 => [:DREADPLATE, :DARKINIUMZ],
|
||||
18 => [:PIXIEPLATE, :FAIRIUMZ]
|
||||
1 => [:FISTPLATE, :FIGHTINIUMZ],
|
||||
2 => [:SKYPLATE, :FLYINIUMZ],
|
||||
3 => [:TOXICPLATE, :POISONIUMZ],
|
||||
4 => [:EARTHPLATE, :GROUNDIUMZ],
|
||||
5 => [:STONEPLATE, :ROCKIUMZ],
|
||||
6 => [:INSECTPLATE, :BUGINIUMZ],
|
||||
7 => [:SPOOKYPLATE, :GHOSTIUMZ],
|
||||
8 => [:IRONPLATE, :STEELIUMZ],
|
||||
10 => [:FLAMEPLATE, :FIRIUMZ],
|
||||
11 => [:SPLASHPLATE, :WATERIUMZ],
|
||||
12 => [:MEADOWPLATE, :GRASSIUMZ],
|
||||
13 => [:ZAPPLATE, :ELECTRIUMZ],
|
||||
14 => [:MINDPLATE, :PSYCHIUMZ],
|
||||
15 => [:ICICLEPLATE, :ICIUMZ],
|
||||
16 => [:DRACOPLATE, :DRAGONIUMZ],
|
||||
17 => [:DREADPLATE, :DARKINIUMZ],
|
||||
18 => [:PIXIEPLATE, :FAIRIUMZ]
|
||||
}
|
||||
ret = 0
|
||||
typeArray.each do |f, items|
|
||||
@@ -394,7 +394,7 @@ MultipleForms.copy(:SCATTERBUG, :SPEWPA, :VIVILLON)
|
||||
MultipleForms.register(:FURFROU, {
|
||||
"getForm" => proc { |pkmn|
|
||||
if !pkmn.time_form_set ||
|
||||
pbGetTimeNow.to_i > pkmn.time_form_set.to_i + 60 * 60 * 24 * 5 # 5 days
|
||||
pbGetTimeNow.to_i > pkmn.time_form_set.to_i + (60 * 60 * 24 * 5) # 5 days
|
||||
next 0
|
||||
end
|
||||
},
|
||||
@@ -447,7 +447,7 @@ MultipleForms.register(:ZYGARDE, {
|
||||
MultipleForms.register(:HOOPA, {
|
||||
"getForm" => proc { |pkmn|
|
||||
if !pkmn.time_form_set ||
|
||||
pbGetTimeNow.to_i > pkmn.time_form_set.to_i + 60 * 60 * 24 * 3 # 3 days
|
||||
pbGetTimeNow.to_i > pkmn.time_form_set.to_i + (60 * 60 * 24 * 3) # 3 days
|
||||
next 0
|
||||
end
|
||||
},
|
||||
@@ -482,23 +482,23 @@ MultipleForms.register(:SILVALLY, {
|
||||
"getForm" => proc { |pkmn|
|
||||
next nil if !pkmn.hasAbility?(:RKSSYSTEM)
|
||||
typeArray = {
|
||||
1 => [:FIGHTINGMEMORY],
|
||||
2 => [:FLYINGMEMORY],
|
||||
3 => [:POISONMEMORY],
|
||||
4 => [:GROUNDMEMORY],
|
||||
5 => [:ROCKMEMORY],
|
||||
6 => [:BUGMEMORY],
|
||||
7 => [:GHOSTMEMORY],
|
||||
8 => [:STEELMEMORY],
|
||||
10 => [:FIREMEMORY],
|
||||
11 => [:WATERMEMORY],
|
||||
12 => [:GRASSMEMORY],
|
||||
13 => [:ELECTRICMEMORY],
|
||||
14 => [:PSYCHICMEMORY],
|
||||
15 => [:ICEMEMORY],
|
||||
16 => [:DRAGONMEMORY],
|
||||
17 => [:DARKMEMORY],
|
||||
18 => [:FAIRYMEMORY]
|
||||
1 => [:FIGHTINGMEMORY],
|
||||
2 => [:FLYINGMEMORY],
|
||||
3 => [:POISONMEMORY],
|
||||
4 => [:GROUNDMEMORY],
|
||||
5 => [:ROCKMEMORY],
|
||||
6 => [:BUGMEMORY],
|
||||
7 => [:GHOSTMEMORY],
|
||||
8 => [:STEELMEMORY],
|
||||
10 => [:FIREMEMORY],
|
||||
11 => [:WATERMEMORY],
|
||||
12 => [:GRASSMEMORY],
|
||||
13 => [:ELECTRICMEMORY],
|
||||
14 => [:PSYCHICMEMORY],
|
||||
15 => [:ICEMEMORY],
|
||||
16 => [:DRAGONMEMORY],
|
||||
17 => [:DARKMEMORY],
|
||||
18 => [:FAIRYMEMORY]
|
||||
}
|
||||
ret = 0
|
||||
typeArray.each do |f, items|
|
||||
@@ -596,7 +596,7 @@ MultipleForms.register(:MILCERY, {
|
||||
sweets = [:STRAWBERRYSWEET, :BERRYSWEET, :LOVESWEET, :STARSWEET,
|
||||
:CLOVERSWEET, :FLOWERSWEET, :RIBBONSWEET]
|
||||
if sweets.include?(pkmn.item_id)
|
||||
next sweets.index(pkmn.item_id) + (pkmn.personalID % num_flavors) * sweets.length
|
||||
next sweets.index(pkmn.item_id) + ((pkmn.personalID % num_flavors) * sweets.length)
|
||||
end
|
||||
next 0
|
||||
}
|
||||
|
||||
@@ -76,18 +76,18 @@ class PokemonStorage
|
||||
|
||||
def allWallpapers
|
||||
return [
|
||||
# Basic wallpapers
|
||||
_INTL("Forest"), _INTL("City"), _INTL("Desert"), _INTL("Savanna"),
|
||||
_INTL("Crag"), _INTL("Volcano"), _INTL("Snow"), _INTL("Cave"),
|
||||
_INTL("Beach"), _INTL("Seafloor"), _INTL("River"), _INTL("Sky"),
|
||||
_INTL("Poké Center"), _INTL("Machine"), _INTL("Checks"), _INTL("Simple"),
|
||||
# Special wallpapers
|
||||
_INTL("Space"), _INTL("Backyard"), _INTL("Nostalgic 1"), _INTL("Torchic"),
|
||||
_INTL("Trio 1"), _INTL("PikaPika 1"), _INTL("Legend 1"), _INTL("Team Galactic 1"),
|
||||
_INTL("Distortion"), _INTL("Contest"), _INTL("Nostalgic 2"), _INTL("Croagunk"),
|
||||
_INTL("Trio 2"), _INTL("PikaPika 2"), _INTL("Legend 2"), _INTL("Team Galactic 2"),
|
||||
_INTL("Heart"), _INTL("Soul"), _INTL("Big Brother"), _INTL("Pokéathlon"),
|
||||
_INTL("Trio 3"), _INTL("Spiky Pika"), _INTL("Kimono Girl"), _INTL("Revival")
|
||||
# Basic wallpapers
|
||||
_INTL("Forest"), _INTL("City"), _INTL("Desert"), _INTL("Savanna"),
|
||||
_INTL("Crag"), _INTL("Volcano"), _INTL("Snow"), _INTL("Cave"),
|
||||
_INTL("Beach"), _INTL("Seafloor"), _INTL("River"), _INTL("Sky"),
|
||||
_INTL("Poké Center"), _INTL("Machine"), _INTL("Checks"), _INTL("Simple"),
|
||||
# Special wallpapers
|
||||
_INTL("Space"), _INTL("Backyard"), _INTL("Nostalgic 1"), _INTL("Torchic"),
|
||||
_INTL("Trio 1"), _INTL("PikaPika 1"), _INTL("Legend 1"), _INTL("Team Galactic 1"),
|
||||
_INTL("Distortion"), _INTL("Contest"), _INTL("Nostalgic 2"), _INTL("Croagunk"),
|
||||
_INTL("Trio 2"), _INTL("PikaPika 2"), _INTL("Legend 2"), _INTL("Team Galactic 2"),
|
||||
_INTL("Heart"), _INTL("Soul"), _INTL("Big Brother"), _INTL("Pokéathlon"),
|
||||
_INTL("Trio 3"), _INTL("Spiky Pika"), _INTL("Kimono Girl"), _INTL("Revival")
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
@@ -1071,12 +1071,12 @@ class Pokemon
|
||||
# @return [Integer] the maximum HP of this Pokémon
|
||||
def calcHP(base, level, iv, ev)
|
||||
return 1 if base == 1 # For Shedinja
|
||||
return ((base * 2 + iv + (ev / 4)) * level / 100).floor + level + 10
|
||||
return (((base * 2) + iv + (ev / 4)) * level / 100).floor + level + 10
|
||||
end
|
||||
|
||||
# @return [Integer] the specified stat of this Pokémon (not used for total HP)
|
||||
def calcStat(base, level, iv, ev, nat)
|
||||
return ((((base * 2 + iv + (ev / 4)) * level / 100).floor + 5) * nat / 100).floor
|
||||
return (((((base * 2) + iv + (ev / 4)) * level / 100).floor + 5) * nat / 100).floor
|
||||
end
|
||||
|
||||
# Recalculates this Pokémon's stats.
|
||||
@@ -1179,9 +1179,10 @@ class Pokemon
|
||||
@iv[s.id] = rand(IV_STAT_LIMIT + 1)
|
||||
@ev[s.id] = 0
|
||||
end
|
||||
if owner.is_a?(Owner)
|
||||
case owner
|
||||
when Owner
|
||||
@owner = owner
|
||||
elsif owner.is_a?(Player) || owner.is_a?(NPCTrainer)
|
||||
when Player, NPCTrainer
|
||||
@owner = Owner.new_from_trainer(owner)
|
||||
else
|
||||
@owner = Owner.new(0, '', 2, 2)
|
||||
@@ -1195,7 +1196,7 @@ class Pokemon
|
||||
@timeReceived = pbGetTimeNow.to_i
|
||||
@timeEggHatched = nil
|
||||
@fused = nil
|
||||
@personalID = rand(2**16) | rand(2**16) << 16
|
||||
@personalID = rand(2**16) | (rand(2**16) << 16)
|
||||
@hp = 1
|
||||
@totalhp = 1
|
||||
calc_stats
|
||||
|
||||
@@ -43,7 +43,7 @@ class Pokemon
|
||||
# @return [Integer] total PP
|
||||
def total_pp
|
||||
max_pp = GameData::Move.get(@id).total_pp
|
||||
return max_pp + max_pp * @ppup / 5
|
||||
return max_pp + (max_pp * @ppup / 5)
|
||||
end
|
||||
alias totalpp total_pp
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class Trainer
|
||||
# Random ID other than this Trainer's ID
|
||||
def make_foreign_ID
|
||||
loop do
|
||||
ret = rand(2**16) | rand(2**16) << 16
|
||||
ret = rand(2**16) | (rand(2**16) << 16)
|
||||
return ret if ret != @id
|
||||
end
|
||||
return 0
|
||||
@@ -168,7 +168,7 @@ class Trainer
|
||||
def initialize(name, trainer_type)
|
||||
@trainer_type = GameData::TrainerType.get(trainer_type).id
|
||||
@name = name
|
||||
@id = rand(2**16) | rand(2**16) << 16
|
||||
@id = rand(2**16) | (rand(2**16) << 16)
|
||||
@language = pbGetLanguage
|
||||
@party = []
|
||||
end
|
||||
|
||||
@@ -14,8 +14,8 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
|
||||
for i in 0...Settings::MAX_PARTY_SIZE
|
||||
if i == 0
|
||||
pbMessage(_INTL("Please enter the first Pokémon.", i))
|
||||
else
|
||||
break if !pbConfirmMessage(_INTL("Add another Pokémon?"))
|
||||
elsif !pbConfirmMessage(_INTL("Add another Pokémon?"))
|
||||
break
|
||||
end
|
||||
loop do
|
||||
species = pbChooseSpeciesList
|
||||
@@ -42,10 +42,12 @@ def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
|
||||
:pokemon => []
|
||||
}
|
||||
party.each do |pkmn|
|
||||
trainer_hash[:pokemon].push({
|
||||
:species => pkmn[0],
|
||||
:level => pkmn[1]
|
||||
})
|
||||
trainer_hash[:pokemon].push(
|
||||
{
|
||||
:species => pkmn[0],
|
||||
:level => pkmn[1]
|
||||
}
|
||||
)
|
||||
end
|
||||
# Add trainer's data to records
|
||||
trainer_hash[:id] = [trainer_hash[:trainer_type], trainer_hash[:name], trainer_hash[:version]]
|
||||
|
||||
@@ -89,8 +89,8 @@ class PokemonEggHatch_Scene
|
||||
@pokemon.species_data.apply_metrics_to_sprite(@sprites["pokemon"], 1)
|
||||
@sprites["hatch"].visible = false
|
||||
for i in 1..fadeTime
|
||||
@sprites["pokemon"].tone = Tone.new(255 - i * toneDiff, 255 - i * toneDiff, 255 - i * toneDiff)
|
||||
@sprites["overlay"].opacity = 255 - i * toneDiff
|
||||
@sprites["pokemon"].tone = Tone.new(255 - (i * toneDiff), 255 - (i * toneDiff), 255 - (i * toneDiff))
|
||||
@sprites["overlay"].opacity = 255 - (i * toneDiff)
|
||||
updateScene
|
||||
end
|
||||
@sprites["pokemon"].tone = Tone.new(0, 0, 0)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user