赞 | 2 |
VIP | 2 |
好人卡 | 4 |
积分 | 1 |
经验 | 96076 |
最后登录 | 2015-12-27 |
在线时间 | 93 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 93 小时
- 注册时间
- 2008-5-16
- 帖子
- 745
|
- 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
- class Scene_Battle
- include Item_Data
- def update_phase3_item_select
- @item_window.visible = true
- @item_window.update
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- end_item_select
- return
- end
- if Input.trigger?(Input::C)
- @item = @item_window.item
- @item = @item_window.item
- @actor_sp = @active_battler.sp
- if @item.id == ITEM_ID and @actor_sp < @item.recover_sp.abs
- $game_system.se_play($data_system.cancel_se)
- else
- unless $game_party.item_can_use?(@item.id)
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- $game_system.se_play($data_system.decision_se)
- @active_battler.current_action.item_id = @item.id
- @item_window.visible = false
- if @item.scope == 1
- start_enemy_select
- elsif @item.scope == 3 or @item.scope == 5
- start_actor_select
- else
- end_item_select
- phase3_next_actor
- end
- return
- end
- end
- end
- end
复制代码
这样就可以了 |
|