赞 | 5 |
VIP | 71 |
好人卡 | 22 |
积分 | 6 |
经验 | 32145 |
最后登录 | 2013-8-9 |
在线时间 | 184 小时 |
Lv2.观梦者 天仙
- 梦石
- 0
- 星屑
- 620
- 在线时间
- 184 小时
- 注册时间
- 2008-4-15
- 帖子
- 5023
|
紧接着下去的:
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Game_Enemy
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # ○ AP の取得
- #--------------------------------------------------------------------------
- def ap
- return enemy.ap
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Game_Troop
- #==============================================================================
- class Game_Troop < Game_Unit
- #--------------------------------------------------------------------------
- # ○ AP の合計計算
- #--------------------------------------------------------------------------
- def ap_total
- ap = 0
- for enemy in dead_members
- ap += enemy.ap unless enemy.hidden
- end
- return ap
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Window_Command
- #==============================================================================
- class Window_Command < Window_Selectable
- unless method_defined?(:add_command)
- #--------------------------------------------------------------------------
- # ○ コマンドを追加
- # 追加した位置を返す
- #--------------------------------------------------------------------------
- def add_command(command)
- @commands << command
- @item_max = @commands.size
- item_index = @item_max - 1
- refresh_command
- draw_item(item_index)
- return item_index
- end
- #--------------------------------------------------------------------------
- # ○ コマンドをリフレッシュ
- #--------------------------------------------------------------------------
- def refresh_command
- buf = self.contents.clone
- self.height = [self.height, row_max * WLH + 32].max
- create_contents
- self.contents.blt(0, 0, buf, buf.rect)
- buf.dispose
- end
- #--------------------------------------------------------------------------
- # ○ コマンドを挿入
- #--------------------------------------------------------------------------
- def insert_command(index, command)
- @commands.insert(index, command)
- @item_max = @commands.size
- refresh_command
- refresh
- end
- #--------------------------------------------------------------------------
- # ○ コマンドを削除
- #--------------------------------------------------------------------------
- def remove_command(command)
- @commands.delete(command)
- @item_max = @commands.size
- refresh
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # □ Window_APViewer
- #------------------------------------------------------------------------------
- # AP ビューアでスキルを表示するウィンドウです。
- #==============================================================================
- class Window_APViewer < Window_Selectable
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- # x : ウィンドウの X 座標
- # y : ウィンドウの Y 座標
- # width : ウィンドウの幅
- # height : ウィンドウの高さ
- # actor : アクター
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height, actor)
- super(x, y, width, height)
- @actor = actor
- @can_gain_ap_skills = []
- self.index = 0
- refresh
- end
- #--------------------------------------------------------------------------
- # ○ スキルの取得
- #--------------------------------------------------------------------------
- def skill
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ○ リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- @data = []
- @can_gain_ap_skills = @actor.can_gain_ap_skills
- equipment_skills = @actor.equipment_skills(true)
- (1...$data_skills.size).each { |i|
- skill = $data_skills[i]
- next if skill.need_ap == 0
- unless KGC::EquipLearnSkill::SHOW_ZERO_AP_SKILL
- # AP が 0 、かつ装備品で習得していないものは無視
- if @actor.skill_ap(skill.id) == 0 && !equipment_skills.include?(skill)
- next
- end
- end
- @data.push(skill)
- }
- @item_max = @data.size
- create_contents
- @item_max.times { |i| draw_item(i) }
- end
- #--------------------------------------------------------------------------
- # ○ 項目の描画
- # index : 項目番号
- #--------------------------------------------------------------------------
- def draw_item(index)
- rect = item_rect(index)
- self.contents.clear_rect(rect)
- skill = @data[index]
- if skill != nil
- rect.width -= 4
- draw_item_name(skill, rect.x, rect.y, enable?(skill))
- if @actor.ap_full?(skill) || @actor.skill_learn?(skill)
- # マスター
- text = Vocab.full_ap_skill
- else
- # AP 蓄積中
- text = sprintf("%s %4d/%4d",
- Vocab.ap, @actor.skill_ap(skill.id), skill.need_ap)
- end
- # AP を描画
- self.contents.font.color = normal_color
- self.contents.draw_text(rect, text, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ○ スキルを有効状態で表示するかどうか
- # skill : スキル
- #--------------------------------------------------------------------------
- def enable?(skill)
- return true if @actor.skill_learn?(skill) # 習得済み
- return true if @actor.ap_full?(skill) # マスター
- return true if @can_gain_ap_skills.include?(skill) # AP 蓄積可能
- return false
- end
- #--------------------------------------------------------------------------
- # ○ スキルをマスクなしで表示するかどうか
- # skill : スキル
- #--------------------------------------------------------------------------
- def no_mask?(skill)
- return true if @actor.skill_learn?(skill) # 習得済み
- return true if @actor.skill_ap(skill.id) > 0 # AP が 1 以上
- return true if @can_gain_ap_skills.include?(skill) # AP 蓄積可能
- return false
- end
- #--------------------------------------------------------------------------
- # ● アイテム名の描画
- # item : アイテム (スキル、武器、防具でも可)
- # x : 描画先 X 座標
- # y : 描画先 Y 座標
- # enabled : 有効フラグ。false のとき半透明で描画
- #--------------------------------------------------------------------------
- def draw_item_name(item, x, y, enabled = true)
- draw_icon(item.icon_index, x, y, enabled)
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- self.contents.draw_text(x + 24, y, 172, WLH,
- no_mask?(item) ? item.name : item.masked_name)
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- return unless self.active
- if Input.repeat?(Input::RIGHT)
- cursor_pagedown
- elsif Input.repeat?(Input::LEFT)
- cursor_pageup
- end
- end
- #--------------------------------------------------------------------------
- # ● ヘルプテキスト更新
- #--------------------------------------------------------------------------
- def update_help
- if KGC::EquipLearnSkill::HIDE_ZERO_AP_SKILL_HELP && !no_mask?(skill)
- @help_window.set_text(KGC::EquipLearnSkill::ZERO_AP_SKILL_HELP)
- else
- @help_window.set_text(skill == nil ? "" : skill.description)
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Scene_Map
- #==============================================================================
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # ● 画面切り替えの実行
- #--------------------------------------------------------------------------
- alias update_scene_change_KGC_EquipLearnSkill update_scene_change
- def update_scene_change
- return if $game_player.moving? # プレイヤーの移動中?
- if $game_temp.next_scene == :ap_viewer
- call_ap_viewer
- return
- end
- update_scene_change_KGC_EquipLearnSkill
- end
- #--------------------------------------------------------------------------
- # ○ AP ビューアへの切り替え
- #--------------------------------------------------------------------------
- def call_ap_viewer
- $game_temp.next_scene = nil
- $scene = Scene_APViewer.new($game_temp.next_scene_actor_index,
- 0, Scene_APViewer::HOST_MAP)
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu < Scene_Base
- if KGC::EquipLearnSkill::USE_MENU_AP_VIEWER_COMMAND
- #--------------------------------------------------------------------------
- # ● コマンドウィンドウの作成
- #--------------------------------------------------------------------------
- alias create_command_window_KGC_EquipLearnSkill create_command_window
- def create_command_window
- create_command_window_KGC_EquipLearnSkill
- return if $imported["CustomMenuCommand"]
- @__command_ap_viewer_index = @command_window.add_command(Vocab.ap_viewer)
- if @command_window.oy > 0
- @command_window.oy -= Window_Base::WLH
- end
- @command_window.index = @menu_index
- end
- end
- #--------------------------------------------------------------------------
- # ● コマンド選択の更新
- #--------------------------------------------------------------------------
- alias update_command_selection_KGC_EquipLearnSkill update_command_selection
- def update_command_selection
- call_ap_viewer_flag = false
- if Input.trigger?(Input::C)
- case @command_window.index
- when @__command_ap_viewer_index # AP ビューア
- call_ap_viewer_flag = true
- end
- end
- # AP ビューアに移行
- if call_ap_viewer_flag
- if $game_party.members.size == 0
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- start_actor_selection
- return
- end
- update_command_selection_KGC_EquipLearnSkill
- end
- #--------------------------------------------------------------------------
- # ● アクター選択の更新
- #--------------------------------------------------------------------------
- alias update_actor_selection_KGC_EquipLearnSkill update_actor_selection
- def update_actor_selection
- if Input.trigger?(Input::C)
- $game_party.last_actor_index = @status_window.index
- Sound.play_decision
- case @command_window.index
- when @__command_ap_viewer_index # AP ビューア
- $scene = Scene_APViewer.new(@status_window.index,
- @__command_ap_viewer_index, Scene_APViewer::HOST_MENU)
- return
- end
- end
- update_actor_selection_KGC_EquipLearnSkill
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # □ Scene_APViewer
- #------------------------------------------------------------------------------
- # AP ビューアの処理を行うクラスです。
- #==============================================================================
- class Scene_APViewer < Scene_Base
- HOST_MENU = 0
- HOST_MAP = 1
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- # actor_index : アクターインデックス
- # menu_index : コマンドのカーソル初期位置
- # host_scene : 呼び出し元 (0..メニュー 1..マップ)
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0, menu_index = 0, host_scene = HOST_MENU)
- @actor_index = actor_index
- @menu_index = menu_index
- @host_scene = host_scene
- end
- #--------------------------------------------------------------------------
- # ● 開始処理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- @actor = $game_party.members[@actor_index]
- @help_window = Window_Help.new
- if $imported["HelpExtension"]
- @help_window.row_max = KGC::HelpExtension::ROW_MAX
- end
- @status_window = Window_SkillStatus.new(0, @help_window.height, @actor)
- dy = @help_window.height + @status_window.height
- @skill_window = Window_APViewer.new(0, dy,
- Graphics.width, Graphics.height - dy, @actor)
- @skill_window.help_window = @help_window
- end
- #--------------------------------------------------------------------------
- # ● 終了処理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @help_window.dispose
- @status_window.dispose
- @skill_window.dispose
- end
- #--------------------------------------------------------------------------
- # ○ 元の画面へ戻る
- #--------------------------------------------------------------------------
- def return_scene
- case @host_scene
- when HOST_MENU
- $scene = Scene_Menu.new(@menu_index)
- when HOST_MAP
- $scene = Scene_Map.new
- end
- end
- #--------------------------------------------------------------------------
- # ○ 次のアクターの画面に切り替え
- #--------------------------------------------------------------------------
- def next_actor
- @actor_index += 1
- @actor_index %= $game_party.members.size
- $scene = Scene_APViewer.new(@actor_index, @menu_index, @host_scene)
- end
- #--------------------------------------------------------------------------
- # ○ 前のアクターの画面に切り替え
- #--------------------------------------------------------------------------
- def prev_actor
- @actor_index += $game_party.members.size - 1
- @actor_index %= $game_party.members.size
- $scene = Scene_APViewer.new(@actor_index, @menu_index, @host_scene)
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @help_window.update
- @skill_window.update
- @status_window.update
- if @skill_window.active
- update_skill_selection
- end
- end
- #--------------------------------------------------------------------------
- # ○ スキル選択の更新
- #--------------------------------------------------------------------------
- def update_skill_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- elsif Input.trigger?(Input::R)
- Sound.play_cursor
- next_actor
- elsif Input.trigger?(Input::L)
- Sound.play_cursor
- prev_actor
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Scene_Battle
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # ● メッセージ表示が終わるまでウェイト
- #--------------------------------------------------------------------------
- alias wait_for_message_KGC_EquipLearnSkill wait_for_message
- def wait_for_message
- return if @ignore_wait_for_message # メッセージ終了までのウェイトを無視
- wait_for_message_KGC_EquipLearnSkill
- end
- #--------------------------------------------------------------------------
- # ● 獲得した経験値とお金の表示
- #--------------------------------------------------------------------------
- alias display_exp_and_gold_KGC_EquipLearnSkill display_exp_and_gold
- def display_exp_and_gold
- @ignore_wait_for_message = true
- display_exp_and_gold_KGC_EquipLearnSkill
- display_ap
- @ignore_wait_for_message = false
- wait_for_message
- end
- #--------------------------------------------------------------------------
- # ● レベルアップの表示
- #--------------------------------------------------------------------------
- alias display_level_up_KGC_EquipLearnSkill display_level_up
- def display_level_up
- display_level_up_KGC_EquipLearnSkill
- display_master_equipment_skill
- end
- #--------------------------------------------------------------------------
- # ○ 獲得 AP の表示
- #--------------------------------------------------------------------------
- def display_ap
- ap = $game_troop.ap_total
- if ap > 0
- text = sprintf(Vocab::ObtainAP, ap)
- $game_message.texts.push('\.' + text)
- end
- wait_for_message
- end
- #--------------------------------------------------------------------------
- # ○ マスターしたスキルの表示
- #--------------------------------------------------------------------------
- def display_master_equipment_skill
- ap = $game_troop.ap_total
- $game_party.existing_members.each { |actor|
- last_skills = actor.skills
- actor.gain_ap(ap, true)
- }
- wait_for_message
- end
- end
复制代码 |
|