Project1
标题:
[已解決]Instant Cast是什么東東?
[打印本页]
作者:
chanszeman1018
时间:
2020-3-26 15:06
提示:
作者被禁止或删除 内容自动屏蔽
作者:
guoxiaomi
时间:
2020-3-26 20:14
是“瞬发”的意思,技能会立即释放,无需等待施法时间,但具体指代什么没看视频就不知道了……
作者:
Nil2018
时间:
2020-3-26 21:35
善用搜索,论坛里所有主流的外站脚本都有全汉化
#==============================================================================
#
# ▼ Yanfly Engine Ace - 即时使用 v1.03
# -- 最后更新: 2012.07.17
# -- 使用难度: 普通
# -- 需要脚本: 无
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-InstantCast"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.07.17 - Instant doesn't take up a turn if a characterh as additional
# actions/can attack twice.
# 2012.01.12 - Anti-crash methods implemented.
# 2011.12.26 - Bug Fixed: If actor gets stunned while doing an instant cast,
# the actor will not be reselected.
# 2011.12.21 - Started Script and Finished.
#
#==============================================================================
# ▼ 介绍
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 即时使用技能/物品的效果为:角色可以立即使用该技能/武器,并且不会消耗本回合的
# 行动次数。只要该角色有足够的释放条件(例如mp、tp)就可以无限使用.
# 即时使用功能重回RPG Maker VX Ace.以下为即时使用的一些改动:
#
# 1) 对于多行动数的角色,例如连续技,只有在第一个动作是即时使用时才会成功使用即
# 时使用效果.就算第二个或之后的行动为即时使用,该技能也不会触发即时使用效果.
#
# 2) 任何即时使用的技能/物品都会自动瞬时触发,包括即时使用技能中的连锁技能.
#
# 3) 如果敌人使用了一个即时使用的技能,其在使用后会额为获得一次行动机会.
#
#==============================================================================
# ▼ 安装方式
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 打开脚本编辑器,将本脚本拷贝/复制到一个在▼ 插件脚本之下▼ Main之上的新
# 脚本页/槽中.记得保存你的工程以使脚本生效.
#
# -----------------------------------------------------------------------------
# 技能备注 - 在数据库-技能中可以使用的备注.
# -----------------------------------------------------------------------------
# <即时使用>
# 使该技能变成即时使用技能.使用后在战斗阶段开始前会立即使用该技能.
#
# -----------------------------------------------------------------------------
# 物品备注 - 在数据库-物品中可以使用的备注.
# -----------------------------------------------------------------------------
# <即时使用>
# 使该物品变成即时使用物品.使用后在战斗阶段开始前会立即使用该技能.
#
#==============================================================================
# ▼ 兼容性
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 本脚本仅为RPG Maker VX Ace编写.极不可能在无任何修改的情况下运行于RPG Maker VX.
#
# 本脚本和 Yanfly Engine Ace - 战斗系统 v1.00+ 互相兼容.
# 请将本脚本放在其之下.
#
#==============================================================================
# ▼ 编辑以下内容可能会出现电脑损坏、死机,电脑主人脑袋爆炸、昏迷、死亡或口臭
# 所以编辑了后果自负。
#==============================================================================
module YEA
module REGEXP
module USABLEITEM
INSTANT = /<(?:INSTANT|即时使用)>/i
end # USABLEITEM
end # REGEXP
end # YEA
#==============================================================================
# ¡ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_instant load_database; end
def self.load_database
load_database_instant
load_notetags_instant
end
#--------------------------------------------------------------------------
# new method: load_notetags_instant
#--------------------------------------------------------------------------
def self.load_notetags_instant
groups = [$data_skills, $data_items]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_instant
end
end
end
end # DataManager
#==============================================================================
# ¡ RPG::UsableItem
#==============================================================================
class RPG::UsableItem < RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :instant
#--------------------------------------------------------------------------
# common cache: load_notetags_instant
#--------------------------------------------------------------------------
def load_notetags_instant
@instant = false
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::USABLEITEM::INSTANT
@instant = true
#---
end
} # self.note.split
#---
end
end # RPG::UsableItem
#==============================================================================
# ¡ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# new method: check_instant_action
#--------------------------------------------------------------------------
def check_instant_action
@backup_actions_instant = []
@actions.each { |action|
next unless action
if action.item.nil?
@backup_actions_instant.push(action.dup)
next
end
unless action.item.instant
@backup_actions_instant.push(action.dup)
action.clear
end
}
end
#--------------------------------------------------------------------------
# new method: restore_instant_action
#--------------------------------------------------------------------------
def restore_instant_action
@backup_actions_instant.each_index { |i|
@actions[i] = @backup_actions_instant[i]
}
@backup_actions_instant.clear
i = 0
@actions.each { |action| if action.item.nil?; break; end; i += 1 }
@action_input_index = i
end
end # Game_Actor
#==============================================================================
# ¡ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# new method: add_extra_action
#--------------------------------------------------------------------------
def add_extra_action
action_list = enemy.actions.select {|a| action_valid?(a) }
return if action_list.empty?
rating_max = action_list.collect {|a| a.rating }.max
rating_zero = rating_max - 3
action_list.reject! {|a| a.rating <= rating_zero }
action = Game_Action.new(self)
action.set_enemy_action(select_enemy_action(action_list, rating_zero))
@actions.push(action)
end
end # Game_Enemy
#==============================================================================
# ¡ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias method: next_command
#--------------------------------------------------------------------------
alias scene_battle_next_command_instant next_command
def next_command
if instant_action?
perform_instant_action
else
scene_battle_next_command_instant
end
end
#--------------------------------------------------------------------------
# new method: instant_action?
#--------------------------------------------------------------------------
def instant_action?
return false if BattleManager.actor.nil?
return false if BattleManager.actor.input.nil?
action = BattleManager.actor.input.item
return false if action.nil?
return action.instant
end
#--------------------------------------------------------------------------
# new method: perform_instant_action
#--------------------------------------------------------------------------
def perform_instant_action
hide_instant_action_windows
@subject = BattleManager.actor
@subject.check_instant_action
execute_action if @subject.current_action.valid?
process_event
loop do
@subject.remove_current_action
break if $game_troop.all_dead?
break unless @subject.current_action
@subject.current_action.prepare
execute_action if @subject.current_action.valid?
end
process_action_end
@subject.make_actions
@subject.restore_instant_action
@subject = nil
show_instant_action_windows
end
#--------------------------------------------------------------------------
# new method: hide_instant_action_windows
#--------------------------------------------------------------------------
def hide_instant_action_windows
if $imported["YEA-BattleEngine"]
@info_viewport.visible = true
@status_aid_window.hide
@status_window.show
@actor_command_window.show
end
end
#--------------------------------------------------------------------------
# new method: show_instant_action_windows
#--------------------------------------------------------------------------
def show_instant_action_windows
if $imported["YEA-BattleEngine"]
@info_viewport.visible = true
end
start_actor_command_selection
status_redraw_target(BattleManager.actor)
next_command unless BattleManager.actor.inputable?
end
#--------------------------------------------------------------------------
# new method: status_redraw_target
#--------------------------------------------------------------------------
def status_redraw_target(target)
return unless target.actor?
@status_window.draw_item($game_party.battle_members.index(target))
end
#--------------------------------------------------------------------------
# alias method: execute_action
#--------------------------------------------------------------------------
alias scene_battle_execute_action_instant execute_action
def execute_action
scene_battle_execute_action_instant
enemy_add_actions
end
#--------------------------------------------------------------------------
# new method: enemy_add_actions
#--------------------------------------------------------------------------
def enemy_add_actions
return if @subject.actor?
return if @subject.current_action.nil?
return if @subject.current_action.item.nil?
return unless @subject.current_action.item.instant
@subject.add_extra_action
end
end # Scene_Battle
#==============================================================================
#
# ▼ End of File
#
#==============================================================================
复制代码
作者:
chanszeman1018
时间:
2020-3-26 22:42
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1