Project1
标题:
(RMVX)请问如何设置一个技能可以选择对敌或对我使用
[打印本页]
作者:
xpdkoei
时间:
2011-8-28 14:17
标题:
(RMVX)请问如何设置一个技能可以选择对敌或对我使用
如同最终幻想里面的设定一样,回复技能对我使用是补血,对不死系敌人使用是去血。 dsu_plus_rewardpost_czw
作者:
102045301
时间:
2011-8-28 18:05
威力100,恢复200,
这个还要使用者和敌人,那我不知道了。
作者:
zphyp120
时间:
2011-8-28 19:24
本帖最后由 zphyp120 于 2011-8-28 19:26 编辑
这就类似死亡缠绕嘛。。。
建议你弄两个技能,在同一个等级学会
比如:治疗·死亡缠绕(治疗效果,对己方使用)
灭敌·死亡缠绕(伤害效果,对敌方方使用)
[line]2[/line]
如果觉得我的答案对您有帮助的话,请按下面的“认可答案”按钮!
作者:
feizhaodan
时间:
2011-8-28 21:02
上脚本啦:
#=begin
#==============================================================================
# ■ Change_Scope
#------------------------------------------------------------------------------
# 设置内容。
#==============================================================================
module Change_Scope
BOTTON = Input::X
# 把X换成你喜欢的键。
# 详细请看帮助里的 RPG Maker VX -》 游戏操控 -》 基本操控 里的按键
end
#==============================================================================
# ■ RPG::Skill
#------------------------------------------------------------------------------
# 技能类(新定义)
#==============================================================================
module RPG
class Skill < UsableItem
alias cs_initialize initialize
def initialize
cs_initialize
@last_scope = 0
end
#--------------------------------------------------------------------------
# ● 更改 目标
#--------------------------------------------------------------------------
def change_scope
if self.scope != self.last_scope
self.scope = self.last_scope
else
if self.for_opponent?
if self.for_all?
self.scope = 8
else
self.scope = 7
end
elsif self.for_friend? and not self.for_dead_friend?
if self.for_all?
self.scope = 2
else
self.scope = 1
end
end
end
end
#--------------------------------------------------------------------------
# ● 获取原目标
#--------------------------------------------------------------------------
def get_last_scope
@last_scope = @scope
end
attr_accessor :last_scope
end
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 处理战斗画面的类。
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# □ 更新同伴目标选择(再定义)
#--------------------------------------------------------------------------
def update_target_actor_selection
@target_actor_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
end_target_actor_selection
elsif Input.trigger?(Input::C)
Sound.play_decision
@active_battler.action.target_index = @target_actor_window.index
end_target_actor_selection
end_skill_selection
end_item_selection
next_actor
elsif Input.trigger?(Change_Scope::BOTTON)
if @skill.for_dead_friend? or @skill.scope == 0
Sound.play_buzzer
return
else
@skill.change_scope
determine_skill(2)
end
end
end
#--------------------------------------------------------------------------
# □ 更新敌人目标选择(再定义)
#--------------------------------------------------------------------------
def update_target_enemy_selection
@target_enemy_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
end_target_enemy_selection
elsif Input.trigger?(Input::C)
Sound.play_decision
@active_battler.action.target_index = @target_enemy_window.enemy.index
end_target_enemy_selection
end_skill_selection
end_item_selection
next_actor
elsif Input.trigger?(Change_Scope::BOTTON)
if @skill.scope == 0
Sound.play_buzzer
return
else
@skill.change_scope
determine_skill(1)
end
end
end
#--------------------------------------------------------------------------
# □ 确认技能(再定义)
#--------------------------------------------------------------------------
def determine_skill(before = 0)
@active_battler.action.set_skill(@skill.id)
if before == 0
@skill_window.active = false
end
if before != 0
$game_message.visible = false
@info_viewport.visible = true
if @skill.for_opponent?
start_target_enemy_selection(true)
else
start_target_actor_selection(true)
end
else
if @skill.need_selection?
if @skill.for_opponent?
start_target_enemy_selection
else
start_target_actor_selection
end
else
end_skill_selection
next_actor
end
end
end
#--------------------------------------------------------------------------
# □ 更新技能选择(再定义)
#--------------------------------------------------------------------------
def update_skill_selection
@skill_window.active = true
@skill_window.update
@help_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
end_skill_selection
elsif Input.trigger?(Input::C)
@skill = @skill_window.skill
@skill.get_last_scope
if @skill != nil
@active_battler.last_skill_id = @skill.id
end
if @active_battler.skill_can_use?(@skill)
Sound.play_decision
determine_skill
else
Sound.play_buzzer
end
end
end
#--------------------------------------------------------------------------
# ● 开始敌人目标选择
#--------------------------------------------------------------------------
def start_target_enemy_selection(before = false)
@target_enemy_window = Window_TargetEnemy.new
if before
@info_viewport.rect.x -= @target_actor_window.width
@info_viewport.ox -= @target_actor_window.width
@target_actor_window.active = false
@target_actor_window.visible = false
@target_actor_window = nil
end
@target_enemy_window.y = @info_viewport.rect.y
@info_viewport.rect.x += @target_enemy_window.width
@info_viewport.ox += @target_enemy_window.width
@actor_command_window.active = false
end
#--------------------------------------------------------------------------
# ● 开始同伴目标选择
#--------------------------------------------------------------------------
def start_target_actor_selection(before = false)
@target_actor_window = Window_BattleStatus.new
if before
@info_viewport.rect.x -= @target_enemy_window.width
@info_viewport.ox -= @target_enemy_window.width
@target_enemy_window.active = false
@target_enemy_window.visible = false
@target_enemy_window = nil
end
@target_actor_window.index = 0
@target_actor_window.active = true
@target_actor_window.y = @info_viewport.rect.y
@info_viewport.rect.x += @target_actor_window.width
@info_viewport.ox += @target_actor_window.width
@actor_command_window.active = false
end
end
#=end
复制代码
在战斗中按你设置的键(默认为X(键盘上的A))
技能只要不是全体或者复活类的话就可以变更目标类型。
之后只要在加血技能上加个单独的属性,把怕这个技能的怪对加血技能附带的属性的抵抗性改成F就行。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1