赞 | 3 |
VIP | 0 |
好人卡 | 0 |
积分 | 2 |
经验 | 45777 |
最后登录 | 2018-5-25 |
在线时间 | 248 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 199
- 在线时间
- 248 小时
- 注册时间
- 2012-4-29
- 帖子
- 386
|
8楼
楼主 |
发表于 2013-5-31 17:46:38
|
只看该作者
=begin
================================================
装备开发系统 版本 1.32 By 804173948 QQ:同上
================================================
更新:
优化画面美观度
与“装备扩展”结合 装备里备注与原脚本相同(类别用 class 数值 与 @type[数值] 功能相同)
自制分类道具栏(可能会发生冲突)
Command 可拥有图标、上色
注意:
本系统只是测试版,可能会有BUG之类的,会不定期更新
使用说明:
1、物品备注填写:
如果这个物品能够被用来开发装备,请按以下要求填写备注——
1、前缀名:<name 名称>
说明:装备开发成功后装备的名称会加上前缀名,如果不填,则取此物品名称的第一个字作为前缀名
如:<name 铁>
开发“剑”武器,成功后就会变成“铁剑”
2、增加能力:<mhp\mmp\atk\def\mat\mdf\agi\luk 数值>
说明:用来提升被开发的装备的各项能力
如:<mhp 100>
<atk 25>
<def 2>
<mat -1>
3、物品类别:<class 数值>
说明:物品的类别(把相近的物品划分为同一类)
注意:数值最好为 0 ~ 15 区间内 如需增加,请修改相性
简单的例子:
物品 1 名称是“铁”
物品 2 名称是“铜”
这两个物品都是金属,所以应该分为同一类
我们把他们分为 第 4 类(<class 4>),那么第四类就是“金属类”
每类物品与每种装备装备对应的相性值请搜索“设置相性”修改
4、能被开发的标志:<useable>
说明:只有写上“<useable>”才能被选择开发材料的窗口显示
备注填写例子:
<name 木>
<atk 1>
<def 1>
<class 3>
<useable>
武器、防具备注填写:
如果这个装备能够被开发,请按以下要求填写备注——
1、熟练度:<exp 数值>
说明:开发这个装备的熟练度,如果此装备无法升级则不填
2、熟练度增加:<add 数值>
说明:每次开发成功增加的熟练度,如果熟练度满了则解锁新装备,如果此装备无法升级则不填
提示:n号武器的熟练度存储在变量 $game_make_item.weapon_exp[n] 中
n号防具的熟练度存储在变量 $game_make_item.armor_exp[n] 中
直接修改熟练度方法:
武器 $data_weapons[id].exp = 新数量
防具 $data_armors[id].exp = 新数量
3、下一级装备:<next 装备ID>
说明:熟练度满了之后解锁的装备,如果此装备无法升级则不填
如:<next 100> (解锁100号装备(武器或防具))
<next 31,38,40> (同时解锁31、38、40号装备(武器或防具))
注意:最多只能同时解锁4个装备
4、装备种类:<class 数值>
说明:装备的类别(子类型)
注意:数值最好为 0 ~ 7 区间内(武器则是 0 ~ 6) 如需增加,请按要求修改子类型(极度不建议)
每类物品与每种装备装备对应的相性值请搜索“设置相性”修改
5、一开始就解锁的标志:<BASIC>(又名“基础装备”)
说明:只有写上“<BASIC>”才能被一开始解锁
6、神秘装备的标志:<lock>
说明:即使上一级的熟练度满了也不一定解锁,需要满足一定的条件才解锁
提示:解锁武器:脚本:$data_weapons[id].lock = false(解锁)/ true(上锁)
解锁防具:脚本:$data_armors[id].lock = false(解锁)/ true(上锁)
提示:
<BASIC> 和 <lock> 可写在同一装备的备注上,但不是一开始就解锁
能力上限可更改,详情请见101行
备注填写例子:
<exp 80>
<add 4>
<next 20>
<class 1>
<BASIC>
注意:判断防具是否饰品: 把防具的装备位置改为“饰品”
2、其他:
修改 最大参加开发人数 方法
$game_make_item.max_maker = 数值(1~3)
如:
$game_make_item.max_maker = 2
那么开发时就可以2个人一起开发了!
(为什么最大是3? 因为太多 1、界面显示不了 ; 2、游戏的不平衡)
修改 各种属性开发最大值 方法
$game_make_item.hmp_max = 数值 (HP、MP最大值修改)默认值是1000
$game_make_item.params_max = 数值 (六种属性最大值修改)默认值是100
说明有待补充
各种冲突:
1、与“物品颜色描绘”脚本 可能发生冲突!
冲突症状:1、直接弹出错误
2、“物品颜色描绘”功能失效
解决方法:去掉“重新定义”的 218~250 行 注释,再删掉 251~258行
其他暂未发现
BUG:
暂无
备注:
本脚本可以简化的(本人偷懒)
(有待简化)
范例的数据库只做了武器 防具还是懒得做了
不要问我数据库里空了的装备是什么,这是国家机密
还有……本人英文水平不好 开始写的时候才刚初二 有许多单词拼写不规范(如:饰品 写成 earring)
=end
#==============================================================================
# ■ MakeEquip
#------------------------------------------------------------------------------
# 模块:开发装备
#==============================================================================
module MakeEquip
# 子类型(可自由修改)
$weapon = ["刀刃","钝器","弓箭","拳套","法杖","其它"] # 武器
$armor = ["头盔","铠甲","魔甲","护腕","战靴","盾牌"] # 防具
$earring = ["头巾","耳环","项链","手鞠","戒指","腰饰","其它"] # 饰品
# 物品类别
$kind_of_item = ["普通布料","魔法布料","岩石","木料","金属","重金属","魔法金属","羽","宝石","其他"]
# 人气值(用途:开发成功后增加售价)(百分比)
$weapon_hot = [45,23,34,18,39,0 ,17]
$armor_hot = [21,51,43,37,19,30,0,9]
$earring_hot = [21,18,27,21,38,13,0,19]
# 设置相性(不会修改者可无视)
$weapon_xx = {
# 类 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ……
"刀刃" => [25 ,20 ,110 ,110 ,135 ,160 ,125 ,15 ,150 ,120 ,140 ,85 ,25 ,30 ],
"钝器" => [10 ,5 ,120 ,130 ,140 ,180 ,120 ,5 ,160 ,105 ,200 ,100 ,50 ,60 ],
"弓箭" => [50 ,50 ,30 ,120 ,45 ,40 ,60 ,140 ,145 ,150 ,135 ,145 ,120 ,140 ],
"拳套" => [105 ,110 ,120 ,72 ,120 ,145 ,140 ,35 ,165 ,175 ,125 ,35 ,15 ,25 ],
"法杖" => [10 ,20 ,30 ,120 ,25 ,15 ,150 ,65 ,180 ,70 ,100 ,135 ,135 ,165 ],
"其它" => [50 ,50 ,120 ,100 ,100 ,95 ,125 ,150 ,200 ,115 ,125 ,120 ,70 ,100 ],
#如需增加子类型
#从这里增加(格式:"子类型名称" => [相性1,2,3...15,16(或更多)])
#相性:对于物品的类型的相性
#例如:相性1 = 对1类别的物品的相性度 如此类推
#注意:"子类型名称" 要与 $weapon 同步
#下同:$armor_xx、$earring_xx 分别是“防具的相性”、“饰品的相性”
}
$armor_xx = {
# 类 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ……
"头盔" => [120 ,40 ,60 ,100 ,140 ,155 ,145 ,40 ,180 ,15 ,70 ,55 ,20 ,20 ],
"铠甲" => [110 ,85 ,50 ,90 ,150 ,160 ,165 ,5 ,200 ,10 ,75 ,50 ,15 ,20 ],
"魔甲" => [150 ,100 ,30 ,45 ,50 ,45 ,180 ,65 ,200 ,20 ,75 ,60 ,20 ,30 ],
"护腕" => [145 ,70 ,60 ,80 ,115 ,135 ,140 ,25 ,175 ,25 ,75 ,40 ,15 ,25 ],
"战靴" => [150 ,90 ,10 ,50 ,65 ,15 ,120 ,110 ,175 ,30 ,105 ,30 ,50 ,55 ],
"盾牌" => [25 ,5 ,50 ,60 ,140 ,180 ,125 ,5 ,160 ,5 ,115 ,100 ,110,125],
}
$earring_xx = {
# 类 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ……
"头巾" => [105,110,15 ,20 ,50 ,35 ,55 ,140 ,135 ,70 ,60 ,40 ,20 ,15 ],
"耳环" => [5 ,15 ,20 ,60 ,80 ,70 ,100,100 ,180 ,70 ,125 ,110,20 ,25 ],
"项链" => [10 ,15 ,10 ,50 ,120 ,115 ,150,115 ,170 ,60 ,100 ,95 ,25 ,20 ],
"手鞠" => [30 ,40 ,15 ,80 ,115 ,140 ,145,75 ,180 ,55 ,105 ,80 ,25 ,25 ],
"戒指" => [25 ,40 ,10 ,35 ,100 ,135 ,145,95 ,200 ,35 ,125 ,55 ,30 ,35 ],
"腰饰" => [70 ,80 ,20 ,50 ,70 ,45 ,90 ,155 ,135 ,30 ,120 ,60 ,35 ,35 ],
"其它" => [40 ,40 ,10 ,35 ,90 ,75 ,115,120 ,150 ,25 ,115 ,50 ,10 ,20 ],
}
@class = 0
@classes = 0
@item = nil
@equip = nil
UP_FLAG = 32 # 能力上升标志图片
ADDNAME = "name"
CLASS = "class"
USEABLE = "useable"
NEED_EXP = "exp"
ADD_EXP = "add"
NEXT_LEVEL = "next"
LOCK = "lock"
BASIC = "BASIC"
ADDPARAM = ["mhp","mmp","atk","def","mat","mdf","agi","luk"]
# 每个能力的名称(可修改)
ParamName = ["血量上限","魔法上限","物理破坏力","物理防御力","魔法破坏力","魔法防御力","灵巧值","幸运值"]
def self.get_or_save_ie(type=true,item,equip)
if type
ie = [@item,@equip]
return ie
else
@item = item
@equip = equip
return
end
end
def self.save_class(value)
@class = value
end
def self.get_class
return @class
end
def self.save_classes(value)
@classes = value
end
def self.get_classes
return @classes
end
end
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● 指令“开始游戏”
#--------------------------------------------------------------------------
alias old command_new_game
def command_new_game
old
for i in 1...$data_weapons.size
$game_party.gain_item($data_weapons,-99,true)
end
for i in 1...$data_armors.size
$game_party.gain_item($data_armors,-99,true)
end
end
end
#==============================================================================
# ■ Scene_Make_Item
#------------------------------------------------------------------------------
# 开发装备
#==============================================================================
class Scene_Make_Item < Scene_MenuBase
include MakeEquip
attr_reader :equip
attr_reader :item
#--------------------------------------------------------------------------
# ● 开始
#--------------------------------------------------------------------------
def start
super
create_window
end
#--------------------------------------------------------------------------
# ● 生成指令窗口
#--------------------------------------------------------------------------
def create_window
create_make_choose_window
end
#--------------------------------------------------------------------------
# ● 帮助窗口
#--------------------------------------------------------------------------
def create_help_window
@help_window = Window_equip_imformation.new(@make_item_window.x,@make_choose_window.height,@make_item_window.width,Graphics.height - @make_choose_window.height - @make_item_window.height)
@help_window.viewport = @viewport
@make_item_window.help_window = @help_window
end
#--------------------------------------------------------------------------
# ● 选择类型窗口
#--------------------------------------------------------------------------
def create_make_choose_window
@make_choose_window = Window_make_choose.new(0,0)
@make_choose_window.height = 48
@make_choose_window.set_handler(:weapon ,method(:makeweapon))
@make_choose_window.set_handler(:armor ,method(:makearmor))
@make_choose_window.set_handler(:earring,method(:makeearring))
@make_choose_window.set_handler(:cancel ,method(:return_scene))
end
#--------------------------------------------------------------------------
# ● 选择子类型窗口
#--------------------------------------------------------------------------
def create_make_weapon_window
@make_window = Window_make_weapon.new(0,@make_choose_window.height,@make_item_window.x,Graphics.height - @make_choose_window.height)
@make_window.set_handler(:ok ,method(:choose_sonkind))
@make_window.set_handler(:cancel ,method(:return_to_choose_mainkind))
@make_window.help_window = @make_item_window
end
def create_make_armor_window
@make_window = Window_make_armor.new(0,@make_choose_window.height,@make_item_window.x,Graphics.height - @make_choose_window.height)
@make_window.set_handler(:ok ,method(:choose_sonkind))
@make_window.set_handler(:cancel ,method(:return_to_choose_mainkind))
@make_window.help_window = @make_item_window
end
def create_make_earring_window
@make_window = Window_make_earring.new(0,@make_choose_window.height,@make_item_window.x,Graphics.height - @make_choose_window.height)
@make_window.set_handler(:ok ,method(:choose_sonkind))
@make_window.set_handler(:cancel ,method(:return_to_choose_mainkind))
@make_window.help_window = @make_item_window
end
#--------------------------------------------------------------------------
# ● 装备列表
#--------------------------------------------------------------------------
def create_make_item_window # 装备列表
@make_item_window = Window_make_item.new#(@actor)
@make_item_window.x = 135 #@make_window.width #Graphics.width - @make_item_window.width
@make_item_window.y = Graphics.height - @make_item_window.height
@make_item_window.set_handler(:ok ,method(:make_item))
@make_item_window.set_handler(:cancel ,method(:close_make_item))
end
#--------------------------------------------------------------------------
# ● 物品列表
#--------------------------------------------------------------------------
def create_item_window # 物品列表
@item_window_help_text = Window_Text_Help.new(325,0,219,48)
@item_window_help_text.draw_help_text("选择材料开发装备")
@item_window = Window_item.new(325,48,219,368)#(@actor)
@item_window.set_handler(:ok ,method(:call_sure_make))
@item_window.set_handler(:cancel ,method(:back_to_equip_list))
@item_window.activate
end
#--------------------------------------------------------------------------
# ● 钱不够了
#--------------------------------------------------------------------------
def create_no_enough_gold
@no_gold_window = Window_Text_Help.new(162,182,220,48)
@no_gold_window.draw_help_text(" 金钱不足! ")
@no_gold_window.set_handler(:ok ,method(:return_scene))
@no_gold_window.set_handler(:cancel ,method(:return_scene))
@no_gold_window.activate
end
#--------------------------------------------------------------------------
# ● 确认框(是 则Call 另一场景)
#--------------------------------------------------------------------------
def create_sure_make_window # 确认
@sure_make_window = Window_sure_make.new#(@actor)
@sure_make_window.set_handler(:yes_make,method(:sure_make))
@sure_make_window.set_handler(:no_make ,method(:back_to_choose_item))
@sure_make_window.set_handler(:cancel ,method(:back_to_choose_item))
@sure_make_window.activate
end
#--------------------------------------------------------------------------
# ● 相性及详细窗口
#--------------------------------------------------------------------------
def create_make_imformation_window # 相性及详细窗口
@make_imformation_window = Window_make_imformation.new#(@actor)
@item_window.help_window = @make_imformation_window
@item_window.equip = @make_item_window.get_item
end
#--------------------------------------------------------------------------
# ● 关闭所有类型窗口
#--------------------------------------------------------------------------
def all_close
@make_window.hide
@make_window.deactivate
@make_choose_window.hide
@make_choose_window.deactivate
end
#--------------------------------------------------------------------------
# ● 选择类型
#--------------------------------------------------------------------------
def makeweapon
MakeEquip::save_classes(1)
@make_window.hide if @make_window
makeoneitem
create_make_weapon_window
@make_window.activate
end
def makearmor
MakeEquip::save_classes(2)
@make_window.hide if @make_window
makeoneitem
create_make_armor_window
@make_window.activate
end
def makeearring
MakeEquip::save_classes(3)
@make_window.hide if @make_window
makeoneitem
create_make_earring_window
@make_window.activate
end
#--------------------------------------------------------------------------
# ● 进入选择装备
#--------------------------------------------------------------------------
def makeoneitem
create_make_item_window
create_help_window
end
#--------------------------------------------------------------------------
# ● 选择装备
#--------------------------------------------------------------------------
def choose_sonkind
@make_item_window.activate
@make_item_window.index = 0
end
#--------------------------------------------------------------------------
# ● 选择父类型
#--------------------------------------------------------------------------
def return_to_choose_mainkind
@make_window.hide
@make_item_window.hide
@help_window.hide
@make_choose_window.activate
end
#--------------------------------------------------------------------------
# ● 关闭选择装备窗口?
#--------------------------------------------------------------------------
def close_make_item
@make_window.activate
end
#--------------------------------------------------------------------------
# ● 确认MakeItem?
#--------------------------------------------------------------------------
def make_item # 确认MakeItem
if @make_item_window.get_item
equip = @make_item_window.get_item
if equip.price > $game_party.gold
create_no_enough_gold
@help_window.hide
else
all_close
create_item_window
create_make_imformation_window
@help_window.hide
@make_item_window.hide
end
else
@make_item_window.activate
end
end
#--------------------------------------------------------------------------
# ● 选择好装备以及物品,call
#--------------------------------------------------------------------------
def call_sure_make
item = @item_window.item
if item
equip = @make_item_window.get_item
if equip.price + item.price > $game_party.gold
create_no_enough_gold
else
create_sure_make_window
end
else
$data_system.sounds[3].play
@item_window.activate
end
end
#--------------------------------------------------------------------------
# ● goto : Scene_Making_Imformation
#--------------------------------------------------------------------------
def sure_make
@item = @item_window.item
@equip = @item_window.equip
MakeEquip::get_or_save_ie(false,@item,@equip)
@make_item_window.deactivate
@make_item_window.close
@help_window.close
@sure_make_window.close
@make_window.close
@make_choose_window.close
SceneManager.goto(Scene_Making_Imformation)
end
#--------------------------------------------------------------------------
# ● 看英文
#--------------------------------------------------------------------------
def back_to_choose_item
@sure_make_window.deactivate
@sure_make_window.hide
@item_window.activate
end
#--------------------------------------------------------------------------
# ● 继续看英文
#--------------------------------------------------------------------------
def back_to_equip_list
@item_window.deactivate
@item_window.hide
@item_window_help_text.hide
@make_imformation_window.hide
@help_window.show
@make_item_window.show
@make_window.show
@make_choose_window.show
@make_item_window.activate
end
#--------------------------------------------------------------------------
# ● ???(貌似作废)
#--------------------------------------------------------------------------
def make_new_equip(equip_id, equip_kind)
if /<#{LOCK}>/i =~ equip_id.note
eid = equip_id.data_id
case equip_kind
when 1
return if @unluckw[eid] = false
when 2
return if @unlucka[eid] = false
end
end
return equip_id
end
end
#==============================================================================
# ■ Get_Item_P
#------------------------------------------------------------------------------
# 获取道具信息
#==============================================================================
class RPG::Item < RPG::UsableItem
include MakeEquip
def addname
if @note =~ /<#{ADDNAME}\s*(\S+?)>/i
return $1 ? $1.to_s : @name[0,1]
end
return @name[0,1]
end
def add_params(param_id)
if @note =~ /<#{ADDPARAM[param_id]} (\d+)\>/i
return $1 ? $1.to_i : 0
elsif @note =~ /<#{ADDPARAM[param_id]} -(\d+)\>/i
i = $1 ? $1.to_i : 0
return -i
end
return 0
end
def class_id
if @note =~ /<#{CLASS} (\d+)\>/i
return $1 ? $1.to_i : -1
end
return -1
end
def is_useable?
return true if @note =~ /<#{USEABLE}>/i
return false
end
end
#==============================================================================
# ■ Get_Weapon_P
#------------------------------------------------------------------------------
# 获取武器信息
#==============================================================================
class RPG::Weapon < RPG::EquipItem
include MakeEquip
attr_accessor :lock
attr_accessor :exp
alias old initialize
def initialize
old
is_lock?
@exp = 0
end
def is_lock?
if @note =~ /<#{BASIC}>/i && @note !~ /<#{LOCK}>/i
@lock = false
else
@lock = true
end
return @lock
end
def need_exp
if @note =~ /<#{NEED_EXP} (\d+)\>/i
return $1 ? $1.to_i : 1
end
return 0
end
def add_exp
if @note =~ /<#{ADD_EXP} (\d+)\>/i
return $1 ? $1.to_i : 1
end
return 0
end
def next_level
unlock_level = []
if @note =~ /<#{NEXT_LEVEL} (\d+)\>/i or @note =~ /<#{NEXT_LEVEL} (\d+)\, (\d+)>/i
unlock_level[0] = $1.to_i if $1
unlock_level[1] = $2.to_i if $2
elsif @note =~ /<#{NEXT_LEVEL} (\d+)\, (\d+)\, (\d+)\>/i or @note =~ /<#{NEXT_LEVEL} (\d+)\, (\d+), (\d+), (\d+)>/i
unlock_level[0] = $1.to_i if $1
unlock_level[1] = $2.to_i if $2
unlock_level[2] = $3.to_i if $3
unlock_level[3] = $4.to_i if $4
end
return unlock_level
end
def class_id
if @note =~ /<#{CLASS} (\d+)\>/i
return $1 ? $1.to_i : -1
elsif /@etype\[(.+?)\]/ =~ @note
return $1 ? $1.to_i : -1
end
return -1
end
end
#==============================================================================
# ■ Get_Armor_P
#------------------------------------------------------------------------------
# 获取防具信息
#==============================================================================
class RPG::Armor < RPG::EquipItem
include MakeEquip
attr_accessor :lock
attr_accessor :exp
alias old initialize
def initialize
old
@etype_id = class_id
is_lock?
@exp = 0
end
def is_lock?
if @note =~ /<#{BASIC}>/i && @note !~ /<#{LOCK}>/i
@lock = false
else
@lock = true
end
return @lock
end
def need_exp
if @note =~ /<#{NEED_EXP} (\d+)\>/i
return $1 ? $1.to_i : 1
end
return 0
end
def add_exp
if @note =~ /<#{ADD_EXP} (\d+)\>/i
return $1 ? $1.to_i : 1
end
return 0
end
def next_level
unlock_level = []
if @note =~ /<#{NEXT_LEVEL} (\d+)\>/i or @note =~ /<#{NEXT_LEVEL} (\d+)\, (\d+)>/i
unlock_level[0] = $1.to_i if $1
unlock_level[1] = $2.to_i if $2
elsif @note =~ /<#{NEXT_LEVEL} (\d+)\, (\d+)\, (\d+)\>/i or @note =~ /<#{NEXT_LEVEL} (\d+)\, (\d+), (\d+), (\d+)>/i
unlock_level[0] = $1.to_i if $1
unlock_level[1] = $2.to_i if $2
unlock_level[2] = $3.to_i if $3
unlock_level[3] = $4.to_i if $4
end
return unlock_level
end
def class_id
if @note =~ /<#{CLASS} (\d+)\>/i
return $1 ? $1.to_i : @etype_id
elsif /@etype\[(.+?)\]/ =~ @note
return $1 ? $1.to_i : @etype_id
end
return @etype_id
end
end
class Window_make_choose < Window_HorzCommand
def window_width
return Graphics.width
end
def col_max
return 3
end
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def make_command_list
add_command("开发武器", :weapon)
add_command("开发防具", :armor)
add_command("开发饰品", :earring)
end
end
class Window_make_weapon < Window_Selectable
def initialize(x, y, width, height)
super(x, y, width, height)
refresh
end
#--------------------------------------------------------------------------
# ● 获取项目数
#--------------------------------------------------------------------------
def item_max
return $weapon.size
end
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def draw_item(index)
draw_text(item_rect(index),$weapon[index],1)
end
#--------------------------------------------------------------------------
# ● 更新帮助内容
#--------------------------------------------------------------------------
def update_help
@help_window.contents.clear
@help_window.make_command_list(@index)
@help_window.update_help
end
end
class Window_make_armor < Window_Selectable
def initialize(x, y, width, height)
super(x, y, width, height)
refresh
end
#--------------------------------------------------------------------------
# ● 获取项目数
#--------------------------------------------------------------------------
def item_max
return $armor.size
end
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def draw_item(index)
draw_text(item_rect(index),$armor[index],1)
end
#--------------------------------------------------------------------------
# ● 更新帮助内容
#--------------------------------------------------------------------------
def update_help
@help_window.contents.clear
@help_window.make_command_list(@index)
@help_window.update_help
end
end
class Window_make_earring < Window_Selectable
def initialize(x, y, width, height)
super(x, y, width, height)
refresh
end
#--------------------------------------------------------------------------
# ● 获取项目数
#--------------------------------------------------------------------------
def item_max
return $earring.size
end
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def draw_item(index)
draw_text(item_rect(index),$earring[index],1)
end
#--------------------------------------------------------------------------
# ● 更新帮助内容
#--------------------------------------------------------------------------
def update_help
@help_window.contents.clear
@help_window.make_command_list(@index)
@help_window.update_help
end
end
class Window_make_item < Window_Selectable
include MakeEquip
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 0,window_width,fitting_height(3))
@itemkind = 0
@itemid = []
@item_max = 0
@hot = 0
make_command_list
end
def visible_line_number
return 3
end
def clear_data
@itemkind = 0
@itemid = []
@item_max = 0
@hot = 0
end
def item_max
if @item_max
return @item_max
else
return 0
end
end
def row_max
[(item_max + col_max - 1) / col_max, 1].max
end
def col_max
return 2
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return Graphics.width - 135
end
#--------------------------------------------------------------------------
# ● 获取装备
#--------------------------------------------------------------------------
def get_item
if item
return @itemkind == 0 ? $data_weapons[item] : $data_armors[item]
end
return nil
end
def item
@itemid && self.index >= 0 ? @itemid[self.index] : nil
end
#--------------------------------------------------------------------------
# ● 获取道具
#--------------------------------------------------------------------------
def make_command_list(kind_class = MakeEquip::get_class - 1)
MakeEquip::save_class(kind_class + 1)
clear_data
case MakeEquip::get_classes
when 1
@hot = $weapon_hot[MakeEquip::get_class - 1]
a = 0
for i in 1...$data_weapons.size
di = $data_weapons
if di.class_id == MakeEquip::get_class - 1
next if di.lock
@itemid[a] = i
a += 1
@itemkind = 0
@item_max = a
draw_item(a - 1)
end
end
if item_max != 0
@index = 0
end
when 2
@hot = $armor_hot[MakeEquip::get_class - 1]
a = 0
for i in 1...$data_armors.size
di = $data_armors
if di.etype_id == MakeEquip::get_class && di.etype_id <= HzhjEquip::ETYPE_ADD_NAME.size
next if di.lock
@itemid[a] = i
a += 1
@itemkind = 1
@item_max = a
draw_item(a - 1)
end
end
if item_max != 0
@index = 0
end
when 3
@hot = $earring_hot[MakeEquip::get_class - 1]
a = 0
for i in 1...$data_armors.size
di = $data_armors
if di.etype_id == MakeEquip::get_class + $earring.size && di.etype_id > HzhjEquip::ETYPE_ADD_NAME2.size
next if di.lock
@itemid[a] = i
a += 1
@itemkind = 1
@item_max = a
draw_item(a - 1)
end
end
if item_max != 0
@index = 0
end
end
end
#--------------------------------------------------------------------------
# ● 更新帮助
#--------------------------------------------------------------------------
def update_help
@help_window.contents.clear
@help_window.draw_item_imformation(@itemid[self.index] ,@itemkind, 4, 0,@hot)#, window_width - 150)
end
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(index)
item = @itemid[index]
if item
rect = item_rect(index)
rect.width -= 4
if @itemkind == 0
draw_item_name($data_weapons[item], rect.x, rect.y, true,item_width)
else
draw_item_name($data_armors[item], rect.x, rect.y, true,item_width)
end
end
end
end
#==============================================================================
# ■ Window_equip_imformation
#------------------------------------------------------------------------------
# 装备资料画面
#==============================================================================
class Window_equip_imformation < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(x, y,width,height)
super(x, y, width, height)
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return Graphics.width - 135
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
return Graphics.height - 172
end
#--------------------------------------------------------------------------
# ● 绘制装备资料
#--------------------------------------------------------------------------
def draw_item_imformation(itemid ,itemkind, x, y,hot)
draw_item_all(itemid ,itemkind, x, y,width,hot)
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
end
#--------------------------------------------------------------------------
# ● 打开窗口
#--------------------------------------------------------------------------
def open
refresh
super
end
end
#==============================================================================
# ■ Window_item
#------------------------------------------------------------------------------
# 选择用来开发的材料
#==============================================================================
class Window_item < Window_ItemList
attr_accessor :equip
def initialize(x, y, width, height)
super
@category = :item
@data = []
refresh
end
#--------------------------------------------------------------------------
# ● 获取列数
#--------------------------------------------------------------------------
def col_max
return 1
end
#--------------------------------------------------------------------------
# ● 获取间隔
#--------------------------------------------------------------------------
def spacing
return 32
end
#--------------------------------------------------------------------------
# ● 能否使用?
#--------------------------------------------------------------------------
def current_item_enabled?
return true
end
#--------------------------------------------------------------------------
# ● 获取道具
#--------------------------------------------------------------------------
def make_item_list
@data = $game_party.all_items.select {|item| include?(item) } # 获取某类型的持有道具
@data.push(nil) if include?(nil)
@data = @data.select {|item| item.is_useable? } # 获取能用的道具
end
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
if item
show
rect = item_rect(index)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, true,172)
draw_item_number(rect, item)
else
hide
end
end
#--------------------------------------------------------------------------
# ● 更新帮助
#--------------------------------------------------------------------------
def update_help
@help_window.contents.clear
@help_window.set_item(item,@equip)
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
make_item_list
create_contents
draw_all_items
end
end
#==============================================================================
# ■ Window_Text_Help
#------------------------------------------------------------------------------
# 帮助文本
#==============================================================================
class Window_Text_Help < Window_Selectable
def initialize(x, y, width, height)
super
refresh
end
#--------------------------------------------------------------------------
# ● 设置文本
#--------------------------------------------------------------------------
def draw_help_text(text = "")
draw_text_ex(2,0,text,width - 4)
end
def refresh
draw_help_text
end
end
#==============================================================================
# ■ Window_make_imformation
#------------------------------------------------------------------------------
# 选择道具窗口帮助
#==============================================================================
class Window_make_imformation < Window_Base
def initialize
super(0,0,325,416)
refresh
end
#--------------------------------------------------------------------------
# ● 设置物品
# item : 技能、物品等
#--------------------------------------------------------------------------
def set_item(item,equip)
draw_ie_imformation(item,equip)
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
end
end
#==============================================================================
# ■ Window_sure_make
#------------------------------------------------------------------------------
# 开发装备(选择角色开发)
#==============================================================================
class Window_sure_make < Window_Command
def initialize
super(0, 0)
update_placement
self.openness = 0
open
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 140
end
#--------------------------------------------------------------------------
# ● 更新窗口的位置
#--------------------------------------------------------------------------
def update_placement
self.x = 544 - window_width
self.y = 416 - window_height
end
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def make_command_list
add_command("开发装备",:yes_make)
add_command(" 返回 ",:no_make)
end
end
第二个 |
|