Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
090b065a9c | ||
|
|
4ec7496fee | ||
|
|
63e3d6970c | ||
|
|
36094cbaac | ||
|
|
0a07063d6b | ||
|
|
e15582deef | ||
|
|
142de56b03 |
10943
Data/CUSTOM_SPRITES
10379
Data/SPRITE_CREDS
@@ -5,8 +5,8 @@
|
|||||||
#==============================================================================#
|
#==============================================================================#
|
||||||
module Settings
|
module Settings
|
||||||
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
|
# The version of your game. It has to adhere to the MAJOR.MINOR.PATCH format.
|
||||||
GAME_VERSION = '6.2.4'
|
GAME_VERSION = '6.2.1'
|
||||||
GAME_VERSION_NUMBER = "6.2.4"
|
GAME_VERSION_NUMBER = "6.2.1"
|
||||||
|
|
||||||
POKERADAR_LIGHT_ANIMATION_RED_ID = 17
|
POKERADAR_LIGHT_ANIMATION_RED_ID = 17
|
||||||
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18
|
POKERADAR_LIGHT_ANIMATION_GREEN_ID = 18
|
||||||
@@ -49,7 +49,7 @@ module Settings
|
|||||||
PLAYER_SURFBASE_FOLDER = 'surf_base/'
|
PLAYER_SURFBASE_FOLDER = 'surf_base/'
|
||||||
OW_SHINE_ANIMATION_ID=25
|
OW_SHINE_ANIMATION_ID=25
|
||||||
|
|
||||||
HTTP_CONFIGS_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/pif-downloadables/refs/heads/master/Settings.rb"
|
HTTP_CONFIGS_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/Scripts/RemoteUrls.rb"
|
||||||
HTTP_CONFIGS_FILE_PATH = "Data/Scripts/DownloadedSettings.rb"
|
HTTP_CONFIGS_FILE_PATH = "Data/Scripts/DownloadedSettings.rb"
|
||||||
|
|
||||||
LEVEL_CAPS=[12,22,26,35,38,45,51,54,62,62,63,64,64,65,67,68]
|
LEVEL_CAPS=[12,22,26,35,38,45,51,54,62,62,63,64,64,65,67,68]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# class Object
|
# class Object
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Object
|
class Object
|
||||||
alias full_inspect inspect unless method_defined?(:full_inspect)
|
alias full_inspect inspect
|
||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
return "#<#{self.class}>"
|
return "#<#{self.class}>"
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ class Game_Map
|
|||||||
attr_reader :display_x # display x-coordinate * 128
|
attr_reader :display_x # display x-coordinate * 128
|
||||||
attr_reader :display_y # display y-coordinate * 128
|
attr_reader :display_y # display y-coordinate * 128
|
||||||
attr_accessor :need_refresh # refresh request flag
|
attr_accessor :need_refresh # refresh request flag
|
||||||
attr_accessor :scroll_direction
|
|
||||||
|
|
||||||
TILE_WIDTH = 32
|
TILE_WIDTH = 32
|
||||||
TILE_HEIGHT = 32
|
TILE_HEIGHT = 32
|
||||||
|
|||||||
@@ -178,12 +178,6 @@ class Game_Player < Game_Character
|
|||||||
self.map.display_y = y * Game_Map::REAL_RES_Y - SCREEN_CENTER_Y
|
self.map.display_y = y * Game_Map::REAL_RES_Y - SCREEN_CENTER_Y
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def isCentered()
|
|
||||||
x_centered = self.map.display_x == x * Game_Map::REAL_RES_X - SCREEN_CENTER_X
|
|
||||||
y_centered = self.map.display_y == y * Game_Map::REAL_RES_Y - SCREEN_CENTER_Y
|
|
||||||
return x_centered && y_centered
|
|
||||||
end
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# * Move to Designated Position
|
# * Move to Designated Position
|
||||||
# x : x-coordinate
|
# x : x-coordinate
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Spriteset_Map
|
class Spriteset_Map
|
||||||
alias _animationSprite_initialize initialize unless method_defined?(:_animationSprite_initialize)
|
alias _animationSprite_initialize initialize
|
||||||
alias _animationSprite_update update unless method_defined?(:_animationSprite_update)
|
alias _animationSprite_update update
|
||||||
alias _animationSprite_dispose dispose unless method_defined?(:_animationSprite_dispose)
|
alias _animationSprite_dispose dispose
|
||||||
|
|
||||||
def initialize(map=nil)
|
def initialize(map=nil)
|
||||||
@usersprites=[]
|
@usersprites=[]
|
||||||
|
|||||||
@@ -7,19 +7,19 @@
|
|||||||
class Sprite_Shadow < RPG::Sprite
|
class Sprite_Shadow < RPG::Sprite
|
||||||
attr_accessor :character
|
attr_accessor :character
|
||||||
|
|
||||||
def initialize(viewport, character = nil, params = [])
|
def initialize(viewport, character = nil,params=[])
|
||||||
super(viewport)
|
super(viewport)
|
||||||
@source = params[0]
|
@source = params[0]
|
||||||
@anglemin = (params.size > 1) ? params[1] : 0
|
@anglemin = (params.size>1) ? params[1] : 0
|
||||||
@anglemax = (params.size > 2) ? params[2] : 0
|
@anglemax = (params.size>2) ? params[2] : 0
|
||||||
@self_opacity = (params.size > 4) ? params[4] : 100
|
@self_opacity = (params.size>4) ? params[4] : 100
|
||||||
@distancemax = (params.size > 3) ? params[3] : 350
|
@distancemax = (params.size>3) ? params[3] : 350
|
||||||
@character = character
|
@character = character
|
||||||
update
|
update
|
||||||
end
|
end
|
||||||
|
|
||||||
def dispose
|
def dispose
|
||||||
@chbitmap&.dispose
|
@chbitmap.dispose if @chbitmap
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -35,18 +35,19 @@ class Sprite_Shadow < RPG::Sprite
|
|||||||
@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
|
||||||
@chbitmap&.dispose
|
|
||||||
if @tile_id >= 384
|
if @tile_id >= 384
|
||||||
|
@chbitmap.dispose if @chbitmap
|
||||||
@chbitmap = pbGetTileBitmap(@character.map.tileset_name,
|
@chbitmap = pbGetTileBitmap(@character.map.tileset_name,
|
||||||
@tile_id, @character.character_hue)
|
@tile_id, @character.character_hue)
|
||||||
self.src_rect.set(0, 0, 32, 32)
|
self.src_rect.set(0, 0, 32, 32)
|
||||||
@ch = 32
|
@ch = 32
|
||||||
@cw = 32
|
@cw = 32
|
||||||
self.ox = 16
|
self.ox = 16
|
||||||
self.oy = 32
|
self.oy = 32
|
||||||
else
|
else
|
||||||
@chbitmap = AnimatedBitmap.new('Graphics/Characters/' + @character.character_name,
|
@chbitmap.dispose if @chbitmap
|
||||||
@character.character_hue)
|
@chbitmap = AnimatedBitmap.new(
|
||||||
|
'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
|
||||||
@@ -74,8 +75,8 @@ class Sprite_Shadow < RPG::Sprite
|
|||||||
self.src_rect.set(sx, sy, @cw, @ch)
|
self.src_rect.set(sx, sy, @cw, @ch)
|
||||||
end
|
end
|
||||||
self.x = ScreenPosHelper.pbScreenX(@character)
|
self.x = ScreenPosHelper.pbScreenX(@character)
|
||||||
self.y = ScreenPosHelper.pbScreenY(@character) - 5
|
self.y = ScreenPosHelper.pbScreenY(@character)-5
|
||||||
self.z = ScreenPosHelper.pbScreenZ(@character, @ch) - 1
|
self.z = ScreenPosHelper.pbScreenZ(@character,@ch)-1
|
||||||
self.zoom_x = ScreenPosHelper.pbScreenZoomX(@character)
|
self.zoom_x = ScreenPosHelper.pbScreenZoomX(@character)
|
||||||
self.zoom_y = ScreenPosHelper.pbScreenZoomY(@character)
|
self.zoom_y = ScreenPosHelper.pbScreenZoomY(@character)
|
||||||
self.blend_type = @character.blend_type
|
self.blend_type = @character.blend_type
|
||||||
@@ -88,10 +89,10 @@ class Sprite_Shadow < RPG::Sprite
|
|||||||
@deltax = ScreenPosHelper.pbScreenX(@source) - self.x
|
@deltax = ScreenPosHelper.pbScreenX(@source) - self.x
|
||||||
@deltay = ScreenPosHelper.pbScreenY(@source) - self.y
|
@deltay = ScreenPosHelper.pbScreenY(@source) - self.y
|
||||||
self.color = Color.new(0, 0, 0)
|
self.color = Color.new(0, 0, 0)
|
||||||
@distance = ((@deltax**2) + (@deltay**2))
|
@distance = ((@deltax ** 2) + (@deltay ** 2))
|
||||||
self.opacity = @self_opacity * 13_000 / ((@distance * 370 / @distancemax) + 6000)
|
self.opacity = @self_opacity * 13000 / ((@distance * 370 / @distancemax) + 6000)
|
||||||
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 || @anglemax != 0
|
if @anglemin != 0 || @anglemax != 0
|
||||||
if (@angle_trigo < @anglemin || @angle_trigo > @anglemax) && @anglemin < @anglemax
|
if (@angle_trigo < @anglemin || @angle_trigo > @anglemax) && @anglemin < @anglemax
|
||||||
@@ -123,7 +124,7 @@ end
|
|||||||
# ? CLASS Sprite_Character edit
|
# ? CLASS Sprite_Character edit
|
||||||
#===================================================
|
#===================================================
|
||||||
class Sprite_Character < RPG::Sprite
|
class Sprite_Character < RPG::Sprite
|
||||||
alias shadow_initialize initialize unless method_defined?(:shadow_initialize)
|
alias :shadow_initialize :initialize
|
||||||
|
|
||||||
def initialize(viewport, character = nil)
|
def initialize(viewport, character = nil)
|
||||||
@ombrelist = []
|
@ombrelist = []
|
||||||
@@ -131,33 +132,37 @@ class Sprite_Character < RPG::Sprite
|
|||||||
shadow_initialize(viewport, @character)
|
shadow_initialize(viewport, @character)
|
||||||
end
|
end
|
||||||
|
|
||||||
def setShadows(map, shadows)
|
def setShadows(map,shadows)
|
||||||
if character.is_a?(Game_Event) && 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
|
||||||
shadows.each do |shadow|
|
for i in 0...shadows.size
|
||||||
@ombrelist.push(Sprite_Shadow.new(viewport, @character, shadows))
|
@ombrelist.push(Sprite_Shadow.new(viewport, @character, shadows[i]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if character.is_a?(Game_Player) && shadows.length > 0
|
if character.is_a?(Game_Player) && shadows.length > 0
|
||||||
shadows.each do |shadow|
|
for i in 0...shadows.size
|
||||||
@ombrelist.push(Sprite_Shadow.new(viewport, $game_player, shadow))
|
@ombrelist.push(Sprite_Shadow.new(viewport, $game_player, shadows[i]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
update
|
update
|
||||||
end
|
end
|
||||||
|
|
||||||
def clearShadows
|
def clearShadows
|
||||||
@ombrelist.each { |s| s&.dispose }
|
@ombrelist.each { |s| s.dispose if s }
|
||||||
@ombrelist.clear
|
@ombrelist.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
alias shadow_update update unless method_defined?(:shadow_update)
|
alias shadow_update update
|
||||||
|
|
||||||
def update
|
def update
|
||||||
shadow_update
|
shadow_update
|
||||||
@ombrelist.each { |ombre| ombre.update }
|
if @ombrelist.length>0
|
||||||
|
for i in 0...@ombrelist.size
|
||||||
|
@ombrelist[i].update
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -178,24 +183,24 @@ end
|
|||||||
class Spriteset_Map
|
class Spriteset_Map
|
||||||
attr_accessor :shadows
|
attr_accessor :shadows
|
||||||
|
|
||||||
alias shadow_initialize initialize unless method_defined?(:shadow_initialize)
|
alias shadow_initialize initialize
|
||||||
|
def initialize(map=nil)
|
||||||
def initialize(map = nil)
|
|
||||||
@shadows = []
|
@shadows = []
|
||||||
warn = false
|
warn = false
|
||||||
map = $game_map if !map
|
map = $game_map if !map
|
||||||
map.events.keys.sort.each do |k|
|
for k in map.events.keys.sort
|
||||||
ev = map.events[k]
|
ev = map.events[k]
|
||||||
warn = true if ev.list != nil && ev.list.length > 0 && ev.list[0].code == 108 &&
|
warn = true if (ev.list != nil && ev.list.length > 0 &&
|
||||||
(ev.list[0].parameters == ["s"] || ev.list[0].parameters == ["o"])
|
ev.list[0].code == 108 &&
|
||||||
params = XPML_read(map, "Shadow Source", ev, 4)
|
(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
|
@shadows.push([ev] + params) if params != nil
|
||||||
end
|
end
|
||||||
if warn == true
|
if warn == true
|
||||||
p "Warning : At least one event on this map uses the obsolete way to add shadows"
|
p "Warning : At least one event on this map uses the obsolete way to add shadows"
|
||||||
end
|
end
|
||||||
shadow_initialize(map)
|
shadow_initialize(map)
|
||||||
@character_sprites.each do |sprite|
|
for sprite in @character_sprites
|
||||||
sprite.setShadows(map, @shadows)
|
sprite.setShadows(map, @shadows)
|
||||||
end
|
end
|
||||||
$scene.spritesetGlobal.playersprite.setShadows(map, @shadows)
|
$scene.spritesetGlobal.playersprite.setShadows(map, @shadows)
|
||||||
@@ -223,31 +228,31 @@ end
|
|||||||
# p XPML_read("third", event_id) -> [3]
|
# p XPML_read("third", event_id) -> [3]
|
||||||
# p XPML_read("forth", event_id) -> nil
|
# p XPML_read("forth", event_id) -> nil
|
||||||
#===================================================
|
#===================================================
|
||||||
def XPML_read(map, markup, event, max_param_number = 0)
|
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
|
||||||
event.list.size.times do |i|
|
for i in 0...event.list.size
|
||||||
if event.list[i].code == 108 &&
|
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
|
||||||
((i + 1)...event.list.size).each do |j|
|
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 && parts[0].downcase != "begin"
|
if parts.size != 1 && parts[0].downcase != "begin"
|
||||||
if parts[1].to_i != 0 || 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
|
||||||
|
parameter_list.push(parts[1])
|
||||||
|
end
|
||||||
else
|
else
|
||||||
parameter_list.push(parts[1])
|
return parameter_list
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return parameter_list
|
return parameter_list
|
||||||
end
|
end
|
||||||
else
|
return parameter_list if max_param_number != 0 && j == i + max_param_number
|
||||||
return parameter_list
|
|
||||||
end
|
end
|
||||||
return parameter_list if max_param_number != 0 && j == i + max_param_number
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
return parameter_list
|
return parameter_list
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,36 +2,36 @@
|
|||||||
# Based on version 2 by Near Fantastica, 04.01.06
|
# Based on version 2 by Near Fantastica, 04.01.06
|
||||||
# In turn based on the Particle Engine designed by PinkMan
|
# In turn based on the Particle Engine designed by PinkMan
|
||||||
class Particle_Engine
|
class Particle_Engine
|
||||||
def initialize(viewport = nil, map = nil)
|
def initialize(viewport=nil,map=nil)
|
||||||
@map = (map) ? map : $game_map
|
@map = (map) ? map : $game_map
|
||||||
@viewport = viewport
|
@viewport = viewport
|
||||||
@effect = []
|
@effect = []
|
||||||
@disposed = false
|
@disposed = false
|
||||||
@firsttime = true
|
@firsttime = true
|
||||||
@effects = {
|
@effects = {
|
||||||
# PinkMan's Effects
|
# PinkMan's Effects
|
||||||
"fire" => Particle_Engine::Fire,
|
"fire" => Particle_Engine::Fire,
|
||||||
"smoke" => Particle_Engine::Smoke,
|
"smoke" => Particle_Engine::Smoke,
|
||||||
"teleport" => Particle_Engine::Teleport,
|
"teleport" => Particle_Engine::Teleport,
|
||||||
"spirit" => Particle_Engine::Spirit,
|
"spirit" => Particle_Engine::Spirit,
|
||||||
"explosion" => Particle_Engine::Explosion,
|
"explosion" => Particle_Engine::Explosion,
|
||||||
"aura" => Particle_Engine::Aura,
|
"aura" => Particle_Engine::Aura,
|
||||||
# BlueScope's Effects
|
# BlueScope's Effects
|
||||||
"soot" => Particle_Engine::Soot,
|
"soot" => Particle_Engine::Soot,
|
||||||
"sootsmoke" => Particle_Engine::SootSmoke,
|
"sootsmoke" => Particle_Engine::SootSmoke,
|
||||||
"rocket" => Particle_Engine::Rocket,
|
"rocket" => Particle_Engine::Rocket,
|
||||||
"fixteleport" => Particle_Engine::FixedTeleport,
|
"fixteleport" => Particle_Engine::FixedTeleport,
|
||||||
"smokescreen" => Particle_Engine::Smokescreen,
|
"smokescreen" => Particle_Engine::Smokescreen,
|
||||||
"flare" => Particle_Engine::Flare,
|
"flare" => Particle_Engine::Flare,
|
||||||
"splash" => Particle_Engine::Splash,
|
"splash" => Particle_Engine::Splash,
|
||||||
# By Peter O.
|
# By Peter O.
|
||||||
"starteleport" => Particle_Engine::StarTeleport
|
"starteleport" => Particle_Engine::StarTeleport
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def dispose
|
def dispose
|
||||||
return if disposed?
|
return if disposed?
|
||||||
@effect.each do |particle|
|
for particle in @effect
|
||||||
next if particle.nil?
|
next if particle.nil?
|
||||||
particle.dispose
|
particle.dispose
|
||||||
end
|
end
|
||||||
@@ -54,46 +54,47 @@ class Particle_Engine
|
|||||||
@effect.delete_at(event.id)
|
@effect.delete_at(event.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def realloc_effect(event, particle)
|
def realloc_effect(event,particle)
|
||||||
type = pbEventCommentInput(event, 1, "Particle Engine Type")
|
type = pbEventCommentInput(event, 1, "Particle Engine Type")
|
||||||
if type.nil?
|
if type.nil?
|
||||||
particle&.dispose
|
particle.dispose if particle
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
type = type[0].downcase
|
type = type[0].downcase
|
||||||
cls = @effects[type]
|
cls = @effects[type]
|
||||||
if cls.nil?
|
if cls.nil?
|
||||||
particle&.dispose
|
particle.dispose if particle
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
if !particle || !particle.is_a?(cls)
|
if !particle || !particle.is_a?(cls)
|
||||||
particle&.dispose
|
particle.dispose if particle
|
||||||
particle = cls.new(event, @viewport)
|
particle = cls.new(event,@viewport)
|
||||||
end
|
end
|
||||||
return particle
|
return particle
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbParticleEffect(event)
|
def pbParticleEffect(event)
|
||||||
return realloc_effect(event, nil)
|
return realloc_effect(event,nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if @firsttime
|
if @firsttime
|
||||||
@firsttime = false
|
@firsttime = false
|
||||||
@map.events.values.each do |event|
|
for event in @map.events.values
|
||||||
remove_effect(event)
|
remove_effect(event)
|
||||||
add_effect(event)
|
add_effect(event)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@effect.each_with_index do |particle, i|
|
for i in 0...@effect.length
|
||||||
|
particle = @effect[i]
|
||||||
next if particle.nil?
|
next if particle.nil?
|
||||||
if particle.event.pe_refresh
|
if particle.event.pe_refresh
|
||||||
event = particle.event
|
event = particle.event
|
||||||
event.pe_refresh = false
|
event.pe_refresh = false
|
||||||
particle = realloc_effect(event, particle)
|
particle = realloc_effect(event,particle)
|
||||||
@effect[i] = particle
|
@effect[i] = particle
|
||||||
end
|
end
|
||||||
particle&.update
|
particle.update if particle
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -135,7 +136,7 @@ class ParticleSprite
|
|||||||
end
|
end
|
||||||
|
|
||||||
def dispose
|
def dispose
|
||||||
@sprite&.dispose
|
@sprite.dispose if @sprite
|
||||||
end
|
end
|
||||||
|
|
||||||
def bitmap=(value)
|
def bitmap=(value)
|
||||||
@@ -152,21 +153,21 @@ class ParticleSprite
|
|||||||
def update
|
def update
|
||||||
w = Graphics.width
|
w = Graphics.width
|
||||||
h = Graphics.height
|
h = Graphics.height
|
||||||
if !@sprite && @x >= @minleft && @y >= @mintop && @x < w && @y < h
|
if !@sprite && @x>=@minleft && @y>=@mintop && @x<w && @y<h
|
||||||
@sprite = Sprite.new(@viewport)
|
@sprite = Sprite.new(@viewport)
|
||||||
elsif @sprite && (@x < @minleft || @y < @mintop || @x >= w || @y >= h)
|
elsif @sprite && (@x<@minleft || @y<@mintop || @x>=w || @y>=h)
|
||||||
@sprite.dispose
|
@sprite.dispose
|
||||||
@sprite = nil
|
@sprite = nil
|
||||||
end
|
end
|
||||||
if @sprite
|
if @sprite
|
||||||
@sprite.x = @x if @sprite.x != @x
|
@sprite.x = @x if @sprite.x!=@x
|
||||||
@sprite.x -= @ox
|
@sprite.x -= @ox
|
||||||
@sprite.y = @y if @sprite.y != @y
|
@sprite.y = @y if @sprite.y!=@y
|
||||||
@sprite.y -= @oy
|
@sprite.y -= @oy
|
||||||
@sprite.z = @z if @sprite.z != @z
|
@sprite.z = @z if @sprite.z!=@z
|
||||||
@sprite.opacity = @opacity if @sprite.opacity != @opacity
|
@sprite.opacity = @opacity if @sprite.opacity!=@opacity
|
||||||
@sprite.blend_type = @blend_type if @sprite.blend_type != @blend_type
|
@sprite.blend_type = @blend_type if @sprite.blend_type!=@blend_type
|
||||||
@sprite.bitmap = @bitmap if @sprite.bitmap != @bitmap
|
@sprite.bitmap = @bitmap if @sprite.bitmap!=@bitmap
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -176,7 +177,7 @@ end
|
|||||||
class ParticleEffect_Event < ParticleEffect
|
class ParticleEffect_Event < ParticleEffect
|
||||||
attr_accessor :event
|
attr_accessor :event
|
||||||
|
|
||||||
def initialize(event, viewport = nil)
|
def initialize(event,viewport=nil)
|
||||||
@event = event
|
@event = event
|
||||||
@viewport = viewport
|
@viewport = viewport
|
||||||
@particles = []
|
@particles = []
|
||||||
@@ -184,24 +185,24 @@ class ParticleEffect_Event < ParticleEffect
|
|||||||
end
|
end
|
||||||
|
|
||||||
def setParameters(params)
|
def setParameters(params)
|
||||||
@randomhue, @leftright, @fade,
|
@randomhue,@leftright,@fade,
|
||||||
@maxparticless, @hue, @slowdown,
|
@maxparticless,@hue,@slowdown,
|
||||||
@ytop, @ybottom, @xleft, @xright,
|
@ytop,@ybottom,@xleft,@xright,
|
||||||
@xgravity, @ygravity, @xoffset, @yoffset,
|
@xgravity,@ygravity,@xoffset,@yoffset,
|
||||||
@opacityvar, @originalopacity = params
|
@opacityvar,@originalopacity = params
|
||||||
end
|
end
|
||||||
|
|
||||||
def loadBitmap(filename, hue)
|
def loadBitmap(filename,hue)
|
||||||
key = [filename, hue]
|
key = [filename,hue]
|
||||||
bitmap = @bitmaps[key]
|
bitmap = @bitmaps[key]
|
||||||
if !bitmap || bitmap.disposed?
|
if !bitmap || bitmap.disposed?
|
||||||
bitmap = AnimatedBitmap.new("Graphics/Fogs/" + filename, hue).deanimate
|
bitmap = AnimatedBitmap.new("Graphics/Fogs/"+filename,hue).deanimate
|
||||||
@bitmaps[key] = bitmap
|
@bitmaps[key] = bitmap
|
||||||
end
|
end
|
||||||
return bitmap
|
return bitmap
|
||||||
end
|
end
|
||||||
|
|
||||||
def initParticles(filename, opacity, zOffset = 0, blendtype = 1)
|
def initParticles(filename,opacity,zOffset=0,blendtype=1)
|
||||||
@particles = []
|
@particles = []
|
||||||
@particlex = []
|
@particlex = []
|
||||||
@particley = []
|
@particley = []
|
||||||
@@ -216,20 +217,20 @@ class ParticleEffect_Event < ParticleEffect
|
|||||||
@zoffset = zOffset
|
@zoffset = zOffset
|
||||||
@bmwidth = 32
|
@bmwidth = 32
|
||||||
@bmheight = 32
|
@bmheight = 32
|
||||||
@maxparticless.times do |i|
|
for i in 0...@maxparticless
|
||||||
@particlex[i] = -@xoffset
|
@particlex[i] = -@xoffset
|
||||||
@particley[i] = -@yoffset
|
@particley[i] = -@yoffset
|
||||||
@particles[i] = ParticleSprite.new(@viewport)
|
@particles[i] = ParticleSprite.new(@viewport)
|
||||||
@particles[i].bitmap = loadBitmap(filename, @hue) if filename
|
@particles[i].bitmap = loadBitmap(filename, @hue) if filename
|
||||||
if i == 0 && @particles[i].bitmap
|
if i==0 && @particles[i].bitmap
|
||||||
@bmwidth = @particles[i].bitmap.width
|
@bmwidth = @particles[i].bitmap.width
|
||||||
@bmheight = @particles[i].bitmap.height
|
@bmheight = @particles[i].bitmap.height
|
||||||
end
|
end
|
||||||
@particles[i].blend_type = blendtype
|
@particles[i].blend_type = blendtype
|
||||||
@particles[i].y = @startingy
|
@particles[i].y = @startingy
|
||||||
@particles[i].x = @startingx
|
@particles[i].x = @startingx
|
||||||
@particles[i].z = self.z + zOffset
|
@particles[i].z = self.z+zOffset
|
||||||
@opacity[i] = rand(opacity / 4)
|
@opacity[i] = rand(opacity/4)
|
||||||
@particles[i].opacity = @opacity[i]
|
@particles[i].opacity = @opacity[i]
|
||||||
@particles[i].update
|
@particles[i].update
|
||||||
end
|
end
|
||||||
@@ -252,29 +253,29 @@ class ParticleEffect_Event < ParticleEffect
|
|||||||
newRealY = @event.real_y
|
newRealY = @event.real_y
|
||||||
@startingx = selfX + @xoffset
|
@startingx = selfX + @xoffset
|
||||||
@startingy = selfY + @yoffset
|
@startingy = selfY + @yoffset
|
||||||
@__offsetx = (@real_x == newRealX) ? 0 : selfX - @screen_x
|
@__offsetx = (@real_x==newRealX) ? 0 : selfX-@screen_x
|
||||||
@__offsety = (@real_y == newRealY) ? 0 : selfY - @screen_y
|
@__offsety = (@real_y==newRealY) ? 0 : selfY-@screen_y
|
||||||
@screen_x = selfX
|
@screen_x = selfX
|
||||||
@screen_y = selfY
|
@screen_y = selfY
|
||||||
@real_x = newRealX
|
@real_x = newRealX
|
||||||
@real_y = newRealY
|
@real_y = newRealY
|
||||||
if @opacityvar > 0 && @viewport
|
if @opacityvar>0 && @viewport
|
||||||
opac = 255.0 / @opacityvar
|
opac = 255.0/@opacityvar
|
||||||
minX = (opac * (-@xgravity.to_f / @slowdown).floor) + @startingx
|
minX = opac*(-@xgravity*1.0 / @slowdown).floor + @startingx
|
||||||
maxX = (opac * (@xgravity.to_f / @slowdown).floor) + @startingx
|
maxX = opac*(@xgravity*1.0 / @slowdown).floor + @startingx
|
||||||
minY = (opac * (-@ygravity.to_f / @slowdown).floor) + @startingy
|
minY = opac*(-@ygravity*1.0 / @slowdown).floor + @startingy
|
||||||
maxY = @startingy
|
maxY = @startingy
|
||||||
minX -= @bmwidth
|
minX -= @bmwidth
|
||||||
minY -= @bmheight
|
minY -= @bmheight
|
||||||
maxX += @bmwidth
|
maxX += @bmwidth
|
||||||
maxY += @bmheight
|
maxY += @bmheight
|
||||||
if maxX < 0 || maxY < 0 || minX >= Graphics.width || minY >= Graphics.height
|
if maxX<0 || maxY<0 || minX>=Graphics.width || minY>=Graphics.height
|
||||||
# echo "skipped"
|
# echo "skipped"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
particleZ = selfZ + @zoffset
|
particleZ = selfZ+@zoffset
|
||||||
@maxparticless.times do |i|
|
for i in 0...@maxparticless
|
||||||
@particles[i].z = particleZ
|
@particles[i].z = particleZ
|
||||||
if @particles[i].y <= @ytop
|
if @particles[i].y <= @ytop
|
||||||
@particles[i].y = @startingy + @yoffset
|
@particles[i].y = @startingy + @yoffset
|
||||||
@@ -308,12 +309,14 @@ class ParticleEffect_Event < ParticleEffect
|
|||||||
@particlex[i] = 0.0
|
@particlex[i] = 0.0
|
||||||
@particley[i] = 0.0
|
@particley[i] = 0.0
|
||||||
end
|
end
|
||||||
elsif @opacity[i] <= 0
|
else
|
||||||
@opacity[i] = 250
|
if @opacity[i] <= 0
|
||||||
@particles[i].y = @startingy + @yoffset
|
@opacity[i] = 250
|
||||||
@particles[i].x = @startingx + @xoffset
|
@particles[i].y = @startingy + @yoffset
|
||||||
@particlex[i] = 0.0
|
@particles[i].x = @startingx + @xoffset
|
||||||
@particley[i] = 0.0
|
@particlex[i] = 0.0
|
||||||
|
@particley[i] = 0.0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
calcParticlePos(i)
|
calcParticlePos(i)
|
||||||
if @randomhue == 1
|
if @randomhue == 1
|
||||||
@@ -330,26 +333,26 @@ class ParticleEffect_Event < ParticleEffect
|
|||||||
def calcParticlePos(i)
|
def calcParticlePos(i)
|
||||||
@leftright = rand(2)
|
@leftright = rand(2)
|
||||||
if @leftright == 1
|
if @leftright == 1
|
||||||
xo = -@xgravity.to_f / @slowdown
|
xo = -@xgravity*1.0 / @slowdown
|
||||||
else
|
else
|
||||||
xo = @xgravity.to_f / @slowdown
|
xo = @xgravity*1.0 / @slowdown
|
||||||
end
|
end
|
||||||
yo = -@ygravity.to_f / @slowdown
|
yo = -@ygravity*1.0 / @slowdown
|
||||||
@particlex[i] += xo
|
@particlex[i] += xo
|
||||||
@particley[i] += yo
|
@particley[i] += yo
|
||||||
@particlex[i] -= @__offsetx
|
@particlex[i] -= @__offsetx
|
||||||
@particley[i] -= @__offsety
|
@particley[i] -= @__offsety
|
||||||
@particlex[i] = @particlex[i].floor
|
@particlex[i] = @particlex[i].floor
|
||||||
@particley[i] = @particley[i].floor
|
@particley[i] = @particley[i].floor
|
||||||
@particles[i].x = @particlex[i] + @startingx + @xoffset
|
@particles[i].x = @particlex[i]+@startingx+@xoffset
|
||||||
@particles[i].y = @particley[i] + @startingy + @yoffset
|
@particles[i].y = @particley[i]+@startingy+@yoffset
|
||||||
end
|
end
|
||||||
|
|
||||||
def dispose
|
def dispose
|
||||||
@particles.each do |particle|
|
for particle in @particles
|
||||||
particle.dispose
|
particle.dispose
|
||||||
end
|
end
|
||||||
@bitmaps.values.each do |bitmap|
|
for bitmap in @bitmaps.values
|
||||||
bitmap.dispose
|
bitmap.dispose
|
||||||
end
|
end
|
||||||
@particles.clear
|
@particles.clear
|
||||||
@@ -360,34 +363,34 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Fire < ParticleEffect_Event
|
class Particle_Engine::Fire < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 1, 20, 40, 0.5, -64,
|
setParameters([0,0,1,20,40,0.5,-64,
|
||||||
Graphics.height, -64, Graphics.width, 0.5, 0.10, -5, -13, 30, 0])
|
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0])
|
||||||
initParticles("particle", 250)
|
initParticles("particle",250)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Smoke < ParticleEffect_Event
|
class Particle_Engine::Smoke < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 0, 80, 20, 0.5, -64,
|
setParameters([0,0,0,80,20,0.5,-64,
|
||||||
Graphics.height, -64, Graphics.width, 0.5, 0.10, -5, -15, 5, 80])
|
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80])
|
||||||
initParticles("smoke", 250)
|
initParticles("smoke",250)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Teleport < ParticleEffect_Event
|
class Particle_Engine::Teleport < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([1, 1, 1, 10, rand(360), 1, -64,
|
setParameters([1,1,1,10,rand(360),1,-64,
|
||||||
Graphics.height, -64, Graphics.width, 0, 3, -8, -15, 20, 0])
|
Graphics.height,-64,Graphics.width,0,3,-8,-15,20,0])
|
||||||
initParticles("wideportal", 250)
|
initParticles("wideportal",250)
|
||||||
@maxparticless.times do |i|
|
for i in 0...@maxparticless
|
||||||
@particles[i].ox = 16
|
@particles[i].ox = 16
|
||||||
@particles[i].oy = 16
|
@particles[i].oy = 16
|
||||||
end
|
end
|
||||||
@@ -397,56 +400,56 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Spirit < ParticleEffect_Event
|
class Particle_Engine::Spirit < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([1, 0, 1, 20, rand(360), 0.5, -64,
|
setParameters([1,0,1,20,rand(360),0.5,-64,
|
||||||
Graphics.height, -64, Graphics.width, 0.5, 0.10, -5, -13, 30, 0])
|
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0])
|
||||||
initParticles("particle", 250)
|
initParticles("particle",250)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Explosion < ParticleEffect_Event
|
class Particle_Engine::Explosion < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 1, 20, 0, 0.5, -64,
|
setParameters([0,0,1,20,0,0.5,-64,
|
||||||
Graphics.height, -64, Graphics.width, 0.5, 0.10, -5, -13, 30, 0])
|
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-13,30,0])
|
||||||
initParticles("explosion", 250)
|
initParticles("explosion",250)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Aura < ParticleEffect_Event
|
class Particle_Engine::Aura < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 1, 20, 0, 1, -64,
|
setParameters([0,0,1,20,0,1,-64,
|
||||||
Graphics.height, -64, Graphics.width, 2, 2, -5, -13, 30, 0])
|
Graphics.height,-64,Graphics.width,2,2,-5,-13,30,0])
|
||||||
initParticles("particle", 250)
|
initParticles("particle",250)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Soot < ParticleEffect_Event
|
class Particle_Engine::Soot < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 0, 20, 0, 0.5, -64,
|
setParameters([0,0,0,20,0,0.5,-64,
|
||||||
Graphics.height, -64, Graphics.width, 0.5, 0.10, -5, -15, 5, 80])
|
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80])
|
||||||
initParticles("smoke", 100, 0, 2)
|
initParticles("smoke",100,0,2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Particle_Engine::SootSmoke < ParticleEffect_Event
|
class Particle_Engine::SootSmoke < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 0, 30, 0, 0.5, -64,
|
setParameters([0,0,0,30,0,0.5,-64,
|
||||||
Graphics.height, -64, Graphics.width, 0.5, 0.10, -5, -15, 5, 80])
|
Graphics.height,-64,Graphics.width,0.5,0.10,-5,-15,5,80])
|
||||||
initParticles("smoke", 100, 0)
|
initParticles("smoke",100,0)
|
||||||
@maxparticless.times do |i|
|
for i in 0...@maxparticless
|
||||||
@particles[i].blend_type = rand(6) < 3 ? 1 : 2
|
@particles[i].blend_type = rand(6) < 3 ? 1 : 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -455,23 +458,23 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Rocket < ParticleEffect_Event
|
class Particle_Engine::Rocket < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 0, 60, 0, 0.5, -64,
|
setParameters([0,0,0,60,0,0.5,-64,
|
||||||
Graphics.height, -64, Graphics.width, 0.5, 0, -5, -15, 5, 80])
|
Graphics.height,-64,Graphics.width,0.5,0,-5,-15,5,80])
|
||||||
initParticles("smoke", 100, -1)
|
initParticles("smoke",100,-1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Particle_Engine::FixedTeleport < ParticleEffect_Event
|
class Particle_Engine::FixedTeleport < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([1, 0, 1, 10, rand(360), 1,
|
setParameters([1,0,1,10,rand(360),1,
|
||||||
-Graphics.height, Graphics.height, 0, Graphics.width, 0, 3, -8, -15, 20, 0])
|
-Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,20,0])
|
||||||
initParticles("wideportal", 250)
|
initParticles("wideportal",250)
|
||||||
@maxparticless.times do |i|
|
for i in 0...@maxparticless
|
||||||
@particles[i].ox = 16
|
@particles[i].ox = 16
|
||||||
@particles[i].oy = 16
|
@particles[i].oy = 16
|
||||||
end
|
end
|
||||||
@@ -482,12 +485,12 @@ end
|
|||||||
|
|
||||||
# By Peter O.
|
# By Peter O.
|
||||||
class Particle_Engine::StarTeleport < ParticleEffect_Event
|
class Particle_Engine::StarTeleport < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 1, 10, 0, 1,
|
setParameters([0,0,1,10,0,1,
|
||||||
-Graphics.height, Graphics.height, 0, Graphics.width, 0, 3, -8, -15, 10, 0])
|
-Graphics.height,Graphics.height,0,Graphics.width,0,3,-8,-15,10,0])
|
||||||
initParticles("star", 250)
|
initParticles("star",250)
|
||||||
@maxparticless.times do |i|
|
for i in 0...@maxparticless
|
||||||
@particles[i].ox = 48
|
@particles[i].ox = 48
|
||||||
@particles[i].oy = 48
|
@particles[i].oy = 48
|
||||||
end
|
end
|
||||||
@@ -497,64 +500,64 @@ end
|
|||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Smokescreen < ParticleEffect_Event
|
class Particle_Engine::Smokescreen < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 0, 250, 0, 0.2, -64,
|
setParameters([0,0,0,250,0,0.2,-64,
|
||||||
Graphics.height, -64, Graphics.width, 0.8, 0.8, -5, -15, 5, 80])
|
Graphics.height,-64,Graphics.width,0.8,0.8,-5,-15,5,80])
|
||||||
initParticles(nil, 100)
|
initParticles(nil,100)
|
||||||
@maxparticless.times do |i|
|
for i in 0...@maxparticless
|
||||||
rnd = rand(3)
|
rnd = rand(3)
|
||||||
@opacity[i] = (rnd == 0) ? 1 : 100
|
@opacity[i] = (rnd==0) ? 1 : 100
|
||||||
filename = (rnd == 0) ? "explosionsmoke" : "smoke"
|
filename = (rnd==0) ? "explosionsmoke" : "smoke"
|
||||||
@particles[i].bitmap = loadBitmap(filename, @hue)
|
@particles[i].bitmap = loadBitmap(filename, @hue)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def calcParticlePos(i)
|
def calcParticlePos(i)
|
||||||
if @randomhue == 1
|
if @randomhue==1
|
||||||
filename = (rand(3) == 0) ? "explosionsmoke" : "smoke"
|
filename = (rand(3)==0) ? "explosionsmoke" : "smoke"
|
||||||
@particles[i].bitmap = loadBitmap(filename, @hue)
|
@particles[i].bitmap = loadBitmap(filename, @hue)
|
||||||
end
|
end
|
||||||
multiple = 1.7
|
multiple = 1.7
|
||||||
xgrav = @xgravity * multiple / @slowdown
|
xgrav = @xgravity*multiple/@slowdown
|
||||||
xgrav = -xgrav if rand(2) == 1
|
xgrav = -xgrav if (rand(2)==1)
|
||||||
ygrav = @ygravity * multiple / @slowdown
|
ygrav = @ygravity*multiple/@slowdown
|
||||||
ygrav = -ygrav if rand(2) == 1
|
ygrav = -ygrav if (rand(2)==1)
|
||||||
@particlex[i] += xgrav
|
@particlex[i] += xgrav
|
||||||
@particley[i] += ygrav
|
@particley[i] += ygrav
|
||||||
@particlex[i] -= @__offsetx
|
@particlex[i] -= @__offsetx
|
||||||
@particley[i] -= @__offsety
|
@particley[i] -= @__offsety
|
||||||
@particlex[i] = @particlex[i].floor
|
@particlex[i] = @particlex[i].floor
|
||||||
@particley[i] = @particley[i].floor
|
@particley[i] = @particley[i].floor
|
||||||
@particles[i].x = @particlex[i] + @startingx + @xoffset
|
@particles[i].x = @particlex[i]+@startingx+@xoffset
|
||||||
@particles[i].y = @particley[i] + @startingy + @yoffset
|
@particles[i].y = @particley[i]+@startingy+@yoffset
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Flare < ParticleEffect_Event
|
class Particle_Engine::Flare < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 1, 30, 10, 1, -64,
|
setParameters([0,0,1,30,10,1,-64,
|
||||||
Graphics.height, -64, Graphics.width, 2, 2, -5, -12, 30, 0])
|
Graphics.height,-64,Graphics.width,2,2,-5,-12,30,0])
|
||||||
initParticles("particle", 255)
|
initParticles("particle",255)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Particle_Engine::Splash < ParticleEffect_Event
|
class Particle_Engine::Splash < ParticleEffect_Event
|
||||||
def initialize(event, viewport)
|
def initialize(event,viewport)
|
||||||
super
|
super
|
||||||
setParameters([0, 0, 1, 30, 255, 1, -64,
|
setParameters([0,0,1,30,255,1,-64,
|
||||||
Graphics.height, -64, Graphics.width, 4, 2, -5, -12, 30, 0])
|
Graphics.height,-64,Graphics.width,4,2,-5,-12,30,0])
|
||||||
initParticles("smoke", 50)
|
initParticles("smoke",50)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
super
|
super
|
||||||
@maxparticless.times do |i|
|
for i in 0...@maxparticless
|
||||||
@particles[i].opacity = 50
|
@particles[i].opacity = 50
|
||||||
@particles[i].update
|
@particles[i].update
|
||||||
end
|
end
|
||||||
@@ -566,9 +569,8 @@ end
|
|||||||
class Game_Event < Game_Character
|
class Game_Event < Game_Character
|
||||||
attr_accessor :pe_refresh
|
attr_accessor :pe_refresh
|
||||||
|
|
||||||
alias nf_particles_game_map_initialize initialize unless method_defined?(:nf_particles_game_map_initialize)
|
alias nf_particles_game_map_initialize initialize
|
||||||
|
def initialize(map_id,event,map=nil)
|
||||||
def initialize(map_id, event, map = nil)
|
|
||||||
@pe_refresh = false
|
@pe_refresh = false
|
||||||
begin
|
begin
|
||||||
nf_particles_game_map_initialize(map_id, event, map)
|
nf_particles_game_map_initialize(map_id, event, map)
|
||||||
@@ -577,8 +579,7 @@ class Game_Event < Game_Character
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias nf_particles_game_map_refresh refresh unless method_defined?(:nf_particles_game_map_refresh)
|
alias nf_particles_game_map_refresh refresh
|
||||||
|
|
||||||
def refresh
|
def refresh
|
||||||
nf_particles_game_map_refresh
|
nf_particles_game_map_refresh
|
||||||
@pe_refresh = true
|
@pe_refresh = true
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
|
|
||||||
#[FRAME1 [x,y]],[FRAME2 [x,y], etc.]
|
#[FRAME1 [x,y]],[FRAME2 [x,y], etc.]
|
||||||
#
|
|
||||||
# exact number of pixels that the sprite needs to be moved for each frame
|
|
||||||
# add 2 pixels on even frames
|
|
||||||
module Outfit_Offsets
|
module Outfit_Offsets
|
||||||
BASE_OFFSET = [[0, 0], [0, 0], [0, 0], [0, 0]]
|
BASE_OFFSET = [[0, 0], [0, 0], [0, 0], [0, 0]]
|
||||||
|
|
||||||
@@ -27,8 +24,4 @@ module Outfit_Offsets
|
|||||||
BIKE_OFFSETS_RIGHT = [[4, -4], [2, -2], [4, -4], [6, -2]]
|
BIKE_OFFSETS_RIGHT = [[4, -4], [2, -2], [4, -4], [6, -2]]
|
||||||
BIKE_OFFSETS_UP = [[0, -2], [-2, 0], [0, -2], [2, 0]]
|
BIKE_OFFSETS_UP = [[0, -2], [-2, 0], [0, -2], [2, 0]]
|
||||||
|
|
||||||
FISH_OFFSETS_DOWN = [[0, -6], [0, -2], [0, -8], [2, -6]]
|
|
||||||
FISH_OFFSETS_LEFT = [[0, -8], [-6, -6], [0, -8], [2, -8]]
|
|
||||||
FISH_OFFSETS_RIGHT = [[0, -8], [6, -6], [0, -8], [-2, -8]]
|
|
||||||
FISH_OFFSETS_UP = [[0, -6], [0, -6], [0, -6], [2, -4]]
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -28,31 +28,6 @@ class Sprite_Wearable < RPG::Sprite
|
|||||||
@sprite.y += offsets_array[current_frame][1]
|
@sprite.y += offsets_array[current_frame][1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def adjustPositionForScreenScrolling
|
|
||||||
return if !$game_map.scrolling? && !@was_just_scrolling
|
|
||||||
if $game_map.scrolling?
|
|
||||||
@was_just_scrolling=true
|
|
||||||
else
|
|
||||||
@was_just_scrolling=false
|
|
||||||
end
|
|
||||||
offset_x = 0
|
|
||||||
offset_y = 0
|
|
||||||
case $game_map.scroll_direction
|
|
||||||
when DIRECTION_RIGHT
|
|
||||||
offset_x=-8
|
|
||||||
when DIRECTION_LEFT
|
|
||||||
offset_x=8
|
|
||||||
when DIRECTION_UP
|
|
||||||
offset_y=8
|
|
||||||
@sprite.z+=50 #weird layering glitch for some reason otherwise. It's reset to the correct value in the next animation frame
|
|
||||||
when DIRECTION_DOWN
|
|
||||||
offset_y=-8
|
|
||||||
end
|
|
||||||
@sprite.x+=offset_x
|
|
||||||
@sprite.y+=offset_y
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def set_sprite_position(action, direction, current_frame)
|
def set_sprite_position(action, direction, current_frame)
|
||||||
@sprite.x = @player_sprite.x - @player_sprite.ox
|
@sprite.x = @player_sprite.x - @player_sprite.ox
|
||||||
@sprite.y = @player_sprite.y - @player_sprite.oy
|
@sprite.y = @player_sprite.y - @player_sprite.oy
|
||||||
@@ -97,33 +72,20 @@ class Sprite_Wearable < RPG::Sprite
|
|||||||
elsif direction == DIRECTION_UP
|
elsif direction == DIRECTION_UP
|
||||||
apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_UP,current_frame)
|
apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_UP,current_frame)
|
||||||
end
|
end
|
||||||
when "fish"
|
|
||||||
if direction == DIRECTION_DOWN
|
|
||||||
apply_sprite_offset(Outfit_Offsets::FISH_OFFSETS_DOWN,current_frame)
|
|
||||||
elsif direction == DIRECTION_LEFT
|
|
||||||
apply_sprite_offset( Outfit_Offsets::FISH_OFFSETS_LEFT,current_frame)
|
|
||||||
elsif direction == DIRECTION_RIGHT
|
|
||||||
apply_sprite_offset( Outfit_Offsets::FISH_OFFSETS_RIGHT,current_frame)
|
|
||||||
elsif direction == DIRECTION_UP
|
|
||||||
apply_sprite_offset( Outfit_Offsets::FISH_OFFSETS_UP,current_frame)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
@sprite.x = @player_sprite.x - @player_sprite.ox
|
@sprite.x = @player_sprite.x - @player_sprite.ox
|
||||||
@sprite.y = @player_sprite.y - @player_sprite.oy
|
@sprite.y = @player_sprite.y - @player_sprite.oy
|
||||||
end
|
end
|
||||||
adjustPositionForScreenScrolling()
|
|
||||||
|
|
||||||
@sprite.y -= 2 if current_frame % 2 == 1
|
@sprite.y -= 2 if current_frame % 2 == 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def animate(action)
|
||||||
def animate(action, frame=nil)
|
|
||||||
@action = action
|
@action = action
|
||||||
current_frame = @player_sprite.character.pattern if !frame
|
current_frame = @player_sprite.character.pattern
|
||||||
direction = @player_sprite.character.direction
|
direction = @player_sprite.character.direction
|
||||||
crop_spritesheet(direction)
|
crop_spritesheet(direction)
|
||||||
adjust_layer()
|
|
||||||
set_sprite_position(@action, direction, current_frame)
|
set_sprite_position(@action, direction, current_frame)
|
||||||
|
adjust_layer()
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(action, filename,color)
|
def update(action, filename,color)
|
||||||
|
|||||||
@@ -6,56 +6,56 @@ class Sprite_Hat < Sprite_Wearable
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# def set_sprite_position(action, direction, current_frame)
|
def set_sprite_position(action, direction, current_frame)
|
||||||
# @sprite.x = @player_sprite.x - @player_sprite.ox
|
@sprite.x = @player_sprite.x - @player_sprite.ox
|
||||||
# @sprite.y = @player_sprite.y - @player_sprite.oy
|
@sprite.y = @player_sprite.y - @player_sprite.oy
|
||||||
# case action
|
case action
|
||||||
# when "run"
|
when "run"
|
||||||
# if direction == DIRECTION_DOWN
|
if direction == DIRECTION_DOWN
|
||||||
# apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_DOWN, current_frame)
|
apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_DOWN, current_frame)
|
||||||
# elsif direction == DIRECTION_LEFT
|
elsif direction == DIRECTION_LEFT
|
||||||
# apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_LEFT, current_frame)
|
apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_LEFT, current_frame)
|
||||||
# elsif direction == DIRECTION_RIGHT
|
elsif direction == DIRECTION_RIGHT
|
||||||
# apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_RIGHT, current_frame)
|
apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_RIGHT, current_frame)
|
||||||
# elsif direction == DIRECTION_UP
|
elsif direction == DIRECTION_UP
|
||||||
# apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_UP, current_frame)
|
apply_sprite_offset(Outfit_Offsets::RUN_OFFSETS_UP, current_frame)
|
||||||
# end
|
end
|
||||||
# when "surf"
|
when "surf"
|
||||||
# if direction == DIRECTION_DOWN
|
if direction == DIRECTION_DOWN
|
||||||
# apply_sprite_offset(Outfit_Offsets::SURF_OFFSETS_DOWN,current_frame)
|
apply_sprite_offset(Outfit_Offsets::SURF_OFFSETS_DOWN,current_frame)
|
||||||
# elsif direction == DIRECTION_LEFT
|
elsif direction == DIRECTION_LEFT
|
||||||
# apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_LEFT,current_frame)
|
apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_LEFT,current_frame)
|
||||||
# elsif direction == DIRECTION_RIGHT
|
elsif direction == DIRECTION_RIGHT
|
||||||
# apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_RIGHT,current_frame)
|
apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_RIGHT,current_frame)
|
||||||
# elsif direction == DIRECTION_UP
|
elsif direction == DIRECTION_UP
|
||||||
# apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_UP,current_frame)
|
apply_sprite_offset( Outfit_Offsets::SURF_OFFSETS_UP,current_frame)
|
||||||
# end
|
end
|
||||||
# when "dive"
|
when "dive"
|
||||||
# if direction == DIRECTION_DOWN
|
if direction == DIRECTION_DOWN
|
||||||
# apply_sprite_offset(Outfit_Offsets::DIVE_OFFSETS_DOWN,current_frame)
|
apply_sprite_offset(Outfit_Offsets::DIVE_OFFSETS_DOWN,current_frame)
|
||||||
# elsif direction == DIRECTION_LEFT
|
elsif direction == DIRECTION_LEFT
|
||||||
# apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_LEFT,current_frame)
|
apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_LEFT,current_frame)
|
||||||
# elsif direction == DIRECTION_RIGHT
|
elsif direction == DIRECTION_RIGHT
|
||||||
# apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_RIGHT,current_frame)
|
apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_RIGHT,current_frame)
|
||||||
# elsif direction == DIRECTION_UP
|
elsif direction == DIRECTION_UP
|
||||||
# apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_UP,current_frame)
|
apply_sprite_offset( Outfit_Offsets::DIVE_OFFSETS_UP,current_frame)
|
||||||
# end
|
end
|
||||||
# when "bike"
|
when "bike"
|
||||||
# if direction == DIRECTION_DOWN
|
if direction == DIRECTION_DOWN
|
||||||
# apply_sprite_offset(Outfit_Offsets::BIKE_OFFSETS_DOWN,current_frame)
|
apply_sprite_offset(Outfit_Offsets::BIKE_OFFSETS_DOWN,current_frame)
|
||||||
# elsif direction == DIRECTION_LEFT
|
elsif direction == DIRECTION_LEFT
|
||||||
# apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_LEFT,current_frame)
|
apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_LEFT,current_frame)
|
||||||
# elsif direction == DIRECTION_RIGHT
|
elsif direction == DIRECTION_RIGHT
|
||||||
# apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_RIGHT,current_frame)
|
apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_RIGHT,current_frame)
|
||||||
# elsif direction == DIRECTION_UP
|
elsif direction == DIRECTION_UP
|
||||||
# apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_UP,current_frame)
|
apply_sprite_offset( Outfit_Offsets::BIKE_OFFSETS_UP,current_frame)
|
||||||
# end
|
end
|
||||||
# else
|
else
|
||||||
# @sprite.x = @player_sprite.x - @player_sprite.ox
|
@sprite.x = @player_sprite.x - @player_sprite.ox
|
||||||
# @sprite.y = @player_sprite.y - @player_sprite.oy
|
@sprite.y = @player_sprite.y - @player_sprite.oy
|
||||||
# end
|
end
|
||||||
# @sprite.y -= 2 if current_frame % 2 == 1
|
@sprite.y -= 2 if current_frame % 2 == 1
|
||||||
# end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class Sprite_Player < Sprite_Character
|
|||||||
getClothedPlayerSprite(true)
|
getClothedPlayerSprite(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def updateCharacterBitmap
|
def updateCharacterBitmap
|
||||||
skinTone = $Trainer.skin_tone ? $Trainer.skin_tone : 0
|
skinTone = $Trainer.skin_tone ? $Trainer.skin_tone : 0
|
||||||
baseBitmapFilename = getBaseOverworldSpriteFilename(@character_name, skinTone)
|
baseBitmapFilename = getBaseOverworldSpriteFilename(@character_name, skinTone)
|
||||||
@@ -79,7 +78,9 @@ class Sprite_Player < Sprite_Character
|
|||||||
return baseBitmap
|
return baseBitmap
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def positionHair(baseBitmap, hairBirmap, offset)
|
||||||
|
baseBitmap.blt(offset[0], offset[1], hairBirmap, hairBirmap.rect)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ class PokeBattle_Scene
|
|||||||
sprite.setBitmapDirectly(generate_front_trainer_sprite_bitmap())
|
sprite.setBitmapDirectly(generate_front_trainer_sprite_bitmap())
|
||||||
sprite.zoom_x=2
|
sprite.zoom_x=2
|
||||||
sprite.zoom_y=2
|
sprite.zoom_y=2
|
||||||
sprite.z=100 + idxTrainer
|
sprite.z=30 + idxTrainer
|
||||||
|
|
||||||
sprite.mirror =true
|
sprite.mirror =true
|
||||||
@sprites["player_#{idxTrainer + 1}"] = sprite
|
@sprites["player_#{idxTrainer + 1}"] = sprite
|
||||||
|
|||||||
@@ -72,9 +72,11 @@ end
|
|||||||
|
|
||||||
def applyRoamWeather()
|
def applyRoamWeather()
|
||||||
return if $game_screen.weather_type != :None
|
return if $game_screen.weather_type != :None
|
||||||
currently_roaming = getAllCurrentlyRoamingPokemon()
|
currently_roaming = $PokemonGlobal.roamPosition.keys
|
||||||
currently_roaming.each do |roamer_id|
|
currently_roaming.each do |roamer_id|
|
||||||
roamerOnCurrentMap = $PokemonGlobal.roamPosition[roamer_id] == $game_map.map_id
|
roamer_switch = Settings::ROAMING_SPECIES[roamer_id][2]
|
||||||
|
roamer_active = $game_switches[roamer_switch]
|
||||||
|
roamerOnCurrentMap = $PokemonGlobal.roamPosition[roamer_id] == $game_map.map_id && roamer_active
|
||||||
if roamerOnCurrentMap
|
if roamerOnCurrentMap
|
||||||
return if $PokemonGlobal.roamPokemonCaught[roamer_id]
|
return if $PokemonGlobal.roamPokemonCaught[roamer_id]
|
||||||
weather = Settings::ROAMING_SPECIES[roamer_id][6]
|
weather = Settings::ROAMING_SPECIES[roamer_id][6]
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ ItemHandlers::UseInField.copy(:BICYCLE, :RACEBIKE)
|
|||||||
|
|
||||||
ItemHandlers::UseInField.add(:OLDROD, proc { |item|
|
ItemHandlers::UseInField.add(:OLDROD, proc { |item|
|
||||||
notCliff = $game_map.passable?($game_player.x, $game_player.y, $game_player.direction, $game_player)
|
notCliff = $game_map.passable?($game_player.x, $game_player.y, $game_player.direction, $game_player)
|
||||||
if !$game_player.pbFacingTerrainTag.can_fish || (!$PokemonGlobal.surfing && !notCliff) || $PokemonGlobal.surfing
|
if !$game_player.pbFacingTerrainTag.can_fish || (!$PokemonGlobal.surfing && !notCliff)
|
||||||
pbMessage(_INTL("Can't use that here."))
|
pbMessage(_INTL("Can't use that here."))
|
||||||
next 0
|
next 0
|
||||||
end
|
end
|
||||||
@@ -257,7 +257,7 @@ ItemHandlers::UseInField.add(:OLDROD, proc { |item|
|
|||||||
|
|
||||||
ItemHandlers::UseInField.add(:GOODROD, proc { |item|
|
ItemHandlers::UseInField.add(:GOODROD, proc { |item|
|
||||||
notCliff = $game_map.passable?($game_player.x, $game_player.y, $game_player.direction, $game_player)
|
notCliff = $game_map.passable?($game_player.x, $game_player.y, $game_player.direction, $game_player)
|
||||||
if !$game_player.pbFacingTerrainTag.can_fish || (!$PokemonGlobal.surfing && !notCliff) || $PokemonGlobal.surfing
|
if !$game_player.pbFacingTerrainTag.can_fish || (!$PokemonGlobal.surfing && !notCliff)
|
||||||
pbMessage(_INTL("Can't use that here."))
|
pbMessage(_INTL("Can't use that here."))
|
||||||
next 0
|
next 0
|
||||||
end
|
end
|
||||||
@@ -270,7 +270,7 @@ ItemHandlers::UseInField.add(:GOODROD, proc { |item|
|
|||||||
|
|
||||||
ItemHandlers::UseInField.add(:SUPERROD, proc { |item|
|
ItemHandlers::UseInField.add(:SUPERROD, proc { |item|
|
||||||
notCliff = $game_map.passable?($game_player.x, $game_player.y, $game_player.direction, $game_player)
|
notCliff = $game_map.passable?($game_player.x, $game_player.y, $game_player.direction, $game_player)
|
||||||
if !$game_player.pbFacingTerrainTag.can_fish || (!$PokemonGlobal.surfing && !notCliff) || $PokemonGlobal.surfing
|
if !$game_player.pbFacingTerrainTag.can_fish || (!$PokemonGlobal.surfing && !notCliff)
|
||||||
pbMessage(_INTL("Can't use that here."))
|
pbMessage(_INTL("Can't use that here."))
|
||||||
next 0
|
next 0
|
||||||
end
|
end
|
||||||
@@ -1075,8 +1075,6 @@ ItemHandlers::UseOnPokemon.add(:ABILITYCAPSULE, proc { |item, pkmn, scene|
|
|||||||
if scene.pbConfirm(_INTL("Would you like to change {1}'s Ability to {2}?",
|
if scene.pbConfirm(_INTL("Would you like to change {1}'s Ability to {2}?",
|
||||||
pkmn.name, newabilname))
|
pkmn.name, newabilname))
|
||||||
pkmn.ability_index = newabil
|
pkmn.ability_index = newabil
|
||||||
pkmn.ability = GameData::Ability.get((newabil == 0) ? abil1 : abil2).id
|
|
||||||
|
|
||||||
#pkmn.ability = GameData::Ability.get((newabil == 0) ? abil1 : abil2).id
|
#pkmn.ability = GameData::Ability.get((newabil == 0) ? abil1 : abil2).id
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
scene.pbDisplay(_INTL("{1}'s Ability changed to {2}!", pkmn.name, newabilname))
|
scene.pbDisplay(_INTL("{1}'s Ability changed to {2}!", pkmn.name, newabilname))
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ def pbLoadTrainer(tr_type, tr_name, tr_version = 0)
|
|||||||
raise _INTL("Trainer type {1} does not exist.", tr_type) if !tr_type_data
|
raise _INTL("Trainer type {1} does not exist.", tr_type) if !tr_type_data
|
||||||
tr_type = tr_type_data.id
|
tr_type = tr_type_data.id
|
||||||
trainer_data = getTrainersDataMode.try_get(tr_type, tr_name, tr_version)
|
trainer_data = getTrainersDataMode.try_get(tr_type, tr_name, tr_version)
|
||||||
if !trainer_data
|
|
||||||
trainer_data = GameData::Trainer.try_get(tr_type, tr_name, tr_version)
|
|
||||||
end
|
|
||||||
return (trainer_data) ? trainer_data.to_trainer : nil
|
return (trainer_data) ? trainer_data.to_trainer : nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -587,7 +587,6 @@ class PokemonMartScreen
|
|||||||
@scene.pbStartBuyScene(@stock,@adapter)
|
@scene.pbStartBuyScene(@stock,@adapter)
|
||||||
item=nil
|
item=nil
|
||||||
loop do
|
loop do
|
||||||
pbWait(4)
|
|
||||||
item=@scene.pbChooseBuyItem
|
item=@scene.pbChooseBuyItem
|
||||||
break if !item
|
break if !item
|
||||||
quantity=0
|
quantity=0
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class Player < Trainer
|
|||||||
attr_accessor :has_snag_machine
|
attr_accessor :has_snag_machine
|
||||||
attr_accessor :seen_purify_chamber
|
attr_accessor :seen_purify_chamber
|
||||||
|
|
||||||
alias __shadowPkmn__initialize initialize unless method_defined?(:__shadowPkmn__initialize)
|
alias __shadowPkmn__initialize initialize
|
||||||
def initialize(name, trainer_type)
|
def initialize(name, trainer_type)
|
||||||
__shadowPkmn__initialize(name, trainer_type)
|
__shadowPkmn__initialize(name, trainer_type)
|
||||||
@has_snag_machine = false
|
@has_snag_machine = false
|
||||||
|
|||||||
@@ -228,11 +228,10 @@ def Kernel.sumGameStats()
|
|||||||
stringStats << "\nBeaten the Elite Four " << $game_variables[VAR_STAT_NB_ELITE_FOUR].to_s << " times"
|
stringStats << "\nBeaten the Elite Four " << $game_variables[VAR_STAT_NB_ELITE_FOUR].to_s << " times"
|
||||||
stringStats << "\nFused " << $game_variables[VAR_STAT_NB_FUSIONS].to_s << " Pokémon"
|
stringStats << "\nFused " << $game_variables[VAR_STAT_NB_FUSIONS].to_s << " Pokémon"
|
||||||
|
|
||||||
nbGymRematches = $game_variables[VAR_STAT_LEADER_REMATCH]
|
stringStats << "\nRematched " << $game_variables[VAR_STAT_LEADER_REMATCH].to_s << " Gym Leaders"
|
||||||
stringStats << "\nRematched " << nbGymRematches.to_s << " Gym Leaders" if nbGymRematches > 0
|
|
||||||
stringStats << "\nTook " << $PokemonGlobal.stepcount.to_s << " steps"
|
stringStats << "\nTook " << $PokemonGlobal.stepcount.to_s << " steps"
|
||||||
stringStats << "\nVisited " << countVisitedMaps.to_s << " different areas"
|
stringStats << "\nVisited " << countVisitedMaps.to_s << " different areas"
|
||||||
stringStats << "\nUsed " << $game_variables[VAR_STAT_RARE_CANDY].to_s << " Rare Candies"
|
stringStats << "\nUsed " << $game_variables[VAR_STAT_RARE_CANDY] << " Rare Candies"
|
||||||
|
|
||||||
if $game_switches[910]
|
if $game_switches[910]
|
||||||
stringStats << "\nMade " << $game_variables[VAR_STAT_NB_WONDERTRADES].to_s << " Wonder Trades"
|
stringStats << "\nMade " << $game_variables[VAR_STAT_NB_WONDERTRADES].to_s << " Wonder Trades"
|
||||||
|
|||||||
@@ -107,12 +107,13 @@ class BetterRegionMap
|
|||||||
if map_metadata
|
if map_metadata
|
||||||
player = map_metadata.town_map_position
|
player = map_metadata.town_map_position
|
||||||
if true#player && player[0] == @region #only use 1 region
|
if true#player && player[0] == @region #only use 1 region
|
||||||
$PokemonGlobal.regionMapSel = [0, 0]
|
$PokemonGlobal.regionMapSel[0] = player[1]
|
||||||
|
$PokemonGlobal.regionMapSel[1] = player[2]
|
||||||
gender = $Trainer.gender.to_digits(3)
|
gender = $Trainer.gender.to_digits(3)
|
||||||
# @window["player"].bmp("Graphics/Pictures/map/Player#{gender}")
|
# @window["player"].bmp("Graphics/Pictures/map/Player#{gender}")
|
||||||
@window["player"].bmp("Graphics/Pictures/map/location_icon")
|
@window["player"].bmp("Graphics/Pictures/map/location_icon")
|
||||||
@window["player"].x = TileWidth * player[1] + (TileWidth / 2.0) if player
|
@window["player"].x = TileWidth * player[1] + (TileWidth / 2.0)
|
||||||
@window["player"].y = TileHeight * player[2] + (TileHeight / 2.0) if player
|
@window["player"].y = TileHeight * player[2] + (TileHeight / 2.0)
|
||||||
@window["player"].center_origins
|
@window["player"].center_origins
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -176,11 +176,11 @@ end
|
|||||||
|
|
||||||
|
|
||||||
def playPokeFluteAnimation
|
def playPokeFluteAnimation
|
||||||
# return if $Trainer.outfit != 0
|
return if $Trainer.outfit != 0
|
||||||
# $game_player.setDefaultCharName("players/pokeflute", 0, false)
|
$game_player.setDefaultCharName("players/pokeflute", 0, false)
|
||||||
# Graphics.update
|
Graphics.update
|
||||||
# Input.update
|
Input.update
|
||||||
# pbUpdateSceneMap
|
pbUpdateSceneMap
|
||||||
end
|
end
|
||||||
|
|
||||||
def restoreDefaultCharacterSprite(charset_number = 0)
|
def restoreDefaultCharacterSprite(charset_number = 0)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def download_file(url, saveLocation)
|
|||||||
echoln _INTL("\nDownloaded file {1} to {2}", url, saveLocation)
|
echoln _INTL("\nDownloaded file {1} to {2}", url, saveLocation)
|
||||||
return saveLocation
|
return saveLocation
|
||||||
else
|
else
|
||||||
echoln _INTL("Tried to download file {1}.",url)
|
echoln _INTL("Tried to download file {1} . Got response {2}",url,response[:body])
|
||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
rescue MKXPError, Errno::ENOENT => error
|
rescue MKXPError, Errno::ENOENT => error
|
||||||
@@ -81,7 +81,7 @@ def download_sprite(base_path, head_id, body_id, saveLocation = "Graphics/temp",
|
|||||||
echoln _INTL("\nDownloaded file from {1} to {2}", base_path, saveLocation)
|
echoln _INTL("\nDownloaded file from {1} to {2}", base_path, saveLocation)
|
||||||
return downloaded_file_name
|
return downloaded_file_name
|
||||||
end
|
end
|
||||||
echoln _INTL("Tried to download file {1} . Got response {2}",url,response[:body])
|
echoln "tried to download " + url
|
||||||
return nil
|
return nil
|
||||||
rescue MKXPError, Errno::ENOENT
|
rescue MKXPError, Errno::ENOENT
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -30,9 +30,7 @@ next catchRate
|
|||||||
})
|
})
|
||||||
BallHandlers::OnCatch.add(:ABILITYBALL,proc{|ball,battle,pokemon|
|
BallHandlers::OnCatch.add(:ABILITYBALL,proc{|ball,battle,pokemon|
|
||||||
species = getSpecies(dexNum(pokemon))
|
species = getSpecies(dexNum(pokemon))
|
||||||
ability = species.hidden_abilities[-1]
|
pokemon.ability_index= getAbilityIndexFromID(species.hidden_abilities[-1],pokemon)
|
||||||
pokemon.ability = ability
|
|
||||||
pokemon.ability_index= getAbilityIndexFromID(ability,pokemon)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
#VIRUS BALL 27 - give pokerus
|
#VIRUS BALL 27 - give pokerus
|
||||||
|
|||||||
@@ -1868,27 +1868,13 @@ ItemHandlers::UseInField.add(:DEVONSCOPE, proc { |item|
|
|||||||
#TRACKER (for roaming legendaries)
|
#TRACKER (for roaming legendaries)
|
||||||
ItemHandlers::UseInField.add(:REVEALGLASS, proc { |item|
|
ItemHandlers::UseInField.add(:REVEALGLASS, proc { |item|
|
||||||
track_pokemon()
|
track_pokemon()
|
||||||
next true
|
|
||||||
})
|
})
|
||||||
ItemHandlers::UseFromBag.add(:REVEALGLASS, proc { |item|
|
ItemHandlers::UseFromBag.add(:REVEALGLASS, proc { |item|
|
||||||
track_pokemon()
|
track_pokemon()
|
||||||
next true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
def getAllCurrentlyRoamingPokemon
|
|
||||||
currently_roaming = []
|
|
||||||
Settings::ROAMING_SPECIES.each_with_index do |data, i|
|
|
||||||
next if !GameData::Species.exists?(data[0])
|
|
||||||
next if data[2] > 0 && !$game_switches[data[2]] # Isn't roaming
|
|
||||||
next if $PokemonGlobal.roamPokemon[i] == true # Roaming Pokémon has been caught
|
|
||||||
currently_roaming << i
|
|
||||||
end
|
|
||||||
return currently_roaming
|
|
||||||
end
|
|
||||||
|
|
||||||
def track_pokemon()
|
def track_pokemon()
|
||||||
currently_roaming = getAllCurrentlyRoamingPokemon()
|
currently_roaming = $PokemonGlobal.roamPosition.keys
|
||||||
echoln currently_roaming
|
|
||||||
weather_data = []
|
weather_data = []
|
||||||
mapinfos = $RPGVX ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata")
|
mapinfos = $RPGVX ? load_data("Data/MapInfos.rvdata") : load_data("Data/MapInfos.rxdata")
|
||||||
currently_roaming.each do |roamer_id|
|
currently_roaming.each do |roamer_id|
|
||||||
@@ -1905,11 +1891,12 @@ def track_pokemon()
|
|||||||
end
|
end
|
||||||
weather_data << forecast_msg if forecast_msg && !weather_data.include?(forecast_msg)
|
weather_data << forecast_msg if forecast_msg && !weather_data.include?(forecast_msg)
|
||||||
end
|
end
|
||||||
weather_data << _INTL("No unusual weather patterns have been detected.") if weather_data.empty?
|
|
||||||
weather_data.each do |message|
|
weather_data.each do |message|
|
||||||
Kernel.pbMessage(message)
|
Kernel.pbMessage(message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# nbRoaming = 0
|
# nbRoaming = 0
|
||||||
# if Settings::ROAMING_SPECIES.length == 0
|
# if Settings::ROAMING_SPECIES.length == 0
|
||||||
# Kernel.pbMessage(_INTL("No roaming Pokémon defined."))
|
# Kernel.pbMessage(_INTL("No roaming Pokémon defined."))
|
||||||
|
|||||||
@@ -1,47 +1,3 @@
|
|||||||
# class ShinySelector
|
|
||||||
# def set_colors(pokemon_id)
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# picturePath = get_unfused_sprite_path(getPokemon(pokemon_id).id_number)
|
|
||||||
# @pokemonBitmap = AnimatedBitmap.new(picturePath)
|
|
||||||
# @previewwindow = PictureWindow.new(@pokemonBitmap)
|
|
||||||
# @previewwindow.z = 100
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# pbFadeOutIn {
|
|
||||||
# scene = ShinySliderOptionsScene.new
|
|
||||||
# screen = PokemonOptionScreen.new(scene)
|
|
||||||
# screen.pbStartScreen
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
#
|
|
||||||
# class ShinySliderOptionsScene < PokemonOption_Scene
|
|
||||||
# def pbGetOptions(inloadscreen = false)
|
|
||||||
# options = []
|
|
||||||
# options << SliderOption.new(_INTL("Hue"), 0, 360, 1,
|
|
||||||
# proc { $game_variables[VAR_RANDOMIZER_TRAINER_BST] },
|
|
||||||
# proc { |value|
|
|
||||||
# $game_variables[VAR_RANDOMIZER_TRAINER_BST] = value
|
|
||||||
# })
|
|
||||||
# end
|
|
||||||
#
|
|
||||||
# def initOptionsWindow
|
|
||||||
# options = []
|
|
||||||
# options << SliderOption.new(_INTL("Hue"), 0, 360, 1,
|
|
||||||
# proc { $game_variables[VAR_RANDOMIZER_TRAINER_BST] },
|
|
||||||
# proc { |value|
|
|
||||||
# $game_variables[VAR_RANDOMIZER_TRAINER_BST] = value
|
|
||||||
# })
|
|
||||||
# return Window_PokemonOption.new(options, 0, 300, Graphics.width, Graphics.height)
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SHINY_COLOR_OFFSETS = {
|
SHINY_COLOR_OFFSETS = {
|
||||||
1 => -30,
|
1 => -30,
|
||||||
2 => -85,
|
2 => -85,
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
|
|
||||||
module Settings
|
module Settings
|
||||||
SHINY_POKEMON_CHANCE = 16
|
SHINY_POKEMON_CHANCE = 16
|
||||||
CREDITS_FILE_URL = "https://gitlab.com/infinitefusion2/customsprites/-/raw/master/Sprite Credits.csv"
|
CREDITS_FILE_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/Sprite Credits.csv"
|
||||||
SPRITES_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/CUSTOM_SPRITES"
|
SPRITES_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/CUSTOM_SPRITES"
|
||||||
VERSION_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/VERSION"
|
VERSION_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/VERSION"
|
||||||
CUSTOM_DEX_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/dex.json"
|
CUSTOM_DEX_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/dex.json"
|
||||||
|
|
||||||
AUTOGEN_SPRITES_REPO_URL = "https://gitlab.com/infinitefusion2/autogen-fusion-sprites/-/raw/main/Battlers/"
|
AUTOGEN_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/autogen-fusion-sprites/-/raw/master/Battlers/"
|
||||||
CUSTOM_SPRITES_REPO_URL = "https://gitlab.com/infinitefusion2/customSprites/-/raw/master/CustomBattlers/"
|
CUSTOM_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/CustomBattlers/"
|
||||||
BASE_POKEMON_SPRITES_REPO_URL = "https://gitlab.com/infinitefusion2/autogen-fusion-sprites/-/raw/main/Battlers/"
|
BASE_POKEMON_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/autogen-fusion-sprites/-/raw/master/Battlers/"
|
||||||
BASE_POKEMON_ALT_SPRITES_REPO_URL = "https://gitlab.com/infinitefusion2/customSprites/-/raw/main/Other/BaseSprites/"
|
BASE_POKEMON_ALT_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/Other/BaseSprites/"
|
||||||
|
|
||||||
DISCORD_URL = "https://discord.com/invite/infinitefusion"
|
DISCORD_URL = "https://discord.com/invite/infinitefusion"
|
||||||
WIKI_URL = "https://infinitefusion.fandom.com/"
|
WIKI_URL = "https://infinitefusion.fandom.com/"
|
||||||
|
|||||||
16
Data/Scripts/RemoteUrls.rb
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
module Settings
|
||||||
|
SHINY_POKEMON_CHANCE = 16
|
||||||
|
CREDITS_FILE_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/Sprite Credits.csv"
|
||||||
|
SPRITES_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/CUSTOM_SPRITES"
|
||||||
|
VERSION_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/VERSION"
|
||||||
|
CUSTOM_DEX_FILE_URL = "https://raw.githubusercontent.com/infinitefusion/infinitefusion-e18/main/Data/dex.json"
|
||||||
|
|
||||||
|
AUTOGEN_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/autogen-fusion-sprites/-/raw/master/Battlers/"
|
||||||
|
CUSTOM_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/CustomBattlers/"
|
||||||
|
BASE_POKEMON_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/autogen-fusion-sprites/-/raw/master/Battlers/"
|
||||||
|
BASE_POKEMON_ALT_SPRITES_REPO_URL = "https://gitlab.com/pokemoninfinitefusion/customsprites/-/raw/master/Other/BaseSprites/"
|
||||||
|
|
||||||
|
DISCORD_URL = "https://discord.com/invite/infinitefusion"
|
||||||
|
WIKI_URL = "https://infinitefusion.fandom.com/"
|
||||||
|
end
|
||||||
6164
Data/dex.json
@@ -1 +0,0 @@
|
|||||||
RPGXP 1.01
|
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 783 B After Width: | Height: | Size: 771 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1021 B |
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 480 B |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 802 B After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 798 B After Width: | Height: | Size: 993 B |
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 516 B |
|
Before Width: | Height: | Size: 727 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 494 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 899 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 517 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 571 B After Width: | Height: | Size: 537 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 895 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 376 B After Width: | Height: | Size: 485 B |
|
Before Width: | Height: | Size: 949 B After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 545 B After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 861 B After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 793 B |
|
Before Width: | Height: | Size: 987 B After Width: | Height: | Size: 1.2 KiB |