diff --git a/Data/Scripts/001_Technical/004_Input.rb b/Data/Scripts/001_Technical/004_Input.rb index 21e467f32..a86ea1cc3 100644 --- a/Data/Scripts/001_Technical/004_Input.rb +++ b/Data/Scripts/001_Technical/004_Input.rb @@ -2,11 +2,11 @@ module Input USE = C BACK = B ACTION = A - AUX1 = X - AUX2 = Y + JUMPUP = X + JUMPDOWN = Y SPECIAL = Z - JUMPUP = L - JUMPDOWN = R + AUX1 = L + AUX2 = R unless defined?(update_KGC_ScreenCapture) class << Input diff --git a/Data/Scripts/001_Technical/006_RPG_Sprite.rb b/Data/Scripts/001_Technical/006_RPG_Sprite.rb index db1035f7c..7f5e36a3e 100644 --- a/Data/Scripts/001_Technical/006_RPG_Sprite.rb +++ b/Data/Scripts/001_Technical/006_RPG_Sprite.rb @@ -48,7 +48,7 @@ class SpriteAnimation @@_reference_count[bitmap] = 1 end @_animation_sprites = [] - if @_animation.position != 3 or not @@_animations.include?(animation) + if @_animation.position != 3 || !@@_animations.include?(animation) 16.times do sprite = ::Sprite.new(self.viewport) sprite.bitmap = bitmap @@ -195,7 +195,7 @@ class SpriteAnimation for i in 0..15 sprite = sprites[i] pattern = cell_data[i, 0] - if sprite == nil or pattern == nil or pattern == -1 + if sprite == nil || pattern == nil || pattern == -1 sprite.visible = false if sprite != nil next end @@ -223,9 +223,9 @@ class SpriteAnimation end def animation_process_timing(timing, hit) - if (timing.condition == 0) or - (timing.condition == 1 and hit == true) or - (timing.condition == 2 and hit == false) + if timing.condition == 0 || + (timing.condition == 1 && hit == true) || + (timing.condition == 2 && hit == false) if timing.se.name != "" se = timing.se pbSEPlay(se) @@ -349,7 +349,7 @@ module RPG bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1) bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1) bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1) - if value.is_a?(Numeric) and value < 0 + if value.is_a?(Numeric) && value < 0 bitmap.font.color.set(176, 255, 144) else bitmap.font.color.set(255, 255, 255) diff --git a/Data/Scripts/003_Game processing/002_Scene_Map.rb b/Data/Scripts/003_Game processing/002_Scene_Map.rb index 2d0609e12..4c731d674 100644 --- a/Data/Scripts/003_Game processing/002_Scene_Map.rb +++ b/Data/Scripts/003_Game processing/002_Scene_Map.rb @@ -179,7 +179,7 @@ class Scene_Map if Input.trigger?(Input::USE) $PokemonTemp.hiddenMoveEventCalling = true elsif Input.trigger?(Input::BACK) - unless $game_system.menu_disabled or $game_player.moving? + unless $game_system.menu_disabled || $game_player.moving? $game_temp.menu_calling = true $game_temp.menu_beep = true end diff --git a/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb b/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb index e19e3488f..710fbc8c6 100644 --- a/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb +++ b/Data/Scripts/003_Game processing/004_Interpreter_Commands.rb @@ -127,7 +127,7 @@ class Interpreter def command_end @list = nil # If main map event and event ID are valid, unlock event - if @main and @event_id > 0 && $game_map.events[@event_id] + if @main && @event_id > 0 && $game_map.events[@event_id] $game_map.events[@event_id].unlock end end @@ -395,7 +395,7 @@ class Interpreter temp_index += 1 return true if temp_index >= @list.size - 1 # Reached end of commands # Skip ahead to after the [Repeat Above] end of the current loop - if @list[temp_index].code == 413 and @list[temp_index].indent < indent + if @list[temp_index].code == 413 && @list[temp_index].indent < indent @index = temp_index return true end diff --git a/Data/Scripts/004_Game classes/001_Game_Screen.rb b/Data/Scripts/004_Game classes/001_Game_Screen.rb index 9e7e885be..417cc2fdb 100644 --- a/Data/Scripts/004_Game classes/001_Game_Screen.rb +++ b/Data/Scripts/004_Game classes/001_Game_Screen.rb @@ -112,9 +112,9 @@ class Game_Screen @flash_color.alpha = @flash_color.alpha*(d-1)/d @flash_duration -= 1 end - if @shake_duration>=1 or @shake!=0 + if @shake_duration>=1 || @shake!=0 delta = (@shake_power*@shake_speed*@shake_direction)/10.0 - if @shake_duration<=1 and @shake*(@shake+delta)<0 + if @shake_duration<=1 && @shake*(@shake+delta)<0 @shake = 0 else @shake += delta diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb index 828092735..824ce8287 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/002_Game_Switches.rb @@ -17,7 +17,7 @@ class Game_Switches # switch_id : switch ID #----------------------------------------------------------------------------- def [](switch_id) - if switch_id<=5000 and @data[switch_id]!=nil + if switch_id<=5000 && @data[switch_id]!=nil return @data[switch_id] else return false diff --git a/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb b/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb index 359161b2f..caacb764a 100644 --- a/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb +++ b/Data/Scripts/004_Game classes/001_Switches and Variables/003_Game_Variables.rb @@ -17,7 +17,7 @@ class Game_Variables # variable_id : variable ID #----------------------------------------------------------------------------- def [](variable_id) - if variable_id<=5000 and @data[variable_id]!=nil + if variable_id<=5000 && @data[variable_id]!=nil return @data[variable_id] else return 0 diff --git a/Data/Scripts/004_Game classes/002_Game_System.rb b/Data/Scripts/004_Game classes/002_Game_System.rb index ba39f0081..7db54145f 100644 --- a/Data/Scripts/004_Game classes/002_Game_System.rb +++ b/Data/Scripts/004_Game classes/002_Game_System.rb @@ -62,7 +62,7 @@ class Game_System def bgm_play_internal(bgm,position) # :nodoc: @bgm_position = position if !@bgm_paused @playing_bgm = (bgm==nil) ? nil : bgm.clone - if bgm!=nil and bgm.name!="" + if bgm!=nil && bgm.name!="" if FileTest.audio_exist?("Audio/BGM/"+bgm.name) bgm_play_internal2("Audio/BGM/"+bgm.name, bgm.volume,bgm.pitch,@bgm_position) if !@defaultBGM @@ -132,7 +132,7 @@ class Game_System def setDefaultBGM(bgm,volume=80,pitch=100) bgm = RPG::AudioFile.new(bgm,volume,pitch) if bgm.is_a?(String) - if bgm!=nil and bgm.name!="" + if bgm!=nil && bgm.name!="" @defaultBGM = nil self.bgm_play(bgm) @defaultBGM = bgm.clone @@ -146,7 +146,7 @@ class Game_System def me_play(me) me = RPG::AudioFile.new(me) if me.is_a?(String) - if me!=nil and me.name!="" + if me!=nil && me.name!="" if FileTest.audio_exist?("Audio/ME/"+me.name) vol = me.volume vol *= $PokemonSystem.bgmvolume/100.0 @@ -163,7 +163,7 @@ class Game_System def bgs_play(bgs) @playing_bgs = (bgs==nil) ? nil : bgs.clone - if bgs!=nil and bgs.name!="" + if bgs!=nil && bgs.name!="" if FileTest.audio_exist?("Audio/BGS/"+bgs.name) vol = bgs.volume vol *= $PokemonSystem.sevolume/100.0 @@ -230,7 +230,7 @@ class Game_System def se_play(se) se = RPG::AudioFile.new(se) if se.is_a?(String) - if se!=nil and se.name!="" && FileTest.audio_exist?("Audio/SE/"+se.name) + if se!=nil && se.name!="" && FileTest.audio_exist?("Audio/SE/"+se.name) vol = se.volume vol *= $PokemonSystem.sevolume/100.0 vol = vol.to_i @@ -275,7 +275,7 @@ class Game_System end def update - @timer -= 1 if @timer_working and @timer>0 + @timer -= 1 if @timer_working && @timer>0 if Input.trigger?(Input::SPECIAL) && pbCurrentEventCommentInput(1,"Cut Scene") event = @map_interpreter.get_character(0) @map_interpreter.pbSetSelfSwitch(event.id,"A",true) diff --git a/Data/Scripts/004_Game classes/004_Game_Map.rb b/Data/Scripts/004_Game classes/004_Game_Map.rb index fadd485a4..c431fe8ac 100644 --- a/Data/Scripts/004_Game classes/004_Game_Map.rb +++ b/Data/Scripts/004_Game classes/004_Game_Map.rb @@ -135,11 +135,11 @@ class Game_Map end def valid?(x, y) - return (x>=0 and x=0 and y=0 && x=0 && y=-10 and x<=width+10 and y>=-10 and y<=height+10) + return x>=-10 && x<=width+10 && y>=-10 && y<=height+10 end def passable?(x, y, d, self_event = nil) diff --git a/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb b/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb index 4d271b17f..3af3ea189 100644 --- a/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb +++ b/Data/Scripts/004_Game classes/005_Game_Map_Autoscroll.rb @@ -80,10 +80,10 @@ class Interpreter def autoscroll(x,y,speed=SCROLL_SPEED_DEFAULT) if $game_map.scrolling? return false - elsif not $game_map.valid?(x,y) + elsif !$game_map.valid?(x,y) print 'Map Autoscroll: given x,y is invalid' return command_skip - elsif not (1..6).include?(speed) + elsif !(1..6).include?(speed) print 'Map Autoscroll: invalid speed (1-6 only)' return command_skip end @@ -93,7 +93,7 @@ class Interpreter max_y = ($game_map.height - Graphics.height*1.0/Game_Map::TILE_HEIGHT) * 4 * Game_Map::TILE_HEIGHT count_x = ($game_map.display_x - [0,[x*Game_Map::REAL_RES_X-center_x,max_x].min].max)/Game_Map::REAL_RES_X count_y = ($game_map.display_y - [0,[y*Game_Map::REAL_RES_Y-center_y,max_y].min].max)/Game_Map::REAL_RES_Y - if not @diag + if !@diag @diag = true dir = nil if count_x > 0 @@ -113,7 +113,7 @@ class Interpreter else @diag = false dir = nil - if count_x != 0 and count_y != 0 + if count_x != 0 && count_y != 0 return false elsif count_x > 0 dir = 4 diff --git a/Data/Scripts/004_Game classes/007_Game_Character.rb b/Data/Scripts/004_Game classes/007_Game_Character.rb index 29c916747..88f358625 100644 --- a/Data/Scripts/004_Game classes/007_Game_Character.rb +++ b/Data/Scripts/004_Game classes/007_Game_Character.rb @@ -178,7 +178,7 @@ class Game_Character def unlock return unless @locked @locked = false - @direction = @prelock_direction if !@direction_fix and @prelock_direction != 0 + @direction = @prelock_direction if !@direction_fix && @prelock_direction != 0 end #============================================================================= @@ -193,11 +193,11 @@ class Game_Character end def bush_depth - return 0 if @tile_id > 0 || @always_on_top or jumping? + return 0 if @tile_id > 0 || @always_on_top || jumping? xbehind = @x + (@direction==4 ? 1 : @direction==6 ? -1 : 0) ybehind = @y + (@direction==8 ? 1 : @direction==2 ? -1 : 0) - return Game_Map::TILE_HEIGHT if self.map.deepBush?(@x, @y) and self.map.deepBush?(xbehind, ybehind) - return 12 if !moving? and self.map.bush?(@x, @y) + return Game_Map::TILE_HEIGHT if self.map.deepBush?(@x, @y) && self.map.deepBush?(xbehind, ybehind) + return 12 if !moving? && self.map.bush?(@x, @y) return 0 end @@ -220,7 +220,7 @@ class Game_Character next if self == event || !event.at_coordinate?(new_x, new_y) || event.through return false if self != $game_player || event.character_name != "" end - if $game_player.x == new_x and $game_player.y == new_y + if $game_player.x == new_x && $game_player.y == new_y return false if !$game_player.through && @character_name != "" end return true @@ -326,7 +326,7 @@ class Game_Character end def straighten - @pattern = 0 if @walk_anime or @step_anime + @pattern = 0 if @walk_anime || @step_anime @anime_count = 0 @prelock_direction = 0 end @@ -394,7 +394,7 @@ class Game_Character end def move_type_custom - return if jumping? or moving? + return if jumping? || moving? while @move_route_index < @move_route.list.size command = @move_route.list[@move_route_index] if command.code == 0 @@ -428,7 +428,7 @@ class Game_Character 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? + @move_route_index += 1 if @move_route.skippable || moving? || jumping? return end if command.code == 15 # Wait @@ -436,7 +436,7 @@ class Game_Character @move_route_index += 1 return end - if command.code >= 16 and command.code <= 26 + if command.code >= 16 && command.code <= 26 case command.code when 16 then turn_down when 17 then turn_left @@ -631,7 +631,7 @@ class Game_Character def move_toward_player sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0) sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0) - return if sx == 0 and sy == 0 + return if sx == 0 && sy == 0 abs_sx = sx.abs abs_sy = sy.abs if abs_sx == abs_sy @@ -639,12 +639,12 @@ class Game_Character end if abs_sx > abs_sy (sx > 0) ? move_left : move_right - if not moving? and sy != 0 + if !moving? && sy != 0 (sy > 0) ? move_up : move_down end else (sy > 0) ? move_up : move_down - if not moving? and sx != 0 + if !moving? && sx != 0 (sx > 0) ? move_left : move_right end end @@ -653,7 +653,7 @@ class Game_Character def move_away_from_player sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0) sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0) - return if sx == 0 and sy == 0 + return if sx == 0 && sy == 0 abs_sx = sx.abs abs_sy = sy.abs if abs_sx == abs_sy @@ -661,12 +661,12 @@ class Game_Character end if abs_sx > abs_sy (sx > 0) ? move_right : move_left - if not moving? and sy != 0 + if !moving? && sy != 0 (sy > 0) ? move_down : move_up end else (sy > 0) ? move_down : move_up - if not moving? and sx != 0 + if !moving? && sx != 0 (sx > 0) ? move_right : move_left end end @@ -796,7 +796,7 @@ class Game_Character def turn_toward_player sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0) sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0) - return if sx == 0 and sy == 0 + return if sx == 0 && sy == 0 if sx.abs > sy.abs (sx > 0) ? turn_left : turn_right else @@ -807,7 +807,7 @@ class Game_Character def turn_away_from_player sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0) sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0) - return if sx == 0 and sy == 0 + return if sx == 0 && sy == 0 if sx.abs > sy.abs (sx > 0) ? turn_right : turn_left else diff --git a/Data/Scripts/004_Game classes/008_Game_Event.rb b/Data/Scripts/004_Game classes/008_Game_Event.rb index 4b405374b..90dbef367 100644 --- a/Data/Scripts/004_Game classes/008_Game_Event.rb +++ b/Data/Scripts/004_Game classes/008_Game_Event.rb @@ -160,7 +160,7 @@ class Game_Event < Game_Character def check_event_trigger_auto if @trigger == 2 # Event touch if at_coordinate?($game_player.x, $game_player.y) - start if not jumping? and over_trigger? + start if !jumping? && over_trigger? end elsif @trigger == 3 # Autorun start diff --git a/Data/Scripts/004_Game classes/009_Game_Player.rb b/Data/Scripts/004_Game classes/009_Game_Player.rb index 76190bc45..ab8b993e2 100644 --- a/Data/Scripts/004_Game classes/009_Game_Player.rb +++ b/Data/Scripts/004_Game classes/009_Game_Player.rb @@ -109,9 +109,9 @@ class Game_Player < Game_Character next if !event.name[/trainer\((\d+)\)/i] distance = $~[1].to_i # If event coordinates and triggers are consistent - if pbEventCanReachPlayer?(event,self,distance) and triggers.include?(event.trigger) + if pbEventCanReachPlayer?(event,self,distance) && triggers.include?(event.trigger) # If starting determinant is front event (other than jumping) - result.push(event) if not event.jumping? and not event.over_trigger? + result.push(event) if !event.jumping? && !event.over_trigger? end end return result @@ -126,9 +126,9 @@ class Game_Player < Game_Character next if !event.name[/counter\((\d+)\)/i] distance = $~[1].to_i # If event coordinates and triggers are consistent - if pbEventFacesPlayer?(event,self,distance) and triggers.include?(event.trigger) + if pbEventFacesPlayer?(event,self,distance) && triggers.include?(event.trigger) # If starting determinant is front event (other than jumping) - result.push(event) if not event.jumping? and not event.over_trigger? + result.push(event) if !event.jumping? && !event.over_trigger? end end return result @@ -200,7 +200,7 @@ class Game_Player < Game_Character return $MapFactory.isPassableFromEdge?(new_x, new_y) end # If debug mode is ON and Ctrl key was pressed - return true if $DEBUG and Input.press?(Input::CTRL) + return true if $DEBUG && Input.press?(Input::CTRL) return super end diff --git a/Data/Scripts/004_Game classes/011_Game_CommonEvent.rb b/Data/Scripts/004_Game classes/011_Game_CommonEvent.rb index 0b9e52394..e688c7701 100644 --- a/Data/Scripts/004_Game classes/011_Game_CommonEvent.rb +++ b/Data/Scripts/004_Game classes/011_Game_CommonEvent.rb @@ -55,7 +55,7 @@ class Game_CommonEvent #----------------------------------------------------------------------------- def refresh # Create an interpreter for parallel process if necessary - if self.trigger == 2 and switchIsOn?(self.switch_id) + if self.trigger == 2 && switchIsOn?(self.switch_id) if @interpreter == nil @interpreter = Interpreter.new end diff --git a/Data/Scripts/004_Game classes/012_Game_DependentEvents.rb b/Data/Scripts/004_Game classes/012_Game_DependentEvents.rb index 4294be256..c92207cc4 100644 --- a/Data/Scripts/004_Game classes/012_Game_DependentEvents.rb +++ b/Data/Scripts/004_Game classes/012_Game_DependentEvents.rb @@ -400,7 +400,7 @@ class DependentEvents next if !d[9] if e.at_coordinate?($game_player.x, $game_player.y) # On same position - if not e.jumping? && (!e.respond_to?("over_trigger") || e.over_trigger?) + if !e.jumping? && (!e.respond_to?("over_trigger") || e.over_trigger?) if e.list.size>1 # Start event $game_map.refresh if $game_map.need_refresh @@ -411,7 +411,7 @@ class DependentEvents elsif facingTile && e.map.map_id==facingTile[0] && e.at_coordinate?(facingTile[1], facingTile[2]) # On facing tile - if not e.jumping? && (!e.respond_to?("over_trigger") || !e.over_trigger?) + if !e.jumping? && (!e.respond_to?("over_trigger") || !e.over_trigger?) if e.list.size>1 # Start event $game_map.refresh if $game_map.need_refresh diff --git a/Data/Scripts/005_Sprites/003_Sprite_Character.rb b/Data/Scripts/005_Sprites/003_Sprite_Character.rb index a7d1da2eb..584d668c4 100644 --- a/Data/Scripts/005_Sprites/003_Sprite_Character.rb +++ b/Data/Scripts/005_Sprites/003_Sprite_Character.rb @@ -1,5 +1,5 @@ class BushBitmap - def initialize(bitmap,isTile,depth) + def initialize(bitmap, isTile, depth) @bitmaps = [] @bitmap = bitmap @isTile = isTile @@ -8,9 +8,7 @@ class BushBitmap end def dispose - for b in @bitmaps - b.dispose if b - end + @bitmaps.each { |b| b.dispose if b } end def bitmap @@ -18,39 +16,39 @@ class BushBitmap current = (@isBitmap) ? 0 : @bitmap.currentIndex if !@bitmaps[current] if @isTile - @bitmaps[current] = pbBushDepthTile(thisBitmap,@depth) + @bitmaps[current] = pbBushDepthTile(thisBitmap, @depth) else - @bitmaps[current] = pbBushDepthBitmap(thisBitmap,@depth) + @bitmaps[current] = pbBushDepthBitmap(thisBitmap, @depth) end end return @bitmaps[current] end - def pbBushDepthBitmap(bitmap,depth) - ret = Bitmap.new(bitmap.width,bitmap.height) - charheight = ret.height/4 - cy = charheight-depth-2 + def pbBushDepthBitmap(bitmap, depth) + ret = Bitmap.new(bitmap.width, bitmap.height) + charheight = ret.height / 4 + cy = charheight - depth - 2 for i in 0...4 - y = i*charheight - if cy>=0 - ret.blt(0,y,bitmap,Rect.new(0,y,ret.width,cy)) - ret.blt(0,y+cy,bitmap,Rect.new(0,y+cy,ret.width,2),170) + y = i * charheight + if cy >= 0 + ret.blt(0, y, bitmap, Rect.new(0, y, ret.width, cy)) + ret.blt(0, y + cy, bitmap, Rect.new(0, y + cy, ret.width, 2), 170) end - ret.blt(0,y+cy+2,bitmap,Rect.new(0,y+cy+2,ret.width,2),85) if cy+2>=0 + ret.blt(0, y + cy + 2, bitmap, Rect.new(0, y + cy + 2, ret.width, 2), 85) if cy + 2 >= 0 end return ret end - def pbBushDepthTile(bitmap,depth) - ret = Bitmap.new(bitmap.width,bitmap.height) + def pbBushDepthTile(bitmap, depth) + ret = Bitmap.new(bitmap.width, bitmap.height) charheight = ret.height - cy = charheight-depth-2 + cy = charheight - depth - 2 y = charheight - if cy>=0 - ret.blt(0,y,bitmap,Rect.new(0,y,ret.width,cy)) - ret.blt(0,y+cy,bitmap,Rect.new(0,y+cy,ret.width,2),170) + if cy >= 0 + ret.blt(0, y, bitmap, Rect.new(0, y, ret.width, cy)) + ret.blt(0, y + cy, bitmap, Rect.new(0, y + cy, ret.width, 2), 170) end - ret.blt(0,y+cy+2,bitmap,Rect.new(0,y+cy+2,ret.width,2),85) if cy+2>=0 + ret.blt(0, y + cy + 2, bitmap, Rect.new(0, y + cy + 2, ret.width, 2), 85) if cy + 2 >= 0 return ret end end @@ -65,10 +63,10 @@ class Sprite_Character < RPG::Sprite @character = character @oldbushdepth = 0 @spriteoffset = false - if !character || character==$game_player || (character.name[/reflection/i] rescue false) - @reflection = Sprite_Reflection.new(self,character,viewport) + if !character || character == $game_player || (character.name[/reflection/i] rescue false) + @reflection = Sprite_Reflection.new(self, character, viewport) end - @surfbase = Sprite_SurfBase.new(self,character,viewport) if character==$game_player + @surfbase = Sprite_SurfBase.new(self, character, viewport) if character == $game_player update end @@ -96,15 +94,15 @@ class Sprite_Character < RPG::Sprite def update return if @character.is_a?(Game_Event) && !@character.should_update? super - if @tile_id!=@character.tile_id or - @character_name!=@character.character_name or - @character_hue!=@character.character_hue or - @oldbushdepth!=@character.bush_depth + if @tile_id != @character.tile_id || + @character_name != @character.character_name || + @character_hue != @character.character_hue || + @oldbushdepth != @character.bush_depth @tile_id = @character.tile_id @character_name = @character.character_name @character_hue = @character.character_hue @oldbushdepth = @character.bush_depth - if @tile_id>=384 + if @tile_id >= 384 @charbitmap.dispose if @charbitmap @charbitmap = pbGetTileBitmap(@character.map.tileset_name, @tile_id, @character_hue, @character.width, @character.height) @@ -114,45 +112,45 @@ class Sprite_Character < RPG::Sprite @spriteoffset = false @cw = Game_Map::TILE_WIDTH * @character.width @ch = Game_Map::TILE_HEIGHT * @character.height - self.src_rect.set(0,0,@cw,@ch) - self.ox = @cw/2 + self.src_rect.set(0, 0, @cw, @ch) + self.ox = @cw / 2 self.oy = @ch - @character.sprite_size = [@cw,@ch] + @character.sprite_size = [@cw, @ch] else @charbitmap.dispose if @charbitmap @charbitmap = AnimatedBitmap.new( - "Graphics/Characters/"+@character_name,@character_hue) - RPG::Cache.retain("Graphics/Characters/", @character_name, @character_hue) if @character == $game_player + 'Graphics/Characters/' + @character_name, @character_hue) + RPG::Cache.retain('Graphics/Characters/', @character_name, @character_hue) if @character == $game_player @charbitmapAnimated = true @bushbitmap.dispose if @bushbitmap @bushbitmap = nil @spriteoffset = @character_name[/offset/i] - @cw = @charbitmap.width/4 - @ch = @charbitmap.height/4 - self.ox = @cw/2 - @character.sprite_size = [@cw,@ch] + @cw = @charbitmap.width / 4 + @ch = @charbitmap.height / 4 + self.ox = @cw / 2 + @character.sprite_size = [@cw, @ch] end end @charbitmap.update if @charbitmapAnimated bushdepth = @character.bush_depth - if bushdepth==0 + if bushdepth == 0 self.bitmap = (@charbitmapAnimated) ? @charbitmap.bitmap : @charbitmap else - @bushbitmap = BushBitmap.new(@charbitmap,(@tile_id>=384),bushdepth) if !@bushbitmap + @bushbitmap = BushBitmap.new(@charbitmap, (@tile_id >= 384), bushdepth) if !@bushbitmap self.bitmap = @bushbitmap.bitmap end self.visible = !@character.transparent - if @tile_id==0 - sx = @character.pattern*@cw - sy = ((@character.direction-2)/2)*@ch - self.src_rect.set(sx,sy,@cw,@ch) - self.oy = (@spriteoffset rescue false) ? @ch-16 : @ch + if @tile_id == 0 + sx = @character.pattern * @cw + sy = ((@character.direction - 2) / 2) * @ch + self.src_rect.set(sx, sy, @cw, @ch) + self.oy = (@spriteoffset rescue false) ? @ch - 16 : @ch self.oy -= @character.bob_height end if self.visible - if $PokemonSystem.tilemap==0 || + if $PokemonSystem.tilemap == 0 || (@character.is_a?(Game_Event) && @character.name[/regulartone/i]) - self.tone.set(0,0,0,0) + self.tone.set(0, 0, 0, 0) else pbDayNightTint(self) end @@ -160,14 +158,14 @@ class Sprite_Character < RPG::Sprite self.x = @character.screen_x self.y = @character.screen_y self.z = @character.screen_z(@ch) -# self.zoom_x = Game_Map::TILE_WIDTH/32.0 -# self.zoom_y = Game_Map::TILE_HEIGHT/32.0 +# self.zoom_x = Game_Map::TILE_WIDTH / 32.0 +# self.zoom_y = Game_Map::TILE_HEIGHT / 32.0 self.opacity = @character.opacity self.blend_type = @character.blend_type # self.bush_depth = @character.bush_depth - if @character.animation_id!=0 + if @character.animation_id != 0 animation = $data_animations[@character.animation_id] - animation(animation,true) + animation(animation, true) @character.animation_id = 0 end @reflection.update if @reflection diff --git a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb index 3c180124c..a3372b1f9 100644 --- a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb +++ b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb @@ -29,8 +29,8 @@ class Sprite_Shadow < RPG::Sprite return end super - if @tile_id != @character.tile_id or - @character_name != @character.character_name or + if @tile_id != @character.tile_id || + @character_name != @character.character_name || @character_hue != @character.character_hue @tile_id = @character.tile_id @character_name = @character.character_name @@ -47,7 +47,7 @@ class Sprite_Shadow < RPG::Sprite else @chbitmap.dispose if @chbitmap @chbitmap = AnimatedBitmap.new( - "Graphics/Characters/"+@character.character_name,@character.character_hue) + 'Graphics/Characters/'+@character.character_name,@character.character_hue) @cw = @chbitmap.width / 4 @ch = @chbitmap.height / 4 self.ox = @cw / 2 @@ -60,11 +60,11 @@ class Sprite_Shadow < RPG::Sprite else self.bitmap = @chbitmap end - self.visible = (not @character.transparent) + self.visible = !@character.transparent if @tile_id == 0 sx = @character.pattern * @cw sy = (@character.direction - 2) / 2 * @ch - if self.angle > 90 or angle < -90 + if self.angle > 90 || angle < -90 case @character.direction when 2 then sy = (8- 2) / 2 * @ch when 4 then sy = (6- 2) / 2 * @ch @@ -94,12 +94,12 @@ class Sprite_Shadow < RPG::Sprite self.angle = 57.3 * Math.atan2(@deltax, @deltay) @angle_trigo = self.angle+90 @angle_trigo += 360 if @angle_trigo < 0 - if @anglemin != 0 or @anglemax != 0 - if (@angle_trigo < @anglemin or @angle_trigo > @anglemax) and @anglemin < @anglemax + if @anglemin != 0 || @anglemax != 0 + if (@angle_trigo < @anglemin || @angle_trigo > @anglemax) && @anglemin < @anglemax self.opacity = 0 return end - if (@angle_trigo < @anglemin and @angle_trigo > @anglemax) and @anglemin > @anglemax + if @angle_trigo < @anglemin && @angle_trigo > @anglemax && @anglemin > @anglemax self.opacity = 0 return end @@ -133,7 +133,7 @@ class Sprite_Character < RPG::Sprite end def setShadows(map,shadows) - if character.is_a?(Game_Event) and shadows.length > 0 + if character.is_a?(Game_Event) && shadows.length > 0 params = XPML_read(map,"Shadow",@character,4) if params != nil for i in 0...shadows.size @@ -141,7 +141,7 @@ class Sprite_Character < RPG::Sprite end end end - if character.is_a?(Game_Player) and shadows.length > 0 + if character.is_a?(Game_Player) && shadows.length > 0 for i in 0...shadows.size @ombrelist.push(Sprite_Shadow.new(viewport, $game_player, shadows[i])) end @@ -185,9 +185,9 @@ class Spriteset_Map map = $game_map if !map for k in map.events.keys.sort ev = map.events[k] - warn = true if (ev.list != nil and ev.list.length > 0 and - ev.list[0].code == 108 and - (ev.list[0].parameters == ["s"] or ev.list[0].parameters == ["o"])) + warn = true if (ev.list != nil && ev.list.length > 0 && + ev.list[0].code == 108 && + (ev.list[0].parameters == ["s"] || ev.list[0].parameters == ["o"])) params = XPML_read(map,"Shadow Source", ev, 4) @shadows.push([ev] + params) if params != nil end @@ -227,14 +227,14 @@ def XPML_read(map,markup,event,max_param_number=0) parameter_list = nil return nil if !event || event.list == nil for i in 0...event.list.size - if event.list[i].code == 108 and + if event.list[i].code == 108 && event.list[i].parameters[0].downcase == "begin " + markup.downcase parameter_list = [] if parameter_list == nil for j in i+1...event.list.size if event.list[j].code == 108 parts = event.list[j].parameters[0].split - if parts.size != 1 and parts[0].downcase != "begin" - if parts[1].to_i != 0 or parts[1] == "0" + if parts.size != 1 && parts[0].downcase != "begin" + if parts[1].to_i != 0 || parts[1] == "0" parameter_list.push(parts[1].to_i) else parameter_list.push(parts[1]) @@ -245,7 +245,7 @@ def XPML_read(map,markup,event,max_param_number=0) else return parameter_list end - return parameter_list if max_param_number != 0 and j == i + max_param_number + return parameter_list if max_param_number != 0 && j == i + max_param_number end end end diff --git a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb index 43e0dcc08..c10c9789d 100644 --- a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb +++ b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb @@ -678,7 +678,7 @@ class Window_InputNumberPokemon < SpriteWindow_Base digits=@digits_max+(@sign ? 1 : 0) refresh if @frame%15==0 if self.active - if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN) + if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN) pbPlayCursorSE() if @index==0 && @sign @negative=!@negative @@ -843,10 +843,10 @@ class SpriteWindow_Selectable < SpriteWindow_Base def update super - if self.active and @item_max > 0 and @index >= 0 and !@ignore_input + if self.active && @item_max > 0 && @index >= 0 && !@ignore_input if Input.repeat?(Input::UP) - if @index >= @column_max or - (Input.trigger?(Input::UP) && (@item_max%@column_max)==0) + if @index >= @column_max || + (Input.trigger?(Input::UP) && (@item_max % @column_max)==0) oldindex = @index @index = (@index - @column_max + @item_max) % @item_max if @index!=oldindex @@ -855,8 +855,8 @@ class SpriteWindow_Selectable < SpriteWindow_Base end end elsif Input.repeat?(Input::DOWN) - if @index < @item_max - @column_max or - (Input.trigger?(Input::DOWN) && (@item_max%@column_max)==0) + if @index < @item_max - @column_max || + (Input.trigger?(Input::DOWN) && (@item_max % @column_max)==0) oldindex = @index @index = (@index + @column_max) % @item_max if @index!=oldindex @@ -865,7 +865,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base end end elsif Input.repeat?(Input::LEFT) - if @column_max >= 2 and @index > 0 + if @column_max >= 2 && @index > 0 oldindex = @index @index -= 1 if @index!=oldindex @@ -874,7 +874,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base end end elsif Input.repeat?(Input::RIGHT) - if @column_max >= 2 and @index < @item_max - 1 + if @column_max >= 2 && @index < @item_max - 1 oldindex = @index @index += 1 if @index!=oldindex diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index bfffa4051..8f752024a 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -43,7 +43,7 @@ class Scene_Battle $game_map.screen.update end # If timer has reached 0 - if $game_system.timer_working and $game_system.timer == 0 + if $game_system.timer_working && $game_system.timer == 0 # Abort battle $game_temp.battle_abort = true end diff --git a/Data/Scripts/010_Data/002_PBS data/006_Item.rb b/Data/Scripts/010_Data/002_PBS data/006_Item.rb index 90bf849db..2fac5562d 100644 --- a/Data/Scripts/010_Data/002_PBS data/006_Item.rb +++ b/Data/Scripts/010_Data/002_PBS data/006_Item.rb @@ -28,7 +28,7 @@ module GameData # Check for TM/HM type icons if item_data.is_machine? prefix = "machine" - if item.data_is_HM? + if item.data.is_HM? prefix = "machine_hm" elsif item_data.is_TR? prefix = "machine_tr" diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index 18360ea3d..4fad678a2 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -582,7 +582,7 @@ def pbTurnTowardEvent(event,otherEvent) end sx += (event.width - otherEvent.width) / 2.0 sy -= (event.height - otherEvent.height) / 2.0 - return if sx == 0 and sy == 0 + return if sx == 0 && sy == 0 if sx.abs > sy.abs (sx > 0) ? event.turn_left : event.turn_right else diff --git a/mkxp.json b/mkxp.json index eb9ae535f..cad587491 100644 --- a/mkxp.json +++ b/mkxp.json @@ -180,11 +180,11 @@ "bindingNames": {"c": "Use", "b": "Back", "a": "Action", - "x": "(unused)", - "y": "(unused)", + "x": "JumpUp", + "y": "JumpDown", "z": "Special", - "l": "JumpUp", - "r": "JumpDown"}, + "l": "(unused)", + "r": "(unused)"}, // Allow symlinks for game assets to be followed