Remapped JumpUp/JumpDown controls, replaced and/or/not, fixed typo in previous commit

This commit is contained in:
Maruno17
2021-04-25 16:38:47 +01:00
parent a42b66db68
commit 484813c592
22 changed files with 137 additions and 139 deletions

View File

@@ -2,11 +2,11 @@ module Input
USE = C USE = C
BACK = B BACK = B
ACTION = A ACTION = A
AUX1 = X JUMPUP = X
AUX2 = Y JUMPDOWN = Y
SPECIAL = Z SPECIAL = Z
JUMPUP = L AUX1 = L
JUMPDOWN = R AUX2 = R
unless defined?(update_KGC_ScreenCapture) unless defined?(update_KGC_ScreenCapture)
class << Input class << Input

View File

@@ -48,7 +48,7 @@ class SpriteAnimation
@@_reference_count[bitmap] = 1 @@_reference_count[bitmap] = 1
end end
@_animation_sprites = [] @_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation) if @_animation.position != 3 || !@@_animations.include?(animation)
16.times do 16.times do
sprite = ::Sprite.new(self.viewport) sprite = ::Sprite.new(self.viewport)
sprite.bitmap = bitmap sprite.bitmap = bitmap
@@ -195,7 +195,7 @@ class SpriteAnimation
for i in 0..15 for i in 0..15
sprite = sprites[i] sprite = sprites[i]
pattern = cell_data[i, 0] 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 sprite.visible = false if sprite != nil
next next
end end
@@ -223,9 +223,9 @@ class SpriteAnimation
end end
def animation_process_timing(timing, hit) def animation_process_timing(timing, hit)
if (timing.condition == 0) or if timing.condition == 0 ||
(timing.condition == 1 and hit == true) or (timing.condition == 1 && hit == true) ||
(timing.condition == 2 and hit == false) (timing.condition == 2 && hit == false)
if timing.se.name != "" if timing.se.name != ""
se = timing.se se = timing.se
pbSEPlay(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) 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) bitmap.font.color.set(176, 255, 144)
else else
bitmap.font.color.set(255, 255, 255) bitmap.font.color.set(255, 255, 255)

View File

@@ -179,7 +179,7 @@ class Scene_Map
if Input.trigger?(Input::USE) if Input.trigger?(Input::USE)
$PokemonTemp.hiddenMoveEventCalling = true $PokemonTemp.hiddenMoveEventCalling = true
elsif Input.trigger?(Input::BACK) 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_calling = true
$game_temp.menu_beep = true $game_temp.menu_beep = true
end end

View File

@@ -127,7 +127,7 @@ class Interpreter
def command_end def command_end
@list = nil @list = nil
# If main map event and event ID are valid, unlock event # 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 $game_map.events[@event_id].unlock
end end
end end
@@ -395,7 +395,7 @@ class Interpreter
temp_index += 1 temp_index += 1
return true if temp_index >= @list.size - 1 # Reached end of commands return true if temp_index >= @list.size - 1 # Reached end of commands
# Skip ahead to after the [Repeat Above] end of the current loop # 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 @index = temp_index
return true return true
end end

View File

@@ -112,9 +112,9 @@ class Game_Screen
@flash_color.alpha = @flash_color.alpha*(d-1)/d @flash_color.alpha = @flash_color.alpha*(d-1)/d
@flash_duration -= 1 @flash_duration -= 1
end end
if @shake_duration>=1 or @shake!=0 if @shake_duration>=1 || @shake!=0
delta = (@shake_power*@shake_speed*@shake_direction)/10.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 @shake = 0
else else
@shake += delta @shake += delta

View File

@@ -17,7 +17,7 @@ class Game_Switches
# switch_id : switch ID # switch_id : switch ID
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def [](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] return @data[switch_id]
else else
return false return false

View File

@@ -17,7 +17,7 @@ class Game_Variables
# variable_id : variable ID # variable_id : variable ID
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def [](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] return @data[variable_id]
else else
return 0 return 0

View File

@@ -62,7 +62,7 @@ class Game_System
def bgm_play_internal(bgm,position) # :nodoc: def bgm_play_internal(bgm,position) # :nodoc:
@bgm_position = position if !@bgm_paused @bgm_position = position if !@bgm_paused
@playing_bgm = (bgm==nil) ? nil : bgm.clone @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) if FileTest.audio_exist?("Audio/BGM/"+bgm.name)
bgm_play_internal2("Audio/BGM/"+bgm.name, bgm_play_internal2("Audio/BGM/"+bgm.name,
bgm.volume,bgm.pitch,@bgm_position) if !@defaultBGM bgm.volume,bgm.pitch,@bgm_position) if !@defaultBGM
@@ -132,7 +132,7 @@ class Game_System
def setDefaultBGM(bgm,volume=80,pitch=100) def setDefaultBGM(bgm,volume=80,pitch=100)
bgm = RPG::AudioFile.new(bgm,volume,pitch) if bgm.is_a?(String) 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 @defaultBGM = nil
self.bgm_play(bgm) self.bgm_play(bgm)
@defaultBGM = bgm.clone @defaultBGM = bgm.clone
@@ -146,7 +146,7 @@ class Game_System
def me_play(me) def me_play(me)
me = RPG::AudioFile.new(me) if me.is_a?(String) 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) if FileTest.audio_exist?("Audio/ME/"+me.name)
vol = me.volume vol = me.volume
vol *= $PokemonSystem.bgmvolume/100.0 vol *= $PokemonSystem.bgmvolume/100.0
@@ -163,7 +163,7 @@ class Game_System
def bgs_play(bgs) def bgs_play(bgs)
@playing_bgs = (bgs==nil) ? nil : bgs.clone @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) if FileTest.audio_exist?("Audio/BGS/"+bgs.name)
vol = bgs.volume vol = bgs.volume
vol *= $PokemonSystem.sevolume/100.0 vol *= $PokemonSystem.sevolume/100.0
@@ -230,7 +230,7 @@ class Game_System
def se_play(se) def se_play(se)
se = RPG::AudioFile.new(se) if se.is_a?(String) 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 = se.volume
vol *= $PokemonSystem.sevolume/100.0 vol *= $PokemonSystem.sevolume/100.0
vol = vol.to_i vol = vol.to_i
@@ -275,7 +275,7 @@ class Game_System
end end
def update 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") if Input.trigger?(Input::SPECIAL) && pbCurrentEventCommentInput(1,"Cut Scene")
event = @map_interpreter.get_character(0) event = @map_interpreter.get_character(0)
@map_interpreter.pbSetSelfSwitch(event.id,"A",true) @map_interpreter.pbSetSelfSwitch(event.id,"A",true)

View File

@@ -135,11 +135,11 @@ class Game_Map
end end
def valid?(x, y) def valid?(x, y)
return (x>=0 and x<width and y>=0 and y<height) return x>=0 && x<width && y>=0 && y<height
end end
def validLax?(x, y) def validLax?(x, y)
return (x>=-10 and x<=width+10 and y>=-10 and y<=height+10) return x>=-10 && x<=width+10 && y>=-10 && y<=height+10
end end
def passable?(x, y, d, self_event = nil) def passable?(x, y, d, self_event = nil)

View File

@@ -80,10 +80,10 @@ class Interpreter
def autoscroll(x,y,speed=SCROLL_SPEED_DEFAULT) def autoscroll(x,y,speed=SCROLL_SPEED_DEFAULT)
if $game_map.scrolling? if $game_map.scrolling?
return false return false
elsif not $game_map.valid?(x,y) elsif !$game_map.valid?(x,y)
print 'Map Autoscroll: given x,y is invalid' print 'Map Autoscroll: given x,y is invalid'
return command_skip return command_skip
elsif not (1..6).include?(speed) elsif !(1..6).include?(speed)
print 'Map Autoscroll: invalid speed (1-6 only)' print 'Map Autoscroll: invalid speed (1-6 only)'
return command_skip return command_skip
end 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 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_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 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 @diag = true
dir = nil dir = nil
if count_x > 0 if count_x > 0
@@ -113,7 +113,7 @@ class Interpreter
else else
@diag = false @diag = false
dir = nil dir = nil
if count_x != 0 and count_y != 0 if count_x != 0 && count_y != 0
return false return false
elsif count_x > 0 elsif count_x > 0
dir = 4 dir = 4

View File

@@ -178,7 +178,7 @@ class Game_Character
def unlock def unlock
return unless @locked return unless @locked
@locked = false @locked = false
@direction = @prelock_direction if !@direction_fix and @prelock_direction != 0 @direction = @prelock_direction if !@direction_fix && @prelock_direction != 0
end end
#============================================================================= #=============================================================================
@@ -193,11 +193,11 @@ class Game_Character
end end
def bush_depth 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) xbehind = @x + (@direction==4 ? 1 : @direction==6 ? -1 : 0)
ybehind = @y + (@direction==8 ? 1 : @direction==2 ? -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 Game_Map::TILE_HEIGHT if self.map.deepBush?(@x, @y) && self.map.deepBush?(xbehind, ybehind)
return 12 if !moving? and self.map.bush?(@x, @y) return 12 if !moving? && self.map.bush?(@x, @y)
return 0 return 0
end end
@@ -220,7 +220,7 @@ class Game_Character
next if self == event || !event.at_coordinate?(new_x, new_y) || event.through next if self == event || !event.at_coordinate?(new_x, new_y) || event.through
return false if self != $game_player || event.character_name != "" return false if self != $game_player || event.character_name != ""
end 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 != "" return false if !$game_player.through && @character_name != ""
end end
return true return true
@@ -326,7 +326,7 @@ class Game_Character
end end
def straighten def straighten
@pattern = 0 if @walk_anime or @step_anime @pattern = 0 if @walk_anime || @step_anime
@anime_count = 0 @anime_count = 0
@prelock_direction = 0 @prelock_direction = 0
end end
@@ -394,7 +394,7 @@ class Game_Character
end end
def move_type_custom def move_type_custom
return if jumping? or moving? return if jumping? || moving?
while @move_route_index < @move_route.list.size while @move_route_index < @move_route.list.size
command = @move_route.list[@move_route_index] command = @move_route.list[@move_route_index]
if command.code == 0 if command.code == 0
@@ -428,7 +428,7 @@ class Game_Character
when 13 then move_backward when 13 then move_backward
when 14 then jump(command.parameters[0], command.parameters[1]) when 14 then jump(command.parameters[0], command.parameters[1])
end end
@move_route_index += 1 if @move_route.skippable or moving? or jumping? @move_route_index += 1 if @move_route.skippable || moving? || jumping?
return return
end end
if command.code == 15 # Wait if command.code == 15 # Wait
@@ -436,7 +436,7 @@ class Game_Character
@move_route_index += 1 @move_route_index += 1
return return
end end
if command.code >= 16 and command.code <= 26 if command.code >= 16 && command.code <= 26
case command.code case command.code
when 16 then turn_down when 16 then turn_down
when 17 then turn_left when 17 then turn_left
@@ -631,7 +631,7 @@ class Game_Character
def move_toward_player def move_toward_player
sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0) sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0)
sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0) 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_sx = sx.abs
abs_sy = sy.abs abs_sy = sy.abs
if abs_sx == abs_sy if abs_sx == abs_sy
@@ -639,12 +639,12 @@ class Game_Character
end end
if abs_sx > abs_sy if abs_sx > abs_sy
(sx > 0) ? move_left : move_right (sx > 0) ? move_left : move_right
if not moving? and sy != 0 if !moving? && sy != 0
(sy > 0) ? move_up : move_down (sy > 0) ? move_up : move_down
end end
else else
(sy > 0) ? move_up : move_down (sy > 0) ? move_up : move_down
if not moving? and sx != 0 if !moving? && sx != 0
(sx > 0) ? move_left : move_right (sx > 0) ? move_left : move_right
end end
end end
@@ -653,7 +653,7 @@ class Game_Character
def move_away_from_player def move_away_from_player
sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0) sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0)
sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0) 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_sx = sx.abs
abs_sy = sy.abs abs_sy = sy.abs
if abs_sx == abs_sy if abs_sx == abs_sy
@@ -661,12 +661,12 @@ class Game_Character
end end
if abs_sx > abs_sy if abs_sx > abs_sy
(sx > 0) ? move_right : move_left (sx > 0) ? move_right : move_left
if not moving? and sy != 0 if !moving? && sy != 0
(sy > 0) ? move_down : move_up (sy > 0) ? move_down : move_up
end end
else else
(sy > 0) ? move_down : move_up (sy > 0) ? move_down : move_up
if not moving? and sx != 0 if !moving? && sx != 0
(sx > 0) ? move_right : move_left (sx > 0) ? move_right : move_left
end end
end end
@@ -796,7 +796,7 @@ class Game_Character
def turn_toward_player def turn_toward_player
sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0) sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0)
sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0) 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 if sx.abs > sy.abs
(sx > 0) ? turn_left : turn_right (sx > 0) ? turn_left : turn_right
else else
@@ -807,7 +807,7 @@ class Game_Character
def turn_away_from_player def turn_away_from_player
sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0) sx = @x + @width / 2.0 - ($game_player.x + $game_player.width / 2.0)
sy = @y - @height / 2.0 - ($game_player.y - $game_player.height / 2.0) 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 if sx.abs > sy.abs
(sx > 0) ? turn_right : turn_left (sx > 0) ? turn_right : turn_left
else else

View File

@@ -160,7 +160,7 @@ class Game_Event < Game_Character
def check_event_trigger_auto def check_event_trigger_auto
if @trigger == 2 # Event touch if @trigger == 2 # Event touch
if at_coordinate?($game_player.x, $game_player.y) if at_coordinate?($game_player.x, $game_player.y)
start if not jumping? and over_trigger? start if !jumping? && over_trigger?
end end
elsif @trigger == 3 # Autorun elsif @trigger == 3 # Autorun
start start

View File

@@ -109,9 +109,9 @@ class Game_Player < Game_Character
next if !event.name[/trainer\((\d+)\)/i] next if !event.name[/trainer\((\d+)\)/i]
distance = $~[1].to_i distance = $~[1].to_i
# If event coordinates and triggers are consistent # 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) # 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
end end
return result return result
@@ -126,9 +126,9 @@ class Game_Player < Game_Character
next if !event.name[/counter\((\d+)\)/i] next if !event.name[/counter\((\d+)\)/i]
distance = $~[1].to_i distance = $~[1].to_i
# If event coordinates and triggers are consistent # 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) # 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
end end
return result return result
@@ -200,7 +200,7 @@ class Game_Player < Game_Character
return $MapFactory.isPassableFromEdge?(new_x, new_y) return $MapFactory.isPassableFromEdge?(new_x, new_y)
end end
# If debug mode is ON and Ctrl key was pressed # 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 return super
end end

View File

@@ -55,7 +55,7 @@ class Game_CommonEvent
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def refresh def refresh
# Create an interpreter for parallel process if necessary # 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 if @interpreter == nil
@interpreter = Interpreter.new @interpreter = Interpreter.new
end end

View File

@@ -400,7 +400,7 @@ class DependentEvents
next if !d[9] next if !d[9]
if e.at_coordinate?($game_player.x, $game_player.y) if e.at_coordinate?($game_player.x, $game_player.y)
# On same position # 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 if e.list.size>1
# Start event # Start event
$game_map.refresh if $game_map.need_refresh $game_map.refresh if $game_map.need_refresh
@@ -411,7 +411,7 @@ class DependentEvents
elsif facingTile && e.map.map_id==facingTile[0] && elsif facingTile && e.map.map_id==facingTile[0] &&
e.at_coordinate?(facingTile[1], facingTile[2]) e.at_coordinate?(facingTile[1], facingTile[2])
# On facing tile # 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 if e.list.size>1
# Start event # Start event
$game_map.refresh if $game_map.need_refresh $game_map.refresh if $game_map.need_refresh

View File

@@ -1,5 +1,5 @@
class BushBitmap class BushBitmap
def initialize(bitmap,isTile,depth) def initialize(bitmap, isTile, depth)
@bitmaps = [] @bitmaps = []
@bitmap = bitmap @bitmap = bitmap
@isTile = isTile @isTile = isTile
@@ -8,9 +8,7 @@ class BushBitmap
end end
def dispose def dispose
for b in @bitmaps @bitmaps.each { |b| b.dispose if b }
b.dispose if b
end
end end
def bitmap def bitmap
@@ -18,39 +16,39 @@ class BushBitmap
current = (@isBitmap) ? 0 : @bitmap.currentIndex current = (@isBitmap) ? 0 : @bitmap.currentIndex
if !@bitmaps[current] if !@bitmaps[current]
if @isTile if @isTile
@bitmaps[current] = pbBushDepthTile(thisBitmap,@depth) @bitmaps[current] = pbBushDepthTile(thisBitmap, @depth)
else else
@bitmaps[current] = pbBushDepthBitmap(thisBitmap,@depth) @bitmaps[current] = pbBushDepthBitmap(thisBitmap, @depth)
end end
end end
return @bitmaps[current] return @bitmaps[current]
end end
def pbBushDepthBitmap(bitmap,depth) def pbBushDepthBitmap(bitmap, depth)
ret = Bitmap.new(bitmap.width,bitmap.height) ret = Bitmap.new(bitmap.width, bitmap.height)
charheight = ret.height/4 charheight = ret.height / 4
cy = charheight-depth-2 cy = charheight - depth - 2
for i in 0...4 for i in 0...4
y = i*charheight y = i * charheight
if cy>=0 if cy >= 0
ret.blt(0,y,bitmap,Rect.new(0,y,ret.width,cy)) 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) ret.blt(0, y + cy, bitmap, Rect.new(0, y + cy, ret.width, 2), 170)
end 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 end
return ret return ret
end end
def pbBushDepthTile(bitmap,depth) def pbBushDepthTile(bitmap, depth)
ret = Bitmap.new(bitmap.width,bitmap.height) ret = Bitmap.new(bitmap.width, bitmap.height)
charheight = ret.height charheight = ret.height
cy = charheight-depth-2 cy = charheight - depth - 2
y = charheight y = charheight
if cy>=0 if cy >= 0
ret.blt(0,y,bitmap,Rect.new(0,y,ret.width,cy)) 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) ret.blt(0, y + cy, bitmap, Rect.new(0, y + cy, ret.width, 2), 170)
end 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 return ret
end end
end end
@@ -65,10 +63,10 @@ class Sprite_Character < RPG::Sprite
@character = character @character = character
@oldbushdepth = 0 @oldbushdepth = 0
@spriteoffset = false @spriteoffset = false
if !character || character==$game_player || (character.name[/reflection/i] rescue false) if !character || character == $game_player || (character.name[/reflection/i] rescue false)
@reflection = Sprite_Reflection.new(self,character,viewport) @reflection = Sprite_Reflection.new(self, character, viewport)
end end
@surfbase = Sprite_SurfBase.new(self,character,viewport) if character==$game_player @surfbase = Sprite_SurfBase.new(self, character, viewport) if character == $game_player
update update
end end
@@ -96,15 +94,15 @@ class Sprite_Character < RPG::Sprite
def update def update
return if @character.is_a?(Game_Event) && !@character.should_update? return if @character.is_a?(Game_Event) && !@character.should_update?
super super
if @tile_id!=@character.tile_id or if @tile_id != @character.tile_id ||
@character_name!=@character.character_name or @character_name != @character.character_name ||
@character_hue!=@character.character_hue or @character_hue != @character.character_hue ||
@oldbushdepth!=@character.bush_depth @oldbushdepth != @character.bush_depth
@tile_id = @character.tile_id @tile_id = @character.tile_id
@character_name = @character.character_name @character_name = @character.character_name
@character_hue = @character.character_hue @character_hue = @character.character_hue
@oldbushdepth = @character.bush_depth @oldbushdepth = @character.bush_depth
if @tile_id>=384 if @tile_id >= 384
@charbitmap.dispose if @charbitmap @charbitmap.dispose if @charbitmap
@charbitmap = pbGetTileBitmap(@character.map.tileset_name, @tile_id, @charbitmap = pbGetTileBitmap(@character.map.tileset_name, @tile_id,
@character_hue, @character.width, @character.height) @character_hue, @character.width, @character.height)
@@ -114,45 +112,45 @@ class Sprite_Character < RPG::Sprite
@spriteoffset = false @spriteoffset = false
@cw = Game_Map::TILE_WIDTH * @character.width @cw = Game_Map::TILE_WIDTH * @character.width
@ch = Game_Map::TILE_HEIGHT * @character.height @ch = Game_Map::TILE_HEIGHT * @character.height
self.src_rect.set(0,0,@cw,@ch) self.src_rect.set(0, 0, @cw, @ch)
self.ox = @cw/2 self.ox = @cw / 2
self.oy = @ch self.oy = @ch
@character.sprite_size = [@cw,@ch] @character.sprite_size = [@cw, @ch]
else else
@charbitmap.dispose if @charbitmap @charbitmap.dispose if @charbitmap
@charbitmap = AnimatedBitmap.new( @charbitmap = AnimatedBitmap.new(
"Graphics/Characters/"+@character_name,@character_hue) 'Graphics/Characters/' + @character_name, @character_hue)
RPG::Cache.retain("Graphics/Characters/", @character_name, @character_hue) if @character == $game_player RPG::Cache.retain('Graphics/Characters/', @character_name, @character_hue) if @character == $game_player
@charbitmapAnimated = true @charbitmapAnimated = true
@bushbitmap.dispose if @bushbitmap @bushbitmap.dispose if @bushbitmap
@bushbitmap = nil @bushbitmap = nil
@spriteoffset = @character_name[/offset/i] @spriteoffset = @character_name[/offset/i]
@cw = @charbitmap.width/4 @cw = @charbitmap.width / 4
@ch = @charbitmap.height/4 @ch = @charbitmap.height / 4
self.ox = @cw/2 self.ox = @cw / 2
@character.sprite_size = [@cw,@ch] @character.sprite_size = [@cw, @ch]
end end
end end
@charbitmap.update if @charbitmapAnimated @charbitmap.update if @charbitmapAnimated
bushdepth = @character.bush_depth bushdepth = @character.bush_depth
if bushdepth==0 if bushdepth == 0
self.bitmap = (@charbitmapAnimated) ? @charbitmap.bitmap : @charbitmap self.bitmap = (@charbitmapAnimated) ? @charbitmap.bitmap : @charbitmap
else 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 self.bitmap = @bushbitmap.bitmap
end end
self.visible = !@character.transparent self.visible = !@character.transparent
if @tile_id==0 if @tile_id == 0
sx = @character.pattern*@cw sx = @character.pattern * @cw
sy = ((@character.direction-2)/2)*@ch sy = ((@character.direction - 2) / 2) * @ch
self.src_rect.set(sx,sy,@cw,@ch) self.src_rect.set(sx, sy, @cw, @ch)
self.oy = (@spriteoffset rescue false) ? @ch-16 : @ch self.oy = (@spriteoffset rescue false) ? @ch - 16 : @ch
self.oy -= @character.bob_height self.oy -= @character.bob_height
end end
if self.visible if self.visible
if $PokemonSystem.tilemap==0 || if $PokemonSystem.tilemap == 0 ||
(@character.is_a?(Game_Event) && @character.name[/regulartone/i]) (@character.is_a?(Game_Event) && @character.name[/regulartone/i])
self.tone.set(0,0,0,0) self.tone.set(0, 0, 0, 0)
else else
pbDayNightTint(self) pbDayNightTint(self)
end end
@@ -160,14 +158,14 @@ class Sprite_Character < RPG::Sprite
self.x = @character.screen_x self.x = @character.screen_x
self.y = @character.screen_y self.y = @character.screen_y
self.z = @character.screen_z(@ch) self.z = @character.screen_z(@ch)
# self.zoom_x = Game_Map::TILE_WIDTH/32.0 # self.zoom_x = Game_Map::TILE_WIDTH / 32.0
# self.zoom_y = Game_Map::TILE_HEIGHT/32.0 # self.zoom_y = Game_Map::TILE_HEIGHT / 32.0
self.opacity = @character.opacity self.opacity = @character.opacity
self.blend_type = @character.blend_type self.blend_type = @character.blend_type
# self.bush_depth = @character.bush_depth # self.bush_depth = @character.bush_depth
if @character.animation_id!=0 if @character.animation_id != 0
animation = $data_animations[@character.animation_id] animation = $data_animations[@character.animation_id]
animation(animation,true) animation(animation, true)
@character.animation_id = 0 @character.animation_id = 0
end end
@reflection.update if @reflection @reflection.update if @reflection

View File

@@ -29,8 +29,8 @@ class Sprite_Shadow < RPG::Sprite
return return
end end
super super
if @tile_id != @character.tile_id or if @tile_id != @character.tile_id ||
@character_name != @character.character_name or @character_name != @character.character_name ||
@character_hue != @character.character_hue @character_hue != @character.character_hue
@tile_id = @character.tile_id @tile_id = @character.tile_id
@character_name = @character.character_name @character_name = @character.character_name
@@ -47,7 +47,7 @@ class Sprite_Shadow < RPG::Sprite
else else
@chbitmap.dispose if @chbitmap @chbitmap.dispose if @chbitmap
@chbitmap = AnimatedBitmap.new( @chbitmap = AnimatedBitmap.new(
"Graphics/Characters/"+@character.character_name,@character.character_hue) 'Graphics/Characters/'+@character.character_name,@character.character_hue)
@cw = @chbitmap.width / 4 @cw = @chbitmap.width / 4
@ch = @chbitmap.height / 4 @ch = @chbitmap.height / 4
self.ox = @cw / 2 self.ox = @cw / 2
@@ -60,11 +60,11 @@ class Sprite_Shadow < RPG::Sprite
else else
self.bitmap = @chbitmap self.bitmap = @chbitmap
end end
self.visible = (not @character.transparent) self.visible = !@character.transparent
if @tile_id == 0 if @tile_id == 0
sx = @character.pattern * @cw sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch sy = (@character.direction - 2) / 2 * @ch
if self.angle > 90 or angle < -90 if self.angle > 90 || angle < -90
case @character.direction case @character.direction
when 2 then sy = (8- 2) / 2 * @ch when 2 then sy = (8- 2) / 2 * @ch
when 4 then sy = (6- 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) self.angle = 57.3 * Math.atan2(@deltax, @deltay)
@angle_trigo = self.angle+90 @angle_trigo = self.angle+90
@angle_trigo += 360 if @angle_trigo < 0 @angle_trigo += 360 if @angle_trigo < 0
if @anglemin != 0 or @anglemax != 0 if @anglemin != 0 || @anglemax != 0
if (@angle_trigo < @anglemin or @angle_trigo > @anglemax) and @anglemin < @anglemax if (@angle_trigo < @anglemin || @angle_trigo > @anglemax) && @anglemin < @anglemax
self.opacity = 0 self.opacity = 0
return return
end end
if (@angle_trigo < @anglemin and @angle_trigo > @anglemax) and @anglemin > @anglemax if @angle_trigo < @anglemin && @angle_trigo > @anglemax && @anglemin > @anglemax
self.opacity = 0 self.opacity = 0
return return
end end
@@ -133,7 +133,7 @@ class Sprite_Character < RPG::Sprite
end end
def setShadows(map,shadows) 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) params = XPML_read(map,"Shadow",@character,4)
if params != nil if params != nil
for i in 0...shadows.size for i in 0...shadows.size
@@ -141,7 +141,7 @@ class Sprite_Character < RPG::Sprite
end end
end 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 for i in 0...shadows.size
@ombrelist.push(Sprite_Shadow.new(viewport, $game_player, shadows[i])) @ombrelist.push(Sprite_Shadow.new(viewport, $game_player, shadows[i]))
end end
@@ -185,9 +185,9 @@ class Spriteset_Map
map = $game_map if !map map = $game_map if !map
for k in map.events.keys.sort for k in map.events.keys.sort
ev = map.events[k] ev = map.events[k]
warn = true if (ev.list != nil and ev.list.length > 0 and warn = true if (ev.list != nil && ev.list.length > 0 &&
ev.list[0].code == 108 and ev.list[0].code == 108 &&
(ev.list[0].parameters == ["s"] or ev.list[0].parameters == ["o"])) (ev.list[0].parameters == ["s"] || ev.list[0].parameters == ["o"]))
params = XPML_read(map,"Shadow Source", ev, 4) params = XPML_read(map,"Shadow Source", ev, 4)
@shadows.push([ev] + params) if params != nil @shadows.push([ev] + params) if params != nil
end end
@@ -227,14 +227,14 @@ def XPML_read(map,markup,event,max_param_number=0)
parameter_list = nil parameter_list = nil
return nil if !event || event.list == nil return nil if !event || event.list == nil
for i in 0...event.list.size 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 event.list[i].parameters[0].downcase == "begin " + markup.downcase
parameter_list = [] if parameter_list == nil parameter_list = [] if parameter_list == nil
for j in i+1...event.list.size for j in i+1...event.list.size
if event.list[j].code == 108 if event.list[j].code == 108
parts = event.list[j].parameters[0].split parts = event.list[j].parameters[0].split
if parts.size != 1 and parts[0].downcase != "begin" if parts.size != 1 && parts[0].downcase != "begin"
if parts[1].to_i != 0 or parts[1] == "0" if parts[1].to_i != 0 || parts[1] == "0"
parameter_list.push(parts[1].to_i) parameter_list.push(parts[1].to_i)
else else
parameter_list.push(parts[1]) parameter_list.push(parts[1])
@@ -245,7 +245,7 @@ def XPML_read(map,markup,event,max_param_number=0)
else else
return parameter_list return parameter_list
end 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 end
end end

View File

@@ -678,7 +678,7 @@ class Window_InputNumberPokemon < SpriteWindow_Base
digits=@digits_max+(@sign ? 1 : 0) digits=@digits_max+(@sign ? 1 : 0)
refresh if @frame%15==0 refresh if @frame%15==0
if self.active if self.active
if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN) if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
pbPlayCursorSE() pbPlayCursorSE()
if @index==0 && @sign if @index==0 && @sign
@negative=!@negative @negative=!@negative
@@ -843,10 +843,10 @@ class SpriteWindow_Selectable < SpriteWindow_Base
def update def update
super 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 Input.repeat?(Input::UP)
if @index >= @column_max or if @index >= @column_max ||
(Input.trigger?(Input::UP) && (@item_max%@column_max)==0) (Input.trigger?(Input::UP) && (@item_max % @column_max)==0)
oldindex = @index oldindex = @index
@index = (@index - @column_max + @item_max) % @item_max @index = (@index - @column_max + @item_max) % @item_max
if @index!=oldindex if @index!=oldindex
@@ -855,8 +855,8 @@ class SpriteWindow_Selectable < SpriteWindow_Base
end end
end end
elsif Input.repeat?(Input::DOWN) elsif Input.repeat?(Input::DOWN)
if @index < @item_max - @column_max or if @index < @item_max - @column_max ||
(Input.trigger?(Input::DOWN) && (@item_max%@column_max)==0) (Input.trigger?(Input::DOWN) && (@item_max % @column_max)==0)
oldindex = @index oldindex = @index
@index = (@index + @column_max) % @item_max @index = (@index + @column_max) % @item_max
if @index!=oldindex if @index!=oldindex
@@ -865,7 +865,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base
end end
end end
elsif Input.repeat?(Input::LEFT) elsif Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index > 0 if @column_max >= 2 && @index > 0
oldindex = @index oldindex = @index
@index -= 1 @index -= 1
if @index!=oldindex if @index!=oldindex
@@ -874,7 +874,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base
end end
end end
elsif Input.repeat?(Input::RIGHT) elsif Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1 if @column_max >= 2 && @index < @item_max - 1
oldindex = @index oldindex = @index
@index += 1 @index += 1
if @index!=oldindex if @index!=oldindex

View File

@@ -43,7 +43,7 @@ class Scene_Battle
$game_map.screen.update $game_map.screen.update
end end
# If timer has reached 0 # 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 # Abort battle
$game_temp.battle_abort = true $game_temp.battle_abort = true
end end

View File

@@ -28,7 +28,7 @@ module GameData
# Check for TM/HM type icons # Check for TM/HM type icons
if item_data.is_machine? if item_data.is_machine?
prefix = "machine" prefix = "machine"
if item.data_is_HM? if item.data.is_HM?
prefix = "machine_hm" prefix = "machine_hm"
elsif item_data.is_TR? elsif item_data.is_TR?
prefix = "machine_tr" prefix = "machine_tr"

View File

@@ -582,7 +582,7 @@ def pbTurnTowardEvent(event,otherEvent)
end end
sx += (event.width - otherEvent.width) / 2.0 sx += (event.width - otherEvent.width) / 2.0
sy -= (event.height - otherEvent.height) / 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 if sx.abs > sy.abs
(sx > 0) ? event.turn_left : event.turn_right (sx > 0) ? event.turn_left : event.turn_right
else else

View File

@@ -180,11 +180,11 @@
"bindingNames": {"c": "Use", "bindingNames": {"c": "Use",
"b": "Back", "b": "Back",
"a": "Action", "a": "Action",
"x": "(unused)", "x": "JumpUp",
"y": "(unused)", "y": "JumpDown",
"z": "Special", "z": "Special",
"l": "JumpUp", "l": "(unused)",
"r": "JumpDown"}, "r": "(unused)"},
// Allow symlinks for game assets to be followed // Allow symlinks for game assets to be followed