插件脚本 【转载|18-20】更好的加速模式

ES泽洛

世末鸽者
管理员
元老
2022-08-04
229
14
288
2,116
23
安徽
www.esplus.club
原来的代码来自PokeCommunity,作者Marin。
再加上考虑到GBA模拟器玩家的使用习惯,所以我就改成了按下空格键切换。
Ruby:
#==============================================================================#
#                         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".                 #
#==============================================================================#

# When the user clicks F, it'll pick the next number in this array.
SPEEDUP_STAGES = [1,2,4,8]


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::SPACE)
      $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

=begin
module Input
  class << Input
    alias fast_forward_button_to_key buttonToKey
  end
end
=end
除此之外,还需要加上一些东西。
在PSystem_Controls中,加上这一行,具体数字看情况,上面数字加一。
1681289556477.png
往下面翻一点点,将C那一行后面的0x20删掉,在下面加一行
Ruby:
when Input::SPACE;     return [0x20]                # Space
1681295185201.png
由于20不能添加绑定按键,所以只好用Ctrl键了。
Ruby:
#==============================================================================#
#                         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".                 #
#==============================================================================#

# When the user clicks F, it'll pick the next number in this array.
SPEEDUP_STAGES = [1,2,4,8]


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::CTRL)
      $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
 
最后编辑:

在线成员

现在没有会员在线。

论坛统计

主题
345
消息
1,587
会员
2,330
最新会员
工藤优幸

关于我们

  • 宝可梦以及其他相关名称是任天堂的商标,版权归宝可梦公司所有。宝可饭堂是一个同人游戏中文社区,不隶属于宝可梦公司。在宝可饭堂上的粉丝游戏亦未获得其授权,请支持正版游戏。
© 2022- pokefans.cn
点此延长宝可饭堂生命