查看: 1340|回复: 4

[已经解决] 请教装备窗口人物BUFF图标位置如何移动(已经解决)

[复制链接]
梦石
0
星屑
468
在线时间
132 小时
注册时间
2016-6-15
回帖
146
发表于 2017-3-8 00:16:41 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 CHAOSCLOUD 于 2017-3-8 12:51 编辑

如图显示,在角色装备栏打开以后,倘若身上有个buff图标则会挡住名字。是否可以在脚本里修正图标的位置。
因为在我的工程里有个唯一道具,装备之后会附加一个buff图标到角色身上方便确认该道具在谁身上。而角色名字超过3个字符则最后一个字就如图这样被遮挡了。在不改名字长度和保持状态图标存在的前提下有修改方案否?诚心求问

3.8日更新截图。1楼说不是原始界面的,我确实用了一个装备扩展插件_(:зゝ∠)_谢谢提醒,当时测试如何关闭重量系统
  1. #==============================================================================
  2. #  ■装備拡張 for RGSS3 Ver1.10
  3. # □author kure
  4. #
  5. # 呼び出し方法  SceneManager.call(Scene_Equip)
  6. #==============================================================================
  7. module KURE
  8.   module ExEquip
  9.   #画面の表示設定
  10.   #装備品のステータス補正表示(0=表示しない 1=表示する)
  11.   VIEW_EQUIP_STATUS = 1
  12.    
  13.   #装備スロット欄の表示設定----------------------------------------------------
  14.   #装備スロット表示名を設定(EQUIP_SLOT_NAME = [スロット5表示名,…]
  15.   EQUIP_SLOT_NAME = ["兵书","坐骑","军印"]
  16.    
  17.   #装備スロットを設定
  18.   #通常のスロット
  19.   EQUIP_SLOT = [0,1,2,3,4,5,6]
  20.   #二刀流のスロット
  21.   EQUIP_SLOT_DUAL = [0,0,2,3,4,5,6]
  22.   
  23.   #ステータス欄の表示設定-------------------------------------------------------
  24.   #ステータス変化に表示する文字列
  25.   #Vocab_Ex1 = [命中率,回避率,会心率]
  26.   Vocab_Ex1 = ["命中率","回避率","会心率"]
  27.   
  28.   #装備重量システム-------------------------------------------------------------
  29.   #装備重量システムを利用する(0=利用しない 1=利用する)
  30.   USE_WEIGHT_SYSTEM = 0
  31.   
  32.   #最大装備重量設定------------------------------------------------------------
  33.   #基礎最大重量(全てのアクターが最低限もてる重量を設定します)
  34.   MAX_WEIGHT_BASE = 50
  35.   #レベル補正(レベルが上がるごとに増える最大重量を設定します)
  36.   MAX_WEIGHT_Lv = 2
  37.   
  38.   #アクター毎、装備重量補正
  39.   #MAX_WEIGHT_ACTOR = [アクターID1,アクターID2,アクターID3,…]
  40.   #MAX_WEIGHT_ACTOR = [20,20,20,20,20,20,20,20,20,20]
  41.    MAX_WEIGHT_ACTOR = [0]
  42.   #職業ごとの装備重量補正
  43.   #MAX_WEIGHT_JOB = [職業ID1,職業ID2,職業ID3,…]
  44.   #MAX_WEIGHT_JOB = [10,10,10,10,10,10,10,10,10,10]
  45.   MAX_WEIGHT_JOB = [0]
  46.   #スキル補正
  47.   #MAX_WEIGHT_SKILL = [[スキルID,重量補正],[スキルID,重量補正],…]
  48.   #MAX_WEIGHT_SKILL = [[1,10],[3,5],[84,100]]
  49.   MAX_WEIGHT_SKILL = [[1,0],[3,0],[84,0]]
  50.   #装備重量の名称
  51.   WEIGHT_NAME = "重量"
  52.   
  53.   #重量0のアイテムの重量表示(0=表示する 1=表示しない)
  54.   WEIGHT_0_ITEM = 1
  55.   
  56.   end
  57. end

  58. #==============================================================================
  59. # ■ RPG::BaseItem
  60. #==============================================================================
  61. class RPG::BaseItem
  62.   #--------------------------------------------------------------------------
  63.   # ● 装備重量の定義(追加定義)
  64.   #--------------------------------------------------------------------------  
  65.   def weight
  66.     cheack_note = @note
  67.     cheack_note.match(/^<装備重量\s?(\d+)>/)
  68.     if $1 == nil
  69.       return 0   
  70.     else
  71.       return type = $1.to_i
  72.     end   
  73.   end
  74.   #--------------------------------------------------------------------------
  75.   # ● 装備重量の定義(追加定義)
  76.   #--------------------------------------------------------------------------  
  77.   def gain_weight  
  78.     cheack_note = @note
  79.     cheack_note.match(/^<最大重量増加\s?(\d+)>/)
  80.     if $1 == nil
  81.       return 0   
  82.     else
  83.       return type = $1.to_i
  84.     end  
  85.   end
  86. end

  87. #==============================================================================
  88. # ■ RPG::EquipItem(再定義)
  89. #==============================================================================
  90. class RPG::EquipItem < RPG::BaseItem
  91.   #--------------------------------------------------------------------------
  92.   # ● 装備タイプの定義(再定義)
  93.   #--------------------------------------------------------------------------  
  94.   def etype_id
  95.     if @note != ""
  96.       cheack_note = @note
  97.       cheack_note.match(/^<装備タイプ\s?(\d+)>/)
  98.       if $1 == nil
  99.         return @etype_id   
  100.       else
  101.         return type = $1.to_i
  102.       end
  103.     else
  104.       return @etype_id
  105.     end
  106.   end
  107.   #--------------------------------------------------------------------------
  108.   # ● 装備タイプの定義(再定義)
  109.   #--------------------------------------------------------------------------  
  110.   def etype_id=(etype_id)
  111.     @etype_id = etype_id
  112.   end
  113. end

  114. #==============================================================================
  115. # ■ Game_BaseItem(追加定義)
  116. #==============================================================================
  117. class Game_BaseItem
  118.   def id
  119.     @item_id
  120.   end
  121. end

  122. #==============================================================================
  123. # ■ Game_Actor
  124. #==============================================================================
  125. class Game_Actor < Game_Battler
  126.   #--------------------------------------------------------------------------
  127.   # ● 装備スロットの配列を取得(再定義)
  128.   #--------------------------------------------------------------------------
  129.   def equip_slots
  130.     return KURE::ExEquip::EQUIP_SLOT_DUAL if dual_wield?
  131.     return KURE::ExEquip::EQUIP_SLOT  # 通常
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● 装備総重量(追加定義)
  135.   #--------------------------------------------------------------------------  
  136.   def all_weight
  137.     weight = 0
  138.       for i in [email]0..@equips.size[/email] - 1
  139.         #オブジェクトが存在している場合
  140.         if @equips[i].object != nil
  141.           if equip_slots[i] == 0
  142.             weight = weight + $data_weapons[@equips[i].id].weight
  143.           else
  144.             weight = weight + $data_armors[@equips[i].id].weight
  145.           end
  146.         end
  147.       end
  148.     return weight
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # ● 重量増加量(追加定義)
  152.   #--------------------------------------------------------------------------  
  153.   def all_gain_weight
  154.     gain_weight = 0
  155.       for i in [email]0..@equips.size[/email] - 1
  156.         #オブジェクトが存在している場合
  157.         if @equips[i].object != nil
  158.           if equip_slots[i] == 0
  159.             gain_weight = gain_weight + $data_weapons[@equips[i].id].gain_weight
  160.           else
  161.             gain_weight = gain_weight + $data_armors[@equips[i].id].gain_weight
  162.           end
  163.         end
  164.       end
  165.     return gain_weight   
  166.   end
  167.   #--------------------------------------------------------------------------
  168.   # ● 重量最大量(追加定義)
  169.   #--------------------------------------------------------------------------  
  170.   def max_weight
  171.     max_weight = 0
  172.     #追加重量
  173.     plus_weight = all_gain_weight
  174.     #基礎値
  175.     max_weight = max_weight + plus_weight + KURE::ExEquip::MAX_WEIGHT_BASE + KURE::ExEquip::MAX_WEIGHT_Lv * @level
  176.     #アクター補正
  177.     if KURE::ExEquip::MAX_WEIGHT_ACTOR[@actor_id] != nil
  178.       max_weight = max_weight + KURE::ExEquip::MAX_WEIGHT_ACTOR[@actor_id]
  179.     end
  180.     #職業補正
  181.     if KURE::ExEquip::MAX_WEIGHT_JOB[@class_id] != nil
  182.       max_weight = max_weight + KURE::ExEquip::MAX_WEIGHT_JOB[@class_id]
  183.     end   
  184.     #スキル補正を加算
  185.     for i in 0..KURE::ExEquip::MAX_WEIGHT_SKILL.size-1
  186.       if KURE::ExEquip::MAX_WEIGHT_SKILL[i] != nil
  187.         #スキルを設定していればスキルを保存
  188.         cheack_skill = $data_skills[KURE::ExEquip::MAX_WEIGHT_SKILL[i][0]]
  189.         #念のためnilではないか確認
  190.         if cheack_skill != nil
  191.           #スキルを覚えていれば補正値を加算
  192.           if skill_learn?(cheack_skill)
  193.             if KURE::ExEquip::MAX_WEIGHT_SKILL[i][1] != nil
  194.             max_weight = max_weight + KURE::ExEquip::MAX_WEIGHT_SKILL[i][1]
  195.             end
  196.           end  
  197.         end
  198.       end
  199.     end
  200.     return max_weight
  201.   end
  202. end

  203. #==============================================================================
  204. # ■ Scene_Equip(再定義)
  205. #------------------------------------------------------------------------------
  206. #  装備画面の処理を行うクラスです。
  207. #==============================================================================
  208. class Scene_Equip < Scene_MenuBase
  209.   #--------------------------------------------------------------------------
  210.   # ● 開始処理
  211.   #--------------------------------------------------------------------------
  212.   def start
  213.     super
  214.     @max_weight = @actor.max_weight
  215.    
  216.     create_help_window
  217.     create_small_status_window
  218.     create_command_window
  219.     create_slot_window
  220.     create_status_window
  221.     create_item_window
  222.    
  223.     @save_item = 0
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # ● コマンドウィンドウの作成
  227.   #--------------------------------------------------------------------------
  228.   def create_command_window
  229.     @command_window = Window_Ex_EquipCommand.new(0,@help_window.height + @small_status_window.height, @small_status_window.width)
  230.     @command_window.viewport = @viewport
  231.     @command_window.help_window = @help_window
  232.     @command_window.set_handler(:equip,    method(:command_equip))
  233.     @command_window.set_handler(:optimize, method(:command_optimize))
  234.     @command_window.set_handler(:clear,    method(:command_clear))
  235.     @command_window.set_handler(:cancel,   method(:return_scene))
  236.     @command_window.set_handler(:pagedown, method(:next_actor))
  237.     @command_window.set_handler(:pageup,   method(:prev_actor))
  238.     @command_window.activate
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # ● スロットウィンドウの作成
  242.   #--------------------------------------------------------------------------
  243.   def create_slot_window
  244.     @slot_window = Window_Ex_EquipSlot.new(0, @command_window.height + @help_window.height + 120, 305,Graphics.height - @command_window.height - @help_window.height - 120)
  245.     @slot_window.viewport = @viewport
  246.     @slot_window.help_window = @help_window
  247.     @slot_window.status_window = @status_window
  248.     @slot_window.actor = @actor
  249.     @slot_window.set_handler(:ok,       method(:on_slot_ok))
  250.     @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
  251.     @slot_window.set_handler(:pagedown, method(:next_actor))
  252.     @slot_window.set_handler(:pageup,   method(:prev_actor))
  253.     @slot_window.deactivate
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # ● ステータスウィンドウの作成
  257.   #--------------------------------------------------------------------------
  258.   def create_status_window
  259.     @status_window = Window_Ex_EquipStatus.new(@slot_window.width, @help_window.height,Graphics.width - @slot_window.width,Graphics.height - @help_window.height)
  260.     @status_window.viewport = @viewport
  261.     @status_window.actor = @actor
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ● ステータスウィンドウの作成
  265.   #--------------------------------------------------------------------------
  266.   def create_small_status_window
  267.     @small_status_window = Window_Equip_Small_Status.new(0,@help_window.height,305,120)
  268.     @small_status_window.viewport = @viewport
  269.     @small_status_window.weight = @actor.all_weight
  270.     @small_status_window.max_weight = @max_weight
  271.     @small_status_window.refresh
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # ● アイテムウィンドウの作成
  275.   #--------------------------------------------------------------------------
  276.   def create_item_window
  277.     @item_window = Window_Ex_EquipItem.new(0,@command_window.height +  @help_window.height + 120, 305,Graphics.height - @command_window.height - @help_window.height - 120)
  278.     @item_window.viewport = @viewport
  279.     @item_window.help_window = @help_window
  280.     @item_window.status_window = @status_window
  281.     @item_window.actor = @actor
  282.     @item_window.set_handler(:ok,     method(:on_item_ok))
  283.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  284.     @slot_window.item_window = @item_window
  285.     @item_window.visible = false
  286.     @item_window.weight = @actor.all_weight
  287.     @item_window.max_weight = @max_weight
  288.   end
  289.   #--------------------------------------------------------------------------
  290.   # ● フレーム更新
  291.   #--------------------------------------------------------------------------
  292.   def update
  293.     update_basic
  294.     update_ex_status_window
  295.   end
  296.   #--------------------------------------------------------------------------
  297.   # ● フレーム更新
  298.   #--------------------------------------------------------------------------
  299.   def update_ex_status_window
  300.     if @item_window.visible == true
  301.       if  @item_window.item != @save_item
  302.         @save_item = @item_window.item
  303.         temp_actor = Marshal.load(Marshal.dump(@actor))
  304.         temp_actor.force_change_equip(@item_window.slot_id, @save_item)
  305.         @status_window.set_temp_actor(temp_actor)
  306.         @status_window.set_select_item2(@save_item)
  307.         @status_window.refresh
  308.       end
  309.     end
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # ● コマンド[装備変更]
  313.   #--------------------------------------------------------------------------
  314.   def command_equip
  315.     slot_window_set_focus
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● コマンド[全て外す]
  319.   #--------------------------------------------------------------------------
  320.   def command_clear
  321.     Sound.play_equip
  322.     @actor.clear_equipments
  323.     @status_window.refresh
  324.     @slot_window.refresh
  325.     @command_window.activate
  326.     if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1
  327.       update_weight     
  328.     end
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # ● スロット[決定]
  332.   #--------------------------------------------------------------------------
  333.   def on_slot_ok
  334.     @save_item = 0
  335.     @slot_window.visible = false
  336.     @item_window.visible = true
  337.     @status_window.draw_index = 1
  338.     @status_window.set_select_item(@slot_window.index)
  339.    
  340.     #装備アイテムがあれば重量を渡す
  341.     if @actor.equips[@slot_window.index] != nil
  342.       @item_window.chage_item_weight = @actor.equips[@slot_window.index].weight
  343.       @item_window.chaged_item_gain_weight = @actor.equips[@slot_window.index].gain_weight
  344.     else
  345.       @item_window.chage_item_weight = 0
  346.       @item_window.chaged_item_gain_weight = 0
  347.     end
  348.     update_weight
  349.    
  350.     @item_window.refresh
  351.     @slot_window.deactivate
  352.     @item_window.activate
  353.     @item_window.select(0)
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # ● スロット[キャンセル]
  357.   #--------------------------------------------------------------------------
  358.   def on_slot_cancel
  359.     @slot_window.unselect
  360.     @slot_window.deactivate
  361.     @command_window.activate
  362.     @command_window.select(0)
  363.   end
  364.   #--------------------------------------------------------------------------
  365.   # ● アイテム[決定]
  366.   #--------------------------------------------------------------------------
  367.   def on_item_ok
  368.     Sound.play_equip
  369.     index = @slot_window.index
  370.     @actor.change_equip(@slot_window.index, @item_window.item)
  371.    
  372.     #二刀流両手剣問題対応
  373.     if @actor.dual_wield?
  374.       if @slot_window.index == 0
  375.         @actor.change_equip(1, nil) if @actor.features_set(54).include?(1)
  376.       elsif @slot_window.index == 1
  377.         @actor.change_equip(0, nil) if @actor.features_set(54).include?(1)
  378.       end
  379.     end
  380.   
  381.     @item_window.chaged_item_gain_weight = 0
  382.     @status_window.draw_index = 0
  383.     slot_window_set_focus
  384.     delete_plus_status
  385.     @slot_window.index = index
  386.     update_weight
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # ● アイテム[キャンセル]
  390.   #--------------------------------------------------------------------------
  391.   def on_item_cancel
  392.     @status_window.draw_index = 0
  393.     index = @slot_window.index
  394.     slot_window_set_focus
  395.     @slot_window.index = index
  396.     delete_plus_status
  397.   end
  398.   #--------------------------------------------------------------------------
  399.   # ● アクターの切り替え
  400.   #--------------------------------------------------------------------------
  401.   def on_actor_change
  402.     update_weight   
  403.     @status_window.actor = @actor
  404.     @slot_window.actor = @actor
  405.     @item_window.actor = @actor
  406.     @command_window.activate
  407.     @command_window.select(0)
  408.     @slot_windowdeactivate
  409.     @slot_window.unselect
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● ステータスウィンドウ項目消去
  413.   #--------------------------------------------------------------------------
  414.   def delete_plus_status
  415.     @status_window.set_temp_actor(nil)
  416.     @status_window.set_select_item(nil)
  417.     @status_window.set_select_item2(nil)
  418.     @status_window.refresh   
  419.   end
  420.   #--------------------------------------------------------------------------
  421.   # ● スロットウィンドウにカーソルセット
  422.   #--------------------------------------------------------------------------
  423.   def slot_window_set_focus
  424.     @item_window.visible = false
  425.     @item_window.unselect
  426.     @item_window.refresh
  427.    
  428.     @slot_window.visible = true
  429.     @slot_window.activate
  430.     @slot_window.select(0)
  431.     @slot_window.refresh
  432.    
  433.     @command_window.unselect
  434.     @command_window.deactivate
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # ● 装備重量更新
  438.   #--------------------------------------------------------------------------  
  439.   def update_weight
  440.     @max_weight = @actor.max_weight
  441.     @small_status_window.weight = @actor.all_weight
  442.     @small_status_window.max_weight = @max_weight
  443.     @item_window.weight = @actor.all_weight
  444.     @item_window.max_weight = @max_weight
  445.     @small_status_window.refresh     
  446.   end
  447. end

  448. #==============================================================================
  449. # ■ Window_Ex_EquipSlot
  450. #==============================================================================
  451. class Window_Ex_EquipSlot < Window_EquipSlot
  452.   #--------------------------------------------------------------------------
  453.   # ● 公開インスタンス変数
  454.   #--------------------------------------------------------------------------
  455.   attr_reader   :status_window            # ステータスウィンドウ
  456.   attr_reader   :item_window              # アイテムウィンドウ
  457.   #--------------------------------------------------------------------------
  458.   # ● オブジェクト初期化
  459.   #--------------------------------------------------------------------------
  460.   def initialize(x, y, width, height)
  461.     @height = height
  462.     super(x, y, width)
  463.     @actor = nil
  464.     refresh
  465.   end
  466.   #--------------------------------------------------------------------------
  467.   # ● ウィンドウ高さの取得
  468.   #--------------------------------------------------------------------------
  469.   def window_height
  470.     return @height
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # ● 項目の描画
  474.   #--------------------------------------------------------------------------
  475.   def draw_item(index)
  476.     return unless @actor
  477.     rect = item_rect_for_text(index)
  478.     change_color(system_color, enable?(index))
  479.     if @actor.equip_slots[index] <= 4
  480.       draw_text(rect.x, rect.y, 75, line_height, slot_name(index))
  481.     else
  482.       draw_index = KURE::ExEquip::EQUIP_SLOT[index]
  483.       draw_text(rect.x, rect.y, 75, line_height, KURE::ExEquip::EQUIP_SLOT_NAME[draw_index-5])      
  484.     end  
  485.     draw_item_name(@actor.equips[index], rect.x + 75, rect.y, enable?(index))
  486.     if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1
  487.       if @actor.equips[index] != nil
  488.         if @actor.equips[index].gain_weight != 0
  489.           change_color(power_up_color)
  490.           draw_text(rect.x, rect.y, rect.width, line_height, @actor.equips[index].gain_weight.to_s,2)         
  491.         else
  492.           if KURE::ExEquip::WEIGHT_0_ITEM == 1
  493.             if @actor.equips[index].weight != 0
  494.               change_color(power_down_color)
  495.               draw_text(rect.x, rect.y, rect.width, line_height, @actor.equips[index].weight.to_s,2)
  496.             end
  497.           else
  498.             change_color(power_down_color)
  499.             draw_text(rect.x, rect.y, rect.width, line_height, @actor.equips[index].weight.to_s,2)
  500.           end
  501.         end
  502.       end
  503.     end
  504.   end
  505.   #--------------------------------------------------------------------------
  506.   # ● リフレッシュ
  507.   #--------------------------------------------------------------------------
  508.   def refresh
  509.     #フォントの設定
  510.     last_font = contents.font.size
  511.     contents.font.size = 20
  512.    
  513.     contents.clear
  514.     create_contents
  515.     draw_all_items
  516.    
  517.     #フォントを戻す
  518.     contents.font.size = last_font
  519.   end
  520.   #--------------------------------------------------------------------------
  521.   # ● ヘルプテキスト更新
  522.   #--------------------------------------------------------------------------
  523.   def update_help
  524.     @help_window.clear
  525.     @help_window.set_item(item) if @help_window
  526.   end
  527. end


  528. #==============================================================================
  529. # ■ Window_Ex_EquipItem
  530. #==============================================================================
  531. class Window_Ex_EquipItem < Window_EquipItem
  532.   attr_reader   :status_window
  533.   attr_accessor :weight
  534.   attr_accessor :max_weight
  535.   attr_accessor :chage_item_weight
  536.   attr_accessor :chaged_item_gain_weight
  537.   #--------------------------------------------------------------------------
  538.   # ● オブジェクト初期化
  539.   #--------------------------------------------------------------------------
  540.   def initialize(x, y, width, height)
  541.     super(x, y, width, height)
  542.     @weight = 0
  543.     @max_weight = 0
  544.     @chage_item_weight = 0
  545.     @chaged_item_gain_weight = 0
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # ● 桁数の取得
  549.   #--------------------------------------------------------------------------
  550.   def col_max
  551.     return 1
  552.   end
  553.   #--------------------------------------------------------------------------
  554.   # ● →キー入力時動作
  555.   #--------------------------------------------------------------------------
  556.   def cursor_right(wrap = false)
  557.     if @status_window.draw_index == 1
  558.       @status_window.draw_index = 2
  559.     else
  560.       @status_window.draw_index = 1
  561.     end
  562.     @status_window.refresh
  563.   end
  564.   #--------------------------------------------------------------------------
  565.   # ● ←キー入力時操作
  566.   #--------------------------------------------------------------------------
  567.   def cursor_left(wrap = false)
  568.     if @status_window.draw_index == 1
  569.       @status_window.draw_index = 2
  570.     else
  571.       @status_window.draw_index = 1
  572.     end
  573.     @status_window.refresh
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # ● アイテムを許可状態で表示するかどうか
  577.   #--------------------------------------------------------------------------
  578.   def enable?(item)
  579.     #重量システムを利用時だけ判定を行う
  580.     if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1
  581.       #アイテムが存在する時
  582.       if item !=nil
  583.         #総重量
  584.         total_weight = item.weight + @weight - @chage_item_weight
  585.         if total_weight > @max_weight - @chaged_item_gain_weight
  586.           return false
  587.         else
  588.           return true
  589.         end
  590.       else
  591.         if @weight > @max_weight - @chaged_item_gain_weight
  592.           return false
  593.         else
  594.           return true
  595.         end
  596.       end
  597.     end
  598.    
  599.     #重量システム非利用時であればtureを返す
  600.     return true
  601.   end
  602.   #--------------------------------------------------------------------------
  603.   # ● 桁数の取得
  604.   #--------------------------------------------------------------------------
  605.   def slot_id
  606.     return @slot_id
  607.   end
  608.   #--------------------------------------------------------------------------
  609.   # ● ヘルプテキスト更新
  610.   #--------------------------------------------------------------------------
  611.   def update_help
  612.     @help_window.set_item(item)
  613.   end
  614.   #--------------------------------------------------------------------------
  615.   # ● 項目の描画
  616.   #--------------------------------------------------------------------------
  617.   def draw_item(index)
  618.     item = @data[index]
  619.     if item
  620.       rect = item_rect(index)
  621.       rect.width -= 4
  622.       draw_item_name(item, rect.x, rect.y, enable?(item))
  623.       draw_item_number(rect, item)
  624.       
  625.       #重量システムを利用時は重量を表示する
  626.       if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1
  627.         if item.gain_weight != 0
  628.           change_color(power_up_color)
  629.           draw_text(rect.x - 50, rect.y, rect.width - 30, line_height, item.gain_weight.to_s,2)         
  630.         else
  631.           #重量0をチェック
  632.           if KURE::ExEquip::WEIGHT_0_ITEM == 1
  633.             if item.weight != 0
  634.               change_color(power_down_color)
  635.               draw_text(rect.x - 50, rect.y, rect.width - 30, line_height, item.weight.to_s,2)
  636.             end
  637.           else
  638.             change_color(power_down_color)
  639.             draw_text(rect.x - 50, rect.y, rect.width - 30, line_height, item.weight.to_s,2)
  640.           end
  641.         end
  642.       end
  643.       
  644.     end
  645.   end
  646. end

  647. #==============================================================================
  648. # ■ Window_Small_Status
  649. #------------------------------------------------------------------------------
  650. #  メニュー画面でパーティメンバーのステータスを表示するウィンドウです。
  651. #==============================================================================
  652. class Window_Equip_Small_Status < Window_Selectable
  653.   #--------------------------------------------------------------------------
  654.   # ● 公開インスタンス変数
  655.   #--------------------------------------------------------------------------
  656.   attr_reader   :pending_index            # 保留位置(並び替え用)
  657.   attr_accessor :weight
  658.   attr_accessor :max_weight
  659.   #--------------------------------------------------------------------------
  660.   # ● オブジェクト初期化
  661.   #--------------------------------------------------------------------------
  662.   def initialize(x, y,width,height)
  663.     super(x, y, width, height)
  664.     refresh
  665.   end
  666.   #--------------------------------------------------------------------------
  667.   # ● 項目の描画
  668.   #--------------------------------------------------------------------------
  669.   def draw_status
  670.     @actor = $game_party.menu_actor
  671.     draw_actor_face(@actor, 0, 0)
  672.     draw_actor_name(@actor, 130, line_height * 0)
  673.     draw_actor_icons(@actor, 230-50, line_height * 0)
  674.     draw_actor_hp(@actor, 130, line_height * 1)
  675.     draw_actor_mp(@actor, 130, line_height * 2)
  676.     if KURE::ExEquip::USE_WEIGHT_SYSTEM == 1
  677.       if @max_weight != nil
  678.         draw_actor_weight(@actor, 130, line_height * 3)
  679.       end
  680.     end
  681.   end
  682.   #--------------------------------------------------------------------------
  683.   # ● 装備重量の描画
  684.   #--------------------------------------------------------------------------
  685.   def draw_actor_weight(actor, x, y, width = 124)
  686.     weight_rate = @weight.to_f / @max_weight
  687.     draw_gauge(x, y, width, weight_rate, tp_gauge_color1, tp_gauge_color2)
  688.     change_color(system_color)
  689.     draw_text(x, y, 30, line_height, KURE::ExEquip::WEIGHT_NAME)
  690.     draw_current_and_max_values(x, y, width, @weight, @max_weight,
  691.     mp_color(actor), normal_color)
  692.   end
  693.   #--------------------------------------------------------------------------
  694.   # ● リフレッシュ
  695.   #--------------------------------------------------------------------------
  696.   def refresh
  697.     contents.clear
  698.     draw_status
  699.   end
  700. end

  701. #==============================================================================
  702. # ■ Window_Ex_EquipStatus
  703. #------------------------------------------------------------------------------
  704. #  装備画面で、アクターの能力値変化を表示するウィンドウです。
  705. #==============================================================================
  706. class Window_Ex_EquipStatus < Window_EquipStatus
  707.   attr_accessor :draw_index
  708.   #--------------------------------------------------------------------------
  709.   # ◎ オブジェクト初期化
  710.   #--------------------------------------------------------------------------
  711.   def initialize(x, y,width,height)
  712.     @draw_index = 0
  713.     @width = width
  714.     @height = height
  715.     super(x, y)
  716.   end
  717.   #--------------------------------------------------------------------------
  718.   # ◎ ウィンドウ幅の取得
  719.   #--------------------------------------------------------------------------
  720.   def window_width
  721.     return @width
  722.   end
  723.   #--------------------------------------------------------------------------
  724.   # ◎ ウィンドウ高さの取得
  725.   #--------------------------------------------------------------------------
  726.   def window_height
  727.     return @height
  728.   end
  729.   #--------------------------------------------------------------------------
  730.   # ◎ リフレッシュ
  731.   #--------------------------------------------------------------------------
  732.   def refresh
  733.     contents.clear
  734.     #フォントの設定
  735.     last_font = contents.font.size
  736.     contents.font.size = 20
  737.    
  738.     draw_gauge(5,0, contents.width, 1, mp_gauge_color2,crisis_color)
  739.     change_color(normal_color)
  740.    
  741.     case @draw_index
  742.     when 0,1
  743.       draw_text(5, 0, 126, contents.font.size, "能力属性栏")   
  744.       draw_equip_befor(5,line_height * 1)
  745.       draw_right_arrow(0, line_height * 2)
  746.       draw_equip_after(65,line_height * 2)
  747.     when 2
  748.       draw_text(5, 0, 126, contents.font.size, "装备属性")
  749.       draw_equip_after(5,line_height * 1)
  750.     end
  751.       
  752.     case @draw_index
  753.     when 0,1   
  754.       11.times {|i| draw_item(0, line_height * 2 + contents.font.size * (1 + i), i) }
  755.     when 2
  756.       draw_features(5,line_height * 2)
  757.     end
  758.    
  759.     case @draw_index
  760.     when 1,2     
  761.       change_color(normal_color)
  762.       draw_text(0, line_height * 12, contents.width, contents.font.size, "",1)
  763.     end
  764.     contents.font.size = last_font
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # ◎ 装備変更のアイテム表示
  768.   #--------------------------------------------------------------------------
  769.   def draw_equip_befor(x,y)
  770.     return unless @actor
  771.     if @base_item_index != nil
  772.       draw_item_name(@actor.equips[@base_item_index], x, y)
  773.     end
  774.   end
  775.   #--------------------------------------------------------------------------
  776.   # ◎ 装備変更のアイテム表示
  777.   #--------------------------------------------------------------------------
  778.   def draw_equip_after(x,y)
  779.     return unless @actor
  780.     if @change_item != nil
  781.       draw_item_name(@change_item, x, y)
  782.     end
  783.   end
  784.   #--------------------------------------------------------------------------
  785.   # ◎ 装備アイテム描画の変数を設定
  786.   #--------------------------------------------------------------------------
  787.   def set_select_item(index)
  788.     return if @base_item_index == index
  789.     @base_item_index = index
  790.     refresh
  791.   end
  792.   #--------------------------------------------------------------------------
  793.   # ◎ 変更装備アイテムの変数を設定
  794.   #--------------------------------------------------------------------------
  795.   def set_select_item2(index)
  796.     return if @change_item == index
  797.     @change_item = index
  798.     refresh
  799.   end
  800.   #--------------------------------------------------------------------------
  801.   # ◎ 項目の描画
  802.   #--------------------------------------------------------------------------
  803.   def draw_item(x, y, param_id)
  804.     case param_id
  805.     when 0,1,2,3,4,5,6,7
  806.       draw_param_name(x + 4, y, param_id)
  807.       draw_current_param(x + 84+20, y, param_id) if @actor
  808.       draw_right_arrow(x + 116, y)
  809.       draw_new_param(x + 140+ 140, y, param_id) if @temp_actor
  810.       
  811.       if KURE::ExEquip::VIEW_EQUIP_STATUS == 1
  812.         change_color(param_change_color(@change_item.params[param_id])) if @change_item
  813.         draw_text(x + 172, y, 40, line_height, @change_item.params[param_id], 2) if @change_item
  814.       end
  815.       
  816.     when 8,9,10
  817.       value = 0
  818.       value2 = 0
  819.       value = (@actor.xparam(param_id - 8) * 100).to_i if @actor
  820.       value2 = (@temp_actor.xparam(param_id - 8) * 100).to_i  if @temp_actor
  821.       change_color(system_color)
  822.       draw_text(x + 4, y, 80, line_height, KURE::ExEquip::Vocab_Ex1[param_id - 8])
  823.       change_color(normal_color)
  824.       draw_text(x + 84+30, y, 32, line_height, value, 2) if @actor
  825.       draw_right_arrow(x + 116, y)
  826.       change_color(param_change_color(value2 - value)) if @temp_actor
  827.       draw_text(x + 140+ 140, y, 32, line_height, value2, 2) if @temp_actor
  828.       
  829.       if KURE::ExEquip::VIEW_EQUIP_STATUS == 1
  830.         change_color(param_change_color(value2 - value))
  831.         draw_text(x + 172, y, 40, line_height, value2 - value, 2) if @change_item
  832.       end
  833.       
  834.     end
  835.   end
  836.   #--------------------------------------------------------------------------
  837.   # ◎ 特徴の描画
  838.   #--------------------------------------------------------------------------
  839.   def draw_features(x,y)
  840.     return if @change_item == nil
  841.     #特徴を描画
  842.     change_color(system_color)
  843.     draw_text(5, y, 126, contents.font.size, "属性特效")
  844.    
  845.     #配列数取得変数を初期化
  846.     features_max = 0
  847.     #描画用配列を作成
  848.     draw_list = Array.new(100)
  849.     #配列用カウンターをセット
  850.     @draw_counter = 0
  851.     #装備品が有れば特徴最大数を取得
  852.     features_max = @change_item.features.size - 1

  853.       #項目をチェックして描画用配列に入れる
  854.       for l in 0..features_max
  855.          
  856.         #攻撃属性がある場合
  857.         if @change_item.features[l].code == 31
  858.           draw_str  = $data_system.elements[@change_item.features[l].data_id]
  859.           draw_list[@draw_counter] = draw_str + "属性 "
  860.           @draw_counter += 1
  861.         end
  862.          
  863.         #属性耐性がある場合
  864.         if @change_item.features[l].code == 11
  865.           #属性名取得
  866.           draw_str = $data_system.elements[@change_item.features[l].data_id]+ "耐性"
  867.           value = 100 - (@change_item.features[l].value * 100).to_i
  868.           draw_list[@draw_counter] = draw_str + value.to_s + "% "
  869.           @draw_counter += 1
  870.         end
  871.         
  872.         #弱体有効度がある場合
  873.         if @change_item.features[l].code == 12
  874.           #属性名取得
  875.           draw_str = "耐"+Vocab::param(@change_item.features[l].data_id)+ "减少"
  876.           value = 100 - (@change_item.features[l].value * 100).to_i
  877.           draw_list[@draw_counter] = draw_str + value.to_s + "% "
  878.           @draw_counter += 1
  879.         end         
  880.          
  881.         #ステート耐性がある場合
  882.         if @change_item.features[l].code == 13
  883.           #ステート名取得
  884.           draw_str = $data_states[@change_item.features[l].data_id].name + "耐性"
  885.           value = 100 - (@change_item.features[l].value * 100).to_i
  886.           draw_list[@draw_counter] = draw_str + value.to_s + "% "
  887.           @draw_counter += 1
  888.         end
  889.          
  890.         #ステート無効化がある場合
  891.         if @change_item.features[l].code == 14
  892.           #ステート名取得
  893.           draw_str = $data_states[@change_item.features[l].data_id].name
  894.           draw_list[@draw_counter] = draw_str + "无效 "
  895.           @draw_counter += 1
  896.         end         
  897.       
  898.         #通常能力値判定がある場合
  899.         if @change_item.features[l].code == 21
  900.           #ステータス名取得
  901.           draw_str = Vocab::param(@change_item.features[l].data_id)
  902.           value = (@change_item.features[l].value * 100).to_i - 100
  903.             if value > 0
  904.               value = "+" + value.to_s
  905.             end            
  906.           draw_list[@draw_counter] = draw_str + value.to_s + "% "
  907.           @draw_counter += 1
  908.         end
  909.          
  910.         #通常能力値判定がある場合
  911.         if @change_item.features[l].code == 22
  912.           #ステータス名取得
  913.           draw_str = @change_item.features[l].data_id
  914.           case draw_str
  915.           when 0
  916.             draw_str = "命中率"
  917.           when 1
  918.             draw_str = "回避率"
  919.           when 2
  920.             draw_str = "会心率"
  921.           when 3
  922.             draw_str = "会心回避"            
  923.           when 4
  924.             draw_str = "兵法回避"
  925.           when 5
  926.             draw_str = "兵法反射"
  927.           when 6
  928.             draw_str = "反击率"
  929.           when 7
  930.             draw_str = "每回兵力回复"
  931.           when 8
  932.             draw_str = "每回谋点回复"
  933.           when 9
  934.             draw_str = "每回气力回复"
  935.           end
  936.           value = (@change_item.features[l].value * 100).to_i
  937.             if value > 0
  938.               value = "+" + value.to_s
  939.             end            
  940.           draw_list[@draw_counter] = draw_str + value.to_s + "% "
  941.           @draw_counter += 1
  942.         end

  943.         #特殊能力値判定がある場合
  944.         if @change_item.features[l].code == 23
  945.           #ステート名取得
  946.           draw_str = @change_item.features[l].data_id
  947.           case draw_str
  948.           when 0
  949.             draw_str = "被打几率"
  950.           when 1
  951.             draw_str = "防御効果"
  952.           when 2
  953.             draw_str = "回复效果"
  954.           when 3
  955.             draw_str = "药草知识"
  956.           when 4
  957.             draw_str = "谋点消费率"
  958.           when 5
  959.             draw_str = "气力增加率"
  960.           when 6
  961.             draw_str = "受物理伤害"
  962.           when 7
  963.             draw_str = "受兵法伤害"
  964.           when 8
  965.             draw_str = "受地图伤害"
  966.           when 9
  967.             draw_str = "经验值"
  968.           end
  969.           value = (@change_item.features[l].value * 100).to_i - 100
  970.             if value > 0
  971.               value = "+" + value.to_s
  972.             end            
  973.           draw_list[@draw_counter] = draw_str + value.to_s + "% "
  974.           @draw_counter += 1
  975.         end

  976.         #攻撃時ステート判定がある場合
  977.         if @change_item.features[l].code == 32
  978.           #ステート名取得
  979.           draw_str = $data_states[@change_item.features[l].data_id].name + "追加"
  980.           value = (@change_item.features[l].value * 100).to_i
  981.           draw_list[@draw_counter] = draw_str + value.to_s + "% "
  982.           @draw_counter += 1
  983.         end
  984.          
  985.         #攻撃追加がある場合
  986.         if @change_item.features[l].code == 34
  987.           #攻撃回数を取得
  988.           value = (@change_item.features[l].value + 1).to_i
  989.           draw_list[@draw_counter] = value.to_s + "回攻击 "
  990.           @draw_counter += 1
  991.         end
  992.          
  993.         #スキルタイプ追加がある場合
  994.         if @change_item.features[l].code == 41
  995.           #項目を取得
  996.           value = $data_system.skill_types[@change_item.features[l].data_id]
  997.           draw_list[@draw_counter] = value + "可使用 "
  998.           @draw_counter += 1
  999.         end  
  1000.          
  1001.         #スキルタイプ削除がある場合
  1002.         if @change_item.features[l].code == 42
  1003.           #項目を取得
  1004.           value = $data_system.skill_types[@change_item.features[l].data_id]
  1005.           draw_list[@draw_counter] = value + "使用不可 "
  1006.           @draw_counter += 1
  1007.         end

  1008.         #スキル追加がある場合
  1009.         if @change_item.features[l].code == 43
  1010.           #項目を取得
  1011.           value = $data_skills[@change_item.features[l].data_id].name
  1012.           draw_list[@draw_counter] = "“" +value + "”可使用 "
  1013.           @draw_counter += 1
  1014.         end
  1015.          
  1016.         #スキル削除がある場合
  1017.         if @change_item.features[l].code == 44
  1018.           #項目を取得
  1019.           value = $data_skills[@change_item.features[l].data_id].name
  1020.           draw_list[@draw_counter] = "“" +value + "”不可使用 "
  1021.           @draw_counter += 1
  1022.         end
  1023.          
  1024.         #行動追加がある場合
  1025.         if @change_item.features[l].code == 61
  1026.           #項目を取得
  1027.           value = (@change_item.features[l].value * 100).to_i
  1028.           draw_list[@draw_counter] = "追加行动"+ value.to_s + "% "
  1029.           @draw_counter += 1
  1030.         end         
  1031.          
  1032.         #特殊フラグがある場合
  1033.         if @change_item.features[l].code == 62
  1034.           #項目を取得
  1035.           value = @change_item.features[l].data_id
  1036.           case value
  1037.           when 0
  1038.             value = "自动战斗"
  1039.           when 1
  1040.             value = "自动防御"
  1041.           when 2
  1042.             value = "自动援护"
  1043.           when 3
  1044.             value = "TP持越"
  1045.           end
  1046.           draw_list[@draw_counter] = value
  1047.           @draw_counter += 1
  1048.         end  
  1049.          
  1050.         #パーティー能力がある場合
  1051.         if @change_item.features[l].code == 64
  1052.           #項目を取得
  1053.           value = @change_item.features[l].data_id
  1054.           case value
  1055.           when 0
  1056.             value = "遇敌率↓"
  1057.           when 1
  1058.             value = "遇敌率0"
  1059.           when 2
  1060.             value = "不会被偷袭"
  1061.           when 3
  1062.             value = "偷袭率上升"
  1063.           when 4
  1064.             value = "金钱双倍"              
  1065.           when 5
  1066.             value = "掉宝双倍"              
  1067.           when 6
  1068.           end
  1069.           draw_list[@draw_counter] = value
  1070.           @draw_counter += 1
  1071.         end
  1072.       end

  1073.       #実際の描画処理
  1074.       for j in 0..@draw_counter
  1075.         if draw_list[j] != nil or 0
  1076.           case j
  1077.           when 0..10
  1078.             change_color(normal_color)            
  1079.             draw_text(x, y + contents.font.size * (j + 1) , contents.width / 2, contents.font.size, draw_list[j])
  1080.           when 11..21
  1081.             change_color(normal_color)            
  1082.             draw_text(x + contents.width / 2, y + contents.font.size * (j - 10) , contents.width / 2, contents.font.size, draw_list[j])
  1083.           end
  1084.         end
  1085.       end      
  1086.    
  1087.   end
  1088. end

  1089. #==============================================================================
  1090. # ■ Window_Ex_EquipCommand
  1091. #------------------------------------------------------------------------------
  1092. #  スキル画面で、コマンド(装備変更、最強装備など)を選択するウィンドウです。
  1093. #==============================================================================
  1094. class Window_Ex_EquipCommand < Window_HorzCommand
  1095.   #--------------------------------------------------------------------------
  1096.   # ● オブジェクト初期化
  1097.   #--------------------------------------------------------------------------
  1098.   def initialize(x, y, width)
  1099.     @window_width = width
  1100.     super(x, y)
  1101.   end
  1102.   #--------------------------------------------------------------------------
  1103.   # ● ウィンドウ幅の取得
  1104.   #--------------------------------------------------------------------------
  1105.   def window_width
  1106.     @window_width
  1107.   end
  1108.   #--------------------------------------------------------------------------
  1109.   # ● 桁数の取得
  1110.   #--------------------------------------------------------------------------
  1111.   def col_max
  1112.     if KURE::ExEquip::USE_WEIGHT_SYSTEM == 0
  1113.       return 3
  1114.     else
  1115.       return 2
  1116.     end
  1117.   end
  1118.   #--------------------------------------------------------------------------
  1119.   # ● コマンドリストの作成
  1120.   #--------------------------------------------------------------------------
  1121.   def make_command_list
  1122.     add_command(Vocab::equip2,   :equip)
  1123.     if KURE::ExEquip::USE_WEIGHT_SYSTEM == 0
  1124.       add_command(Vocab::optimize, :optimize)
  1125.     end
  1126.     add_command(Vocab::clear,    :clear)
  1127.   end
  1128. end
复制代码
我再补充几张图你看一下吧,因为是新建的工程就用了一个装备扩展插件,代码如下。
捕获.PNG
捕获2.PNG
技能:Icon绘制,头像&立绘,VA行走图,地图绘制(全PS制作),脚本盲
梦石
0
星屑
644
在线时间
830 小时
注册时间
2016-7-24
回帖
644

开拓者

发表于 2017-3-8 07:35:29 | 显示全部楼层
你這個很明顯不是默認介面,請把介面插件貼出來方便修改

点评

谢谢提醒,插件已经补在一楼啦~\(≧▽≦)/~  发表于 2017-3-8 12:37

评分

参与人数 1星屑 +100 收起 理由
RaidenInfinity + 100 认可答案

查看全部评分

2016/07/17 加入RPG製作,勿忘初衷!
回复

使用道具 举报

梦石
0
星屑
468
在线时间
132 小时
注册时间
2016-6-15
回帖
146
 楼主| 发表于 2017-3-8 12:40:49 | 显示全部楼层
补充一下,谢谢1楼的前辈提醒,于是682行修改数值已经自行解决了

点评

还是因为前辈提醒,我就顺藤摸瓜找有没有x,y轴类似的draw一类的代码一样一样试了_(:зゝ∠)_  发表于 2017-3-8 16:42

评分

参与人数 1星屑 +6 收起 理由
QQ蚊子湯 + 6 好像也不盲嘛!

查看全部评分

技能:Icon绘制,头像&立绘,VA行走图,地图绘制(全PS制作),脚本盲
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部