mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Remapped JumpUp/JumpDown controls, replaced and/or/not, fixed typo in previous commit
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -96,9 +94,9 @@ 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
|
||||
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
|
||||
@@ -121,8 +119,8 @@ class Sprite_Character < RPG::Sprite
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,9 +843,9 @@ 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
|
||||
if @index >= @column_max ||
|
||||
(Input.trigger?(Input::UP) && (@item_max % @column_max)==0)
|
||||
oldindex = @index
|
||||
@index = (@index - @column_max + @item_max) % @item_max
|
||||
@@ -855,7 +855,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
||||
end
|
||||
end
|
||||
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)
|
||||
oldindex = @index
|
||||
@index = (@index + @column_max) % @item_max
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user