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.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
case @_animation_height
when 0; sprite.z = 1
when 1; sprite.z = sprite.y+32+15
when 2; sprite.z = sprite.y+32+32+17
else; sprite.z = 2000
when 0 then sprite.z = 1
when 1 then sprite.z = sprite.y+32+15
when 2 then sprite.z = sprite.y+32+32+17
else sprite.z = 2000
end
sprite.ox = 96
sprite.oy = 96

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -294,15 +294,28 @@ class PokemonMapFactory
def getFacingTileFromPos(mapID,x,y,direction=0,steps=1)
id = mapID
case direction
when 1; x -= steps; y += steps
when 2; y += steps
when 3; x += 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
else; return [id,x,y]
when 1
x -= steps
y += steps
when 2
y += steps
when 3
x += 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
else
return [id,x,y]
end
return getRealTilePos(mapID,x,y)
end
@@ -333,14 +346,26 @@ class PokemonMapFactory
def getFacingCoords(x,y,direction=0,steps=1)
case direction
when 1; x -= steps; y += steps
when 2; y += steps
when 3; x += 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
when 1
x -= steps
y += steps
when 2
y += steps
when 3
x += 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
return [x,y]
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -206,8 +206,8 @@ def pbRepositionMessageWindow(msgwindow, linecount=2)
end
if $game_message
case $game_message.background
when 1; msgwindow.opacity=0 # dim
when 2; msgwindow.opacity=0 # transparent
when 1 then msgwindow.opacity=0 # dim
when 2 then msgwindow.opacity=0 # transparent
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]
for i in block[0]...block[1]
case block[2]
when 1; 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]
else; characters[i][1]=xDst+characters[i][1]
when 1 then characters[i][1] = xDst + (widthDst - block[3] - 4) + 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]
end
end
end

View File

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

View File

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

View File

@@ -117,9 +117,12 @@ def pbGetSpeciesData(species, form = 0, species_data_type = -1)
end
return species_data[s][species_data_type] if species_data[s] && species_data[s][species_data_type]
case species_data_type
when SpeciesData::TYPE2; return nil
when SpeciesData::BASE_STATS; return [1, 1, 1, 1, 1, 1]
when SpeciesData::EFFORT_POINTS; return [0, 0, 0, 0, 0, 0]
when SpeciesData::TYPE2
return nil
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
return 1
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -366,9 +366,9 @@ class PokeBattle_Move_017 < PokeBattle_Move
def pbAdditionalEffect(user,target)
return if target.damageState.substitute
case @battle.pbRandom(3)
when 0; target.pbBurn(user) if target.pbCanBurn?(user,false,self)
when 1; target.pbFreeze if target.pbCanFreeze?(user,false,self)
when 2; target.pbParalyze(user) if target.pbCanParalyze?(user,false,self)
when 0 then target.pbBurn(user) if target.pbCanBurn?(user, false, self)
when 1 then target.pbFreeze if target.pbCanFreeze?(user, false, self)
when 2 then target.pbParalyze(user) if target.pbCanParalyze?(user, false, self)
end
end
end
@@ -1893,24 +1893,24 @@ class PokeBattle_Move_060 < PokeBattle_Move
end
if !checkedTerrain
case @battle.environment
when PBEnvironment::Grass; @newType = getID(PBTypes,:GRASS)
when PBEnvironment::TallGrass; @newType = getID(PBTypes,:GRASS)
when PBEnvironment::MovingWater; @newType = getID(PBTypes,:WATER)
when PBEnvironment::StillWater; @newType = getID(PBTypes,:WATER)
when PBEnvironment::Puddle; @newType = getID(PBTypes,:WATER)
when PBEnvironment::Underwater; @newType = getID(PBTypes,:WATER)
when PBEnvironment::Cave; @newType = getID(PBTypes,:ROCK)
when PBEnvironment::Rock; @newType = getID(PBTypes,:GROUND)
when PBEnvironment::Sand; @newType = getID(PBTypes,:GROUND)
when PBEnvironment::Forest; @newType = getID(PBTypes,:BUG)
when PBEnvironment::ForestGrass; @newType = getID(PBTypes,:BUG)
when PBEnvironment::Snow; @newType = getID(PBTypes,:ICE)
when PBEnvironment::Ice; @newType = getID(PBTypes,:ICE)
when PBEnvironment::Volcano; @newType = getID(PBTypes,:FIRE)
when PBEnvironment::Graveyard; @newType = getID(PBTypes,:GHOST)
when PBEnvironment::Sky; @newType = getID(PBTypes,:FLYING)
when PBEnvironment::Space; @newType = getID(PBTypes,:DRAGON)
when PBEnvironment::UltraSpace; @newType = getID(PBTypes,:PSYCHIC)
when PBEnvironment::Grass then @newType = getID(PBTypes,:GRASS)
when PBEnvironment::TallGrass then @newType = getID(PBTypes,:GRASS)
when PBEnvironment::MovingWater then @newType = getID(PBTypes,:WATER)
when PBEnvironment::StillWater then @newType = getID(PBTypes,:WATER)
when PBEnvironment::Puddle then @newType = getID(PBTypes,:WATER)
when PBEnvironment::Underwater then @newType = getID(PBTypes,:WATER)
when PBEnvironment::Cave then @newType = getID(PBTypes,:ROCK)
when PBEnvironment::Rock then @newType = getID(PBTypes,:GROUND)
when PBEnvironment::Sand then @newType = getID(PBTypes,:GROUND)
when PBEnvironment::Forest then @newType = getID(PBTypes,:BUG)
when PBEnvironment::ForestGrass then @newType = getID(PBTypes,:BUG)
when PBEnvironment::Snow then @newType = getID(PBTypes,:ICE)
when PBEnvironment::Ice then @newType = getID(PBTypes,:ICE)
when PBEnvironment::Volcano then @newType = getID(PBTypes,:FIRE)
when PBEnvironment::Graveyard then @newType = getID(PBTypes,:GHOST)
when PBEnvironment::Sky then @newType = getID(PBTypes,:FLYING)
when PBEnvironment::Space then @newType = getID(PBTypes,:DRAGON)
when PBEnvironment::UltraSpace then @newType = getID(PBTypes,:PSYCHIC)
end
end
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)
id = :BODYSLAM # Environment-specific anim
case @secretPower
when 1; id = :THUNDERSHOCK if GameData::Move.exists?(:THUNDERSHOCK)
when 2; id = :VINEWHIP if GameData::Move.exists?(:VINEWHIP)
when 3; id = :FAIRYWIND if GameData::Move.exists?(:FAIRYWIND)
when 4; id = :CONFUSIO if GameData::Move.exists?(:CONFUSION)
when 5; id = :WATERPULSE if GameData::Move.exists?(:WATERPULSE)
when 6; id = :MUDSHOT if GameData::Move.exists?(:MUDSHOT)
when 7; id = :ROCKTHROW if GameData::Move.exists?(:ROCKTHROW)
when 8; id = :MUDSLAP if GameData::Move.exists?(:MUDSLAP)
when 9; id = :ICESHARD if GameData::Move.exists?(:ICESHARD)
when 10; id = :INCINERATE if GameData::Move.exists?(:INCINERATE)
when 11; id = :SHADOWSNEAK if GameData::Move.exists?(:SHADOWSNEAK)
when 12; id = :GUST if GameData::Move.exists?(:GUST)
when 13; id = :SWIFT if GameData::Move.exists?(:SWIFT)
when 14; id = :PSYWAVE if GameData::Move.exists?(:PSYWAVE)
when 1 then id = :THUNDERSHOCK if GameData::Move.exists?(:THUNDERSHOCK)
when 2 then id = :VINEWHIP if GameData::Move.exists?(:VINEWHIP)
when 3 then id = :FAIRYWIND if GameData::Move.exists?(:FAIRYWIND)
when 4 then id = :CONFUSIO if GameData::Move.exists?(:CONFUSION)
when 5 then id = :WATERPULSE if GameData::Move.exists?(:WATERPULSE)
when 6 then id = :MUDSHOT if GameData::Move.exists?(:MUDSHOT)
when 7 then id = :ROCKTHROW if GameData::Move.exists?(:ROCKTHROW)
when 8 then id = :MUDSLAP if GameData::Move.exists?(:MUDSLAP)
when 9 then id = :ICESHARD if GameData::Move.exists?(:ICESHARD)
when 10 then id = :INCINERATE if GameData::Move.exists?(:INCINERATE)
when 11 then id = :SHADOWSNEAK if GameData::Move.exists?(:SHADOWSNEAK)
when 12 then id = :GUST if GameData::Move.exists?(:GUST)
when 13 then id = :SWIFT if GameData::Move.exists?(:SWIFT)
when 14 then id = :PSYWAVE if GameData::Move.exists?(:PSYWAVE)
end
super
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -299,10 +299,10 @@ ItemHandlers::UseInField.add(:ITEMFINDER,proc { |item|
direction = (offsetY<0) ? 8 : 2
end
case direction
when 2; $game_player.turn_down
when 4; $game_player.turn_left
when 6; $game_player.turn_right
when 8; $game_player.turn_up
when 2 then $game_player.turn_down
when 4 then $game_player.turn_left
when 6 then $game_player.turn_right
when 8 then $game_player.turn_up
end
pbWait(Graphics.frame_rate*3/10)
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
gender_rate = pbGetSpeciesData(@species, formSimple, SpeciesData::GENDER_RATE)
case gender_rate
when PBGenderRates::AlwaysMale; return 0
when PBGenderRates::AlwaysFemale; return 1
when PBGenderRates::Genderless; return 2
when PBGenderRates::AlwaysMale then return 0
when PBGenderRates::AlwaysFemale then return 1
when PBGenderRates::Genderless then return 2
end
# Return gender for species that can be male or female
return @genderflag if @genderflag && (@genderflag == 0 || @genderflag == 1)

View File

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

View File

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

View File

@@ -347,11 +347,11 @@ class PokemonSummary_Scene
drawMarkings(overlay,84,292)
# Draw page-specific information
case page
when 1; drawPageOne
when 2; drawPageTwo
when 3; drawPageThree
when 4; drawPageFour
when 5; drawPageFive
when 1 then drawPageOne
when 2 then drawPageTwo
when 3 then drawPageThree
when 4 then drawPageFour
when 5 then drawPageFive
end
end
@@ -409,8 +409,12 @@ class PokemonSummary_Scene
ownerbase = Color.new(64,64,64)
ownershadow = Color.new(176,176,176)
case @pokemon.owner.gender
when 0; 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)
when 0
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
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)])

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -615,10 +615,10 @@ module Compiler
#=============================================================================
def compile_all(mustCompile)
FileLineData.clear
if (!$INEDITOR || LANGUAGES.length < 2) && safeExists?("Data/messages.dat")
MessageTypes.loadMessageFile("Data/messages.dat")
end
if mustCompile
if (!$INEDITOR || LANGUAGES.length<2) && pbRgssExists?("Data/messages.dat")
MessageTypes.loadMessageFile("Data/messages.dat")
end
yield(_INTL("Compiling type data"))
compile_types # No dependencies
yield(_INTL("Compiling town map data"))
@@ -660,13 +660,6 @@ module Compiler
yield(_INTL("Saving messages"))
pbSetTextMessages
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
pbSetWindowText(nil)
end
@@ -722,8 +715,6 @@ module Compiler
mustCompile = false
# Should recompile if new maps were imported
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 !safeIsDirectory?("PBS")
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)
end
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 "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"
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"
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 "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"
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
records.push(record)
}

View File

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

Binary file not shown.