mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-28 17:26:00 +00:00
More Rubocop
This commit is contained in:
@@ -93,6 +93,11 @@ Style/Documentation:
|
|||||||
Style/FormatString:
|
Style/FormatString:
|
||||||
EnforcedStyle: sprintf
|
EnforcedStyle: sprintf
|
||||||
|
|
||||||
|
# String literals are not frozen by default, which makes this comment a
|
||||||
|
# pointless bit of boilerplate that we neither need nor want.
|
||||||
|
Style/FrozenStringLiteralComment:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
# RMXP and Essentials use lots of global variables.
|
# RMXP and Essentials use lots of global variables.
|
||||||
Style/GlobalVars:
|
Style/GlobalVars:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ class Module
|
|||||||
delimiter = class_method ? '.' : '#'
|
delimiter = class_method ? '.' : '#'
|
||||||
|
|
||||||
target.define_method(name) do |*args, **kvargs|
|
target.define_method(name) do |*args, **kvargs|
|
||||||
alias_name = format('%s%s%s', class_name, delimiter, name)
|
alias_name = sprintf('%s%s%s', class_name, delimiter, name)
|
||||||
aliased_method_name = format('%s%s%s', class_name, delimiter, aliased_method)
|
aliased_method_name = sprintf('%s%s%s', class_name, delimiter, aliased_method)
|
||||||
Deprecation.warn_method(alias_name, removal_in, aliased_method_name)
|
Deprecation.warn_method(alias_name, removal_in, aliased_method_name)
|
||||||
method(aliased_method).call(*args, **kvargs)
|
method(aliased_method).call(*args, **kvargs)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -413,12 +413,12 @@ module PluginManager
|
|||||||
# -1 if v1 is lower than v2
|
# -1 if v1 is lower than v2
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
def self.compare_versions(v1, v2)
|
def self.compare_versions(v1, v2)
|
||||||
d1 = v1.split("")
|
d1 = v1.chars
|
||||||
d1.insert(0, "0") if d1[0] == "." # Turn ".123" into "0.123"
|
d1.insert(0, "0") if d1[0] == "." # Turn ".123" into "0.123"
|
||||||
while d1[-1] == "." # Turn "123." into "123"
|
while d1[-1] == "." # Turn "123." into "123"
|
||||||
d1 = d1[0..-2]
|
d1 = d1[0..-2]
|
||||||
end
|
end
|
||||||
d2 = v2.split("")
|
d2 = v2.chars
|
||||||
d2.insert(0, "0") if d2[0] == "." # Turn ".123" into "0.123"
|
d2.insert(0, "0") if d2[0] == "." # Turn ".123" into "0.123"
|
||||||
while d2[-1] == "." # Turn "123." into "123"
|
while d2[-1] == "." # Turn "123." into "123"
|
||||||
d2 = d2[0..-2]
|
d2 = d2[0..-2]
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ class SpriteAnimation
|
|||||||
["x", "y", "ox", "oy", "viewport", "flash", "src_rect", "opacity", "tone"].each do |def_name|
|
["x", "y", "ox", "oy", "viewport", "flash", "src_rect", "opacity", "tone"].each do |def_name|
|
||||||
eval <<-__END__
|
eval <<-__END__
|
||||||
|
|
||||||
def #{def_name}(*arg)
|
def #{def_name}(*arg) # def x(*arg)
|
||||||
@sprite.#{def_name}(*arg)
|
@sprite.#{def_name}(*arg) # @sprite.x(*arg)
|
||||||
end
|
end # end
|
||||||
|
|
||||||
__END__
|
__END__
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ module Game
|
|||||||
$data_system = load_data('Data/System.rxdata')
|
$data_system = load_data('Data/System.rxdata')
|
||||||
pbLoadBattleAnimations
|
pbLoadBattleAnimations
|
||||||
GameData.load_all
|
GameData.load_all
|
||||||
map_file = format('Data/Map%03d.rxdata', $data_system.start_map_id)
|
map_file = sprintf('Data/Map%03d.rxdata', $data_system.start_map_id)
|
||||||
if $data_system.start_map_id == 0 || !pbRgssExists?(map_file)
|
if $data_system.start_map_id == 0 || !pbRgssExists?(map_file)
|
||||||
raise _INTL('No starting position was set in the map editor.')
|
raise _INTL('No starting position was set in the map editor.')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Interpreter
|
|||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
str = super.chop
|
str = super.chop
|
||||||
str << format(' @event_id: %d>', @event_id)
|
str << sprintf(' @event_id: %d>', @event_id)
|
||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Game_SelfSwitches
|
|||||||
# key : key
|
# key : key
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
def [](key)
|
def [](key)
|
||||||
return (@data[key] == true) ? true : false
|
return @data[key] == true
|
||||||
end
|
end
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# * Set Self Switch
|
# * Set Self Switch
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Sprite_Reflection
|
|||||||
@event = event
|
@event = event
|
||||||
@height = 0
|
@height = 0
|
||||||
@fixedheight = false
|
@fixedheight = false
|
||||||
if @event != $game_player && @event&.name[/reflection\((\d+)\)/i]
|
if @event && @event != $game_player && @event.name[/reflection\((\d+)\)/i]
|
||||||
@height = $~[1].to_i || 0
|
@height = $~[1].to_i || 0
|
||||||
@fixedheight = true
|
@fixedheight = true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
class PictureOrigin
|
class PictureOrigin
|
||||||
TopLeft = 0
|
TOP_LEFT = 0
|
||||||
Center = 1
|
CENTER = 1
|
||||||
TopRight = 2
|
TOP_RIGHT = 2
|
||||||
BottomLeft = 3
|
BOTTOM_LEFT = 3
|
||||||
LowerLeft = 3
|
LOWER_LEFT = 3
|
||||||
BottomRight = 4
|
BOTTOM_RIGHT = 4
|
||||||
LowerRight = 4
|
LOWER_RIGHT = 4
|
||||||
Top = 5
|
TOP = 5
|
||||||
Bottom = 6
|
BOTTOM = 6
|
||||||
Left = 7
|
LEFT = 7
|
||||||
Right = 8
|
RIGHT = 8
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Processes
|
class Processes
|
||||||
XY = 0
|
XY = 0
|
||||||
DeltaXY = 1
|
DELTA_XY = 1
|
||||||
Z = 2
|
Z = 2
|
||||||
Curve = 3
|
CURVE = 3
|
||||||
Zoom = 4
|
ZOOM = 4
|
||||||
Angle = 5
|
ANGLE = 5
|
||||||
Tone = 6
|
TONE = 6
|
||||||
Color = 7
|
COLOR = 7
|
||||||
Hue = 8
|
HUE = 8
|
||||||
Opacity = 9
|
OPACITY = 9
|
||||||
Visible = 10
|
VISIBLE = 10
|
||||||
BlendType = 11
|
BLEND_TYPE = 11
|
||||||
SE = 12
|
SE = 12
|
||||||
Name = 13
|
NAME = 13
|
||||||
Origin = 14
|
ORIGIN = 14
|
||||||
Src = 15
|
SRC = 15
|
||||||
SrcSize = 16
|
SRC_SIZE = 16
|
||||||
CropBottom = 17
|
CROP_BOTTOM = 17
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ class PictureEx
|
|||||||
@visible = true
|
@visible = true
|
||||||
@blend_type = 0
|
@blend_type = 0
|
||||||
@name = ""
|
@name = ""
|
||||||
@origin = PictureOrigin::TopLeft
|
@origin = PictureOrigin::TOP_LEFT
|
||||||
@src_rect = Rect.new(0, 0, -1, -1)
|
@src_rect = Rect.new(0, 0, -1, -1)
|
||||||
@cropBottom = -1
|
@cropBottom = -1
|
||||||
@frameUpdates = []
|
@frameUpdates = []
|
||||||
@@ -213,12 +213,12 @@ class PictureEx
|
|||||||
|
|
||||||
def moveCurve(delay, duration, x1, y1, x2, y2, x3, y3, cb = nil)
|
def moveCurve(delay, duration, x1, y1, x2, y2, x3, y3, cb = nil)
|
||||||
delay, duration = ensureDelayAndDuration(delay, duration)
|
delay, duration = ensureDelayAndDuration(delay, duration)
|
||||||
@processes.push([Processes::Curve, delay, duration, 0, cb, [@x, @y, x1, y1, x2, y2, x3, y3]])
|
@processes.push([Processes::CURVE, delay, duration, 0, cb, [@x, @y, x1, y1, x2, y2, x3, y3]])
|
||||||
end
|
end
|
||||||
|
|
||||||
def moveDelta(delay, duration, x, y, cb = nil)
|
def moveDelta(delay, duration, x, y, cb = nil)
|
||||||
delay, duration = ensureDelayAndDuration(delay, duration)
|
delay, duration = ensureDelayAndDuration(delay, duration)
|
||||||
@processes.push([Processes::DeltaXY, delay, duration, 0, cb, @x, @y, x, y])
|
@processes.push([Processes::DELTA_XY, delay, duration, 0, cb, @x, @y, x, y])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setDelta(delay, x, y, cb = nil)
|
def setDelta(delay, x, y, cb = nil)
|
||||||
@@ -236,7 +236,7 @@ class PictureEx
|
|||||||
|
|
||||||
def moveZoomXY(delay, duration, zoom_x, zoom_y, cb = nil)
|
def moveZoomXY(delay, duration, zoom_x, zoom_y, cb = nil)
|
||||||
delay, duration = ensureDelayAndDuration(delay, duration)
|
delay, duration = ensureDelayAndDuration(delay, duration)
|
||||||
@processes.push([Processes::Zoom, delay, duration, 0, cb, @zoom_x, @zoom_y, zoom_x, zoom_y])
|
@processes.push([Processes::ZOOM, delay, duration, 0, cb, @zoom_x, @zoom_y, zoom_x, zoom_y])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setZoomXY(delay, zoom_x, zoom_y, cb = nil)
|
def setZoomXY(delay, zoom_x, zoom_y, cb = nil)
|
||||||
@@ -253,7 +253,7 @@ class PictureEx
|
|||||||
|
|
||||||
def moveAngle(delay, duration, angle, cb = nil)
|
def moveAngle(delay, duration, angle, cb = nil)
|
||||||
delay, duration = ensureDelayAndDuration(delay, duration)
|
delay, duration = ensureDelayAndDuration(delay, duration)
|
||||||
@processes.push([Processes::Angle, delay, duration, 0, cb, @angle, angle])
|
@processes.push([Processes::ANGLE, delay, duration, 0, cb, @angle, angle])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setAngle(delay, angle, cb = nil)
|
def setAngle(delay, angle, cb = nil)
|
||||||
@@ -263,7 +263,7 @@ class PictureEx
|
|||||||
def moveTone(delay, duration, tone, cb = nil)
|
def moveTone(delay, duration, tone, cb = nil)
|
||||||
delay, duration = ensureDelayAndDuration(delay, duration)
|
delay, duration = ensureDelayAndDuration(delay, duration)
|
||||||
target = (tone) ? tone.clone : Tone.new(0, 0, 0, 0)
|
target = (tone) ? tone.clone : Tone.new(0, 0, 0, 0)
|
||||||
@processes.push([Processes::Tone, delay, duration, 0, cb, @tone.clone, target])
|
@processes.push([Processes::TONE, delay, duration, 0, cb, @tone.clone, target])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setTone(delay, tone, cb = nil)
|
def setTone(delay, tone, cb = nil)
|
||||||
@@ -273,7 +273,7 @@ class PictureEx
|
|||||||
def moveColor(delay, duration, color, cb = nil)
|
def moveColor(delay, duration, color, cb = nil)
|
||||||
delay, duration = ensureDelayAndDuration(delay, duration)
|
delay, duration = ensureDelayAndDuration(delay, duration)
|
||||||
target = (color) ? color.clone : Color.new(0, 0, 0, 0)
|
target = (color) ? color.clone : Color.new(0, 0, 0, 0)
|
||||||
@processes.push([Processes::Color, delay, duration, 0, cb, @color.clone, target])
|
@processes.push([Processes::COLOR, delay, duration, 0, cb, @color.clone, target])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setColor(delay, color, cb = nil)
|
def setColor(delay, color, cb = nil)
|
||||||
@@ -283,7 +283,7 @@ class PictureEx
|
|||||||
# Hue changes don't actually work.
|
# Hue changes don't actually work.
|
||||||
def moveHue(delay, duration, hue, cb = nil)
|
def moveHue(delay, duration, hue, cb = nil)
|
||||||
delay, duration = ensureDelayAndDuration(delay, duration)
|
delay, duration = ensureDelayAndDuration(delay, duration)
|
||||||
@processes.push([Processes::Hue, delay, duration, 0, cb, @hue, hue])
|
@processes.push([Processes::HUE, delay, duration, 0, cb, @hue, hue])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Hue changes don't actually work.
|
# Hue changes don't actually work.
|
||||||
@@ -293,7 +293,7 @@ class PictureEx
|
|||||||
|
|
||||||
def moveOpacity(delay, duration, opacity, cb = nil)
|
def moveOpacity(delay, duration, opacity, cb = nil)
|
||||||
delay, duration = ensureDelayAndDuration(delay, duration)
|
delay, duration = ensureDelayAndDuration(delay, duration)
|
||||||
@processes.push([Processes::Opacity, delay, duration, 0, cb, @opacity, opacity])
|
@processes.push([Processes::OPACITY, delay, duration, 0, cb, @opacity, opacity])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setOpacity(delay, opacity, cb = nil)
|
def setOpacity(delay, opacity, cb = nil)
|
||||||
@@ -302,13 +302,13 @@ class PictureEx
|
|||||||
|
|
||||||
def setVisible(delay, visible, cb = nil)
|
def setVisible(delay, visible, cb = nil)
|
||||||
delay = ensureDelay(delay)
|
delay = ensureDelay(delay)
|
||||||
@processes.push([Processes::Visible, delay, 0, 0, cb, visible])
|
@processes.push([Processes::VISIBLE, delay, 0, 0, cb, visible])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Only values of 0 (normal), 1 (additive) and 2 (subtractive) are allowed.
|
# Only values of 0 (normal), 1 (additive) and 2 (subtractive) are allowed.
|
||||||
def setBlendType(delay, blend, cb = nil)
|
def setBlendType(delay, blend, cb = nil)
|
||||||
delay = ensureDelayAndDuration(delay)
|
delay = ensureDelayAndDuration(delay)
|
||||||
@processes.push([Processes::BlendType, delay, 0, 0, cb, blend])
|
@processes.push([Processes::BLEND_TYPE, delay, 0, 0, cb, blend])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setSE(delay, seFile, volume = nil, pitch = nil, cb = nil)
|
def setSE(delay, seFile, volume = nil, pitch = nil, cb = nil)
|
||||||
@@ -318,28 +318,28 @@ class PictureEx
|
|||||||
|
|
||||||
def setName(delay, name, cb = nil)
|
def setName(delay, name, cb = nil)
|
||||||
delay = ensureDelay(delay)
|
delay = ensureDelay(delay)
|
||||||
@processes.push([Processes::Name, delay, 0, 0, cb, name])
|
@processes.push([Processes::NAME, delay, 0, 0, cb, name])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setOrigin(delay, origin, cb = nil)
|
def setOrigin(delay, origin, cb = nil)
|
||||||
delay = ensureDelay(delay)
|
delay = ensureDelay(delay)
|
||||||
@processes.push([Processes::Origin, delay, 0, 0, cb, origin])
|
@processes.push([Processes::ORIGIN, delay, 0, 0, cb, origin])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setSrc(delay, srcX, srcY, cb = nil)
|
def setSrc(delay, srcX, srcY, cb = nil)
|
||||||
delay = ensureDelay(delay)
|
delay = ensureDelay(delay)
|
||||||
@processes.push([Processes::Src, delay, 0, 0, cb, srcX, srcY])
|
@processes.push([Processes::SRC, delay, 0, 0, cb, srcX, srcY])
|
||||||
end
|
end
|
||||||
|
|
||||||
def setSrcSize(delay, srcWidth, srcHeight, cb = nil)
|
def setSrcSize(delay, srcWidth, srcHeight, cb = nil)
|
||||||
delay = ensureDelay(delay)
|
delay = ensureDelay(delay)
|
||||||
@processes.push([Processes::SrcSize, delay, 0, 0, cb, srcWidth, srcHeight])
|
@processes.push([Processes::SRC_SIZE, delay, 0, 0, cb, srcWidth, srcHeight])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Used to cut Pokémon sprites off when they faint and sink into the ground.
|
# Used to cut Pokémon sprites off when they faint and sink into the ground.
|
||||||
def setCropBottom(delay, y, cb = nil)
|
def setCropBottom(delay, y, cb = nil)
|
||||||
delay = ensureDelay(delay)
|
delay = ensureDelay(delay)
|
||||||
@processes.push([Processes::CropBottom, delay, 0, 0, cb, y])
|
@processes.push([Processes::CROP_BOTTOM, delay, 0, 0, cb, y])
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@@ -354,28 +354,28 @@ class PictureEx
|
|||||||
when Processes::XY
|
when Processes::XY
|
||||||
process[5] = @x
|
process[5] = @x
|
||||||
process[6] = @y
|
process[6] = @y
|
||||||
when Processes::DeltaXY
|
when Processes::DELTA_XY
|
||||||
process[5] = @x
|
process[5] = @x
|
||||||
process[6] = @y
|
process[6] = @y
|
||||||
process[7] += @x
|
process[7] += @x
|
||||||
process[8] += @y
|
process[8] += @y
|
||||||
when Processes::Curve
|
when Processes::CURVE
|
||||||
process[5][0] = @x
|
process[5][0] = @x
|
||||||
process[5][1] = @y
|
process[5][1] = @y
|
||||||
when Processes::Z
|
when Processes::Z
|
||||||
process[5] = @z
|
process[5] = @z
|
||||||
when Processes::Zoom
|
when Processes::ZOOM
|
||||||
process[5] = @zoom_x
|
process[5] = @zoom_x
|
||||||
process[6] = @zoom_y
|
process[6] = @zoom_y
|
||||||
when Processes::Angle
|
when Processes::ANGLE
|
||||||
process[5] = @angle
|
process[5] = @angle
|
||||||
when Processes::Tone
|
when Processes::TONE
|
||||||
process[5] = @tone.clone
|
process[5] = @tone.clone
|
||||||
when Processes::Color
|
when Processes::COLOR
|
||||||
process[5] = @color.clone
|
process[5] = @color.clone
|
||||||
when Processes::Hue
|
when Processes::HUE
|
||||||
process[5] = @hue
|
process[5] = @hue
|
||||||
when Processes::Opacity
|
when Processes::OPACITY
|
||||||
process[5] = @opacity
|
process[5] = @opacity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -389,49 +389,49 @@ class PictureEx
|
|||||||
fra = (process[2] == 0) ? 1 : process[3] # Frame counter
|
fra = (process[2] == 0) ? 1 : process[3] # Frame counter
|
||||||
dur = (process[2] == 0) ? 1 : process[2] # Total duration of process
|
dur = (process[2] == 0) ? 1 : process[2] # Total duration of process
|
||||||
case process[0]
|
case process[0]
|
||||||
when Processes::XY, Processes::DeltaXY
|
when Processes::XY, Processes::DELTA_XY
|
||||||
@x = process[5] + (fra * (process[7] - process[5]) / dur)
|
@x = process[5] + (fra * (process[7] - process[5]) / dur)
|
||||||
@y = process[6] + (fra * (process[8] - process[6]) / dur)
|
@y = process[6] + (fra * (process[8] - process[6]) / dur)
|
||||||
when Processes::Curve
|
when Processes::CURVE
|
||||||
@x, @y = getCubicPoint2(process[5], fra.to_f / dur)
|
@x, @y = getCubicPoint2(process[5], fra.to_f / dur)
|
||||||
when Processes::Z
|
when Processes::Z
|
||||||
@z = process[5] + (fra * (process[6] - process[5]) / dur)
|
@z = process[5] + (fra * (process[6] - process[5]) / dur)
|
||||||
when Processes::Zoom
|
when Processes::ZOOM
|
||||||
@zoom_x = process[5] + (fra * (process[7] - process[5]) / dur)
|
@zoom_x = process[5] + (fra * (process[7] - process[5]) / dur)
|
||||||
@zoom_y = process[6] + (fra * (process[8] - process[6]) / dur)
|
@zoom_y = process[6] + (fra * (process[8] - process[6]) / dur)
|
||||||
when Processes::Angle
|
when Processes::ANGLE
|
||||||
@angle = process[5] + (fra * (process[6] - process[5]) / dur)
|
@angle = process[5] + (fra * (process[6] - process[5]) / dur)
|
||||||
when Processes::Tone
|
when Processes::TONE
|
||||||
@tone.red = process[5].red + (fra * (process[6].red - process[5].red) / 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.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.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.gray = process[5].gray + (fra * (process[6].gray - process[5].gray) / dur)
|
||||||
when Processes::Color
|
when Processes::COLOR
|
||||||
@color.red = process[5].red + (fra * (process[6].red - process[5].red) / 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.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.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.alpha = process[5].alpha + (fra * (process[6].alpha - process[5].alpha) / dur)
|
||||||
when Processes::Hue
|
when Processes::HUE
|
||||||
@hue = (process[6] - process[5]).to_f / dur
|
@hue = (process[6] - process[5]).to_f / dur
|
||||||
when Processes::Opacity
|
when Processes::OPACITY
|
||||||
@opacity = process[5] + (fra * (process[6] - process[5]) / dur)
|
@opacity = process[5] + (fra * (process[6] - process[5]) / dur)
|
||||||
when Processes::Visible
|
when Processes::VISIBLE
|
||||||
@visible = process[5]
|
@visible = process[5]
|
||||||
when Processes::BlendType
|
when Processes::BLEND_TYPE
|
||||||
@blend_type = process[5]
|
@blend_type = process[5]
|
||||||
when Processes::SE
|
when Processes::SE
|
||||||
pbSEPlay(process[5], process[6], process[7])
|
pbSEPlay(process[5], process[6], process[7])
|
||||||
when Processes::Name
|
when Processes::NAME
|
||||||
@name = process[5]
|
@name = process[5]
|
||||||
when Processes::Origin
|
when Processes::ORIGIN
|
||||||
@origin = process[5]
|
@origin = process[5]
|
||||||
when Processes::Src
|
when Processes::SRC
|
||||||
@src_rect.x = process[5]
|
@src_rect.x = process[5]
|
||||||
@src_rect.y = process[6]
|
@src_rect.y = process[6]
|
||||||
when Processes::SrcSize
|
when Processes::SRC_SIZE
|
||||||
@src_rect.width = process[5]
|
@src_rect.width = process[5]
|
||||||
@src_rect.height = process[6]
|
@src_rect.height = process[6]
|
||||||
when Processes::CropBottom
|
when Processes::CROP_BOTTOM
|
||||||
@cropBottom = process[5]
|
@cropBottom = process[5]
|
||||||
end
|
end
|
||||||
# Increase frame counter
|
# Increase frame counter
|
||||||
@@ -447,7 +447,7 @@ class PictureEx
|
|||||||
@processes.compact! if procEnded
|
@processes.compact! if procEnded
|
||||||
# Add the constant rotation speed
|
# Add the constant rotation speed
|
||||||
if @rotate_speed != 0
|
if @rotate_speed != 0
|
||||||
@frameUpdates.push(Processes::Angle) if !@frameUpdates.include?(Processes::Angle)
|
@frameUpdates.push(Processes::ANGLE) if !@frameUpdates.include?(Processes::ANGLE)
|
||||||
@angle += @rotate_speed
|
@angle += @rotate_speed
|
||||||
while @angle < 0
|
while @angle < 0
|
||||||
@angle += 360
|
@angle += 360
|
||||||
@@ -466,52 +466,52 @@ def setPictureSprite(sprite, picture, iconSprite = false)
|
|||||||
return if picture.frameUpdates.length == 0
|
return if picture.frameUpdates.length == 0
|
||||||
picture.frameUpdates.each do |type|
|
picture.frameUpdates.each do |type|
|
||||||
case type
|
case type
|
||||||
when Processes::XY, Processes::DeltaXY
|
when Processes::XY, Processes::DELTA_XY
|
||||||
sprite.x = picture.x.round
|
sprite.x = picture.x.round
|
||||||
sprite.y = picture.y.round
|
sprite.y = picture.y.round
|
||||||
when Processes::Z
|
when Processes::Z
|
||||||
sprite.z = picture.z
|
sprite.z = picture.z
|
||||||
when Processes::Zoom
|
when Processes::ZOOM
|
||||||
sprite.zoom_x = picture.zoom_x / 100.0
|
sprite.zoom_x = picture.zoom_x / 100.0
|
||||||
sprite.zoom_y = picture.zoom_y / 100.0
|
sprite.zoom_y = picture.zoom_y / 100.0
|
||||||
when Processes::Angle
|
when Processes::ANGLE
|
||||||
sprite.angle = picture.angle
|
sprite.angle = picture.angle
|
||||||
when Processes::Tone
|
when Processes::TONE
|
||||||
sprite.tone = picture.tone
|
sprite.tone = picture.tone
|
||||||
when Processes::Color
|
when Processes::COLOR
|
||||||
sprite.color = picture.color
|
sprite.color = picture.color
|
||||||
when Processes::Hue
|
when Processes::HUE
|
||||||
# This doesn't do anything.
|
# This doesn't do anything.
|
||||||
when Processes::BlendType
|
when Processes::BLEND_TYPE
|
||||||
sprite.blend_type = picture.blend_type
|
sprite.blend_type = picture.blend_type
|
||||||
when Processes::Opacity
|
when Processes::OPACITY
|
||||||
sprite.opacity = picture.opacity
|
sprite.opacity = picture.opacity
|
||||||
when Processes::Visible
|
when Processes::VISIBLE
|
||||||
sprite.visible = picture.visible
|
sprite.visible = picture.visible
|
||||||
when Processes::Name
|
when Processes::NAME
|
||||||
sprite.name = picture.name if iconSprite && sprite.name != picture.name
|
sprite.name = picture.name if iconSprite && sprite.name != picture.name
|
||||||
when Processes::Origin
|
when Processes::ORIGIN
|
||||||
case picture.origin
|
case picture.origin
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Left, PictureOrigin::BottomLeft
|
when PictureOrigin::TOP_LEFT, PictureOrigin::LEFT, PictureOrigin::BOTTOM_LEFT
|
||||||
sprite.ox = 0
|
sprite.ox = 0
|
||||||
when PictureOrigin::Top, PictureOrigin::Center, PictureOrigin::Bottom
|
when PictureOrigin::TOP, PictureOrigin::CENTER, PictureOrigin::BOTTOM
|
||||||
sprite.ox = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.src_rect.width / 2 : 0
|
sprite.ox = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.src_rect.width / 2 : 0
|
||||||
when PictureOrigin::TopRight, PictureOrigin::Right, PictureOrigin::BottomRight
|
when PictureOrigin::TOP_RIGHT, PictureOrigin::RIGHT, PictureOrigin::BOTTOM_RIGHT
|
||||||
sprite.ox = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.src_rect.width : 0
|
sprite.ox = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.src_rect.width : 0
|
||||||
end
|
end
|
||||||
case picture.origin
|
case picture.origin
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Top, PictureOrigin::TopRight
|
when PictureOrigin::TOP_LEFT, PictureOrigin::TOP, PictureOrigin::TOP_RIGHT
|
||||||
sprite.oy = 0
|
sprite.oy = 0
|
||||||
when PictureOrigin::Left, PictureOrigin::Center, PictureOrigin::Right
|
when PictureOrigin::LEFT, PictureOrigin::CENTER, PictureOrigin::RIGHT
|
||||||
sprite.oy = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.src_rect.height / 2 : 0
|
sprite.oy = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.src_rect.height / 2 : 0
|
||||||
when PictureOrigin::BottomLeft, PictureOrigin::Bottom, PictureOrigin::BottomRight
|
when PictureOrigin::BOTTOM_LEFT, PictureOrigin::BOTTOM, PictureOrigin::BOTTOM_RIGHT
|
||||||
sprite.oy = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.src_rect.height : 0
|
sprite.oy = (sprite.bitmap && !sprite.bitmap.disposed?) ? sprite.src_rect.height : 0
|
||||||
end
|
end
|
||||||
when Processes::Src
|
when Processes::SRC
|
||||||
next unless iconSprite && sprite.src_rect
|
next unless iconSprite && sprite.src_rect
|
||||||
sprite.src_rect.x = picture.src_rect.x
|
sprite.src_rect.x = picture.src_rect.x
|
||||||
sprite.src_rect.y = picture.src_rect.y
|
sprite.src_rect.y = picture.src_rect.y
|
||||||
when Processes::SrcSize
|
when Processes::SRC_SIZE
|
||||||
next unless iconSprite && sprite.src_rect
|
next unless iconSprite && sprite.src_rect
|
||||||
sprite.src_rect.width = picture.src_rect.width
|
sprite.src_rect.width = picture.src_rect.width
|
||||||
sprite.src_rect.height = picture.src_rect.height
|
sprite.src_rect.height = picture.src_rect.height
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ def pbDoEnsureBitmap(bitmap, dwidth, dheight)
|
|||||||
bitmap&.dispose
|
bitmap&.dispose
|
||||||
bitmap = Bitmap.new([1, dwidth].max, [1, dheight].max)
|
bitmap = Bitmap.new([1, dwidth].max, [1, dheight].max)
|
||||||
(oldfont) ? bitmap.font = oldfont : pbSetSystemFont(bitmap)
|
(oldfont) ? bitmap.font = oldfont : pbSetSystemFont(bitmap)
|
||||||
bitmap.font.shadow = false if bitmap.font&.respond_to?("shadow")
|
bitmap.font.shadow = false if bitmap.font.respond_to?("shadow")
|
||||||
end
|
end
|
||||||
return bitmap
|
return bitmap
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -512,7 +512,6 @@ class Window_MultilineTextEntry < SpriteWindow_Base
|
|||||||
startY = getLineY(@firstline)
|
startY = getLineY(@firstline)
|
||||||
textchars.each do |text|
|
textchars.each do |text|
|
||||||
thisline = text[5]
|
thisline = text[5]
|
||||||
thiscolumn = text[7]
|
|
||||||
thislength = text[8]
|
thislength = text[8]
|
||||||
textY = text[2] - startY
|
textY = text[2] - startY
|
||||||
# Don't draw lines before the first or zero-length segments
|
# Don't draw lines before the first or zero-length segments
|
||||||
|
|||||||
@@ -115,14 +115,14 @@ def getPlayTime2(filename)
|
|||||||
return -1 if wave != 0x45564157 # "WAVE"
|
return -1 if wave != 0x45564157 # "WAVE"
|
||||||
fmt = fgetdw.call(file)
|
fmt = fgetdw.call(file)
|
||||||
return -1 if fmt != 0x20746d66 # "fmt "
|
return -1 if fmt != 0x20746d66 # "fmt "
|
||||||
fmtsize = fgetdw.call(file)
|
fgetdw.call(file) # fmtsize
|
||||||
format = fgetw.call(file)
|
fgetw.call(file) # format
|
||||||
channels = fgetw.call(file)
|
fgetw.call(file) # channels
|
||||||
rate = fgetdw.call(file)
|
fgetdw.call(file) # rate
|
||||||
bytessec = fgetdw.call(file)
|
bytessec = fgetdw.call(file)
|
||||||
return -1 if bytessec == 0
|
return -1 if bytessec == 0
|
||||||
bytessample = fgetw.call(file)
|
fgetw.call(file) # bytessample
|
||||||
bitssample = fgetw.call(file)
|
fgetw.call(file) # bitssample
|
||||||
data = fgetdw.call(file)
|
data = fgetdw.call(file)
|
||||||
return -1 if data != 0x61746164 # "data"
|
return -1 if data != 0x61746164 # "data"
|
||||||
datasize = fgetdw.call(file)
|
datasize = fgetdw.call(file)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ def pbBGMPlay(param, volume = nil, pitch = nil)
|
|||||||
return
|
return
|
||||||
elsif (RPG.const_defined?(:BGM) rescue false)
|
elsif (RPG.const_defined?(:BGM) rescue false)
|
||||||
b = RPG::BGM.new(param.name, param.volume, param.pitch)
|
b = RPG::BGM.new(param.name, param.volume, param.pitch)
|
||||||
if b&.respond_to?("play")
|
if b.respond_to?("play")
|
||||||
b.play
|
b.play
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -108,7 +108,7 @@ def pbMEPlay(param, volume = nil, pitch = nil)
|
|||||||
return
|
return
|
||||||
elsif (RPG.const_defined?(:ME) rescue false)
|
elsif (RPG.const_defined?(:ME) rescue false)
|
||||||
b = RPG::ME.new(param.name, param.volume, param.pitch)
|
b = RPG::ME.new(param.name, param.volume, param.pitch)
|
||||||
if b&.respond_to?("play")
|
if b.respond_to?("play")
|
||||||
b.play
|
b.play
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -125,7 +125,7 @@ def pbMEStop(timeInSeconds = 0.0)
|
|||||||
if $game_system && timeInSeconds > 0.0 && $game_system.respond_to?("me_fade")
|
if $game_system && timeInSeconds > 0.0 && $game_system.respond_to?("me_fade")
|
||||||
$game_system.me_fade(timeInSeconds)
|
$game_system.me_fade(timeInSeconds)
|
||||||
return
|
return
|
||||||
elsif $game_system&.respond_to?("me_stop")
|
elsif $game_system.respond_to?("me_stop")
|
||||||
$game_system.me_stop(nil)
|
$game_system.me_stop(nil)
|
||||||
return
|
return
|
||||||
elsif (RPG.const_defined?(:ME) rescue false)
|
elsif (RPG.const_defined?(:ME) rescue false)
|
||||||
@@ -158,7 +158,7 @@ def pbBGSPlay(param, volume = nil, pitch = nil)
|
|||||||
return
|
return
|
||||||
elsif (RPG.const_defined?(:BGS) rescue false)
|
elsif (RPG.const_defined?(:BGS) rescue false)
|
||||||
b = RPG::BGS.new(param.name, param.volume, param.pitch)
|
b = RPG::BGS.new(param.name, param.volume, param.pitch)
|
||||||
if b&.respond_to?("play")
|
if b.respond_to?("play")
|
||||||
b.play
|
b.play
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -209,7 +209,7 @@ def pbSEPlay(param, volume = nil, pitch = nil)
|
|||||||
end
|
end
|
||||||
if (RPG.const_defined?(:SE) rescue false)
|
if (RPG.const_defined?(:SE) rescue false)
|
||||||
b = RPG::SE.new(param.name, param.volume, param.pitch)
|
b = RPG::SE.new(param.name, param.volume, param.pitch)
|
||||||
if b&.respond_to?("play")
|
if b.respond_to?("play")
|
||||||
b.play
|
b.play
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -60,10 +60,13 @@ class Battle
|
|||||||
end
|
end
|
||||||
sideCounts.each_with_index do |_count, i|
|
sideCounts.each_with_index do |_count, i|
|
||||||
if !requireds[i] || requireds[i] == 0
|
if !requireds[i] || requireds[i] == 0
|
||||||
raise _INTL("Player-side trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)",
|
if side == 0
|
||||||
i + 1, @sideSizes[0], @sideSizes[1]) if side == 0
|
raise _INTL("Player-side trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)",
|
||||||
raise _INTL("Opposing trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)",
|
i + 1, @sideSizes[0], @sideSizes[1])
|
||||||
i + 1, @sideSizes[0], @sideSizes[1]) if side == 1
|
elsif side == 1
|
||||||
|
raise _INTL("Opposing trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)",
|
||||||
|
i + 1, @sideSizes[0], @sideSizes[1])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
next if requireds[i] <= sideCounts[i] # Trainer has enough Pokémon to fill their positions
|
next if requireds[i] <= sideCounts[i] # Trainer has enough Pokémon to fill their positions
|
||||||
if requireds[i] == 1
|
if requireds[i] == 1
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ class Battle
|
|||||||
end
|
end
|
||||||
# Embargo
|
# Embargo
|
||||||
if battler && battler.effects[PBEffects::Embargo] > 0
|
if battler && battler.effects[PBEffects::Embargo] > 0
|
||||||
scene.pbDisplay(_INTL("Embargo's effect prevents the item's use on {1}!",
|
if showMessages
|
||||||
battler.pbThis(true))) if showMessages
|
scene.pbDisplay(_INTL("Embargo's effect prevents the item's use on {1}!",
|
||||||
|
battler.pbThis(true)))
|
||||||
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -61,8 +61,9 @@ class Battle::Battler
|
|||||||
case @battle.field.terrain
|
case @battle.field.terrain
|
||||||
when :Electric
|
when :Electric
|
||||||
if newStatus == :SLEEP
|
if newStatus == :SLEEP
|
||||||
@battle.pbDisplay(_INTL("{1} surrounds itself with electrified terrain!",
|
if showMessages
|
||||||
pbThis(true))) if showMessages
|
@battle.pbDisplay(_INTL("{1} surrounds itself with electrified terrain!", pbThis(true)))
|
||||||
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
when :Misty
|
when :Misty
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ class Battle::Battler
|
|||||||
end
|
end
|
||||||
# Check the stat stage
|
# Check the stat stage
|
||||||
if statStageAtMax?(stat)
|
if statStageAtMax?(stat)
|
||||||
@battle.pbDisplay(_INTL("{1}'s {2} won't go any higher!",
|
if showFailMsg
|
||||||
pbThis, GameData::Stat.get(stat).name)) if showFailMsg
|
@battle.pbDisplay(_INTL("{1}'s {2} won't go any higher!",
|
||||||
|
pbThis, GameData::Stat.get(stat).name))
|
||||||
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
@@ -162,8 +164,10 @@ class Battle::Battler
|
|||||||
end
|
end
|
||||||
# Check the stat stage
|
# Check the stat stage
|
||||||
if statStageAtMin?(stat)
|
if statStageAtMin?(stat)
|
||||||
@battle.pbDisplay(_INTL("{1}'s {2} won't go any lower!",
|
if showFailMsg
|
||||||
pbThis, GameData::Stat.get(stat).name)) if showFailMsg
|
@battle.pbDisplay(_INTL("{1}'s {2} won't go any lower!",
|
||||||
|
pbThis, GameData::Stat.get(stat).name))
|
||||||
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ class Battle::Battler
|
|||||||
@battle.pbHideAbilitySplash(b) if b.damageState.magicBounce
|
@battle.pbHideAbilitySplash(b) if b.damageState.magicBounce
|
||||||
newChoice = choice.clone
|
newChoice = choice.clone
|
||||||
newChoice[3] = user.index
|
newChoice[3] = user.index
|
||||||
newTargets = pbFindTargets(newChoice ,move, b)
|
newTargets = pbFindTargets(newChoice, move, b)
|
||||||
newTargets = pbChangeTargets(move, b, newTargets)
|
newTargets = pbChangeTargets(move, b, newTargets)
|
||||||
success = false
|
success = false
|
||||||
if !move.pbMoveFailed?(b, newTargets)
|
if !move.pbMoveFailed?(b, newTargets)
|
||||||
|
|||||||
@@ -1358,8 +1358,9 @@ class Battle::Move::StartGravity < Battle::Move
|
|||||||
b.effects[PBEffects::SkyDrop] = -1
|
b.effects[PBEffects::SkyDrop] = -1
|
||||||
showMessage = true
|
showMessage = true
|
||||||
end
|
end
|
||||||
@battle.pbDisplay(_INTL("{1} couldn't stay airborne because of gravity!",
|
if showMessage
|
||||||
b.pbThis)) if showMessage
|
@battle.pbDisplay(_INTL("{1} couldn't stay airborne because of gravity!", b.pbThis))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -607,9 +607,11 @@ class Battle::Move::HealUserDependingOnUserStockpile < Battle::Move
|
|||||||
@battle.pbDisplay(_INTL("{1}'s stockpiled effect wore off!", user.pbThis))
|
@battle.pbDisplay(_INTL("{1}'s stockpiled effect wore off!", user.pbThis))
|
||||||
showAnim = true
|
showAnim = true
|
||||||
if user.effects[PBEffects::StockpileDef] > 0 &&
|
if user.effects[PBEffects::StockpileDef] > 0 &&
|
||||||
user.pbCanLowerStatStage?(:DEFENSE, user, self) && user.pbLowerStatStage(:DEFENSE, user.effects[PBEffects::StockpileDef], user, showAnim)
|
user.pbCanLowerStatStage?(:DEFENSE, user, self)
|
||||||
|
if user.pbLowerStatStage(:DEFENSE, user.effects[PBEffects::StockpileDef], user, showAnim)
|
||||||
showAnim = false
|
showAnim = false
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if user.effects[PBEffects::StockpileSpDef] > 0 &&
|
if user.effects[PBEffects::StockpileSpDef] > 0 &&
|
||||||
user.pbCanLowerStatStage?(:SPECIAL_DEFENSE, user, self)
|
user.pbCanLowerStatStage?(:SPECIAL_DEFENSE, user, self)
|
||||||
user.pbLowerStatStage(:SPECIAL_DEFENSE, user.effects[PBEffects::StockpileSpDef], user, showAnim)
|
user.pbLowerStatStage(:SPECIAL_DEFENSE, user.effects[PBEffects::StockpileSpDef], user, showAnim)
|
||||||
|
|||||||
@@ -255,8 +255,10 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
|
|||||||
else
|
else
|
||||||
s = GameData::Status.get(@battler.status).icon_position
|
s = GameData::Status.get(@battler.status).icon_position
|
||||||
end
|
end
|
||||||
imagePos.push(["Graphics/Pictures/Battle/icon_statuses", @spriteBaseX + 24, 36,
|
if s >= 0
|
||||||
0, s * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT]) if s >= 0
|
imagePos.push(["Graphics/Pictures/Battle/icon_statuses", @spriteBaseX + 24, 36,
|
||||||
|
0, s * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
pbDrawImagePositions(self.bitmap, imagePos)
|
pbDrawImagePositions(self.bitmap, imagePos)
|
||||||
refreshHP
|
refreshHP
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class Battle::Scene::Animation
|
|||||||
def empty?; return @pictureEx.length == 0; end
|
def empty?; return @pictureEx.length == 0; end
|
||||||
def animDone?; return @animDone; end
|
def animDone?; return @animDone; end
|
||||||
|
|
||||||
def addSprite(s, origin = PictureOrigin::TopLeft)
|
def addSprite(s, origin = PictureOrigin::TOP_LEFT)
|
||||||
num = @pictureEx.length
|
num = @pictureEx.length
|
||||||
picture = PictureEx.new(s.z)
|
picture = PictureEx.new(s.z)
|
||||||
picture.x = s.x
|
picture.x = s.x
|
||||||
@@ -31,7 +31,7 @@ class Battle::Scene::Animation
|
|||||||
return picture
|
return picture
|
||||||
end
|
end
|
||||||
|
|
||||||
def addNewSprite(x, y, name, origin = PictureOrigin::TopLeft)
|
def addNewSprite(x, y, name, origin = PictureOrigin::TOP_LEFT)
|
||||||
num = @pictureEx.length
|
num = @pictureEx.length
|
||||||
picture = PictureEx.new(num)
|
picture = PictureEx.new(num)
|
||||||
picture.setXY(0, x, y)
|
picture.setXY(0, x, y)
|
||||||
@@ -87,7 +87,7 @@ module Battle::Scene::Animation::BallAnimationMixin
|
|||||||
|
|
||||||
def addBallSprite(ballX, ballY, poke_ball)
|
def addBallSprite(ballX, ballY, poke_ball)
|
||||||
file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball)
|
file_path = sprintf("Graphics/Battle animations/ball_%s", poke_ball)
|
||||||
ball = addNewSprite(ballX, ballY, file_path, PictureOrigin::Center)
|
ball = addNewSprite(ballX, ballY, file_path, PictureOrigin::CENTER)
|
||||||
@ballSprite = @pictureSprites.last
|
@ballSprite = @pictureSprites.last
|
||||||
if @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
if @ballSprite.bitmap.width >= @ballSprite.bitmap.height
|
||||||
@ballSprite.src_rect.width = @ballSprite.bitmap.height / 2
|
@ballSprite.src_rect.width = @ballSprite.bitmap.height / 2
|
||||||
|
|||||||
@@ -15,26 +15,26 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
|
|||||||
makeSlideSprite("battle_bg2", 0.5, appearTime)
|
makeSlideSprite("battle_bg2", 0.5, appearTime)
|
||||||
end
|
end
|
||||||
# Bases
|
# Bases
|
||||||
makeSlideSprite("base_0", 1, appearTime, PictureOrigin::Bottom)
|
makeSlideSprite("base_0", 1, appearTime, PictureOrigin::BOTTOM)
|
||||||
makeSlideSprite("base_1", -1, appearTime, PictureOrigin::Center)
|
makeSlideSprite("base_1", -1, appearTime, PictureOrigin::CENTER)
|
||||||
# Player sprite, partner trainer sprite
|
# Player sprite, partner trainer sprite
|
||||||
@battle.player.each_with_index do |_p, i|
|
@battle.player.each_with_index do |_p, i|
|
||||||
makeSlideSprite("player_#{i + 1}", 1, appearTime, PictureOrigin::Bottom)
|
makeSlideSprite("player_#{i + 1}", 1, appearTime, PictureOrigin::BOTTOM)
|
||||||
end
|
end
|
||||||
# Opposing trainer sprite(s) or wild Pokémon sprite(s)
|
# Opposing trainer sprite(s) or wild Pokémon sprite(s)
|
||||||
if @battle.trainerBattle?
|
if @battle.trainerBattle?
|
||||||
@battle.opponent.each_with_index do |_p, i|
|
@battle.opponent.each_with_index do |_p, i|
|
||||||
makeSlideSprite("trainer_#{i + 1}", -1, appearTime, PictureOrigin::Bottom)
|
makeSlideSprite("trainer_#{i + 1}", -1, appearTime, PictureOrigin::BOTTOM)
|
||||||
end
|
end
|
||||||
else # Wild battle
|
else # Wild battle
|
||||||
@battle.pbParty(1).each_with_index do |_pkmn, i|
|
@battle.pbParty(1).each_with_index do |_pkmn, i|
|
||||||
idxBattler = (2 * i) + 1
|
idxBattler = (2 * i) + 1
|
||||||
makeSlideSprite("pokemon_#{idxBattler}", -1, appearTime, PictureOrigin::Bottom)
|
makeSlideSprite("pokemon_#{idxBattler}", -1, appearTime, PictureOrigin::BOTTOM)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Shadows
|
# Shadows
|
||||||
@battle.battlers.length.times do |i|
|
@battle.battlers.length.times do |i|
|
||||||
makeSlideSprite("shadow_#{i}", (i.even?) ? 1 : -1, appearTime, PictureOrigin::Center)
|
makeSlideSprite("shadow_#{i}", (i.even?) ? 1 : -1, appearTime, PictureOrigin::CENTER)
|
||||||
end
|
end
|
||||||
# Fading blackness over whole screen
|
# Fading blackness over whole screen
|
||||||
blackScreen = addNewSprite(0, 0, "Graphics/Battle animations/black_screen")
|
blackScreen = addNewSprite(0, 0, "Graphics/Battle animations/black_screen")
|
||||||
@@ -73,7 +73,7 @@ class Battle::Scene::Animation::Intro2 < Battle::Scene::Animation
|
|||||||
@sideSize.times do |i|
|
@sideSize.times do |i|
|
||||||
idxBattler = (2 * i) + 1
|
idxBattler = (2 * i) + 1
|
||||||
next if !@sprites["pokemon_#{idxBattler}"]
|
next if !@sprites["pokemon_#{idxBattler}"]
|
||||||
battler = addSprite(@sprites["pokemon_#{idxBattler}"], PictureOrigin::Bottom)
|
battler = addSprite(@sprites["pokemon_#{idxBattler}"], PictureOrigin::BOTTOM)
|
||||||
battler.moveTone(0, 4, Tone.new(0, 0, 0, 0))
|
battler.moveTone(0, 4, Tone.new(0, 0, 0, 0))
|
||||||
battler.setCallback(10 * i, [@sprites["pokemon_#{idxBattler}"], :pbPlayIntroAnimation])
|
battler.setCallback(10 * i, [@sprites["pokemon_#{idxBattler}"], :pbPlayIntroAnimation])
|
||||||
end
|
end
|
||||||
@@ -279,7 +279,7 @@ class Battle::Scene::Animation::TrainerAppear < Battle::Scene::Animation
|
|||||||
delay = 0
|
delay = 0
|
||||||
# Make old trainer sprite move off-screen first if necessary
|
# Make old trainer sprite move off-screen first if necessary
|
||||||
if @idxTrainer > 0 && @sprites["trainer_#{@idxTrainer}"].visible
|
if @idxTrainer > 0 && @sprites["trainer_#{@idxTrainer}"].visible
|
||||||
oldTrainer = addSprite(@sprites["trainer_#{@idxTrainer}"], PictureOrigin::Bottom)
|
oldTrainer = addSprite(@sprites["trainer_#{@idxTrainer}"], PictureOrigin::BOTTOM)
|
||||||
oldTrainer.moveDelta(delay, 8, Graphics.width / 4, 0)
|
oldTrainer.moveDelta(delay, 8, Graphics.width / 4, 0)
|
||||||
oldTrainer.setVisible(delay + 8, false)
|
oldTrainer.setVisible(delay + 8, false)
|
||||||
delay = oldTrainer.totalDuration
|
delay = oldTrainer.totalDuration
|
||||||
@@ -288,7 +288,7 @@ class Battle::Scene::Animation::TrainerAppear < Battle::Scene::Animation
|
|||||||
if @sprites["trainer_#{@idxTrainer + 1}"]
|
if @sprites["trainer_#{@idxTrainer + 1}"]
|
||||||
trainerX, trainerY = Battle::Scene.pbTrainerPosition(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 = addSprite(@sprites["trainer_#{@idxTrainer + 1}"], PictureOrigin::BOTTOM)
|
||||||
newTrainer.setVisible(delay, true)
|
newTrainer.setVisible(delay, true)
|
||||||
newTrainer.setXY(delay, trainerX, trainerY)
|
newTrainer.setXY(delay, trainerX, trainerY)
|
||||||
newTrainer.moveDelta(delay, 8, -Graphics.width / 4, 0)
|
newTrainer.moveDelta(delay, 8, -Graphics.width / 4, 0)
|
||||||
@@ -318,7 +318,7 @@ class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation
|
|||||||
pl = @sprites[spriteNameBase + "_#{i}"]
|
pl = @sprites[spriteNameBase + "_#{i}"]
|
||||||
i += 1
|
i += 1
|
||||||
next if !pl.visible || pl.x < 0
|
next if !pl.visible || pl.x < 0
|
||||||
trainer = addSprite(pl, PictureOrigin::Bottom)
|
trainer = addSprite(pl, PictureOrigin::BOTTOM)
|
||||||
trainer.moveDelta(0, 16, -Graphics.width / 2, 0)
|
trainer.moveDelta(0, 16, -Graphics.width / 2, 0)
|
||||||
# Animate trainer sprite(s) if they have multiple frames
|
# Animate trainer sprite(s) if they have multiple frames
|
||||||
if pl.bitmap && !pl.bitmap.disposed? && pl.bitmap.width >= pl.bitmap.height * 2
|
if pl.bitmap && !pl.bitmap.disposed? && pl.bitmap.width >= pl.bitmap.height * 2
|
||||||
@@ -371,7 +371,7 @@ class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
|
|||||||
trSprite = @sprites[spriteNameBase + "_#{i}"]
|
trSprite = @sprites[spriteNameBase + "_#{i}"]
|
||||||
i += 1
|
i += 1
|
||||||
next if !trSprite.visible || trSprite.x > Graphics.width
|
next if !trSprite.visible || trSprite.x > Graphics.width
|
||||||
trainer = addSprite(trSprite, PictureOrigin::Bottom)
|
trainer = addSprite(trSprite, PictureOrigin::BOTTOM)
|
||||||
trainer.moveDelta(0, 16, Graphics.width / 2, 0)
|
trainer.moveDelta(0, 16, Graphics.width / 2, 0)
|
||||||
trainer.setVisible(16, false)
|
trainer.setVisible(16, false)
|
||||||
end
|
end
|
||||||
@@ -456,7 +456,7 @@ class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
|
|||||||
ballBurst(delay, battlerStartX, battlerStartY - 18, poke_ball)
|
ballBurst(delay, battlerStartX, battlerStartY - 18, poke_ball)
|
||||||
ball.moveOpacity(delay + 2, 2, 0)
|
ball.moveOpacity(delay + 2, 2, 0)
|
||||||
# Set up battler sprite
|
# Set up battler sprite
|
||||||
battler = addSprite(batSprite, PictureOrigin::Bottom)
|
battler = addSprite(batSprite, PictureOrigin::BOTTOM)
|
||||||
battler.setXY(0, battlerStartX, battlerStartY)
|
battler.setXY(0, battlerStartX, battlerStartY)
|
||||||
battler.setZoom(0, 0)
|
battler.setZoom(0, 0)
|
||||||
battler.setColor(0, col)
|
battler.setColor(0, col)
|
||||||
@@ -464,7 +464,7 @@ class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
|
|||||||
battlerAppear(battler, delay, battlerEndX, battlerEndY, batSprite, col)
|
battlerAppear(battler, delay, battlerEndX, battlerEndY, batSprite, col)
|
||||||
if @shadowVisible
|
if @shadowVisible
|
||||||
# Set up shadow sprite
|
# Set up shadow sprite
|
||||||
shadow = addSprite(shaSprite, PictureOrigin::Center)
|
shadow = addSprite(shaSprite, PictureOrigin::CENTER)
|
||||||
shadow.setOpacity(0, 0)
|
shadow.setOpacity(0, 0)
|
||||||
# Shadow animation
|
# Shadow animation
|
||||||
shadow.setVisible(delay, @shadowVisible)
|
shadow.setVisible(delay, @shadowVisible)
|
||||||
@@ -520,7 +520,7 @@ class Battle::Scene::Animation::PokeballTrainerSendOut < Battle::Scene::Animatio
|
|||||||
ballBurst(delay, battlerStartX, battlerStartY - 18, poke_ball)
|
ballBurst(delay, battlerStartX, battlerStartY - 18, poke_ball)
|
||||||
ball.moveOpacity(delay + 2, 2, 0)
|
ball.moveOpacity(delay + 2, 2, 0)
|
||||||
# Set up battler sprite
|
# Set up battler sprite
|
||||||
battler = addSprite(batSprite, PictureOrigin::Bottom)
|
battler = addSprite(batSprite, PictureOrigin::BOTTOM)
|
||||||
battler.setXY(0, battlerStartX, battlerStartY)
|
battler.setXY(0, battlerStartX, battlerStartY)
|
||||||
battler.setZoom(0, 0)
|
battler.setZoom(0, 0)
|
||||||
battler.setColor(0, col)
|
battler.setColor(0, col)
|
||||||
@@ -528,7 +528,7 @@ class Battle::Scene::Animation::PokeballTrainerSendOut < Battle::Scene::Animatio
|
|||||||
battlerAppear(battler, delay, battlerEndX, battlerEndY, batSprite, col)
|
battlerAppear(battler, delay, battlerEndX, battlerEndY, batSprite, col)
|
||||||
if @shadowVisible
|
if @shadowVisible
|
||||||
# Set up shadow sprite
|
# Set up shadow sprite
|
||||||
shadow = addSprite(shaSprite, PictureOrigin::Center)
|
shadow = addSprite(shaSprite, PictureOrigin::CENTER)
|
||||||
shadow.setOpacity(0, 0)
|
shadow.setOpacity(0, 0)
|
||||||
# Shadow animation
|
# Shadow animation
|
||||||
shadow.setVisible(delay, @shadowVisible)
|
shadow.setVisible(delay, @shadowVisible)
|
||||||
@@ -570,7 +570,7 @@ class Battle::Scene::Animation::BattlerRecall < Battle::Scene::Animation
|
|||||||
battlerEndX = ballPos[0]
|
battlerEndX = ballPos[0]
|
||||||
battlerEndY = ballPos[1]
|
battlerEndY = ballPos[1]
|
||||||
# Set up battler sprite
|
# Set up battler sprite
|
||||||
battler = addSprite(batSprite, PictureOrigin::Bottom)
|
battler = addSprite(batSprite, PictureOrigin::BOTTOM)
|
||||||
battler.setVisible(0, true)
|
battler.setVisible(0, true)
|
||||||
battler.setColor(0, col)
|
battler.setColor(0, col)
|
||||||
# Set up Poké Ball sprite
|
# Set up Poké Ball sprite
|
||||||
@@ -585,7 +585,7 @@ class Battle::Scene::Animation::BattlerRecall < Battle::Scene::Animation
|
|||||||
battlerAbsorb(battler, delay, battlerEndX, battlerEndY, col)
|
battlerAbsorb(battler, delay, battlerEndX, battlerEndY, col)
|
||||||
if shaSprite.visible
|
if shaSprite.visible
|
||||||
# Set up shadow sprite
|
# Set up shadow sprite
|
||||||
shadow = addSprite(shaSprite, PictureOrigin::Center)
|
shadow = addSprite(shaSprite, PictureOrigin::CENTER)
|
||||||
# Shadow animation
|
# Shadow animation
|
||||||
shadow.moveOpacity(0, 10, 0)
|
shadow.moveOpacity(0, 10, 0)
|
||||||
shadow.setVisible(delay, false)
|
shadow.setVisible(delay, false)
|
||||||
@@ -609,8 +609,8 @@ class Battle::Scene::Animation::BattlerDamage < Battle::Scene::Animation
|
|||||||
batSprite = @sprites["pokemon_#{@idxBattler}"]
|
batSprite = @sprites["pokemon_#{@idxBattler}"]
|
||||||
shaSprite = @sprites["shadow_#{@idxBattler}"]
|
shaSprite = @sprites["shadow_#{@idxBattler}"]
|
||||||
# Set up battler/shadow sprite
|
# Set up battler/shadow sprite
|
||||||
battler = addSprite(batSprite, PictureOrigin::Bottom)
|
battler = addSprite(batSprite, PictureOrigin::BOTTOM)
|
||||||
shadow = addSprite(shaSprite, PictureOrigin::Center)
|
shadow = addSprite(shaSprite, PictureOrigin::CENTER)
|
||||||
# Animation
|
# Animation
|
||||||
delay = 0
|
delay = 0
|
||||||
case @effectiveness
|
case @effectiveness
|
||||||
@@ -647,8 +647,8 @@ class Battle::Scene::Animation::BattlerFaint < Battle::Scene::Animation
|
|||||||
batSprite = @sprites["pokemon_#{@idxBattler}"]
|
batSprite = @sprites["pokemon_#{@idxBattler}"]
|
||||||
shaSprite = @sprites["shadow_#{@idxBattler}"]
|
shaSprite = @sprites["shadow_#{@idxBattler}"]
|
||||||
# Set up battler/shadow sprite
|
# Set up battler/shadow sprite
|
||||||
battler = addSprite(batSprite, PictureOrigin::Bottom)
|
battler = addSprite(batSprite, PictureOrigin::BOTTOM)
|
||||||
shadow = addSprite(shaSprite, PictureOrigin::Center)
|
shadow = addSprite(shaSprite, PictureOrigin::CENTER)
|
||||||
# Get approx duration depending on sprite's position/size. Min 20 frames.
|
# Get approx duration depending on sprite's position/size. Min 20 frames.
|
||||||
battlerTop = batSprite.y - batSprite.height
|
battlerTop = batSprite.y - batSprite.height
|
||||||
cropY = Battle::Scene.pbBattlerPosition(@idxBattler, @battle.pbSideSize(@idxBattler))[1]
|
cropY = Battle::Scene.pbBattlerPosition(@idxBattler, @battle.pbSideSize(@idxBattler))[1]
|
||||||
@@ -723,7 +723,7 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
|||||||
@ballSpriteIndex = (@success) ? @tempSprites.length - 1 : -1
|
@ballSpriteIndex = (@success) ? @tempSprites.length - 1 : -1
|
||||||
# Set up trainer sprite (only visible in Safari Zone battles)
|
# Set up trainer sprite (only visible in Safari Zone battles)
|
||||||
if @showingTrainer && traSprite && traSprite.bitmap.width >= traSprite.bitmap.height * 2
|
if @showingTrainer && traSprite && traSprite.bitmap.width >= traSprite.bitmap.height * 2
|
||||||
trainer = addSprite(traSprite, PictureOrigin::Bottom)
|
trainer = addSprite(traSprite, PictureOrigin::BOTTOM)
|
||||||
# Trainer animation
|
# Trainer animation
|
||||||
ballStartX, ballStartY = trainerThrowingFrames(ball, trainer, traSprite)
|
ballStartX, ballStartY = trainerThrowingFrames(ball, trainer, traSprite)
|
||||||
end
|
end
|
||||||
@@ -738,7 +738,7 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
|||||||
delay = ball.totalDuration + 6
|
delay = ball.totalDuration + 6
|
||||||
ballOpenUp(ball, delay, @poke_ball, true, false)
|
ballOpenUp(ball, delay, @poke_ball, true, false)
|
||||||
# Set up battler sprite
|
# Set up battler sprite
|
||||||
battler = addSprite(batSprite, PictureOrigin::Bottom)
|
battler = addSprite(batSprite, PictureOrigin::BOTTOM)
|
||||||
# Poké Ball absorbs battler
|
# Poké Ball absorbs battler
|
||||||
delay = ball.totalDuration
|
delay = ball.totalDuration
|
||||||
ballBurstCapture(delay, ballEndX, ballEndY, @poke_ball)
|
ballBurstCapture(delay, ballEndX, ballEndY, @poke_ball)
|
||||||
@@ -751,7 +751,7 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
|||||||
battler.setVisible(delay + 5, false)
|
battler.setVisible(delay + 5, false)
|
||||||
if @shadowVisible
|
if @shadowVisible
|
||||||
# Set up shadow sprite
|
# Set up shadow sprite
|
||||||
shadow = addSprite(shaSprite, PictureOrigin::Center)
|
shadow = addSprite(shaSprite, PictureOrigin::CENTER)
|
||||||
# Shadow animation
|
# Shadow animation
|
||||||
shadow.moveOpacity(delay, 5, 0)
|
shadow.moveOpacity(delay, 5, 0)
|
||||||
shadow.moveZoom(delay, 5, 0)
|
shadow.moveZoom(delay, 5, 0)
|
||||||
|
|||||||
@@ -391,20 +391,22 @@ class Battle::AI
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if skill >= PBTrainerAI.bestSkill && target.itemActive? && (target.item && !target.item.is_berry?)
|
if skill >= PBTrainerAI.bestSkill &&
|
||||||
Battle::ItemEffects.triggerDamageCalcFromTarget(
|
target.itemActive? && target.item && !target.item.is_berry?
|
||||||
target.item, user, target, move, multipliers, baseDmg, type
|
Battle::ItemEffects.triggerDamageCalcFromTarget(
|
||||||
)
|
target.item, user, target, move, multipliers, baseDmg, type
|
||||||
end
|
)
|
||||||
|
end
|
||||||
# Global abilities
|
# Global abilities
|
||||||
if skill >= PBTrainerAI.mediumSkill && ((@battle.pbCheckGlobalAbility(:DARKAURA) && type == :DARK) ||
|
if skill >= PBTrainerAI.mediumSkill &&
|
||||||
(@battle.pbCheckGlobalAbility(:FAIRYAURA) && type == :FAIRY))
|
((@battle.pbCheckGlobalAbility(:DARKAURA) && type == :DARK) ||
|
||||||
if @battle.pbCheckGlobalAbility(:AURABREAK)
|
(@battle.pbCheckGlobalAbility(:FAIRYAURA) && type == :FAIRY))
|
||||||
multipliers[:base_damage_multiplier] *= 2 / 3.0
|
if @battle.pbCheckGlobalAbility(:AURABREAK)
|
||||||
else
|
multipliers[:base_damage_multiplier] *= 2 / 3.0
|
||||||
multipliers[:base_damage_multiplier] *= 4 / 3.0
|
else
|
||||||
end
|
multipliers[:base_damage_multiplier] *= 4 / 3.0
|
||||||
end
|
end
|
||||||
|
end
|
||||||
# Parental Bond
|
# Parental Bond
|
||||||
if skill >= PBTrainerAI.mediumSkill && user.hasActiveAbility?(:PARENTALBOND)
|
if skill >= PBTrainerAI.mediumSkill && user.hasActiveAbility?(:PARENTALBOND)
|
||||||
multipliers[:base_damage_multiplier] *= 1.25
|
multipliers[:base_damage_multiplier] *= 1.25
|
||||||
@@ -413,9 +415,10 @@ class Battle::AI
|
|||||||
# TODO
|
# TODO
|
||||||
# Helping Hand - n/a
|
# Helping Hand - n/a
|
||||||
# Charge
|
# Charge
|
||||||
if skill >= PBTrainerAI.mediumSkill && (user.effects[PBEffects::Charge] > 0 && type == :ELECTRIC)
|
if skill >= PBTrainerAI.mediumSkill &&
|
||||||
multipliers[:base_damage_multiplier] *= 2
|
user.effects[PBEffects::Charge] > 0 && type == :ELECTRIC
|
||||||
end
|
multipliers[:base_damage_multiplier] *= 2
|
||||||
|
end
|
||||||
# Mud Sport and Water Sport
|
# Mud Sport and Water Sport
|
||||||
if skill >= PBTrainerAI.mediumSkill
|
if skill >= PBTrainerAI.mediumSkill
|
||||||
if type == :ELECTRIC
|
if type == :ELECTRIC
|
||||||
@@ -450,16 +453,16 @@ class Battle::AI
|
|||||||
end
|
end
|
||||||
# Badge multipliers
|
# Badge multipliers
|
||||||
if skill >= PBTrainerAI.highSkill && @battle.internalBattle && target.pbOwnedByPlayer?
|
if skill >= PBTrainerAI.highSkill && @battle.internalBattle && target.pbOwnedByPlayer?
|
||||||
if move.physicalMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_DEFENSE
|
if move.physicalMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_DEFENSE
|
||||||
multipliers[:defense_multiplier] *= 1.1
|
multipliers[:defense_multiplier] *= 1.1
|
||||||
elsif move.specialMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPDEF
|
elsif move.specialMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPDEF
|
||||||
multipliers[:defense_multiplier] *= 1.1
|
multipliers[:defense_multiplier] *= 1.1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Multi-targeting attacks
|
# Multi-targeting attacks
|
||||||
if skill >= PBTrainerAI.highSkill && pbTargetsMultiple?(move, user)
|
if skill >= PBTrainerAI.highSkill && pbTargetsMultiple?(move, user)
|
||||||
multipliers[:final_damage_multiplier] *= 0.75
|
multipliers[:final_damage_multiplier] *= 0.75
|
||||||
end
|
end
|
||||||
# Weather
|
# Weather
|
||||||
if skill >= PBTrainerAI.mediumSkill
|
if skill >= PBTrainerAI.mediumSkill
|
||||||
case user.effectiveWeather
|
case user.effectiveWeather
|
||||||
@@ -487,50 +490,51 @@ class Battle::AI
|
|||||||
# Critical hits - n/a
|
# Critical hits - n/a
|
||||||
# Random variance - n/a
|
# Random variance - n/a
|
||||||
# STAB
|
# STAB
|
||||||
if skill >= PBTrainerAI.mediumSkill && (type && user.pbHasType?(type))
|
if skill >= PBTrainerAI.mediumSkill && type && user.pbHasType?(type)
|
||||||
if user.hasActiveAbility?(:ADAPTABILITY)
|
if user.hasActiveAbility?(:ADAPTABILITY)
|
||||||
multipliers[:final_damage_multiplier] *= 2
|
multipliers[:final_damage_multiplier] *= 2
|
||||||
else
|
else
|
||||||
multipliers[:final_damage_multiplier] *= 1.5
|
multipliers[:final_damage_multiplier] *= 1.5
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
# Type effectiveness
|
# Type effectiveness
|
||||||
if skill >= PBTrainerAI.mediumSkill
|
if skill >= PBTrainerAI.mediumSkill
|
||||||
typemod = pbCalcTypeMod(type, user, target)
|
typemod = pbCalcTypeMod(type, user, target)
|
||||||
multipliers[:final_damage_multiplier] *= typemod.to_f / Effectiveness::NORMAL_EFFECTIVE
|
multipliers[:final_damage_multiplier] *= typemod.to_f / Effectiveness::NORMAL_EFFECTIVE
|
||||||
end
|
end
|
||||||
# Burn
|
# Burn
|
||||||
if skill >= PBTrainerAI.highSkill && (user.status == :BURN && move.physicalMove?(type) &&
|
if skill >= PBTrainerAI.highSkill && move.physicalMove?(type) &&
|
||||||
!user.hasActiveAbility?(:GUTS) &&
|
user.status == :BURN && !user.hasActiveAbility?(:GUTS) &&
|
||||||
!(Settings::MECHANICS_GENERATION >= 6 && move.function == "DoublePowerIfUserPoisonedBurnedParalyzed")) # Facade
|
!(Settings::MECHANICS_GENERATION >= 6 &&
|
||||||
multipliers[:final_damage_multiplier] /= 2
|
move.function == "DoublePowerIfUserPoisonedBurnedParalyzed") # Facade
|
||||||
end
|
multipliers[:final_damage_multiplier] /= 2
|
||||||
|
end
|
||||||
# Aurora Veil, Reflect, Light Screen
|
# Aurora Veil, Reflect, Light Screen
|
||||||
if skill >= PBTrainerAI.highSkill && (!move.ignoresReflect? && !user.hasActiveAbility?(:INFILTRATOR))
|
if skill >= PBTrainerAI.highSkill && !move.ignoresReflect? && !user.hasActiveAbility?(:INFILTRATOR)
|
||||||
if target.pbOwnSide.effects[PBEffects::AuroraVeil] > 0
|
if target.pbOwnSide.effects[PBEffects::AuroraVeil] > 0
|
||||||
if @battle.pbSideBattlerCount(target) > 1
|
if @battle.pbSideBattlerCount(target) > 1
|
||||||
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
||||||
else
|
else
|
||||||
multipliers[:final_damage_multiplier] /= 2
|
multipliers[:final_damage_multiplier] /= 2
|
||||||
end
|
end
|
||||||
elsif target.pbOwnSide.effects[PBEffects::Reflect] > 0 && move.physicalMove?(type)
|
elsif target.pbOwnSide.effects[PBEffects::Reflect] > 0 && move.physicalMove?(type)
|
||||||
if @battle.pbSideBattlerCount(target) > 1
|
if @battle.pbSideBattlerCount(target) > 1
|
||||||
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
||||||
else
|
else
|
||||||
multipliers[:final_damage_multiplier] /= 2
|
multipliers[:final_damage_multiplier] /= 2
|
||||||
end
|
end
|
||||||
elsif target.pbOwnSide.effects[PBEffects::LightScreen] > 0 && move.specialMove?(type)
|
elsif target.pbOwnSide.effects[PBEffects::LightScreen] > 0 && move.specialMove?(type)
|
||||||
if @battle.pbSideBattlerCount(target) > 1
|
if @battle.pbSideBattlerCount(target) > 1
|
||||||
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
||||||
else
|
else
|
||||||
multipliers[:final_damage_multiplier] /= 2
|
multipliers[:final_damage_multiplier] /= 2
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
# Minimize
|
# Minimize
|
||||||
if skill >= PBTrainerAI.highSkill && (target.effects[PBEffects::Minimize] && move.tramplesMinimize?(2))
|
if skill >= PBTrainerAI.highSkill && (target.effects[PBEffects::Minimize] && move.tramplesMinimize?(2))
|
||||||
multipliers[:final_damage_multiplier] *= 2
|
multipliers[:final_damage_multiplier] *= 2
|
||||||
end
|
end
|
||||||
# Move-specific base damage modifiers
|
# Move-specific base damage modifiers
|
||||||
# TODO
|
# TODO
|
||||||
# Move-specific final damage modifiers
|
# Move-specific final damage modifiers
|
||||||
@@ -549,16 +553,16 @@ class Battle::AI
|
|||||||
if c >= 0 && user.abilityActive?
|
if c >= 0 && user.abilityActive?
|
||||||
c = Battle::AbilityEffects.triggerCriticalCalcFromUser(user.ability, user, target, c)
|
c = Battle::AbilityEffects.triggerCriticalCalcFromUser(user.ability, user, target, c)
|
||||||
end
|
end
|
||||||
if skill >= PBTrainerAI.bestSkill && (c >= 0 && !moldBreaker && target.abilityActive?)
|
if skill >= PBTrainerAI.bestSkill && c >= 0 && !moldBreaker && target.abilityActive?
|
||||||
c = Battle::AbilityEffects.triggerCriticalCalcFromTarget(target.ability, user, target, c)
|
c = Battle::AbilityEffects.triggerCriticalCalcFromTarget(target.ability, user, target, c)
|
||||||
end
|
end
|
||||||
# Item effects that alter critical hit rate
|
# Item effects that alter critical hit rate
|
||||||
if c >= 0 && user.itemActive?
|
if c >= 0 && user.itemActive?
|
||||||
c = Battle::ItemEffects.triggerCriticalCalcFromUser(user.item, user, target, c)
|
c = Battle::ItemEffects.triggerCriticalCalcFromUser(user.item, user, target, c)
|
||||||
end
|
end
|
||||||
if skill >= PBTrainerAI.bestSkill && (c >= 0 && target.itemActive?)
|
if skill >= PBTrainerAI.bestSkill && c >= 0 && target.itemActive?
|
||||||
c = Battle::ItemEffects.triggerCriticalCalcFromTarget(target.item, user, target, c)
|
c = Battle::ItemEffects.triggerCriticalCalcFromTarget(target.item, user, target, c)
|
||||||
end
|
end
|
||||||
# Other efffects
|
# Other efffects
|
||||||
c = -1 if target.pbOwnSide.effects[PBEffects::LuckyChant] > 0
|
c = -1 if target.pbOwnSide.effects[PBEffects::LuckyChant] > 0
|
||||||
if c >= 0
|
if c >= 0
|
||||||
@@ -632,22 +636,22 @@ class Battle::AI
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if skill >= PBTrainerAI.bestSkill && (target.abilityActive? && !moldBreaker)
|
if skill >= PBTrainerAI.bestSkill && target.abilityActive? && !moldBreaker
|
||||||
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
|
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
|
||||||
target.ability, modifiers, user, target, move, type
|
target.ability, modifiers, user, target, move, type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
# Item effects that alter accuracy calculation
|
# Item effects that alter accuracy calculation
|
||||||
if skill >= PBTrainerAI.mediumSkill && user.itemActive?
|
if skill >= PBTrainerAI.mediumSkill && user.itemActive?
|
||||||
Battle::ItemEffects.triggerAccuracyCalcFromUser(
|
Battle::ItemEffects.triggerAccuracyCalcFromUser(
|
||||||
user.item, modifiers, user, target, move, type
|
user.item, modifiers, user, target, move, type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if skill >= PBTrainerAI.bestSkill && target.itemActive?
|
if skill >= PBTrainerAI.bestSkill && target.itemActive?
|
||||||
Battle::ItemEffects.triggerAccuracyCalcFromTarget(
|
Battle::ItemEffects.triggerAccuracyCalcFromTarget(
|
||||||
target.item, modifiers, user, target, move, type
|
target.item, modifiers, user, target, move, type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to specific values
|
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to specific values
|
||||||
if skill >= PBTrainerAI.mediumSkill
|
if skill >= PBTrainerAI.mediumSkill
|
||||||
if @battle.field.effects[PBEffects::Gravity] > 0
|
if @battle.field.effects[PBEffects::Gravity] > 0
|
||||||
@@ -666,8 +670,8 @@ class Battle::AI
|
|||||||
user.effects[PBEffects::LockOnPos] == target.index
|
user.effects[PBEffects::LockOnPos] == target.index
|
||||||
end
|
end
|
||||||
if skill >= PBTrainerAI.highSkill
|
if skill >= PBTrainerAI.highSkill
|
||||||
if move.function == "BadPoisonTarget" && (Settings::MORE_TYPE_EFFECTS && move.statusMove? &&
|
if move.function == "BadPoisonTarget" && # Toxic
|
||||||
user.pbHasType?(:POISON)) # Toxic
|
Settings::MORE_TYPE_EFFECTS && move.statusMove? && user.pbHasType?(:POISON)
|
||||||
modifiers[:base_accuracy] = 0
|
modifiers[:base_accuracy] = 0
|
||||||
end
|
end
|
||||||
if ["OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"].include?(move.function)
|
if ["OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"].include?(move.function)
|
||||||
|
|||||||
@@ -499,8 +499,8 @@ class PBAnimation < Array
|
|||||||
pbSEPlay(name, i.volume, i.pitch) if name
|
pbSEPlay(name, i.volume, i.pitch) if name
|
||||||
end
|
end
|
||||||
# if sprite
|
# if sprite
|
||||||
# sprite.flash(i.flashColor,i.flashDuration*2) if i.flashScope==1
|
# sprite.flash(i.flashColor, i.flashDuration * 2) if i.flashScope == 1
|
||||||
# sprite.flash(nil,i.flashDuration*2) if i.flashScope==3
|
# sprite.flash(nil, i.flashDuration * 2) if i.flashScope == 3
|
||||||
# end
|
# end
|
||||||
when 1 # Set background graphic (immediate)
|
when 1 # Set background graphic (immediate)
|
||||||
if i.name && i.name != ""
|
if i.name && i.name != ""
|
||||||
@@ -509,12 +509,12 @@ class PBAnimation < Array
|
|||||||
bgGraphic.oy = -i.bgY || 0
|
bgGraphic.oy = -i.bgY || 0
|
||||||
bgGraphic.color = Color.new(i.colorRed || 0, i.colorGreen || 0, i.colorBlue || 0, i.colorAlpha || 0)
|
bgGraphic.color = Color.new(i.colorRed || 0, i.colorGreen || 0, i.colorBlue || 0, i.colorAlpha || 0)
|
||||||
bgGraphic.opacity = i.opacity || 0
|
bgGraphic.opacity = i.opacity || 0
|
||||||
bgColor.opacity = 0
|
bgColor.opacity = 0
|
||||||
else
|
else
|
||||||
bgGraphic.setBitmap(nil)
|
bgGraphic.setBitmap(nil)
|
||||||
bgGraphic.opacity = 0
|
bgGraphic.opacity = 0
|
||||||
bgColor.color = Color.new(i.colorRed || 0, i.colorGreen || 0, i.colorBlue || 0, i.colorAlpha || 0)
|
bgColor.color = Color.new(i.colorRed || 0, i.colorGreen || 0, i.colorBlue || 0, i.colorAlpha || 0)
|
||||||
bgColor.opacity = i.opacity || 0
|
bgColor.opacity = i.opacity || 0
|
||||||
end
|
end
|
||||||
when 2 # Move/recolour background graphic
|
when 2 # Move/recolour background graphic
|
||||||
if bgGraphic.bitmap.nil?
|
if bgGraphic.bitmap.nil?
|
||||||
@@ -535,12 +535,12 @@ class PBAnimation < Array
|
|||||||
foGraphic.oy = -i.bgY || 0
|
foGraphic.oy = -i.bgY || 0
|
||||||
foGraphic.color = Color.new(i.colorRed || 0, i.colorGreen || 0, i.colorBlue || 0, i.colorAlpha || 0)
|
foGraphic.color = Color.new(i.colorRed || 0, i.colorGreen || 0, i.colorBlue || 0, i.colorAlpha || 0)
|
||||||
foGraphic.opacity = i.opacity || 0
|
foGraphic.opacity = i.opacity || 0
|
||||||
foColor.opacity = 0
|
foColor.opacity = 0
|
||||||
else
|
else
|
||||||
foGraphic.setBitmap(nil)
|
foGraphic.setBitmap(nil)
|
||||||
foGraphic.opacity = 0
|
foGraphic.opacity = 0
|
||||||
foColor.color = Color.new(i.colorRed || 0, i.colorGreen || 0, i.colorBlue || 0, i.colorAlpha || 0)
|
foColor.color = Color.new(i.colorRed || 0, i.colorGreen || 0, i.colorBlue || 0, i.colorAlpha || 0)
|
||||||
foColor.opacity = i.opacity || 0
|
foColor.opacity = i.opacity || 0
|
||||||
end
|
end
|
||||||
when 4 # Move/recolour foreground graphic
|
when 4 # Move/recolour foreground graphic
|
||||||
if foGraphic.bitmap.nil?
|
if foGraphic.bitmap.nil?
|
||||||
@@ -563,12 +563,12 @@ class PBAnimation < Array
|
|||||||
next if frame < i.frame || frame > i.frame + i.duration
|
next if frame < i.frame || frame > i.frame + i.duration
|
||||||
fraction = (frame - i.frame).to_f / i.duration
|
fraction = (frame - i.frame).to_f / i.duration
|
||||||
if bgGraphic.bitmap.nil?
|
if bgGraphic.bitmap.nil?
|
||||||
bgColor.opacity = oldbg[2] + ((i.opacity - oldbg[2]) * fraction) if i.opacity != nil
|
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
|
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
|
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
|
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
|
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + ((i.colorAlpha - oldbg[3].alpha) * fraction) : oldbg[3].alpha
|
||||||
bgColor.color = Color.new(cr, cg, cb, ca)
|
bgColor.color = Color.new(cr, cg, cb, ca)
|
||||||
else
|
else
|
||||||
bgGraphic.ox = oldbg[0] - ((i.bgX - oldbg[0]) * fraction) if i.bgX != 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.oy = oldbg[1] - ((i.bgY - oldbg[1]) * fraction) if i.bgY != nil
|
||||||
@@ -577,14 +577,14 @@ class PBAnimation < Array
|
|||||||
cg = (i.colorGreen != nil) ? oldbg[3].green + ((i.colorGreen - oldbg[3].green) * fraction) : oldbg[3].green
|
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
|
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
|
ca = (i.colorAlpha != nil) ? oldbg[3].alpha + ((i.colorAlpha - oldbg[3].alpha) * fraction) : oldbg[3].alpha
|
||||||
bgGraphic.color = Color.new(cr, cg, cb, ca)
|
bgGraphic.color = Color.new(cr, cg, cb, ca)
|
||||||
end
|
end
|
||||||
when 4
|
when 4
|
||||||
next if !i.duration || i.duration <= 0
|
next if !i.duration || i.duration <= 0
|
||||||
next if frame < i.frame || frame > i.frame + i.duration
|
next if frame < i.frame || frame > i.frame + i.duration
|
||||||
fraction = (frame - i.frame).to_f / i.duration
|
fraction = (frame - i.frame).to_f / i.duration
|
||||||
if foGraphic.bitmap.nil?
|
if foGraphic.bitmap.nil?
|
||||||
foColor.opacity = oldfo[2] + ((i.opacity - oldfo[2]) * fraction) if i.opacity != nil
|
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
|
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
|
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
|
cb = (i.colorBlue != nil) ? oldfo[3].blue + ((i.colorBlue - oldfo[3].blue) * fraction) : oldfo[3].blue
|
||||||
@@ -598,7 +598,7 @@ class PBAnimation < Array
|
|||||||
cg = (i.colorGreen != nil) ? oldfo[3].green + ((i.colorGreen - oldfo[3].green) * fraction) : oldfo[3].green
|
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
|
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
|
ca = (i.colorAlpha != nil) ? oldfo[3].alpha + ((i.colorAlpha - oldfo[3].alpha) * fraction) : oldfo[3].alpha
|
||||||
foGraphic.color = Color.new(cr, cg, cb, ca)
|
foGraphic.color = Color.new(cr, cg, cb, ca)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -119,10 +119,10 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
|
|||||||
ballEndX = ballPos[0] - 40
|
ballEndX = ballPos[0] - 40
|
||||||
ballEndY = ballPos[1] - 4
|
ballEndY = ballPos[1] - 4
|
||||||
# Set up trainer sprite
|
# Set up trainer sprite
|
||||||
trainer = addSprite(traSprite, PictureOrigin::Bottom)
|
trainer = addSprite(traSprite, PictureOrigin::BOTTOM)
|
||||||
# Set up bait sprite
|
# Set up bait sprite
|
||||||
ball = addNewSprite(ballStartX, ballStartY,
|
ball = addNewSprite(ballStartX, ballStartY,
|
||||||
"Graphics/Battle animations/safari_bait", PictureOrigin::Center)
|
"Graphics/Battle animations/safari_bait", PictureOrigin::CENTER)
|
||||||
ball.setZ(0, batSprite.z + 1)
|
ball.setZ(0, batSprite.z + 1)
|
||||||
# Trainer animation
|
# Trainer animation
|
||||||
if traSprite.bitmap.width >= traSprite.bitmap.height * 2
|
if traSprite.bitmap.width >= traSprite.bitmap.height * 2
|
||||||
@@ -138,7 +138,7 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
|
|||||||
ball.moveOpacity(delay + 8, 2, 0)
|
ball.moveOpacity(delay + 8, 2, 0)
|
||||||
ball.setVisible(delay + 10, false)
|
ball.setVisible(delay + 10, false)
|
||||||
# Set up battler sprite
|
# Set up battler sprite
|
||||||
battler = addSprite(batSprite, PictureOrigin::Bottom)
|
battler = addSprite(batSprite, PictureOrigin::BOTTOM)
|
||||||
# Show Pokémon jumping before eating the bait
|
# Show Pokémon jumping before eating the bait
|
||||||
delay = ball.totalDuration + 3
|
delay = ball.totalDuration + 3
|
||||||
2.times do
|
2.times do
|
||||||
@@ -184,10 +184,10 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
|
|||||||
ballEndX = batSprite.x
|
ballEndX = batSprite.x
|
||||||
ballEndY = batSprite.y - (batSprite.bitmap.height / 2)
|
ballEndY = batSprite.y - (batSprite.bitmap.height / 2)
|
||||||
# Set up trainer sprite
|
# Set up trainer sprite
|
||||||
trainer = addSprite(traSprite, PictureOrigin::Bottom)
|
trainer = addSprite(traSprite, PictureOrigin::BOTTOM)
|
||||||
# Set up bait sprite
|
# Set up bait sprite
|
||||||
ball = addNewSprite(ballStartX, ballStartY,
|
ball = addNewSprite(ballStartX, ballStartY,
|
||||||
"Graphics/Battle animations/safari_rock", PictureOrigin::Center)
|
"Graphics/Battle animations/safari_rock", PictureOrigin::CENTER)
|
||||||
ball.setZ(0, batSprite.z + 1)
|
ball.setZ(0, batSprite.z + 1)
|
||||||
# Trainer animation
|
# Trainer animation
|
||||||
if traSprite.bitmap.width >= traSprite.bitmap.height * 2
|
if traSprite.bitmap.width >= traSprite.bitmap.height * 2
|
||||||
@@ -205,7 +205,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
|
|||||||
ball.setVisible(delay + 4, false)
|
ball.setVisible(delay + 4, false)
|
||||||
# Set up anger sprite
|
# Set up anger sprite
|
||||||
anger = addNewSprite(ballEndX - 42, ballEndY - 36,
|
anger = addNewSprite(ballEndX - 42, ballEndY - 36,
|
||||||
"Graphics/Battle animations/safari_anger", PictureOrigin::Center)
|
"Graphics/Battle animations/safari_anger", PictureOrigin::CENTER)
|
||||||
anger.setVisible(0, false)
|
anger.setVisible(0, false)
|
||||||
anger.setZ(0, batSprite.z + 1)
|
anger.setZ(0, batSprite.z + 1)
|
||||||
# Show anger appearing
|
# Show anger appearing
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ def pbHiddenMoveAnimation(pokemon)
|
|||||||
bg = Sprite.new(viewport)
|
bg = Sprite.new(viewport)
|
||||||
bg.bitmap = RPG::Cache.picture("hiddenMovebg")
|
bg.bitmap = RPG::Cache.picture("hiddenMovebg")
|
||||||
sprite = PokemonSprite.new(viewport)
|
sprite = PokemonSprite.new(viewport)
|
||||||
sprite.setOffset(PictureOrigin::Center)
|
sprite.setOffset(PictureOrigin::CENTER)
|
||||||
sprite.setPokemonBitmap(pokemon)
|
sprite.setPokemonBitmap(pokemon)
|
||||||
sprite.z = 1
|
sprite.z = 1
|
||||||
sprite.visible = false
|
sprite.visible = false
|
||||||
|
|||||||
@@ -42,27 +42,27 @@ class ItemIconSprite < SpriteWrapper
|
|||||||
@forceitemchange = false
|
@forceitemchange = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def setOffset(offset = PictureOrigin::Center)
|
def setOffset(offset = PictureOrigin::CENTER)
|
||||||
@offset = offset
|
@offset = offset
|
||||||
changeOrigin
|
changeOrigin
|
||||||
end
|
end
|
||||||
|
|
||||||
def changeOrigin
|
def changeOrigin
|
||||||
@offset = PictureOrigin::Center if !@offset
|
@offset = PictureOrigin::CENTER if !@offset
|
||||||
case @offset
|
case @offset
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Top, PictureOrigin::TopRight
|
when PictureOrigin::TOP_LEFT, PictureOrigin::TOP, PictureOrigin::TOP_RIGHT
|
||||||
self.oy = 0
|
self.oy = 0
|
||||||
when PictureOrigin::Left, PictureOrigin::Center, PictureOrigin::Right
|
when PictureOrigin::LEFT, PictureOrigin::CENTER, PictureOrigin::RIGHT
|
||||||
self.oy = self.height / 2
|
self.oy = self.height / 2
|
||||||
when PictureOrigin::BottomLeft, PictureOrigin::Bottom, PictureOrigin::BottomRight
|
when PictureOrigin::BOTTOM_LEFT, PictureOrigin::BOTTOM, PictureOrigin::BOTTOM_RIGHT
|
||||||
self.oy = self.height
|
self.oy = self.height
|
||||||
end
|
end
|
||||||
case @offset
|
case @offset
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Left, PictureOrigin::BottomLeft
|
when PictureOrigin::TOP_LEFT, PictureOrigin::LEFT, PictureOrigin::BOTTOM_LEFT
|
||||||
self.ox = 0
|
self.ox = 0
|
||||||
when PictureOrigin::Top, PictureOrigin::Center, PictureOrigin::Bottom
|
when PictureOrigin::TOP, PictureOrigin::CENTER, PictureOrigin::BOTTOM
|
||||||
self.ox = self.width / 2
|
self.ox = self.width / 2
|
||||||
when PictureOrigin::TopRight, PictureOrigin::Right, PictureOrigin::BottomRight
|
when PictureOrigin::TOP_RIGHT, PictureOrigin::RIGHT, PictureOrigin::BOTTOM_RIGHT
|
||||||
self.ox = self.width
|
self.ox = self.width
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,28 +20,28 @@ class PokemonSprite < SpriteWrapper
|
|||||||
self.bitmap = nil
|
self.bitmap = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def setOffset(offset = PictureOrigin::Center)
|
def setOffset(offset = PictureOrigin::CENTER)
|
||||||
@offset = offset
|
@offset = offset
|
||||||
changeOrigin
|
changeOrigin
|
||||||
end
|
end
|
||||||
|
|
||||||
def changeOrigin
|
def changeOrigin
|
||||||
return if !self.bitmap
|
return if !self.bitmap
|
||||||
@offset = PictureOrigin::Center if !@offset
|
@offset = PictureOrigin::CENTER if !@offset
|
||||||
case @offset
|
case @offset
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Left, PictureOrigin::BottomLeft
|
when PictureOrigin::TOP_LEFT, PictureOrigin::LEFT, PictureOrigin::BOTTOM_LEFT
|
||||||
self.ox = 0
|
self.ox = 0
|
||||||
when PictureOrigin::Top, PictureOrigin::Center, PictureOrigin::Bottom
|
when PictureOrigin::TOP, PictureOrigin::CENTER, PictureOrigin::BOTTOM
|
||||||
self.ox = self.bitmap.width / 2
|
self.ox = self.bitmap.width / 2
|
||||||
when PictureOrigin::TopRight, PictureOrigin::Right, PictureOrigin::BottomRight
|
when PictureOrigin::TOP_RIGHT, PictureOrigin::RIGHT, PictureOrigin::BOTTOM_RIGHT
|
||||||
self.ox = self.bitmap.width
|
self.ox = self.bitmap.width
|
||||||
end
|
end
|
||||||
case @offset
|
case @offset
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Top, PictureOrigin::TopRight
|
when PictureOrigin::TOP_LEFT, PictureOrigin::TOP, PictureOrigin::TOP_RIGHT
|
||||||
self.oy = 0
|
self.oy = 0
|
||||||
when PictureOrigin::Left, PictureOrigin::Center, PictureOrigin::Right
|
when PictureOrigin::LEFT, PictureOrigin::CENTER, PictureOrigin::RIGHT
|
||||||
self.oy = self.bitmap.height / 2
|
self.oy = self.bitmap.height / 2
|
||||||
when PictureOrigin::BottomLeft, PictureOrigin::Bottom, PictureOrigin::BottomRight
|
when PictureOrigin::BOTTOM_LEFT, PictureOrigin::BOTTOM, PictureOrigin::BOTTOM_RIGHT
|
||||||
self.oy = self.bitmap.height
|
self.oy = self.bitmap.height
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -138,30 +138,30 @@ class PokemonIconSprite < SpriteWrapper
|
|||||||
changeOrigin
|
changeOrigin
|
||||||
end
|
end
|
||||||
|
|
||||||
def setOffset(offset = PictureOrigin::Center)
|
def setOffset(offset = PictureOrigin::CENTER)
|
||||||
@offset = offset
|
@offset = offset
|
||||||
changeOrigin
|
changeOrigin
|
||||||
end
|
end
|
||||||
|
|
||||||
def changeOrigin
|
def changeOrigin
|
||||||
return if !self.bitmap
|
return if !self.bitmap
|
||||||
@offset = PictureOrigin::TopLeft if !@offset
|
@offset = PictureOrigin::TOP_LEFT if !@offset
|
||||||
case @offset
|
case @offset
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Left, PictureOrigin::BottomLeft
|
when PictureOrigin::TOP_LEFT, PictureOrigin::LEFT, PictureOrigin::BOTTOM_LEFT
|
||||||
self.ox = 0
|
self.ox = 0
|
||||||
when PictureOrigin::Top, PictureOrigin::Center, PictureOrigin::Bottom
|
when PictureOrigin::TOP, PictureOrigin::CENTER, PictureOrigin::BOTTOM
|
||||||
self.ox = self.src_rect.width / 2
|
self.ox = self.src_rect.width / 2
|
||||||
when PictureOrigin::TopRight, PictureOrigin::Right, PictureOrigin::BottomRight
|
when PictureOrigin::TOP_RIGHT, PictureOrigin::RIGHT, PictureOrigin::BOTTOM_RIGHT
|
||||||
self.ox = self.src_rect.width
|
self.ox = self.src_rect.width
|
||||||
end
|
end
|
||||||
case @offset
|
case @offset
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Top, PictureOrigin::TopRight
|
when PictureOrigin::TOP_LEFT, PictureOrigin::TOP, PictureOrigin::TOP_RIGHT
|
||||||
self.oy = 0
|
self.oy = 0
|
||||||
when PictureOrigin::Left, PictureOrigin::Center, PictureOrigin::Right
|
when PictureOrigin::LEFT, PictureOrigin::CENTER, PictureOrigin::RIGHT
|
||||||
# NOTE: This assumes the top quarter of the icon is blank, so oy is placed
|
# NOTE: This assumes the top quarter of the icon is blank, so oy is placed
|
||||||
# in the middle of the lower three quarters of the image.
|
# in the middle of the lower three quarters of the image.
|
||||||
self.oy = self.src_rect.height * 5 / 8
|
self.oy = self.src_rect.height * 5 / 8
|
||||||
when PictureOrigin::BottomLeft, PictureOrigin::Bottom, PictureOrigin::BottomRight
|
when PictureOrigin::BOTTOM_LEFT, PictureOrigin::BOTTOM, PictureOrigin::BOTTOM_RIGHT
|
||||||
self.oy = self.src_rect.height
|
self.oy = self.src_rect.height
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -268,30 +268,30 @@ class PokemonSpeciesIconSprite < SpriteWrapper
|
|||||||
refresh
|
refresh
|
||||||
end
|
end
|
||||||
|
|
||||||
def setOffset(offset = PictureOrigin::Center)
|
def setOffset(offset = PictureOrigin::CENTER)
|
||||||
@offset = offset
|
@offset = offset
|
||||||
changeOrigin
|
changeOrigin
|
||||||
end
|
end
|
||||||
|
|
||||||
def changeOrigin
|
def changeOrigin
|
||||||
return if !self.bitmap
|
return if !self.bitmap
|
||||||
@offset = PictureOrigin::TopLeft if !@offset
|
@offset = PictureOrigin::TOP_LEFT if !@offset
|
||||||
case @offset
|
case @offset
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Left, PictureOrigin::BottomLeft
|
when PictureOrigin::TOP_LEFT, PictureOrigin::LEFT, PictureOrigin::BOTTOM_LEFT
|
||||||
self.ox = 0
|
self.ox = 0
|
||||||
when PictureOrigin::Top, PictureOrigin::Center, PictureOrigin::Bottom
|
when PictureOrigin::TOP, PictureOrigin::CENTER, PictureOrigin::BOTTOM
|
||||||
self.ox = self.src_rect.width / 2
|
self.ox = self.src_rect.width / 2
|
||||||
when PictureOrigin::TopRight, PictureOrigin::Right, PictureOrigin::BottomRight
|
when PictureOrigin::TOP_RIGHT, PictureOrigin::RIGHT, PictureOrigin::BOTTOM_RIGHT
|
||||||
self.ox = self.src_rect.width
|
self.ox = self.src_rect.width
|
||||||
end
|
end
|
||||||
case @offset
|
case @offset
|
||||||
when PictureOrigin::TopLeft, PictureOrigin::Top, PictureOrigin::TopRight
|
when PictureOrigin::TOP_LEFT, PictureOrigin::TOP, PictureOrigin::TOP_RIGHT
|
||||||
self.oy = 0
|
self.oy = 0
|
||||||
when PictureOrigin::Left, PictureOrigin::Center, PictureOrigin::Right
|
when PictureOrigin::LEFT, PictureOrigin::CENTER, PictureOrigin::RIGHT
|
||||||
# NOTE: This assumes the top quarter of the icon is blank, so oy is placed
|
# NOTE: This assumes the top quarter of the icon is blank, so oy is placed
|
||||||
# in the middle of the lower three quarters of the image.
|
# in the middle of the lower three quarters of the image.
|
||||||
self.oy = self.src_rect.height * 5 / 8
|
self.oy = self.src_rect.height * 5 / 8
|
||||||
when PictureOrigin::BottomLeft, PictureOrigin::Bottom, PictureOrigin::BottomRight
|
when PictureOrigin::BOTTOM_LEFT, PictureOrigin::BOTTOM, PictureOrigin::BOTTOM_RIGHT
|
||||||
self.oy = self.src_rect.height
|
self.oy = self.src_rect.height
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class Pokemon
|
|||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
str = super.chop
|
str = super.chop
|
||||||
str << format(' %s Lv.%s>', @species, @level.to_s || '???')
|
str << sprintf(' %s Lv.%s>', @species, @level.to_s || '???')
|
||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class Trainer
|
|||||||
def inspect
|
def inspect
|
||||||
str = super.chop
|
str = super.chop
|
||||||
party_str = @party.map { |p| p.species_data.species }.inspect
|
party_str = @party.map { |p| p.species_data.species }.inspect
|
||||||
str << format(' %s @party=%s>', self.full_name, party_str)
|
str << sprintf(' %s @party=%s>', self.full_name, party_str)
|
||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class Player < Trainer
|
|||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
str = super.chop
|
str = super.chop
|
||||||
str << format(' seen: %d, owned: %d>', self.seen_count, self.owned_count)
|
str << sprintf(' seen: %d, owned: %d>', self.seen_count, self.owned_count)
|
||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class PokemonEggHatch_Scene
|
|||||||
Color.new(248, 248, 248), @viewport)
|
Color.new(248, 248, 248), @viewport)
|
||||||
# Create egg sprite/Pokémon sprite
|
# Create egg sprite/Pokémon sprite
|
||||||
@sprites["pokemon"] = PokemonSprite.new(@viewport)
|
@sprites["pokemon"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["pokemon"].setOffset(PictureOrigin::Bottom)
|
@sprites["pokemon"].setOffset(PictureOrigin::BOTTOM)
|
||||||
@sprites["pokemon"].x = Graphics.width / 2
|
@sprites["pokemon"].x = Graphics.width / 2
|
||||||
@sprites["pokemon"].y = 264 + 56 # 56 to offset the egg sprite
|
@sprites["pokemon"].y = 264 + 56 # 56 to offset the egg sprite
|
||||||
@sprites["pokemon"].setSpeciesBitmap(@pokemon.species, @pokemon.gender,
|
@sprites["pokemon"].setSpeciesBitmap(@pokemon.species, @pokemon.gender,
|
||||||
|
|||||||
@@ -498,12 +498,12 @@ class PokemonEvolutionScene
|
|||||||
addBackgroundOrColoredPlane(@sprites, "background", "evolutionbg",
|
addBackgroundOrColoredPlane(@sprites, "background", "evolutionbg",
|
||||||
Color.new(248, 248, 248), @bgviewport)
|
Color.new(248, 248, 248), @bgviewport)
|
||||||
rsprite1 = PokemonSprite.new(@viewport)
|
rsprite1 = PokemonSprite.new(@viewport)
|
||||||
rsprite1.setOffset(PictureOrigin::Center)
|
rsprite1.setOffset(PictureOrigin::CENTER)
|
||||||
rsprite1.setPokemonBitmap(@pokemon, false)
|
rsprite1.setPokemonBitmap(@pokemon, false)
|
||||||
rsprite1.x = Graphics.width / 2
|
rsprite1.x = Graphics.width / 2
|
||||||
rsprite1.y = (Graphics.height - 64) / 2
|
rsprite1.y = (Graphics.height - 64) / 2
|
||||||
rsprite2 = PokemonSprite.new(@viewport)
|
rsprite2 = PokemonSprite.new(@viewport)
|
||||||
rsprite2.setOffset(PictureOrigin::Center)
|
rsprite2.setOffset(PictureOrigin::CENTER)
|
||||||
rsprite2.setPokemonBitmapSpecies(@pokemon, @newspecies, false)
|
rsprite2.setPokemonBitmapSpecies(@pokemon, @newspecies, false)
|
||||||
rsprite2.x = rsprite1.x
|
rsprite2.x = rsprite1.x
|
||||||
rsprite2.y = rsprite1.y
|
rsprite2.y = rsprite1.y
|
||||||
|
|||||||
@@ -36,14 +36,14 @@ class PokemonTrade_Scene
|
|||||||
Color.new(248, 248, 248), @viewport)
|
Color.new(248, 248, 248), @viewport)
|
||||||
@sprites["rsprite1"] = PokemonSprite.new(@viewport)
|
@sprites["rsprite1"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["rsprite1"].setPokemonBitmap(@pokemon, false)
|
@sprites["rsprite1"].setPokemonBitmap(@pokemon, false)
|
||||||
@sprites["rsprite1"].setOffset(PictureOrigin::Bottom)
|
@sprites["rsprite1"].setOffset(PictureOrigin::BOTTOM)
|
||||||
@sprites["rsprite1"].x = Graphics.width / 2
|
@sprites["rsprite1"].x = Graphics.width / 2
|
||||||
@sprites["rsprite1"].y = 264
|
@sprites["rsprite1"].y = 264
|
||||||
@sprites["rsprite1"].z = 10
|
@sprites["rsprite1"].z = 10
|
||||||
@pokemon.species_data.apply_metrics_to_sprite(@sprites["rsprite1"], 1)
|
@pokemon.species_data.apply_metrics_to_sprite(@sprites["rsprite1"], 1)
|
||||||
@sprites["rsprite2"] = PokemonSprite.new(@viewport)
|
@sprites["rsprite2"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["rsprite2"].setPokemonBitmap(@pokemon2, false)
|
@sprites["rsprite2"].setPokemonBitmap(@pokemon2, false)
|
||||||
@sprites["rsprite2"].setOffset(PictureOrigin::Bottom)
|
@sprites["rsprite2"].setOffset(PictureOrigin::BOTTOM)
|
||||||
@sprites["rsprite2"].x = Graphics.width / 2
|
@sprites["rsprite2"].x = Graphics.width / 2
|
||||||
@sprites["rsprite2"].y = 264
|
@sprites["rsprite2"].y = 264
|
||||||
@sprites["rsprite2"].z = 10
|
@sprites["rsprite2"].z = 10
|
||||||
@@ -63,11 +63,11 @@ class PokemonTrade_Scene
|
|||||||
pictureBall.setXY(0, Graphics.width / 2, 48)
|
pictureBall.setXY(0, Graphics.width / 2, 48)
|
||||||
pictureBall.setName(0, ballimage)
|
pictureBall.setName(0, ballimage)
|
||||||
pictureBall.setSrcSize(0, 32, 64)
|
pictureBall.setSrcSize(0, 32, 64)
|
||||||
pictureBall.setOrigin(0, PictureOrigin::Center)
|
pictureBall.setOrigin(0, PictureOrigin::CENTER)
|
||||||
pictureBall.setVisible(0, true)
|
pictureBall.setVisible(0, true)
|
||||||
# Starting position of sprite
|
# Starting position of sprite
|
||||||
picturePoke.setXY(0, @sprites["rsprite1"].x, @sprites["rsprite1"].y)
|
picturePoke.setXY(0, @sprites["rsprite1"].x, @sprites["rsprite1"].y)
|
||||||
picturePoke.setOrigin(0, PictureOrigin::Bottom)
|
picturePoke.setOrigin(0, PictureOrigin::BOTTOM)
|
||||||
picturePoke.setVisible(0, true)
|
picturePoke.setVisible(0, true)
|
||||||
# Change Pokémon color
|
# Change Pokémon color
|
||||||
picturePoke.moveColor(2, 5, Color.new(31 * 8, 22 * 8, 30 * 8, 255))
|
picturePoke.moveColor(2, 5, Color.new(31 * 8, 22 * 8, 30 * 8, 255))
|
||||||
@@ -105,10 +105,10 @@ class PokemonTrade_Scene
|
|||||||
pictureBall.setXY(0, Graphics.width / 2, -32)
|
pictureBall.setXY(0, Graphics.width / 2, -32)
|
||||||
pictureBall.setName(0, ballimage)
|
pictureBall.setName(0, ballimage)
|
||||||
pictureBall.setSrcSize(0, 32, 64)
|
pictureBall.setSrcSize(0, 32, 64)
|
||||||
pictureBall.setOrigin(0, PictureOrigin::Center)
|
pictureBall.setOrigin(0, PictureOrigin::CENTER)
|
||||||
pictureBall.setVisible(0, true)
|
pictureBall.setVisible(0, true)
|
||||||
# Starting position of sprite
|
# Starting position of sprite
|
||||||
picturePoke.setOrigin(0, PictureOrigin::Bottom)
|
picturePoke.setOrigin(0, PictureOrigin::BOTTOM)
|
||||||
picturePoke.setZoom(0, 0)
|
picturePoke.setZoom(0, 0)
|
||||||
picturePoke.setColor(0, Color.new(31 * 8, 22 * 8, 30 * 8, 255))
|
picturePoke.setColor(0, Color.new(31 * 8, 22 * 8, 30 * 8, 255))
|
||||||
picturePoke.setVisible(0, false)
|
picturePoke.setVisible(0, false)
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ class HallOfFame_Scene
|
|||||||
ypoint = ypointformula(i)
|
ypoint = ypointformula(i)
|
||||||
pok = @hallEntry[i]
|
pok = @hallEntry[i]
|
||||||
@sprites["pokemon#{i}"] = PokemonSprite.new(@viewport)
|
@sprites["pokemon#{i}"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["pokemon#{i}"].setOffset(PictureOrigin::TopLeft)
|
@sprites["pokemon#{i}"].setOffset(PictureOrigin::TOP_LEFT)
|
||||||
@sprites["pokemon#{i}"].setPokemonBitmap(pok)
|
@sprites["pokemon#{i}"].setPokemonBitmap(pok)
|
||||||
# This method doesn't put the exact coordinates
|
# This method doesn't put the exact coordinates
|
||||||
@sprites["pokemon#{i}"].x = xpoint
|
@sprites["pokemon#{i}"].x = xpoint
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ class PokemonPokedex_Scene
|
|||||||
@sprites["searchbg"].visible = false
|
@sprites["searchbg"].visible = false
|
||||||
@sprites["pokedex"] = Window_Pokedex.new(206, 30, 276, 364, @viewport)
|
@sprites["pokedex"] = Window_Pokedex.new(206, 30, 276, 364, @viewport)
|
||||||
@sprites["icon"] = PokemonSprite.new(@viewport)
|
@sprites["icon"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["icon"].setOffset(PictureOrigin::Center)
|
@sprites["icon"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["icon"].x = 112
|
@sprites["icon"].x = 112
|
||||||
@sprites["icon"].y = 196
|
@sprites["icon"].y = 196
|
||||||
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
@sprites = {}
|
@sprites = {}
|
||||||
@sprites["background"] = IconSprite.new(0, 0, @viewport)
|
@sprites["background"] = IconSprite.new(0, 0, @viewport)
|
||||||
@sprites["infosprite"] = PokemonSprite.new(@viewport)
|
@sprites["infosprite"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["infosprite"].setOffset(PictureOrigin::Center)
|
@sprites["infosprite"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["infosprite"].x = 104
|
@sprites["infosprite"].x = 104
|
||||||
@sprites["infosprite"].y = 136
|
@sprites["infosprite"].y = 136
|
||||||
@mapdata = pbLoadTownMapData
|
@mapdata = pbLoadTownMapData
|
||||||
@@ -40,14 +40,14 @@ class PokemonPokedexInfo_Scene
|
|||||||
@sprites["areaoverlay"] = IconSprite.new(0, 0, @viewport)
|
@sprites["areaoverlay"] = IconSprite.new(0, 0, @viewport)
|
||||||
@sprites["areaoverlay"].setBitmap("Graphics/Pictures/Pokedex/overlay_area")
|
@sprites["areaoverlay"].setBitmap("Graphics/Pictures/Pokedex/overlay_area")
|
||||||
@sprites["formfront"] = PokemonSprite.new(@viewport)
|
@sprites["formfront"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["formfront"].setOffset(PictureOrigin::Center)
|
@sprites["formfront"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["formfront"].x = 130
|
@sprites["formfront"].x = 130
|
||||||
@sprites["formfront"].y = 158
|
@sprites["formfront"].y = 158
|
||||||
@sprites["formback"] = PokemonSprite.new(@viewport)
|
@sprites["formback"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["formback"].setOffset(PictureOrigin::Bottom)
|
@sprites["formback"].setOffset(PictureOrigin::BOTTOM)
|
||||||
@sprites["formback"].x = 382 # y is set below as it depends on metrics
|
@sprites["formback"].x = 382 # y is set below as it depends on metrics
|
||||||
@sprites["formicon"] = PokemonSpeciesIconSprite.new(nil, @viewport)
|
@sprites["formicon"] = PokemonSpeciesIconSprite.new(nil, @viewport)
|
||||||
@sprites["formicon"].setOffset(PictureOrigin::Center)
|
@sprites["formicon"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["formicon"].x = 82
|
@sprites["formicon"].x = 82
|
||||||
@sprites["formicon"].y = 328
|
@sprites["formicon"].y = 328
|
||||||
@sprites["uparrow"] = AnimatedSprite.new("Graphics/Pictures/uparrow", 8, 28, 40, 2, @viewport)
|
@sprites["uparrow"] = AnimatedSprite.new("Graphics/Pictures/uparrow", 8, 28, 40, 2, @viewport)
|
||||||
@@ -99,7 +99,7 @@ class PokemonPokedexInfo_Scene
|
|||||||
@sprites = {}
|
@sprites = {}
|
||||||
@sprites["background"] = IconSprite.new(0, 0, @viewport)
|
@sprites["background"] = IconSprite.new(0, 0, @viewport)
|
||||||
@sprites["infosprite"] = PokemonSprite.new(@viewport)
|
@sprites["infosprite"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["infosprite"].setOffset(PictureOrigin::Center)
|
@sprites["infosprite"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["infosprite"].x = 104
|
@sprites["infosprite"].x = 104
|
||||||
@sprites["infosprite"].y = 136
|
@sprites["infosprite"].y = 136
|
||||||
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ class PokemonPartyPanel < SpriteWrapper
|
|||||||
@ballsprite.addBitmap("desel", "Graphics/Pictures/Party/icon_ball")
|
@ballsprite.addBitmap("desel", "Graphics/Pictures/Party/icon_ball")
|
||||||
@ballsprite.addBitmap("sel", "Graphics/Pictures/Party/icon_ball_sel")
|
@ballsprite.addBitmap("sel", "Graphics/Pictures/Party/icon_ball_sel")
|
||||||
@pkmnsprite = PokemonIconSprite.new(pokemon, viewport)
|
@pkmnsprite = PokemonIconSprite.new(pokemon, viewport)
|
||||||
@pkmnsprite.setOffset(PictureOrigin::Center)
|
@pkmnsprite.setOffset(PictureOrigin::CENTER)
|
||||||
@pkmnsprite.active = @active
|
@pkmnsprite.active = @active
|
||||||
@pkmnsprite.z = self.z + 2
|
@pkmnsprite.z = self.z + 2
|
||||||
@helditemsprite = HeldItemIconSprite.new(0, 0, @pokemon, viewport)
|
@helditemsprite = HeldItemIconSprite.new(0, 0, @pokemon, viewport)
|
||||||
|
|||||||
@@ -122,12 +122,12 @@ class PokemonSummary_Scene
|
|||||||
@sprites = {}
|
@sprites = {}
|
||||||
@sprites["background"] = IconSprite.new(0, 0, @viewport)
|
@sprites["background"] = IconSprite.new(0, 0, @viewport)
|
||||||
@sprites["pokemon"] = PokemonSprite.new(@viewport)
|
@sprites["pokemon"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["pokemon"].setOffset(PictureOrigin::Center)
|
@sprites["pokemon"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["pokemon"].x = 104
|
@sprites["pokemon"].x = 104
|
||||||
@sprites["pokemon"].y = 206
|
@sprites["pokemon"].y = 206
|
||||||
@sprites["pokemon"].setPokemonBitmap(@pokemon)
|
@sprites["pokemon"].setPokemonBitmap(@pokemon)
|
||||||
@sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport)
|
@sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport)
|
||||||
@sprites["pokeicon"].setOffset(PictureOrigin::Center)
|
@sprites["pokeicon"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["pokeicon"].x = 46
|
@sprites["pokeicon"].x = 46
|
||||||
@sprites["pokeicon"].y = 92
|
@sprites["pokeicon"].y = 92
|
||||||
@sprites["pokeicon"].visible = false
|
@sprites["pokeicon"].visible = false
|
||||||
@@ -189,7 +189,7 @@ class PokemonSummary_Scene
|
|||||||
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
|
||||||
pbSetSystemFont(@sprites["overlay"].bitmap)
|
pbSetSystemFont(@sprites["overlay"].bitmap)
|
||||||
@sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport)
|
@sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport)
|
||||||
@sprites["pokeicon"].setOffset(PictureOrigin::Center)
|
@sprites["pokeicon"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["pokeicon"].x = 46
|
@sprites["pokeicon"].x = 46
|
||||||
@sprites["pokeicon"].y = 92
|
@sprites["pokeicon"].y = 92
|
||||||
@sprites["movesel"] = MoveSelectionSprite.new(@viewport, !move_to_learn.nil?)
|
@sprites["movesel"] = MoveSelectionSprite.new(@viewport, !move_to_learn.nil?)
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ class PokemonLoad_Scene
|
|||||||
end
|
end
|
||||||
trainer.party.each_with_index do |pkmn, i|
|
trainer.party.each_with_index do |pkmn, i|
|
||||||
@sprites["party#{i}"] = PokemonIconSprite.new(pkmn, @viewport)
|
@sprites["party#{i}"] = PokemonIconSprite.new(pkmn, @viewport)
|
||||||
@sprites["party#{i}"].setOffset(PictureOrigin::Center)
|
@sprites["party#{i}"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["party#{i}"].x = (167 + (33 * (i % 2))) * 2
|
@sprites["party#{i}"].x = (167 + (33 * (i % 2))) * 2
|
||||||
@sprites["party#{i}"].y = (56 + (25 * (i / 2))) * 2
|
@sprites["party#{i}"].y = (56 + (25 * (i / 2))) * 2
|
||||||
@sprites["party#{i}"].z = 99999
|
@sprites["party#{i}"].z = 99999
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ReadyMenuButton < SpriteWrapper
|
|||||||
pbSetSystemFont(self.bitmap)
|
pbSetSystemFont(self.bitmap)
|
||||||
if @command[2]
|
if @command[2]
|
||||||
@icon = PokemonIconSprite.new($player.party[@command[3]], viewport)
|
@icon = PokemonIconSprite.new($player.party[@command[3]], viewport)
|
||||||
@icon.setOffset(PictureOrigin::Center)
|
@icon.setOffset(PictureOrigin::CENTER)
|
||||||
else
|
else
|
||||||
@icon = ItemIconSprite.new(0, 0, @command[0], viewport)
|
@icon = ItemIconSprite.new(0, 0, @command[0], viewport)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ class PokemonStorageScene
|
|||||||
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @boxsidesviewport)
|
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @boxsidesviewport)
|
||||||
pbSetSystemFont(@sprites["overlay"].bitmap)
|
pbSetSystemFont(@sprites["overlay"].bitmap)
|
||||||
@sprites["pokemon"] = AutoMosaicPokemonSprite.new(@boxsidesviewport)
|
@sprites["pokemon"] = AutoMosaicPokemonSprite.new(@boxsidesviewport)
|
||||||
@sprites["pokemon"].setOffset(PictureOrigin::Center)
|
@sprites["pokemon"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["pokemon"].x = 90
|
@sprites["pokemon"].x = 90
|
||||||
@sprites["pokemon"].y = 134
|
@sprites["pokemon"].y = 134
|
||||||
@sprites["boxparty"] = PokemonBoxPartySprite.new(@storage.party, @boxsidesviewport)
|
@sprites["boxparty"] = PokemonBoxPartySprite.new(@storage.party, @boxsidesviewport)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class MoveRelearner_Scene
|
|||||||
@sprites = {}
|
@sprites = {}
|
||||||
addBackgroundPlane(@sprites, "bg", "reminderbg", @viewport)
|
addBackgroundPlane(@sprites, "bg", "reminderbg", @viewport)
|
||||||
@sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport)
|
@sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport)
|
||||||
@sprites["pokeicon"].setOffset(PictureOrigin::Center)
|
@sprites["pokeicon"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["pokeicon"].x = 320
|
@sprites["pokeicon"].x = 320
|
||||||
@sprites["pokeicon"].y = 84
|
@sprites["pokeicon"].y = 84
|
||||||
@sprites["background"] = IconSprite.new(0, 0, @viewport)
|
@sprites["background"] = IconSprite.new(0, 0, @viewport)
|
||||||
|
|||||||
@@ -860,7 +860,7 @@ class PurifyChamberSetView < SpriteWrapper
|
|||||||
@directflow.setFlowStrength(1)
|
@directflow.setFlowStrength(1)
|
||||||
@__sprites = []
|
@__sprites = []
|
||||||
@__sprites[0] = PokemonIconSprite.new(nil, viewport)
|
@__sprites[0] = PokemonIconSprite.new(nil, viewport)
|
||||||
PurifyChamber::SETSIZE * 2.times do |i|
|
(PurifyChamber::SETSIZE * 2).times do |i|
|
||||||
@__sprites[i + 1] = PokemonIconSprite.new(nil, viewport)
|
@__sprites[i + 1] = PokemonIconSprite.new(nil, viewport)
|
||||||
end
|
end
|
||||||
@__sprites[1 + (PurifyChamber::SETSIZE * 2)] = PokemonIconSprite.new(nil, viewport)
|
@__sprites[1 + (PurifyChamber::SETSIZE * 2)] = PokemonIconSprite.new(nil, viewport)
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ def pbDownloadMysteryGift(trainer)
|
|||||||
sprites["msgwindow"].visible = false
|
sprites["msgwindow"].visible = false
|
||||||
if gift[1] == 0
|
if gift[1] == 0
|
||||||
sprite = PokemonSprite.new(viewport)
|
sprite = PokemonSprite.new(viewport)
|
||||||
sprite.setOffset(PictureOrigin::Center)
|
sprite.setOffset(PictureOrigin::CENTER)
|
||||||
sprite.setPokemonBitmap(gift[2])
|
sprite.setPokemonBitmap(gift[2])
|
||||||
sprite.x = Graphics.width / 2
|
sprite.x = Graphics.width / 2
|
||||||
sprite.y = -sprite.bitmap.height / 2
|
sprite.y = -sprite.bitmap.height / 2
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class PokemonEntryScene
|
|||||||
@sprites["shadow"].x = 33 * 2
|
@sprites["shadow"].x = 33 * 2
|
||||||
@sprites["shadow"].y = 32 * 2
|
@sprites["shadow"].y = 32 * 2
|
||||||
@sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport)
|
@sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport)
|
||||||
@sprites["subject"].setOffset(PictureOrigin::Center)
|
@sprites["subject"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["subject"].x = 88
|
@sprites["subject"].x = 88
|
||||||
@sprites["subject"].y = 54
|
@sprites["subject"].y = 54
|
||||||
@sprites["gender"] = BitmapSprite.new(32, 32, @viewport)
|
@sprites["gender"] = BitmapSprite.new(32, 32, @viewport)
|
||||||
@@ -426,7 +426,7 @@ class PokemonEntryScene2
|
|||||||
@sprites["shadow"].x = 66
|
@sprites["shadow"].x = 66
|
||||||
@sprites["shadow"].y = 64
|
@sprites["shadow"].y = 64
|
||||||
@sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport)
|
@sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport)
|
||||||
@sprites["subject"].setOffset(PictureOrigin::Center)
|
@sprites["subject"].setOffset(PictureOrigin::CENTER)
|
||||||
@sprites["subject"].x = 88
|
@sprites["subject"].x = 88
|
||||||
@sprites["subject"].y = 54
|
@sprites["subject"].y = 54
|
||||||
@sprites["gender"] = BitmapSprite.new(32, 32, @viewport)
|
@sprites["gender"] = BitmapSprite.new(32, 32, @viewport)
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ class SlotMachineScene
|
|||||||
@wager = 3
|
@wager = 3
|
||||||
(1..5).each do |i|
|
(1..5).each do |i|
|
||||||
@sprites["row#{i}"].visible = true
|
@sprites["row#{i}"].visible = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@sprites["reel1"].startSpinning
|
@sprites["reel1"].startSpinning
|
||||||
@sprites["reel2"].startSpinning
|
@sprites["reel2"].startSpinning
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ class VoltorbFlip
|
|||||||
numText += "0"
|
numText += "0"
|
||||||
end
|
end
|
||||||
numText += num.to_s
|
numText += num.to_s
|
||||||
numImages = numText.split(//)[0...2]
|
numImages = numText.chars[0...2]
|
||||||
2.times do |j|
|
2.times do |j|
|
||||||
@numbers[j] = [@directory + "numbersSmall", 472 + (j * 16), (i * 64) + 8, numImages[j].to_i * 16, 0, 16, 16]
|
@numbers[j] = [@directory + "numbersSmall", 472 + (j * 16), (i * 64) + 8, numImages[j].to_i * 16, 0, 16, 16]
|
||||||
end
|
end
|
||||||
@@ -453,7 +453,7 @@ class VoltorbFlip
|
|||||||
numText += "0"
|
numText += "0"
|
||||||
end
|
end
|
||||||
numText += num.to_s
|
numText += num.to_s
|
||||||
numImages = numText.split(//)[0...2]
|
numImages = numText.chars[0...2]
|
||||||
2.times do |j|
|
2.times do |j|
|
||||||
@numbers[j] = [@directory + "numbersSmall", (i * 64) + 152 + (j * 16), 328, numImages[j].to_i * 16, 0, 16, 16]
|
@numbers[j] = [@directory + "numbersSmall", (i * 64) + 152 + (j * 16), 328, numImages[j].to_i * 16, 0, 16, 16]
|
||||||
end
|
end
|
||||||
@@ -470,7 +470,7 @@ class VoltorbFlip
|
|||||||
coinText += "0"
|
coinText += "0"
|
||||||
end
|
end
|
||||||
coinText += source.to_s
|
coinText += source.to_s
|
||||||
coinImages = coinText.split(//)[0...5]
|
coinImages = coinText.chars[0...5]
|
||||||
5.times do |i|
|
5.times do |i|
|
||||||
@coins[i] = [@directory + "numbersScore", 6 + (i * 24), y, coinImages[i].to_i * 24, 0, 24, 38]
|
@coins[i] = [@directory + "numbersScore", 6 + (i * 24), y, coinImages[i].to_i * 24, 0, 24, 38]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ class SpritePositioner
|
|||||||
@sprites["shadow_1"] = IconSprite.new(0, 0, @viewport)
|
@sprites["shadow_1"] = IconSprite.new(0, 0, @viewport)
|
||||||
@sprites["shadow_1"].z = 3
|
@sprites["shadow_1"].z = 3
|
||||||
@sprites["pokemon_0"] = PokemonSprite.new(@viewport)
|
@sprites["pokemon_0"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["pokemon_0"].setOffset(PictureOrigin::Bottom)
|
@sprites["pokemon_0"].setOffset(PictureOrigin::BOTTOM)
|
||||||
@sprites["pokemon_0"].z = 4
|
@sprites["pokemon_0"].z = 4
|
||||||
@sprites["pokemon_1"] = PokemonSprite.new(@viewport)
|
@sprites["pokemon_1"] = PokemonSprite.new(@viewport)
|
||||||
@sprites["pokemon_1"].setOffset(PictureOrigin::Bottom)
|
@sprites["pokemon_1"].setOffset(PictureOrigin::BOTTOM)
|
||||||
@sprites["pokemon_1"].z = 4
|
@sprites["pokemon_1"].z = 4
|
||||||
@sprites["info"] = Window_UnformattedTextPokemon.new("")
|
@sprites["info"] = Window_UnformattedTextPokemon.new("")
|
||||||
@sprites["info"].viewport = @viewport
|
@sprites["info"].viewport = @viewport
|
||||||
|
|||||||
@@ -802,7 +802,7 @@ class AnimationCanvas < Sprite
|
|||||||
if Input.trigger?(Input::MOUSELEFT) && mousepos &&
|
if Input.trigger?(Input::MOUSELEFT) && mousepos &&
|
||||||
pbSpriteHitTest(self, mousepos[0], mousepos[1], false, true)
|
pbSpriteHitTest(self, mousepos[0], mousepos[1], false, true)
|
||||||
selectedcel = -1
|
selectedcel = -1
|
||||||
usealpha = (Input.press?(Input::ALT)) ? true : false
|
usealpha = Input.press?(Input::ALT)
|
||||||
PBAnimation::MAX_SPRITES.times do |j|
|
PBAnimation::MAX_SPRITES.times do |j|
|
||||||
if pbSpriteHitTest(@celsprites[j], mousepos[0], mousepos[1], usealpha, false)
|
if pbSpriteHitTest(@celsprites[j], mousepos[0], mousepos[1], usealpha, false)
|
||||||
selectedcel = j
|
selectedcel = j
|
||||||
|
|||||||
Reference in New Issue
Block a user