Deleted rubyscreen.dll, eradicated semicolons from when... statements, compiling is now before setting up the system, appeased vocal dissenters

This commit is contained in:
Maruno17
2020-11-26 21:10:45 +00:00
parent 017cdb8d0f
commit eb22e49d9b
73 changed files with 905 additions and 817 deletions

View File

@@ -205,10 +205,10 @@ class SpriteAnimation
sprite.visible = true sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192) sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
case @_animation_height case @_animation_height
when 0; sprite.z = 1 when 0 then sprite.z = 1
when 1; sprite.z = sprite.y+32+15 when 1 then sprite.z = sprite.y+32+15
when 2; sprite.z = sprite.y+32+32+17 when 2 then sprite.z = sprite.y+32+32+17
else; sprite.z = 2000 else sprite.z = 2000
end end
sprite.ox = 96 sprite.ox = 96
sprite.oy = 96 sprite.oy = 96

View File

@@ -219,9 +219,13 @@ module PluginManager
optional = false optional = false
exact = false exact = false
case def_arg case def_arg
when :optional; optional = true when :optional
when :exact; exact = true optional = true
when :optional_exact; optional = true; exact = true when :exact
exact = true
when :optional_exact
optional = true
exact = true
else else
self.error("Expected first dependency argument to be one of " + self.error("Expected first dependency argument to be one of " +
":optional, :exact or :optional_exact, but got #{dep_arg.inspect}.") ":optional, :exact or :optional_exact, but got #{dep_arg.inspect}.")

View File

@@ -309,9 +309,9 @@ class Game_Character
#============================================================================= #=============================================================================
def move_type_random def move_type_random
case rand(6) case rand(6)
when 0..3; move_random when 0..3 then move_random
when 4; move_forward when 4 then move_forward
when 5; @stop_count = 0 when 5 then @stop_count = 0
end end
end end
@@ -323,9 +323,9 @@ class Game_Character
return return
end end
case rand(6) case rand(6)
when 0..3; move_toward_player when 0..3 then move_toward_player
when 4; move_random when 4 then move_random
when 5; move_forward when 5 then move_forward
end end
end end
@@ -349,20 +349,20 @@ class Game_Character
end end
if command.code <= 14 if command.code <= 14
case command.code case command.code
when 1; move_down when 1 then move_down
when 2; move_left when 2 then move_left
when 3; move_right when 3 then move_right
when 4; move_up when 4 then move_up
when 5; move_lower_left when 5 then move_lower_left
when 6; move_lower_right when 6 then move_lower_right
when 7; move_upper_left when 7 then move_upper_left
when 8; move_upper_right when 8 then move_upper_right
when 9; move_random when 9 then move_random
when 10; move_toward_player when 10 then move_toward_player
when 11; move_away_from_player when 11 then move_away_from_player
when 12; move_forward when 12 then move_forward
when 13; move_backward when 13 then move_backward
when 14; jump(command.parameters[0], command.parameters[1]) when 14 then jump(command.parameters[0], command.parameters[1])
end end
@move_route_index += 1 if @move_route.skippable or moving? or jumping? @move_route_index += 1 if @move_route.skippable or moving? or jumping?
return return
@@ -374,17 +374,17 @@ class Game_Character
end end
if command.code >= 16 and command.code <= 26 if command.code >= 16 and command.code <= 26
case command.code case command.code
when 16; turn_down when 16 then turn_down
when 17; turn_left when 17 then turn_left
when 18; turn_right when 18 then turn_right
when 19; turn_up when 19 then turn_up
when 20; turn_right_90 when 20 then turn_right_90
when 21; turn_left_90 when 21 then turn_left_90
when 22; turn_180 when 22 then turn_180
when 23; turn_right_or_left_90 when 23 then turn_right_or_left_90
when 24; turn_random when 24 then turn_random
when 25; turn_toward_player when 25 then turn_toward_player
when 26; turn_away_from_player when 26 then turn_away_from_player
end end
@move_route_index += 1 @move_route_index += 1
return return
@@ -397,18 +397,18 @@ class Game_Character
when 28 when 28
$game_switches[command.parameters[0]] = false $game_switches[command.parameters[0]] = false
self.map.need_refresh = true self.map.need_refresh = true
when 29; self.move_speed = command.parameters[0] when 29 then self.move_speed = command.parameters[0]
when 30; self.move_frequency = command.parameters[0] when 30 then self.move_frequency = command.parameters[0]
when 31; @walk_anime = true when 31 then @walk_anime = true
when 32; @walk_anime = false when 32 then @walk_anime = false
when 33; @step_anime = true when 33 then @step_anime = true
when 34; @step_anime = false when 34 then @step_anime = false
when 35; @direction_fix = true when 35 then @direction_fix = true
when 36; @direction_fix = false when 36 then @direction_fix = false
when 37; @through = true when 37 then @through = true
when 38; @through = false when 38 then @through = false
when 39; @always_on_top = true when 39 then @always_on_top = true
when 40; @always_on_top = false when 40 then @always_on_top = false
when 41 when 41
@tile_id = 0 @tile_id = 0
@character_name = command.parameters[0] @character_name = command.parameters[0]
@@ -422,10 +422,10 @@ class Game_Character
@pattern = command.parameters[3] @pattern = command.parameters[3]
@original_pattern = @pattern @original_pattern = @pattern
end end
when 42; @opacity = command.parameters[0] when 42 then @opacity = command.parameters[0]
when 43; @blend_type = command.parameters[0] when 43 then @blend_type = command.parameters[0]
when 44; pbSEPlay(command.parameters[0]) when 44 then pbSEPlay(command.parameters[0])
when 45; eval(command.parameters[0]) when 45 then eval(command.parameters[0])
end end
@move_route_index += 1 @move_route_index += 1
end end
@@ -512,28 +512,28 @@ class Game_Character
def moveLeft90 # anticlockwise def moveLeft90 # anticlockwise
case self.direction case self.direction
when 2; move_right # down when 2 then move_right # down
when 4; move_down # left when 4 then move_down # left
when 6; move_up # right when 6 then move_up # right
when 8; move_left # up when 8 then move_left # up
end end
end end
def moveRight90 # clockwise def moveRight90 # clockwise
case self.direction case self.direction
when 2; move_left # down when 2 then move_left # down
when 4; move_up # left when 4 then move_up # left
when 6; move_down # right when 6 then move_down # right
when 8; move_right # up when 8 then move_right # up
end end
end end
def move_random def move_random
case rand(4) case rand(4)
when 0; move_down(false) when 0 then move_down(false)
when 1; move_left(false) when 1 then move_left(false)
when 2; move_right(false) when 2 then move_right(false)
when 3; move_up(false) when 3 then move_up(false)
end end
end end
@@ -553,10 +553,10 @@ class Game_Character
end end
return if dirs.length==0 return if dirs.length==0
case dirs[rand(dirs.length)] case dirs[rand(dirs.length)]
when 0; move_down(false) when 0 then move_down(false)
when 1; move_left(false) when 1 then move_left(false)
when 2; move_right(false) when 2 then move_right(false)
when 3; move_up(false) when 3 then move_up(false)
end end
end end
@@ -614,10 +614,10 @@ class Game_Character
def move_forward def move_forward
case @direction case @direction
when 2; move_down(false) when 2 then move_down(false)
when 4; move_left(false) when 4 then move_left(false)
when 6; move_right(false) when 6 then move_right(false)
when 8; move_up(false) when 8 then move_up(false)
end end
end end
@@ -625,10 +625,10 @@ class Game_Character
last_direction_fix = @direction_fix last_direction_fix = @direction_fix
@direction_fix = true @direction_fix = true
case @direction case @direction
when 2; move_up(false) when 2 then move_up(false)
when 4; move_right(false) when 4 then move_right(false)
when 6; move_left(false) when 6 then move_left(false)
when 8; move_down(false) when 8 then move_down(false)
end end
@direction_fix = last_direction_fix @direction_fix = last_direction_fix
end end
@@ -666,19 +666,19 @@ class Game_Character
def jumpForward def jumpForward
case self.direction case self.direction
when 2; jump(0,1) # down when 2 then jump(0,1) # down
when 4; jump(-1,0) # left when 4 then jump(-1,0) # left
when 6; jump(1,0) # right when 6 then jump(1,0) # right
when 8; jump(0,-1) # up when 8 then jump(0,-1) # up
end end
end end
def jumpBackward def jumpBackward
case self.direction case self.direction
when 2; jump(0,-1) # down when 2 then jump(0,-1) # down
when 4; jump(1,0) # left when 4 then jump(1,0) # left
when 6; jump(-1,0) # right when 6 then jump(-1,0) # right
when 8; jump(0,1) # up when 8 then jump(0,1) # up
end end
end end
@@ -697,28 +697,28 @@ class Game_Character
def turn_right_90 def turn_right_90
case @direction case @direction
when 2; turn_left when 2 then turn_left
when 4; turn_up when 4 then turn_up
when 6; turn_down when 6 then turn_down
when 8; turn_right when 8 then turn_right
end end
end end
def turn_left_90 def turn_left_90
case @direction case @direction
when 2; turn_right when 2 then turn_right
when 4; turn_down when 4 then turn_down
when 6; turn_up when 6 then turn_up
when 8; turn_left when 8 then turn_left
end end
end end
def turn_180 def turn_180
case @direction case @direction
when 2; turn_up when 2 then turn_up
when 4; turn_right when 4 then turn_right
when 6; turn_left when 6 then turn_left
when 8; turn_down when 8 then turn_down
end end
end end
@@ -728,10 +728,10 @@ class Game_Character
def turn_random def turn_random
case rand(4) case rand(4)
when 0; turn_up when 0 then turn_up
when 1; turn_right when 1 then turn_right
when 2; turn_left when 2 then turn_left
when 3; turn_down when 3 then turn_down
end end
end end
@@ -793,9 +793,9 @@ class Game_Character
# 6 => @stop_count > 0 # 0 seconds # 6 => @stop_count > 0 # 0 seconds
if @stop_count >= self.move_frequency_real if @stop_count >= self.move_frequency_real
case @move_type case @move_type
when 1; move_type_random when 1 then move_type_random
when 2; move_type_toward_player when 2 then move_type_toward_player
when 3; move_type_custom when 3 then move_type_custom
end end
end end
end end

View File

@@ -351,17 +351,17 @@ class Game_Player < Game_Character
if @moved_last_frame || if @moved_last_frame ||
(dir > 0 && dir == @lastdir && Graphics.frame_count - @lastdirframe > Graphics.frame_rate / 20) (dir > 0 && dir == @lastdir && Graphics.frame_count - @lastdirframe > Graphics.frame_rate / 20)
case dir case dir
when 2; move_down when 2 then move_down
when 4; move_left when 4 then move_left
when 6; move_right when 6 then move_right
when 8; move_up when 8 then move_up
end end
elsif dir != @lastdir elsif dir != @lastdir
case dir case dir
when 2; turn_down when 2 then turn_down
when 4; turn_left when 4 then turn_left
when 6; turn_right when 6 then turn_right
when 8; turn_up when 8 then turn_up
end end
end end
end end

View File

@@ -3,10 +3,10 @@ class Game_Player < Game_Character
def fullPattern def fullPattern
case self.direction case self.direction
when 2; return self.pattern when 2 then return self.pattern
when 4; return 4+self.pattern when 4 then return self.pattern + 4
when 6; return 8+self.pattern when 6 then return self.pattern + 8
when 8; return 12+self.pattern when 8 then return self.pattern + 12
end end
return 0 return 0
end end

View File

@@ -161,14 +161,26 @@ class Game_Map
# All other events # All other events
newx = x; newy = y newx = x; newy = y
case d case d
when 1; newx -= 1; newy += 1 when 1
when 2; newy += 1 newx -= 1
when 3; newx += 1; newy += 1 newy += 1
when 4; newx -= 1 when 2
when 6; newx += 1 newy += 1
when 7; newx -= 1; newy -= 1 when 3
when 8; newy -= 1 newx += 1
when 9; newx += 1; newy -= 1 newy += 1
when 4
newx -= 1
when 6
newx += 1
when 7
newx -= 1
newy -= 1
when 8
newy -= 1
when 9
newx += 1
newy -= 1
end end
return false if !valid?(newx, newy) return false if !valid?(newx, newy)
for i in [2, 1, 0] for i in [2, 1, 0]
@@ -403,10 +415,10 @@ class Game_Map
distance = (1<<@scroll_speed)*40.0/Graphics.frame_rate distance = (1<<@scroll_speed)*40.0/Graphics.frame_rate
distance = @scroll_rest if distance>@scroll_rest distance = @scroll_rest if distance>@scroll_rest
case @scroll_direction case @scroll_direction
when 2; scroll_down(distance) when 2 then scroll_down(distance)
when 4; scroll_left(distance) when 4 then scroll_left(distance)
when 6; scroll_right(distance) when 6 then scroll_right(distance)
when 8; scroll_up(distance) when 8 then scroll_up(distance)
end end
@scroll_rest -= distance @scroll_rest -= distance
end end

View File

@@ -178,14 +178,14 @@ class Game_Map
distance = @scroll_rest if distance>@scroll_rest distance = @scroll_rest if distance>@scroll_rest
# Execute scrolling # Execute scrolling
case @scroll_direction case @scroll_direction
when 1; scroll_downleft(distance) when 1 then scroll_downleft(distance)
when 2; scroll_down(distance) when 2 then scroll_down(distance)
when 3; scroll_downright(distance) when 3 then scroll_downright(distance)
when 4; scroll_left(distance) when 4 then scroll_left(distance)
when 6; scroll_right(distance) when 6 then scroll_right(distance)
when 7; scroll_upleft(distance) when 7 then scroll_upleft(distance)
when 8; scroll_up(distance) when 8 then scroll_up(distance)
when 9; scroll_upright(distance) when 9 then scroll_upright(distance)
end end
# Subtract distance scrolled # Subtract distance scrolled
@scroll_rest -= distance @scroll_rest -= distance

View File

@@ -294,15 +294,28 @@ class PokemonMapFactory
def getFacingTileFromPos(mapID,x,y,direction=0,steps=1) def getFacingTileFromPos(mapID,x,y,direction=0,steps=1)
id = mapID id = mapID
case direction case direction
when 1; x -= steps; y += steps when 1
when 2; y += steps x -= steps
when 3; x += steps; y += steps y += steps
when 4; x -= steps when 2
when 6; x += steps y += steps
when 7; x -= steps; y -= steps when 3
when 8; y -= steps x += steps
when 9; x += steps; y -= steps y += steps
else; return [id,x,y] when 4
x -= steps
when 6
x += steps
when 7
x -= steps
y -= steps
when 8
y -= steps
when 9
x += steps
y -= steps
else
return [id,x,y]
end end
return getRealTilePos(mapID,x,y) return getRealTilePos(mapID,x,y)
end end
@@ -333,14 +346,26 @@ class PokemonMapFactory
def getFacingCoords(x,y,direction=0,steps=1) def getFacingCoords(x,y,direction=0,steps=1)
case direction case direction
when 1; x -= steps; y += steps when 1
when 2; y += steps x -= steps
when 3; x += steps; y += steps y += steps
when 4; x -= steps when 2
when 6; x += steps y += steps
when 7; x -= steps; y -= steps when 3
when 8; y -= steps x += steps
when 9; x += steps; y -= steps y += steps
when 4
x -= steps
when 6
x += steps
when 7
x -= steps
y -= steps
when 8
y -= steps
when 9
x += steps
y -= steps
end end
return [x,y] return [x,y]
end end

View File

@@ -66,11 +66,7 @@ class Sprite_Reflection
@sprite.zoom_x = @rsprite.zoom_x @sprite.zoom_x = @rsprite.zoom_x
@sprite.zoom_y = @rsprite.zoom_y @sprite.zoom_y = @rsprite.zoom_y
frame = (Graphics.frame_count%40)/10 frame = (Graphics.frame_count%40)/10
case frame @sprite.zoom_x *= [1.0, 0.95, 1.0, 1.05][frame]
when 1; @sprite.zoom_x *= 0.95
when 3; @sprite.zoom_x *= 1.05
else; @sprite.zoom_x *= 1.0
end
@sprite.angle = 180.0 @sprite.angle = 180.0
@sprite.mirror = true @sprite.mirror = true
@sprite.bitmap = @rsprite.bitmap @sprite.bitmap = @rsprite.bitmap

View File

@@ -68,10 +68,10 @@ class Sprite_Shadow < RPG::Sprite
sy = (@character.direction - 2) / 2 * @ch sy = (@character.direction - 2) / 2 * @ch
if self.angle > 90 or angle < -90 if self.angle > 90 or angle < -90
case @character.direction case @character.direction
when 2; sy = (8- 2) / 2 * @ch when 2 then sy = (8- 2) / 2 * @ch
when 4; sy = (6- 2) / 2 * @ch when 4 then sy = (6- 2) / 2 * @ch
when 6; sy = (4- 2) / 2 * @ch when 6 then sy = (4- 2) / 2 * @ch
when 8; sy = (2- 2) / 2 * @ch when 8 then sy = (2- 2) / 2 * @ch
end end
end end
self.src_rect.set(sx, sy, @cw, @ch) self.src_rect.set(sx, sy, @cw, @ch)

View File

@@ -261,103 +261,103 @@ class Interpreter
@parameters = @list[@index].parameters @parameters = @list[@index].parameters
# Branch by command code # Branch by command code
case @list[@index].code case @list[@index].code
when 101; return command_101 # Show Text when 101 then return command_101 # Show Text
when 102; return command_102 # Show Choices when 102 then return command_102 # Show Choices
when 402; return command_402 # When [**] when 402 then return command_402 # When [**]
when 403; return command_403 # When Cancel when 403 then return command_403 # When Cancel
when 103; return command_103 # Input Number when 103 then return command_103 # Input Number
when 104; return command_104 # Change Text Options when 104 then return command_104 # Change Text Options
when 105; return command_105 # Button Input Processing when 105 then return command_105 # Button Input Processing
when 106; return command_106 # Wait when 106 then return command_106 # Wait
when 111; return command_111 # Conditional Branch when 111 then return command_111 # Conditional Branch
when 411; return command_411 # Else when 411 then return command_411 # Else
when 112; return command_112 # Loop when 112 then return command_112 # Loop
when 413; return command_413 # Repeat Above when 413 then return command_413 # Repeat Above
when 113; return command_113 # Break Loop when 113 then return command_113 # Break Loop
when 115; return command_115 # Exit Event Processing when 115 then return command_115 # Exit Event Processing
when 116; return command_116 # Erase Event when 116 then return command_116 # Erase Event
when 117; return command_117 # Call Common Event when 117 then return command_117 # Call Common Event
when 118; return command_118 # Label when 118 then return command_118 # Label
when 119; return command_119 # Jump to Label when 119 then return command_119 # Jump to Label
when 121; return command_121 # Control Switches when 121 then return command_121 # Control Switches
when 122; return command_122 # Control Variables when 122 then return command_122 # Control Variables
when 123; return command_123 # Control Self Switch when 123 then return command_123 # Control Self Switch
when 124; return command_124 # Control Timer when 124 then return command_124 # Control Timer
when 125; return command_125 # Change Gold when 125 then return command_125 # Change Gold
when 126; return command_126 # Change Items when 126 then return command_126 # Change Items
when 127; return command_127 # Change Weapons when 127 then return command_127 # Change Weapons
when 128; return command_128 # Change Armor when 128 then return command_128 # Change Armor
when 129; return command_129 # Change Party Member when 129 then return command_129 # Change Party Member
when 131; return command_131 # Change Windowskin when 131 then return command_131 # Change Windowskin
when 132; return command_132 # Change Battle BGM when 132 then return command_132 # Change Battle BGM
when 133; return command_133 # Change Battle End ME when 133 then return command_133 # Change Battle End ME
when 134; return command_134 # Change Save Access when 134 then return command_134 # Change Save Access
when 135; return command_135 # Change Menu Access when 135 then return command_135 # Change Menu Access
when 136; return command_136 # Change Encounter when 136 then return command_136 # Change Encounter
when 201; return command_201 # Transfer Player when 201 then return command_201 # Transfer Player
when 202; return command_202 # Set Event Location when 202 then return command_202 # Set Event Location
when 203; return command_203 # Scroll Map when 203 then return command_203 # Scroll Map
when 204; return command_204 # Change Map Settings when 204 then return command_204 # Change Map Settings
when 205; return command_205 # Change Fog Color Tone when 205 then return command_205 # Change Fog Color Tone
when 206; return command_206 # Change Fog Opacity when 206 then return command_206 # Change Fog Opacity
when 207; return command_207 # Show Animation when 207 then return command_207 # Show Animation
when 208; return command_208 # Change Transparent Flag when 208 then return command_208 # Change Transparent Flag
when 209; return command_209 # Set Move Route when 209 then return command_209 # Set Move Route
when 210; return command_210 # Wait for Move's Completion when 210 then return command_210 # Wait for Move's Completion
when 221; return command_221 # Prepare for Transition when 221 then return command_221 # Prepare for Transition
when 222; return command_222 # Execute Transition when 222 then return command_222 # Execute Transition
when 223; return command_223 # Change Screen Color Tone when 223 then return command_223 # Change Screen Color Tone
when 224; return command_224 # Screen Flash when 224 then return command_224 # Screen Flash
when 225; return command_225 # Screen Shake when 225 then return command_225 # Screen Shake
when 231; return command_231 # Show Picture when 231 then return command_231 # Show Picture
when 232; return command_232 # Move Picture when 232 then return command_232 # Move Picture
when 233; return command_233 # Rotate Picture when 233 then return command_233 # Rotate Picture
when 234; return command_234 # Change Picture Color Tone when 234 then return command_234 # Change Picture Color Tone
when 235; return command_235 # Erase Picture when 235 then return command_235 # Erase Picture
when 236; return command_236 # Set Weather Effects when 236 then return command_236 # Set Weather Effects
when 241; return command_241 # Play BGM when 241 then return command_241 # Play BGM
when 242; return command_242 # Fade Out BGM when 242 then return command_242 # Fade Out BGM
when 245; return command_245 # Play BGS when 245 then return command_245 # Play BGS
when 246; return command_246 # Fade Out BGS when 246 then return command_246 # Fade Out BGS
when 247; return command_247 # Memorize BGM/BGS when 247 then return command_247 # Memorize BGM/BGS
when 248; return command_248 # Restore BGM/BGS when 248 then return command_248 # Restore BGM/BGS
when 249; return command_249 # Play ME when 249 then return command_249 # Play ME
when 250; return command_250 # Play SE when 250 then return command_250 # Play SE
when 251; return command_251 # Stop SE when 251 then return command_251 # Stop SE
when 301; return command_301 # Battle Processing when 301 then return command_301 # Battle Processing
when 601; return command_601 # If Win when 601 then return command_601 # If Win
when 602; return command_602 # If Escape when 602 then return command_602 # If Escape
when 603; return command_603 # If Lose when 603 then return command_603 # If Lose
when 302; return command_302 # Shop Processing when 302 then return command_302 # Shop Processing
when 303; return command_303 # Name Input Processing when 303 then return command_303 # Name Input Processing
when 311; return command_311 # Change HP when 311 then return command_311 # Change HP
when 312; return command_312 # Change SP when 312 then return command_312 # Change SP
when 313; return command_313 # Change State when 313 then return command_313 # Change State
when 314; return command_314 # Recover All when 314 then return command_314 # Recover All
when 315; return command_315 # Change EXP when 315 then return command_315 # Change EXP
when 316; return command_316 # Change Level when 316 then return command_316 # Change Level
when 317; return command_317 # Change Parameters when 317 then return command_317 # Change Parameters
when 318; return command_318 # Change Skills when 318 then return command_318 # Change Skills
when 319; return command_319 # Change Equipment when 319 then return command_319 # Change Equipment
when 320; return command_320 # Change Actor Name when 320 then return command_320 # Change Actor Name
when 321; return command_321 # Change Actor Class when 321 then return command_321 # Change Actor Class
when 322; return command_322 # Change Actor Graphic when 322 then return command_322 # Change Actor Graphic
when 331; return command_331 # Change Enemy HP when 331 then return command_331 # Change Enemy HP
when 332; return command_332 # Change Enemy SP when 332 then return command_332 # Change Enemy SP
when 333; return command_333 # Change Enemy State when 333 then return command_333 # Change Enemy State
when 334; return command_334 # Enemy Recover All when 334 then return command_334 # Enemy Recover All
when 335; return command_335 # Enemy Appearance when 335 then return command_335 # Enemy Appearance
when 336; return command_336 # Enemy Transform when 336 then return command_336 # Enemy Transform
when 337; return command_337 # Show Battle Animation when 337 then return command_337 # Show Battle Animation
when 338; return command_338 # Deal Damage when 338 then return command_338 # Deal Damage
when 339; return command_339 # Force Action when 339 then return command_339 # Force Action
when 340; return command_340 # Abort Battle when 340 then return command_340 # Abort Battle
when 351; return command_351 # Call Menu Screen when 351 then return command_351 # Call Menu Screen
when 352; return command_352 # Call Save Screen when 352 then return command_352 # Call Save Screen
when 353; return command_353 # Game Over when 353 then return command_353 # Game Over
when 354; return command_354 # Return to Title Screen when 354 then return command_354 # Return to Title Screen
when 355; return command_355 # Script when 355 then return command_355 # Script
else; return true # Other else return true # Other
end end
end end
@@ -842,22 +842,22 @@ class Interpreter
character = get_character(@parameters[4]) character = get_character(@parameters[4])
if character != nil if character != nil
case @parameters[5] case @parameters[5]
when 0; value = character.x # x-coordinate when 0 then value = character.x # x-coordinate
when 1; value = character.y # y-coordinate when 1 then value = character.y # y-coordinate
when 2; value = character.direction # direction when 2 then value = character.direction # direction
when 3; value = character.screen_x # screen x-coordinate when 3 then value = character.screen_x # screen x-coordinate
when 4; value = character.screen_y # screen y-coordinate when 4 then value = character.screen_y # screen y-coordinate
when 5; value = character.terrain_tag # terrain tag when 5 then value = character.terrain_tag # terrain tag
end end
end end
when 7 # other when 7 # other
case @parameters[4] case @parameters[4]
when 0; value = $game_map.map_id # map ID when 0 then value = $game_map.map_id # map ID
# when 1, 3 # number of party members, steps # when 1, 3 # number of party members, steps
when 2; value = $Trainer.money # gold when 2 then value = $Trainer.money # gold
when 4; value = Graphics.frame_count / Graphics.frame_rate # play time when 4 then value = Graphics.frame_count / Graphics.frame_rate # play time
when 5; value = $game_system.timer / Graphics.frame_rate # timer when 5 then value = $game_system.timer / Graphics.frame_rate # timer
when 6; value = $game_system.save_count # save count when 6 then value = $game_system.save_count # save count
end end
end end
# Loop for group control # Loop for group control
@@ -1077,14 +1077,10 @@ class Interpreter
end end
# Set character direction # Set character direction
case @parameters[4] case @parameters[4]
when 8 # up when 2 then character.turn_down
character.turn_up when 4 then character.turn_left
when 6 # right when 6 then character.turn_right
character.turn_right when 8 then character.turn_up
when 2 # down
character.turn_down
when 4 # left
character.turn_left
end end
# Continue # Continue
return true return true
@@ -1113,10 +1109,10 @@ class Interpreter
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def command_204 def command_204
case @parameters[0] case @parameters[0]
when 0 # panorama when 0 # panorama
$game_map.panorama_name = @parameters[1] $game_map.panorama_name = @parameters[1]
$game_map.panorama_hue = @parameters[2] $game_map.panorama_hue = @parameters[2]
when 1 # fog when 1 # fog
$game_map.fog_name = @parameters[1] $game_map.fog_name = @parameters[1]
$game_map.fog_hue = @parameters[2] $game_map.fog_hue = @parameters[2]
$game_map.fog_opacity = @parameters[3] $game_map.fog_opacity = @parameters[3]
@@ -1124,7 +1120,7 @@ class Interpreter
$game_map.fog_zoom = @parameters[5] $game_map.fog_zoom = @parameters[5]
$game_map.fog_sx = @parameters[6] $game_map.fog_sx = @parameters[6]
$game_map.fog_sy = @parameters[7] $game_map.fog_sy = @parameters[7]
when 2 # battleback when 2 # battleback
$game_map.battleback_name = @parameters[1] $game_map.battleback_name = @parameters[1]
$game_temp.battleback_name = @parameters[1] $game_temp.battleback_name = @parameters[1]
end end

View File

@@ -72,10 +72,10 @@ class Scene_Map
end end
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y) $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
case $game_temp.player_new_direction case $game_temp.player_new_direction
when 2; $game_player.turn_down when 2 then $game_player.turn_down
when 4; $game_player.turn_left when 4 then $game_player.turn_left
when 6; $game_player.turn_right when 6 then $game_player.turn_right
when 8; $game_player.turn_up when 8 then $game_player.turn_up
end end
$game_player.straighten $game_player.straighten
$game_map.update $game_map.update

View File

@@ -471,14 +471,16 @@ module MiniRegistry
type = type.unpack("V")[0] type = type.unpack("V")[0]
data = data[0,size.unpack("V")[0]] data = data[0,size.unpack("V")[0]]
case type case type
when 1; return data.chop # REG_SZ when 1 then return data.chop # REG_SZ
when 2; return data.gsub(/%([^%]+)%/) { ENV[$1] || $& } # REG_EXPAND_SZ when 2 then return data.gsub(/%([^%]+)%/) { ENV[$1] || $& } # REG_EXPAND_SZ
when 3; return data # REG_BINARY when 3 then return data # REG_BINARY
when 4; return data.unpack("V")[0] # REG_DWORD when 4 then return data.unpack("V")[0] # REG_DWORD
when 5; return data.unpack("V")[0] # REG_DWORD_BIG_ENDIAN when 5 then return data.unpack("V")[0] # REG_DWORD_BIG_ENDIAN
when 11; data.unpack("VV"); return (data[1]<<32|data[0]) # REG_QWORD when 11 # REG_QWORD
else; raise "Type #{type} not supported." data.unpack("VV")
return (data[1]<<32|data[0])
end end
raise "Type #{type} not supported."
end end
private private
@@ -548,9 +550,9 @@ class StringInput
def seek(offset, whence=IO::SEEK_SET) def seek(offset, whence=IO::SEEK_SET)
raise IOError, 'closed stream' if @closed raise IOError, 'closed stream' if @closed
case whence case whence
when IO::SEEK_SET; @pos = offset when IO::SEEK_SET then @pos = offset
when IO::SEEK_CUR; @pos += offset when IO::SEEK_CUR then @pos += offset
when IO::SEEK_END; @pos = @string.size - offset when IO::SEEK_END then @pos = @string.size - offset
else else
raise ArgumentError, "unknown seek flag: #{whence}" raise ArgumentError, "unknown seek flag: #{whence}"
end end

View File

@@ -206,8 +206,8 @@ def pbRepositionMessageWindow(msgwindow, linecount=2)
end end
if $game_message if $game_message
case $game_message.background case $game_message.background
when 1; msgwindow.opacity=0 # dim when 1 then msgwindow.opacity=0 # dim
when 2; msgwindow.opacity=0 # transparent when 2 then msgwindow.opacity=0 # transparent
end end
end end
end end

View File

@@ -863,9 +863,9 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
next if block[0]>=block[1] next if block[0]>=block[1]
for i in block[0]...block[1] for i in block[0]...block[1]
case block[2] case block[2]
when 1; characters[i][1]=xDst+(widthDst-block[3]-4)+characters[i][1] when 1 then characters[i][1] = xDst + (widthDst - block[3] - 4) + characters[i][1]
when 2; characters[i][1]=xDst+((widthDst/2)-(block[3]/2))+characters[i][1] when 2 then characters[i][1] = xDst + ((widthDst / 2) - (block[3] / 2)) + characters[i][1]
else; characters[i][1]=xDst+characters[i][1] else characters[i][1] = xDst + characters[i][1]
end end
end end
end end

View File

@@ -1093,9 +1093,9 @@ class PokemonEntryScene2
@cursor3.update @cursor3.update
updateCursorPos updateCursorPos
case @cursortype case @cursortype
when 0; @sprite.bitmap=@cursor1.bitmap when 0 then @sprite.bitmap=@cursor1.bitmap
when 1; @sprite.bitmap=@cursor2.bitmap when 1 then @sprite.bitmap=@cursor2.bitmap
when 2; @sprite.bitmap=@cursor3.bitmap when 2 then @sprite.bitmap=@cursor3.bitmap
end end
end end
@@ -1369,19 +1369,19 @@ class PokemonEntryScene2
elsif Input.repeat?(Input::UP) elsif Input.repeat?(Input::UP)
if @cursorpos<0 # Controls if @cursorpos<0 # Controls
case @cursorpos case @cursorpos
when MODE1; @cursorpos = ROWS*(COLUMNS-1) when MODE1 then @cursorpos = ROWS*(COLUMNS-1)
when MODE2; @cursorpos = ROWS*(COLUMNS-1)+2 when MODE2 then @cursorpos = ROWS*(COLUMNS-1)+2
when MODE3; @cursorpos = ROWS*(COLUMNS-1)+4 when MODE3 then @cursorpos = ROWS*(COLUMNS-1)+4
when BACK; @cursorpos = ROWS*(COLUMNS-1)+8 when BACK then @cursorpos = ROWS*(COLUMNS-1)+8
when OK; @cursorpos = ROWS*(COLUMNS-1)+11 when OK then @cursorpos = ROWS*(COLUMNS-1)+11
end end
elsif @cursorpos<ROWS # Top row of letters elsif @cursorpos<ROWS # Top row of letters
case @cursorpos case @cursorpos
when 0,1; @cursorpos = MODE1 when 0, 1 then @cursorpos = MODE1
when 2,3; @cursorpos = MODE2 when 2, 3 then @cursorpos = MODE2
when 4,5,6; @cursorpos = MODE3 when 4, 5, 6 then @cursorpos = MODE3
when 7,8,9,10; @cursorpos = BACK when 7, 8, 9, 10 then @cursorpos = BACK
when 11,12; @cursorpos = OK when 11, 12 then @cursorpos = OK
end end
else else
cursordiv=wrapmod((cursordiv-1),COLUMNS) cursordiv=wrapmod((cursordiv-1),COLUMNS)
@@ -1390,11 +1390,11 @@ class PokemonEntryScene2
elsif Input.repeat?(Input::DOWN) elsif Input.repeat?(Input::DOWN)
if @cursorpos<0 # Controls if @cursorpos<0 # Controls
case @cursorpos case @cursorpos
when MODE1; @cursorpos = 0 when MODE1 then @cursorpos = 0
when MODE2; @cursorpos = 2 when MODE2 then @cursorpos = 2
when MODE3; @cursorpos = 4 when MODE3 then @cursorpos = 4
when BACK; @cursorpos = 8 when BACK then @cursorpos = 8
when OK; @cursorpos = 11 when OK then @cursorpos = 11
end end
elsif @cursorpos>=ROWS*(COLUMNS-1) # Bottom row of letters elsif @cursorpos>=ROWS*(COLUMNS-1) # Bottom row of letters
case @cursorpos case @cursorpos

View File

@@ -55,39 +55,39 @@ module Graphics
dc = File.basename(filename).downcase dc = File.basename(filename).downcase
case dc case dc
# Other coded transitions # Other coded transitions
when "breakingglass"; @@transition = Transitions::BreakingGlass.new(duration) when "breakingglass" then @@transition = Transitions::BreakingGlass.new(duration)
when "rotatingpieces"; @@transition = Transitions::ShrinkingPieces.new(duration, true) when "rotatingpieces" then @@transition = Transitions::ShrinkingPieces.new(duration, true)
when "shrinkingpieces"; @@transition = Transitions::ShrinkingPieces.new(duration, false) when "shrinkingpieces" then @@transition = Transitions::ShrinkingPieces.new(duration, false)
when "splash"; @@transition = Transitions::SplashTransition.new(duration) when "splash" then @@transition = Transitions::SplashTransition.new(duration)
when "random_stripe_v"; @@transition = Transitions::RandomStripeTransition.new(duration, 0) when "random_stripe_v" then @@transition = Transitions::RandomStripeTransition.new(duration, 0)
when "random_stripe_h"; @@transition = Transitions::RandomStripeTransition.new(duration, 1) when "random_stripe_h" then @@transition = Transitions::RandomStripeTransition.new(duration, 1)
when "zoomin"; @@transition = Transitions::ZoomInTransition.new(duration) when "zoomin" then @@transition = Transitions::ZoomInTransition.new(duration)
when "scrolldown"; @@transition = Transitions::ScrollScreen.new(duration, 2) when "scrolldown" then @@transition = Transitions::ScrollScreen.new(duration, 2)
when "scrollleft"; @@transition = Transitions::ScrollScreen.new(duration, 4) when "scrollleft" then @@transition = Transitions::ScrollScreen.new(duration, 4)
when "scrollright"; @@transition = Transitions::ScrollScreen.new(duration, 6) when "scrollright" then @@transition = Transitions::ScrollScreen.new(duration, 6)
when "scrollup"; @@transition = Transitions::ScrollScreen.new(duration, 8) when "scrollup" then @@transition = Transitions::ScrollScreen.new(duration, 8)
when "scrolldownleft"; @@transition = Transitions::ScrollScreen.new(duration, 1) when "scrolldownleft" then @@transition = Transitions::ScrollScreen.new(duration, 1)
when "scrolldownright"; @@transition = Transitions::ScrollScreen.new(duration, 3) when "scrolldownright" then @@transition = Transitions::ScrollScreen.new(duration, 3)
when "scrollupleft"; @@transition = Transitions::ScrollScreen.new(duration, 7) when "scrollupleft" then @@transition = Transitions::ScrollScreen.new(duration, 7)
when "scrollupright"; @@transition = Transitions::ScrollScreen.new(duration, 9) when "scrollupright" then @@transition = Transitions::ScrollScreen.new(duration, 9)
when "mosaic"; @@transition = Transitions::MosaicTransition.new(duration) when "mosaic" then @@transition = Transitions::MosaicTransition.new(duration)
# HGSS transitions # HGSS transitions
when "snakesquares"; @@transition = Transitions::SnakeSquares.new(duration) when "snakesquares" then @@transition = Transitions::SnakeSquares.new(duration)
when "diagonalbubbletl"; @@transition = Transitions::DiagonalBubble.new(duration, 0) when "diagonalbubbletl" then @@transition = Transitions::DiagonalBubble.new(duration, 0)
when "diagonalbubbletr"; @@transition = Transitions::DiagonalBubble.new(duration, 1) when "diagonalbubbletr" then @@transition = Transitions::DiagonalBubble.new(duration, 1)
when "diagonalbubblebl"; @@transition = Transitions::DiagonalBubble.new(duration, 2) when "diagonalbubblebl" then @@transition = Transitions::DiagonalBubble.new(duration, 2)
when "diagonalbubblebr"; @@transition = Transitions::DiagonalBubble.new(duration, 3) when "diagonalbubblebr" then @@transition = Transitions::DiagonalBubble.new(duration, 3)
when "risingsplash"; @@transition = Transitions::RisingSplash.new(duration) when "risingsplash" then @@transition = Transitions::RisingSplash.new(duration)
when "twoballpass"; @@transition = Transitions::TwoBallPass.new(duration) when "twoballpass" then @@transition = Transitions::TwoBallPass.new(duration)
when "spinballsplit"; @@transition = Transitions::SpinBallSplit.new(duration) when "spinballsplit" then @@transition = Transitions::SpinBallSplit.new(duration)
when "threeballdown"; @@transition = Transitions::ThreeBallDown.new(duration) when "threeballdown" then @@transition = Transitions::ThreeBallDown.new(duration)
when "balldown"; @@transition = Transitions::BallDown.new(duration) when "balldown" then @@transition = Transitions::BallDown.new(duration)
when "wavythreeballup"; @@transition = Transitions::WavyThreeBallUp.new(duration) when "wavythreeballup" then @@transition = Transitions::WavyThreeBallUp.new(duration)
when "wavyspinball"; @@transition = Transitions::WavySpinBall.new(duration) when "wavyspinball" then @@transition = Transitions::WavySpinBall.new(duration)
when "fourballburst"; @@transition = Transitions::FourBallBurst.new(duration) when "fourballburst" then @@transition = Transitions::FourBallBurst.new(duration)
# Graphic transitions # Graphic transitions
when ""; @@transition = Transitions::FadeTransition.new(duration) when "" then @@transition = Transitions::FadeTransition.new(duration)
else; ret = false else ret = false
end end
Graphics.frame_reset if ret Graphics.frame_reset if ret
return ret return ret
@@ -736,9 +736,9 @@ module Transitions
@sprites[k].visible = false @sprites[k].visible = false
@sprites[k].bitmap = @bitmap @sprites[k].bitmap = @bitmap
case origin case origin
when 1; k = i*cx+(cx-1-j) # Top right when 1 then k = i*cx+(cx-1-j) # Top right
when 2; k = @numtiles-1-(i*cx+(cx-1-j)) # Bottom left when 2 then k = @numtiles-1-(i*cx+(cx-1-j)) # Bottom left
when 3; k = @numtiles-1-k # Bottom right when 3 then k = @numtiles-1-k # Bottom right
end end
@frame[k] = ((0.6*j*width+0.8*i*height)*(@numframes/50)/l).floor @frame[k] = ((0.6*j*width+0.8*i*height)*(@numframes/50)/l).floor
end end

View File

@@ -117,9 +117,12 @@ def pbGetSpeciesData(species, form = 0, species_data_type = -1)
end end
return species_data[s][species_data_type] if species_data[s] && species_data[s][species_data_type] return species_data[s][species_data_type] if species_data[s] && species_data[s][species_data_type]
case species_data_type case species_data_type
when SpeciesData::TYPE2; return nil when SpeciesData::TYPE2
when SpeciesData::BASE_STATS; return [1, 1, 1, 1, 1, 1] return nil
when SpeciesData::EFFORT_POINTS; return [0, 0, 0, 0, 0, 0] when SpeciesData::BASE_STATS
return [1, 1, 1, 1, 1, 1]
when SpeciesData::EFFORT_POINTS
return [0, 0, 0, 0, 0, 0]
when SpeciesData::STEPS_TO_HATCH, SpeciesData::HEIGHT, SpeciesData::WEIGHT when SpeciesData::STEPS_TO_HATCH, SpeciesData::HEIGHT, SpeciesData::WEIGHT
return 1 return 1
end end

View File

@@ -104,7 +104,6 @@ module GameData
# @return [Boolean] whether other represents the same thing as this thing # @return [Boolean] whether other represents the same thing as this thing
def ==(other) def ==(other)
return false if other.nil? return false if other.nil?
validate other => [Symbol, self.class, String, Integer]
if other.is_a?(Symbol) if other.is_a?(Symbol)
return @id == other return @id == other
elsif other.is_a?(self.class) elsif other.is_a?(self.class)

View File

@@ -12,7 +12,6 @@ module GameData
include InstanceMethods include InstanceMethods
def initialize(hash) def initialize(hash)
validate hash => Hash, hash[:id] => Symbol
@id = hash[:id] @id = hash[:id]
@id_number = hash[:id_number] || -1 @id_number = hash[:id_number] || -1
@real_name = hash[:name] || "Unnamed" @real_name = hash[:name] || "Unnamed"

View File

@@ -19,7 +19,6 @@ module GameData
include InstanceMethods include InstanceMethods
def initialize(hash) def initialize(hash)
validate hash => Hash, hash[:id] => Symbol
@id = hash[:id] @id = hash[:id]
@id_number = hash[:id_number] || -1 @id_number = hash[:id_number] || -1
@real_name = hash[:name] || "Unnamed" @real_name = hash[:name] || "Unnamed"

View File

@@ -16,7 +16,6 @@ module GameData
include InstanceMethods include InstanceMethods
def initialize(hash) def initialize(hash)
validate hash => Hash, hash[:id] => Symbol
@id = hash[:id] @id = hash[:id]
@id_number = hash[:id_number] || -1 @id_number = hash[:id_number] || -1
@hours_per_stage = hash[:hours_per_stage] || 3 @hours_per_stage = hash[:hours_per_stage] || 3

View File

@@ -83,7 +83,6 @@ module GameData
end end
def initialize(hash) def initialize(hash)
validate hash => Hash, hash[:id] => Integer
@id = hash[:id] @id = hash[:id]
@home = hash[:home] @home = hash[:home]
@wild_battle_BGM = hash[:wild_battle_BGM] @wild_battle_BGM = hash[:wild_battle_BGM]

View File

@@ -77,7 +77,6 @@ module GameData
end end
def initialize(hash) def initialize(hash)
validate hash => Hash, hash[:id] => Integer
@id = hash[:id] @id = hash[:id]
@outdoor_map = hash[:outdoor_map] @outdoor_map = hash[:outdoor_map]
@announce_location = hash[:announce_location] @announce_location = hash[:announce_location]

View File

@@ -22,7 +22,6 @@ module GameData
include InstanceMethods include InstanceMethods
def initialize(hash) def initialize(hash)
validate hash => Hash, hash[:id] => Symbol
@id = hash[:id] @id = hash[:id]
@id_number = hash[:id_number] || -1 @id_number = hash[:id_number] || -1
@real_name = hash[:name] || "Unnamed" @real_name = hash[:name] || "Unnamed"

View File

@@ -10,14 +10,14 @@ module PBGenderRates
def self.genderByte(gender) def self.genderByte(gender)
case gender case gender
when AlwaysMale; return 0 when AlwaysMale then return 0
when FemaleOneEighth; return 32 when FemaleOneEighth then return 32
when Female25Percent; return 64 when Female25Percent then return 64
when Female50Percent; return 128 when Female50Percent then return 128
when Female75Percent; return 192 when Female75Percent then return 192
when FemaleSevenEighths; return 224 when FemaleSevenEighths then return 224
when AlwaysFemale; return 254 when AlwaysFemale then return 254
when Genderless; return 255 when Genderless then return 255
end end
return 255 # Default value (genderless) return 255 # Default value (genderless)
end end

View File

@@ -170,9 +170,9 @@ class PokeBattle_Battler
if hasActiveAbility?(:FORECAST) if hasActiveAbility?(:FORECAST)
newForm = 0 newForm = 0
case @battle.pbWeather case @battle.pbWeather
when PBWeather::Sun, PBWeather::HarshSun; newForm = 1 when PBWeather::Sun, PBWeather::HarshSun then newForm = 1
when PBWeather::Rain, PBWeather::HeavyRain; newForm = 2 when PBWeather::Rain, PBWeather::HeavyRain then newForm = 2
when PBWeather::Hail; newForm = 3 when PBWeather::Hail then newForm = 3
end end
if @form!=newForm if @form!=newForm
@battle.pbShowAbilitySplash(self,true) @battle.pbShowAbilitySplash(self,true)
@@ -187,9 +187,7 @@ class PokeBattle_Battler
if isSpecies?(:CHERRIM) if isSpecies?(:CHERRIM)
if hasActiveAbility?(:FLOWERGIFT) if hasActiveAbility?(:FLOWERGIFT)
newForm = 0 newForm = 0
case @battle.pbWeather newForm = 1 if [PBWeather::Sun, PBWeather::HarshSun].include?(@battle.pbWeather)
when PBWeather::Sun, PBWeather::HarshSun; newForm = 1
end
if @form!=newForm if @form!=newForm
@battle.pbShowAbilitySplash(self,true) @battle.pbShowAbilitySplash(self,true)
@battle.pbHideAbilitySplash(self) @battle.pbHideAbilitySplash(self)

View File

@@ -30,11 +30,11 @@ class PokeBattle_Battler
if showMessages if showMessages
msg = "" msg = ""
case self.status case self.status
when PBStatuses::SLEEP; msg = _INTL("{1} is already asleep!",pbThis) when PBStatuses::SLEEP then msg = _INTL("{1} is already asleep!",pbThis)
when PBStatuses::POISON; msg = _INTL("{1} is already poisoned!",pbThis) when PBStatuses::POISON then msg = _INTL("{1} is already poisoned!",pbThis)
when PBStatuses::BURN; msg = _INTL("{1} already has a burn!",pbThis) when PBStatuses::BURN then msg = _INTL("{1} already has a burn!",pbThis)
when PBStatuses::PARALYSIS; msg = _INTL("{1} is already paralyzed!",pbThis) when PBStatuses::PARALYSIS then msg = _INTL("{1} is already paralyzed!",pbThis)
when PBStatuses::FROZEN; msg = _INTL("{1} is already frozen solid!",pbThis) when PBStatuses::FROZEN then msg = _INTL("{1} is already frozen solid!",pbThis)
end end
@battle.pbDisplay(msg) @battle.pbDisplay(msg)
end end
@@ -124,11 +124,11 @@ class PokeBattle_Battler
msg = "" msg = ""
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
case newStatus case newStatus
when PBStatuses::SLEEP; msg = _INTL("{1} stays awake!",pbThis) when PBStatuses::SLEEP then msg = _INTL("{1} stays awake!",pbThis)
when PBStatuses::POISON; msg = _INTL("{1} cannot be poisoned!",pbThis) when PBStatuses::POISON then msg = _INTL("{1} cannot be poisoned!",pbThis)
when PBStatuses::BURN; msg = _INTL("{1} cannot be burned!",pbThis) when PBStatuses::BURN then msg = _INTL("{1} cannot be burned!",pbThis)
when PBStatuses::PARALYSIS; msg = _INTL("{1} cannot be paralyzed!",pbThis) when PBStatuses::PARALYSIS then msg = _INTL("{1} cannot be paralyzed!",pbThis)
when PBStatuses::FROZEN; msg = _INTL("{1} cannot be frozen solid!",pbThis) when PBStatuses::FROZEN then msg = _INTL("{1} cannot be frozen solid!",pbThis)
end end
elsif immAlly elsif immAlly
case newStatus case newStatus
@@ -150,11 +150,11 @@ class PokeBattle_Battler
end end
else else
case newStatus case newStatus
when PBStatuses::SLEEP; msg = _INTL("{1} stays awake because of its {2}!",pbThis,abilityName) when PBStatuses::SLEEP then msg = _INTL("{1} stays awake because of its {2}!",pbThis,abilityName)
when PBStatuses::POISON; msg = _INTL("{1}'s {2} prevents poisoning!",pbThis,abilityName) when PBStatuses::POISON then msg = _INTL("{1}'s {2} prevents poisoning!",pbThis,abilityName)
when PBStatuses::BURN; msg = _INTL("{1}'s {2} prevents burns!",pbThis,abilityName) when PBStatuses::BURN then msg = _INTL("{1}'s {2} prevents burns!",pbThis,abilityName)
when PBStatuses::PARALYSIS; msg = _INTL("{1}'s {2} prevents paralysis!",pbThis,abilityName) when PBStatuses::PARALYSIS then msg = _INTL("{1}'s {2} prevents paralysis!",pbThis,abilityName)
when PBStatuses::FROZEN; msg = _INTL("{1}'s {2} prevents freezing!",pbThis,abilityName) when PBStatuses::FROZEN then msg = _INTL("{1}'s {2} prevents freezing!",pbThis,abilityName)
end end
end end
@battle.pbDisplay(msg) @battle.pbDisplay(msg)
@@ -401,16 +401,20 @@ class PokeBattle_Battler
anim = ""; msg = "" anim = ""; msg = ""
case self.status case self.status
when PBStatuses::SLEEP when PBStatuses::SLEEP
anim = "Sleep"; msg = _INTL("{1} is fast asleep.",pbThis) anim = "Sleep"
msg = _INTL("{1} is fast asleep.", pbThis)
when PBStatuses::POISON when PBStatuses::POISON
anim = (@statusCount>0) ? "Toxic" : "Poison" anim = (@statusCount>0) ? "Toxic" : "Poison"
msg = _INTL("{1} was hurt by poison!",pbThis) msg = _INTL("{1} was hurt by poison!", pbThis)
when PBStatuses::BURN when PBStatuses::BURN
anim = "Burn"; msg = _INTL("{1} was hurt by its burn!",pbThis) anim = "Burn"
msg = _INTL("{1} was hurt by its burn!", pbThis)
when PBStatuses::PARALYSIS when PBStatuses::PARALYSIS
anim = "Paralysis"; msg = _INTL("{1} is paralyzed! It can't move!",pbThis) anim = "Paralysis"
msg = _INTL("{1} is paralyzed! It can't move!", pbThis)
when PBStatuses::FROZEN when PBStatuses::FROZEN
anim = "Frozen"; msg = _INTL("{1} is frozen solid!",pbThis) anim = "Frozen"
msg = _INTL("{1} is frozen solid!", pbThis)
end end
@battle.pbCommonAnimation(anim,self) if anim!="" @battle.pbCommonAnimation(anim,self) if anim!=""
yield if block_given? yield if block_given?
@@ -423,11 +427,11 @@ class PokeBattle_Battler
self.status = PBStatuses::NONE self.status = PBStatuses::NONE
if showMessages if showMessages
case oldStatus case oldStatus
when PBStatuses::SLEEP; @battle.pbDisplay(_INTL("{1} woke up!",pbThis)) when PBStatuses::SLEEP then @battle.pbDisplay(_INTL("{1} woke up!",pbThis))
when PBStatuses::POISON; @battle.pbDisplay(_INTL("{1} was cured of its poisoning.",pbThis)) when PBStatuses::POISON then @battle.pbDisplay(_INTL("{1} was cured of its poisoning.",pbThis))
when PBStatuses::BURN; @battle.pbDisplay(_INTL("{1}'s burn was healed.",pbThis)) when PBStatuses::BURN then @battle.pbDisplay(_INTL("{1}'s burn was healed.",pbThis))
when PBStatuses::PARALYSIS; @battle.pbDisplay(_INTL("{1} was cured of paralysis.",pbThis)) when PBStatuses::PARALYSIS then @battle.pbDisplay(_INTL("{1} was cured of paralysis.",pbThis))
when PBStatuses::FROZEN; @battle.pbDisplay(_INTL("{1} thawed out!",pbThis)) when PBStatuses::FROZEN then @battle.pbDisplay(_INTL("{1} thawed out!",pbThis))
end end
end end
PBDebug.log("[Status change] #{pbThis}'s status was cured") if !showMessages PBDebug.log("[Status change] #{pbThis}'s status was cured") if !showMessages

View File

@@ -162,10 +162,10 @@ class PokeBattle_Battler
end end
# Show refusal message and do nothing # Show refusal message and do nothing
case @battle.pbRandom(4) case @battle.pbRandom(4)
when 0; @battle.pbDisplay(_INTL("{1} won't obey!",pbThis)) when 0 then @battle.pbDisplay(_INTL("{1} won't obey!",pbThis))
when 1; @battle.pbDisplay(_INTL("{1} turned away!",pbThis)) when 1 then @battle.pbDisplay(_INTL("{1} turned away!",pbThis))
when 2; @battle.pbDisplay(_INTL("{1} is loafing around!",pbThis)) when 2 then @battle.pbDisplay(_INTL("{1} is loafing around!",pbThis))
when 3; @battle.pbDisplay(_INTL("{1} pretended not to notice!",pbThis)) when 3 then @battle.pbDisplay(_INTL("{1} pretended not to notice!",pbThis))
end end
return false return false
end end

View File

@@ -182,8 +182,8 @@ class PokeBattle_Move
return false if c<0 return false if c<0
# Move-specific "always/never a critical hit" effects # Move-specific "always/never a critical hit" effects
case pbCritialOverride(user,target) case pbCritialOverride(user,target)
when 1; return true when 1 then return true
when -1; return false when -1 then return false
end end
# Other effects # Other effects
return true if c>50 # Merciless return true if c>50 # Merciless

View File

@@ -366,9 +366,9 @@ class PokeBattle_Move_017 < PokeBattle_Move
def pbAdditionalEffect(user,target) def pbAdditionalEffect(user,target)
return if target.damageState.substitute return if target.damageState.substitute
case @battle.pbRandom(3) case @battle.pbRandom(3)
when 0; target.pbBurn(user) if target.pbCanBurn?(user,false,self) when 0 then target.pbBurn(user) if target.pbCanBurn?(user, false, self)
when 1; target.pbFreeze if target.pbCanFreeze?(user,false,self) when 1 then target.pbFreeze if target.pbCanFreeze?(user, false, self)
when 2; target.pbParalyze(user) if target.pbCanParalyze?(user,false,self) when 2 then target.pbParalyze(user) if target.pbCanParalyze?(user, false, self)
end end
end end
end end
@@ -1893,24 +1893,24 @@ class PokeBattle_Move_060 < PokeBattle_Move
end end
if !checkedTerrain if !checkedTerrain
case @battle.environment case @battle.environment
when PBEnvironment::Grass; @newType = getID(PBTypes,:GRASS) when PBEnvironment::Grass then @newType = getID(PBTypes,:GRASS)
when PBEnvironment::TallGrass; @newType = getID(PBTypes,:GRASS) when PBEnvironment::TallGrass then @newType = getID(PBTypes,:GRASS)
when PBEnvironment::MovingWater; @newType = getID(PBTypes,:WATER) when PBEnvironment::MovingWater then @newType = getID(PBTypes,:WATER)
when PBEnvironment::StillWater; @newType = getID(PBTypes,:WATER) when PBEnvironment::StillWater then @newType = getID(PBTypes,:WATER)
when PBEnvironment::Puddle; @newType = getID(PBTypes,:WATER) when PBEnvironment::Puddle then @newType = getID(PBTypes,:WATER)
when PBEnvironment::Underwater; @newType = getID(PBTypes,:WATER) when PBEnvironment::Underwater then @newType = getID(PBTypes,:WATER)
when PBEnvironment::Cave; @newType = getID(PBTypes,:ROCK) when PBEnvironment::Cave then @newType = getID(PBTypes,:ROCK)
when PBEnvironment::Rock; @newType = getID(PBTypes,:GROUND) when PBEnvironment::Rock then @newType = getID(PBTypes,:GROUND)
when PBEnvironment::Sand; @newType = getID(PBTypes,:GROUND) when PBEnvironment::Sand then @newType = getID(PBTypes,:GROUND)
when PBEnvironment::Forest; @newType = getID(PBTypes,:BUG) when PBEnvironment::Forest then @newType = getID(PBTypes,:BUG)
when PBEnvironment::ForestGrass; @newType = getID(PBTypes,:BUG) when PBEnvironment::ForestGrass then @newType = getID(PBTypes,:BUG)
when PBEnvironment::Snow; @newType = getID(PBTypes,:ICE) when PBEnvironment::Snow then @newType = getID(PBTypes,:ICE)
when PBEnvironment::Ice; @newType = getID(PBTypes,:ICE) when PBEnvironment::Ice then @newType = getID(PBTypes,:ICE)
when PBEnvironment::Volcano; @newType = getID(PBTypes,:FIRE) when PBEnvironment::Volcano then @newType = getID(PBTypes,:FIRE)
when PBEnvironment::Graveyard; @newType = getID(PBTypes,:GHOST) when PBEnvironment::Graveyard then @newType = getID(PBTypes,:GHOST)
when PBEnvironment::Sky; @newType = getID(PBTypes,:FLYING) when PBEnvironment::Sky then @newType = getID(PBTypes,:FLYING)
when PBEnvironment::Space; @newType = getID(PBTypes,:DRAGON) when PBEnvironment::Space then @newType = getID(PBTypes,:DRAGON)
when PBEnvironment::UltraSpace; @newType = getID(PBTypes,:PSYCHIC) when PBEnvironment::UltraSpace then @newType = getID(PBTypes,:PSYCHIC)
end end
end end
if !user.pbHasOtherType?(@newType) if !user.pbHasOtherType?(@newType)

View File

@@ -958,20 +958,20 @@ class PokeBattle_Move_0A4 < PokeBattle_Move
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true) def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
id = :BODYSLAM # Environment-specific anim id = :BODYSLAM # Environment-specific anim
case @secretPower case @secretPower
when 1; id = :THUNDERSHOCK if GameData::Move.exists?(:THUNDERSHOCK) when 1 then id = :THUNDERSHOCK if GameData::Move.exists?(:THUNDERSHOCK)
when 2; id = :VINEWHIP if GameData::Move.exists?(:VINEWHIP) when 2 then id = :VINEWHIP if GameData::Move.exists?(:VINEWHIP)
when 3; id = :FAIRYWIND if GameData::Move.exists?(:FAIRYWIND) when 3 then id = :FAIRYWIND if GameData::Move.exists?(:FAIRYWIND)
when 4; id = :CONFUSIO if GameData::Move.exists?(:CONFUSION) when 4 then id = :CONFUSIO if GameData::Move.exists?(:CONFUSION)
when 5; id = :WATERPULSE if GameData::Move.exists?(:WATERPULSE) when 5 then id = :WATERPULSE if GameData::Move.exists?(:WATERPULSE)
when 6; id = :MUDSHOT if GameData::Move.exists?(:MUDSHOT) when 6 then id = :MUDSHOT if GameData::Move.exists?(:MUDSHOT)
when 7; id = :ROCKTHROW if GameData::Move.exists?(:ROCKTHROW) when 7 then id = :ROCKTHROW if GameData::Move.exists?(:ROCKTHROW)
when 8; id = :MUDSLAP if GameData::Move.exists?(:MUDSLAP) when 8 then id = :MUDSLAP if GameData::Move.exists?(:MUDSLAP)
when 9; id = :ICESHARD if GameData::Move.exists?(:ICESHARD) when 9 then id = :ICESHARD if GameData::Move.exists?(:ICESHARD)
when 10; id = :INCINERATE if GameData::Move.exists?(:INCINERATE) when 10 then id = :INCINERATE if GameData::Move.exists?(:INCINERATE)
when 11; id = :SHADOWSNEAK if GameData::Move.exists?(:SHADOWSNEAK) when 11 then id = :SHADOWSNEAK if GameData::Move.exists?(:SHADOWSNEAK)
when 12; id = :GUST if GameData::Move.exists?(:GUST) when 12 then id = :GUST if GameData::Move.exists?(:GUST)
when 13; id = :SWIFT if GameData::Move.exists?(:SWIFT) when 13 then id = :SWIFT if GameData::Move.exists?(:SWIFT)
when 14; id = :PSYWAVE if GameData::Move.exists?(:PSYWAVE) when 14 then id = :PSYWAVE if GameData::Move.exists?(:PSYWAVE)
end end
super super
end end

View File

@@ -563,9 +563,9 @@ class PokeBattle_Move_114 < PokeBattle_Move
def pbEffectGeneral(user) def pbEffectGeneral(user)
hpGain = 0 hpGain = 0
case [user.effects[PBEffects::Stockpile],1].max case [user.effects[PBEffects::Stockpile],1].max
when 1; hpGain = user.totalhp/4 when 1 then hpGain = user.totalhp/4
when 2; hpGain = user.totalhp/2 when 2 then hpGain = user.totalhp/2
when 3; hpGain = user.totalhp when 3 then hpGain = user.totalhp
end end
if user.pbRecoverHP(hpGain)>0 if user.pbRecoverHP(hpGain)>0
@battle.pbDisplay(_INTL("{1}'s HP was restored.",user.pbThis)) @battle.pbDisplay(_INTL("{1}'s HP was restored.",user.pbThis))

View File

@@ -12,14 +12,14 @@ begin
def self.animationName(weather) def self.animationName(weather)
case weather case weather
when Sun; return "Sun" when Sun then return "Sun"
when Rain; return "Rain" when Rain then return "Rain"
when Sandstorm; return "Sandstorm" when Sandstorm then return "Sandstorm"
when Hail; return "Hail" when Hail then return "Hail"
when HarshSun; return "HarshSun" when HarshSun then return "HarshSun"
when HeavyRain; return "HeavyRain" when HeavyRain then return "HeavyRain"
when StrongWinds; return "StrongWinds" when StrongWinds then return "StrongWinds"
when ShadowSky; return "ShadowSky" when ShadowSky then return "ShadowSky"
end end
return nil return nil
end end

View File

@@ -179,15 +179,15 @@ class PokeBattle_Battle
def setBattleMode(mode) def setBattleMode(mode)
@sideSizes = @sideSizes =
case mode case mode
when "triple", "3v3"; [3,3] when "triple", "3v3" then [3, 3]
when "3v2"; [3,2] when "3v2" then [3, 2]
when "3v1"; [3,1] when "3v1" then [3, 1]
when "2v3"; [2,3] when "2v3" then [2, 3]
when "double", "2v2"; [2,2] when "double", "2v2" then [2, 2]
when "2v1"; [2,1] when "2v1" then [2, 1]
when "1v3"; [1,3] when "1v3" then [1, 3]
when "1v2"; [1,2] when "1v2" then [1, 2]
else; [1,1] # Single, 1v1 (default) else [1, 1] # Single, 1v1 (default)
end end
end end
@@ -220,7 +220,8 @@ class PokeBattle_Battle
n = pbSideSize(idxBattler%2) n = pbSideSize(idxBattler%2)
return [0,0,1][idxBattler/2] if n==3 return [0,0,1][idxBattler/2] if n==3
return idxBattler/2 # Same as [0,1][idxBattler/2], i.e. 2 battler slots return idxBattler/2 # Same as [0,1][idxBattler/2], i.e. 2 battler slots
when 3; return idxBattler/2 when 3
return idxBattler/2
end end
return 0 return 0
end end
@@ -658,14 +659,14 @@ class PokeBattle_Battle
pbCommonAnimation(PBWeather.animationName(@field.weather)) if showAnim pbCommonAnimation(PBWeather.animationName(@field.weather)) if showAnim
pbHideAbilitySplash(user) if user pbHideAbilitySplash(user) if user
case @field.weather case @field.weather
when PBWeather::Sun; pbDisplay(_INTL("The sunlight turned harsh!")) when PBWeather::Sun then pbDisplay(_INTL("The sunlight turned harsh!"))
when PBWeather::Rain; pbDisplay(_INTL("It started to rain!")) when PBWeather::Rain then pbDisplay(_INTL("It started to rain!"))
when PBWeather::Sandstorm; pbDisplay(_INTL("A sandstorm brewed!")) when PBWeather::Sandstorm then pbDisplay(_INTL("A sandstorm brewed!"))
when PBWeather::Hail; pbDisplay(_INTL("It started to hail!")) when PBWeather::Hail then pbDisplay(_INTL("It started to hail!"))
when PBWeather::HarshSun; pbDisplay(_INTL("The sunlight turned extremely harsh!")) when PBWeather::HarshSun then pbDisplay(_INTL("The sunlight turned extremely harsh!"))
when PBWeather::HeavyRain; pbDisplay(_INTL("A heavy rain began to fall!")) when PBWeather::HeavyRain then pbDisplay(_INTL("A heavy rain began to fall!"))
when PBWeather::StrongWinds; pbDisplay(_INTL("Mysterious strong winds are protecting Flying-type Pokémon!")) when PBWeather::StrongWinds then pbDisplay(_INTL("Mysterious strong winds are protecting Flying-type Pokémon!"))
when PBWeather::ShadowSky; pbDisplay(_INTL("A shadow sky appeared!")) when PBWeather::ShadowSky then pbDisplay(_INTL("A shadow sky appeared!"))
end end
# Check for end of primordial weather, and weather-triggered form changes # Check for end of primordial weather, and weather-triggered form changes
eachBattler { |b| b.pbCheckFormOnWeatherChange } eachBattler { |b| b.pbCheckFormOnWeatherChange }

View File

@@ -273,14 +273,14 @@ class PokeBattle_Battle
# Weather announcement # Weather announcement
pbCommonAnimation(PBWeather.animationName(@field.weather)) pbCommonAnimation(PBWeather.animationName(@field.weather))
case @field.weather case @field.weather
when PBWeather::Sun; pbDisplay(_INTL("The sunlight is strong.")) when PBWeather::Sun then pbDisplay(_INTL("The sunlight is strong."))
when PBWeather::Rain; pbDisplay(_INTL("It is raining.")) when PBWeather::Rain then pbDisplay(_INTL("It is raining."))
when PBWeather::Sandstorm; pbDisplay(_INTL("A sandstorm is raging.")) when PBWeather::Sandstorm then pbDisplay(_INTL("A sandstorm is raging."))
when PBWeather::Hail; pbDisplay(_INTL("Hail is falling.")) when PBWeather::Hail then pbDisplay(_INTL("Hail is falling."))
when PBWeather::HarshSun; pbDisplay(_INTL("The sunlight is extremely harsh.")) when PBWeather::HarshSun then pbDisplay(_INTL("The sunlight is extremely harsh."))
when PBWeather::HeavyRain; pbDisplay(_INTL("It is raining heavily.")) when PBWeather::HeavyRain then pbDisplay(_INTL("It is raining heavily."))
when PBWeather::StrongWinds; pbDisplay(_INTL("The wind is strong.")) when PBWeather::StrongWinds then pbDisplay(_INTL("The wind is strong."))
when PBWeather::ShadowSky; pbDisplay(_INTL("The sky is shadowy.")) when PBWeather::ShadowSky then pbDisplay(_INTL("The sky is shadowy."))
end end
# Terrain announcement # Terrain announcement
pbCommonAnimation(PBBattleTerrains.animationName(@field.terrain)) pbCommonAnimation(PBBattleTerrains.animationName(@field.terrain))

View File

@@ -61,14 +61,14 @@ class PokeBattle_Battle
# Weather continues # Weather continues
pbCommonAnimation(PBWeather.animationName(@field.weather)) pbCommonAnimation(PBWeather.animationName(@field.weather))
case @field.weather case @field.weather
# when PBWeather::Sun; pbDisplay(_INTL("The sunlight is strong.")) # when PBWeather::Sun then pbDisplay(_INTL("The sunlight is strong."))
# when PBWeather::Rain; pbDisplay(_INTL("Rain continues to fall.")) # when PBWeather::Rain then pbDisplay(_INTL("Rain continues to fall."))
when PBWeather::Sandstorm; pbDisplay(_INTL("The sandstorm is raging.")) when PBWeather::Sandstorm then pbDisplay(_INTL("The sandstorm is raging."))
when PBWeather::Hail; pbDisplay(_INTL("The hail is crashing down.")) when PBWeather::Hail then pbDisplay(_INTL("The hail is crashing down."))
# when PBWeather::HarshSun; pbDisplay(_INTL("The sunlight is extremely harsh.")) # when PBWeather::HarshSun then pbDisplay(_INTL("The sunlight is extremely harsh."))
# when PBWeather::HeavyRain; pbDisplay(_INTL("It is raining heavily.")) # when PBWeather::HeavyRain then pbDisplay(_INTL("It is raining heavily."))
# when PBWeather::StrongWinds; pbDisplay(_INTL("The wind is strong.")) # when PBWeather::StrongWinds then pbDisplay(_INTL("The wind is strong."))
when PBWeather::ShadowSky; pbDisplay(_INTL("The shadow sky continues.")); when PBWeather::ShadowSky then pbDisplay(_INTL("The shadow sky continues."))
end end
# Effects due to weather # Effects due to weather
curWeather = pbWeather curWeather = pbWeather
@@ -132,10 +132,10 @@ class PokeBattle_Battle
# Terrain continues # Terrain continues
pbCommonAnimation(PBBattleTerrains.animationName(@field.terrain)) pbCommonAnimation(PBBattleTerrains.animationName(@field.terrain))
case @field.terrain case @field.terrain
when PBBattleTerrains::Electric; pbDisplay(_INTL("An electric current is running across the battlefield.")) when PBBattleTerrains::Electric then pbDisplay(_INTL("An electric current is running across the battlefield."))
when PBBattleTerrains::Grassy; pbDisplay(_INTL("Grass is covering the battlefield.")) when PBBattleTerrains::Grassy then pbDisplay(_INTL("Grass is covering the battlefield."))
when PBBattleTerrains::Misty; pbDisplay(_INTL("Mist is swirling about the battlefield.")) when PBBattleTerrains::Misty then pbDisplay(_INTL("Mist is swirling about the battlefield."))
when PBBattleTerrains::Psychic; pbDisplay(_INTL("The battlefield is weird.")) when PBBattleTerrains::Psychic then pbDisplay(_INTL("The battlefield is weird."))
end end
end end
@@ -174,8 +174,8 @@ class PokeBattle_Battle
# Get the position to move to # Get the position to move to
pos = -1 pos = -1
case pbSideSize(side) case pbSideSize(side)
when 2; pos = [2,3,0,1][b.index] # The unoccupied position when 2 then pos = [2,3,0,1][b.index] # The unoccupied position
when 3; pos = (side==0) ? 2 : 3 # The centre position when 3 then pos = (side==0) ? 2 : 3 # The centre position
end end
next if pos<0 next if pos<0
# Can't move if the same trainer doesn't control both positions # Can't move if the same trainer doesn't control both positions

View File

@@ -9,10 +9,10 @@ begin
def self.animationName(terrain) def self.animationName(terrain)
case terrain case terrain
when Electric; return "ElectricTerrain" when Electric then return "ElectricTerrain"
when Grassy; return "GrassyTerrain" when Grassy then return "GrassyTerrain"
when Misty; return "MistyTerrain" when Misty then return "MistyTerrain"
when Psychic; return "PsychicTerrain" when Psychic then return "PsychicTerrain"
end end
return nil return nil
end end

View File

@@ -146,11 +146,11 @@ class PokeBattle_AI
stage = battler.stages[stat]+6 stage = battler.stages[stat]+6
value = 0 value = 0
case stat case stat
when PBStats::ATTACK; value = battler.attack when PBStats::ATTACK then value = battler.attack
when PBStats::DEFENSE; value = battler.defense when PBStats::DEFENSE then value = battler.defense
when PBStats::SPATK; value = battler.spatk when PBStats::SPATK then value = battler.spatk
when PBStats::SPDEF; value = battler.spdef when PBStats::SPDEF then value = battler.spdef
when PBStats::SPEED; value = battler.speed when PBStats::SPEED then value = battler.speed
end end
return (value.to_f*stageMul[stage]/stageDiv[stage]).floor return (value.to_f*stageMul[stage]/stageDiv[stage]).floor
end end

View File

@@ -65,21 +65,21 @@ module PokeBattle_BallAnimationMixin
# Poké Ball. # Poké Ball.
def getBattlerColorFromBallType(ballType) def getBattlerColorFromBallType(ballType)
case ballType case ballType
when 1; return Color.new(132, 189, 247) # Great Ball when 1 then return Color.new(132, 189, 247) # Great Ball
when 2; return Color.new(189, 247, 165) # Safari Ball when 2 then return Color.new(189, 247, 165) # Safari Ball
when 3; return Color.new(255, 255, 123) # Ultra Ball when 3 then return Color.new(255, 255, 123) # Ultra Ball
when 4; return Color.new(189, 165, 231) # Master Ball when 4 then return Color.new(189, 165, 231) # Master Ball
when 5; return Color.new(173, 255, 206) # Net Ball when 5 then return Color.new(173, 255, 206) # Net Ball
when 6; return Color.new( 99, 206, 247) # Dive Ball when 6 then return Color.new( 99, 206, 247) # Dive Ball
when 7; return Color.new(247, 222, 82) # Nest Ball when 7 then return Color.new(247, 222, 82) # Nest Ball
when 8; return Color.new(255, 198, 132) # Repeat Ball when 8 then return Color.new(255, 198, 132) # Repeat Ball
when 9; return Color.new(239, 247, 247) # Timer Ball when 9 then return Color.new(239, 247, 247) # Timer Ball
when 10; return Color.new(255, 140, 82) # Luxury Ball when 10 then return Color.new(255, 140, 82) # Luxury Ball
when 11; return Color.new(255, 74, 82) # Premier Ball when 11 then return Color.new(255, 74, 82) # Premier Ball
when 12; return Color.new(115, 115, 140) # Dusk Ball when 12 then return Color.new(115, 115, 140) # Dusk Ball
when 13; return Color.new(255, 198, 231) # Heal Ball when 13 then return Color.new(255, 198, 231) # Heal Ball
when 14; return Color.new(140, 214, 255) # Quick Ball when 14 then return Color.new(140, 214, 255) # Quick Ball
when 15; return Color.new(247, 66, 41) # Cherish Ball when 15 then return Color.new(247, 66, 41) # Cherish Ball
end end
return Color.new(255, 181, 247) # Poké Ball, Sport Ball, Apricorn Balls, others return Color.new(255, 181, 247) # Poké Ball, Sport Ball, Apricorn Balls, others
end end

View File

@@ -623,9 +623,9 @@ class BattlerDamageAnimation < PokeBattle_Animation
# Animation # Animation
delay = 0 delay = 0
case @effectiveness case @effectiveness
when 0; battler.setSE(delay,"Battle damage normal") when 0 then battler.setSE(delay, "Battle damage normal")
when 1; battler.setSE(delay,"Battle damage weak") when 1 then battler.setSE(delay, "Battle damage weak")
when 2; battler.setSE(delay,"Battle damage super") when 2 then battler.setSE(delay, "Battle damage super")
end end
4.times do # 4 flashes, each lasting 0.2 (4/20) seconds 4.times do # 4 flashes, each lasting 0.2 (4/20) seconds
battler.setVisible(delay,false) battler.setVisible(delay,false)

View File

@@ -350,8 +350,8 @@ class PokemonDataBox < SpriteWrapper
# Data box bobbing while Pokémon is selected # Data box bobbing while Pokémon is selected
if @selected==1 || @selected==2 # Choosing commands/targeted or damaged if @selected==1 || @selected==2 # Choosing commands/targeted or damaged
case (frameCounter/QUARTER_ANIM_PERIOD).floor case (frameCounter/QUARTER_ANIM_PERIOD).floor
when 1; self.y = @spriteY-2 when 1 then self.y = @spriteY-2
when 3; self.y = @spriteY+2 when 3 then self.y = @spriteY+2
end end
end end
end end
@@ -574,8 +574,8 @@ class PokemonBattlerSprite < RPG::Sprite
@spriteYExtra = 0 @spriteYExtra = 0
if @selected==1 # When choosing commands for this Pokémon if @selected==1 # When choosing commands for this Pokémon
case (frameCounter/QUARTER_ANIM_PERIOD).floor case (frameCounter/QUARTER_ANIM_PERIOD).floor
when 1; @spriteYExtra = 2 when 1 then @spriteYExtra = 2
when 3; @spriteYExtra = -2 when 3 then @spriteYExtra = -2
end end
end end
self.x = self.x self.x = self.x
@@ -584,8 +584,8 @@ class PokemonBattlerSprite < RPG::Sprite
# Pokémon sprite blinking when targeted # Pokémon sprite blinking when targeted
if @selected==2 && @spriteVisible if @selected==2 && @spriteVisible
case (frameCounter/SIXTH_ANIM_PERIOD).floor case (frameCounter/SIXTH_ANIM_PERIOD).floor
when 2, 5; self.visible = false when 2, 5 then self.visible = false
else; self.visible = true else self.visible = true
end end
end end
@updating = false @updating = false

View File

@@ -93,8 +93,8 @@ class PokeBattle_Scene
def pbCreateBackdropSprites def pbCreateBackdropSprites
case @battle.time case @battle.time
when 1; time = "eve" when 1 then time = "eve"
when 2; time = "night" when 2 then time = "night"
end end
# Put everything together into backdrop, bases and message bar filenames # Put everything together into backdrop, bases and message bar filenames
backdropFilename = @battle.backdrop backdropFilename = @battle.backdrop

View File

@@ -565,14 +565,26 @@ def pbFacingTileRegular(direction=nil,event=nil)
y = event.y y = event.y
direction = event.direction if !direction direction = event.direction if !direction
case direction case direction
when 1; y += 1; x -= 1 when 1
when 2; y += 1 y += 1
when 3; y += 1; x += 1 x -= 1
when 4; x -= 1 when 2
when 6; x += 1 y += 1
when 7; y -= 1; x -= 1 when 3
when 8; y -= 1 y += 1
when 9; y -= 1; x += 1 x += 1
when 4
x -= 1
when 6
x += 1
when 7
y -= 1
x -= 1
when 8
y -= 1
when 9
y -= 1
x += 1
end end
return [$game_map.map_id,x,y] return [$game_map.map_id,x,y]
end end
@@ -652,10 +664,10 @@ module InterpreterFieldMixin
# tiles that are passable only from certain directions # tiles that are passable only from certain directions
return if !event.passableStrict?(event.x,event.y,$game_player.direction) return if !event.passableStrict?(event.x,event.y,$game_player.direction)
case $game_player.direction case $game_player.direction
when 2; event.move_down # down when 2 then event.move_down
when 4; event.move_left # left when 4 then event.move_left
when 6; event.move_right # right when 6 then event.move_right
when 8; event.move_up # up when 8 then event.move_up
end end
$PokemonMap.addMovedEvent(@event_id) if $PokemonMap $PokemonMap.addMovedEvent(@event_id) if $PokemonMap
if oldx!=event.x || oldy!=event.y if oldx!=event.x || oldy!=event.y
@@ -1098,10 +1110,10 @@ def pbJumpToward(dist=1,playSound=false,cancelSurf=false)
x = $game_player.x x = $game_player.x
y = $game_player.y y = $game_player.y
case $game_player.direction case $game_player.direction
when 2; $game_player.jump(0,dist) # down when 2 then $game_player.jump(0, dist) # down
when 4; $game_player.jump(-dist,0) # left when 4 then $game_player.jump(-dist, 0) # left
when 6; $game_player.jump(dist,0) # right when 6 then $game_player.jump(dist, 0) # right
when 8; $game_player.jump(0,-dist) # up when 8 then $game_player.jump(0, -dist) # up
end end
if $game_player.x!=x || $game_player.y!=y if $game_player.x!=x || $game_player.y!=y
pbSEPlay("Player jump") if playSound pbSEPlay("Player jump") if playSound
@@ -1276,10 +1288,18 @@ def pbSetEscapePoint
xco = $game_player.x xco = $game_player.x
yco = $game_player.y yco = $game_player.y
case $game_player.direction case $game_player.direction
when 2; yco -= 1; dir = 8 # Down when 2 # Down
when 4; xco += 1; dir = 6 # Left yco -= 1
when 6; xco -= 1; dir = 4 # Right dir = 8
when 8; yco += 1; dir = 2 # Up when 4 # Left
xco += 1
dir = 6
when 6 # Right
xco -= 1
dir = 4
when 8 # Up
yco += 1
dir = 2
end end
$PokemonGlobal.escapePoint = [$game_map.map_id,xco,yco,dir] $PokemonGlobal.escapePoint = [$game_map.map_id,xco,yco,dir]
end end

View File

@@ -703,10 +703,10 @@ end
def pbScrollMap(direction,distance,speed) def pbScrollMap(direction,distance,speed)
if speed==0 if speed==0
case direction case direction
when 2; $game_map.scroll_down(distance * Game_Map::REAL_RES_Y) when 2 then $game_map.scroll_down(distance * Game_Map::REAL_RES_Y)
when 4; $game_map.scroll_left(distance * Game_Map::REAL_RES_X) when 4 then $game_map.scroll_left(distance * Game_Map::REAL_RES_X)
when 6; $game_map.scroll_right(distance * Game_Map::REAL_RES_X) when 6 then $game_map.scroll_right(distance * Game_Map::REAL_RES_X)
when 8; $game_map.scroll_up(distance * Game_Map::REAL_RES_Y) when 8 then $game_map.scroll_up(distance * Game_Map::REAL_RES_Y)
end end
else else
$game_map.start_scroll(direction, distance, speed) $game_map.start_scroll(direction, distance, speed)

View File

@@ -206,11 +206,11 @@ module RPG
@sprites.each { |s| s.dispose } @sprites.each { |s| s.dispose }
@sprites.clear @sprites.clear
return return
when PBFieldWeather::Rain; prepareRainBitmap when PBFieldWeather::Rain then prepareRainBitmap
when PBFieldWeather::HeavyRain, PBFieldWeather::Storm; prepareStormBitmap when PBFieldWeather::HeavyRain, PBFieldWeather::Storm then prepareStormBitmap
when PBFieldWeather::Snow; prepareSnowBitmaps when PBFieldWeather::Snow then prepareSnowBitmaps
when PBFieldWeather::Blizzard; prepareBlizzardBitmaps when PBFieldWeather::Blizzard then prepareBlizzardBitmaps
when PBFieldWeather::Sandstorm; prepareSandstormBitmaps when PBFieldWeather::Sandstorm then prepareSandstormBitmaps
end end
weatherBitmaps = (@type==PBFieldWeather::None || @type==PBFieldWeather::Sun) ? nil : @weatherTypes[@type][0] weatherBitmaps = (@type==PBFieldWeather::None || @type==PBFieldWeather::Sun) ? nil : @weatherTypes[@type][0]
ensureSprites ensureSprites
@@ -226,13 +226,13 @@ module RPG
# @max is (power+1)*4, where power is between 1 and 9 # @max is (power+1)*4, where power is between 1 and 9
# Set tone of viewport (general screen brightening/darkening) # Set tone of viewport (general screen brightening/darkening)
case @type case @type
when PBFieldWeather::None; @viewport.tone.set(0,0,0,0) when PBFieldWeather::None then @viewport.tone.set(0, 0, 0, 0)
when PBFieldWeather::Rain; @viewport.tone.set(-@max*3/4, -@max*3/4, -@max*3/4, 10) when PBFieldWeather::Rain then @viewport.tone.set(-@max * 3 / 4, -@max * 3 / 4, -@max * 3 / 4, 10)
when PBFieldWeather::HeavyRain; @viewport.tone.set(-@max*6/4, -@max*6/4, -@max*6/4, 20) when PBFieldWeather::HeavyRain then @viewport.tone.set(-@max * 6 / 4, -@max * 6 / 4, -@max * 6 / 4, 20)
when PBFieldWeather::Storm; @viewport.tone.set(-@max*6/4, -@max*6/4, -@max*6/4, 20) when PBFieldWeather::Storm then @viewport.tone.set(-@max * 6 / 4, -@max * 6 / 4, -@max * 6 / 4, 20)
when PBFieldWeather::Snow; @viewport.tone.set( @max/2, @max/2, @max/2, 0) when PBFieldWeather::Snow then @viewport.tone.set( @max / 2, @max / 2, @max / 2, 0)
when PBFieldWeather::Blizzard; @viewport.tone.set( @max*3/4, @max*3/4, max*3/4, 0) when PBFieldWeather::Blizzard then @viewport.tone.set( @max * 3 / 4, @max * 3 / 4, max * 3 / 4, 0)
when PBFieldWeather::Sandstorm; @viewport.tone.set( @max/2, 0, -@max/2, 0) when PBFieldWeather::Sandstorm then @viewport.tone.set( @max / 2, 0, -@max / 2, 0)
when PBFieldWeather::Sun when PBFieldWeather::Sun
@sun = @max if @sun!=@max && @sun!=-@max @sun = @max if @sun!=@max && @sun!=-@max
@sun = -@sun if @sunValue>@max || @sunValue<0 @sun = -@sun if @sunValue>@max || @sunValue<0

View File

@@ -182,10 +182,10 @@ class PokemonMapMetadata
next if !$game_map.events[i[0][1]] next if !$game_map.events[i[0][1]]
$game_map.events[i[0][1]].moveto(i[1][0],i[1][1]) $game_map.events[i[0][1]].moveto(i[1][0],i[1][1])
case i[1][2] case i[1][2]
when 2; $game_map.events[i[0][1]].turn_down when 2 then $game_map.events[i[0][1]].turn_down
when 4; $game_map.events[i[0][1]].turn_left when 4 then $game_map.events[i[0][1]].turn_left
when 6; $game_map.events[i[0][1]].turn_right when 6 then $game_map.events[i[0][1]].turn_right
when 8; $game_map.events[i[0][1]].turn_up when 8 then $game_map.events[i[0][1]].turn_up
end end
end end
if i[1][3]!=nil if i[1][3]!=nil

View File

@@ -30,26 +30,26 @@ class PokemonTemp
when "single", "1v1", "1v2", "2v1", "1v3", "3v1", when "single", "1v1", "1v2", "2v1", "1v3", "3v1",
"double", "2v2", "2v3", "3v2", "triple", "3v3" "double", "2v2", "2v3", "3v2", "triple", "3v3"
rules["size"] = rule.to_s.downcase rules["size"] = rule.to_s.downcase
when "canlose"; rules["canLose"] = true when "canlose" then rules["canLose"] = true
when "cannotlose"; rules["canLose"] = false when "cannotlose" then rules["canLose"] = false
when "canrun"; rules["canRun"] = true when "canrun" then rules["canRun"] = true
when "cannotrun"; rules["canRun"] = false when "cannotrun" then rules["canRun"] = false
when "roamerflees"; rules["roamerFlees"] = true when "roamerflees" then rules["roamerFlees"] = true
when "noexp"; rules["expGain"] = false when "noexp" then rules["expGain"] = false
when "nomoney"; rules["moneyGain"] = false when "nomoney" then rules["moneyGain"] = false
when "switchstyle"; rules["switchStyle"] = true when "switchstyle" then rules["switchStyle"] = true
when "setstyle"; rules["switchStyle"] = false when "setstyle" then rules["switchStyle"] = false
when "anims"; rules["battleAnims"] = true when "anims" then rules["battleAnims"] = true
when "noanims"; rules["battleAnims"] = false when "noanims" then rules["battleAnims"] = false
when "terrain"; rules["defaultTerrain"] = getID(PBBattleTerrains,var) when "terrain" then rules["defaultTerrain"] = getID(PBBattleTerrains, var)
when "weather"; rules["defaultWeather"] = getID(PBWeather,var) when "weather" then rules["defaultWeather"] = getID(PBWeather, var)
when "environment", "environ"; rules["environment"] = getID(PBEnvironment,var) when "environment", "environ" then rules["environment"] = getID(PBEnvironment, var)
when "backdrop", "battleback"; rules["backdrop"] = var when "backdrop", "battleback" then rules["backdrop"] = var
when "base"; rules["base"] = var when "base" then rules["base"] = var
when "outcome", "outcomevar"; rules["outcomeVar"] = var when "outcome", "outcomevar" then rules["outcomeVar"] = var
when "nopartner"; rules["noPartner"] = true when "nopartner" then rules["noPartner"] = true
else else
raise _INTL("Battle rule \"{1}\" does not exist.",rule) raise _INTL("Battle rule \"{1}\" does not exist.", rule)
end end
end end
end end
@@ -140,12 +140,18 @@ def pbPrepareBattle(battle)
if battleRules["base"].nil? if battleRules["base"].nil?
case battle.environment case battle.environment
when PBEnvironment::Grass, PBEnvironment::TallGrass, when PBEnvironment::Grass, PBEnvironment::TallGrass,
PBEnvironment::ForestGrass; base = "grass" PBEnvironment::ForestGrass
# when PBEnvironment::Rock; base = "rock" base = "grass"
when PBEnvironment::Sand; base = "sand" # when PBEnvironment::Rock
when PBEnvironment::MovingWater, PBEnvironment::StillWater; base = "water" # base = "rock"
when PBEnvironment::Puddle; base = "puddle" when PBEnvironment::Sand
when PBEnvironment::Ice; base = "ice" base = "sand"
when PBEnvironment::MovingWater, PBEnvironment::StillWater
base = "water"
when PBEnvironment::Puddle
base = "puddle"
when PBEnvironment::Ice
base = "ice"
end end
else else
base = battleRules["base"] base = battleRules["base"]
@@ -168,24 +174,24 @@ end
def pbGetEnvironment def pbGetEnvironment
ret = GameData::MapMetadata.get($game_map.map_id).battle_environment ret = GameData::MapMetadata.get($game_map.map_id).battle_environment
ret = PBEnvironment::None if !ret ret = PBEnvironment::None if !ret
if $PokemonTemp.encounterType==EncounterTypes::OldRod || if $PokemonTemp.encounterType == EncounterTypes::OldRod ||
$PokemonTemp.encounterType==EncounterTypes::GoodRod || $PokemonTemp.encounterType == EncounterTypes::GoodRod ||
$PokemonTemp.encounterType==EncounterTypes::SuperRod $PokemonTemp.encounterType == EncounterTypes::SuperRod
terrainTag = pbFacingTerrainTag terrainTag = pbFacingTerrainTag
else else
terrainTag = $game_player.terrain_tag terrainTag = $game_player.terrain_tag
end end
case terrainTag case terrainTag
when PBTerrain::Grass, PBTerrain::SootGrass when PBTerrain::Grass, PBTerrain::SootGrass
ret = (ret==PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::Grass ret = (ret == PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::Grass
when PBTerrain::TallGrass when PBTerrain::TallGrass
ret = (ret==PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::TallGrass ret = (ret == PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::TallGrass
when PBTerrain::Rock; ret = PBEnvironment::Rock when PBTerrain::Rock then ret = PBEnvironment::Rock
when PBTerrain::Sand; ret = PBEnvironment::Sand when PBTerrain::Sand then ret = PBEnvironment::Sand
when PBTerrain::DeepWater, PBTerrain::Water; ret = PBEnvironment::MovingWater when PBTerrain::DeepWater, PBTerrain::Water then ret = PBEnvironment::MovingWater
when PBTerrain::StillWater; ret = PBEnvironment::StillWater when PBTerrain::StillWater then ret = PBEnvironment::StillWater
when PBTerrain::Puddle; ret = PBEnvironment::Puddle when PBTerrain::Puddle then ret = PBEnvironment::Puddle
when PBTerrain::Ice; ret = PBEnvironment::Ice when PBTerrain::Ice then ret = PBEnvironment::Ice
end end
return ret return ret
end end

View File

@@ -335,22 +335,31 @@ class Maze
end end
end end
def recurseDepthFirst(x,y,depth) def recurseDepthFirst(x, y, depth)
setVisited(x,y) setVisited(x,y)
dirs=@@dirs.shuffle! dirs = @@dirs.shuffle!
for c in 0...4 for c in 0...4
d=dirs[c] d = dirs[c]
cx=0;cy=0 cx = 0
cy = 0
case d case d
when EdgeMasks::North; cx=x; cy=y-1 when EdgeMasks::North
when EdgeMasks::South; cx=x; cy=y+1 cx = x
when EdgeMasks::East; cx=x+1; cy=y cy = y - 1
when EdgeMasks::West; cx=x-1; cy=y when EdgeMasks::South
cx = x
cy = y + 1
when EdgeMasks::East
cx = x + 1
cy = y
when EdgeMasks::West
cx = x - 1
cy = y
end end
if cx>=0 && cy>=0 && cx<cellWidth && cy<cellHeight if cx >= 0 && cy >= 0 && cx < cellWidth && cy < cellHeight
if !getVisited(cx,cy) if !getVisited(cx, cy)
clearEdgeNode(x,y,d) clearEdgeNode(x, y, d)
recurseDepthFirst(cx,cy,depth+1) recurseDepthFirst(cx, cy, depth + 1)
end end
end end
end end

View File

@@ -37,10 +37,10 @@ class BerryPlantMoistureSprite
def updateGraphic def updateGraphic
case @oldmoisture case @oldmoisture
when -1; @light.setBitmap("") when -1 then @light.setBitmap("")
when 0; @light.setBitmap("Graphics/Characters/berrytreeDry") when 0 then @light.setBitmap("Graphics/Characters/berrytreeDry")
when 1; @light.setBitmap("Graphics/Characters/berrytreeDamp") when 1 then @light.setBitmap("Graphics/Characters/berrytreeDamp")
when 2; @light.setBitmap("Graphics/Characters/berrytreeWet") when 2 then @light.setBitmap("Graphics/Characters/berrytreeWet")
end end
end end
@@ -257,10 +257,10 @@ class BerryPlantSprite
if pbResolveBitmap("Graphics/Characters/"+filename) if pbResolveBitmap("Graphics/Characters/"+filename)
@event.character_name=filename @event.character_name=filename
case berryData[0] case berryData[0]
when 2; @event.turn_down # X sprouted when 2 then @event.turn_down # X sprouted
when 3; @event.turn_left # X taller when 3 then @event.turn_left # X taller
when 4; @event.turn_right # X flowering when 4 then @event.turn_right # X flowering
when 5; @event.turn_up # X berries when 5 then @event.turn_up # X berries
end end
else else
@event.character_name="Object ball" @event.character_name="Object ball"
@@ -288,11 +288,11 @@ def pbBerryPlant
end end
# Stop the event turning towards the player # Stop the event turning towards the player
case berryData[0] case berryData[0]
when 1; thisEvent.turn_down # X planted when 1 then thisEvent.turn_down # X planted
when 2; thisEvent.turn_down # X sprouted when 2 then thisEvent.turn_down # X sprouted
when 3; thisEvent.turn_left # X taller when 3 then thisEvent.turn_left # X taller
when 4; thisEvent.turn_right # X flowering when 4 then thisEvent.turn_right # X flowering
when 5; thisEvent.turn_up # X berries when 5 then thisEvent.turn_up # X berries
end end
watering = [:SPRAYDUCK, :SQUIRTBOTTLE, :WAILMERPAIL, :SPRINKLOTAD] watering = [:SPRAYDUCK, :SQUIRTBOTTLE, :WAILMERPAIL, :SPRINKLOTAD]
berry=berryData[1] berry=berryData[1]

View File

@@ -65,10 +65,10 @@ def moveThrough(follower,direction)
oldThrough=follower.through oldThrough=follower.through
follower.through=true follower.through=true
case direction case direction
when 2; follower.move_down # down when 2 then follower.move_down
when 4; follower.move_left # left when 4 then follower.move_left
when 6; follower.move_right # right when 6 then follower.move_right
when 8; follower.move_up # up when 8 then follower.move_up
end end
follower.through=oldThrough follower.through=oldThrough
end end
@@ -87,10 +87,10 @@ def moveFancy(follower,direction)
oldThrough=follower.through oldThrough=follower.through
follower.through=true follower.through=true
case direction case direction
when 2; follower.move_down # down when 2 then follower.move_down
when 4; follower.move_left # left when 4 then follower.move_left
when 6; follower.move_right # right when 6 then follower.move_right
when 8; follower.move_up # up when 8 then follower.move_up
end end
follower.through=oldThrough follower.through=oldThrough
end end
@@ -155,11 +155,11 @@ class DependentEvents
newEvent = Game_Event.new(eventData[0],rpgEvent,$MapFactory.getMap(eventData[2])) newEvent = Game_Event.new(eventData[0],rpgEvent,$MapFactory.getMap(eventData[2]))
newEvent.character_name = eventData[6] newEvent.character_name = eventData[6]
newEvent.character_hue = eventData[7] newEvent.character_hue = eventData[7]
case eventData[5] # direction case eventData[5] # direction
when 2; newEvent.turn_down when 2 then newEvent.turn_down
when 4; newEvent.turn_left when 4 then newEvent.turn_left
when 6; newEvent.turn_right when 6 then newEvent.turn_right
when 8; newEvent.turn_up when 8 then newEvent.turn_up
end end
return newEvent return newEvent
end end

View File

@@ -532,11 +532,15 @@ def pbUseItem(bag,item,bagscene=nil)
elsif useType==2 # Item is usable from bag elsif useType==2 # Item is usable from bag
intret = ItemHandlers.triggerUseFromBag(item) intret = ItemHandlers.triggerUseFromBag(item)
case intret case intret
when 0; return 0 when 0 then return 0
when 1; return 1 # Item used when 1 then return 1 # Item used
when 2; return 2 # Item used, end screen when 2 then return 2 # Item used, end screen
when 3; bag.pbDeleteItem(item); return 1 # Item used, consume item when 3 # Item used, consume item
when 4; bag.pbDeleteItem(item); return 2 # Item used, end screen and consume item bag.pbDeleteItem(item)
return 1
when 4 # Item used, end screen and consume item
bag.pbDeleteItem(item)
return 2
end end
pbMessage(_INTL("Can't use that here.")) pbMessage(_INTL("Can't use that here."))
return 0 return 0

View File

@@ -299,10 +299,10 @@ ItemHandlers::UseInField.add(:ITEMFINDER,proc { |item|
direction = (offsetY<0) ? 8 : 2 direction = (offsetY<0) ? 8 : 2
end end
case direction case direction
when 2; $game_player.turn_down when 2 then $game_player.turn_down
when 4; $game_player.turn_left when 4 then $game_player.turn_left
when 6; $game_player.turn_right when 6 then $game_player.turn_right
when 8; $game_player.turn_up when 8 then $game_player.turn_up
end end
pbWait(Graphics.frame_rate*3/10) pbWait(Graphics.frame_rate*3/10)
pbMessage(_INTL("Huh? The {1}'s responding!\1",GameData::Item.get(item).name)) pbMessage(_INTL("Huh? The {1}'s responding!\1",GameData::Item.get(item).name))

View File

@@ -224,9 +224,9 @@ class Pokemon
# Return sole gender option for all male/all female/genderless species # Return sole gender option for all male/all female/genderless species
gender_rate = pbGetSpeciesData(@species, formSimple, SpeciesData::GENDER_RATE) gender_rate = pbGetSpeciesData(@species, formSimple, SpeciesData::GENDER_RATE)
case gender_rate case gender_rate
when PBGenderRates::AlwaysMale; return 0 when PBGenderRates::AlwaysMale then return 0
when PBGenderRates::AlwaysFemale; return 1 when PBGenderRates::AlwaysFemale then return 1
when PBGenderRates::Genderless; return 2 when PBGenderRates::Genderless then return 2
end end
# Return gender for species that can be male or female # Return gender for species that can be male or female
return @genderflag if @genderflag && (@genderflag == 0 || @genderflag == 1) return @genderflag if @genderflag && (@genderflag == 0 || @genderflag == 1)

View File

@@ -760,12 +760,12 @@ class PokemonPokedex_Scene
# Remove all unseen species from the results # Remove all unseen species from the results
dexlist = dexlist.find_all { |item| next $Trainer.seen[item[0]] } dexlist = dexlist.find_all { |item| next $Trainer.seen[item[0]] }
case $PokemonGlobal.pokedexMode case $PokemonGlobal.pokedexMode
when MODENUMERICAL; dexlist.sort! { |a,b| a[4]<=>b[4] } when MODENUMERICAL then dexlist.sort! { |a,b| a[4]<=>b[4] }
when MODEATOZ; dexlist.sort! { |a,b| a[1]<=>b[1] } when MODEATOZ then dexlist.sort! { |a,b| a[1]<=>b[1] }
when MODEHEAVIEST; dexlist.sort! { |a,b| b[3]<=>a[3] } when MODEHEAVIEST then dexlist.sort! { |a,b| b[3]<=>a[3] }
when MODELIGHTEST; dexlist.sort! { |a,b| a[3]<=>b[3] } when MODELIGHTEST then dexlist.sort! { |a,b| a[3]<=>b[3] }
when MODETALLEST; dexlist.sort! { |a,b| b[2]<=>a[2] } when MODETALLEST then dexlist.sort! { |a,b| b[2]<=>a[2] }
when MODESMALLEST; dexlist.sort! { |a,b| a[2]<=>b[2] } when MODESMALLEST then dexlist.sort! { |a,b| a[2]<=>b[2] }
end end
return dexlist return dexlist
end end
@@ -822,17 +822,17 @@ class PokemonPokedex_Scene
ret = nil ret = nil
# Set background # Set background
case mode case mode
when 0; @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_order") when 0 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_order")
when 1; @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_name") when 1 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_name")
when 2 when 2
if PBTypes.regularTypesCount==18 if PBTypes.regularTypesCount==18
@sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_type_18") @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_type_18")
else else
@sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_type") @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_type")
end end
when 3,4; @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_size") when 3, 4 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_size")
when 5; @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_color") when 5 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_color")
when 6; @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_shape") when 6 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_shape")
end end
selindex = selitems.clone selindex = selitems.clone
index = selindex[0] index = selindex[0]

View File

@@ -186,8 +186,8 @@ class PokemonPokedexInfo_Scene
thisformname = thisform[2] thisformname = thisform[2]
else # Necessarily applies only to form 0 else # Necessarily applies only to form 0
case thisform[1] case thisform[1]
when 0; thisformname = _INTL("Male") when 0 then thisformname = _INTL("Male")
when 1; thisformname = _INTL("Female") when 1 then thisformname = _INTL("Female")
else else
thisformname = (multiforms) ? _INTL("One Form") : _INTL("Genderless") thisformname = (multiforms) ? _INTL("One Form") : _INTL("Genderless")
end end
@@ -212,9 +212,9 @@ class PokemonPokedexInfo_Scene
@sprites["formicon"].visible = (@page==3) if @sprites["formicon"] @sprites["formicon"].visible = (@page==3) if @sprites["formicon"]
# Draw page-specific information # Draw page-specific information
case page case page
when 1; drawPageInfo when 1 then drawPageInfo
when 2; drawPageArea when 2 then drawPageArea
when 3; drawPageForms when 3 then drawPageForms
end end
end end

View File

@@ -347,11 +347,11 @@ class PokemonSummary_Scene
drawMarkings(overlay,84,292) drawMarkings(overlay,84,292)
# Draw page-specific information # Draw page-specific information
case page case page
when 1; drawPageOne when 1 then drawPageOne
when 2; drawPageTwo when 2 then drawPageTwo
when 3; drawPageThree when 3 then drawPageThree
when 4; drawPageFour when 4 then drawPageFour
when 5; drawPageFive when 5 then drawPageFive
end end
end end
@@ -409,8 +409,12 @@ class PokemonSummary_Scene
ownerbase = Color.new(64,64,64) ownerbase = Color.new(64,64,64)
ownershadow = Color.new(176,176,176) ownershadow = Color.new(176,176,176)
case @pokemon.owner.gender case @pokemon.owner.gender
when 0; ownerbase = Color.new(24,112,216); ownershadow = Color.new(136,168,208) when 0
when 1; ownerbase = Color.new(248,56,32); ownershadow = Color.new(224,152,144) ownerbase = Color.new(24, 112, 216)
ownershadow = Color.new(136, 168, 208)
when 1
ownerbase = Color.new(248, 56, 32)
ownershadow = Color.new(224, 152, 144)
end end
textpos.push([@pokemon.owner.name,435,176,2,ownerbase,ownershadow]) textpos.push([@pokemon.owner.name,435,176,2,ownerbase,ownershadow])
textpos.push([sprintf("%05d",@pokemon.owner.public_id),435,208,2,Color.new(64,64,64),Color.new(176,176,176)]) textpos.push([sprintf("%05d",@pokemon.owner.public_id),435,208,2,Color.new(64,64,64),Color.new(176,176,176)])

View File

@@ -106,9 +106,9 @@ $VersionStyles = [
def pbSettingToTextSpeed(speed) def pbSettingToTextSpeed(speed)
case speed case speed
when 0; return 2 when 0 then return 2
when 1; return 1 when 1 then return 1
when 2; return -2 when 2 then return -2
end end
return MessageConfig::TextSpeed || 1 return MessageConfig::TextSpeed || 1
end end

View File

@@ -1582,10 +1582,10 @@ class PokemonStorageScreen
_INTL("Cancel") _INTL("Cancel")
]) ])
case command case command
when 0; pbWithdraw(selected,nil) when 0 then pbWithdraw(selected, nil)
when 1; pbSummary(selected,nil) when 1 then pbSummary(selected, nil)
when 2; pbMark(selected,nil) when 2 then pbMark(selected, nil)
when 3; pbRelease(selected,nil) when 3 then pbRelease(selected, nil)
end end
end end
end end
@@ -1615,10 +1615,10 @@ class PokemonStorageScreen
_INTL("Cancel") _INTL("Cancel")
]) ])
case command case command
when 0; pbStore([-1,selected],nil) when 0 then pbStore([-1, selected], nil)
when 1; pbSummary([-1,selected],nil) when 1 then pbSummary([-1, selected], nil)
when 2; pbMark([-1,selected],nil) when 2 then pbMark([-1, selected], nil)
when 3; pbRelease([-1,selected],nil) when 3 then pbRelease([-1, selected], nil)
end end
end end
end end
@@ -1961,15 +1961,18 @@ class PokemonStorageScreen
retval = selected retval = selected
break break
end end
when 1; pbSummary(selected,nil) when 1
pbSummary(selected,nil)
when 2 # Store/Withdraw when 2 # Store/Withdraw
if selected[0]==-1 if selected[0]==-1
pbStore(selected,nil) pbStore(selected,nil)
else else
pbWithdraw(selected,nil) pbWithdraw(selected,nil)
end end
when 3; pbItem(selected,nil) when 3
when 4; pbMark(selected,nil) pbItem(selected,nil)
when 4
pbMark(selected,nil)
end end
end end
end end

View File

@@ -111,9 +111,9 @@ def pbTrainerPCMenu
_INTL("Turn Off") _INTL("Turn Off")
],-1,nil,command) ],-1,nil,command)
case command case command
when 0; pbPCItemStorage when 0 then pbPCItemStorage
when 1; pbPCMailbox when 1 then pbPCMailbox
else; break else break
end end
end end
end end

View File

@@ -259,22 +259,22 @@ class SpriteMetafilePlayer
value=@metafile[j][1] value=@metafile[j][1]
for sprite in @sprites for sprite in @sprites
case code case code
when SpriteMetafile::X; sprite.x=value when SpriteMetafile::X then sprite.x = value
when SpriteMetafile::Y; sprite.y=value when SpriteMetafile::Y then sprite.y = value
when SpriteMetafile::OX; sprite.ox=value when SpriteMetafile::OX then sprite.ox = value
when SpriteMetafile::OY; sprite.oy=value when SpriteMetafile::OY then sprite.oy = value
when SpriteMetafile::ZOOM_X; sprite.zoom_x=value when SpriteMetafile::ZOOM_X then sprite.zoom_x = value
when SpriteMetafile::ZOOM_Y; sprite.zoom_y=value when SpriteMetafile::ZOOM_Y then sprite.zoom_y = value
when SpriteMetafile::SRC_RECT; sprite.src_rect=value when SpriteMetafile::SRC_RECT then sprite.src_rect = value
when SpriteMetafile::VISIBLE; sprite.visible=value when SpriteMetafile::VISIBLE then sprite.visible = value
when SpriteMetafile::Z; sprite.z=value # prevent crashes when SpriteMetafile::Z then sprite.z = value # prevent crashes
when SpriteMetafile::ANGLE; sprite.angle=(value==180) ? 179.9 : value when SpriteMetafile::ANGLE then sprite.angle = (value == 180) ? 179.9 : value
when SpriteMetafile::MIRROR; sprite.mirror=value when SpriteMetafile::MIRROR then sprite.mirror = value
when SpriteMetafile::BUSH_DEPTH; sprite.bush_depth=value when SpriteMetafile::BUSH_DEPTH then sprite.bush_depth = value
when SpriteMetafile::OPACITY; sprite.opacity=value when SpriteMetafile::OPACITY then sprite.opacity = value
when SpriteMetafile::BLEND_TYPE; sprite.blend_type=value when SpriteMetafile::BLEND_TYPE then sprite.blend_type = value
when SpriteMetafile::COLOR; sprite.color=value when SpriteMetafile::COLOR then sprite.color = value
when SpriteMetafile::TONE; sprite.tone=value when SpriteMetafile::TONE then sprite.tone = value
end end
end end
end end

View File

@@ -56,9 +56,9 @@ class TriadCard
aType = @type aType = @type
oType = opponent.type oType = opponent.type
case PBTypes.getEffectiveness(aType,oType) case PBTypes.getEffectiveness(aType,oType)
when PBTypeEffectiveness::INEFFECTIVE; return -2 when PBTypeEffectiveness::INEFFECTIVE then return -2
when PBTypeEffectiveness::NOT_EFFECTIVE_ONE; return -1 when PBTypeEffectiveness::NOT_EFFECTIVE_ONE then return -1
when PBTypeEffectiveness::SUPER_EFFECTIVE_ONE; return 1 when PBTypeEffectiveness::SUPER_EFFECTIVE_ONE then return 1
end end
return 0 return 0
end end

View File

@@ -98,36 +98,36 @@ module Input
def self.buttonToKey(button) def self.buttonToKey(button)
case button case button
when Input::DOWN; return [0x28] # Down when Input::DOWN then return [0x28] # Down
when Input::LEFT; return [0x25] # Left when Input::LEFT then return [0x25] # Left
when Input::RIGHT; return [0x27] # Right when Input::RIGHT then return [0x27] # Right
when Input::UP; return [0x26] # Up when Input::UP then return [0x26] # Up
when Input::TAB; return [0x09] # Tab when Input::TAB then return [0x09] # Tab
when Input::A; return [0x5A,0x57,0x59,0x10] # Z, W, Y, Shift when Input::A then return [0x5A, 0x57, 0x59, 0x10] # Z, W, Y, Shift
when Input::B; return [0x58,0x1B] # X, ESC when Input::B then return [0x58, 0x1B] # X, ESC
when Input::C; return [0x43,0x0D,0x20] # C, ENTER, Space when Input::C then return [0x43, 0x0D, 0x20] # C, ENTER, Space
# when Input::X; return [0x41] # A # when Input::X then return [0x41] # A
# when Input::Y; return [0x53] # S # when Input::Y then return [0x53] # S
# when Input::Z; return [0x44] # D # when Input::Z then return [0x44] # D
when Input::L; return [0x41,0x51,0x21] # A, Q, Page Up when Input::L then return [0x41, 0x51, 0x21] # A, Q, Page Up
when Input::R; return [0x53,0x22] # S, Page Down when Input::R then return [0x53, 0x22] # S, Page Down
when Input::ENTER; return [0x0D] # ENTER when Input::ENTER then return [0x0D] # ENTER
when Input::ESC; return [0x1B] # ESC when Input::ESC then return [0x1B] # ESC
when Input::SHIFT; return [0x10] # Shift when Input::SHIFT then return [0x10] # Shift
when Input::CTRL; return [0x11] # Ctrl when Input::CTRL then return [0x11] # Ctrl
when Input::ALT; return [0x12] # Alt when Input::ALT then return [0x12] # Alt
when Input::BACKSPACE; return [0x08] # Backspace when Input::BACKSPACE then return [0x08] # Backspace
when Input::DELETE; return [0x2E] # Delete when Input::DELETE then return [0x2E] # Delete
when Input::HOME; return [0x24] # Home when Input::HOME then return [0x24] # Home
when Input::ENDKEY; return [0x23] # End when Input::ENDKEY then return [0x23] # End
when Input::F5; return [0x46,0x74,0x09] # F, F5, Tab when Input::F5 then return [0x46, 0x74, 0x09] # F, F5, Tab
when Input::ONLYF5; return [0x74] # F5 when Input::ONLYF5 then return [0x74] # F5
when Input::F6; return [0x75] # F6 when Input::F6 then return [0x75] # F6
when Input::F7; return [0x76] # F7 when Input::F7 then return [0x76] # F7
when Input::F8; return [0x77] # F8 when Input::F8 then return [0x77] # F8
when Input::F9; return [0x78] # F9 when Input::F9 then return [0x78] # F9
else; return []
end end
return []
end end
def self.dir4 def self.dir4

View File

@@ -85,11 +85,11 @@ def pbCheckPokemonBitmapFiles(params)
factors.each_with_index do |factor,index| factors.each_with_index do |factor,index|
newVal = ((i/(2**index))%2==0) ? factor[1] : factor[2] newVal = ((i/(2**index))%2==0) ? factor[1] : factor[2]
case factor[0] case factor[0]
when 0; trySpecies = newVal when 0 then trySpecies = newVal
when 2; tryGender = newVal when 2 then tryGender = newVal
when 3; tryShiny = newVal when 3 then tryShiny = newVal
when 4; tryForm = newVal when 4 then tryForm = newVal
when 5; tryShadow = newVal when 5 then tryShadow = newVal
end end
end end
for j in 0...2 # Try using the species' internal name and then its ID number for j in 0...2 # Try using the species' internal name and then its ID number
@@ -192,11 +192,11 @@ def pbCheckPokemonIconFiles(params,egg=false)
factors.each_with_index do |factor,index| factors.each_with_index do |factor,index|
newVal = ((i/(2**index))%2==0) ? factor[1] : factor[2] newVal = ((i/(2**index))%2==0) ? factor[1] : factor[2]
case factor[0] case factor[0]
when 0; trySpecies = newVal when 0 then trySpecies = newVal
when 1; tryGender = newVal when 1 then tryGender = newVal
when 2; tryShiny = newVal when 2 then tryShiny = newVal
when 3; tryForm = newVal when 3 then tryForm = newVal
when 4; tryShadow = newVal when 4 then tryShadow = newVal
end end
end end
for j in 0...2 # Try using the species' internal name and then its ID number for j in 0...2 # Try using the species' internal name and then its ID number

View File

@@ -105,13 +105,13 @@ def pbGetLanguage()
return 0 if ret==0 # Unknown return 0 if ret==0 # Unknown
end end
case ret case ret
when 0x11; return 1 # Japanese when 0x11 then return 1 # Japanese
when 0x09; return 2 # English when 0x09 then return 2 # English
when 0x0C; return 3 # French when 0x0C then return 3 # French
when 0x10; return 4 # Italian when 0x10 then return 4 # Italian
when 0x07; return 5 # German when 0x07 then return 5 # German
when 0x0A; return 7 # Spanish when 0x0A then return 7 # Spanish
when 0x12; return 8 # Korean when 0x12 then return 8 # Korean
end end
return 2 # Use 'English' by default return 2 # Use 'English' by default
end end
@@ -182,7 +182,8 @@ end
def beginRecordUI def beginRecordUI
code = beginRecord code = beginRecord
case code case code
when 0; return true when 0
return true
when 256+66 when 256+66
pbMessage(_INTL("All recording devices are in use. Recording is not possible now.")) pbMessage(_INTL("All recording devices are in use. Recording is not possible now."))
return false return false
@@ -758,10 +759,10 @@ def getRandomNameEx(type,variable,upper,maxLength=100)
name = "" name = ""
formats = [] formats = []
case type case type
when 0; formats = %w( F5 BvE FE FE5 FEvE ) # Names for males when 0 then formats = %w( F5 BvE FE FE5 FEvE ) # Names for males
when 1; formats = %w( vE6 vEvE6 BvE6 B4 v3 vEv3 Bv3 ) # Names for females when 1 then formats = %w( vE6 vEvE6 BvE6 B4 v3 vEv3 Bv3 ) # Names for females
when 2; formats = %w( WE WEU WEvE BvE BvEU BvEvE ) # Neutral gender names when 2 then formats = %w( WE WEU WEvE BvE BvEU BvEvE ) # Neutral gender names
else; return "" else return ""
end end
format = formats[rand(formats.length)] format = formats[rand(formats.length)]
format.scan(/./) { |c| format.scan(/./) { |c|
@@ -816,8 +817,8 @@ def getRandomNameEx(type,variable,upper,maxLength=100)
} }
name = name[0,maxLength] name = name[0,maxLength]
case upper case upper
when 0; name = name.upcase when 0 then name = name.upcase
when 1; name[0,1] = name[0,1].upcase when 1 then name[0, 1] = name[0, 1].upcase
end end
if $game_variables && variable if $game_variables && variable
$game_variables[variable] = name $game_variables[variable] = name

View File

@@ -318,12 +318,24 @@ module PokemonDebugMixin
#=========================================================================== #===========================================================================
when "setbeauty", "setcool", "setcute", "setsmart", "settough", "setsheen" when "setbeauty", "setcool", "setcute", "setsmart", "settough", "setsheen"
case command case command
when "setbeauty"; statname = _INTL("Beauty"); defval = pkmn.beauty when "setbeauty"
when "setcool"; statname = _INTL("Cool"); defval = pkmn.cool statname = _INTL("Beauty")
when "setcute"; statname = _INTL("Cute"); defval = pkmn.cute defval = pkmn.beauty
when "setsmart"; statname = _INTL("Smart"); defval = pkmn.smart when "setcool"
when "settough"; statname = _INTL("Tough"); defval = pkmn.tough statname = _INTL("Cool")
when "setsheen"; statname = _INTL("Sheen"); defval = pkmn.sheen defval = pkmn.cool
when "setcute"
statname = _INTL("Cute")
defval = pkmn.cute
when "setsmart"
statname = _INTL("Smart")
defval = pkmn.smart
when "settough"
statname = _INTL("Tough")
defval = pkmn.tough
when "setsheen"
statname = _INTL("Sheen")
defval = pkmn.sheen
end end
params = ChooseNumberParams.new params = ChooseNumberParams.new
params.setRange(0,255) params.setRange(0,255)
@@ -332,12 +344,12 @@ module PokemonDebugMixin
_INTL("Set the Pokémon's {1} (max. 255).",statname),params) { pbUpdate } _INTL("Set the Pokémon's {1} (max. 255).",statname),params) { pbUpdate }
if newval!=defval if newval!=defval
case command case command
when "setbeauty"; pkmn.beauty = newval when "setbeauty" then pkmn.beauty = newval
when "setcool"; pkmn.cool = newval when "setcool" then pkmn.cool = newval
when "setcute"; pkmn.cute = newval when "setcute" then pkmn.cute = newval
when "setsmart"; pkmn.smart = newval when "setsmart" then pkmn.smart = newval
when "settough"; pkmn.tough = newval when "settough" then pkmn.tough = newval
when "setsheen"; pkmn.sheen = newval when "setsheen" then pkmn.sheen = newval
end end
pbRefreshSingle(pkmnid) pbRefreshSingle(pkmnid)
end end

View File

@@ -30,9 +30,9 @@ def pbSaveTypes
cname = getConstantName(PBTypes,j) rescue pbGetTypeConst(j) cname = getConstantName(PBTypes,j) rescue pbGetTypeConst(j)
next if !cname || cname=="" next if !cname || cname==""
case PBTypes.getEffectiveness(j,i) case PBTypes.getEffectiveness(j,i)
when PBTypeEffectiveness::SUPER_EFFECTIVE_ONE; weak.push(cname) when PBTypeEffectiveness::SUPER_EFFECTIVE_ONE then weak.push(cname)
when PBTypeEffectiveness::NOT_EFFECTIVE_ONE; resist.push(cname) when PBTypeEffectiveness::NOT_EFFECTIVE_ONE then resist.push(cname)
when PBTypeEffectiveness::INEFFECTIVE; immune.push(cname) when PBTypeEffectiveness::INEFFECTIVE then immune.push(cname)
end end
end end
f.write("Weaknesses = "+weak.join(",")+"\r\n") if weak.length>0 f.write("Weaknesses = "+weak.join(",")+"\r\n") if weak.length>0

View File

@@ -244,39 +244,39 @@ class SpritePositioner
Input.update Input.update
self.update self.update
case param case param
when 0; @sprites["info"].setTextToFit("Ally Position = #{xpos},#{ypos}") when 0 then @sprites["info"].setTextToFit("Ally Position = #{xpos},#{ypos}")
when 1; @sprites["info"].setTextToFit("Enemy Position = #{xpos},#{ypos}") when 1 then @sprites["info"].setTextToFit("Enemy Position = #{xpos},#{ypos}")
when 3; @sprites["info"].setTextToFit("Shadow Position = #{xpos}") when 3 then @sprites["info"].setTextToFit("Shadow Position = #{xpos}")
end end
if Input.repeat?(Input::UP) && param!=3 if Input.repeat?(Input::UP) && param!=3
ypos -= 1 ypos -= 1
case param case param
when 0; @metrics[SpeciesData::METRIC_PLAYER_Y][@species] = ypos when 0 then @metrics[SpeciesData::METRIC_PLAYER_Y][@species] = ypos
when 1; @metrics[SpeciesData::METRIC_ENEMY_Y][@species] = ypos when 1 then @metrics[SpeciesData::METRIC_ENEMY_Y][@species] = ypos
end end
refresh refresh
elsif Input.repeat?(Input::DOWN) && param!=3 elsif Input.repeat?(Input::DOWN) && param!=3
ypos += 1 ypos += 1
case param case param
when 0; @metrics[SpeciesData::METRIC_PLAYER_Y][@species] = ypos when 0 then @metrics[SpeciesData::METRIC_PLAYER_Y][@species] = ypos
when 1; @metrics[SpeciesData::METRIC_ENEMY_Y][@species] = ypos when 1 then @metrics[SpeciesData::METRIC_ENEMY_Y][@species] = ypos
end end
refresh refresh
end end
if Input.repeat?(Input::LEFT) if Input.repeat?(Input::LEFT)
xpos -= 1 xpos -= 1
case param case param
when 0; @metrics[SpeciesData::METRIC_PLAYER_X][@species] = xpos when 0 then @metrics[SpeciesData::METRIC_PLAYER_X][@species] = xpos
when 1; @metrics[SpeciesData::METRIC_ENEMY_X][@species] = xpos when 1 then @metrics[SpeciesData::METRIC_ENEMY_X][@species] = xpos
when 3; @metrics[SpeciesData::METRIC_SHADOW_X][@species] = xpos when 3 then @metrics[SpeciesData::METRIC_SHADOW_X][@species] = xpos
end end
refresh refresh
elsif Input.repeat?(Input::RIGHT) elsif Input.repeat?(Input::RIGHT)
xpos += 1 xpos += 1
case param case param
when 0; @metrics[SpeciesData::METRIC_PLAYER_X][@species] = xpos when 0 then @metrics[SpeciesData::METRIC_PLAYER_X][@species] = xpos
when 1; @metrics[SpeciesData::METRIC_ENEMY_X][@species] = xpos when 1 then @metrics[SpeciesData::METRIC_ENEMY_X][@species] = xpos
when 3; @metrics[SpeciesData::METRIC_SHADOW_X][@species] = xpos when 3 then @metrics[SpeciesData::METRIC_SHADOW_X][@species] = xpos
end end
refresh refresh
end end

View File

@@ -52,11 +52,11 @@ module SerialRecords
while strm.pos<offset+length while strm.pos<offset+length
datatype = strm.read(1) datatype = strm.read(1)
case datatype case datatype
when "0"; ret.push(nil) when "0" then ret.push(nil)
when "T"; ret.push(true) when "T" then ret.push(true)
when "F"; ret.push(false) when "F" then ret.push(false)
when "\""; ret.push(decodeString(strm)) when "\"" then ret.push(decodeString(strm))
when "i"; ret.push(decodeInt(strm)) when "i" then ret.push(decodeInt(strm))
end end
end end
return ret return ret

View File

@@ -615,10 +615,10 @@ module Compiler
#============================================================================= #=============================================================================
def compile_all(mustCompile) def compile_all(mustCompile)
FileLineData.clear FileLineData.clear
if (!$INEDITOR || LANGUAGES.length < 2) && safeExists?("Data/messages.dat")
MessageTypes.loadMessageFile("Data/messages.dat")
end
if mustCompile if mustCompile
if (!$INEDITOR || LANGUAGES.length<2) && pbRgssExists?("Data/messages.dat")
MessageTypes.loadMessageFile("Data/messages.dat")
end
yield(_INTL("Compiling type data")) yield(_INTL("Compiling type data"))
compile_types # No dependencies compile_types # No dependencies
yield(_INTL("Compiling town map data")) yield(_INTL("Compiling town map data"))
@@ -660,13 +660,6 @@ module Compiler
yield(_INTL("Saving messages")) yield(_INTL("Saving messages"))
pbSetTextMessages pbSetTextMessages
MessageTypes.saveMessages MessageTypes.saveMessages
else
if (!$INEDITOR || LANGUAGES.length<2) && safeExists?("Data/messages.dat")
MessageTypes.loadMessageFile("Data/messages.dat")
end
end
if !$INEDITOR && LANGUAGES.length>=2
pbLoadMessages("Data/"+LANGUAGES[$PokemonSystem.language][1])
end end
pbSetWindowText(nil) pbSetWindowText(nil)
end end
@@ -722,8 +715,6 @@ module Compiler
mustCompile = false mustCompile = false
# Should recompile if new maps were imported # Should recompile if new maps were imported
mustCompile |= import_new_maps mustCompile |= import_new_maps
# Should recompile if no existing data is found
mustCompile |= !(PBSpecies.respond_to?("maxValue") rescue false)
# If no PBS file, create one and fill it, then recompile # If no PBS file, create one and fill it, then recompile
if !safeIsDirectory?("PBS") if !safeIsDirectory?("PBS")
Dir.mkdir("PBS") rescue nil Dir.mkdir("PBS") rescue nil

View File

@@ -169,10 +169,14 @@ module Compiler
print _INTL("Warning: Map {1}, as mentioned in the map connection data, was not found.\r\n{2}",record[3],FileLineData.linereport) print _INTL("Warning: Map {1}, as mentioned in the map connection data, was not found.\r\n{2}",record[3],FileLineData.linereport)
end end
case record[1] case record[1]
when "N"; raise _INTL("North side of first map must connect with south side of second map\r\n{1}",FileLineData.linereport) if record[4]!="S" when "N"
when "S"; raise _INTL("South side of first map must connect with north side of second map\r\n{1}",FileLineData.linereport) if record[4]!="N" raise _INTL("North side of first map must connect with south side of second map\r\n{1}", FileLineData.linereport) if record[4] != "S"
when "E"; raise _INTL("East side of first map must connect with west side of second map\r\n{1}",FileLineData.linereport) if record[4]!="W" when "S"
when "W"; raise _INTL("West side of first map must connect with east side of second map\r\n{1}",FileLineData.linereport) if record[4]!="E" raise _INTL("South side of first map must connect with north side of second map\r\n{1}", FileLineData.linereport) if record[4] != "N"
when "E"
raise _INTL("East side of first map must connect with west side of second map\r\n{1}", FileLineData.linereport) if record[4] != "W"
when "W"
raise _INTL("West side of first map must connect with east side of second map\r\n{1}", FileLineData.linereport) if record[4] != "E"
end end
records.push(record) records.push(record)
} }

View File

@@ -1,5 +1,5 @@
pbSetUpSystem
Compiler.main Compiler.main
pbSetUpSystem
class Scene_DebugIntro class Scene_DebugIntro
def main def main

Binary file not shown.