Reorganized files
This commit is contained in:
		
							parent
							
								
									66b1cbe21f
								
							
						
					
					
						commit
						c0bf423bbf
					
				
					 16 changed files with 153 additions and 156 deletions
				
			
		| 
						 | 
					@ -1,4 +1,16 @@
 | 
				
			||||||
class SpecialEventData
 | 
					class SpecialEventData
 | 
				
			||||||
 | 
					  attr_reader :flags
 | 
				
			||||||
 | 
					  attr_reader :collision
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def initialize(flags, collision)
 | 
				
			||||||
 | 
					    @flags = flags
 | 
				
			||||||
 | 
					    @collision = collision
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.get(name)
 | 
				
			||||||
 | 
					    return SPECIAL_EVENTS[name]
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SPECIAL_EVENTS = {
 | 
					  SPECIAL_EVENTS = {
 | 
				
			||||||
    :bigpool => SpecialEventData.new(
 | 
					    :bigpool => SpecialEventData.new(
 | 
				
			||||||
      [:bottom],
 | 
					      [:bottom],
 | 
				
			||||||
| 
						 | 
					@ -1,15 +0,0 @@
 | 
				
			||||||
class Language
 | 
					 | 
				
			||||||
  attr_reader :font
 | 
					 | 
				
			||||||
  attr_reader :character_table
 | 
					 | 
				
			||||||
  attr_reader :character_table_height
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def initialize(font, character_table, character_table_height)
 | 
					 | 
				
			||||||
    @font = font
 | 
					 | 
				
			||||||
    @character_table = character_table
 | 
					 | 
				
			||||||
    @character_table_height = character_table_height
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def self.get(code = :en)
 | 
					 | 
				
			||||||
    return LANGUAGES[code] || LANGUAGES[:en]
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,41 +0,0 @@
 | 
				
			||||||
def bg(name)
 | 
					 | 
				
			||||||
  $game_map.bg_name = name
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def particles(type)
 | 
					 | 
				
			||||||
  $game_map.particles_type = type
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def ambient(r, g = -1, b = -1)
 | 
					 | 
				
			||||||
  g = r if g < 0
 | 
					 | 
				
			||||||
  b = r if b < 0
 | 
					 | 
				
			||||||
  #$scene.ambient = Color.new(r, g, b)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def clear_ambient
 | 
					 | 
				
			||||||
  #$scene.ambient = Color.new(255, 255, 255)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def add_light(id, file, intensity, x, y)
 | 
					 | 
				
			||||||
  #$scene.add_light(id, file, intensity, x, y)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def del_light(id)
 | 
					 | 
				
			||||||
  #$scene.del_light(id)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def clear_lights
 | 
					 | 
				
			||||||
  #$scene.clear_lights
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def fade_in_bulb
 | 
					 | 
				
			||||||
  #$scene.fade_in_bulb
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def clamp_panorama
 | 
					 | 
				
			||||||
  $game_map.clamped_panorama = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
def wrap_map
 | 
					 | 
				
			||||||
  $game_map.wrapping = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,3 +0,0 @@
 | 
				
			||||||
def enter_name
 | 
					 | 
				
			||||||
  $game_temp.name_calling = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,17 +0,0 @@
 | 
				
			||||||
def check_exit(min, max, x: -1, y: -1)
 | 
					 | 
				
			||||||
  result = false
 | 
					 | 
				
			||||||
  if x >= 0
 | 
					 | 
				
			||||||
    if $game_player.x == x
 | 
					 | 
				
			||||||
      if $game_player.y >= min && $game_player.y <= max
 | 
					 | 
				
			||||||
        result = true
 | 
					 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
  elsif y >= 0
 | 
					 | 
				
			||||||
    if $game_player.y == y
 | 
					 | 
				
			||||||
      if $game_player.x >= min && $game_player.x <= max
 | 
					 | 
				
			||||||
        result = true
 | 
					 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
  Script.tmp_s1 = $game_switches[11] ? false : result
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,47 +0,0 @@
 | 
				
			||||||
module Script
 | 
					 | 
				
			||||||
  def self.px
 | 
					 | 
				
			||||||
    logpos($game_player.x, $game_player.real_x, $game_player.direction == 6)
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def self.py
 | 
					 | 
				
			||||||
    logpos($game_player.y, $game_player.real_y, $game_player.direction == 2)
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # Temporary switch assignment
 | 
					 | 
				
			||||||
  def self.tmp_s1=(val)
 | 
					 | 
				
			||||||
    $game_switches[TMP_INDEX+0] = val
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def self.tmp_s2=(val)
 | 
					 | 
				
			||||||
    $game_switches[TMP_INDEX+1] = val
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def self.tmp_s3=(val)
 | 
					 | 
				
			||||||
    $game_switches[TMP_INDEX+2] = val
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def self.tmp_v1=(val)
 | 
					 | 
				
			||||||
    $game_variables[TMP_INDEX+0] = val
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def self.tmp_v2=(val)
 | 
					 | 
				
			||||||
    $game_variables[TMP_INDEX+1] = val
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def self.tmp_v3=(val)
 | 
					 | 
				
			||||||
    $game_variables[TMP_INDEX+2] = val
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  private
 | 
					 | 
				
			||||||
  TMP_INDEX = 22
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def self.logpos(pos, realpos, positive)
 | 
					 | 
				
			||||||
    bigpos = pos * 128
 | 
					 | 
				
			||||||
    if realpos < bigpos
 | 
					 | 
				
			||||||
      return pos - 1 if positive
 | 
					 | 
				
			||||||
    elsif realpos > bigpos
 | 
					 | 
				
			||||||
      return pos + 1 if positive
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    return pos
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
							
								
								
									
										111
									
								
								scripts/Script.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										111
									
								
								scripts/Script.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,111 @@
 | 
				
			||||||
 | 
					module Script
 | 
				
			||||||
 | 
					  def self.px
 | 
				
			||||||
 | 
					    logpos($game_player.x, $game_player.real_x, $game_player.direction == 6)
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.py
 | 
				
			||||||
 | 
					    logpos($game_player.y, $game_player.real_y, $game_player.direction == 2)
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Temporary switch assignment
 | 
				
			||||||
 | 
					  def self.tmp_s1=(val)
 | 
				
			||||||
 | 
					    $game_switches[TMP_INDEX+0] = val
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.tmp_s2=(val)
 | 
				
			||||||
 | 
					    $game_switches[TMP_INDEX+1] = val
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.tmp_s3=(val)
 | 
				
			||||||
 | 
					    $game_switches[TMP_INDEX+2] = val
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.tmp_v1=(val)
 | 
				
			||||||
 | 
					    $game_variables[TMP_INDEX+0] = val
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.tmp_v2=(val)
 | 
				
			||||||
 | 
					    $game_variables[TMP_INDEX+1] = val
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.tmp_v3=(val)
 | 
				
			||||||
 | 
					    $game_variables[TMP_INDEX+2] = val
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  private
 | 
				
			||||||
 | 
					  TMP_INDEX = 22
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.logpos(pos, realpos, positive)
 | 
				
			||||||
 | 
					    bigpos = pos * 128
 | 
				
			||||||
 | 
					    if realpos < bigpos
 | 
				
			||||||
 | 
					      return pos - 1 if positive
 | 
				
			||||||
 | 
					    elsif realpos > bigpos
 | 
				
			||||||
 | 
					      return pos + 1 if positive
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    return pos
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def enter_name
 | 
				
			||||||
 | 
					  $game_temp.name_calling = true
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def check_exit(min, max, x: -1, y: -1)
 | 
				
			||||||
 | 
					  result = false
 | 
				
			||||||
 | 
					  if x >= 0
 | 
				
			||||||
 | 
					    if $game_player.x == x
 | 
				
			||||||
 | 
					      if $game_player.y >= min && $game_player.y <= max
 | 
				
			||||||
 | 
					        result = true
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  elsif y >= 0
 | 
				
			||||||
 | 
					    if $game_player.y == y
 | 
				
			||||||
 | 
					      if $game_player.x >= min && $game_player.x <= max
 | 
				
			||||||
 | 
					        result = true
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					  Script.tmp_s1 = $game_switches[11] ? false : result
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def bg(name)
 | 
				
			||||||
 | 
					  $game_map.bg_name = name
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def particles(type)
 | 
				
			||||||
 | 
					  $game_map.particles_type = type
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def ambient(r, g = -1, b = -1)
 | 
				
			||||||
 | 
					  g = r if g < 0
 | 
				
			||||||
 | 
					  b = r if b < 0
 | 
				
			||||||
 | 
					  #$scene.ambient = Color.new(r, g, b)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def clear_ambient
 | 
				
			||||||
 | 
					  #$scene.ambient = Color.new(255, 255, 255)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def add_light(id, file, intensity, x, y)
 | 
				
			||||||
 | 
					  #$scene.add_light(id, file, intensity, x, y)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def del_light(id)
 | 
				
			||||||
 | 
					  #$scene.del_light(id)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def clear_lights
 | 
				
			||||||
 | 
					  #$scene.clear_lights
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def fade_in_bulb
 | 
				
			||||||
 | 
					  #$scene.fade_in_bulb
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def clamp_panorama
 | 
				
			||||||
 | 
					  $game_map.clamped_panorama = true
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def wrap_map
 | 
				
			||||||
 | 
					  $game_map.wrapping = true
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
| 
						 | 
					@ -1,13 +0,0 @@
 | 
				
			||||||
class SpecialEventData
 | 
					 | 
				
			||||||
  attr_reader :flags
 | 
					 | 
				
			||||||
  attr_reader :collision
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def initialize(flags, collision)
 | 
					 | 
				
			||||||
    @flags = flags
 | 
					 | 
				
			||||||
    @collision = collision
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def self.get(name)
 | 
					 | 
				
			||||||
    return SPECIAL_EVENTS[name]
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,6 @@
 | 
				
			||||||
 | 
					# Overrides
 | 
				
			||||||
 | 
					RPG
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Game_Temp
 | 
					Game_Temp
 | 
				
			||||||
Game_System
 | 
					Game_System
 | 
				
			||||||
Game_Switches
 | 
					Game_Switches
 | 
				
			||||||
| 
						 | 
					@ -28,6 +31,7 @@ Sprite_Character
 | 
				
			||||||
Sprite_Battler
 | 
					Sprite_Battler
 | 
				
			||||||
Sprite_Picture
 | 
					Sprite_Picture
 | 
				
			||||||
Sprite_Timer
 | 
					Sprite_Timer
 | 
				
			||||||
 | 
					Sprite_Light
 | 
				
			||||||
Spriteset_Map
 | 
					Spriteset_Map
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Window_Base
 | 
					Window_Base
 | 
				
			||||||
| 
						 | 
					@ -89,33 +93,25 @@ Scene_Battle 4
 | 
				
			||||||
Scene_Name
 | 
					Scene_Name
 | 
				
			||||||
Scene_Debug
 | 
					Scene_Debug
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RPG
 | 
					# Internationalization
 | 
				
			||||||
Ed_Message
 | 
					i18n_Translator
 | 
				
			||||||
 | 
					i18n_Language
 | 
				
			||||||
# Classes
 | 
					 | 
				
			||||||
Language
 | 
					 | 
				
			||||||
Translator
 | 
					 | 
				
			||||||
Light
 | 
					 | 
				
			||||||
Particles
 | 
					 | 
				
			||||||
SpecialEventData
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Data
 | 
					# Data
 | 
				
			||||||
Item
 | 
					Data_Item
 | 
				
			||||||
Language_Data
 | 
					Data_Footsteps
 | 
				
			||||||
Footsteps
 | 
					Data_SpecialEventData
 | 
				
			||||||
SpecialEventData_Data
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Script Functions
 | 
					# Script Functions
 | 
				
			||||||
Script Aux
 | 
					Script
 | 
				
			||||||
Map
 | 
					 | 
				
			||||||
Name
 | 
					 | 
				
			||||||
Position
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Puzzles
 | 
					# Puzzles
 | 
				
			||||||
Sokoban
 | 
					Puzzle_Sokoban
 | 
				
			||||||
Pixel
 | 
					Puzzle_Pixel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Save/Load
 | 
					# Misc
 | 
				
			||||||
SaveLoad
 | 
					SaveLoad
 | 
				
			||||||
 | 
					Ed_Message
 | 
				
			||||||
 | 
					Particles
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Main
 | 
					Main
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,18 @@
 | 
				
			||||||
class Language
 | 
					class Language
 | 
				
			||||||
 | 
					  attr_reader :font
 | 
				
			||||||
 | 
					  attr_reader :character_table
 | 
				
			||||||
 | 
					  attr_reader :character_table_height
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def initialize(font, character_table, character_table_height)
 | 
				
			||||||
 | 
					    @font = font
 | 
				
			||||||
 | 
					    @character_table = character_table
 | 
				
			||||||
 | 
					    @character_table_height = character_table_height
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def self.get(code = :en)
 | 
				
			||||||
 | 
					    return LANGUAGES[code] || LANGUAGES[:en]
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  LANGUAGES = {
 | 
					  LANGUAGES = {
 | 
				
			||||||
    :en => Language.new(
 | 
					    :en => Language.new(
 | 
				
			||||||
      'Terminus (TTF)', [
 | 
					      'Terminus (TTF)', [
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue