赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1030 |
最后登录 | 2021-2-21 |
在线时间 | 5 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 80
- 在线时间
- 5 小时
- 注册时间
- 2008-2-17
- 帖子
- 125
|
3楼
楼主 |
发表于 2008-11-8 21:37:35
|
只看该作者
- # 组合装备脚本 Written by SLICK
- module RPG
- class Weapon
- attr_accessor :combine
- def description
- return @description.split(/,/)[0].to_s
- end
- def combine
- ccc = @description.split(/,/)[1].to_i
- return ccc = nil ? 0 : ccc
- end
- end
- class Armor
- attr_accessor :combine
- def description
- return @description.split(/,/)[0].to_s
- end
- def combine
- ccc = @description.split(/,/)[1].to_i
- return ccc = nil ? 0 : ccc
- end
- end
- end
- class Scene_Title
- alias etech_main main
- def main
- etech_main
- $data_weapons[1000] = $data_weapons[0]
- $data_armors[1000] = $data_armors[0]
- end
- end
- class Scene_Save < Scene_File
- #--------------------------------------------------------------------------
- # ● 写入存档数据
- # file : 写入用文件对像 (已经打开)
- #--------------------------------------------------------------------------
- def write_save_data(file)
- # 生成描绘存档文件用的角色图形
- characters = []
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- characters.push([actor.character_name, actor.character_hue])
- end
- # 写入描绘存档文件用的角色数据
- Marshal.dump(characters, file)
- # 写入测量游戏时间用画面计数
- Marshal.dump(Graphics.frame_count, file)
- # 增加 1 次存档次数
- $game_system.save_count += 1
- # 保存魔法编号
- # (将编辑器保存的值以随机值替换)
- $game_system.magic_number = $data_system.magic_number
- # 写入各种游戏对像
- Marshal.dump($game_system, file)
- Marshal.dump($game_switches, file)
- Marshal.dump($game_variables, file)
- Marshal.dump($game_self_switches, file)
- Marshal.dump($game_screen, file)
- Marshal.dump($game_actors, file)
- Marshal.dump($game_party, file)
- Marshal.dump($game_troop, file)
- Marshal.dump($game_map, file)
- Marshal.dump($game_player, file)
- Marshal.dump($data_weapons.size, file)
- for iii in 1000...$data_weapons.size
- Marshal.dump($data_weapons[iii], file)
- end
- Marshal.dump($data_armors.size, file)
- for iii in 1000...$data_armors.size
- Marshal.dump($data_armors[iii], file)
- end
- end
- end
- class Scene_Load < Scene_File
- #--------------------------------------------------------------------------
- # ● 读取存档数据
- # file : 读取用文件对像 (已经打开)
- #--------------------------------------------------------------------------
- def read_save_data(file)
- # 读取描绘存档文件用的角色数据
- characters = Marshal.load(file)
- # 读取测量游戏时间用画面计数
- Graphics.frame_count = Marshal.load(file)
- # 读取各种游戏对像
- $game_system = Marshal.load(file)
- $game_switches = Marshal.load(file)
- $game_variables = Marshal.load(file)
- $game_self_switches = Marshal.load(file)
- $game_screen = Marshal.load(file)
- $game_actors = Marshal.load(file)
- $game_party = Marshal.load(file)
- $game_troop = Marshal.load(file)
- $game_map = Marshal.load(file)
- $game_player = Marshal.load(file)
- $data_weapons = []
- $data_armors = []
- $data_weapons = load_data("Data/Weapons.rxdata")
- $data_armors = load_data("Data/Armors.rxdata")
- iii = Marshal.load(file)
- for jjj in 1000...iii
- $data_weapons[jjj]= Marshal.load(file)
- end
- iii = Marshal.load(file)
- for jjj in 1000...iii
- $data_armors[jjj] = Marshal.load(file)
- end
- # 魔法编号与保存时有差异的情况下
- # (加入编辑器的编辑过的数据)
- if $game_system.magic_number != $data_system.magic_number
- # 重新装载地图
- $game_map.setup($game_map.map_id)
- $game_player.center($game_player.x, $game_player.y)
- end
- # 刷新同伴成员
- $game_party.refresh
- end
- end
- #==============================================================================
- # ■ Scene_Combine
- #------------------------------------------------------------------------------
- # 处理合成画面的类。
- #==============================================================================
- class Scene_Combine
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor_index : 角色索引
- # equip_index : 装备索引
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0)
- @actor_index = actor_index
- end
-
- def main
- @help_window = Window_Help.new
- @name_window = Window_NNName.new($game_party.actors[@actor_index])
- @combine_window = Window_Material.new
- @combine_window.help_window = @help_window
- @equip_window = Window_CombineRight.new($game_party.actors[@actor_index])
- @equip_window.help_window = @help_window
- @ccconfirm_window = Window_CCConfirm.new
- @combine_window.visible = true
- @combine_window.active = false
- @equip_window.visible = true
- @equip_window.active = true
- @ccconfirm_window.visible = false
- @ccconfirm_window.active = false
- # 执行过度
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换就中断循环
- if $scene != self
- break
- end
- end
- # 装备过渡
- Graphics.freeze
- # 释放窗口
- @help_window.dispose
- @combine_window.dispose
- @equip_window.dispose
- @name_window.dispose
- @ccconfirm_window.dispose
- end
-
- def update
- @help_window.update
- @combine_window.update
- @equip_window.update
- @ccconfirm_window.update
- if @combine_window.active
- update_combine
- return
- end
- if @equip_window.active
- update_equip
- return
- end
- if @ccconfirm_window.active
- update_ccconfirm
- return
- end
- end
-
- def update_ccconfirm
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @epro_window.dispose
- @ccconfirm_window.active = false
- @ccconfirm_window.visible = false
- @equip_window.active = true
- return
- end
- if Input.trigger?(Input::C)
- case @ccconfirm_window.index
- when 0
- $game_system.se_play($data_system.decision_se)
- iiitem = @combine_window.item
- case @equip_window.index
- when 0
- make_new_equip($data_weapons[$game_party.actors[@actor_index].weapon_id], iiitem)
- when 1
- make_new_equip($data_armors[$game_party.actors[@actor_index].armor1_id], iiitem)
- when 2
- make_new_equip($data_armors[$game_party.actors[@actor_index].armor2_id], iiitem)
- when 3
- make_new_equip($data_armors[$game_party.actors[@actor_index].armor3_id], iiitem)
- when 4
- make_new_equip($data_armors[$game_party.actors[@actor_index].armor4_id], iiitem)
- end
- when 1
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @epro_window.dispose
- @ccconfirm_window.active = false
- @ccconfirm_window.visible = false
- @equip_window.active = true
- end
- return
- end
- if Input.trigger?(Input::UP)
- $game_system.se_play($data_system.cursor_se)
- @ccconfirm_window.index = 0
- return
- end
- if Input.trigger?(Input::DOWN)
- $game_system.se_play($data_system.cursor_se)
- @ccconfirm_window.index = 1
- return
- end
- end
-
- def make_new_equip(combine1, combine2)
- $game_switches[49] = true
- result = rand(100).to_i
- if result >= $game_variables[50]
- $game_party.actors[@actor_index].equip(@equip_window.index, 0, 1)
- $game_variables[49] = 1
- else
- if @equip_window.index == 0
- iii = $data_weapons.size
- kkk = $game_party.actors[@actor_index].weapon_id
- $data_weapons[iii] = $data_weapons[kkk].clone
- $data_weapons[iii].id = iii
- if $new_extra != nil
- $data_weapons[iii].name = ( $data_weapons[kkk].name)
- end
- if $new_element_plus != nil
- $data_weapons[iii].name = ( $data_weapons[kkk].name)
- end
- $data_weapons[iii].description = ($data_weapons[kkk].description + "," + [$data_weapons[kkk].combine - 1].to_s)
- $data_weapons[iii].atk = $data_weapons[kkk].atk + ($atk_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].pdef = $data_weapons[kkk].pdef + ($pdef_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].mdef = $data_weapons[kkk].mdef + ($mdef_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].str_plus = $data_weapons[kkk].str_plus + ($str_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].dex_plus = $data_weapons[kkk].dex_plus + ($dex_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].agi_plus = $data_weapons[kkk].agi_plus + ($agi_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].int_plus = $data_weapons[kkk].int_plus + ($int_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].element_set = $element_plus2
- $game_party.gain_weapon(iii, 1)
- for jjj in 1...$data_classes.size
- if $data_classes[jjj].weapon_set.include?(kkk)
- $data_classes[jjj].weapon_set.push(iii)
- end
- end
- else
- iii = $data_armors.size
- case @equip_window.index
- when 1
- kkk = $game_party.actors[@actor_index].armor1_id
- when 2
- kkk = $game_party.actors[@actor_index].armor2_id
- when 3
- kkk = $game_party.actors[@actor_index].armor3_id
- when 4
- kkk = $game_party.actors[@actor_index].armor4_id
- end
- $data_armors[iii] = $data_armors[kkk].clone
- $data_armors[iii].id = iii
- if $new_extra != nil
- $data_armors[iii].name = ( $data_armors[kkk].name)
- end
- if $new_element_plus != nil
- $data_armors[iii].name = ( $data_armors[kkk].name)
- end
- $data_armors[iii].description = ($data_armors[kkk].description + "," + [$data_armors[kkk].combine - 1].to_s)
- $data_armors[iii].eva = $data_armors[kkk].eva + ($eva_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].pdef = $data_armors[kkk].pdef + ($pdef_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].mdef = $data_armors[kkk].mdef + ($mdef_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].str_plus = $data_armors[kkk].str_plus + ($str_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].dex_plus = $data_armors[kkk].dex_plus + ($dex_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].agi_plus = $data_armors[kkk].agi_plus + ($agi_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].int_plus = $data_armors[kkk].int_plus + ($int_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].guard_element_set = $element_plus2
- $game_party.gain_armor(iii, 1)
- for jjj in 1...$data_classes.size
- if $data_classes[jjj].armor_set.include?(kkk)
- $data_classes[jjj].armor_set.push(iii)
- end
- end
- end
- $game_party.actors[@actor_index].equip(@equip_window.index, iii, 1)
- $game_variables[49] = 0
- end
-
- $game_party.lose_item(combine2.id, 1)
- @epro_window.dispose
- $scene = Scene_Map.new
- end
-
- def update_combine
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @combine_window.active = false
- @equip_window.active = true
- return
- end
- if Input.trigger?(Input::C)
- $game_system.se_play($data_system.decision_se)
- @combine_window.active = false
- @combine2 = @combine_window.item
- @epro_window = Window_EPro.new(@combine1, @combine2)
- @epro_window.visible = true
- @epro_window.active = false
- @ccconfirm_window.active = true
- @ccconfirm_window.visible = true
- end
- end
-
- def update_equip
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- $game_switches[49] = true
- $game_variables[49] = 2
- $scene = Scene_Map.new
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- case @equip_window.index
- when 0
- @combine1 = $data_weapons[$game_party.actors[@actor_index].weapon_id]
- when 1
- @combine1 = $data_armors[$game_party.actors[@actor_index].armor1_id]
- when 2
- @combine1 = $data_armors[$game_party.actors[@actor_index].armor2_id]
- when 3
- @combine1 = $data_armors[$game_party.actors[@actor_index].armor3_id]
- when 4
- @combine1 = $data_armors[$game_party.actors[@actor_index].armor4_id]
- end
- $game_system.se_play($data_system.decision_se)
- if @combine1 == nil
- return
- end
- if @combine1.combine <= 0
- return
- end
- @combine_window.active = true
- @equip_window.active = false
- return
- end
- # 按下 R 键的情况下
- if Input.trigger?(Input::R)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至下一位角色
- @actor_index += 1
- @actor_index %= $game_party.actors.size
- # 切换到别的装备画面
- $scene = Scene_Combine.new(@actor_index)
- return
- end
- # 按下 L 键的情况下
- if Input.trigger?(Input::L)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至上一位角色
- @actor_index += $game_party.actors.size - 1
- @actor_index %= $game_party.actors.size
- # 切换到别的装备画面
- $scene = Scene_Combine.new(@actor_index)
- return
- end
- end
- end
- #==============================================================================
- # ■ Window_Material
- #------------------------------------------------------------------------------
- # 材料窗口。
- #==============================================================================
- class Window_Material < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 64, 320, 416)
- @column_max = 1
- refresh
- self.index = 0
- # 战斗中的情况下将窗口移至中央并将其半透明化
- if $game_temp.in_battle
- self.y = 64
- self.height = 256
- self.back_opacity = 160
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def item
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- # 添加报务
- for i in 1...$data_items.size
- if $game_party.item_number(i) > 0
- if $data_items[i].element_set.include?(31)
- @data.push($data_items[i])
- end
- end
- end
- # 如果项目数不是 0 就生成位图、重新描绘全部项目
- @item_max = @data.size
- if @item_max > 0
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max
- draw_item(i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- case item
- when RPG::Item
- number = $game_party.item_number(item.id)
- when RPG::Weapon
- number = $game_party.weapon_number(item.id)
- when RPG::Armor
- number = $game_party.armor_number(item.id)
- end
- self.contents.font.color = normal_color
- x = 4
- y = index * 32
- rect = Rect.new(x, y, self.width / @column_max - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(item.icon_name)
- opacity = self.contents.font.color == normal_color ? 255 : 128
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
- self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
- self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
- self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(self.item == nil ? "" : self.item.description)
- end
- end
- #==============================================================================
- # ■ Window_EquipRight
- #------------------------------------------------------------------------------
- # 装备画面、显示角色现在装备的物品的窗口。
- #==============================================================================
- class Window_NNName < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(320, 64, 320, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.draw_text(4, 0, 256, 32, actor.name, 0)
- end
- end
- class Window_CombineRight < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(320, 128, 320, 352)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def item
- return @data[self.index]
- 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.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
- self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
- self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
- self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
- self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor4)
- 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)
- draw_item_name(@data[4], 92, 32 * 4)
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- if self.item != nil
- ssstring = self.item.description
- case self.index
- when 0
- ssstring += " 还可以组合" + $data_weapons[@actor.weapon_id].combine.to_s + "次"
- when 1
- ssstring += " 还可以组合" + $data_armors[@actor.armor1_id].combine.to_s + "次"
- when 2
- ssstring += " 还可以组合" + $data_armors[@actor.armor2_id].combine.to_s + "次"
- when 3
- ssstring += " 还可以组合" + $data_armors[@actor.armor3_id].combine.to_s + "次"
- when 4
- ssstring += " 还可以组合" + $data_armors[@actor.armor4_id].combine.to_s + "次"
- end
-
- end
- @help_window.set_text(self.item == nil ? "" : ssstring)
- end
- end
- #==============================================================================
- # ■ Window_EPro
- #------------------------------------------------------------------------------
- # 装备合成界面中的组装前后比较窗口。
- #==============================================================================
- class Window_EPro < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #
- #--------------------------------------------------------------------------
- def initialize(combine1, combine2)
- super(0, 0, 384, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- @combine1 = combine1
- @combine2 = combine2
- refresh
- self.z = 300
- end
-
- def refresh
- self.contents.clear
- if @combine1.is_a?(RPG::Weapon)
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 192, 32, "欲组装的武器:", 0)
- self.contents.font.color = normal_color
- self.contents.draw_text(164, 0, 192, 32, @combine1.name.to_s, 0)
- self.contents.font.color = system_color
- self.contents.draw_text(128, 32, 80, 32, "组装前", 0)
- self.contents.draw_text(256, 32, 80, 32, "组装后", 0)
- self.contents.draw_text(4, 64, 80, 32, "攻击力", 0)
- self.contents.draw_text(4, 96, 80, 32, "物理防", 0)
- self.contents.draw_text(4, 128, 80, 32, "魔法防", 0)
- self.contents.draw_text(4, 160, 80, 32, "加力量", 0)
- self.contents.draw_text(4, 192, 80, 32, "加灵巧", 0)
- self.contents.draw_text(4, 224, 80, 32, "加速度", 0)
- self.contents.draw_text(4, 256, 80, 32, "加魔力", 0)
- self.contents.draw_text(4, 288, 80, 32, "属性", 0)
- self.contents.font.color = normal_color
- self.contents.draw_text(128, 64, 80, 32, @combine1.atk.to_s, 0)
- self.contents.draw_text(128, 96, 80, 32, @combine1.pdef.to_s, 0)
- self.contents.draw_text(128, 128, 80, 32, @combine1.mdef.to_s, 0)
- self.contents.draw_text(128, 160, 80, 32, @combine1.str_plus.to_s, 0)
- self.contents.draw_text(128, 192, 80, 32, @combine1.dex_plus.to_s, 0)
- self.contents.draw_text(128, 224, 80, 32, @combine1.agi_plus.to_s, 0)
- self.contents.draw_text(128, 256, 80, 32, @combine1.int_plus.to_s, 0)
- $str_plus2 = 0
- $dex_plus2 = 0
- $agi_plus2 = 0
- $int_plus2 = 0
- $atk_plus2 = 0
- $new_extra = nil
- case @combine2.parameter_type
- when 1
- $atk_plus2 = @combine2.parameter_points
- $new_extra = ""
- when 3
- $str_plus2 = @combine2.parameter_points
- $new_extra = ""
- when 4
- $dex_plus2 = @combine2.parameter_points
- $new_extra = "敏"
- when 5
- $agi_plus2 = @combine2.parameter_points
- $new_extra = "疾"
- when 6
- $int_plus2 = @combine2.parameter_points
- $new_extra = "灵"
- end
- if $new_extra == nil and @combine2.pdef_f != 0
- $new_extra = "坚"
- end
- if $new_extra == nil and @combine2.mdef_f != 0
- $new_extra = "圣"
- end
- $pdef_plus2 = @combine2.pdef_f
- $mdef_plus2 = @combine2.mdef_f
- self.contents.draw_text(256, 64, 80, 32, $atk_plus2.to_s, 0)
- self.contents.draw_text(256, 96, 80, 32, $pdef_plus2.to_s, 0)
- self.contents.draw_text(256, 128, 80, 32, $mdef_plus2.to_s, 0)
- self.contents.draw_text(256, 160, 80, 32, $str_plus2.to_s, 0)
- self.contents.draw_text(256, 192, 80, 32, $dex_plus2.to_s, 0)
- self.contents.draw_text(256, 224, 80, 32, $agi_plus2.to_s, 0)
- self.contents.draw_text(256, 256, 80, 32, $int_plus2.to_s, 0)
- jjj = 288
- for iii in 1..16
- if @combine1.element_set.include?(iii)
- self.contents.draw_text(128, jjj, 80, 32, $data_system.elements[iii], 0)
- jjj += 32
- end
- end
- $element_plus2 = []
- $new_element_plus = nil
- for iii in 1..16
- if @combine1.element_set.include?(iii)
- $element_plus2.push(iii)
- end
- if @combine2.element_set.include?(iii)
- if $new_element_plus == nil
- $new_element_plus = $data_system.elements[iii].to_s
- end
- $element_plus2.push(iii)
- end
- end
- jjj = 288
- for iii in 1..16
- if $element_plus2.include?(iii)
- self.contents.draw_text(256, jjj, 80, 32, $data_system.elements[iii], 0)
- jjj += 32
- end
- end
- else
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 192, 32, "欲组装的防具:", 0)
- self.contents.font.color = normal_color
- self.contents.draw_text(164, 0, 192, 32, @combine1.name.to_s, 0)
- self.contents.font.color = system_color
- self.contents.draw_text(128, 32, 80, 32, "组装前", 0)
- self.contents.draw_text(256, 32, 80, 32, "组装后", 0)
- self.contents.draw_text(4, 64, 80, 32, "物理防", 0)
- self.contents.draw_text(4, 96, 80, 32, "魔法防", 0)
- self.contents.draw_text(4, 128, 80, 32, "加回避", 0)
- self.contents.draw_text(4, 160, 80, 32, "加力量", 0)
- self.contents.draw_text(4, 192, 80, 32, "加灵巧", 0)
- self.contents.draw_text(4, 224, 80, 32, "加速度", 0)
- self.contents.draw_text(4, 256, 80, 32, "加魔力", 0)
- self.contents.draw_text(4, 288, 80, 32, "属性防御", 0)
- self.contents.font.color = normal_color
- self.contents.draw_text(128, 64, 80, 32, @combine1.pdef.to_s, 0)
- self.contents.draw_text(128, 96, 80, 32, @combine1.mdef.to_s, 0)
- self.contents.draw_text(128, 128, 80, 32, @combine1.eva.to_s, 0)
- self.contents.draw_text(128, 160, 80, 32, @combine1.str_plus.to_s, 0)
- self.contents.draw_text(128, 192, 80, 32, @combine1.dex_plus.to_s, 0)
- self.contents.draw_text(128, 224, 80, 32, @combine1.agi_plus.to_s, 0)
- self.contents.draw_text(128, 256, 80, 32, @combine1.int_plus.to_s, 0)
- $str_plus2 = 0
- $dex_plus2 = 0
- $agi_plus2 = 0
- $int_plus2 = 0
- $eva_plus2 = 0
- $new_extra = nil
- case @combine2.parameter_type
- when 1
- $new_extra = "刚"
- $eva_plus2 = @combine2.parameter_points
- when 3
- $new_extra = "劲"
- $str_plus2 = @combine2.parameter_points
- when 4
- $new_extra = "敏"
- $dex_plus2 = @combine2.parameter_points
- when 5
- $new_extra = "疾"
- $agi_plus2 = @combine2.parameter_points
- when 6
- $new_extra = "灵"
- $int_plus2 = @combine2.parameter_points
- end
- if $new_extra == nil and @combine2.pdef_f != 0
- $new_extra = "坚"
- end
- if $new_extra == nil and @combine2.mdef_f != 0
- $new_extra = "圣"
- end
- $pdef_plus2 = @combine2.pdef_f
- $mdef_plus2 = @combine2.mdef_f
- self.contents.draw_text(256, 64, 80, 32, $pdef_plus2.to_s, 0)
- self.contents.draw_text(256, 96, 80, 32, $mdef_plus2.to_s, 0)
- self.contents.draw_text(256, 128, 80, 32, $eva_plus2.to_s, 0)
- self.contents.draw_text(256, 160, 80, 32, $str_plus2.to_s, 0)
- self.contents.draw_text(256, 192, 80, 32, $dex_plus2.to_s, 0)
- self.contents.draw_text(256, 224, 80, 32, $agi_plus2.to_s, 0)
- self.contents.draw_text(256, 256, 80, 32, $int_plus2.to_s, 0)
- jjj = 288
- for iii in 1..16
- if @combine1.guard_element_set.include?(iii)
- self.contents.draw_text(128, jjj, 80, 32, $data_system.elements[iii], 0)
- jjj += 32
- end
- end
- $element_plus2 = []
- $new_element_plus = nil
- for iii in 1..16
- if @combine1.guard_element_set.include?(iii)
- $element_plus2.push(iii)
- end
- if @combine2.element_set.include?(iii)
- if $new_element_plus == nil
- $new_element_plus = $data_system.elements[iii].to_s
- end
- $element_plus2.push(iii)
- end
- end
- jjj = 288
- for iii in 1..16
- if $element_plus2.include?(iii)
- self.contents.draw_text(256, jjj, 80, 32, $data_system.elements[iii], 0)
- jjj += 32
- end
- end
- end
- self.contents.draw_text(224, 64, 80, 32, "+", 0)
- self.contents.draw_text(224, 96, 80, 32, "+", 0)
- self.contents.draw_text(224, 128, 80, 32, "+", 0)
- self.contents.draw_text(224, 160, 80, 32, "+", 0)
- self.contents.draw_text(224, 192, 80, 32, "+", 0)
- self.contents.draw_text(224, 224, 80, 32, "+", 0)
- self.contents.draw_text(224, 256, 80, 32, "+", 0)
- self.contents.draw_text(224, 288, 80, 32, "+", 0)
- self.contents.draw_text(0, 384, 352, 32, "数值的增加只能表示大概,实际组成", 0)
- self.contents.draw_text(0, 416, 352, 32, "会上下浮动20%,确定要组合吗?", 0)
- end
-
- def update
- refresh
- end
- end
- class Window_CCConfirm < Window_Selectable
- def initialize
- super(384, 384, 128, 96)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- @column_max = 1
- @item_max = 2
- self.index = 0
- self.z = 300
- end
- def refresh
- self.contents.clear
- self.contents.draw_text(0, 0, 64, 32, "好的", 0)
- self.contents.draw_text(0, 32, 64, 32, "不好", 0)
- end
- def update
- refresh
- end
- end
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 变更装备
- # equip_type : 装备类型
- # id : 武器 or 防具 ID (0 为解除装备)
- #--------------------------------------------------------------------------
- def equip(equip_type, id, loseit = 0)
- case equip_type
- when 0 # 武器
- if id == 0 or $game_party.weapon_number(id) > 0
- if loseit == 0
- $game_party.gain_weapon(@weapon_id, 1)
- end
- @weapon_id = id
- $game_party.lose_weapon(id, 1)
- end
- when 1 # 盾
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor1_id], $data_armors[id])
- if loseit == 0
- $game_party.gain_armor(@armor1_id, 1)
- end
- @armor1_id = id
- $game_party.lose_armor(id, 1)
- end
- when 2 # 头
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor2_id], $data_armors[id])
- if loseit == 0
- $game_party.gain_armor(@armor2_id, 1)
- end
- @armor2_id = id
- $game_party.lose_armor(id, 1)
- end
- when 3 # 身体
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor3_id], $data_armors[id])
- if loseit == 0
- $game_party.gain_armor(@armor3_id, 1)
- end
- @armor3_id = id
- $game_party.lose_armor(id, 1)
- end
- when 4 # 装饰品
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor4_id], $data_armors[id])
- if loseit == 0
- $game_party.gain_armor(@armor4_id, 1)
- end
- @armor4_id = id
- $game_party.lose_armor(id, 1)
- end
- end
- end
- end
- #==============================================================================
- # ■ Window_EquipLeft
复制代码 |
|