Project1
标题: ★ 仿网游装备系统 ★<更新[15/3/14]> [打印本页]
作者: 芯☆淡茹水 时间: 2014-1-18 18:28
标题: ★ 仿网游装备系统 ★<更新[15/3/14]> 本帖最后由 芯☆淡茹水 于 2015-5-2 22:00 编辑
很早就打算做个功能多点的装备系统,鱿鱼本人较忙,直到现在放假才完成。
虽说是仿网游装备系统,只是大体相似,还有很多细节的地方没有实现。
详细说明在范例—>脚本有说明,这里只说下特色。
1,武器和角色攻击仿网游实现范围值,也就是:最小攻击 ~ 最大攻击 。获取具体攻击力时从 最小攻击 和 最大攻击 之间随机。
2,增加了武器和角色/敌人的 魔法攻击力 ,并应用到战斗中。所有 攻击力为0 的技能,视为魔法技能,与角色/敌人的 魔法攻击力 关联。
3,该系统每件装备都是独一无二,可随意装备,改造,出售。不会影响同类其他装备。可打造属于自己的极品装备。
4,增加装备耐久度,装备耐久为 0 时,装备的各属性不会加到角色上。耐久 和 最大耐久 可用设置的物品进行修复和提高。
5,装备每升一星,各属性会提高一定百分比。
6,镶嵌的宝石增加属性,可设置的内容有:物理攻击;魔法攻击;最大HP;最大SP;力量;灵巧;速度;魔力;回避;物攻 +?%;魔攻 +?%;物防 +?%;魔防 +?%。
7,还有许多没想到的,可下载范例自己体验 。
****************************************************************************************
更新[14/01/20]
1,简化了一下脚本。
2,增加 装备在升满星并且镶嵌满宝石后,随机额外增加一项属性,并应用到战斗中。(PS:要复杂就再复杂点)
随机属性有 4 项,分别为: 物理伤害减少:?%。
魔法伤害减少:?%。
增加伤害:?%。
?% 的几率忽视目标防御。
(?号为 5到10 的随机数。)
****************************************************************************************
更新[14/05/04]
1,增加职业装备限制,和默认系统一样。
****************************************************************************************
****************************************************************************************
更新[14/05/17]
新增同件装备镶嵌相同宝石的数量限制。
****************************************************************************************
更新[14/06/01]
1, 修复打开背包有时会报错的BUG.
2,修复拆解装备会报错的BUG。
3,在 装备场景 增加简易的装备信息显示。并增加 角色属性显示。
本次更改脚本有:Game_Equip Game_Actor Window_Base Window_Item Window_EquipLeft Window_EquipRight Window_EquipItem
新增加的脚本有:Window_EquipHelp Scene_Equip
****************************************************************************************
****************************************************************************************
更新[14/11/19]
鉴于有上千的下载次数,把工程内的脚本基本统统换血。优化了一些计算方式,更换了物品信息显示窗口,
修复了一些在优化脚本时发现的BUG等。由于一个人的思维不可能太全面,仍然存在的一些BUG望发现者
能够及时回复提出。
****************************************************************************************
****************************************************************************************
更新[15/3/14]
加入试验用的 装备打包和导入 , 具体细节查看工程脚本的说明。
下面是一个装备打包后的文件,可下载后放入工程的 Exchange 文件夹下,进入游戏后可导入到游戏里。
exchange1.rxdata
(272 Bytes, 下载次数: 505)
****************************************************************************************
由于修改和增加了许多内容:定义了装备类,肯定要修改装备的得失和角色各属性;增加了装备的属性,肯定要修改和增加窗口来显示;增加了窗口就要修改场景,,,
所以该系统可能和大部分关于 装备;物品;角色;背包,,,等外挂脚本相冲突。
装备作为自由型RPG游戏的重要元素,喜欢复杂点的装备系统的童鞋,可以尝试使用该系统。
PS:该系统未长时间测试,BUG肯定是有。若发现 BUG ,或里面的计算式不符合,或有更好的建议。请回复。
截图:
[attach]214837[/attach]
[attach]215342[/attach]
工程:
仿网游装备系统.rar
(380.08 KB, 下载次数: 2669, 售价: 5 星屑)
作者: chd114 时间: 2014-1-18 20:20
最后那几张图右下角那个是能量条还是打造修复进度条?
作者: 恐惧剑刃 时间: 2014-1-18 21:18
果断下载学习
作者: yagami 时间: 2014-1-18 23:01
我也写过个类似的装备系统 所以有个建议 在耐久上可以 扩充下 当前耐久 当前最大耐久 真实最大耐久
武器的能力是 耐久/当前最大耐久 * 能力值 这样耐久的作用就大点了 每次修复 当前最大耐久会略微减少 再将耐久= 当前最大耐久 设置个接口可以让 当前最大耐久=真实最大耐久 这样就可以做个稀有道具了
作者: 美丽晨露 时间: 2014-1-19 09:31
看起来好复杂的样子啊
而且跟如果更换游戏中的数据库的
各种数值的话,修改就不好办了
比如:加入回避力,加入命中率,加入······等等
作者: chd114 时间: 2014-1-19 11:25
其实你可以顺便把背包改一改···毕竟网游的背包里面物品只显示图标和数量···名字那些你把光标或者鼠标移上去才会详细显示···
作者: 【凌】 时间: 2014-1-19 12:21
学习一下!!
作者: YeYe. 时间: 2014-1-21 01:41
支持一个~ 另外觉得太复杂 已经超出本小姐这呆脑袋瓜使用了·······
局限性很低········不过很华丽的说
PS:之前的范例里BUG太多,设置起来也比较麻烦,可能过于复杂了吧...........
PPS:我暂时没办法充值,过完年我充值几百V再给LZ补偿
PSP:之前已转5V给LZ,已经收到了吧
作者: ylr5426390 时间: 2014-1-22 14:41
好牛叉..膜拜大神
作者: 【凌】 时间: 2014-1-23 10:26
为什么会这样??????
未命名.jpg
(18.68 KB, 下载次数: 92)
作者: 【凌】 时间: 2014-1-23 12:50
回复 @芯☆淡茹水 。
检查过了,还是这样。
未命名2.jpg
(159.18 KB, 下载次数: 44)
未命名1.jpg
(11.56 KB, 下载次数: 49)
未命名.jpg
(120 KB, 下载次数: 51)
作者: w26010009053 时间: 2014-1-24 20:43
感谢分享
作者: 番茄馅的包子 时间: 2014-1-28 17:51
本人渣渣,有没有不用打孔的版本,习惯于wow,国产的无好感
作者: guoyq1988 时间: 2014-2-2 19:08
芯大越来越厉害了
只是还不兼容防具扩展
虽然不弹出,但只要一卸下武器后就装备不上了
希望以后能兼容
刚把芯式战斗系统弄过去,目前还没发现BUG
作者: y967 时间: 2014-2-11 18:02
在装备界面没有武器和防具属性显示框,也没有属性变化,一定要拿下来在包里才能看见,不方便啊,其他都还好
作者: y967 时间: 2014-2-11 21:12
好的,期待你的完善
还有个小问题,就是打造这个功能,好象装备只要勾选了50以后的属性,界面就有显示,但我想在一开始不出现后面终极的装备,到后期再出现,可否设置一下初期的改造员只显示初期的打造装备
作者: y967 时间: 2014-2-16 15:00
本帖最后由 y967 于 2014-2-16 15:30 编辑
又有问题了,魔法攻击是怎么计算的,计算公式?加入了魔法攻击,技能攻击力不对了,感觉攻击力没用了,魔法攻击也没用了,纯粹是技能的威力在起作用
作者: ziemo375 时间: 2014-2-16 18:59
老板..这盘我要了
作者: y967 时间: 2014-2-17 16:59
本帖最后由 y967 于 2014-2-17 22:43 编辑
问题是 ,技能威力不破防,就没有伤害,魔法攻击和普通攻击都没算进攻击力基数
而且物理攻击的时候也出错了,截图传不上来,和原GAME BATTLER2 冲突了
作者: 【凌】 时间: 2014-2-18 16:35
不能用普通攻击??????
作者: xingmot 时间: 2014-2-18 19:59
问一下,能不能和装备栏增加,装备限制兼容?[附:求转换为VA的]
作者: y967 时间: 2014-2-19 23:10
使用物理攻击的时候,出错了
而且技能伤害公式看不懂了
作者: jamessong 时间: 2014-2-22 23:07
是啊,如果不佩戴武器的话,普通攻击就报错了。求大神帮帮忙修改下行么
作者: Zz1tai 时间: 2014-2-23 09:27
用那个100%强化成功的强化石强化装备 强化等级越高显示的成功率越低 其实还是100% 是我RP太好还是怎么。。。。。 另外 我建议同一个装备上最好让他不能打同样的宝石。
作者: Zz1tai 时间: 2014-2-23 09:35
另外建议一下 比如说 打第一个孔的时候 需要打孔石 打第二个孔需要二级打孔石 打第三个孔需要三级打孔石。 以此类推
作者: Zz1tai 时间: 2014-2-23 09:39
好吧 我又来了 希望增加一个装备宝石拆除的功能 用来拆除已经镶嵌的宝石
作者: y967 时间: 2014-2-23 13:14
你修复了哪条?还是全部重新复制一边?范例测试物理攻击可用了,另外,技能威力设置什么的,是在你这个上设置还是原来的battle3里设置
作者: jamessong 时间: 2014-2-23 16:30
先谢谢楼主修复了普通攻击报错这项。楼主很认真的,但是我设置武器加防御力 然后装备武器后没有任何显示。比如铁剑+15的物理防御,但是装备铁剑以后防御还是不变。希望楼主主能帮忙改改,先谢谢了啊。
作者: jamessong 时间: 2014-2-23 23:12
谢谢楼主,已经完美了。
作者: jamessong 时间: 2014-3-1 01:50
楼主,不好意思有点问题。如果一个武器魔攻是999的话,当角色佩戴这个武器,在战斗的时候使用蓄力这样子的辅助状态技能给自己或队友加状态,被加状态的队友会掉好多血。比如主角999魔攻,然后给自己加蓄力状态,血少的直接 战斗不能 gameover 求芯大帮修
作者: y967 时间: 2014-3-3 20:14
问题:放有状态的技能的时候,怪物会自己掉血,怪物自己放强化力量这个技能,比如附加力量增加100%,怪物会掉很多血,再放一次,直接就死了
作者: uishi121 时间: 2014-3-4 05:58
膜拜大神,
但小弟的工程有些複雜,
可能很難加入大神的腳本了,真是可惜。
作者: eve592370698 时间: 2014-3-4 20:36
数据库里面好像只有一个攻击不分物理和魔法吧?
作者: timiesea 时间: 2014-3-4 23:34
透过这个模仿的系统,感觉被模仿的那一个真正的系统好坑爹,纯粹坑爹!
作者: 西瓜小刀 时间: 2014-3-5 21:59
太棒了!
作者: jamessong 时间: 2014-3-11 08:21
不知道怎么回事,数据库弄把999魔攻,999物攻的武器,然后战斗时装备这个武器。使用状态技能就掉血比如蓄力,使用加血技能(治疗)不加血反而扣血。。。。。。我就是在范例测试的。求大神帮忙。
作者: hs1409 时间: 2014-3-15 13:19
买了下不来。。。
作者: 【凌】 时间: 2014-4-6 22:03
非常好的东西,我等了很久了。
作者: chd114 时间: 2014-4-7 01:39
打孔镶嵌宝石的话建议弄成彩虹岛那种···可以打拼图提升拼图等级赋予能力,打方块降低拼图等级减少能力并恢复一定耐久
作者: guoyq1988 时间: 2014-4-10 22:31
有事来请教芯大
这个系统很强大
但我想让每个职业有固定的武器(默认的)
要不然角色装备的是 斧头 的武器,却显示用 长枪 捅怪的动画
(用的是你的芯式战斗系统+芯式装备系统)
感觉很奇怪
如果角色就一两个还好,可本人的游戏主角有20个(12个宠物)
能否请芯大抽空,帮我修改下呢?不胜感谢~O(∩_∩)O
作者: gu123321gu 时间: 2014-4-25 11:17
下载不鸟怎么办- -
作者: a1035866449 时间: 2014-4-26 19:17
很好的东西啊 ,就是宝石孔不匹配宝石 看着难受。
刚才顺手做了个简单孔图片,然后又顺手做了个窗口图。。。大家看着觉得不错凑合用吧。
作者: zt121670670 时间: 2014-4-27 10:07
芯大为什么在测试的时候有些技能造成的伤害是0
作者: zt121670670 时间: 2014-4-27 10:29
就是用普通攻击打出的伤害为0这到底是为什么啊
作者: zt121670670 时间: 2014-4-27 10:36
可是我看了下每项属性都比他高啊
作者: 盖子 时间: 2014-4-27 10:45
这个似乎不错
作者: Im剑侠客 时间: 2014-5-5 00:19
复杂度相当高啊,得花费不少时间,研究什么的太有趣了。
作者: y967 时间: 2014-5-16 14:27
问题:状态栏显示依旧有问题,显示不全,而且显示的都是乱的
还有,攻击宝石可以镶嵌到防具上,而且武器上也可以镶嵌5个,感觉太多了,只镶嵌一个就好了,其他吧宝石没用了
作者: 九夜神尊 时间: 2014-5-16 15:35
LZ果然大神
光看了截图还有回复,没有下载下来。
看到好多回复提出各种各样的要求,LZ且不能各个都满足。
于是在原作的基础上,留下大大的接口,让他们蹦跶去吧。
作者: y967 时间: 2014-5-17 09:51
拆解紫色的武器时候出错了
作者: y967 时间: 2014-5-17 10:30
有个小意见:你更新的哪条脚本可不可以说出来,我不想再全部复制上去啊,可以吗?
作者: y967 时间: 2014-5-26 12:24
问题:副手(盾)加了速度,但装备上去没有效果,状态里也不显示
作者: 芯☆淡茹水 时间: 2014-5-26 21:04
本帖最后由 芯☆淡茹水 于 2014-5-26 21:11 编辑
@y967
未加之前:
防具盾牌:
加了以后:
如果是状态的话:
未加之前:
防具:
加了之后:
作者: chd114 时间: 2014-6-1 12:29
芯☆淡茹水 发表于 2014-5-26 21:04
@y967
未加之前:
身上多个装备都有状态会不会一起显示?
作者: 刘飞洋 时间: 2014-6-3 16:55
我来试一试,把他整合XAS系统,整合XAS3.9版本问题不大,因为XAS3.9用的就是RM自带的伤害公式。
作者: CJ的世界 时间: 2014-6-4 14:45
大大啊!这系统真的是太好了!真不知道该怎么说了,一定给32个赞
作者: y967 时间: 2014-6-5 16:26
问题:
限制一下20%攻击力石头吧,限制只能武器能镶嵌,要不所有装备都能镶嵌,太变态了
作者: dai754814791 时间: 2014-7-16 20:28
哇,看看,好似好东西啊
作者: 寒影 时间: 2014-7-18 20:57
额……我就想要打造什么的系统啊……
555555貌似容错不好啊
作者: 哆啦溯 时间: 2014-7-27 09:37
本帖最后由 哆啦溯 于 2014-7-27 09:41 编辑
都是很好的脚本啊!特别是我最需要的显示物品详细信息的脚本也有!
但是...都不容易和其他脚本兼容啊{:2_270:}
我目前用的是【物品分类】【装备能力变化】【装备栏拓展】脚本,不知道能不能在这个基础上增加显示物品详细信息的功能?
——脚本盲一个- -
【物品分类】
# ————————————————————————————————————
# 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息
# ————————————————————————————————————
#==============================================================================
# ■ Harts_Window_ItemTitle
#==============================================================================
class Harts_Window_ItemTitle < Window_Base
def initialize
super ( 0 , 0 , 160 , 64 )
self .contents = Bitmap.new ( width - 32 , height - 32 )
self .contents .clear
self .contents .font .color = normal_color
self .contents .draw_text ( 4 , 0 , 120 , 32 , $data_system .words .item , 1 )
end
end
#==============================================================================
# ■ Harts_Window_ItemCommand
#==============================================================================
class Harts_Window_ItemCommand < Window_Selectable
attr_accessor :commands
#--------------------------------------------------------------------------
# ● 初始化,生成commands窗口
#--------------------------------------------------------------------------
def initialize
super ( 0 , 64 , 160 , 352 )
self .contents = Bitmap.new ( width - 32 , height - 32 )
@commands = [ ]
#————————生成commands窗口
for i in 1 ...$data_items.size
if $game_party .item_number ( i) > 0
push = true
for com in @commands
if com == $data_items [ i] .desc
push = false
end
end
if push == true
@commands .push ( $data_items[ i] .desc )
end
end
end
for i in 1 ...$data_weapons.size
if $game_party .weapon_number ( i) > 0
push = true
for com in @commands
if com == $data_weapons [ i] .desc
push = false
end
end
if push == true
@commands .push ( $data_weapons[ i] .desc )
end
end
end
for i in 1 ...$data_armors.size
if $game_party .armor_number ( i) > 0
push = true
for com in @commands
if com == $data_armors [ i] .desc
push = false
end
end
if push == true
@commands .push ( $data_armors[ i] .desc )
end
end
end
if @commands == [ ]
@commands .push ( "普通物品" )
end
@item_max = @commands .size
refresh
self .index = 0
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def refresh
self .contents .clear
for i in 0 ...@item_max
draw_item( i, normal_color)
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_item( index, color)
self .contents .font .color = color
y = index * 32
self .contents .draw_text ( 4 , y, 128 , 32 , @commands [ index] )
end
#--------------------------------------------------------------------------
# 只描绘原文字
#--------------------------------------------------------------------------
def update_help
@help_window .set_text ( @commands[ self .index ] )
end
end
#==============================================================================
# ■ Window_Item
#==============================================================================
class Harts_Window_ItemList < Window_Selectable
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def initialize
super ( 160 , 0 , 480 , 416 )
refresh
self .index = 0
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def item
return @data [ self .index ]
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def refresh
if self .contents != nil
self .contents .dispose
self .contents = nil
end
@data = [ ]
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def set_item( command)
refresh
for i in 1 ...$data_items.size
if $game_party .item_number ( i) > 0 and $data_items [ i] .desc == command
@data .push ( $data_items[ i] )
end
end
for i in 1 ...$data_weapons.size
if $game_party .weapon_number ( i) > 0 and $data_weapons [ i] .desc == command
@data .push ( $data_weapons[ i] )
end
end
for i in 1 ...$data_armors.size
if $game_party .armor_number ( i) > 0 and $data_armors [ i] .desc == command
@data .push ( $data_armors[ i] )
end
end
@item_max = @data .size
if @item_max > 0
self .contents = Bitmap.new ( width - 32 , row_max * 32 )
self .contents .clear
for i in 0 ...@item_max
draw_item( i)
end
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def item_number
return @item_max
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
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
if item.is_a ?( RPG::Item ) and
$game_party .item_can_use ?( item.id )
self .contents .font .color = normal_color
else
self .contents .font .color = disabled_color
end
x = 4
y = index * 32
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 + 400 , y, 16 , 32 , ":" , 1 )
self .contents .draw_text ( x + 416 , y, 24 , 32 , number.to_s , 2 )
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_help
@help_window .set_text ( self .item == nil ? "" : self .item .description )
end
end
#==============================================================================
# ■ Harts_Scene_Item
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def main
@itemtitle_window = Harts_Window_ItemTitle.new
@itemcommand_window = Harts_Window_ItemCommand.new
@command_index = @itemcommand_window .index
@itemlist_window = Harts_Window_ItemList.new
@itemlist_window .active = false
@help_window = Window_Help.new
@help_window .x = 0
@help_window .y = 416
@itemcommand_window .help_window = @help_window
@itemlist_window .help_window = @help_window
@target_window = Window_Target.new
@target_window .visible = false
@target_window .active = false
@itemlist_window .set_item ( @itemcommand_window.commands [ @command_index] )
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@itemtitle_window .dispose
@itemcommand_window .dispose
@itemlist_window .dispose
@help_window .dispose
@target_window .dispose
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update
@itemtitle_window .update
@itemcommand_window .update
@itemlist_window .update
@help_window .update
@target_window .update
if @command_index != @itemcommand_window .index
@command_index = @itemcommand_window .index
@itemlist_window .set_item ( @itemcommand_window.commands [ @command_index] )
end
if @itemcommand_window .active
update_itemcommand
return
end
if @itemlist_window .active
update_itemlist
return
end
if @target_window .active
update_target
return
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_itemcommand
if Input.trigger ?( Input::B )
$game_system .se_play ( $data_system.cancel_se )
$scene = Scene_Menu.new ( 0 )
return
end
if Input.trigger ?( Input::C )
if @itemlist_window .item_number == 0
$game_system .se_play ( $data_system.buzzer_se )
return
end
$game_system .se_play ( $data_system.decision_se )
@itemcommand_window .active = false
@itemlist_window .active = true
@itemlist_window .index = 0
return
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_itemlist
if Input.trigger ?( Input::B )
$game_system .se_play ( $data_system.cancel_se )
@itemcommand_window .active = true
@itemlist_window .active = false
@itemlist_window .index = 0
@itemcommand_window .index = @command_index
return
end
if Input.trigger ?( Input::C )
@item = @itemlist_window .item
unless @item .is_a ?( RPG::Item )
$game_system .se_play ( $data_system.buzzer_se )
return
end
unless $game_party .item_can_use ?( @item.id )
$game_system .se_play ( $data_system.buzzer_se )
return
end
$game_system .se_play ( $data_system.decision_se )
if @item .scope >= 3
@itemlist_window .active = false
@target_window .x = 304
@target_window .visible = true
@target_window .active = true
if @item .scope == 4 || @item .scope == 6
@target_window .index = -1
else
@target_window .index = 0
end
else
if @item .common_event_id > 0
$game_temp .common_event_id = @item .common_event_id
$game_system .se_play ( @item.menu_se )
if @item .consumable
$game_party .lose_item ( @item.id , 1 )
@itemlist_window .draw_item ( @itemlist_window.index )
end
$scene = Scene_Map.new
return
end
end
return
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_target
if Input.trigger ?( Input::B )
$game_system .se_play ( $data_system.cancel_se )
unless $game_party .item_can_use ?( @item.id )
@itemlist_window .refresh
end
@itemlist_window .active = true
@target_window .visible = false
@target_window .active = false
@itemlist_window .set_item ( @itemcommand_window.commands [ @command_index] )
return
end
if Input.trigger ?( Input::C )
if $game_party .item_number ( @item.id ) == 0
$game_system .se_play ( $data_system.buzzer_se )
return
end
if @target_window .index == -1
used = false
for i in $game_party .actors
used |= i.item_effect ( @item)
end
end
if @target_window .index >= 0
target = $game_party .actors [ @target_window.index ]
used = target.item_effect ( @item)
end
if used
$game_system .se_play ( @item.menu_se )
if @item .consumable
$game_party .lose_item ( @item.id , 1 )
@itemlist_window .draw_item ( @itemlist_window.index )
@itemlist_window .set_item ( @itemcommand_window.commands [ @command_index] )
end
@target_window .refresh
if $game_party .all_dead ?
$scene = Scene_Gameover.new
return
end
if @item .common_event_id > 0
$game_temp .common_event_id = @item .common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system .se_play ( $data_system.buzzer_se )
end
return
end
end
end
#==============================================================================
# ■ RPG追加定义,使用@符号分类
#==============================================================================
module RPG
class Weapon#武器
def description
description = @description .split ( /@/) [ 0 ]
return description != nil ? description : ''
end
def desc
desc = @description .split ( /@/) [ 1 ]
return desc != nil ? desc : "武器防具"
end
end
class Item#物品
def description
description = @description .split ( /@/) [ 0 ]
return description != nil ? description : ''
end
def desc
desc = @description .split ( /@/) [ 1 ]
return desc != nil ? desc : "物品"
end
end
class Armor#防具
def description
description = @description .split ( /@/) [ 0 ]
return description != nil ? description : ''
end
def desc
desc = @description .split ( /@/) [ 1 ]
return desc != nil ? desc : "武器防具"
end
end
end
# ————————————————————————————————————
# 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息
# ————————————————————————————————————
#==============================================================================
# ■ Harts_Window_ItemTitle
#==============================================================================
class Harts_Window_ItemTitle < Window_Base
def initialize
super ( 0 , 0 , 160 , 64 )
self .contents = Bitmap.new ( width - 32 , height - 32 )
self .contents .clear
self .contents .font .color = normal_color
self .contents .draw_text ( 4 , 0 , 120 , 32 , $data_system .words .item , 1 )
end
end
#==============================================================================
# ■ Harts_Window_ItemCommand
#==============================================================================
class Harts_Window_ItemCommand < Window_Selectable
attr_accessor :commands
#--------------------------------------------------------------------------
# ● 初始化,生成commands窗口
#--------------------------------------------------------------------------
def initialize
super ( 0 , 64 , 160 , 352 )
self .contents = Bitmap.new ( width - 32 , height - 32 )
@commands = [ ]
#————————生成commands窗口
for i in 1 ...$data_items.size
if $game_party .item_number ( i) > 0
push = true
for com in @commands
if com == $data_items [ i] .desc
push = false
end
end
if push == true
@commands .push ( $data_items[ i] .desc )
end
end
end
for i in 1 ...$data_weapons.size
if $game_party .weapon_number ( i) > 0
push = true
for com in @commands
if com == $data_weapons [ i] .desc
push = false
end
end
if push == true
@commands .push ( $data_weapons[ i] .desc )
end
end
end
for i in 1 ...$data_armors.size
if $game_party .armor_number ( i) > 0
push = true
for com in @commands
if com == $data_armors [ i] .desc
push = false
end
end
if push == true
@commands .push ( $data_armors[ i] .desc )
end
end
end
if @commands == [ ]
@commands .push ( "普通物品" )
end
@item_max = @commands .size
refresh
self .index = 0
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def refresh
self .contents .clear
for i in 0 ...@item_max
draw_item( i, normal_color)
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_item( index, color)
self .contents .font .color = color
y = index * 32
self .contents .draw_text ( 4 , y, 128 , 32 , @commands [ index] )
end
#--------------------------------------------------------------------------
# 只描绘原文字
#--------------------------------------------------------------------------
def update_help
@help_window .set_text ( @commands[ self .index ] )
end
end
#==============================================================================
# ■ Window_Item
#==============================================================================
class Harts_Window_ItemList < Window_Selectable
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def initialize
super ( 160 , 0 , 480 , 416 )
refresh
self .index = 0
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def item
return @data [ self .index ]
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def refresh
if self .contents != nil
self .contents .dispose
self .contents = nil
end
@data = [ ]
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def set_item( command)
refresh
for i in 1 ...$data_items.size
if $game_party .item_number ( i) > 0 and $data_items [ i] .desc == command
@data .push ( $data_items[ i] )
end
end
for i in 1 ...$data_weapons.size
if $game_party .weapon_number ( i) > 0 and $data_weapons [ i] .desc == command
@data .push ( $data_weapons[ i] )
end
end
for i in 1 ...$data_armors.size
if $game_party .armor_number ( i) > 0 and $data_armors [ i] .desc == command
@data .push ( $data_armors[ i] )
end
end
@item_max = @data .size
if @item_max > 0
self .contents = Bitmap.new ( width - 32 , row_max * 32 )
self .contents .clear
for i in 0 ...@item_max
draw_item( i)
end
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def item_number
return @item_max
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
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
if item.is_a ?( RPG::Item ) and
$game_party .item_can_use ?( item.id )
self .contents .font .color = normal_color
else
self .contents .font .color = disabled_color
end
x = 4
y = index * 32
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 + 400 , y, 16 , 32 , ":" , 1 )
self .contents .draw_text ( x + 416 , y, 24 , 32 , number.to_s , 2 )
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_help
@help_window .set_text ( self .item == nil ? "" : self .item .description )
end
end
#==============================================================================
# ■ Harts_Scene_Item
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def main
@itemtitle_window = Harts_Window_ItemTitle.new
@itemcommand_window = Harts_Window_ItemCommand.new
@command_index = @itemcommand_window .index
@itemlist_window = Harts_Window_ItemList.new
@itemlist_window .active = false
@help_window = Window_Help.new
@help_window .x = 0
@help_window .y = 416
@itemcommand_window .help_window = @help_window
@itemlist_window .help_window = @help_window
@target_window = Window_Target.new
@target_window .visible = false
@target_window .active = false
@itemlist_window .set_item ( @itemcommand_window.commands [ @command_index] )
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@itemtitle_window .dispose
@itemcommand_window .dispose
@itemlist_window .dispose
@help_window .dispose
@target_window .dispose
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update
@itemtitle_window .update
@itemcommand_window .update
@itemlist_window .update
@help_window .update
@target_window .update
if @command_index != @itemcommand_window .index
@command_index = @itemcommand_window .index
@itemlist_window .set_item ( @itemcommand_window.commands [ @command_index] )
end
if @itemcommand_window .active
update_itemcommand
return
end
if @itemlist_window .active
update_itemlist
return
end
if @target_window .active
update_target
return
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_itemcommand
if Input.trigger ?( Input::B )
$game_system .se_play ( $data_system.cancel_se )
$scene = Scene_Menu.new ( 0 )
return
end
if Input.trigger ?( Input::C )
if @itemlist_window .item_number == 0
$game_system .se_play ( $data_system.buzzer_se )
return
end
$game_system .se_play ( $data_system.decision_se )
@itemcommand_window .active = false
@itemlist_window .active = true
@itemlist_window .index = 0
return
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_itemlist
if Input.trigger ?( Input::B )
$game_system .se_play ( $data_system.cancel_se )
@itemcommand_window .active = true
@itemlist_window .active = false
@itemlist_window .index = 0
@itemcommand_window .index = @command_index
return
end
if Input.trigger ?( Input::C )
@item = @itemlist_window .item
unless @item .is_a ?( RPG::Item )
$game_system .se_play ( $data_system.buzzer_se )
return
end
unless $game_party .item_can_use ?( @item.id )
$game_system .se_play ( $data_system.buzzer_se )
return
end
$game_system .se_play ( $data_system.decision_se )
if @item .scope >= 3
@itemlist_window .active = false
@target_window .x = 304
@target_window .visible = true
@target_window .active = true
if @item .scope == 4 || @item .scope == 6
@target_window .index = -1
else
@target_window .index = 0
end
else
if @item .common_event_id > 0
$game_temp .common_event_id = @item .common_event_id
$game_system .se_play ( @item.menu_se )
if @item .consumable
$game_party .lose_item ( @item.id , 1 )
@itemlist_window .draw_item ( @itemlist_window.index )
end
$scene = Scene_Map.new
return
end
end
return
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_target
if Input.trigger ?( Input::B )
$game_system .se_play ( $data_system.cancel_se )
unless $game_party .item_can_use ?( @item.id )
@itemlist_window .refresh
end
@itemlist_window .active = true
@target_window .visible = false
@target_window .active = false
@itemlist_window .set_item ( @itemcommand_window.commands [ @command_index] )
return
end
if Input.trigger ?( Input::C )
if $game_party .item_number ( @item.id ) == 0
$game_system .se_play ( $data_system.buzzer_se )
return
end
if @target_window .index == -1
used = false
for i in $game_party .actors
used |= i.item_effect ( @item)
end
end
if @target_window .index >= 0
target = $game_party .actors [ @target_window.index ]
used = target.item_effect ( @item)
end
if used
$game_system .se_play ( @item.menu_se )
if @item .consumable
$game_party .lose_item ( @item.id , 1 )
@itemlist_window .draw_item ( @itemlist_window.index )
@itemlist_window .set_item ( @itemcommand_window.commands [ @command_index] )
end
@target_window .refresh
if $game_party .all_dead ?
$scene = Scene_Gameover.new
return
end
if @item .common_event_id > 0
$game_temp .common_event_id = @item .common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system .se_play ( $data_system.buzzer_se )
end
return
end
end
end
#==============================================================================
# ■ RPG追加定义,使用@符号分类
#==============================================================================
module RPG
class Weapon#武器
def description
description = @description .split ( /@/) [ 0 ]
return description != nil ? description : ''
end
def desc
desc = @description .split ( /@/) [ 1 ]
return desc != nil ? desc : "武器防具"
end
end
class Item#物品
def description
description = @description .split ( /@/) [ 0 ]
return description != nil ? description : ''
end
def desc
desc = @description .split ( /@/) [ 1 ]
return desc != nil ? desc : "物品"
end
end
class Armor#防具
def description
description = @description .split ( /@/) [ 0 ]
return description != nil ? description : ''
end
def desc
desc = @description .split ( /@/) [ 1 ]
return desc != nil ? desc : "武器防具"
end
end
end
【装备能力变化】
#==============================================================================
# ■ Window_ShopStatus
#------------------------------------------------------------------------------
# 商店画面、显示物品所持数与角色装备的窗口。
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super ( 368 , 128 , 272 , 352 )
self .contents = Bitmap.new ( width - 32 , height - 32 )
self .contents .font .size = 16
@item = nil
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self .contents .clear
if @item == nil
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
self .contents .font .color = system_color
self .contents .draw_text ( 4 , 0 , 200 , 32 , "所持数" )
self .contents .font .color = normal_color
self .contents .draw_text ( 204 , 0 , 32 , 32 , number.to_s , 2 )
if @item .is_a ?( RPG::Item )
return
end
# 添加装备品信息
for i in 0 ...$game_party.actors .size
# 获取角色
actor = $game_party .actors [ i]
# 可以装备为普通文字颜色、不能装备设置为无效文字颜色
if actor.equippable ?( @item)
self .contents .font .color = normal_color
else
self .contents .font .color = disabled_color
end
# 描绘角色名字
j = 70
self .contents .draw_text ( 0 , 32 + j * i, 120 , 32 , actor.name )
# 获取当前的装备品
if @item .is_a ?( RPG::Weapon )
item1 = $data_weapons [ actor.weapon_id ]
elsif @item .kind == 0
item1 = $data_armors [ actor.armor1_id ]
elsif @item .kind == 1
item1 = $data_armors [ actor.armor2_id ]
elsif @item .kind == 2
item1 = $data_armors [ actor.armor3_id ]
else
item1 = $data_armors [ actor.armor4_id ]
end
# 可以装备的情况
#if actor.equippable?(@item)
# 武器的情况
i += 1
if @item .is_a ?( RPG::Weapon )
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item .atk : 0
pdef1 = item1 != nil ? item1.pdef : 0
pdef2 = @item != nil ? @item .pdef : 0
str1 = item1 != nil ? item1.str_plus : 0
str2 = @item != nil ? @item .str_plus : 0
dex1 = item1 != nil ? item1.dex_plus : 0
dex2 = @item != nil ? @item .dex_plus : 0
agi1 = item1 != nil ? item1.agi_plus : 0
agi2 = @item != nil ? @item .agi_plus : 0
int1 = item1 != nil ? item1.int_plus : 0
int2 = @item != nil ? @item .int_plus : 0
[ url=home.php ?mod=space&uid=101599 ] @atk[ /url] = atk2 - atk1
@str = str2 - str1
@dex = dex2 - dex1
[ url=home.php ?mod=space&uid=6136 ] @agi[ /url] = agi2 - agi1
@int = int2 - int1
@pdef = pdef2 - pdef1
x = -16
self .contents .draw_text ( 80 *0 , x+j * i, 112 , 32 ,"攻击" ,0 )
self .contents .draw_text ( 80 *1 , x+j * i, 112 , 32 ,"力量" ,0 )
self .contents .draw_text ( 80 *2 , x+j * i, 112 , 32 ,"速度" ,0 )
self .contents .draw_text ( 80 *0 , x+j * i+16 , 112 , 32 ,"敏捷" ,0 )
self .contents .draw_text ( 80 *1 , x+j * i+16 , 112 , 32 ,"魔力" ,0 )
self .contents .draw_text ( 80 *2 , x+j * i+16 , 112 , 32 ,"防御" ,0 )
#---------------------------------------------------------------------
q=40 -10
if atk2 >= atk1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if str2 >= str1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if dex2 >= dex1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if agi2 >= agi1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if int2 >= int1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if pdef2 >= pdef1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
q=50
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,@atk.abs .to_s ,0 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,@str.abs .to_s ,0 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,@dex.abs .to_s ,0 )
#---------------------------------------------------------------------
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,@agi.abs .to_s ,0 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,@int.abs .to_s ,0 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,@pdef.abs .to_s ,0 )
end
# 防具的情况
if @item .is_a ?( RPG::Armor )
str1 = item1 != nil ? item1.str_plus : 0
str2 = @item != nil ? @item .str_plus : 0
dex1 = item1 != nil ? item1.dex_plus : 0
dex2 = @item != nil ? @item .dex_plus : 0
agi1 = item1 != nil ? item1.agi_plus : 0
agi2 = @item != nil ? @item .agi_plus : 0
int1 = item1 != nil ? item1.int_plus : 0
int2 = @item != nil ? @item .int_plus : 0
pdef1 = item1 != nil ? item1.pdef : 0
pdef2 = @item != nil ? @item .pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
mdef2 = @item != nil ? @item .mdef : 0
@str = str2 - str1
@dex = dex2 - dex1
[ url=home.php ?mod=space&uid=6136 ] @agi[ /url] = agi2 - agi1
@int = int2 - int1
@pdef = pdef2 - pdef1
@mdef = mdef2 - mdef1
x=-16
self .contents .draw_text ( 80 *0 , x+j * i, 112 , 32 ,"力量" ,0 )
self .contents .draw_text ( 80 *1 , x+j * i, 112 , 32 ,"速度" ,0 )
self .contents .draw_text ( 80 *2 , x+j * i, 112 , 32 ,"敏捷" ,0 )
self .contents .draw_text ( 80 *0 , x+j * i+16 , 112 , 32 ,"魔力" ,0 )
self .contents .draw_text ( 80 *1 , x+j * i+16 , 112 , 32 ,"防御" ,0 )
self .contents .draw_text ( 80 *2 , x+j * i+16 , 112 , 32 ,"魔御" ,0 )
#---------------------------------------------------------------------
q=30
if str2 >= str1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if dex2 >= dex1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if agi2 >= agi1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if int2 >= int1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
q=40 -10
if pdef2 >= pdef1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if mdef2 >= mdef1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
q=50
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,@str.abs .to_s ,0 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,@dex.abs .to_s ,0 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,@agi.abs .to_s ,0 )
#---------------------------------------------------------------------
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,@int.abs .to_s ,0 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,@pdef.abs .to_s ,0 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,@mdef.abs .to_s ,0 )
end
end
self .contents .font .color = normal_color
i -= 1
#self.contents.font.size = 22
# 描绘物品
if item1 != nil
x = 4
y = 64 + 64 * i + 32
#bitmap = RPG::Cache.icon(item1.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, item1.name)
end
end
#end
#--------------------------------------------------------------------------
# ● 设置物品
# item : 新的物品
#--------------------------------------------------------------------------
def item=( item)
if @item != item
@item = item
refresh
end
end
end
#==============================================================================
# ■ Window_ShopStatus
#------------------------------------------------------------------------------
# 商店画面、显示物品所持数与角色装备的窗口。
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super ( 368 , 128 , 272 , 352 )
self .contents = Bitmap.new ( width - 32 , height - 32 )
self .contents .font .size = 16
@item = nil
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self .contents .clear
if @item == nil
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
self .contents .font .color = system_color
self .contents .draw_text ( 4 , 0 , 200 , 32 , "所持数" )
self .contents .font .color = normal_color
self .contents .draw_text ( 204 , 0 , 32 , 32 , number.to_s , 2 )
if @item .is_a ?( RPG::Item )
return
end
# 添加装备品信息
for i in 0 ...$game_party.actors .size
# 获取角色
actor = $game_party .actors [ i]
# 可以装备为普通文字颜色、不能装备设置为无效文字颜色
if actor.equippable ?( @item)
self .contents .font .color = normal_color
else
self .contents .font .color = disabled_color
end
# 描绘角色名字
j = 70
self .contents .draw_text ( 0 , 32 + j * i, 120 , 32 , actor.name )
# 获取当前的装备品
if @item .is_a ?( RPG::Weapon )
item1 = $data_weapons [ actor.weapon_id ]
elsif @item .kind == 0
item1 = $data_armors [ actor.armor1_id ]
elsif @item .kind == 1
item1 = $data_armors [ actor.armor2_id ]
elsif @item .kind == 2
item1 = $data_armors [ actor.armor3_id ]
else
item1 = $data_armors [ actor.armor4_id ]
end
# 可以装备的情况
#if actor.equippable?(@item)
# 武器的情况
i += 1
if @item .is_a ?( RPG::Weapon )
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item .atk : 0
pdef1 = item1 != nil ? item1.pdef : 0
pdef2 = @item != nil ? @item .pdef : 0
str1 = item1 != nil ? item1.str_plus : 0
str2 = @item != nil ? @item .str_plus : 0
dex1 = item1 != nil ? item1.dex_plus : 0
dex2 = @item != nil ? @item .dex_plus : 0
agi1 = item1 != nil ? item1.agi_plus : 0
agi2 = @item != nil ? @item .agi_plus : 0
int1 = item1 != nil ? item1.int_plus : 0
int2 = @item != nil ? @item .int_plus : 0
[ url=home.php ?mod=space&uid=101599 ] @atk[ /url] = atk2 - atk1
@str = str2 - str1
@dex = dex2 - dex1
[ url=home.php ?mod=space&uid=6136 ] @agi[ /url] = agi2 - agi1
@int = int2 - int1
@pdef = pdef2 - pdef1
x = -16
self .contents .draw_text ( 80 *0 , x+j * i, 112 , 32 ,"攻击" ,0 )
self .contents .draw_text ( 80 *1 , x+j * i, 112 , 32 ,"力量" ,0 )
self .contents .draw_text ( 80 *2 , x+j * i, 112 , 32 ,"速度" ,0 )
self .contents .draw_text ( 80 *0 , x+j * i+16 , 112 , 32 ,"敏捷" ,0 )
self .contents .draw_text ( 80 *1 , x+j * i+16 , 112 , 32 ,"魔力" ,0 )
self .contents .draw_text ( 80 *2 , x+j * i+16 , 112 , 32 ,"防御" ,0 )
#---------------------------------------------------------------------
q=40 -10
if atk2 >= atk1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if str2 >= str1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if dex2 >= dex1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if agi2 >= agi1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if int2 >= int1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if pdef2 >= pdef1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
q=50
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,@atk.abs .to_s ,0 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,@str.abs .to_s ,0 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,@dex.abs .to_s ,0 )
#---------------------------------------------------------------------
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,@agi.abs .to_s ,0 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,@int.abs .to_s ,0 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,@pdef.abs .to_s ,0 )
end
# 防具的情况
if @item .is_a ?( RPG::Armor )
str1 = item1 != nil ? item1.str_plus : 0
str2 = @item != nil ? @item .str_plus : 0
dex1 = item1 != nil ? item1.dex_plus : 0
dex2 = @item != nil ? @item .dex_plus : 0
agi1 = item1 != nil ? item1.agi_plus : 0
agi2 = @item != nil ? @item .agi_plus : 0
int1 = item1 != nil ? item1.int_plus : 0
int2 = @item != nil ? @item .int_plus : 0
pdef1 = item1 != nil ? item1.pdef : 0
pdef2 = @item != nil ? @item .pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
mdef2 = @item != nil ? @item .mdef : 0
@str = str2 - str1
@dex = dex2 - dex1
[ url=home.php ?mod=space&uid=6136 ] @agi[ /url] = agi2 - agi1
@int = int2 - int1
@pdef = pdef2 - pdef1
@mdef = mdef2 - mdef1
x=-16
self .contents .draw_text ( 80 *0 , x+j * i, 112 , 32 ,"力量" ,0 )
self .contents .draw_text ( 80 *1 , x+j * i, 112 , 32 ,"速度" ,0 )
self .contents .draw_text ( 80 *2 , x+j * i, 112 , 32 ,"敏捷" ,0 )
self .contents .draw_text ( 80 *0 , x+j * i+16 , 112 , 32 ,"魔力" ,0 )
self .contents .draw_text ( 80 *1 , x+j * i+16 , 112 , 32 ,"防御" ,0 )
self .contents .draw_text ( 80 *2 , x+j * i+16 , 112 , 32 ,"魔御" ,0 )
#---------------------------------------------------------------------
q=30
if str2 >= str1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if dex2 >= dex1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if agi2 >= agi1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if int2 >= int1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
q=40 -10
if pdef2 >= pdef1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
if mdef2 >= mdef1
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,"↑" ,0 )
else
self .contents .font .color = Color.new ( 255 ,0 ,0 ,255 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,"↓" ,0 )
end
#---------------------------------------------------------------------
self .contents .font .color = Color.new ( 159 ,251 ,162 ,255 )
q=50
self .contents .draw_text ( 80 *0 +q, x+j * i, 112 , 32 ,@str.abs .to_s ,0 )
self .contents .draw_text ( 80 *1 +q, x+j * i, 112 , 32 ,@dex.abs .to_s ,0 )
self .contents .draw_text ( 80 *2 +q, x+j * i, 112 , 32 ,@agi.abs .to_s ,0 )
#---------------------------------------------------------------------
self .contents .draw_text ( 80 *0 +q, x+j * i+16 , 112 , 32 ,@int.abs .to_s ,0 )
self .contents .draw_text ( 80 *1 +q, x+j * i+16 , 112 , 32 ,@pdef.abs .to_s ,0 )
self .contents .draw_text ( 80 *2 +q, x+j * i+16 , 112 , 32 ,@mdef.abs .to_s ,0 )
end
end
self .contents .font .color = normal_color
i -= 1
#self.contents.font.size = 22
# 描绘物品
if item1 != nil
x = 4
y = 64 + 64 * i + 32
#bitmap = RPG::Cache.icon(item1.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, item1.name)
end
end
#end
#--------------------------------------------------------------------------
# ● 设置物品
# item : 新的物品
#--------------------------------------------------------------------------
def item=( item)
if @item != item
@item = item
refresh
end
end
end
【装备栏拓展】
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# 防具类追加
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
module RPG
class Armor
def name
name = @name .split ( /,/) [ 0 ]
return name != nil ? name : ''
end
def kind
kind = @name .split ( /,/) [ 1 ]
return kind != nil ? kind.to_i : @kind
end
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# Game_Actor添加新的防具ID,并对相关方法修正
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
class Game_Actor < Game_Battler
attr_reader :armor5_id # 道具 ID
attr_reader :armor6_id # 装饰品 ID
#--------------------------------------------------------------------------
# ● 设置
# actor_id : 角色 ID
#--------------------------------------------------------------------------
alias old_setup setup
def setup( actor_id)
old_setup( actor_id)
@armor5_id = 0
@armor6_id = 0
update_auto_state( nil , $data_armors [ @armor5_id] )
update_auto_state( nil , $data_armors [ @armor6_id] )
end
#--------------------------------------------------------------------------
# ● 取得属性修正值
# element_id : 属性 ID
#--------------------------------------------------------------------------
def element_rate( element_id)
# 获取对应属性有效度的数值
table = [ 0 ,200 ,150 ,100 ,50 ,0 ,-100 ]
result = table[ $data_classes[ @class_id] .element_ranks [ element_id] ]
# 防具能防御本属性的情况下效果减半
for i in [ @armor1_id, @armor2_id , @armor3_id , @armor4_id , @armor5_id , @armor6_id ]
armor = $data_armors [ i]
if armor != nil and armor.guard_element_set .include ?( element_id)
result /= 2
end
end
# 状态能防御本属性的情况下效果减半
for i in @states
if $data_states [ i] .guard_element_set .include ?( element_id)
result /= 2
end
end
# 过程结束
return result
end
#--------------------------------------------------------------------------
# ● 判定防御属性
# state_id : 属性 ID
#--------------------------------------------------------------------------
def state_guard?( state_id)
for i in [ @armor1_id, @armor2_id , @armor3_id , @armor4_id , @armor5_id , @armor6_id ]
armor = $data_armors [ i]
if armor != nil
if armor.guard_state_set .include ?( state_id)
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# ● 获取基本力量
#--------------------------------------------------------------------------
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]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
n += armor5 != nil ? armor5.str_plus : 0
n += armor6 != nil ? armor6.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]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
n += armor5 != nil ? armor5.dex_plus : 0
n += armor6 != nil ? armor6.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]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
n += armor5 != nil ? armor5.agi_plus : 0
n += armor6 != nil ? armor6.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]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
n += armor5 != nil ? armor5.int_plus : 0
n += armor6 != nil ? armor6.int_plus : 0
return [ [ n, 1 ] .max , 999 ] .min
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]
pdef1 = weapon != nil ? weapon.pdef : 0
pdef2 = armor1 != nil ? armor1.pdef : 0
pdef3 = armor2 != nil ? armor2.pdef : 0
pdef4 = armor3 != nil ? armor3.pdef : 0
pdef5 = armor4 != nil ? armor4.pdef : 0
pdef6 = armor5 != nil ? armor5.pdef : 0
pdef7 = armor6 != nil ? armor6.pdef : 0
return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + pdef6 + pdef7
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]
mdef1 = weapon != nil ? weapon.mdef : 0
mdef2 = armor1 != nil ? armor1.mdef : 0
mdef3 = armor2 != nil ? armor2.mdef : 0
mdef4 = armor3 != nil ? armor3.mdef : 0
mdef5 = armor4 != nil ? armor4.mdef : 0
mdef6 = armor5 != nil ? armor5.mdef : 0
mdef7 = armor6 != nil ? armor6.mdef : 0
return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 + mdef6 + mdef7
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]
eva1 = armor1 != nil ? armor1.eva : 0
eva2 = armor2 != nil ? armor2.eva : 0
eva3 = armor3 != nil ? armor3.eva : 0
eva4 = armor4 != nil ? armor4.eva : 0
eva5 = armor5 != nil ? armor5.eva : 0
eva6 = armor6 != nil ? armor6.eva : 0
return eva1 + eva2 + eva3 + eva4 + eva5 + eva6
end
#--------------------------------------------------------------------------
# ● 装备固定判定
# equip_type : 装备类型
#--------------------------------------------------------------------------
def equip_fix?( equip_type)
case equip_type
when 0 # 武器
return $data_actors [ @actor_id] .weapon_fix
when 1 # 盾
return $data_actors [ @actor_id] .armor1_fix
when 2 # 头
return $data_actors [ @actor_id] .armor2_fix
when 3 # 身体
return $data_actors [ @actor_id] .armor3_fix
when 4 # 道具
return $data_actors [ @actor_id] .armor4_fix
end
return false
end
#--------------------------------------------------------------------------
# ● 变更装备
# equip_type : 装备类型
# id : 武器 or 防具 ID (0 为解除装备)
#--------------------------------------------------------------------------
def equip( equip_type, id)
case equip_type
when 0 # 武器
if id == 0 or $game_party .weapon_number ( id) > 0
$game_party .gain_weapon ( @weapon_id, 1 )
@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] )
$game_party .gain_armor ( @armor1_id, 1 )
@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] )
$game_party .gain_armor ( @armor2_id, 1 )
@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] )
$game_party .gain_armor ( @armor3_id, 1 )
@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] )
$game_party .gain_armor ( @armor4_id, 1 )
@armor4_id = id
$game_party .lose_armor ( id, 1 )
end
when 5 # 装饰品
if id == 0 or $game_party .armor_number ( id) > 0
update_auto_state( $data_armors[ @armor5_id] , $data_armors [ id] )
$game_party .gain_armor ( @armor5_id, 1 )
@armor5_id = id
$game_party .lose_armor ( id, 1 )
end
when 6 # 道具
if id == 0 or $game_party .armor_number ( id) > 0
update_auto_state( $data_armors[ @armor6_id] , $data_armors [ id] )
$game_party .gain_armor ( @armor6_id, 1 )
@armor6_id = id
$game_party .lose_armor ( id, 1 )
end
end
end
#--------------------------------------------------------------------------
# ● 更改职业 ID
# class_id : 新的职业 ID
#--------------------------------------------------------------------------
def class_id=( class_id)
if $data_classes [ class_id] != nil
@class_id = class_id
# 避开无法装备的物品
unless equippable?( $data_weapons[ @weapon_id] )
equip( 0 , 0 )
end
unless equippable?( $data_armors[ @armor1_id] )
equip( 1 , 0 )
end
unless equippable?( $data_armors[ @armor2_id] )
equip( 2 , 0 )
end
unless equippable?( $data_armors[ @armor3_id] )
equip( 3 , 0 )
end
unless equippable?( $data_armors[ @armor4_id] )
equip( 4 , 0 )
end
unless equippable?( $data_armors[ @armor5_id] )
equip( 5 , 0 )
end
unless equippable?( $data_armors[ @armor6_id] )
equip( 6 , 0 )
end
end
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# Window_Base美化,增加属性增减颜色,及全能力值描绘
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
################## 属性增减颜色 ##############################
def up_color
return Color.new ( 255 , 0 , 0 )
end
def down_color
return Color.new ( 0 , 255 , 0 )
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter( actor, x, y, type)
case type
when 0
parameter_name = $data_system .words .atk
parameter_value = actor.atk
when 1
parameter_name = $data_system .words .pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system .words .mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system .words .str
parameter_value = actor.str
when 4
parameter_name = $data_system .words .dex
parameter_value = actor.dex
when 5
parameter_name = $data_system .words .agi
parameter_value = actor.agi
when 6
parameter_name = $data_system .words .int
parameter_value = actor.int
when 7
parameter_name = "回避"
parameter_value = actor.eva
end
self .contents .font .color = system_color
self .contents .draw_text ( x, y, 120 , 32 , parameter_name)
self .contents .font .color = normal_color
self .contents .draw_text ( x + 120 , y, 36 , 32 , parameter_value.to_s , 2 )
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# 装备窗口美化,全能力值描绘并追加新的防具装备栏
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#==============================================================================
# ■ Window_EquipRight
#------------------------------------------------------------------------------
# 装备画面、显示角色现在装备的物品的窗口。
#==============================================================================
class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize( actor)
super ( 272 , 64 , 368 , 256 )
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 ] )
@data .push ( $data_armors[ @actor.armor5_id ] )
@data .push ( $data_armors[ @actor.armor6_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 * 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 )
self .contents .draw_text ( 4 , 32 * 5 , 92 , 32 , "道具" )
self .contents .draw_text ( 4 , 32 * 6 , 92 , 32 , "装饰品" )
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 )
draw_item_name( @data[ 5 ] , 92 , 32 * 5 )
draw_item_name( @data[ 6 ] , 92 , 32 * 6 )
end
end
#==============================================================================
# ■ Window_EquipLeft
#------------------------------------------------------------------------------
# 装备画面的、显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipLeft < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize( actor)
super ( 0 , 64 , 272 , 416 )
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 )
draw_actor_parameter( @actor, 4 , 64 , 0 )
draw_actor_parameter( @actor, 4 , 96 , 1 )
draw_actor_parameter( @actor, 4 , 128 , 2 )
draw_actor_parameter( @actor, 4 , 160 , 7 )
draw_actor_parameter( @actor, 4 , 192 , 3 )
draw_actor_parameter( @actor, 4 , 224 , 4 )
draw_actor_parameter( @actor, 4 , 256 , 5 )
draw_actor_parameter( @actor, 4 , 288 , 6 )
if @new_atk != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 64 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_atk >@actor.atk ? up_color : down_color
self .contents .font .color = normal_color if @new_atk == @actor .atk
self .contents .draw_text ( 200 , 64 , 36 , 32 , @new_atk .to_s , 2 )
end
if @new_pdef != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 96 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_pdef >@actor.pdef ? up_color : down_color
self .contents .font .color = normal_color if @new_pdef == @actor .pdef
self .contents .draw_text ( 200 , 96 , 36 , 32 , @new_pdef .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 = @new_mdef >@actor.mdef ? up_color : down_color
self .contents .font .color = normal_color if @new_mdef == @actor .mdef
self .contents .draw_text ( 200 , 128 , 36 , 32 , @new_mdef .to_s , 2 )
end
if @new_eva != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 160 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_eva >@actor.eva ? up_color : down_color
self .contents .font .color = normal_color if @new_eva == @actor .eva
self .contents .draw_text ( 200 , 160 , 36 , 32 , @new_eva .to_s , 2 )
end
if @new_str != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 192 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_str >@actor.str ? up_color : down_color
self .contents .font .color = normal_color if @new_str == @actor .str
self .contents .draw_text ( 200 , 192 , 36 , 32 , @new_str .to_s , 2 )
end
if @new_dex != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 224 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_dex >@actor.dex ? up_color : down_color
self .contents .font .color = normal_color if @new_dex == @actor .dex
self .contents .draw_text ( 200 , 224 , 36 , 32 , @new_dex .to_s , 2 )
end
if @new_agi != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 256 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_agi >@actor.agi ? up_color : down_color
self .contents .font .color = normal_color if @new_agi == @actor .agi
self .contents .draw_text ( 200 , 256 , 36 , 32 , @new_agi .to_s , 2 )
end
if @new_int != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 288 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_int >@actor.int ? up_color : down_color
self .contents .font .color = normal_color if @new_int == @actor .int
self .contents .draw_text ( 200 , 288 , 36 , 32 , @new_int .to_s , 2 )
end
end
#--------------------------------------------------------------------------
# ● 变更装备后的能力值设置
# new_atk : 变更装备后的攻击力
# new_pdef : 变更装备后的物理防御
# new_mdef : 变更装备后的魔法防御
#--------------------------------------------------------------------------
def set_new_parameters( new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or @new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_eva = new_eva
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
refresh
end
end
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
# equip_type : 装备部位 (0~3)
#--------------------------------------------------------------------------
def initialize( actor, equip_type)
super ( 272 , 320 , 368 , 160 )
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self .active = false
self .index = -1
end
#--------------------------------------------------------------------------
# ● 项目的描绘
# index : 项目符号
#--------------------------------------------------------------------------
def draw_item( index)
item = @data [ index]
x = 4
y = index * 32
case item
when RPG::Weapon
number = $game_party .weapon_number ( item.id )
when RPG::Armor
number = $game_party .armor_number ( item.id )
end
bitmap = RPG::Cache .icon ( item.icon_name )
self .contents .blt ( x, y + 4 , bitmap, Rect.new ( 0 , 0 , 24 , 24 ) )
self .contents .font .color = normal_color
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
end
class Scene_Equip
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 获取角色
@actor = $game_party .actors [ @actor_index]
# 生成窗口
@help_window = Window_Help.new
@left_window = Window_EquipLeft.new ( @actor)
@right_window = Window_EquipRight.new ( @actor)
@item_window1 = Window_EquipItem.new ( @actor, 0 )
@item_window2 = Window_EquipItem.new ( @actor, 1 )
@item_window3 = Window_EquipItem.new ( @actor, 2 )
@item_window4 = Window_EquipItem.new ( @actor, 3 )
@item_window5 = Window_EquipItem.new ( @actor, 4 )
@item_window6 = Window_EquipItem.new ( @actor, 5 )
@item_window7 = Window_EquipItem.new ( @actor, 6 )
# 关联帮助窗口
@right_window .help_window = @help_window
@item_window1 .help_window = @help_window
@item_window2 .help_window = @help_window
@item_window3 .help_window = @help_window
@item_window4 .help_window = @help_window
@item_window5 .help_window = @help_window
@item_window6 .help_window = @help_window
@item_window7 .help_window = @help_window
# 设置光标位置
@right_window .index = @equip_index
refresh
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面切换的话的就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@help_window .dispose
@left_window .dispose
@right_window .dispose
@item_window1 .dispose
@item_window2 .dispose
@item_window3 .dispose
@item_window4 .dispose
@item_window5 .dispose
@item_window6 .dispose
@item_window7 .dispose
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
# 设置物品窗口的可视状态
@item_window1 .visible = ( @right_window.index == 0 )
@item_window2 .visible = ( @right_window.index == 1 )
@item_window3 .visible = ( @right_window.index == 2 )
@item_window4 .visible = ( @right_window.index == 3 )
@item_window5 .visible = ( @right_window.index == 4 )
@item_window6 .visible = ( @right_window.index == 5 )
@item_window7 .visible = ( @right_window.index == 6 )
# 获取当前装备中的物品
item1 = @right_window .item
# 设置当前的物品窗口到 @item_window
case @right_window .index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
when 5
@item_window = @item_window6
when 6
@item_window = @item_window7
end
# 右窗口被激活的情况下
if @right_window .active
# 删除变更装备后的能力
###############################################################
@left_window .set_new_parameters ( nil , nil , nil , nil , nil , nil , nil , nil )
end
# 物品窗口被激活的情况下
if @item_window .active
# 获取现在选中的物品
item2 = @item_window .item
# 变更装备
last_hp = @actor .hp
last_sp = @actor .sp
@actor .equip ( @right_window.index , item2 == nil ? 0 : item2.id )
###############################################################
# 获取变更装备后的能力值
new_atk = @actor .atk
new_pdef = @actor .pdef
new_mdef = @actor .mdef
new_eva = @actor .eva
new_str = @actor .str
new_dex = @actor .dex
new_agi = @actor .agi
new_int = @actor .int
# 返回到装备
@actor .equip ( @right_window.index , item1 == nil ? 0 : item1.id )
@actor .hp = last_hp
@actor .sp = last_sp
# 描画左窗口
###############################################################
@left_window .set_new_parameters ( new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
###############################################################
end
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# 状态窗口美化,全防具装备栏描绘
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
# 显示状态画面、完全规格的状态窗口。
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self .contents .clear
draw_actor_graphic( @actor, 40 , 112 )
draw_actor_name( @actor, 4 , 0 )
draw_actor_class( @actor, 4 + 144 , 0 )
draw_actor_level( @actor, 96 , 32 )
draw_actor_state( @actor, 96 , 64 )
draw_actor_hp( @actor, 96 , 112 , 172 )
draw_actor_sp( @actor, 96 , 144 , 172 )
draw_actor_parameter( @actor, 96 , 192 , 0 )
draw_actor_parameter( @actor, 96 , 224 , 1 )
draw_actor_parameter( @actor, 96 , 256 , 2 )
draw_actor_parameter( @actor, 96 , 304 , 3 )
draw_actor_parameter( @actor, 96 , 336 , 4 )
draw_actor_parameter( @actor, 96 , 368 , 5 )
draw_actor_parameter( @actor, 96 , 400 , 6 )
self .contents .font .color = system_color
self .contents .draw_text ( 320 , 48 , 80 , 32 , "EXP" )
self .contents .draw_text ( 320 , 80 , 80 , 32 , "NEXT" )
self .contents .font .color = normal_color
self .contents .draw_text ( 320 + 80 , 48 , 84 , 32 , @actor .exp_s , 2 )
self .contents .draw_text ( 320 + 80 , 80 , 84 , 32 , @actor .next_rest_exp_s , 2 )
self .contents .font .color = system_color
self .contents .draw_text ( 320 , 160 , 96 , 32 , "装备" )
draw_item_name( $data_weapons[ @actor.weapon_id ] , 320 + 16 , 208 )
draw_item_name( $data_armors[ @actor.armor1_id ] , 320 + 16 , 240 )
draw_item_name( $data_armors[ @actor.armor2_id ] , 320 + 16 , 272 )
draw_item_name( $data_armors[ @actor.armor3_id ] , 320 + 16 , 304 )
draw_item_name( $data_armors[ @actor.armor4_id ] , 320 + 16 , 336 )
draw_item_name( $data_armors[ @actor.armor5_id ] , 320 + 16 , 368 )
draw_item_name( $data_armors[ @actor.armor6_id ] , 320 + 16 , 400 )
end
def dummy
self .contents .font .color = system_color
self .contents .draw_text ( 320 , 112 , 96 , 32 , $data_system .words .weapon )
self .contents .draw_text ( 320 , 176 , 96 , 32 , $data_system .words .armor1 )
self .contents .draw_text ( 320 , 240 , 96 , 32 , $data_system .words .armor2 )
self .contents .draw_text ( 320 , 304 , 96 , 32 , $data_system .words .armor3 )
self .contents .draw_text ( 320 , 368 , 96 , 32 , $data_system .words .armor4 )
draw_item_name( $data_weapons[ @actor.weapon_id ] , 320 + 24 , 144 )
draw_item_name( $data_armors[ @actor.armor1_id ] , 320 + 24 , 208 )
draw_item_name( $data_armors[ @actor.armor2_id ] , 320 + 24 , 272 )
draw_item_name( $data_armors[ @actor.armor3_id ] , 320 + 24 , 336 )
draw_item_name( $data_armors[ @actor.armor4_id ] , 320 + 24 , 400 )
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# 商店购买窗口美化,增加对新装备位置的描述
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#==============================================================================
# ■ Window_ShopStatus
#------------------------------------------------------------------------------
# 商店画面、显示物品所持数与角色装备的窗口。
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self .contents .clear
if @item == nil
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
self .contents .font .color = system_color
self .contents .draw_text ( 4 , 0 , 200 , 32 , "所持数" )
self .contents .font .color = normal_color
self .contents .draw_text ( 204 , 0 , 32 , 32 , number.to_s , 2 )
if @item .is_a ?( RPG::Item )
return
end
# 添加装备品信息
for i in 0 ...$game_party.actors .size
# 获取角色
actor = $game_party .actors [ i]
# 可以装备为普通文字颜色、不能装备设置为无效文字颜色
if actor.equippable ?( @item)
self .contents .font .color = normal_color
else
self .contents .font .color = disabled_color
end
# 描绘角色名字
self .contents .draw_text ( 4 , 64 + 64 * i, 120 , 32 , actor.name )
# 获取当前的装备品
if @item .is_a ?( RPG::Weapon )
item1 = $data_weapons [ actor.weapon_id ]
elsif @item .kind == 0
item1 = $data_armors [ actor.armor1_id ]
elsif @item .kind == 1
item1 = $data_armors [ actor.armor2_id ]
elsif @item .kind == 2
item1 = $data_armors [ actor.armor3_id ]
elsif @item .kind == 3
item1 = $data_armors [ actor.armor4_id ]
elsif @item .kind == 4
item1 = $data_armors [ actor.armor5_id ]
else # if @item.kind == 5
item1 = $data_armors [ actor.armor6_id ]
end
# 可以装备的情况
if actor.equippable ?( @item)
# 武器的情况
if @item .is_a ?( RPG::Weapon )
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item .atk : 0
change = atk2 - atk1
end
# 防具的情况
if @item .is_a ?( RPG::Armor )
pdef1 = item1 != nil ? item1.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
pdef2 = @item != nil ? @item .pdef : 0
mdef2 = @item != nil ? @item .mdef : 0
change = pdef2 - pdef1 + mdef2 - mdef1
end
# 描绘能力值变化
self .contents .draw_text ( 124 , 64 + 64 * i, 112 , 32 ,
sprintf ( "%+d" , change) , 2 )
end
# 描绘物品
if item1 != nil
x = 4
y = 64 + 64 * i + 32
bitmap = RPG::Cache .icon ( item1.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 , item1.name )
end
end
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# 防具类追加
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
module RPG
class Armor
def name
name = @name .split ( /,/) [ 0 ]
return name != nil ? name : ''
end
def kind
kind = @name .split ( /,/) [ 1 ]
return kind != nil ? kind.to_i : @kind
end
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# Game_Actor添加新的防具ID,并对相关方法修正
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
class Game_Actor < Game_Battler
attr_reader :armor5_id # 道具 ID
attr_reader :armor6_id # 装饰品 ID
#--------------------------------------------------------------------------
# ● 设置
# actor_id : 角色 ID
#--------------------------------------------------------------------------
alias old_setup setup
def setup( actor_id)
old_setup( actor_id)
@armor5_id = 0
@armor6_id = 0
update_auto_state( nil , $data_armors [ @armor5_id] )
update_auto_state( nil , $data_armors [ @armor6_id] )
end
#--------------------------------------------------------------------------
# ● 取得属性修正值
# element_id : 属性 ID
#--------------------------------------------------------------------------
def element_rate( element_id)
# 获取对应属性有效度的数值
table = [ 0 ,200 ,150 ,100 ,50 ,0 ,-100 ]
result = table[ $data_classes[ @class_id] .element_ranks [ element_id] ]
# 防具能防御本属性的情况下效果减半
for i in [ @armor1_id, @armor2_id , @armor3_id , @armor4_id , @armor5_id , @armor6_id ]
armor = $data_armors [ i]
if armor != nil and armor.guard_element_set .include ?( element_id)
result /= 2
end
end
# 状态能防御本属性的情况下效果减半
for i in @states
if $data_states [ i] .guard_element_set .include ?( element_id)
result /= 2
end
end
# 过程结束
return result
end
#--------------------------------------------------------------------------
# ● 判定防御属性
# state_id : 属性 ID
#--------------------------------------------------------------------------
def state_guard?( state_id)
for i in [ @armor1_id, @armor2_id , @armor3_id , @armor4_id , @armor5_id , @armor6_id ]
armor = $data_armors [ i]
if armor != nil
if armor.guard_state_set .include ?( state_id)
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
# ● 获取基本力量
#--------------------------------------------------------------------------
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]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
n += armor5 != nil ? armor5.str_plus : 0
n += armor6 != nil ? armor6.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]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
n += armor5 != nil ? armor5.dex_plus : 0
n += armor6 != nil ? armor6.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]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
n += armor5 != nil ? armor5.agi_plus : 0
n += armor6 != nil ? armor6.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]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
n += armor5 != nil ? armor5.int_plus : 0
n += armor6 != nil ? armor6.int_plus : 0
return [ [ n, 1 ] .max , 999 ] .min
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]
pdef1 = weapon != nil ? weapon.pdef : 0
pdef2 = armor1 != nil ? armor1.pdef : 0
pdef3 = armor2 != nil ? armor2.pdef : 0
pdef4 = armor3 != nil ? armor3.pdef : 0
pdef5 = armor4 != nil ? armor4.pdef : 0
pdef6 = armor5 != nil ? armor5.pdef : 0
pdef7 = armor6 != nil ? armor6.pdef : 0
return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + pdef6 + pdef7
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]
mdef1 = weapon != nil ? weapon.mdef : 0
mdef2 = armor1 != nil ? armor1.mdef : 0
mdef3 = armor2 != nil ? armor2.mdef : 0
mdef4 = armor3 != nil ? armor3.mdef : 0
mdef5 = armor4 != nil ? armor4.mdef : 0
mdef6 = armor5 != nil ? armor5.mdef : 0
mdef7 = armor6 != nil ? armor6.mdef : 0
return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 + mdef6 + mdef7
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]
eva1 = armor1 != nil ? armor1.eva : 0
eva2 = armor2 != nil ? armor2.eva : 0
eva3 = armor3 != nil ? armor3.eva : 0
eva4 = armor4 != nil ? armor4.eva : 0
eva5 = armor5 != nil ? armor5.eva : 0
eva6 = armor6 != nil ? armor6.eva : 0
return eva1 + eva2 + eva3 + eva4 + eva5 + eva6
end
#--------------------------------------------------------------------------
# ● 装备固定判定
# equip_type : 装备类型
#--------------------------------------------------------------------------
def equip_fix?( equip_type)
case equip_type
when 0 # 武器
return $data_actors [ @actor_id] .weapon_fix
when 1 # 盾
return $data_actors [ @actor_id] .armor1_fix
when 2 # 头
return $data_actors [ @actor_id] .armor2_fix
when 3 # 身体
return $data_actors [ @actor_id] .armor3_fix
when 4 # 道具
return $data_actors [ @actor_id] .armor4_fix
end
return false
end
#--------------------------------------------------------------------------
# ● 变更装备
# equip_type : 装备类型
# id : 武器 or 防具 ID (0 为解除装备)
#--------------------------------------------------------------------------
def equip( equip_type, id)
case equip_type
when 0 # 武器
if id == 0 or $game_party .weapon_number ( id) > 0
$game_party .gain_weapon ( @weapon_id, 1 )
@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] )
$game_party .gain_armor ( @armor1_id, 1 )
@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] )
$game_party .gain_armor ( @armor2_id, 1 )
@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] )
$game_party .gain_armor ( @armor3_id, 1 )
@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] )
$game_party .gain_armor ( @armor4_id, 1 )
@armor4_id = id
$game_party .lose_armor ( id, 1 )
end
when 5 # 装饰品
if id == 0 or $game_party .armor_number ( id) > 0
update_auto_state( $data_armors[ @armor5_id] , $data_armors [ id] )
$game_party .gain_armor ( @armor5_id, 1 )
@armor5_id = id
$game_party .lose_armor ( id, 1 )
end
when 6 # 道具
if id == 0 or $game_party .armor_number ( id) > 0
update_auto_state( $data_armors[ @armor6_id] , $data_armors [ id] )
$game_party .gain_armor ( @armor6_id, 1 )
@armor6_id = id
$game_party .lose_armor ( id, 1 )
end
end
end
#--------------------------------------------------------------------------
# ● 更改职业 ID
# class_id : 新的职业 ID
#--------------------------------------------------------------------------
def class_id=( class_id)
if $data_classes [ class_id] != nil
@class_id = class_id
# 避开无法装备的物品
unless equippable?( $data_weapons[ @weapon_id] )
equip( 0 , 0 )
end
unless equippable?( $data_armors[ @armor1_id] )
equip( 1 , 0 )
end
unless equippable?( $data_armors[ @armor2_id] )
equip( 2 , 0 )
end
unless equippable?( $data_armors[ @armor3_id] )
equip( 3 , 0 )
end
unless equippable?( $data_armors[ @armor4_id] )
equip( 4 , 0 )
end
unless equippable?( $data_armors[ @armor5_id] )
equip( 5 , 0 )
end
unless equippable?( $data_armors[ @armor6_id] )
equip( 6 , 0 )
end
end
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# Window_Base美化,增加属性增减颜色,及全能力值描绘
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
################## 属性增减颜色 ##############################
def up_color
return Color.new ( 255 , 0 , 0 )
end
def down_color
return Color.new ( 0 , 255 , 0 )
end
#--------------------------------------------------------------------------
# ● 描绘能力值
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# type : 能力值种类 (0~6)
#--------------------------------------------------------------------------
def draw_actor_parameter( actor, x, y, type)
case type
when 0
parameter_name = $data_system .words .atk
parameter_value = actor.atk
when 1
parameter_name = $data_system .words .pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system .words .mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system .words .str
parameter_value = actor.str
when 4
parameter_name = $data_system .words .dex
parameter_value = actor.dex
when 5
parameter_name = $data_system .words .agi
parameter_value = actor.agi
when 6
parameter_name = $data_system .words .int
parameter_value = actor.int
when 7
parameter_name = "回避"
parameter_value = actor.eva
end
self .contents .font .color = system_color
self .contents .draw_text ( x, y, 120 , 32 , parameter_name)
self .contents .font .color = normal_color
self .contents .draw_text ( x + 120 , y, 36 , 32 , parameter_value.to_s , 2 )
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# 装备窗口美化,全能力值描绘并追加新的防具装备栏
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#==============================================================================
# ■ Window_EquipRight
#------------------------------------------------------------------------------
# 装备画面、显示角色现在装备的物品的窗口。
#==============================================================================
class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize( actor)
super ( 272 , 64 , 368 , 256 )
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 ] )
@data .push ( $data_armors[ @actor.armor5_id ] )
@data .push ( $data_armors[ @actor.armor6_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 * 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 )
self .contents .draw_text ( 4 , 32 * 5 , 92 , 32 , "道具" )
self .contents .draw_text ( 4 , 32 * 6 , 92 , 32 , "装饰品" )
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 )
draw_item_name( @data[ 5 ] , 92 , 32 * 5 )
draw_item_name( @data[ 6 ] , 92 , 32 * 6 )
end
end
#==============================================================================
# ■ Window_EquipLeft
#------------------------------------------------------------------------------
# 装备画面的、显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipLeft < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize( actor)
super ( 0 , 64 , 272 , 416 )
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 )
draw_actor_parameter( @actor, 4 , 64 , 0 )
draw_actor_parameter( @actor, 4 , 96 , 1 )
draw_actor_parameter( @actor, 4 , 128 , 2 )
draw_actor_parameter( @actor, 4 , 160 , 7 )
draw_actor_parameter( @actor, 4 , 192 , 3 )
draw_actor_parameter( @actor, 4 , 224 , 4 )
draw_actor_parameter( @actor, 4 , 256 , 5 )
draw_actor_parameter( @actor, 4 , 288 , 6 )
if @new_atk != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 64 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_atk >@actor.atk ? up_color : down_color
self .contents .font .color = normal_color if @new_atk == @actor .atk
self .contents .draw_text ( 200 , 64 , 36 , 32 , @new_atk .to_s , 2 )
end
if @new_pdef != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 96 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_pdef >@actor.pdef ? up_color : down_color
self .contents .font .color = normal_color if @new_pdef == @actor .pdef
self .contents .draw_text ( 200 , 96 , 36 , 32 , @new_pdef .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 = @new_mdef >@actor.mdef ? up_color : down_color
self .contents .font .color = normal_color if @new_mdef == @actor .mdef
self .contents .draw_text ( 200 , 128 , 36 , 32 , @new_mdef .to_s , 2 )
end
if @new_eva != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 160 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_eva >@actor.eva ? up_color : down_color
self .contents .font .color = normal_color if @new_eva == @actor .eva
self .contents .draw_text ( 200 , 160 , 36 , 32 , @new_eva .to_s , 2 )
end
if @new_str != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 192 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_str >@actor.str ? up_color : down_color
self .contents .font .color = normal_color if @new_str == @actor .str
self .contents .draw_text ( 200 , 192 , 36 , 32 , @new_str .to_s , 2 )
end
if @new_dex != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 224 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_dex >@actor.dex ? up_color : down_color
self .contents .font .color = normal_color if @new_dex == @actor .dex
self .contents .draw_text ( 200 , 224 , 36 , 32 , @new_dex .to_s , 2 )
end
if @new_agi != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 256 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_agi >@actor.agi ? up_color : down_color
self .contents .font .color = normal_color if @new_agi == @actor .agi
self .contents .draw_text ( 200 , 256 , 36 , 32 , @new_agi .to_s , 2 )
end
if @new_int != nil
self .contents .font .color = system_color
self .contents .draw_text ( 160 , 288 , 40 , 32 , "→" , 1 )
self .contents .font .color = @new_int >@actor.int ? up_color : down_color
self .contents .font .color = normal_color if @new_int == @actor .int
self .contents .draw_text ( 200 , 288 , 36 , 32 , @new_int .to_s , 2 )
end
end
#--------------------------------------------------------------------------
# ● 变更装备后的能力值设置
# new_atk : 变更装备后的攻击力
# new_pdef : 变更装备后的物理防御
# new_mdef : 变更装备后的魔法防御
#--------------------------------------------------------------------------
def set_new_parameters( new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or @new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_eva = new_eva
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
refresh
end
end
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
# equip_type : 装备部位 (0~3)
#--------------------------------------------------------------------------
def initialize( actor, equip_type)
super ( 272 , 320 , 368 , 160 )
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self .active = false
self .index = -1
end
#--------------------------------------------------------------------------
# ● 项目的描绘
# index : 项目符号
#--------------------------------------------------------------------------
def draw_item( index)
item = @data [ index]
x = 4
y = index * 32
case item
when RPG::Weapon
number = $game_party .weapon_number ( item.id )
when RPG::Armor
number = $game_party .armor_number ( item.id )
end
bitmap = RPG::Cache .icon ( item.icon_name )
self .contents .blt ( x, y + 4 , bitmap, Rect.new ( 0 , 0 , 24 , 24 ) )
self .contents .font .color = normal_color
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
end
class Scene_Equip
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 获取角色
@actor = $game_party .actors [ @actor_index]
# 生成窗口
@help_window = Window_Help.new
@left_window = Window_EquipLeft.new ( @actor)
@right_window = Window_EquipRight.new ( @actor)
@item_window1 = Window_EquipItem.new ( @actor, 0 )
@item_window2 = Window_EquipItem.new ( @actor, 1 )
@item_window3 = Window_EquipItem.new ( @actor, 2 )
@item_window4 = Window_EquipItem.new ( @actor, 3 )
@item_window5 = Window_EquipItem.new ( @actor, 4 )
@item_window6 = Window_EquipItem.new ( @actor, 5 )
@item_window7 = Window_EquipItem.new ( @actor, 6 )
# 关联帮助窗口
@right_window .help_window = @help_window
@item_window1 .help_window = @help_window
@item_window2 .help_window = @help_window
@item_window3 .help_window = @help_window
@item_window4 .help_window = @help_window
@item_window5 .help_window = @help_window
@item_window6 .help_window = @help_window
@item_window7 .help_window = @help_window
# 设置光标位置
@right_window .index = @equip_index
refresh
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面切换的话的就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@help_window .dispose
@left_window .dispose
@right_window .dispose
@item_window1 .dispose
@item_window2 .dispose
@item_window3 .dispose
@item_window4 .dispose
@item_window5 .dispose
@item_window6 .dispose
@item_window7 .dispose
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
# 设置物品窗口的可视状态
@item_window1 .visible = ( @right_window.index == 0 )
@item_window2 .visible = ( @right_window.index == 1 )
@item_window3 .visible = ( @right_window.index == 2 )
@item_window4 .visible = ( @right_window.index == 3 )
@item_window5 .visible = ( @right_window.index == 4 )
@item_window6 .visible = ( @right_window.index == 5 )
@item_window7 .visible = ( @right_window.index == 6 )
# 获取当前装备中的物品
item1 = @right_window .item
# 设置当前的物品窗口到 @item_window
case @right_window .index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
when 5
@item_window = @item_window6
when 6
@item_window = @item_window7
end
# 右窗口被激活的情况下
if @right_window .active
# 删除变更装备后的能力
###############################################################
@left_window .set_new_parameters ( nil , nil , nil , nil , nil , nil , nil , nil )
end
# 物品窗口被激活的情况下
if @item_window .active
# 获取现在选中的物品
item2 = @item_window .item
# 变更装备
last_hp = @actor .hp
last_sp = @actor .sp
@actor .equip ( @right_window.index , item2 == nil ? 0 : item2.id )
###############################################################
# 获取变更装备后的能力值
new_atk = @actor .atk
new_pdef = @actor .pdef
new_mdef = @actor .mdef
new_eva = @actor .eva
new_str = @actor .str
new_dex = @actor .dex
new_agi = @actor .agi
new_int = @actor .int
# 返回到装备
@actor .equip ( @right_window.index , item1 == nil ? 0 : item1.id )
@actor .hp = last_hp
@actor .sp = last_sp
# 描画左窗口
###############################################################
@left_window .set_new_parameters ( new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
###############################################################
end
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# 状态窗口美化,全防具装备栏描绘
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
# 显示状态画面、完全规格的状态窗口。
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self .contents .clear
draw_actor_graphic( @actor, 40 , 112 )
draw_actor_name( @actor, 4 , 0 )
draw_actor_class( @actor, 4 + 144 , 0 )
draw_actor_level( @actor, 96 , 32 )
draw_actor_state( @actor, 96 , 64 )
draw_actor_hp( @actor, 96 , 112 , 172 )
draw_actor_sp( @actor, 96 , 144 , 172 )
draw_actor_parameter( @actor, 96 , 192 , 0 )
draw_actor_parameter( @actor, 96 , 224 , 1 )
draw_actor_parameter( @actor, 96 , 256 , 2 )
draw_actor_parameter( @actor, 96 , 304 , 3 )
draw_actor_parameter( @actor, 96 , 336 , 4 )
draw_actor_parameter( @actor, 96 , 368 , 5 )
draw_actor_parameter( @actor, 96 , 400 , 6 )
self .contents .font .color = system_color
self .contents .draw_text ( 320 , 48 , 80 , 32 , "EXP" )
self .contents .draw_text ( 320 , 80 , 80 , 32 , "NEXT" )
self .contents .font .color = normal_color
self .contents .draw_text ( 320 + 80 , 48 , 84 , 32 , @actor .exp_s , 2 )
self .contents .draw_text ( 320 + 80 , 80 , 84 , 32 , @actor .next_rest_exp_s , 2 )
self .contents .font .color = system_color
self .contents .draw_text ( 320 , 160 , 96 , 32 , "装备" )
draw_item_name( $data_weapons[ @actor.weapon_id ] , 320 + 16 , 208 )
draw_item_name( $data_armors[ @actor.armor1_id ] , 320 + 16 , 240 )
draw_item_name( $data_armors[ @actor.armor2_id ] , 320 + 16 , 272 )
draw_item_name( $data_armors[ @actor.armor3_id ] , 320 + 16 , 304 )
draw_item_name( $data_armors[ @actor.armor4_id ] , 320 + 16 , 336 )
draw_item_name( $data_armors[ @actor.armor5_id ] , 320 + 16 , 368 )
draw_item_name( $data_armors[ @actor.armor6_id ] , 320 + 16 , 400 )
end
def dummy
self .contents .font .color = system_color
self .contents .draw_text ( 320 , 112 , 96 , 32 , $data_system .words .weapon )
self .contents .draw_text ( 320 , 176 , 96 , 32 , $data_system .words .armor1 )
self .contents .draw_text ( 320 , 240 , 96 , 32 , $data_system .words .armor2 )
self .contents .draw_text ( 320 , 304 , 96 , 32 , $data_system .words .armor3 )
self .contents .draw_text ( 320 , 368 , 96 , 32 , $data_system .words .armor4 )
draw_item_name( $data_weapons[ @actor.weapon_id ] , 320 + 24 , 144 )
draw_item_name( $data_armors[ @actor.armor1_id ] , 320 + 24 , 208 )
draw_item_name( $data_armors[ @actor.armor2_id ] , 320 + 24 , 272 )
draw_item_name( $data_armors[ @actor.armor3_id ] , 320 + 24 , 336 )
draw_item_name( $data_armors[ @actor.armor4_id ] , 320 + 24 , 400 )
end
end
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#
# 商店购买窗口美化,增加对新装备位置的描述
#
# ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
#==============================================================================
# ■ Window_ShopStatus
#------------------------------------------------------------------------------
# 商店画面、显示物品所持数与角色装备的窗口。
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self .contents .clear
if @item == nil
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
self .contents .font .color = system_color
self .contents .draw_text ( 4 , 0 , 200 , 32 , "所持数" )
self .contents .font .color = normal_color
self .contents .draw_text ( 204 , 0 , 32 , 32 , number.to_s , 2 )
if @item .is_a ?( RPG::Item )
return
end
# 添加装备品信息
for i in 0 ...$game_party.actors .size
# 获取角色
actor = $game_party .actors [ i]
# 可以装备为普通文字颜色、不能装备设置为无效文字颜色
if actor.equippable ?( @item)
self .contents .font .color = normal_color
else
self .contents .font .color = disabled_color
end
# 描绘角色名字
self .contents .draw_text ( 4 , 64 + 64 * i, 120 , 32 , actor.name )
# 获取当前的装备品
if @item .is_a ?( RPG::Weapon )
item1 = $data_weapons [ actor.weapon_id ]
elsif @item .kind == 0
item1 = $data_armors [ actor.armor1_id ]
elsif @item .kind == 1
item1 = $data_armors [ actor.armor2_id ]
elsif @item .kind == 2
item1 = $data_armors [ actor.armor3_id ]
elsif @item .kind == 3
item1 = $data_armors [ actor.armor4_id ]
elsif @item .kind == 4
item1 = $data_armors [ actor.armor5_id ]
else # if @item.kind == 5
item1 = $data_armors [ actor.armor6_id ]
end
# 可以装备的情况
if actor.equippable ?( @item)
# 武器的情况
if @item .is_a ?( RPG::Weapon )
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item .atk : 0
change = atk2 - atk1
end
# 防具的情况
if @item .is_a ?( RPG::Armor )
pdef1 = item1 != nil ? item1.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
pdef2 = @item != nil ? @item .pdef : 0
mdef2 = @item != nil ? @item .mdef : 0
change = pdef2 - pdef1 + mdef2 - mdef1
end
# 描绘能力值变化
self .contents .draw_text ( 124 , 64 + 64 * i, 112 , 32 ,
sprintf ( "%+d" , change) , 2 )
end
# 描绘物品
if item1 != nil
x = 4
y = 64 + 64 * i + 32
bitmap = RPG::Cache .icon ( item1.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 , item1.name )
end
end
end
end
作者: 043838438 时间: 2014-8-7 22:03
不能分解装备 一分解就出错 {:2_264:}请大神帮忙(σ゚д゚)σ
作者: 043838438 时间: 2014-8-15 20:36
043838438 发表于 2014-8-7 22:03
不能分解装备 一分解就出错请大神帮忙(σ゚д゚)σ
就是这个···( ̄︿ ̄)
搜狗截图_2014-08-15_20-31-57.png
(8.81 KB, 下载次数: 42)
出错原因
作者: 小传子 时间: 2014-8-19 20:36
$game_party.gain_item(id, 1) if (rand (100) < n) and id > MAKE_ELEMENT_ID
拆卸宝石时:)
作者: zk495252176 时间: 2014-10-1 17:02
膜拜之~~~
作者: 芯☆淡茹水 时间: 2014-11-19 11:39
花了2天时间,把工程大换血一次。
重写了装备类;
美化物品信息窗口;
打造界面;
以及修复在重写过程中发现的BUG。
作者: j296196585 时间: 2014-11-24 13:42
t天,我为了这天,兴奋N久
作者: hookpjh 时间: 2014-11-25 17:23
楼主,做得太好了!干得漂亮,能否做一个VA版的,那就完美了
最近发现一个韩国模拟器可以在安卓上全速模拟RPG制造大师三个版本,就等你的脚本了!
作者: hookpjh 时间: 2014-11-26 09:04
必须记得密码的,这是我的新号,上一个号注册时间是05年5月的
脚本在手机上运行起来是没问题,只是高级属性窗口显示不出来啊,悲剧了,那就玩pc的吧
作者: 火烧兔子 时间: 2014-11-26 22:58
这个脚本太强大了
提一点建议:
1)附加属性能否限定装备类型?
例如武器却加防御太奇怪了,某些情况下装备一件武器的防御甚至超过了衣服……
因此给每种类型的装备都限定一下附加的属性,例如武器就只能加攻击、暴击率、暴击伤害等等
2)附加属性的种类有点少。
其实这些很容易想到的,只是不知道实现起来会不会很难。
如:命中率、暴击率,还可以有一些特殊效果附加在武器上,普攻3%几率令目标冰冻,防具上则有30%睡眠抗性等等(可以参考一些网游
我想随机属性的种类越多,这个脚本的趣味也就越大
最后支持LZ继续更新脚本
作者: hookpjh 时间: 2014-11-27 13:52
hookpjh 发表于 2014-11-26 09:04
必须记得密码的,这是我的新号,上一个号注册时间是05年5月的
脚本在手机上运行起来是没问题,只是高级属性 ...
...那个必须忘记密码,因为根本不存在。
好像是另外一个RPMX论坛的帐号,05年肯定是最火的,柳柳好像还没那么高人气的
ps:偶尔水一下,会不会被扣分{:2_276:}
作者: hookpjh 时间: 2014-11-27 22:58
楼主,脚本有bug,当用无孔装备镶嵌时,出现下图
bug.JPG
(23.41 KB, 下载次数: 50)
作者: hookpjh 时间: 2014-11-30 09:34
楼主,发现bug,当两个角色气其一个装备了该物品,另外一个同伴向商店出售同位置的装备就报错,其他位置装备可正常出售。比如a装备了剑,那么b出售剑就报错,但b出售铠甲正常。当a卸下剑,b出售剑也正常;上图
bug2.JPG
(23.32 KB, 下载次数: 45)
作者: hookpjh 时间: 2014-11-30 11:57
hookpjh 发表于 2014-11-30 09:34
楼主,发现bug,当两个角色气其一个装备了该物品,另外一个同伴向商店出售同位置的装备就报错,其他位置装 ...
大神,修复在脚本哪一条啊?想简单点替换掉
作者: 小啊好帅啊 时间: 2014-12-1 11:53
太牛了!哈哈哈哈!
作者: 掘地三尺发现你 时间: 2014-12-5 20:23
能不能单独设置某个武器,耐久度无限?
求回答
谢谢
作者: y967 时间: 2014-12-28 12:24
1,11 月19号修复了什么,状态显示装备还是乱的
加血技能变成了1点,是在你的工程上测试的
作者: y967 时间: 2014-12-28 12:28
感觉魔攻没什么用,而且治疗技能出错是不是和这个有关
作者: 惊鸿灬一梦 时间: 2015-1-5 16:34
加血会加死自己,在你的工程上测试的,这该怎么改啊楼主,求教
作者: 芯☆淡茹水 时间: 2015-3-14 14:46
更新顶一下,
嘛~。其实只是更新一个本人的试验功能:装备的打包和导入
在游戏打包场景里可对已有的装备打包,在 Exchange 文件夹下生成一个 装备数据的打包文件rxdata ,这个文件可以给玩同样游戏的玩家导入。
在游戏导入场景里,可对 Exchange 文件夹下所有 装备打包文件 进行导入,添加到游戏里。
一个游戏同样的装备只能有一件,无限的复制导入无效;S/L大法无效;卖掉后再导入也无效。
作者: 高调上的低调 时间: 2015-3-27 22:10
下载了之后怎么没有文件呢
作者: q903772068 时间: 2015-4-10 16:54
怎么能不用打包功能
作者: q903772068 时间: 2015-4-10 17:35
我把这个脚本放到游戏里 初期装备都失效了 进入游戏就是没有装备的状态
123.png
(4.46 KB, 下载次数: 48)
作者: 644617926 时间: 2015-4-30 19:58
大神你好- -新手一枚,请问下怪物没魔攻放技能的时候怎么能有伤害呢?每次都是0啊哪怕没穿装备
作者: n11221 时间: 2015-5-20 20:25
这个简直是太厉害了,不得不佩服的支持一下!
作者: 锡鹏 时间: 2015-6-19 21:00
我也出差错啊 怎么办
作者: AYU刀锋 时间: 2015-6-21 14:43
本帖最后由 AYU刀锋 于 2015-6-21 15:47 编辑
我想给您的里面加上装备后缀,但是遇到一点问题,总是提示编写错误。当然可能是因为我不会罢了……
理想效果为:装备等级(星级)=1 后缀 +1段 以此类推
X☆R_Equip中
#--------------------------------------------------------------------------
# X☆R: 装备名(基础名+后缀名)。
#--------------------------------------------------------------------------
def name
sf_name = case @level
when = 0 :"" (从这里开始提示错误)
when = 1 :X☆R::Level_Name1
when = 2 :X☆R::Level_Name2
when = 3 :X☆R::Level_Name3
when = 4 :X☆R::Level_Name4
when = 5 :X☆R::Level_Name5
when = 6 :X☆R::Level_Name6
when = 7 :X☆R::Level_Name7
when = 8 :X☆R::Level_Name8
when = 9 :X☆R::Level_Name9
when = 10 :X☆R::Level_Name10
end
return base_name + sf_name
end
☆ 设置 ←中
#----------------------------------------------------------------------------
# 一级星级的装备的后缀名。
Level_Name1 = "1段"
#----------------------------------------------------------------------------
# 二级星级的装备的后缀名。
Level_Name2 = "2段"
#----------------------------------------------------------------------------
# 三级星级的装备的后缀名。
Level_Name3 = "3段"
#----------------------------------------------------------------------------
# 四级星级的装备的后缀名。
Level_Name4 = "4段"
#----------------------------------------------------------------------------
# 五级星级的装备的后缀名。
Level_Name5 = "5段"
#----------------------------------------------------------------------------
# 六级星级的装备的后缀名。
Level_Name6 = "6段"
#----------------------------------------------------------------------------
# 七级星级的装备的后缀名。
Level_Name7 = "7段"
#----------------------------------------------------------------------------
# 八级品质的装备的后缀名。
Level_Name8 = "8段"
#----------------------------------------------------------------------------
# 九级品质的装备的后缀名。
Level_Name9 = "9段"
#----------------------------------------------------------------------------
# 十级星级的装备的后缀名。
Level_Name10 = "10段"
另外如果宝石可拆的话更好!
升级部分希望能帮忙修改为需要打造类材料(我自己替换材料名字)并告诉我怎样设置?
升级几率我已改100%,但是升级属性我想改成固定属性,求教怎样调整!
作者: 舞小朵儿 时间: 2015-7-31 20:31
大神求问~这个是什么原因啊?
作者: acv255 时间: 2015-8-11 15:11
这个厉害,用了
作者: 0936zz 时间: 2015-8-12 15:09
收藏= =
然后暴抱走= =
50经验有点贵= =
所以还是先不抱了= =
作者: 花天酒地 时间: 2015-9-17 14:40
大神 我想让默认的装备增加几个选项怎么弄啊 系统默认的只有武器 盾 衣服 帽子 首饰 我想增加个靴子 戒指 项链
作者: 花天酒地 时间: 2015-9-18 04:13
【凌】 发表于 2014-1-23 10:26
为什么会这样??????
大神 我用了打造装备脚本 以前没事 不知道怎么现在只要打造装备 就提示脚本错误
错误.png
(10.09 KB, 下载次数: 69)
工程地址.zip
220 Bytes, 下载次数: 160
作者: 花天酒地 时间: 2015-9-18 04:16
大神 用了打造装备脚本以前没事 现在只要打造就提示错误 我把工程发你看下
错误.png
(10.09 KB, 下载次数: 58)
工程地址.zip
220 Bytes, 下载次数: 163
作者: kk1365597030 时间: 2015-10-1 14:24
简直666666的不行
作者: Zhangjiaxing1 时间: 2017-4-21 15:12
非常不错的升级系统,要是能有个人物的升星系统那更完美
作者: qq595006041 时间: 2018-12-28 16:57
您好 , 您的仿网游装备系统为什么我用的时候没有武器攻击最小和最大的设置,状态栏也没有显示
作者: qq595006041 时间: 2019-1-2 16:22
@芯☆淡茹水 装备持有判定混乱怎么办,大神
作者: qq595006041 时间: 2019-1-2 16:36
本帖最后由 qq595006041 于 2019-1-2 17:00 编辑
@芯☆淡茹水 还有就是您这个范例武器没有最小到最大攻击,请问应该怎么设置
那如果要做套装效果该怎么办,我用事件判定的
作者: 淞…… 时间: 2019-3-13 22:54
学习一下!
作者: 一枚菜鸡大队长 时间: 2024-2-3 19:56
我只需要里面的一个两个功能怎么办......东西太多了感觉不好装啊,而且好多内容对于我的游戏来讲太臃肿了
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1