设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1207|回复: 1
打印 上一主题 下一主题

[已经过期] 帮忙把其他的注释写上~

[复制链接]

Lv1.梦旅人

超级囧神 无尽的灌水

梦石
0
星屑
144
在线时间
784 小时
注册时间
2010-6-27
帖子
2065
跳转到指定楼层
1
发表于 2010-9-12 16:48:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
  1. #武器附加技能脚本

  2. $data_system = load_data("Data/System.rvdata") if $data_system == nil

  3. #==============================================================================
  4. # ★ カスタマイズ項目 - Customize ★
  5. #==============================================================================

  6. module KGC
  7. module EquipLearnSkill
  8.   # ◆ AP の名称
  9.   # 在增加菜单中显示的东西
  10.   VOCAB_AP     = "技能熟练度"
  11.   # ◆ AP のデフォルト値
  12.   #  所持 AP を指定しなかったエネミーの AP。
  13.   DEFAULT_AP   = 1
  14.   # ◆ 装備しただけでは習得しない
  15.   #  true  : 没有装备或AP不够不能使用
  16.   #  false : 装备了之后就可以使用
  17.   NEED_FULL_AP = false

  18.   #  %s :战斗结束的时候出现计算增加技能熟练度的语言
  19.   VOCAB_RESULT_OBTAIN_AP         = "#{VOCAB_AP} 一共增加 %s !"
  20.   #  无用,设置为空
  21.   VOCAB_RESULT_MASTER_SKILL      = "%s"
  22.   #  战斗结束,熟练度满点的时候提示
  23.   VOCAB_RESULT_MASTER_SKILL_NAME = "%s被他彻底领悟!"

  24.   #  在菜单底部增加选项,查看此时的技能熟练度(熟练度加满不用装备武器
  25.   #一样可以使用技能)
  26.   USE_MENU_AP_VIEWER_COMMAND = false
  27.   # ◆ メニュー画面の「AP ビューア」コマンドの名称
  28.   VOCAB_MENU_AP_VIEWER       = "#{VOCAB_AP}指数"

  29.   # ◆ 底部增加菜单,技能熟练度满所显示的提示
  30.   VOCAB_MASTER_SKILL      = "不用装备也能正常使用"
  31.   # ◆ 没有装备武器也显示技能名称
  32.   SHOW_ZERO_AP_SKILL      = false
  33.   #我不知道
  34.   MASK_ZERO_AP_SKILL_NAME = false
  35.   # ◆ 蓄積 AP が 0 のスキルに表示する名前
  36.   #  1文字だけ指定すると、スキル名と同じ長さに拡張されます。
  37.   ZERO_AP_NAME_MASK       = "?"
  38.   # ◆ 蓄積 AP が 0 のスキルのヘルプを隠す
  39.   HIDE_ZERO_AP_SKILL_HELP = true
  40.   # ◆ 没有装备特定武器的时候显示的文字
  41.   ZERO_AP_SKILL_HELP      = "没有装备特定武器"

  42.   # ◆ 除外装備品配列
  43.   #  配列の添字がアクター ID に対応。
  44.   #  習得装備から除外する武器・防具の ID を配列に格納。
  45.   EXCLUDE_WEAPONS = []  # 武器
  46.   EXCLUDE_ARMORS  = []  # 防具
  47.   # ここから下に定義。
  48.   #  <例>
  49.   #  アクターID:1 は、武器ID:50 と 70 のスキルを習得できない。
  50.   # EXCLUDE_WEAPONS[1] = [50, 70]

  51.   # ◆ 除外スキル配列
  52.   #  配列の添字がアクター ID と対応。
  53.   #  装備では習得不可能にするスキル ID を配列に格納。
  54.   EXCLUDE_SKILLS = []
  55.   #  <例>
  56.   #  アクターID:1 は、スキルID:30 を装備品で習得することはできない。
  57.   # EXCLUDE_SKILLS[1] = [30]
  58. end
  59. end

  60. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  61. $imported = {} if $imported == nil
  62. $imported["EquipLearnSkill"] = true

  63. module KGC::EquipLearnSkill
  64.   module Regexp
  65.     module BaseItem
  66.       # 習得スキル
  67.       LEARN_SKILL = /<(?:LEARN_SKILL|装备学会)\s*(\d+(?:\s*,\s*\d+)*)>/i
  68.     end

  69.     module Skill
  70.       # 必要 AP
  71.       NEED_AP = /<(?:NEED_AP|必要AP)\s*(\d+)>/i
  72.     end

  73.     module Enemy
  74.       # 所持 AP
  75.       AP = /<AP\s*(\d+)>/i
  76.     end
  77.   end
  78. end

  79. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  80. #==============================================================================
  81. # □ KGC::Commands
  82. #==============================================================================

  83. module KGC
  84. module Commands
  85.   module_function
  86.   #--------------------------------------------------------------------------
  87.   # ○ AP の獲得
  88.   #     actor_id : アクター ID
  89.   #     ap       : 獲得 AP
  90.   #     show     : マスター表示フラグ
  91.   #--------------------------------------------------------------------------
  92.   def gain_actor_ap(actor_id, ap, show = false)
  93.     $game_actors[actor_id].gain_ap(ap, show)
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ○ AP の変更
  97.   #     actor_id : アクター ID
  98.   #     skill_id : スキル ID
  99.   #     ap       : AP
  100.   #--------------------------------------------------------------------------
  101.   def change_actor_ap(actor_id, skill_id, ap)
  102.     skill = $data_skills[skill_id]
  103.     return if skill == nil
  104.     $game_actors[actor_id].change_ap(skill, ap)

  105.     $game_actors[actor_id].restore_passive_rev if $imported["PassiveSkill"]
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ○ AP ビューアの呼び出し
  109.   #     actor_index : アクターインデックス
  110.   #--------------------------------------------------------------------------
  111.   def call_ap_viewer(actor_index = 0)
  112.     return if $game_temp.in_battle
  113.     $game_temp.next_scene = :ap_viewer
  114.     $game_temp.next_scene_actor_index = actor_index
  115.   end
  116. end
  117. end

  118. class Game_Interpreter
  119.   include KGC::Commands
  120. end

  121. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  122. #==============================================================================
  123. # ■ Vocab
  124. #==============================================================================

  125. module Vocab
  126.   # 戦闘終了メッセージ
  127.   ObtainAP              = KGC::EquipLearnSkill::VOCAB_RESULT_OBTAIN_AP
  128.   ResultFullAPSkill     = KGC::EquipLearnSkill::VOCAB_RESULT_MASTER_SKILL
  129.   ResultFullAPSkillName = KGC::EquipLearnSkill::VOCAB_RESULT_MASTER_SKILL_NAME

  130.   # AP
  131.   def self.ap
  132.     return KGC::EquipLearnSkill::VOCAB_AP
  133.   end

  134.   # マスターしたスキル
  135.   def self.full_ap_skill
  136.     return KGC::EquipLearnSkill::VOCAB_MASTER_SKILL
  137.   end

  138.   # AP ビューア
  139.   def self.ap_viewer
  140.     return KGC::EquipLearnSkill::VOCAB_MENU_AP_VIEWER
  141.   end
  142. end

  143. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  144. #==============================================================================
  145. # ■ RPG::BaseItem
  146. #==============================================================================

  147. class RPG::BaseItem
  148.   #--------------------------------------------------------------------------
  149.   # ○ スキル習得装備のキャッシュ生成
  150.   #--------------------------------------------------------------------------
  151.   def create_equip_learn_skill_cache
  152.     @__learn_skills = []

  153.     self.note.each_line { |line|
  154.       if line =~ KGC::EquipLearnSkill::Regexp::BaseItem::LEARN_SKILL
  155.         # スキル習得
  156.         $1.scan(/\d+/).each { |num|
  157.           skill_id = num.to_i
  158.           # 存在するスキルならリストに加える
  159.           @__learn_skills << skill_id if $data_skills[skill_id] != nil
  160.         }
  161.       end
  162.     }
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ○ 習得するスキル ID の配列
  166.   #--------------------------------------------------------------------------
  167.   def learn_skills
  168.     create_equip_learn_skill_cache if @__learn_skills == nil
  169.     return @__learn_skills
  170.   end
  171. end

  172. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  173. #==============================================================================
  174. # ■ RPG::Skill
  175. #==============================================================================

  176. class RPG::Skill < RPG::UsableItem
  177.   #--------------------------------------------------------------------------
  178.   # ○ クラス変数
  179.   #--------------------------------------------------------------------------
  180.   @@__masked_name =
  181.     KGC::EquipLearnSkill::ZERO_AP_NAME_MASK  # マスク名
  182.   @@__expand_masked_name = false             # マスク名拡張表示フラグ

  183.   if @@__expand_masked_name != nil
  184.     @@__expand_masked_name = (@@__masked_name.scan(/./).size == 1)
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ○ スキル習得装備のキャッシュ生成
  188.   #--------------------------------------------------------------------------
  189.   def create_equip_learn_skill_cache
  190.     @__need_ap = 0

  191.     self.note.each_line { |line|
  192.       if line =~ KGC::EquipLearnSkill::Regexp::Skill::NEED_AP  # 必要 AP
  193.         @__need_ap = $1.to_i
  194.       end
  195.     }
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ○ マスク名
  199.   #--------------------------------------------------------------------------
  200.   def masked_name
  201.     if KGC::EquipLearnSkill::MASK_ZERO_AP_SKILL_NAME
  202.       if @@__expand_masked_name
  203.         # マスク名を拡張して表示
  204.         return @@__masked_name * self.name.scan(/./).size
  205.       else
  206.         return @@__masked_name
  207.       end
  208.     else
  209.       return self.name
  210.     end
  211.   end
  212.   #--------------------------------------------------------------------------
  213.   # ○ 習得に必要な AP
  214.   #--------------------------------------------------------------------------
  215.   def need_ap
  216.     create_equip_learn_skill_cache if @__need_ap == nil
  217.     return @__need_ap
  218.   end
  219. end

  220. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  221. #==============================================================================
  222. # ■ RPG::Enemy
  223. #==============================================================================

  224. class RPG::Enemy
  225.   #--------------------------------------------------------------------------
  226.   # ○ スキル習得装備のキャッシュ生成
  227.   #--------------------------------------------------------------------------
  228.   def create_equip_learn_skill_cache
  229.     @__ap = KGC::EquipLearnSkill::DEFAULT_AP

  230.     self.note.each_line { |line|
  231.       if line =~ KGC::EquipLearnSkill::Regexp::Enemy::AP  # 所持 AP
  232.         @__ap = $1.to_i
  233.       end
  234.     }
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ○ 所持 AP
  238.   #--------------------------------------------------------------------------
  239.   def ap
  240.     create_equip_learn_skill_cache if @__ap == nil
  241.     return @__ap
  242.   end
  243. end

  244. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  245. #==============================================================================
  246. # ■ Game_Temp
  247. #==============================================================================

  248. unless $imported["CustomMenuCommand"]
  249. class Game_Temp
  250.   #--------------------------------------------------------------------------
  251.   # ● 公開インスタンス変数
  252.   #--------------------------------------------------------------------------
  253.   attr_accessor :next_scene_actor_index   # 次のシーンのアクターインデックス
  254.   #--------------------------------------------------------------------------
  255.   # ● オブジェクト初期化
  256.   #--------------------------------------------------------------------------
  257.   alias initialize_KGC_EquipLearnSkill initialize
  258.   def initialize
  259.     initialize_KGC_EquipLearnSkill

  260.     @next_scene_actor_index = 0
  261.   end
  262. end
  263. end

  264. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  265. #==============================================================================
  266. # ■ Game_Actor
  267. #==============================================================================

  268. class Game_Actor < Game_Battler
  269.   #--------------------------------------------------------------------------
  270.   # ● セットアップ
  271.   #     actor_id : アクター ID
  272.   #--------------------------------------------------------------------------
  273.   alias setup_KGC_EquipLearnSkill setup
  274.   def setup(actor_id)
  275.     setup_KGC_EquipLearnSkill(actor_id)

  276.     @skill_ap = []
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ○ 指定スキルの AP 取得
  280.   #     skill_id : スキル ID
  281.   #--------------------------------------------------------------------------
  282.   def skill_ap(skill_id)
  283.     @skill_ap = [] if @skill_ap == nil
  284.     return (@skill_ap[skill_id] != nil ? @skill_ap[skill_id] : 0)
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ○ AP 変更
  288.   #     skill : スキル
  289.   #     ap    : 新しい AP
  290.   #--------------------------------------------------------------------------
  291.   def change_ap(skill, ap)
  292.     @skill_ap = [] if @skill_ap == nil
  293.     @skill_ap[skill.id] = [[ap, skill.need_ap].min, 0].max
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # ○ マスターしたスキルの表示
  297.   #     new_skills : 新しくマスターしたスキルの配列
  298.   #--------------------------------------------------------------------------
  299.   def display_full_ap_skills(new_skills)
  300.     $game_message.new_page
  301.     text = sprintf(Vocab::ResultFullAPSkill, name)
  302.     $game_message.texts.push(text)
  303.     new_skills.each { |skill|
  304.       text = sprintf(Vocab::ResultFullAPSkillName, skill.name)
  305.       $game_message.texts.push(text)
  306.     }
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # ○ AP 獲得
  310.   #     ap   : AP の増加量
  311.   #     show : マスタースキル表示フラグ
  312.   #--------------------------------------------------------------------------
  313.   def gain_ap(ap, show)
  314.     last_full_ap_skills = full_ap_skills

  315.     # 装備品により習得しているスキルに AP を加算
  316.     equipment_skills(true).each { |skill|
  317.       change_ap(skill, skill_ap(skill.id) + ap)
  318.     }
  319.     restore_passive_rev if $imported["PassiveSkill"]

  320.     # マスターしたスキルを表示
  321.     if show && last_full_ap_skills != full_ap_skills
  322.       display_full_ap_skills(full_ap_skills - last_full_ap_skills)
  323.     end
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● スキルオブジェクトの配列取得
  327.   #--------------------------------------------------------------------------
  328.   alias skills_KGC_EquipLearnSkill skills
  329.   def skills
  330.     result = skills_KGC_EquipLearnSkill

  331.     # 装備品と AP 蓄積済みのスキルを追加
  332.     additional_skills = equipment_skills | full_ap_skills
  333.     return (result | additional_skills).sort_by { |s| s.id }
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ○ 装備品の習得スキル取得
  337.   #     all : 使用不可能なスキルも含める
  338.   #--------------------------------------------------------------------------
  339.   def equipment_skills(all = false)
  340.     result = []
  341.     equips.compact.each { |item|
  342.       next unless include_learnable_equipment?(item)        # 除外装備は無視

  343.       item.learn_skills.each { |i|
  344.         skill = $data_skills[i]
  345.         next unless include_equipment_skill?(skill)          # 除外スキルは無視
  346.         if !all && KGC::EquipLearnSkill::NEED_FULL_AP        # 要蓄積の場合
  347.           next unless skill.need_ap == 0 || ap_full?(skill)    # 未達成なら無視
  348.         end
  349.         result << skill
  350.       }
  351.     }
  352.     return result
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ○ スキル習得装備除外判定
  356.   #     item : 判定装備
  357.   #--------------------------------------------------------------------------
  358.   def include_learnable_equipment?(item)
  359.     return false unless item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor)
  360.     return false unless equippable?(item)

  361.     case item
  362.     when RPG::Weapon  # 武器
  363.       # 除外武器に含まれている場合
  364.       if KGC::EquipLearnSkill::EXCLUDE_WEAPONS[id] != nil &&
  365.           KGC::EquipLearnSkill::EXCLUDE_WEAPONS[id].include?(item.id)
  366.         return false
  367.       end
  368.     when RPG::Armor   # 防具
  369.       # 除外防具に含まれている場合
  370.       if KGC::EquipLearnSkill::EXCLUDE_ARMORS[id] != nil &&
  371.           KGC::EquipLearnSkill::EXCLUDE_ARMORS[id].include?(item.id)
  372.         return false
  373.       end
  374.     end

  375.     return true
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ○ 装備品による習得スキル除外判定
  379.   #     skill : スキル
  380.   #--------------------------------------------------------------------------
  381.   def include_equipment_skill?(skill)
  382.     # 自身が除外されている場合
  383.     if KGC::EquipLearnSkill::EXCLUDE_SKILLS[id] != nil &&
  384.         KGC::EquipLearnSkill::EXCLUDE_SKILLS[id].include?(skill.id)
  385.       return false
  386.     end

  387.     return true
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # ○ AP 蓄積済みのスキルを取得
  391.   #--------------------------------------------------------------------------
  392.   def full_ap_skills
  393.     result = []
  394.     (1...$data_skills.size).each { |i|
  395.       skill = $data_skills[i]
  396.       result << skill if ap_full?(skill) && include_equipment_skill?(skill)
  397.     }
  398.     return result
  399.   end
  400.   #--------------------------------------------------------------------------
  401.   # ○ AP 蓄積可能なスキルを取得
  402.   #--------------------------------------------------------------------------
  403.   def can_gain_ap_skills
  404.     result = []
  405.     equips.compact.each { |item|
  406.       next unless include_learnable_equipment?(item)  # 除外装備なら無視

  407.       item.learn_skills.each { |i|
  408.         skill = $data_skills[i]
  409.         next unless include_equipment_skill?(skill)   # 除外スキルなら無視
  410.         result << skill
  411.       }
  412.     }
  413.     return (result - full_ap_skills)              # マスターしたものを除く
  414.   end
  415.   #--------------------------------------------------------------------------
  416.   # ○ AP 蓄積済み判定
  417.   #     skill : スキル
  418.   #--------------------------------------------------------------------------
  419.   def ap_full?(skill)
  420.     return false unless skill.is_a?(RPG::Skill)   # スキル以外
  421.     return false if skill.need_ap == 0            # 必要 AP が 0
  422.     return true  if @skills.include?(skill.id)    # 習得済み

  423.     return (skill_ap(skill.id) >= skill.need_ap)
  424.   end
  425.   #--------------------------------------------------------------------------
  426.   # ● スキルの使用可能判定
  427.   #     skill : スキル
  428.   #--------------------------------------------------------------------------
  429.   def skill_can_use?(skill)
  430.     return super
  431.   end
  432. end

  433. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  434. #==============================================================================
  435. # ■ Game_Enemy
  436. #==============================================================================

  437. class Game_Enemy < Game_Battler
  438.   #--------------------------------------------------------------------------
  439.   # ○ AP の取得
  440.   #--------------------------------------------------------------------------
  441.   def ap
  442.     return enemy.ap
  443.   end
  444. end

  445. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  446. #==============================================================================
  447. # ■ Game_Troop
  448. #==============================================================================

  449. class Game_Troop < Game_Unit
  450.   #--------------------------------------------------------------------------
  451.   # ○ AP の合計計算
  452.   #--------------------------------------------------------------------------
  453.   def ap_total
  454.     ap = 0
  455.     for enemy in dead_members
  456.       ap += enemy.ap unless enemy.hidden
  457.     end
  458.     return ap
  459.   end
  460. end

  461. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  462. #==============================================================================
  463. # ■ Window_Command
  464. #==============================================================================

  465. class Window_Command < Window_Selectable
  466.   unless method_defined?(:add_command)
  467.   #--------------------------------------------------------------------------
  468.   # ○ コマンドを追加
  469.   #    追加した位置を返す
  470.   #--------------------------------------------------------------------------
  471.   def add_command(command)
  472.     @commands << command
  473.     @item_max = @commands.size
  474.     item_index = @item_max - 1
  475.     refresh_command
  476.     draw_item(item_index)
  477.     return item_index
  478.   end
  479.   #--------------------------------------------------------------------------
  480.   # ○ コマンドをリフレッシュ
  481.   #--------------------------------------------------------------------------
  482.   def refresh_command
  483.     buf = self.contents.clone
  484.     self.height = [self.height, row_max * WLH + 32].max
  485.     create_contents
  486.     self.contents.blt(0, 0, buf, buf.rect)
  487.     buf.dispose
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # ○ コマンドを挿入
  491.   #--------------------------------------------------------------------------
  492.   def insert_command(index, command)
  493.     @commands.insert(index, command)
  494.     @item_max = @commands.size
  495.     refresh_command
  496.     refresh
  497.   end
  498.   #--------------------------------------------------------------------------
  499.   # ○ コマンドを削除
  500.   #--------------------------------------------------------------------------
  501.   def remove_command(command)
  502.     @commands.delete(command)
  503.     @item_max = @commands.size
  504.     refresh
  505.   end
  506.   end
  507. end

  508. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  509. #==============================================================================
  510. # □ Window_APViewer
  511. #------------------------------------------------------------------------------
  512. #  AP ビューアでスキルを表示するウィンドウです。
  513. #==============================================================================

  514. class Window_APViewer < Window_Selectable
  515.   #--------------------------------------------------------------------------
  516.   # ● オブジェクト初期化
  517.   #     x      : ウィンドウの X 座標
  518.   #     y      : ウィンドウの Y 座標
  519.   #     width  : ウィンドウの幅
  520.   #     height : ウィンドウの高さ
  521.   #     actor  : アクター
  522.   #--------------------------------------------------------------------------
  523.   def initialize(x, y, width, height, actor)
  524.     super(x, y, width, height)
  525.     @actor = actor
  526.     @can_gain_ap_skills = []
  527.     @equipment_skills   = []
  528.     self.index = 0
  529.     refresh
  530.   end
  531.   #--------------------------------------------------------------------------
  532.   # ○ スキルの取得
  533.   #--------------------------------------------------------------------------
  534.   def skill
  535.     return @data[self.index]
  536.   end
  537.   #--------------------------------------------------------------------------
  538.   # ○ リフレッシュ
  539.   #--------------------------------------------------------------------------
  540.   def refresh
  541.     @data = []
  542.     @can_gain_ap_skills = @actor.can_gain_ap_skills
  543.     @equipment_skills   = @actor.equipment_skills(true)

  544.     (1...$data_skills.size).each { |i|
  545.       skill = $data_skills[i]
  546.       @data << skill if include?(skill)
  547.     }
  548.     @item_max = @data.size
  549.     create_contents
  550.     @item_max.times { |i| draw_item(i) }
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # ○ 項目の描画
  554.   #     index : 項目番号
  555.   #--------------------------------------------------------------------------
  556.   def draw_item(index)
  557.     rect = item_rect(index)
  558.     self.contents.clear_rect(rect)
  559.     skill = @data[index]
  560.     if skill != nil
  561.       rect.width -= 4
  562.       draw_item_name(skill, rect.x, rect.y, enable?(skill))
  563.       if @actor.ap_full?(skill) || @actor.skill_learn?(skill)
  564.         # マスター
  565.         text = Vocab.full_ap_skill
  566.       else
  567.         # AP 蓄積中
  568.         text = sprintf("%s %4d/%4d",
  569.           Vocab.ap, @actor.skill_ap(skill.id), skill.need_ap)
  570.       end
  571.       # AP を描画
  572.       self.contents.font.color = normal_color
  573.       self.contents.draw_text(rect, text, 2)
  574.     end
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ○ スキルをリストに含めるか
  578.   #     skill : スキル
  579.   #--------------------------------------------------------------------------
  580.   def include?(skill)
  581.     return false if skill.need_ap == 0
  582.     unless KGC::EquipLearnSkill::SHOW_ZERO_AP_SKILL
  583.       # AP が 0 、かつ装備品で習得していない
  584.       if @actor.skill_ap(skill.id) == 0 && !@equipment_skills.include?(skill)
  585.         return false
  586.       end
  587.     end

  588.     return true
  589.   end
  590.   #--------------------------------------------------------------------------
  591.   # ○ スキルを有効状態で表示するかどうか
  592.   #     skill : スキル
  593.   #--------------------------------------------------------------------------
  594.   def enable?(skill)
  595.     return true if @actor.skill_learn?(skill)           # 習得済み
  596.     return true if @actor.ap_full?(skill)               # マスター
  597.     return true if @can_gain_ap_skills.include?(skill)  # AP 蓄積可能

  598.     return false
  599.   end
  600.   #--------------------------------------------------------------------------
  601.   # ○ スキルをマスク表示するかどうか
  602.   #     skill : スキル
  603.   #--------------------------------------------------------------------------
  604.   def mask?(skill)
  605.     return false if @actor.skill_learn?(skill)           # 習得済み
  606.     return false if @actor.skill_ap(skill.id) > 0        # AP が 1 以上
  607.     return false if @can_gain_ap_skills.include?(skill)  # AP 蓄積可能

  608.     return true
  609.   end
  610.   #--------------------------------------------------------------------------
  611.   # ● アイテム名の描画
  612.   #     item    : アイテム (スキル、武器、防具でも可)
  613.   #     x       : 描画先 X 座標
  614.   #     y       : 描画先 Y 座標
  615.   #     enabled : 有効フラグ。false のとき半透明で描画
  616.   #--------------------------------------------------------------------------
  617.   def draw_item_name(item, x, y, enabled = true)
  618.     draw_icon(item.icon_index, x, y, enabled)
  619.     self.contents.font.color = normal_color
  620.     self.contents.font.color.alpha = enabled ? 255 : 128
  621.     self.contents.draw_text(x + 24, y, 172, WLH,
  622.       mask?(item) ? item.masked_name : item.name)
  623.   end
  624.   #--------------------------------------------------------------------------
  625.   # ● カーソルを 1 ページ後ろに移動
  626.   #--------------------------------------------------------------------------
  627.   def cursor_pagedown
  628.     return if Input.repeat?(Input::R)
  629.     super
  630.   end
  631.   #--------------------------------------------------------------------------
  632.   # ● カーソルを 1 ページ前に移動
  633.   #--------------------------------------------------------------------------
  634.   def cursor_pageup
  635.     return if Input.repeat?(Input::L)
  636.     super
  637.   end
  638.   #--------------------------------------------------------------------------
  639.   # ● フレーム更新
  640.   #--------------------------------------------------------------------------
  641.   def update
  642.     last_index = @index
  643.     super
  644.     return unless self.active

  645.     if Input.repeat?(Input::RIGHT)
  646.       cursor_pagedown
  647.     elsif Input.repeat?(Input::LEFT)
  648.       cursor_pageup
  649.     end
  650.     if @index != last_index
  651.       Sound.play_cursor
  652.     end
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # ● ヘルプテキスト更新
  656.   #--------------------------------------------------------------------------
  657.   def update_help
  658.     if KGC::EquipLearnSkill::HIDE_ZERO_AP_SKILL_HELP && mask?(skill)
  659.       @help_window.set_text(KGC::EquipLearnSkill::ZERO_AP_SKILL_HELP)
  660.     else
  661.       @help_window.set_text(skill == nil ? "" : skill.description)
  662.     end
  663.   end
  664. end

  665. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  666. #==============================================================================
  667. # ■ Scene_Map
  668. #==============================================================================

  669. class Scene_Map < Scene_Base
  670.   #--------------------------------------------------------------------------
  671.   # ● 画面切り替えの実行
  672.   #--------------------------------------------------------------------------
  673.   alias update_scene_change_KGC_EquipLearnSkill update_scene_change
  674.   def update_scene_change
  675.     return if $game_player.moving?    # プレイヤーの移動中?

  676.     if $game_temp.next_scene == :ap_viewer
  677.       call_ap_viewer
  678.       return
  679.     end

  680.     update_scene_change_KGC_EquipLearnSkill
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # ○ AP ビューアへの切り替え
  684.   #--------------------------------------------------------------------------
  685.   def call_ap_viewer
  686.     $game_temp.next_scene = nil
  687.     $scene = Scene_APViewer.new($game_temp.next_scene_actor_index,
  688.       0, Scene_APViewer::HOST_MAP)
  689.   end
  690. end

  691. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  692. #==============================================================================
  693. # ■ Scene_Menu
  694. #==============================================================================

  695. class Scene_Menu < Scene_Base
  696.   if KGC::EquipLearnSkill::USE_MENU_AP_VIEWER_COMMAND
  697.   #--------------------------------------------------------------------------
  698.   # ● コマンドウィンドウの作成
  699.   #--------------------------------------------------------------------------
  700.   alias create_command_window_KGC_EquipLearnSkill create_command_window
  701.   def create_command_window
  702.     create_command_window_KGC_EquipLearnSkill

  703.     return if $imported["CustomMenuCommand"]

  704.     @__command_ap_viewer_index = @command_window.add_command(Vocab.ap_viewer)
  705.     if @command_window.oy > 0
  706.       @command_window.oy -= Window_Base::WLH
  707.     end
  708.     @command_window.index = @menu_index
  709.   end
  710.   end
  711.   #--------------------------------------------------------------------------
  712.   # ● コマンド選択の更新
  713.   #--------------------------------------------------------------------------
  714.   alias update_command_selection_KGC_EquipLearnSkill update_command_selection
  715.   def update_command_selection
  716.     call_ap_viewer_flag = false
  717.     if Input.trigger?(Input::C)
  718.       case @command_window.index
  719.       when @__command_ap_viewer_index  # AP ビューア
  720.         call_ap_viewer_flag = true
  721.       end
  722.     end

  723.     # AP ビューアに移行
  724.     if call_ap_viewer_flag
  725.       if $game_party.members.size == 0
  726.         Sound.play_buzzer
  727.         return
  728.       end
  729.       Sound.play_decision
  730.       start_actor_selection
  731.       return
  732.     end

  733.     update_command_selection_KGC_EquipLearnSkill
  734.   end
  735.   #--------------------------------------------------------------------------
  736.   # ● アクター選択の更新
  737.   #--------------------------------------------------------------------------
  738.   alias update_actor_selection_KGC_EquipLearnSkill update_actor_selection
  739.   def update_actor_selection
  740.     if Input.trigger?(Input::C)
  741.       $game_party.last_actor_index = @status_window.index
  742.       Sound.play_decision
  743.       case @command_window.index
  744.       when @__command_ap_viewer_index  # AP ビューア
  745.         $scene = Scene_APViewer.new(@status_window.index,
  746.           @__command_ap_viewer_index, Scene_APViewer::HOST_MENU)
  747.         return
  748.       end
  749.     end

  750.     update_actor_selection_KGC_EquipLearnSkill
  751.   end
  752. end

  753. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  754. #==============================================================================
  755. # □ Scene_APViewer
  756. #------------------------------------------------------------------------------
  757. #   AP ビューアの処理を行うクラスです。
  758. #==============================================================================

  759. class Scene_APViewer < Scene_Base
  760.   HOST_MENU   = 0
  761.   HOST_MAP    = 1
  762.   #--------------------------------------------------------------------------
  763.   # ● オブジェクト初期化
  764.   #     actor_index : アクターインデックス
  765.   #     menu_index  : コマンドのカーソル初期位置
  766.   #     host_scene  : 呼び出し元 (0..メニュー  1..マップ)
  767.   #--------------------------------------------------------------------------
  768.   def initialize(actor_index = 0, menu_index = 0, host_scene = HOST_MENU)
  769.     @actor_index = actor_index
  770.     @menu_index = menu_index
  771.     @host_scene = host_scene
  772.   end
  773.   #--------------------------------------------------------------------------
  774.   # ● 開始処理
  775.   #--------------------------------------------------------------------------
  776.   def start
  777.     super
  778.     create_menu_background
  779.     @actor = $game_party.members[@actor_index]
  780.     @help_window = Window_Help.new
  781.     if $imported["HelpExtension"]
  782.       @help_window.row_max = KGC::HelpExtension::ROW_MAX
  783.     end
  784.     @status_window = Window_SkillStatus.new(0, @help_window.height, @actor)
  785.     dy = @help_window.height + @status_window.height
  786.     @skill_window = Window_APViewer.new(0, dy,
  787.       Graphics.width, Graphics.height - dy, @actor)
  788.     @skill_window.help_window = @help_window
  789.   end
  790.   #--------------------------------------------------------------------------
  791.   # ● 終了処理
  792.   #--------------------------------------------------------------------------
  793.   def terminate
  794.     super
  795.     dispose_menu_background
  796.     @help_window.dispose
  797.     @status_window.dispose
  798.     @skill_window.dispose
  799.   end
  800.   #--------------------------------------------------------------------------
  801.   # ○ 元の画面へ戻る
  802.   #--------------------------------------------------------------------------
  803.   def return_scene
  804.     case @host_scene
  805.     when HOST_MENU
  806.       $scene = Scene_Menu.new(@menu_index)
  807.     when HOST_MAP
  808.       $scene = Scene_Map.new
  809.     end
  810.   end
  811.   #--------------------------------------------------------------------------
  812.   # ○ 次のアクターの画面に切り替え
  813.   #--------------------------------------------------------------------------
  814.   def next_actor
  815.     @actor_index += 1
  816.     @actor_index %= $game_party.members.size
  817.     $scene = Scene_APViewer.new(@actor_index, @menu_index, @host_scene)
  818.   end
  819.   #--------------------------------------------------------------------------
  820.   # ○ 前のアクターの画面に切り替え
  821.   #--------------------------------------------------------------------------
  822.   def prev_actor
  823.     @actor_index += $game_party.members.size - 1
  824.     @actor_index %= $game_party.members.size
  825.     $scene = Scene_APViewer.new(@actor_index, @menu_index, @host_scene)
  826.   end
  827.   #--------------------------------------------------------------------------
  828.   # ● フレーム更新
  829.   #--------------------------------------------------------------------------
  830.   def update
  831.     super
  832.     update_menu_background
  833.     @help_window.update
  834.     @skill_window.update
  835.     @status_window.update
  836.     if @skill_window.active
  837.       update_skill_selection
  838.     end
  839.   end
  840.   #--------------------------------------------------------------------------
  841.   # ○ スキル選択の更新
  842.   #--------------------------------------------------------------------------
  843.   def update_skill_selection
  844.     if Input.trigger?(Input::B)
  845.       Sound.play_cancel
  846.       return_scene
  847.     elsif Input.trigger?(Input::R)
  848.       Sound.play_cursor
  849.       next_actor
  850.     elsif Input.trigger?(Input::L)
  851.       Sound.play_cursor
  852.       prev_actor
  853.     end
  854.   end
  855. end

  856. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  857. #==============================================================================
  858. # ■ Scene_Battle
  859. #==============================================================================

  860. class Scene_Battle < Scene_Base
  861.   #--------------------------------------------------------------------------
  862.   # ● メッセージ表示が終わるまでウェイト
  863.   #--------------------------------------------------------------------------
  864.   alias wait_for_message_KGC_EquipLearnSkill wait_for_message
  865.   def wait_for_message
  866.     return if @ignore_wait_for_message  # メッセージ終了までのウェイトを無視

  867.     wait_for_message_KGC_EquipLearnSkill
  868.   end
  869.   #--------------------------------------------------------------------------
  870.   # ● 獲得した経験値とお金の表示
  871.   #--------------------------------------------------------------------------
  872.   alias display_exp_and_gold_KGC_EquipLearnSkill display_exp_and_gold
  873.   def display_exp_and_gold
  874.     @ignore_wait_for_message = true

  875.     display_exp_and_gold_KGC_EquipLearnSkill

  876.     display_ap
  877.     @ignore_wait_for_message = false
  878.     wait_for_message
  879.   end
  880.   #--------------------------------------------------------------------------
  881.   # ● レベルアップの表示
  882.   #--------------------------------------------------------------------------
  883.   alias display_level_up_KGC_EquipLearnSkill display_level_up
  884.   def display_level_up
  885.     display_level_up_KGC_EquipLearnSkill

  886.     display_master_equipment_skill
  887.   end
  888.   #--------------------------------------------------------------------------
  889.   # ○ 獲得 AP の表示
  890.   #--------------------------------------------------------------------------
  891.   def display_ap
  892.     ap = $game_troop.ap_total
  893.     if ap > 0
  894.       text = sprintf(Vocab::ObtainAP, ap)
  895.       $game_message.texts.push('\.' + text)
  896.     end
  897.     wait_for_message
  898.   end
  899.   #--------------------------------------------------------------------------
  900.   # ○ マスターしたスキルの表示
  901.   #--------------------------------------------------------------------------
  902.   def display_master_equipment_skill
  903.     ap = $game_troop.ap_total
  904.     $game_party.existing_members.each { |actor|
  905.       last_skills = actor.skills
  906.       actor.gain_ap(ap, true)
  907.     }
  908.     wait_for_message
  909.   end
  910. end
复制代码

Lv1.梦旅人

穿越一季:朔

梦石
0
星屑
50
在线时间
333 小时
注册时间
2007-4-11
帖子
5369

贵宾

2
发表于 2010-9-13 14:32:54 | 只看该作者
当地球村还有汉化翻译的时候这个完全可以悬赏求翻译的
6R复活?别扯淡了.

柳柳一旦接手66RPG,我果断呵呵啊。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-21 22:06

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表