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

Project1

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

[已经解决] 扩张状态画面的一个问题

 关闭 [复制链接]

Lv3.寻梦者

梦石
0
星屑
1010
在线时间
226 小时
注册时间
2010-4-16
帖子
87
跳转到指定楼层
1
发表于 2011-7-23 19:51:15 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
http://ytomy.sakura.ne.jp/tkool/rpgtech/php/tech.php?tool=VX&cat=tech_vx/menu&tech=extended_status_scene
这个网站得脚本
问:怎么把人物介绍去掉!!


以下是脚本:
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  2. #_/    ◆ 拡張ステータス画面 - KGC_ExtendedStatusScene ◆ VX ◆
  3. #_/    ◇ Last update : 2009/09/26 ◇
  4. #_/----------------------------------------------------------------------------
  5. #_/  ステータス画面に表示する内容を詳細化します。
  6. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

  7. $data_states = load_data("Data/States.rvdata") if $data_states == nil
  8. $data_system = load_data("Data/System.rvdata") if $data_system == nil

  9. #==============================================================================
  10. # ★ カスタマイズ項目 - Customize BEGIN ★
  11. #==============================================================================

  12. module KGC
  13. module ExtendedStatusScene
  14.   # ◆ プロフィール
  15.   PROFILE = []
  16.   # ここから下に
  17.   #  PROFILE[アクターID] = 'プロフィール'
  18.   # という書式で設定。
  19.   # 改行する場合は、改行したい位置に \| を入力。
  20.   PROFILE[1] =
  21.     'Name: \N[1]\|'


  22.   # ◆ コマンド
  23.   #  コマンドを表示したい順に記述。
  24.   #  表示したくないコマンドは省略可 (0 個はダメ)。
  25.   #   :param          .. パラメータ
  26.   #   :resist         .. 属性/ステート耐性
  27.   #   :element_resist .. 属性耐性
  28.   #   :state_resist   .. ステート耐性
  29.   #   :profile        .. プロフィール
  30.   COMMANDS = [:param, :element_resist, :state_resist, :profile]

  31.   # ◆ コマンド名
  32.   COMMAND_NAME = {
  33.     :param          => "能力値",
  34.     :resist         => "耐性",
  35.     :element_resist => "属性耐性",
  36.     :state_resist   => "效果耐性",
  37.     :profile        => "人物介绍",
  38.   }

  39.   # ◆ 表示するパラメータ
  40.   #  :param ページに表示したい順に記述。
  41.   #  表示したくない項目は省略可。
  42.   #   :atk .. 攻撃力
  43.   #   :def .. 防御力
  44.   #   :spi .. 精神力
  45.   #   :agi .. 敏捷性
  46.   #   :hit .. 命中率
  47.   #   :eva .. 回避率
  48.   #   :cri .. クリティカル率
  49.   #   :cp  .. CP (≪スキルCP制≫ に対応)
  50.   #   :ep  .. EP (≪装備拡張≫ に対応)
  51.   PARAMS = [:atk, :def, :spi, :agi, :hit, :eva, :cri, :cp, :ep]

  52.   # ◆ パラメータ名
  53.   #  :param, :resist コマンドで使用。
  54.   PARAMETER_NAME = {
  55.     # :param 用
  56.     :hit => "命中率",
  57.     :eva => "回避率",
  58.     :cri => "暴击率",
  59.     # :resist 用
  60.     :element_resist => "属性耐性",
  61.     :state_resist   => "状态耐性",
  62.   }  # ← これは消さないこと!

  63.   # ◆ 属性耐性の表記方法
  64.   #   0 .. 数値
  65.   #   1 .. チャート
  66.   #   2 .. チャート&数値 (:resist はチャートのみ)
  67.   #  1, 2 は ≪ビットマップ拡張≫ が必要。
  68.   RESIST_STYLE = 2
  69.   # ◆ 耐性の数値
  70.   #   0 .. 属性: 100 で通常、99 以下は軽減 (マイナスは吸収)、101 以上は弱点
  71.   #        ステート: 付加成功率 (かかりやすさ)
  72.   #   1 .. 属性: 0 で通常、プラスは軽減 (101 以上は吸収)、マイナスは弱点
  73.   #        ステート: 付加回避率 (かかりにくさ)
  74.   RESIST_NUM_STYLE = 1

  75.   # ◆ チャート色
  76.   CHART_LINE_COLOR  = Color.new(128, 255, 128)  # ライン色
  77.   CHART_BASE_COLOR  = Color.new(128, 192, 255)  # ベース色
  78.   CHART_FLASH_COLOR = Color.new(128, 255, 128)  # フラッシュ色
  79.   # ◆ チャートをなめらかにする
  80.   #   true  : 高品質、低速
  81.   #   false : 低品質、高速
  82.   CHART_HIGHQUALITY = true

  83.   # ~ 以下の項目は ≪モンスター図鑑≫ と互換性があります。 ~
  84.   # ~ ≪モンスター図鑑≫ 側の設定をコピーしても構いません。~

  85.   # ◆ 属性耐性を調べる範囲
  86.   #  耐性を調べる属性の ID を配列に格納。
  87.   #  .. や ... を使用した範囲指定も可能。
  88.   ELEMENT_RANGE = [1..16]
  89.   # ◆ 属性のアイコン
  90.   #  各属性に対応するアイコンの番号を指定。
  91.   #  配列の添字が属性 ID に対応。
  92.   #  (最初が属性 ID: 0 に対応、あとは ID: 1, 2, 3, ... の順)
  93.   ELEMENT_ICON = [0,                         # ID: 0 はダミー (未使用)
  94.      50,   1,   4,  14,  24,  12, 189, 136,  # ID: 1 ~  8
  95.     104, 105, 106, 107, 108, 109, 110, 111,  # ID: 9 ~ 16
  96.   ]  # ← これは消さないこと!

  97.   # ◆ ステート耐性を調べる範囲
  98.   #  耐性を調べるステートの ID を配列に格納。
  99.   #  記述方法は ELEMENT_RANGE と同様。
  100.   STATE_RANGE = [1...12,16...25,]#$data_states.size
  101. end
  102. end

  103. #==============================================================================
  104. # ☆ カスタマイズ項目 終了 - Customize END ☆
  105. #==============================================================================

  106. $imported = {} if $imported == nil
  107. $imported["ExtendedStatusScene"] = true

  108. module KGC::ExtendedStatusScene
  109.   module_function
  110.   #--------------------------------------------------------------------------
  111.   # ○ Range と Integer の配列を Integer の配列に変換 (重複要素は排除)
  112.   #--------------------------------------------------------------------------
  113.   def convert_integer_array(array, type = nil)
  114.     result = []
  115.     array.each { |i|
  116.       case i
  117.       when Range
  118.         result |= i.to_a
  119.       when Integer
  120.         result |= [i]
  121.       end
  122.     }
  123.     case type
  124.     when :element
  125.       result.delete_if { |x| x >= $data_system.elements.size }
  126.     when :state
  127.       result.delete_if { |x|
  128.         x >= $data_states.size ||
  129.         $data_states[x].nonresistance ||
  130.         $data_states[x].priority == 0
  131.       }
  132.     end
  133.     return result
  134.   end

  135.   # チェックする属性リスト
  136.   CHECK_ELEMENT_LIST = convert_integer_array(ELEMENT_RANGE, :element)
  137.   # チェックするステートリスト
  138.   CHECK_STATE_LIST   = convert_integer_array(STATE_RANGE, :state)

  139.   # 耐性表記方法
  140.   case RESIST_STYLE
  141.   when 0
  142.     RESIST_STYLE_SYMBOL = :num
  143.   when 1
  144.     RESIST_STYLE_SYMBOL = :chart
  145.   else
  146.     RESIST_STYLE_SYMBOL = :both
  147.   end
  148. end

  149. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  150. #==============================================================================
  151. # □ Window_StatusCommand
  152. #------------------------------------------------------------------------------
  153. #   ステータス画面で、表示する内容を選択するウィンドウです。
  154. #==============================================================================

  155. class Window_StatusCommand < Window_Command
  156.   #--------------------------------------------------------------------------
  157.   # ● オブジェクト初期化
  158.   #--------------------------------------------------------------------------
  159.   def initialize
  160.     commands = []
  161.     KGC::ExtendedStatusScene::COMMANDS.each { |c|
  162.       commands << KGC::ExtendedStatusScene::COMMAND_NAME[c]
  163.     }
  164.     super(160, commands)
  165.     self.height = WLH * 5 + 32
  166.     self.active = true
  167.   end
  168.   #--------------------------------------------------------------------------
  169.   # ○ 選択中のコマンド取得
  170.   #--------------------------------------------------------------------------
  171.   def command
  172.     return KGC::ExtendedStatusScene::COMMANDS[index]
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # ● カーソルを 1 ページ後ろに移動
  176.   #--------------------------------------------------------------------------
  177.   def cursor_pagedown
  178.     return if Input.repeat?(Input::R)
  179.     super
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # ● カーソルを 1 ページ前に移動
  183.   #--------------------------------------------------------------------------
  184.   def cursor_pageup
  185.     return if Input.repeat?(Input::L)
  186.     super
  187.   end
  188. end

  189. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  190. #==============================================================================
  191. # ■ Window_Status
  192. #==============================================================================

  193. class Window_Status < Window_Base
  194.   #--------------------------------------------------------------------------
  195.   # ● オブジェクト初期化
  196.   #     actor : アクター
  197.   #--------------------------------------------------------------------------
  198.   def initialize(actor)
  199.     super(160, 0, Graphics.width - 160, WLH * 5 + 32)
  200.     @actor = actor
  201.     refresh
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● リフレッシュ
  205.   #--------------------------------------------------------------------------
  206.   def refresh
  207.     self.contents.clear
  208.     draw_basic(104, 0)
  209.     draw_exp(104, WLH * 3)
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # ● 基本情報の描画
  213.   #     x : 描画先 X 座標
  214.   #     y : 描画先 Y 座標
  215.   #--------------------------------------------------------------------------
  216.   def draw_basic(x, y)
  217.     draw_actor_face(@actor, 0, (contents.height - 96) / 2)
  218.     draw_actor_name(@actor, x, y)
  219.     draw_actor_class(@actor, x + 120, y)
  220.     draw_actor_level(@actor, x, y + WLH)
  221.     draw_actor_state(@actor, x, y + WLH * 2)
  222.     draw_actor_hp(@actor, x + 120, y + WLH)
  223.     draw_actor_mp(@actor, x + 120, y + WLH * 2)
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # ● 経験値情報の描画
  227.   #     x : 描画先 X 座標
  228.   #     y : 描画先 Y 座標
  229.   #--------------------------------------------------------------------------
  230.   def draw_exp(x, y)
  231.     if $imported["GenericGauge"]
  232.       draw_actor_exp(@actor, x, y + WLH * 0, 240)
  233.       draw_actor_next_exp(@actor, x, y + WLH * 1, 240)
  234.     end

  235.     s1 = @actor.exp_s
  236.     s2 = @actor.next_rest_exp_s
  237.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  238.     self.contents.font.color = system_color
  239.     self.contents.draw_text(x, y + WLH * 0, 180, WLH, Vocab::ExpTotal)
  240.     self.contents.draw_text(x, y + WLH * 1, 180, WLH, s_next)
  241.     self.contents.font.color = normal_color

  242.     unless $imported["GenericGauge"]
  243.       self.contents.draw_text(x, y + WLH * 0, 240, WLH, s1, 2)
  244.       self.contents.draw_text(x, y + WLH * 1, 240, WLH, s2, 2)
  245.     end
  246.   end
  247. end

  248. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  249. #==============================================================================
  250. # □ Window_StatusDetail
  251. #------------------------------------------------------------------------------
  252. #   ステータス画面で、アクターの詳細情報を表示するウィンドウです。
  253. #==============================================================================

  254. class Window_StatusDetail < Window_Base
  255.   #--------------------------------------------------------------------------
  256.   # ○ 公開インスタンス変数
  257.   #--------------------------------------------------------------------------
  258.   attr_reader   :category
  259.   #--------------------------------------------------------------------------
  260.   # ● オブジェクト初期化
  261.   #     actor : アクター
  262.   #--------------------------------------------------------------------------
  263.   def initialize(actor)
  264.     @category = nil
  265.     y = WLH * 5 + 32
  266.     super(0, y, Graphics.width, Graphics.height - y)
  267.     create_chart_sprite
  268.     @actor    = actor
  269.     @duration = 0
  270.     self.z = z
  271.   end
  272.   #--------------------------------------------------------------------------
  273.   # ○ レーダーチャートスプライト作成
  274.   #--------------------------------------------------------------------------
  275.   def create_chart_sprite
  276.     @element_chart_sprite = Sprite_Base.new
  277.     @element_chart_sprite.bitmap = Bitmap.new(height - 32, height - 32)
  278.     @element_chart_sprite.ox = @element_chart_sprite.width  / 2
  279.     @element_chart_sprite.oy = @element_chart_sprite.height / 2
  280.     @element_chart_sprite.blend_type = 1
  281.     @element_chart_sprite.opacity = 0
  282.     @element_chart_sprite.visible = false

  283.     @state_chart_sprite = Sprite_Base.new
  284.     @state_chart_sprite.bitmap = Bitmap.new(height - 32, height - 32)
  285.     @state_chart_sprite.ox = @state_chart_sprite.width  / 2
  286.     @state_chart_sprite.oy = @state_chart_sprite.height / 2
  287.     @state_chart_sprite.blend_type = 1
  288.     @state_chart_sprite.opacity = 0
  289.     @state_chart_sprite.visible = false
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ● 破棄
  293.   #--------------------------------------------------------------------------
  294.   def dispose
  295.     @element_chart_sprite.bitmap.dispose
  296.     @element_chart_sprite.dispose
  297.     @state_chart_sprite.bitmap.dispose
  298.     @state_chart_sprite.dispose
  299.     super
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ○ Z 座標設定
  303.   #--------------------------------------------------------------------------
  304.   def z=(value)
  305.     super(value)
  306.     @element_chart_sprite.z = z + 1 if @element_chart_sprite != nil
  307.     @state_chart_sprite.z   = z + 1 if @state_chart_sprite   != nil
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ○ カテゴリー設定
  311.   #--------------------------------------------------------------------------
  312.   def category=(category)
  313.     return if @category == category
  314.     @category = category
  315.     refresh
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● リフレッシュ
  319.   #--------------------------------------------------------------------------
  320.   def refresh
  321.     @element_chart_sprite.visible = false
  322.     @state_chart_sprite.visible   = false
  323.     return if @category == nil

  324.     self.contents.clear
  325.     case @category
  326.     when :param
  327.       draw_parameter_list
  328.     when :resist
  329.       draw_resistance
  330.     when :element_resist
  331.       draw_element_resistance(0, 0,
  332.         KGC::ExtendedStatusScene::RESIST_STYLE_SYMBOL)
  333.     when :state_resist
  334.       draw_state_resistance(0, 0,
  335.         KGC::ExtendedStatusScene::RESIST_STYLE_SYMBOL)
  336.     when :profile
  337.       draw_profile
  338.     end
  339.     Graphics.frame_reset
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ○ パラメータ描画
  343.   #--------------------------------------------------------------------------
  344.   def draw_parameter_list
  345.     y = 0
  346.     KGC::ExtendedStatusScene::PARAMS.each { |param|
  347.       draw_parameter(param, 0, y)
  348.       y += WLH
  349.     }

  350.     x = 192
  351.     contents.font.color = system_color
  352.     contents.draw_text(x, 0, 120, WLH, Vocab::equip)
  353.     @actor.equips.each_with_index { |item, i|
  354.       draw_item_name(item, x, WLH * (i + 1))
  355.     }
  356.     contents.font.color = normal_color
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ○ 個別パラメータ描画
  360.   #--------------------------------------------------------------------------
  361.   def draw_parameter(param, x, y)
  362.     case param
  363.     when :atk
  364.       draw_actor_parameter(@actor, x, y, 0)
  365.     when :def
  366.       draw_actor_parameter(@actor, x, y, 1)
  367.     when :spi
  368.       draw_actor_parameter(@actor, x, y, 2)
  369.     when :agi
  370.       draw_actor_parameter(@actor, x, y, 3)
  371.     when :hit
  372.       draw_actor_parameter(@actor, x, y, 4)
  373.     when :eva
  374.       draw_actor_parameter(@actor, x, y, 5)
  375.     when :cri
  376.       draw_actor_parameter(@actor, x, y, 6)
  377.     when :cp
  378.       return unless $imported["SkillCPSystem"]
  379.       return unless KGC::SkillCPSystem::SHOW_STATUS_CP
  380.       draw_actor_cp(@actor, x, y, 156)
  381.     when :ep
  382.       return unless $imported["EquipExtension"]
  383.       return unless KGC::EquipExtension::SHOW_STATUS_EP
  384.       draw_actor_ep(@actor, x, y, 156)
  385.     end
  386.   end
  387.   #--------------------------------------------------------------------------
  388.   # ● 能力値の描画
  389.   #     actor : アクター
  390.   #     x     : 描画先 X 座標
  391.   #     y     : 描画先 Y 座標
  392.   #     type  : 能力値の種類 (0~6)
  393.   #--------------------------------------------------------------------------
  394.   def draw_actor_parameter(actor, x, y, type)
  395.     return super(actor, x, y, type) if type <= 3

  396.     names = KGC::ExtendedStatusScene::PARAMETER_NAME
  397.     case type
  398.     when 4
  399.       parameter_name  = names[:hit]
  400.       parameter_value = actor.hit
  401.     when 5
  402.       parameter_name  = names[:eva]
  403.       parameter_value = actor.eva
  404.     when 6
  405.       parameter_name  = names[:cri]
  406.       parameter_value = actor.cri
  407.     end
  408.     self.contents.font.color = system_color
  409.     self.contents.draw_text(x, y, 120, WLH, parameter_name)
  410.     self.contents.font.color = normal_color
  411.     self.contents.draw_text(x + 120, y, 36, WLH, parameter_value, 2)
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ○ 耐性描画
  415.   #--------------------------------------------------------------------------
  416.   def draw_resistance
  417.     case KGC::ExtendedStatusScene::RESIST_STYLE
  418.     when 0
  419.       type = :num
  420.     else
  421.       type = :chart
  422.     end

  423.     x = 0
  424.     contents.font.color = system_color
  425.     contents.draw_text(x, 0, 120, WLH,
  426.       KGC::ExtendedStatusScene::PARAMETER_NAME[:element_resist])
  427.     contents.font.color = normal_color
  428.     x = draw_element_resistance(x, WLH, type)

  429.     contents.font.color = system_color
  430.     contents.draw_text(x, 0, 120, WLH,
  431.       KGC::ExtendedStatusScene::PARAMETER_NAME[:state_resist])
  432.     x = draw_state_resistance(x, WLH, type)

  433.     contents.font.color = normal_color
  434.   end
  435.   #--------------------------------------------------------------------------
  436.   # ○ 属性耐性描画
  437.   #     x, y : 描画先 X, Y
  438.   #     type : 表示形式 (:num, :chart, :both)
  439.   #    描画終了時の X 座標を返す。
  440.   #--------------------------------------------------------------------------
  441.   def draw_element_resistance(x, y, type)
  442.     if $imported["BitmapExtension"]
  443.       if KGC::ExtendedStatusScene::CHART_HIGHQUALITY
  444.         Bitmap.smoothing_mode = TRGSSX::SM_ANTIALIAS
  445.       end
  446.       if [:chart, :both].include?(type)
  447.         x = draw_element_resistance_chart(x, y)
  448.         @element_chart_sprite.visible = true
  449.       end
  450.       Bitmap.smoothing_mode = TRGSSX::SM_DEFAULT
  451.     end

  452.     if [:num, :both].include?(type)
  453.       x = draw_element_resistance_num(x, y)
  454.     end

  455.     return x
  456.   end
  457.   #--------------------------------------------------------------------------
  458.   # ○ 属性耐性描画 (チャート)
  459.   #     x, y : 描画先 X, Y
  460.   #    描画終了時の X 座標を返す。
  461.   #--------------------------------------------------------------------------
  462.   def draw_element_resistance_chart(x, y)
  463.     r  = (contents.height - y - 56) / 2
  464.     cx = x + r + 28
  465.     cy = y + r + 28
  466.     pw = (Bitmap.smoothing_mode == TRGSSX::SM_ANTIALIAS ? 2 : 1)
  467.     elements = KGC::ExtendedStatusScene::CHECK_ELEMENT_LIST

  468.     draw_chart_line(cx, cy, r, elements.size, 3, pw)

  469.     # チャート
  470.     points = []
  471.     elements.each_with_index { |e, i|
  472.       n   = @actor.element_rate(e)
  473.       n   = 100 - n if KGC::ExtendedStatusScene::RESIST_NUM_STYLE == 1
  474.       n   = [[n, -100].max, 200].min
  475.       dr  = r * (n + 100) / 100 / 3
  476.       rad = Math::PI * (360.0 * i / elements.size - 90.0) / 180.0
  477.       dx  = cx + Integer(dr * Math.cos(-rad))
  478.       dy  = cy + Integer(dr * Math.sin(rad))
  479.       points << [dx, dy]

  480.       dx = cx + Integer((r + 14) * Math.cos(-rad)) - 12
  481.       dy = cy + Integer((r + 14) * Math.sin(rad))  - 12
  482.       draw_icon(KGC::ExtendedStatusScene::ELEMENT_ICON[e], dx, dy)
  483.     }

  484.     draw_chart(cx, cy, r, points, pw)
  485.     draw_chart_flash(@element_chart_sprite, x, y, r, points, pw)

  486.     return (x + cx + r + 42)
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # ○ 属性耐性描画 (数値)
  490.   #     x, y : 描画先 X, Y
  491.   #    描画終了時の X 座標を返す。
  492.   #--------------------------------------------------------------------------
  493.   def draw_element_resistance_num(x, y)
  494.     origin_y = y
  495.     contents.font.color = normal_color
  496.     KGC::ExtendedStatusScene::CHECK_ELEMENT_LIST.each { |i|
  497.       if y + WLH > contents.height
  498.         x += 84
  499.         y  = origin_y
  500.       end
  501.       draw_icon(KGC::ExtendedStatusScene::ELEMENT_ICON[i], x, y)
  502.       n = @actor.element_rate(i)
  503.       n = 100 - n if KGC::ExtendedStatusScene::RESIST_NUM_STYLE == 1
  504.       rate = sprintf("%4d%%", n)
  505.       contents.draw_text(x + 24, y, 52, WLH, rate, 2)
  506.       y += WLH
  507.     }
  508.     return (x + 96)
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ○ ステート耐性描画
  512.   #     x, y : 描画先 X, Y
  513.   #     type : 表示形式 (:num, :chart, :both)
  514.   #    描画終了時の X 座標を返す。
  515.   #--------------------------------------------------------------------------
  516.   def draw_state_resistance(x, y, type)
  517.     if $imported["BitmapExtension"]
  518.       if KGC::ExtendedStatusScene::CHART_HIGHQUALITY
  519.         Bitmap.smoothing_mode = TRGSSX::SM_ANTIALIAS
  520.       end
  521.       if [:chart, :both].include?(type)
  522.         x = draw_state_resistance_chart(x, y)
  523.         @state_chart_sprite.visible = true
  524.       end
  525.       Bitmap.smoothing_mode = TRGSSX::SM_DEFAULT
  526.     end

  527.     if [:num, :both].include?(type)
  528.       x = draw_state_resistance_num(x, y)
  529.     end

  530.     return x
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # ○ ステート耐性描画 (チャート)
  534.   #     x, y : 描画先 X, Y
  535.   #    描画終了時の X 座標を返す。
  536.   #--------------------------------------------------------------------------
  537.   def draw_state_resistance_chart(x, y)
  538.     r  = (contents.height - y - 56) / 2
  539.     cx = x + r + 28
  540.     cy = y + r + 28
  541.     pw = (Bitmap.smoothing_mode == TRGSSX::SM_ANTIALIAS ? 2 : 1)
  542.     states = KGC::ExtendedStatusScene::CHECK_STATE_LIST

  543.     draw_chart_line(cx, cy, r, states.size, 2, pw)

  544.     # チャート
  545.     points = []
  546.     states.each_with_index { |s, i|
  547.       state = $data_states[s]
  548.       n   = @actor.state_probability(s)
  549.       n   = 100 - n if KGC::ExtendedStatusScene::RESIST_NUM_STYLE == 1
  550.       dr  = r * n / 100
  551.       rad = Math::PI * (360.0 * i / states.size - 90.0) / 180.0
  552.       dx  = cx + Integer(dr * Math.cos(-rad))
  553.       dy  = cy + Integer(dr * Math.sin(rad))
  554.       points << [dx, dy]

  555.       dx = cx + Integer((r + 14) * Math.cos(-rad)) - 12
  556.       dy = cy + Integer((r + 14) * Math.sin(rad))  - 12
  557.       draw_icon(state.icon_index, dx, dy)
  558.     }

  559.     draw_chart(cx, cy, r, points, pw)
  560.     draw_chart_flash(@state_chart_sprite, x, y, r, points, pw)

  561.     return (x + cx + r + 42)
  562.   end
  563.   #--------------------------------------------------------------------------
  564.   # ○ ステート耐性描画 (数値)
  565.   #     x, y : 描画先 X, Y
  566.   #    描画終了時の X 座標を返す。
  567.   #--------------------------------------------------------------------------
  568.   def draw_state_resistance_num(x, y)
  569.     origin_y = y
  570.     contents.font.color = normal_color
  571.     KGC::ExtendedStatusScene::CHECK_STATE_LIST.each { |i|
  572.       state = $data_states[i]
  573.       if y + WLH > contents.height
  574.         x += 76
  575.         y  = origin_y
  576.       end
  577.       draw_icon(state.icon_index, x, y)
  578.       n = @actor.state_probability(i)
  579.       n = 100 - n if KGC::ExtendedStatusScene::RESIST_NUM_STYLE == 1
  580.       rate = sprintf("%3d%%", n)
  581.       contents.draw_text(x + 24, y, 44, WLH, rate, 2)
  582.       y += WLH
  583.     }
  584.     return x
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # ○ チャートライン描画
  588.   #     cx, cy : 中心 X, Y
  589.   #     r      : 半径
  590.   #     n      : 頂点数
  591.   #     breaks : 空間数
  592.   #     pw     : ペン幅
  593.   #--------------------------------------------------------------------------
  594.   def draw_chart_line(cx, cy, r, n, breaks, pw)
  595.     color = KGC::ExtendedStatusScene::CHART_BASE_COLOR.clone
  596.     contents.draw_regular_polygon(cx, cy, r, n, color, pw)
  597.     color.alpha = color.alpha * 5 / 8
  598.     contents.draw_spoke(cx, cy, r, n, color, pw)
  599.     (1..breaks).each { |i|
  600.       contents.draw_regular_polygon(cx, cy, r * i / breaks, n, color, pw)
  601.     }
  602.   end
  603.   #--------------------------------------------------------------------------
  604.   # ○ チャート描画
  605.   #     cx, cy : 中心 X, Y
  606.   #     r      : 半径
  607.   #     points : 頂点リスト
  608.   #     pw     : ペン幅
  609.   #--------------------------------------------------------------------------
  610.   def draw_chart(cx, cy, r, points, pw)
  611.     contents.draw_polygon(points, KGC::ExtendedStatusScene::CHART_LINE_COLOR, 2)
  612.   end
  613.   #--------------------------------------------------------------------------
  614.   # ○ チャートフラッシュ描画
  615.   #     sprite : チャートスプライト
  616.   #     x, y   : 基準 X, Y
  617.   #     r      : 半径
  618.   #     points : 頂点リスト
  619.   #     pw     : ペン幅
  620.   #--------------------------------------------------------------------------
  621.   def draw_chart_flash(sprite, x, y, r, points, pw)
  622.     points = points.clone
  623.     points.each { |pt| pt[0] -= x }

  624.     cx = x + r + 28
  625.     cy = y + r + 28
  626.     color = KGC::ExtendedStatusScene::CHART_FLASH_COLOR
  627.     sprite.bitmap.clear
  628.     sprite.bitmap.fill_polygon(points, Color.new(0, 0, 0, 0), color)
  629.     sprite.ox = cx - x
  630.     sprite.oy = cy
  631.     sprite.x  = self.x + cx + 16
  632.     sprite.y  = self.y + cy + 16
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ○ プロフィール描画
  636.   #--------------------------------------------------------------------------
  637.   def draw_profile
  638.     profile = KGC::ExtendedStatusScene::PROFILE[@actor.id]
  639.     return if profile == nil

  640.     contents.font.color = normal_color
  641.     profile.split(/\\\|/).each_with_index { |line, i|
  642.       draw_profile_text(0, WLH * i, line)
  643.     }
  644.   end
  645.   #--------------------------------------------------------------------------
  646.   # ○ プロフィールテキスト描画
  647.   #     x, y : 描画先座標
  648.   #     text : 描画テキスト
  649.   #--------------------------------------------------------------------------
  650.   def draw_profile_text(x, y, text)
  651.     buf = convert_special_characters(text)
  652.     while (c = buf.slice!(/./m)) != nil
  653.       case c
  654.       when "\x01"                       # \C[n]  (文字色変更)
  655.         buf.sub!(/\[(\d+)\]/, "")
  656.         contents.font.color = text_color($1.to_i)
  657.         next
  658.       when "\x02"                       # \G  (所持金表示)
  659.         n  = $game_party.gold.to_s
  660.         cw = contents.text_size(n).width
  661.         contents.draw_text(x, y, cw + 8, WLH, n)
  662.         x += cw
  663.       else                              # 普通の文字
  664.         contents.draw_text(x, y, 40, WLH, c)
  665.         x += contents.text_size(c).width
  666.       end
  667.     end
  668.     contents.font.color = normal_color
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # ○ 特殊文字の変換
  672.   #     text : 変換対象テキスト
  673.   #--------------------------------------------------------------------------
  674.   def convert_special_characters(text)
  675.     buf = text.dup
  676.     buf.gsub!(/\\V\[(\d+)\]/i) { $game_variables[$1.to_i] }
  677.     buf.gsub!(/\\V\[(\d+)\]/i) { $game_variables[$1.to_i] }
  678.     buf.gsub!(/\\N\[(\d+)\]/i) { $game_actors[$1.to_i].name }
  679.     buf.gsub!(/\\C\[(\d+)\]/i) { "\x01[#{$1}]" }
  680.     buf.gsub!(/\\G/)           { "\x02" }
  681.     buf.gsub!(/\\\\/)          { "\\" }
  682.     return buf
  683.   end
  684.   #--------------------------------------------------------------------------
  685.   # ● フレーム更新
  686.   #--------------------------------------------------------------------------
  687.   def update
  688.     super
  689.     update_chart
  690.   end
  691.   #--------------------------------------------------------------------------
  692.   # ○ チャート更新
  693.   #--------------------------------------------------------------------------
  694.   def update_chart
  695.     return if @element_chart_sprite == nil

  696.     @element_chart_sprite.update
  697.     @state_chart_sprite.update

  698.     zoom = opacity = 0
  699.     case @duration
  700.     when 0..11
  701.       zoom    = @duration / 11.0
  702.       opacity = 255
  703.     when 12..27
  704.       zoom    = 1
  705.       opacity = (27 - @duration) * 16
  706.     end
  707.     @element_chart_sprite.zoom_x  = @element_chart_sprite.zoom_y = zoom
  708.     @element_chart_sprite.opacity = opacity
  709.     @state_chart_sprite.zoom_x    = @state_chart_sprite.zoom_y   = zoom
  710.     @state_chart_sprite.opacity   = opacity

  711.     @duration = (@duration + 1) % Graphics.frame_rate
  712.   end
  713. end

  714. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  715. #==============================================================================
  716. # ■ Scene_Status
  717. #==============================================================================

  718. class Scene_Status < Scene_Base
  719.   #--------------------------------------------------------------------------
  720.   # ● オブジェクト初期化
  721.   #     actor_index   : アクターインデックス
  722.   #     command_index : コマンドインデックス
  723.   #--------------------------------------------------------------------------
  724.   def initialize(actor_index = 0, command_index = 0)
  725.     @actor_index   = actor_index
  726.     @command_index = command_index
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   # ● 開始処理
  730.   #--------------------------------------------------------------------------
  731.   alias start_KGC_ExtendedStatusScene start
  732.   def start
  733.     start_KGC_ExtendedStatusScene

  734.     @command_window = Window_StatusCommand.new
  735.     @command_window.index = @command_index
  736.     @detail_window = Window_StatusDetail.new(@actor)
  737.     @detail_window.category = @command_window.command
  738.   end
  739.   #--------------------------------------------------------------------------
  740.   # ● 終了処理
  741.   #--------------------------------------------------------------------------
  742.   alias terminate_KGC_ExtendedStatusScene terminate
  743.   def terminate
  744.     terminate_KGC_ExtendedStatusScene

  745.     @command_window.dispose
  746.     @detail_window.dispose
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # ● 次のアクターの画面に切り替え
  750.   #--------------------------------------------------------------------------
  751.   def next_actor
  752.     @actor_index += 1
  753.     @actor_index %= $game_party.members.size
  754.     $scene = Scene_Status.new(@actor_index, @command_window.index)
  755.   end
  756.   #--------------------------------------------------------------------------
  757.   # ● 前のアクターの画面に切り替え
  758.   #--------------------------------------------------------------------------
  759.   def prev_actor
  760.     @actor_index += $game_party.members.size - 1
  761.     @actor_index %= $game_party.members.size
  762.     $scene = Scene_Status.new(@actor_index, @command_window.index)
  763.   end
  764.   #--------------------------------------------------------------------------
  765.   # ● フレーム更新
  766.   #--------------------------------------------------------------------------
  767.   alias update_KGC_ExtendedStatusScene update
  768.   def update
  769.     @command_window.update
  770.     @detail_window.update
  771.     @detail_window.category = @command_window.command

  772.     update_KGC_ExtendedStatusScene
  773.   end
  774. end
复制代码












Lv1.梦旅人

梦石
0
星屑
50
在线时间
227 小时
注册时间
2009-12-25
帖子
24
2
发表于 2011-7-23 19:55:29 | 只看该作者
35行 COMMANDS = [:param, :element_resist, :state_resist]

点评

额...没想到那么简单  发表于 2011-7-23 20:04
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-14 18:30

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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