Project1
标题:
效果范围的问题
[打印本页]
作者:
wangyanzhe6
时间:
2015-8-7 15:57
标题:
效果范围的问题
系统默认都是,设置单个队友只能对单个队友发动,设置单个敌人只能对单个敌人发动……
怎么样让他双面化,就是让所有范围都扩大到敌我双方。比如设置单个队友,开始光标在单
个队友身上,但也可以移动到敌方身上。
作者:
neverstop
时间:
2015-8-9 12:41
#==============================================================================
#
# ▼ YSA Battle Add-On: Invert Targets
# -- Last Updated: 2012.02.19
# -- Level: Easy
# -- Requires Optional:
# + Yanfly Engine Ace - Ace Battle Engine
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YSA-InvertTargets"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.02.19 - Add notetag <no invert>.
# 2012.01.03 - Fix a critical bug after an inverted skill.
# 2012.01.03 - Started Script and Finished.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Skill and Item Notetags
# -----------------------------------------------------------------------------
# <no invert>
# 使技能/项目不能倒。
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================
module YSA
module INVERT_TARGETS
#选择将反转目标选择的键。
INVERT_KEY = :SHIFT
end
end
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
module YSA
module REGEXP
module USABLEITEM
NO_INVERT = /<(?:NO_INVERT|no invert)>/i
end # USABLEITEM
end # REGEXP
end # YSA
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_invt load_database; end
def self.load_database
load_database_invt
load_notetags_invt
end
#--------------------------------------------------------------------------
# new method: load_notetags_invt
#--------------------------------------------------------------------------
def self.load_notetags_invt
groups = [$data_skills, $data_items]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_invt
end
end
end
end # DataManager
#==============================================================================
# ■ RPG::UsableItem
#==============================================================================
class RPG::UsableItem < RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :no_invert
#--------------------------------------------------------------------------
# common cache: load_notetags_invt
#--------------------------------------------------------------------------
def load_notetags_invt
@no_invert = false
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YSA::REGEXP::USABLEITEM::NO_INVERT
@no_invert = true
#---
end
} # self.note.split
#---
end
end # RPG::UsableItem
#==============================================================================
# ■ Game_Action
#==============================================================================
class Game_Action
#--------------------------------------------------------------------------
# alias method: friends_unit
#--------------------------------------------------------------------------
alias invert_target_friends_unit friends_unit
def friends_unit
subject.invert_target? ? subject.opponents_unit : invert_target_friends_unit
end
#--------------------------------------------------------------------------
# alias method: opponents_unit
#--------------------------------------------------------------------------
alias invert_target_opponents_unit opponents_unit
def opponents_unit
subject.invert_target? ? subject.friends_unit : invert_target_opponents_unit
end
#--------------------------------------------------------------------------
# alias method: set_skill
#--------------------------------------------------------------------------
alias invert_target_set_skill set_skill
def set_skill(skill_id)
invert_target_set_skill(skill_id)
subject.invert_target = false
end
#--------------------------------------------------------------------------
# alias method: set_item
#--------------------------------------------------------------------------
alias invert_target_set_item set_item
def set_item(skill_id)
invert_target_set_item(skill_id)
subject.invert_target = false
end
end # Game_Action
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :invert_target
#--------------------------------------------------------------------------
# alias method: initialize
#--------------------------------------------------------------------------
alias invert_target_initialize initialize
def initialize
invert_target_initialize
@invert_target = false
end
#--------------------------------------------------------------------------
# new method: invert_target?
#--------------------------------------------------------------------------
def invert_target?
@invert_target
end
end # Game_Battler
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias method: update_basic
#--------------------------------------------------------------------------
alias scene_battle_update_basic_invtrg update_basic
def update_basic
scene_battle_update_basic_invtrg
update_input_invert_target
end
#--------------------------------------------------------------------------
# new method: update_input_invert_target
#--------------------------------------------------------------------------
def update_input_invert_target
return unless BattleManager.actor
return unless @actor_window.active || @enemy_window.active
if Input.trigger?(YSA::INVERT_TARGETS::INVERT_KEY)
return if BattleManager.actor.input.item.no_invert
BattleManager.actor.invert_target = !BattleManager.actor.invert_target
if @actor_window.active
@actor_window.unselect
@actor_window.hide.deactivate
case @actor_command_window.current_symbol
when :skill
@skill_window.show
when :item
@item_window.show
end
select_enemy_selection
elsif @enemy_window.active
@enemy_window.hide.deactivate
case @actor_command_window.current_symbol
when :skill
@skill_window.hide
when :item
@item_window.hide
end
if $imported["YEA-BattleEngine"]
scene_battle_select_actor_selection_abe
else
select_actor_selection
end
end
end
end
#--------------------------------------------------------------------------
# alias method: on_actor_cancel
#--------------------------------------------------------------------------
alias scene_battle_on_actor_cancel_invtrg on_actor_cancel
def on_actor_cancel
scene_battle_on_actor_cancel_invtrg
BattleManager.actor.invert_target = false
end
#--------------------------------------------------------------------------
# alias method: on_enemy_cancel
#--------------------------------------------------------------------------
alias scene_battle_on_enemy_cancel_invtrg on_enemy_cancel
def on_enemy_cancel
scene_battle_on_enemy_cancel_invtrg
BattleManager.actor.invert_target = false
end
#--------------------------------------------------------------------------
# alias method: turn_end
#--------------------------------------------------------------------------
alias scene_battle_turn_end_invtrg turn_end
def turn_end
scene_battle_turn_end_invtrg
for actor in $game_party.members
actor.invert_target = false
end
end
end # Scene_Battle
#==============================================================================
#
# ▼ End of File
#
#==============================================================================
复制代码
双向技能,不知是不是满意 ,在技能备注中填写<no invert>就非双向技能,shift键转换对象
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1