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

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -135,11 +135,11 @@ class Game_Map
end
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
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
def passable?(x, y, d, self_event = nil)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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