赞 | 153 |
VIP | 10 |
好人卡 | 39 |
积分 | 93 |
经验 | 146191 |
最后登录 | 2024-5-6 |
在线时间 | 2504 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 9280
- 在线时间
- 2504 小时
- 注册时间
- 2011-5-20
- 帖子
- 15389
|
本帖最后由 chd114 于 2012-8-30 10:25 编辑
- $game_party.gain_weapon(3,+$game_variables[71])
复制代码 上面是原来减少武器的脚本,某件武器随即减少71号变量代表的件数,如果不到71号变量件就不执行这段脚本,现在加入耐久脚本后要怎么改- #==============================================================================
- # 装备耐久度 测试版
- # by 沉影不器,chd114为兼容魔塔样板特意修改
- #==============================================================================
- #主要更改:
- #
- # ① 角色的每件装备都是原数据库的克隆品,使每件装备都有唯一id
- # ② 角色物品窗口中所有装备单独一格
- # ③ 更改了商店中对装备的买卖方式,跳过输入数量,只能一件一件买卖
- # ④ 战斗中,打人消耗武器耐久度(非物理攻击的技能不消耗),被打消耗防具耐久度,有一定机率
- # ⑤ 装备耐久度降为 0 时即是装备损坏,装备能力消失,可修复
- # ⑥ 损坏的装备将在大地图上显示
- #------------------------------------------------------------------------------
- #使用说明
- #
- # ① 武器耐久度在[数据库-武器]一栏的武器名称后输入,格式为"武器名,耐久度最大值"
- # 例如"铜剑,12"表示铜剑最大耐久度为12
- # 防具设定同上
- # ② 脚本第28行设定原数据库武器最大id
- # 例如:默认数据库里最后一个武器是密斯利尔杖,id是32
- # ③ 脚本第29行设定原数据库防具最大id,同上
- # ●以上两个常量为必设,须根据您自己的数据库更改,否则出错
- # ④ 脚本第30行设定最大耐久度,
- # ⑤ 角色初期装备最好没有重复id的装备,比如默认数据库中几个人物都用了铜盾(id:1)
- # 这将使几个人物的该铜盾共享一个耐久度
- #==============================================================================
- module DUR
- DATA_WEAPON_SIZE = 10# 原数据库武器最大id
- DATA_ARMOR_SIZE = 15 # 原数据库防具最大id
- DUR_SET_MAX = 999 # 最大耐久度
- end
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- def base_str
- n = $data_actors[@actor_id].parameters[2, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- armor5 = $data_armors[@armor5_id]
- armor6 = $data_armors[@armor6_id]
- armor7 = $data_armors[@armor7_id]
- armor8 = $data_armors[@armor8_id]
- armor9 = $data_armors[@armor9_id]
- armor10 = $data_armors[@armor10_id]
- armor11 = $data_armors[@armor11_id]
- armor12 = $data_armors[@armor12_id]
- armor13 = $data_armors[@armor13_id]
- n += (weapon != nil and weapon.dur > 0) ? weapon.str_plus : 0
- n += (armor1 != nil and armor1.dur > 0) ? armor1.str_plus : 0
- n += (armor2 != nil and armor2.dur > 0) ? armor2.str_plus : 0
- n += (armor3 != nil and armor3.dur > 0) ? armor3.str_plus : 0
- n += (armor4 != nil and armor4.dur > 0) ? armor4.str_plus : 0
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- def base_dex
- n = $data_actors[@actor_id].parameters[3, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- armor5 = $data_armors[@armor5_id]
- armor6 = $data_armors[@armor6_id]
- armor7 = $data_armors[@armor7_id]
- armor8 = $data_armors[@armor8_id]
- armor9 = $data_armors[@armor9_id]
- armor10 = $data_armors[@armor10_id]
- armor11 = $data_armors[@armor11_id]
- armor12 = $data_armors[@armor12_id]
- armor13 = $data_armors[@armor13_id]
- n += (weapon != nil and weapon.dur > 0) ? weapon.dex_plus : 0
- n += (armor1 != nil and armor1.dur > 0) ? armor1.dex_plus : 0
- n += (armor2 != nil and armor2.dur > 0) ? armor2.dex_plus : 0
- n += (armor3 != nil and armor3.dur > 0) ? armor3.dex_plus : 0
- n += (armor4 != nil and armor4.dur > 0) ? armor4.dex_plus : 0
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- def base_agi
- n = $data_actors[@actor_id].parameters[4, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- armor5 = $data_armors[@armor5_id]
- armor6 = $data_armors[@armor6_id]
- armor7 = $data_armors[@armor7_id]
- armor8 = $data_armors[@armor8_id]
- armor9 = $data_armors[@armor9_id]
- armor10 = $data_armors[@armor10_id]
- armor11 = $data_armors[@armor11_id]
- armor12 = $data_armors[@armor12_id]
- armor13 = $data_armors[@armor13_id]
- n += (weapon != nil and weapon.dur > 0) ? weapon.agi_plus : 0
- n += (armor1 != nil and armor1.dur > 0) ? armor1.agi_plus : 0
- n += (armor2 != nil and armor2.dur > 0) ? armor2.agi_plus : 0
- n += (armor3 != nil and armor3.dur > 0) ? armor3.agi_plus : 0
- n += (armor4 != nil and armor4.dur > 0) ? armor4.agi_plus : 0
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- def base_int
- n = $data_actors[@actor_id].parameters[5, @level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- armor5 = $data_armors[@armor5_id]
- armor6 = $data_armors[@armor6_id]
- armor7 = $data_armors[@armor7_id]
- armor8 = $data_armors[@armor8_id]
- armor9 = $data_armors[@armor9_id]
- armor10 = $data_armors[@armor10_id]
- armor11 = $data_armors[@armor11_id]
- armor12 = $data_armors[@armor12_id]
- armor13 = $data_armors[@armor13_id]
- n += (weapon != nil and weapon.dur > 0) ? weapon.int_plus : 0
- n += (armor1 != nil and armor1.dur > 0) ? armor1.int_plus : 0
- n += (armor2 != nil and armor2.dur > 0) ? armor2.int_plus : 0
- n += (armor3 != nil and armor3.dur > 0) ? armor3.int_plus : 0
- n += (armor4 != nil and armor4.dur > 0) ? armor4.int_plus : 0
- return [[n, 1].max, 999].min
- end
- #--------------------------------------------------------------------------
- def base_atk
- weapon = $data_weapons[@weapon_id]
- return (weapon != nil and weapon.dur > 0) ? weapon.atk : 0
- end
- #--------------------------------------------------------------------------
- def base_pdef
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- armor5 = $data_armors[@armor5_id]
- armor6 = $data_armors[@armor6_id]
- armor7 = $data_armors[@armor7_id]
- armor8 = $data_armors[@armor8_id]
- armor9 = $data_armors[@armor9_id]
- armor10 = $data_armors[@armor10_id]
- armor11 = $data_armors[@armor11_id]
- armor12 = $data_armors[@armor12_id]
- armor13 = $data_armors[@armor13_id]
- pdef1 = (weapon != nil and weapon.dur > 0) ? weapon.pdef : 0
- pdef2 = (armor1 != nil and armor1.dur > 0) ? armor1.pdef : 0
- pdef3 = (armor2 != nil and armor2.dur > 0) ? armor2.pdef : 0
- pdef4 = (armor3 != nil and armor3.dur > 0) ? armor3.pdef : 0
- pdef5 = (armor4 != nil and armor4.dur > 0) ? armor4.pdef : 0
- return pdef1 + pdef2 + pdef3 + pdef4 + pdef5
- end
- #--------------------------------------------------------------------------
- def base_mdef
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- armor5 = $data_armors[@armor5_id]
- armor6 = $data_armors[@armor6_id]
- armor7 = $data_armors[@armor7_id]
- armor8 = $data_armors[@armor8_id]
- armor9 = $data_armors[@armor9_id]
- armor10 = $data_armors[@armor10_id]
- armor11 = $data_armors[@armor11_id]
- armor12 = $data_armors[@armor12_id]
- armor13 = $data_armors[@armor13_id]
- mdef1 = (weapon != nil and weapon.dur > 0) ? weapon.mdef : 0
- mdef2 = (armor1 != nil and armor1.dur > 0) ? armor1.mdef : 0
- mdef3 = (armor2 != nil and armor2.dur > 0) ? armor2.mdef : 0
- mdef4 = (armor3 != nil and armor3.dur > 0) ? armor3.mdef : 0
- mdef5 = (armor4 != nil and armor4.dur > 0) ? armor4.mdef : 0
- return mdef1 + mdef2 + mdef3 + mdef4 + mdef5
- end
- #--------------------------------------------------------------------------
- def base_eva
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- armor5 = $data_armors[@armor5_id]
- armor6 = $data_armors[@armor6_id]
- armor7 = $data_armors[@armor7_id]
- armor8 = $data_armors[@armor8_id]
- armor9 = $data_armors[@armor9_id]
- armor10 = $data_armors[@armor10_id]
- armor11 = $data_armors[@armor11_id]
- armor12 = $data_armors[@armor12_id]
- armor13 = $data_armors[@armor13_id]
- eva1 = (armor1 != nil and armor1.dur > 0) ? armor1.eva : 0
- eva2 = (armor2 != nil and armor2.dur > 0) ? armor2.eva : 0
- eva3 = (armor3 != nil and armor3.dur > 0) ? armor3.eva : 0
- eva4 = (armor4 != nil and armor4.dur > 0) ? armor4.eva : 0
- return eva1 + eva2 + eva3 + eva4
- end
- end
- #==============================================================================
- class Game_Party
- #--------------------------------------------------------------------------
- attr_accessor :weapons
- attr_accessor :armors
- #--------------------------------------------------------------------------
- def weapon_number(weapon_id)
- return @weapons.include?(weapon_id) ? @weapons[weapon_id] : 0
- end
- #--------------------------------------------------------------------------
- # 以下修改于<<武器攻击力波动>>(灼眼的夏娜)
- def gain_weapon(weapon_id, n)
- if weapon_id > 0
- if n > 0 # 增加武器的情况
- n = 1
- # 装备栏中使用的武器不处理~
- if $scene.is_a?(Scene_Equip)
- @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
- else
- new_weapon = $data_weapons[weapon_id].clone
- new_weapon.dur_set = $data_weapons[weapon_id].dur_set
- new_weapon.dur = $data_weapons[weapon_id].dur_set
- new_weapon.id = $data_weapons.size
- #数据库扩容
- $data_weapons.push(new_weapon)
- # 职业可装备武器数组更新~
- for i in 1...$data_classes.size
- if $data_classes[i].weapon_set.include?(weapon_id)
- $data_classes[i].weapon_set.push(new_weapon.id)
- end
- end
- # 增加武器~
- @weapons[new_weapon.id] = [[weapon_number(new_weapon.id) + n, 0].max, 99].min
- end
- else # n < 0 减少武器的情况(未定的情况: n = 0)
- n = -1
- # 装备栏中卸下的武器不处理~
- if $scene.is_a?(Scene_Equip)
- @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
- else
- lose_name = $data_weapons[weapon_id].name
- dur_min = DUR::DUR_SET_MAX
- for i in DUR::DATA_WEAPON_SIZE+1...$data_weapons.size
- # 重新确定weapon_id,必定在原武器数据库之外
- # 减少同名武器中耐久度最低的
- if $data_weapons[i].name == lose_name and $data_weapons[i].dur < dur_min
- weapon_id = i
- end
- end
- # 已不存在的不做操作
- if weapon_number(weapon_id) <= 0
- return
- end
- # 减少武器
- @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
- # 删除行囊拥有的武器id,后id补进
- @weapons.delete(weapon_id)
- weapon_keys = @weapons.keys.sort!
- for i in weapon_keys
- if i > weapon_id
- @weapons[i-1] = @weapons[i]
- @weapons.delete(i)
- end
- end
- # 更改角色使用中的武器id
- for i in [email protected]
- if @actors[i].weapon_id != nil and @actors[i].weapon_id > weapon_id
- @actors[i].weapon_id -= 1
- end
- end
- if weapon_id > DUR::DATA_WEAPON_SIZE
- # 删除数据库武器id,后补进
- for i in weapon_id+1...$data_weapons.size
- $data_weapons[i].id -= 1
- end
- $data_weapons.delete_at(weapon_id)
- # 职业可装备武器数组更新
- for i in 1...$data_classes.size
- if $data_classes[i].weapon_set.include?(weapon_id)
- $data_classes[i].weapon_set.delete(weapon_id)
- end
- for j in $data_classes[i].weapon_set
- if j > weapon_id
- $data_classes[i].weapon_set.delete(j)
- j -= 1
- $data_classes[i].weapon_set.push(j)
- end
- end
- end
- end
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- def gain_armor(armor_id, n)
- if armor_id > 0
- if n > 0 # 增加防具的情况
- n = 1
- # 装备栏中使用的防具不处理~
- if $scene.is_a?(Scene_Equip)
- @armors[armor_id] = [[armor_number(armor_id) + n, 0].max, 99].min
- else
- new_armor = $data_armors[armor_id].clone
- new_armor.dur_set = $data_armors[armor_id].dur_set
- new_armor.dur = $data_armors[armor_id].dur_set
- new_armor.id = $data_armors.size
- #数据库扩容
- $data_armors.push(new_armor)
- # 职业可装备防具数组更新~
- for i in 1...$data_classes.size
- if $data_classes[i].armor_set.include?(armor_id)
- $data_classes[i].armor_set.push(new_armor.id)
- end
- end
- # 增加防具
- @armors[new_armor.id] = [[armor_number(new_armor.id) + n, 0].max, 99].min
- end
- else # n < 0 减少防具的情况(未定的情况: n = 0)
- n = -1
- # 装备栏中卸下的防具不处理
- if $scene.is_a?(Scene_Equip)
- @armors[armor_id] = [[armor_number(armor_id) + n, 0].max, 99].min
- else
- lose_name = $data_armors[armor_id].name
- dur_min = DUR::DUR_SET_MAX
- for i in DUR::DATA_ARMOR_SIZE+1...$data_armors.size
- # 重新确定armor_id,必定在原防具数据库之外
- # 减少同名防具中耐久度最低的
- if $data_armors[i].name == lose_name and $data_armors[i].dur < dur_min
- armor_id = i
- end
- end
- # 已不存在的不做操作
- if armor_number(armor_id) <= 0
- return
- end
- # 减少防具
- @armors[armor_id] = [[armor_number(armor_id) + n, 0].max, 99].min
- # 删除行囊拥有的防具id,后id补进
- @weapons.delete(armor_id)
- armor_keys = @armors.keys.sort!
- for i in armor_keys
- if i > armor_id
- @armors[i-1] = @armors[i]
- @armors.delete(i)
- end
- end
- # 更改角色使用中的防具id
- for i in [email protected]
- if @actors[i].armor1_id != nil and @actors[i].armor1_id > armor_id
- @actors[i].armor1_id -= 1
- end
- if @actors[i].armor2_id != nil and @actors[i].armor2_id > armor_id
- @actors[i].armor2_id -= 1
- end
- if @actors[i].armor3_id != nil and @actors[i].armor3_id > armor_id
- @actors[i].armor3_id -= 1
- end
- if @actors[i].armor4_id != nil and @actors[i].armor4_id > armor_id
- @actors[i].armor4_id -= 1
- end
- end
- if armor_id > DUR::DATA_ARMOR_SIZE
- # 删除数据库防具id,后补进
- for i in armor_id+1...$data_armors.size
- $data_armors[i].id -= 1
- end
- $data_armors.delete_at(armor_id)
- # 职业可装备防具数组更新
- for i in 1...$data_classes.size
- if $data_classes[i].armor_set.include?(armor_id)
- $data_classes[i].armor_set.delete(armor_id)
- end
- for j in $data_classes[i].armor_set
- if j > armor_id
- $data_classes[i].armor_set.delete(j)
- j -= 1
- $data_classes[i].armor_set.push(j)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- # ===========================================================================
- class Window_Item < Window_Selectable
- #--------------------------------------------------------------------------
- def update_help
- description = ""
- if self.item != nil
- description = self.item.description
- if !self.item.is_a? RPG::Item
- dur_set = item.dur_set
- dur = item.dur
- description = description + " 耐久度: #{dur}/#{dur_set}"
- end
- end
- @help_window.set_text(description)
- end
- end
- # ===========================================================================
- class Window_EquipItem < Window_Selectable
- #--------------------------------------------------------------------------
- def update_help
- description = ""
- if self.item != nil
- description = self.item.description
- dur_set = item.dur_set
- dur = item.dur
- description = description + " 耐久度: #{dur}/#{dur_set}"
- end
- @help_window.set_text(description)
- end
- end
- # ===========================================================================
- class Window_EquipRight < Window_Selectable
- #--------------------------------------------------------------------------
- def update_help
- description = ""
- if self.item != nil
- description = self.item.description
- dur_set = item.dur_set
- dur = item.dur
- description = description + " 耐久度: #{dur}/#{dur_set}"
- end
- @help_window.set_text(description)
- end
- end
- #==============================================================================
- class Window_ShopBuy < Window_Selectable
- #--------------------------------------------------------------------------
- def update_help
- description = ""
- if self.item != nil
- description = self.item.description
- if !self.item.is_a? RPG::Item
- dur_set = item.dur_set
- dur = item.dur
- description = description + " 耐久度: #{dur}/#{dur_set}"
- end
- end
- @help_window.set_text(description)
- end
- end
- #==============================================================================
- class Window_ShopSell < Window_Selectable
- #--------------------------------------------------------------------------
- def update_help
- description = ""
- if self.item != nil
- description = self.item.description
- if !self.item.is_a? RPG::Item
- dur_set = item.dur_set
- dur = item.dur
- description = description + " 耐久度: #{dur}/#{dur_set}"
- end
- end
- @help_window.set_text(description)
- end
- end
- #==============================================================================
- class Scene_Title
- #--------------------------------------------------------------------------
- alias main_add_dur main
- def main
- main_add_dur
- # 战斗测试的情况下
- if $BTEST
- battle_test
- return
- end
- $data_weapons = load_data("Data/Weapons.rxdata")
- $data_armors = load_data("Data/Armors.rxdata")
- # 初始化耐久度
- for i in 1...$data_weapons.size
- $data_weapons[i].dur = $data_weapons[i].dur_set
- end
- for i in 1...$data_armors.size
- $data_armors[i].dur = $data_armors[i].dur_set
- end
- end
- end
- #==============================================================================
- class Scene_Shop
- #--------------------------------------------------------------------------
- def update_buy
- @status_window.item = @buy_window.item
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- # 窗口状态转向初期模式
- @command_window.active = true
- @dummy_window.visible = true
- @buy_window.active = false
- @buy_window.visible = false
- @status_window.visible = false
- @status_window.item = nil
- @help_window.set_text("")
- return
- end
- if Input.trigger?(Input::C)
- @item = @buy_window.item
- if @item == nil or @item.price > $game_party.gold
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- 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
- if number == 99
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- $game_system.se_play($data_system.decision_se)
- max = @item.price == 0 ? 99 : $game_party.gold / @item.price
- max = [max, 99 - number].min
- if @item.is_a? RPG::Item # 除物品外直接买进1件
- @buy_window.active = false
- @buy_window.visible = false
- @number_window.set(@item, max, @item.price)
- @number_window.active = true
- @number_window.visible = true
- else
- update_number
- end
- end
- end
- #--------------------------------------------------------------------------
- def update_sell
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @command_window.active = true
- @dummy_window.visible = true
- @sell_window.active = false
- @sell_window.visible = false
- @status_window.item = nil
- @help_window.set_text("")
- return
- end
- if Input.trigger?(Input::C)
- @item = @sell_window.item
- @status_window.item = @item
- if @item == nil or @item.price == 0
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- $game_system.se_play($data_system.decision_se)
- 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
- max = number
- if @item.is_a? RPG::Item # 除物品外直接卖出1件
- @sell_window.active = false
- @sell_window.visible = false
- @number_window.set(@item, max, @item.price / 2)
- @number_window.active = true
- @number_window.visible = true
- @status_window.visible = true
- else
- update_number
- end
- end
- end
- end
- #==============================================================================
- class Window_Dur < Window_Base
- #--------------------------------------------------------------------------
- def initialize
- super(0,0,320,480)
- self.opacity = 0
- self.contents = Bitmap.new(width - 32, height - 32)
- @text_dur_old = [0]
- @text_dur = []
- refresh
- end
- #--------------------------------------------------------------------------
- def draw_text_dur(index,y)
- text = @text_dur[index]
- tx = 0
- ty = index * 24 + y
- self.contents.font.color = normal_color
- self.contents.draw_text(tx, ty, 320-32, 24, text)
- end
- #--------------------------------------------------------------------------
- def refresh
- # 节省内存
- if @text_dur_old == @text_dur
- return
- end
- @text_dur.clear
- # 取得空耐久度的装备名
- for i in $game_party.actors
- if $data_weapons[i.weapon_id] != nil and $data_weapons[i.weapon_id].dur == 0
- @text_dur.push(i.name + "-" + $data_weapons[i.weapon_id].name)
- end
- if $data_armors[i.armor1_id] != nil and $data_armors[i.armor1_id].dur == 0
- @text_dur.push(i.name + "-" + $data_armors[i.armor1_id].name)
- end
- if $data_armors[i.armor2_id] != nil and $data_armors[i.armor2_id].dur == 0
- @text_dur.push(i.name + "-" + $data_armors[i.armor2_id].name)
- end
- if $data_armors[i.armor3_id] != nil and $data_armors[i.armor3_id].dur == 0
- @text_dur.push(i.name + "-" + $data_armors[i.armor3_id].name)
- end
- if $data_armors[i.armor4_id] != nil and $data_armors[i.armor4_id].dur == 0
- @text_dur.push(i.name + "-" + $data_armors[i.armor4_id].name)
- end
- end
- @text_dur_old = @text_dur
- y = 448 - @text_dur.size * 24
- self.contents.clear
- self.contents.font.size = 14
- if @text_dur != []
- self.contents.font.color = Color.new(255, 0, 0) # 红色显示
- self.contents.draw_text(0, y - 24, 320 - 32, 24, "装备损坏:")
- end
- for i in 0... @text_dur.size
- draw_text_dur(i,y)
- end
- self.contents.font.size = Font.default_size
- end
- end
- #↑
- #↓
- #==============================================================================
- class Scene_Save < Scene_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)
- $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, file)
- Marshal.dump($data_armors, file)
- Marshal.dump($data_classes, file)
- end
- end
- #==============================================================================
- module RPG
- class Weapon
- attr_accessor :dur_set
- attr_accessor :dur
- def name
- name = @name.split(/,/)[0]
- return name != nil ? name : ''
- end
- def dur_set
- dur_set = @name.split(/-/)[1]
- return dur_set != nil ? dur_set.to_i : 0
- end
- end
- class Armor
- attr_accessor :dur_set
- attr_accessor :dur
- def name
- name = @name.split(/,/)[0]
- return name != nil ? name : ''
- end
- def dur_set
- dur_set = @name.split(/-/)[1]
- return dur_set != nil ? dur_set.to_i : 0
- end
- end
- end
复制代码 另外这个脚本加入后无法正常存档(不是不能存,是存完之后save里面有档位文件,但是却无法读取) |
|