赞 | 2 |
VIP | 2 |
好人卡 | 4 |
积分 | 1 |
经验 | 96076 |
最后登录 | 2015-12-27 |
在线时间 | 93 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 93 小时
- 注册时间
- 2008-5-16
- 帖子
- 745
|
把脚本放到main前,然后在脚本内自己设置下需要效果物品的ID即可
- module Item_Data
- ITEM_ID = 1 # 有该效果的物品ID
- end
- class Scene_Item
- include Item_Data
- def update_target
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- unless $game_party.item_can_use?(@item.id)
- @item_window.refresh
- end
- @item_window.active = true
- @target_window.visible = false
- @target_window.active = false
- return
- end
- if Input.trigger?(Input::C)
- @item = @item_window.item
- @actor_sp = $game_party.actors[@target_window.index].sp
- if @item.id == ITEM_ID and @actor_sp < @item.recover_sp.abs
- else
- if $game_party.item_number(@item.id) == 0
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- if @target_window.index == -1
- used = false
- for i in $game_party.actors
- used |= i.item_effect(@item)
- end
- end
- if @target_window.index >= 0
- target = $game_party.actors[@target_window.index]
- used = target.item_effect(@item)
- end
- if used
- $game_system.se_play(@item.menu_se)
- if @item.consumable
- $game_party.lose_item(@item.id, 1)
- @item_window.draw_item(@item_window.index)
- end
- @target_window.refresh
- if $game_party.all_dead?
- $scene = Scene_Gameover.new
- return
- end
- if @item.common_event_id > 0
- $game_temp.common_event_id = @item.common_event_id
- $scene = Scene_Map.new
- return
- end
- end
- end
- unless used
- $game_system.se_play($data_system.buzzer_se)
- end
- return
- end
- end
- end
复制代码 |
|