Project1
标题:
请教一下这个脚本为什么出错
[打印本页]
作者:
苹果星ねこ
时间:
2012-6-3 20:20
标题:
请教一下这个脚本为什么出错
本帖最后由 苹果星ねこ 于 2012-6-3 20:39 编辑
第38行出错
module RPG
class Item
attr_accessor :description
def description
@description.split(/,/)[0] == nil ? @description : @description.split(/,/)[0]
end
def help
return @description.split(/,/)[1]
end
end
end
class Scene_Battle
def make_item_action_result
# 获取物品
@item = $data_items[@active_battler.current_action.item_id]
# 因为物品耗尽而无法使用的情况下
unless $game_party.item_can_use?(@item.id)
# 移至步骤 1
@phase4_step = 1
return
end
# 消耗品的情况下
if @item.consumable
# 使用的物品减 1
$game_party.lose_item(@item.id, 1)
end
#######################################################eclair
# 在帮助窗口显示特技名
if @item.help != nil
tar = ""
text = @item.help
case @item.scope
when 1
tar = @target_battlers[0].name
when 2
tar = "敌人全体"
when 3
tar = @target_battlers[0].name
when 4
tar = "我方全体"
when 5
tar = "自己"
end
tar = "自己" if tar == @active_battler.name
loop do
last_text = text.clone
text.gsub!(/\a/){@active_battler.name}
text.gsub!(/\t/){tar}
text.gsub!(/\n/){@item.name}
text = text.split(/@/)[0] #避开特技分类的冲突 :)
break if text == last_text
end
@help_window.set_text(text, 1)
else
@help_window.set_text(@item.name, 1)
end
########################################################eclair
# 设置动画 ID
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
# 设置公共事件 ID
@common_event_id = @item.common_event_id
# 确定对像
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
# 设置对像侧战斗者
set_target_battlers(@item.scope)
# 应用物品效果
for target in @target_battlers
target.item_effect(@item)
end
end
end
复制代码
@hys111111
dsu_plus_rewardpost_czw
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1