mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Changed functionality of running key, added compatibility with old Mystery Gifts
This commit is contained in:
@@ -162,7 +162,7 @@ class Bitmap
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Zlib deflation
|
# Zlib deflation
|
||||||
smoldata = Zlib::Deflate.deflate(data.pack("C*")).bytes.map { |e| e.to_i }
|
smoldata = Zlib::Deflate.deflate(data.pack("C*")).bytes
|
||||||
# data chunk length
|
# data chunk length
|
||||||
f.write_int smoldata.size
|
f.write_int smoldata.size
|
||||||
# IDAT
|
# IDAT
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ def pbDownloadData(url, filename = nil, authorization = nil, depth = 0, &block)
|
|||||||
return ret if !ret.is_a?(Hash)
|
return ret if !ret.is_a?(Hash)
|
||||||
return "" if ret[:status] != 200
|
return "" if ret[:status] != 200
|
||||||
return ret[:body] if !filename
|
return ret[:body] if !filename
|
||||||
File.open(filename, "wb"){|f|f.write(ret[:body])}
|
File.open(filename, "wb") { |f| f.write(ret[:body]) }
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -82,4 +82,4 @@ def pbPostToFile(url, postdata, file)
|
|||||||
pbPostData(url, postdata,file)
|
pbPostData(url, postdata,file)
|
||||||
rescue
|
rescue
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ SaveData.register_conversion(:v19_convert_player) do
|
|||||||
display_title 'Converting player trainer class'
|
display_title 'Converting player trainer class'
|
||||||
to_all do |save_data|
|
to_all do |save_data|
|
||||||
next if save_data[:player].is_a?(PlayerTrainer)
|
next if save_data[:player].is_a?(PlayerTrainer)
|
||||||
# Conversion of the party is handled in PokeBattle_Trainer.copy
|
# Conversion of the party is handled in PokeBattle_Trainer.convert
|
||||||
save_data[:player] = PokeBattle_Trainer.copy(save_data[:player])
|
save_data[:player] = PokeBattle_Trainer.convert(save_data[:player])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class Game_Player < Game_Character
|
|||||||
@move_route_forcing || $game_temp.message_window_showing ||
|
@move_route_forcing || $game_temp.message_window_showing ||
|
||||||
pbMapInterpreterRunning?
|
pbMapInterpreterRunning?
|
||||||
terrain = pbGetTerrainTag
|
terrain = pbGetTerrainTag
|
||||||
input = ($PokemonSystem.runstyle==1) ? $PokemonGlobal.runtoggle : Input.press?(Input::SPECIAL)
|
input = ($PokemonSystem.runstyle == 1) ^ Input.press?(Input::SPECIAL)
|
||||||
return input && $PokemonGlobal.runningShoes && !jumping? &&
|
return input && $PokemonGlobal.runningShoes && !jumping? &&
|
||||||
!$PokemonGlobal.diving && !$PokemonGlobal.surfing &&
|
!$PokemonGlobal.diving && !$PokemonGlobal.surfing &&
|
||||||
!$PokemonGlobal.bicycle && !PBTerrain.onlyWalk?(terrain)
|
!$PokemonGlobal.bicycle && !PBTerrain.onlyWalk?(terrain)
|
||||||
|
|||||||
@@ -187,10 +187,6 @@ class Scene_Map
|
|||||||
unless $game_player.moving?
|
unless $game_player.moving?
|
||||||
$PokemonTemp.keyItemCalling = true
|
$PokemonTemp.keyItemCalling = true
|
||||||
end
|
end
|
||||||
elsif Input.trigger?(Input::SPECIAL)
|
|
||||||
if $PokemonSystem.runstyle==1
|
|
||||||
$PokemonGlobal.runtoggle = !$PokemonGlobal.runtoggle
|
|
||||||
end
|
|
||||||
elsif Input.press?(Input::F9)
|
elsif Input.press?(Input::F9)
|
||||||
$game_temp.debug_calling = true if $DEBUG
|
$game_temp.debug_calling = true if $DEBUG
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class BitmapWrapper < Bitmap
|
|||||||
def dispose
|
def dispose
|
||||||
return if self.disposed?
|
return if self.disposed?
|
||||||
@refcount -= 1
|
@refcount -= 1
|
||||||
super if @refcount == 0
|
super if @refcount <= 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(*arg)
|
def initialize(*arg)
|
||||||
@@ -265,8 +265,8 @@ module BitmapCache
|
|||||||
objKey = fromCache(key)
|
objKey = fromCache(key)
|
||||||
if !objKey
|
if !objKey
|
||||||
bitmap = BitmapWrapper.new(Game_Map::TILE_WIDTH, Game_Map::TILE_HEIGHT)
|
bitmap = BitmapWrapper.new(Game_Map::TILE_WIDTH, Game_Map::TILE_HEIGHT)
|
||||||
x = (tile_id - 384) % 8 * 32
|
x = (tile_id - 384) % 8 * Game_Map::TILE_WIDTH
|
||||||
y = (tile_id - 384) / 8 * 32
|
y = (tile_id - 384) / 8 * Game_Map::TILE_HEIGHT
|
||||||
rect = Rect.new(x, y, Game_Map::TILE_WIDTH, Game_Map::TILE_HEIGHT)
|
rect = Rect.new(x, y, Game_Map::TILE_WIDTH, Game_Map::TILE_HEIGHT)
|
||||||
tileset = yield(filename)
|
tileset = yield(filename)
|
||||||
bitmap.blt(0, 0, tileset, rect)
|
bitmap.blt(0, 0, tileset, rect)
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ class GifBitmap
|
|||||||
end
|
end
|
||||||
|
|
||||||
def totalFrames
|
def totalFrames
|
||||||
@totalframes/2 # Due to frame count being incremented by 2
|
@totalframes/2 # Due to frame count being incremented by 2
|
||||||
end
|
end
|
||||||
|
|
||||||
def disposed?
|
def disposed?
|
||||||
@@ -311,7 +311,7 @@ class GifBitmap
|
|||||||
@gifbitmaps.length==0 ? 0 : @gifbitmaps[0].height
|
@gifbitmaps.length==0 ? 0 : @gifbitmaps[0].height
|
||||||
end
|
end
|
||||||
|
|
||||||
# This function must be called in order to animate the GIF image.
|
# This function must be called in order to animate the GIF image.
|
||||||
def update
|
def update
|
||||||
return if disposed?
|
return if disposed?
|
||||||
if @gifbitmaps.length>0
|
if @gifbitmaps.length>0
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
|
|||||||
alignstack.push(0)
|
alignstack.push(0)
|
||||||
nextline=1 if x>0 && nextline==0
|
nextline=1 if x>0 && nextline==0
|
||||||
else
|
else
|
||||||
alignstack.pop;
|
alignstack.pop
|
||||||
nextline=1 if x>0 && nextline==0
|
nextline=1 if x>0 && nextline==0
|
||||||
end
|
end
|
||||||
elsif control=="ac" # Center align
|
elsif control=="ac" # Center align
|
||||||
@@ -600,7 +600,7 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
|
|||||||
alignstack.push(2)
|
alignstack.push(2)
|
||||||
nextline=1 if x>0 && nextline==0
|
nextline=1 if x>0 && nextline==0
|
||||||
else
|
else
|
||||||
alignstack.pop;
|
alignstack.pop
|
||||||
nextline=1 if x>0 && nextline==0
|
nextline=1 if x>0 && nextline==0
|
||||||
end
|
end
|
||||||
elsif control=="icon" # Icon
|
elsif control=="icon" # Icon
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ class LocationWindow
|
|||||||
@window.dispose
|
@window.dispose
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if @frames>80
|
if @frames > Graphics.frame_rate * 2
|
||||||
@window.y -= 4
|
@window.y -= 4
|
||||||
@window.dispose if @window.y+@window.height<0
|
@window.dispose if @window.y+@window.height<0
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ class PokemonGlobalMetadata
|
|||||||
attr_accessor :sliding
|
attr_accessor :sliding
|
||||||
attr_accessor :fishing
|
attr_accessor :fishing
|
||||||
attr_accessor :runningShoes
|
attr_accessor :runningShoes
|
||||||
attr_accessor :runtoggle
|
|
||||||
# Player data
|
# Player data
|
||||||
attr_accessor :startTime
|
attr_accessor :startTime
|
||||||
attr_accessor :stepcount
|
attr_accessor :stepcount
|
||||||
@@ -71,7 +70,6 @@ class PokemonGlobalMetadata
|
|||||||
@sliding = false
|
@sliding = false
|
||||||
@fishing = false
|
@fishing = false
|
||||||
@runningShoes = false
|
@runningShoes = false
|
||||||
@runtoggle = false
|
|
||||||
# Player data
|
# Player data
|
||||||
@startTime = Time.now
|
@startTime = Time.now
|
||||||
@stepcount = 0
|
@stepcount = 0
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class PokeBattle_Trainer
|
|||||||
attr_reader :pokedex, :pokegear
|
attr_reader :pokedex, :pokegear
|
||||||
attr_reader :mysterygiftaccess, :mysterygift
|
attr_reader :mysterygiftaccess, :mysterygift
|
||||||
|
|
||||||
def self.copy(trainer)
|
def self.convert(trainer)
|
||||||
validate trainer => self
|
validate trainer => self
|
||||||
ret = PlayerTrainer.new(trainer.name, trainer.trainertype)
|
ret = PlayerTrainer.new(trainer.name, trainer.trainertype)
|
||||||
ret.id = trainer.id
|
ret.id = trainer.id
|
||||||
|
|||||||
@@ -349,14 +349,9 @@ class PokemonOption_Scene
|
|||||||
proc { $PokemonSystem.battlestyle },
|
proc { $PokemonSystem.battlestyle },
|
||||||
proc { |value| $PokemonSystem.battlestyle = value }
|
proc { |value| $PokemonSystem.battlestyle = value }
|
||||||
),
|
),
|
||||||
EnumOption.new(_INTL("Running Key"),[_INTL("Hold"),_INTL("Toggle")],
|
EnumOption.new(_INTL("Default Movement"),[_INTL("Walking"),_INTL("Running")],
|
||||||
proc { $PokemonSystem.runstyle },
|
proc { $PokemonSystem.runstyle },
|
||||||
proc { |value|
|
proc { |value| $PokemonSystem.runstyle = value }
|
||||||
if $PokemonSystem.runstyle!=value
|
|
||||||
$PokemonSystem.runstyle = value
|
|
||||||
$PokemonGlobal.runtoggle = false if $PokemonGlobal
|
|
||||||
end
|
|
||||||
}
|
|
||||||
),
|
),
|
||||||
NumberOption.new(_INTL("Speech Frame"),1,Settings::SPEECH_WINDOWSKINS.length,
|
NumberOption.new(_INTL("Speech Frame"),1,Settings::SPEECH_WINDOWSKINS.length,
|
||||||
proc { $PokemonSystem.textskin },
|
proc { $PokemonSystem.textskin },
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
# NOTE: Essentials cannot handle https addresses. You must use a http address.
|
# NOTE: Essentials cannot handle https addresses. You must use a http address.
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
module MysteryGift
|
module MysteryGift
|
||||||
URL = "http://images1.wikia.nocookie.net/pokemonessentials/images/e/e7/MysteryGift.txt"
|
URL = "https://pastebin.com/raw/w6BqqUsm"
|
||||||
# URL = "http://pastebin.com/raw/w6BqqUsm"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -57,7 +56,8 @@ def pbEditMysteryGift(type,item,id=0,giftname="")
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if id==0
|
if id==0
|
||||||
master=[]; idlist=[]
|
master=[]
|
||||||
|
idlist=[]
|
||||||
if safeExists?("MysteryGiftMaster.txt")
|
if safeExists?("MysteryGiftMaster.txt")
|
||||||
master=IO.read("MysteryGiftMaster.txt")
|
master=IO.read("MysteryGiftMaster.txt")
|
||||||
master=pbMysteryGiftDecrypt(master)
|
master=pbMysteryGiftDecrypt(master)
|
||||||
@@ -146,7 +146,7 @@ def pbManageMysteryGifts
|
|||||||
pbMessage(_INTL("Online Mystery Gifts found.\\wtnp[20]"))
|
pbMessage(_INTL("Online Mystery Gifts found.\\wtnp[20]"))
|
||||||
online=pbMysteryGiftDecrypt(online)
|
online=pbMysteryGiftDecrypt(online)
|
||||||
t=[]
|
t=[]
|
||||||
for gift in online; t.push(gift[0]); end
|
online.each { |gift| t.push(gift[0]) }
|
||||||
online=t
|
online=t
|
||||||
end
|
end
|
||||||
# Show list of all gifts.
|
# Show list of all gifts.
|
||||||
@@ -155,9 +155,9 @@ def pbManageMysteryGifts
|
|||||||
commands=pbRefreshMGCommands(master,online)
|
commands=pbRefreshMGCommands(master,online)
|
||||||
command=pbMessage(_INTL("\\ts[]Manage Mystery Gifts (X=online)."),commands,-1,nil,command)
|
command=pbMessage(_INTL("\\ts[]Manage Mystery Gifts (X=online)."),commands,-1,nil,command)
|
||||||
# Gift chosen
|
# Gift chosen
|
||||||
if command==-1 || command==commands.length-1
|
if command==-1 || command==commands.length-1 # Cancel
|
||||||
break
|
break
|
||||||
elsif command==commands.length-2
|
elsif command==commands.length-2 # Export selected to file
|
||||||
begin
|
begin
|
||||||
newfile=[]
|
newfile=[]
|
||||||
for gift in master
|
for gift in master
|
||||||
@@ -170,7 +170,7 @@ def pbManageMysteryGifts
|
|||||||
rescue
|
rescue
|
||||||
pbMessage(_INTL("Couldn't save the gifts to MysteryGift.txt."))
|
pbMessage(_INTL("Couldn't save the gifts to MysteryGift.txt."))
|
||||||
end
|
end
|
||||||
elsif command>=0 && command<commands.length-2
|
elsif command>=0 && command<commands.length-2 # A gift
|
||||||
cmd=0
|
cmd=0
|
||||||
loop do
|
loop do
|
||||||
commands=pbRefreshMGCommands(master,online)
|
commands=pbRefreshMGCommands(master,online)
|
||||||
@@ -336,7 +336,16 @@ end
|
|||||||
|
|
||||||
def pbMysteryGiftDecrypt(gift)
|
def pbMysteryGiftDecrypt(gift)
|
||||||
return [] if gift==""
|
return [] if gift==""
|
||||||
ret=Marshal.restore(Zlib::Inflate.inflate(gift.unpack("m")[0]))
|
ret = Marshal.restore(Zlib::Inflate.inflate(gift.unpack("m")[0]))
|
||||||
|
if ret
|
||||||
|
ret.each do |gift|
|
||||||
|
if gift[1] == 0 # Pokémon
|
||||||
|
gift[2] = PokeBattle_Pokemon.convert(gift[2])
|
||||||
|
else # Item
|
||||||
|
gift[2] = GameData::Item.get(gift[2]).id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ def pbScreenCapture
|
|||||||
t = pbGetTimeNow
|
t = pbGetTimeNow
|
||||||
filestart = t.strftime("[%Y-%m-%d] %H_%M_%S")
|
filestart = t.strftime("[%Y-%m-%d] %H_%M_%S")
|
||||||
filestart = sprintf("%s.%03d", filestart, (t.to_f - t.to_i) * 1000) # milliseconds
|
filestart = sprintf("%s.%03d", filestart, (t.to_f - t.to_i) * 1000) # milliseconds
|
||||||
capturefile = RTP.getSaveFileName(sprintf("%s.png", filestart))
|
# capturefile = RTP.getSaveFileName(sprintf("%s.png", filestart))
|
||||||
Graphics.snap_to_bitmap.save_to_png(capturefile)
|
# Graphics.snap_to_bitmap.save_to_png(capturefile)
|
||||||
|
capturefile = RTP.getSaveFileName(sprintf("%s.bmp", filestart))
|
||||||
|
Graphics.screenshot(capturefile)
|
||||||
pbSEPlay("Pkmn exp full") if FileTest.audio_exist?("Audio/SE/Pkmn exp full")
|
pbSEPlay("Pkmn exp full") if FileTest.audio_exist?("Audio/SE/Pkmn exp full")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user