mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
bugfixes 1.5, speed up, variableShop
This commit is contained in:
32
Data/Scripts/050_AddOns/EggMoveTutor.rb
Normal file
32
Data/Scripts/050_AddOns/EggMoveTutor.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
def pbRelearnEggMoveScreen(pkmn)
|
||||
retval = true
|
||||
pbFadeOutIn {
|
||||
scene = MoveRelearner_Scene.new
|
||||
screen = MoveRelearnerScreen.new(scene)
|
||||
retval = screen.pbStartScreenEgg(pkmn)
|
||||
}
|
||||
return retval
|
||||
end
|
||||
|
||||
class MoveRelearnerScreen
|
||||
def pbStartScreenEgg(pkmn)
|
||||
baby = pbGetBabySpecies(pkmn.species)
|
||||
moves = pbGetSpeciesEggMoves(baby)
|
||||
|
||||
@scene.pbStartScene(pkmn, moves)
|
||||
loop do
|
||||
move = @scene.pbChooseMove
|
||||
if move
|
||||
if @scene.pbConfirm(_INTL("Teach {1}?", GameData::Move.get(move).name))
|
||||
if pbLearnMove(pkmn, move)
|
||||
@scene.pbEndScene
|
||||
return true
|
||||
end
|
||||
end
|
||||
elsif @scene.pbConfirm(_INTL("Give up trying to teach a new move to {1}?", pkmn.name))
|
||||
@scene.pbEndScene
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
53
Data/Scripts/050_AddOns/NonMoneyShop.rb
Normal file
53
Data/Scripts/050_AddOns/NonMoneyShop.rb
Normal file
@@ -0,0 +1,53 @@
|
||||
class VariableCurrencyMartAdapter < PokemonMartAdapter
|
||||
def initialize(currency)
|
||||
@currency_variable = currency
|
||||
end
|
||||
def getMoney
|
||||
return pbGet(@currency_variable).to_i
|
||||
end
|
||||
|
||||
def getMoneyString
|
||||
return pbGet(@currency_variable).to_s
|
||||
end
|
||||
|
||||
def setMoney(value)
|
||||
pbSet(@currency_variable,value)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def pbVariablePokemonMart(stock,currencyVariable,currency_name="Points",speech=nil,cantsell=true)
|
||||
for i in 0...stock.length
|
||||
stock[i] = GameData::Item.get(stock[i]).id
|
||||
stock[i] = nil if GameData::Item.get(stock[i]).is_important? && $PokemonBag.pbHasItem?(stock[i])
|
||||
end
|
||||
stock.compact!
|
||||
commands = []
|
||||
cmdBuy = -1
|
||||
cmdSell = -1
|
||||
cmdQuit = -1
|
||||
commands[cmdBuy = commands.length] = _INTL("Buy")
|
||||
commands[cmdSell = commands.length] = _INTL("Sell") if !cantsell
|
||||
commands[cmdQuit = commands.length] = _INTL("Quit")
|
||||
cmd = pbMessage(
|
||||
speech ? speech : _INTL("Welcome! How may I serve you?"),
|
||||
commands,cmdQuit+1)
|
||||
loop do
|
||||
if cmdBuy>=0 && cmd==cmdBuy
|
||||
adapter = VariableCurrencyMartAdapter.new(currencyVariable)
|
||||
scene = PokemonMart_Scene.new(currency_name)
|
||||
screen = PokemonMartScreen.new(scene,stock,adapter)
|
||||
screen.pbBuyScreen
|
||||
elsif cmdSell>=0 && cmd==cmdSell #NOT IMPLEMENTED
|
||||
scene = PokemonMart_Scene.new(currency_name)
|
||||
screen = PokemonMartScreen.new(scene,stock,adapter)
|
||||
screen.pbSellScreen
|
||||
else
|
||||
pbMessage(_INTL("Please come again!"))
|
||||
break
|
||||
end
|
||||
cmd = pbMessage(_INTL("Is there anything else I can help you with?"),
|
||||
commands,cmdQuit+1)
|
||||
end
|
||||
$game_temp.clear_mart_prices
|
||||
end
|
||||
@@ -26,6 +26,7 @@ class PokemonTemp
|
||||
attr_accessor :speechbubble_arrow
|
||||
attr_accessor :speechbubble_outofrange
|
||||
attr_accessor :speechbubble_talking
|
||||
attr_accessor :speechbubble_alwaysDown
|
||||
end
|
||||
|
||||
module MessageConfig
|
||||
@@ -85,7 +86,7 @@ def pbRepositionMessageWindow(msgwindow, linecount=2)
|
||||
msgwindow.setSkin("Graphics/windowskins/frlgtextskin")
|
||||
msgwindow.height = 102
|
||||
msgwindow.width = Graphics.width
|
||||
if $game_player.direction==8
|
||||
if $game_player.direction==8 && !$PokemonTemp.speechbubble_alwaysDown
|
||||
$PokemonTemp.speechbubble_vp = Viewport.new(0, 0, Graphics.width, 280)
|
||||
msgwindow.y = 6
|
||||
else
|
||||
@@ -119,7 +120,7 @@ end
|
||||
def pbCreateMessageWindow(viewport=nil,skin=nil)
|
||||
arrow = nil
|
||||
if $PokemonTemp.speechbubble_bubble==2 && $game_map.events[$PokemonTemp.speechbubble_talking] != nil # Message window set to floating bubble.
|
||||
if $game_player.direction==8 # Player facing up, message window top.
|
||||
if $game_player.direction==8 && !$PokemonTemp.speechbubble_alwaysDown# Player facing up, message window top.
|
||||
$PokemonTemp.speechbubble_vp = Viewport.new(0, 104, Graphics.width, 280)
|
||||
$PokemonTemp.speechbubble_vp.z = 999999
|
||||
arrow = Sprite.new($PokemonTemp.speechbubble_vp)
|
||||
@@ -192,4 +193,6 @@ end
|
||||
def pbCallBub(status=0,value=0,always_down=false)
|
||||
$PokemonTemp.speechbubble_talking=get_character(value).id
|
||||
$PokemonTemp.speechbubble_bubble=status
|
||||
$PokemonTemp.speechbubble_alwaysDown=always_down
|
||||
|
||||
end
|
||||
62
Data/Scripts/050_AddOns/Spped Up.rb
Normal file
62
Data/Scripts/050_AddOns/Spped Up.rb
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
#==============================================================================#
|
||||
# Better Fast-forward Mode #
|
||||
# v1.0 #
|
||||
# #
|
||||
# by Marin #
|
||||
#==============================================================================#
|
||||
# Usage #
|
||||
# #
|
||||
# SPEEDUP_STAGES are the speed stages the game will pick from. If you click F, #
|
||||
# it'll choose the next number in that array. It goes back to the first number #
|
||||
# afterward. #
|
||||
# #
|
||||
# $GameSpeed is the current index in the speed up array. #
|
||||
# Should you want to change that manually, you can do, say, $GameSpeed = 0 #
|
||||
# #
|
||||
# If you don't want the user to be able to speed up at certain points, you can #
|
||||
# use "pbDisallowSpeedup" and "pbAllowSpeedup". #
|
||||
#==============================================================================#
|
||||
# Please give credit when using this. #
|
||||
#==============================================================================#
|
||||
|
||||
PluginManager.register({
|
||||
:name => "Better Fast-forward Mode",
|
||||
:version => "1.1",
|
||||
:credits => "Marin",
|
||||
:link => "https://reliccastle.com/resources/151/"
|
||||
})
|
||||
|
||||
# When the user clicks F, it'll pick the next number in this array.
|
||||
SPEEDUP_STAGES = [1,2,3]
|
||||
|
||||
|
||||
def pbAllowSpeedup
|
||||
$CanToggle = true
|
||||
end
|
||||
|
||||
def pbDisallowSpeedup
|
||||
$CanToggle = false
|
||||
end
|
||||
|
||||
# Default game speed.
|
||||
$GameSpeed = 0
|
||||
$frame = 0
|
||||
$CanToggle = true
|
||||
|
||||
module Graphics
|
||||
class << Graphics
|
||||
alias fast_forward_update update
|
||||
end
|
||||
|
||||
def self.update
|
||||
if $CanToggle && Input.trigger?(Input::AUX1)
|
||||
$GameSpeed += 1
|
||||
$GameSpeed = 0 if $GameSpeed >= SPEEDUP_STAGES.size
|
||||
end
|
||||
$frame += 1
|
||||
return unless $frame % SPEEDUP_STAGES[$GameSpeed] == 0
|
||||
fast_forward_update
|
||||
$frame = 0
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user