| 赞 | 46 |
| VIP | |
| 好人卡 | |
| 积分 | 97 |
| 经验 | |
| 最后登录 | 2026-6-17 |
| 在线时间 | 2775 小时 |
梦石0
星屑9716
在线时间2775 小时
注册时间2008-9-5
回帖3458
   
|
楼主 |
发表于 2016-3-6 22:31:08
|
显示全部楼层
本帖最后由 cinderelmini 于 2016-3-18 14:02 编辑
欧买歌 发表于 2016-3-6 19:38 
嗯大触你好ORZ我又来破事问了
2014年学的脚本现在基本全都忘光光了
想把装备界面的攻击力,魔法防御以及武 ...
[fold=【代码】]
- class Window_EquipRight < Window_Selectable
- def initialize(actor)
- super(272, 64, 368, 192 - 32) #(高度减掉1行)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- self.index = 0
- end
- def refresh
- self.contents.clear
- @data = []
- #@data.push($data_weapons[@actor.weapon_id])
- @data.push($data_armors[@actor.armor1_id])
- @data.push($data_armors[@actor.armor2_id])
- @data.push($data_armors[@actor.armor3_id])
- @data.push($data_armors[@actor.armor4_id])
- @item_max = @data.size
- self.contents.font.color = system_color
- #self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
- self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.armor1)
- self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor2)
- self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor3)
- self.contents.draw_text(5, 32 * 3, 92, 32, $data_system.words.armor4)
- #draw_item_name(@data[0], 92, 32 * 0)
- draw_item_name(@data[0], 92, 32 * 0)
- draw_item_name(@data[1], 92, 32 * 1)
- draw_item_name(@data[2], 92, 32 * 2)
- draw_item_name(@data[3], 92, 32 * 3)
- end
- end
- class Window_EquipItem < Window_Selectable
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- # 添加可以装备的武器 (去掉武器)
- =begin
- if @equip_type == 0
- weapon_set = $data_classes[@actor.class_id].weapon_set
- for i in 1...$data_weapons.size
- if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
- @data.push($data_weapons[i])
- end
- end
- end
- =end
- # 添加可以装备的防具
- # if @equip_type != 0 (去掉index为0的判定)
- armor_set = $data_classes[@actor.class_id].armor_set
- for i in 1...$data_armors.size
- if $game_party.armor_number(i) > 0 and armor_set.include?(i)
- # if $data_armors[i].kind == @equip_type-1 (不用-1了)
- if $data_armors[i].kind == @equip_type
- @data.push($data_armors[i])
- end
- end
- end
- # end
- # 添加空白
- @data.push(nil)
- # 生成位图、描绘全部项目
- @item_max = @data.size
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max-1
- draw_item(i)
- end
- end
- end
- class Window_EquipLeft < Window_Base
- def initialize(actor)
- super(0, 64, 272, 192 - 64) #(高度减掉两行也就是64)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 4, 0)
- draw_actor_level(@actor, 4, 32)
- # (y坐标减掉32)
- draw_actor_parameter(@actor, 4, 96 - 32, 1)
- if @new_pdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 96 - 32, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 96 - 32, 36, 32, @new_pdef.to_s, 2)
- end
- =begin
- draw_actor_parameter(@actor, 4, 64, 0)
- draw_actor_parameter(@actor, 4, 128, 2)
- if @new_atk != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 64, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
- end
- if @new_mdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 128, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
- end
- =end
- end
- end
- class Scene_Equip
- def update_item
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 激活右侧窗口
- @right_window.active = true
- @item_window.active = false
- @item_window.index = -1
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 演奏装备 SE
- $game_system.se_play($data_system.equip_se)
- # 获取物品窗口现在选择的装备数据
- item = @item_window.item
- # 变更装备 (index+1才是防具位置开始)
- @actor.equip(@right_window.index + 1, item == nil ? 0 : item.id)
- # 激活右侧窗口
- @right_window.active = true
- @item_window.active = false
- @item_window.index = -1
- # 再生成右侧窗口、物品窗口的内容
- @right_window.refresh
- @item_window.refresh
- return
- end
- end
- end
复制代码 [/fold] |
|