Project1
标题:
装备颜色脚本整合
[打印本页]
作者:
YeYe.
时间:
2014-2-27 12:37
标题:
装备颜色脚本整合
本帖最后由 YeYe. 于 2014-2-28 03:40 编辑
之前30VIP订做的打孔系统存在些问题,不能兼容“物品颜色脚本”唉...都在忙,没人肯帮我!急死我了·············
打孔系统用了这个颜色脚本没用,比如:铜剑@5 应该显示紫色的,但是他连名字都不显示了......................我把自己所有的智慧都用尽了可就是不能如我所愿~
如何整合起来?我把脚本都贴上来了,还带了工程
颜色脚本:
# 装备颜色 @1-6号颜色
module RPG
class Skill
def name
name = @name.split(/@/)[0]
return name != nil ? name : ''
end
def name_color
name_color = @name.split(/@/)[1]
return name_color != nil ? name_color.to_i : 0
end
end
class Weapon
def name
name = @name.split(/@/)[0]
return name != nil ? name : ''
end
def name_color
name_color = @name.split(/@/)[1]
return name_color != nil ? name_color.to_i : 0
end
end
class Item
def name
name = @name.split(/@/)[0]
return name != nil ? name : ''
end
def name_color
name_color = @name.split(/@/)[1]
return name_color != nil ? name_color.to_i : 0
end
end
class Armor
def name
name = @name.split(/@/)[0]
return name != nil ? name : ''
end
def name_color
name_color = @name.split(/@/)[1]
return name != nil ? name_color.to_i : 0
end
end
end
复制代码
脚本不长应该不难的吧······················改了哪里记得帮我 弄个备注来标记,我要全局搜索 学习学习~!
[attach]228010[/attach]
@狂人
@P叔叔
@高手
@最喜欢帮我的人 @爱人 请帮帮我!这次没有V,过几天充值后本小姐变成了土豪后我们一起做朋友好吗?
作者:
batfjtn
时间:
2014-2-27 16:56
本帖最后由 batfjtn 于 2014-2-28 15:51 编辑
要改的地方太多了~!!!
不过我敢说你肯定没有看你的自己的工程~~!!
那个打孔系统是独立出来的~!!
所以你需要把所有的颜色脚本都修改~~!!!
首先查看Scene_Menu这个类~~!!
然后查看第128行~~!!
OK亮点出来了~~!!
脚本是$scene = Scene_Smith.new
所以你再查看Scene_Smith这个类~~!!
查看main里的内容~~!!
def main
@item = nil
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
@info_window = Window_Equipment.new
@disp_window = Window_Equip_Disp.new
@info_window.item = @item
@help_window = Window_Help.new
@disp_window.help_window = @help_window
@command_window = Window_SmithCommand.new
@command_window.help_window = @help_window
@dummy_window = Window_Base.new(288, 128, 352, 352)
@dummy_window.visible = false
@equip_window = Window_SmithEquip.new(@item)
@equip_window.help_window = @help_window
@item_window = Window_SmithItem.new
@item_window.help_window = @help_window
@dscd_window = Window_SmithDscd.new
@restore_window = Window_SmithRestore.new
@hole_window = Window_SmithHole.new(@item)
@dcps_window = Window_SmithDcps.new
@step = 1
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@dummy_window.dispose
@info_window.dispose
@disp_window.dispose
@help_window.dispose
@command_window.dispose
@equip_window.dispose
@dscd_window.dispose
@item_window.dispose
@restore_window.dispose
@hole_window.dispose
@dcps_window.dispose
end
复制代码
然后问题就出现了~!!
如果你不修改颜色脚本的话是没有办法使用的`~!!
论坛上的颜色脚本都是使用默认类的~~!!
所以这里你需要自己修改一下~!!
此句错误~~!!!!"你的打孔系统是独立出来的`!!"
是物品栏~~!!
这句多余~~!!!!包括的你物品栏也是~~!!!
而颜色脚本的的话都是修改原先的脚本~!!
颜色脚本~~!!
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#
# 脚本功能:给不同物品显示不同颜色,类似暗黑破坏神,比如套装为绿色,超级为金色
# 可以更改的种类包括物品、防具、特技、武器。
#
# 使用方法:对于不想为白色表示的物品,在描述中最后添加@6,@4一类的即可。
# 数字为颜色编号,和对话框中的一样。
# ——————————————————————————————————————
module RPG
class Skill
def description
description = @description.split(/@/)[0]
return description != nil ? description : ''
end
def name_color_66RPG
name_color = @description.split(/@/)[1]
return name_color != nil ? name_color.to_i : 0
end
end
class Weapon
def description
description = @description.split(/@/)[0]
return description != nil ? description : ''
end
def name_color_66RPG
name_color = @description.split(/@/)[1]
return name_color != nil ? name_color.to_i : 0
end
end
class Item
def description
description = @description.split(/@/)[0]
return description != nil ? description : ''
end
def name_color_66RPG
name_color = @description.split(/@/)[1]
return name_color != nil ? name_color.to_i : 0
end
end
class Armor
def description
description = @description.split(/@/)[0]
return description != nil ? description : ''
end
def name_color_66RPG
name_color = @description.split(/@/)[1]
return name != nil ? name_color.to_i : 0
end
end
end
# ——————————————————————————————————————
# 本脚本原创自www.66rpg.com,转载请保留此信息
# ——————————————————————————————————————
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘物品名
# item : 物品
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
#--------------------------------------------------------------------------
def draw_item_name(item, x, y)
if item == nil
return
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 = text_color(item.name_color_66RPG)
self.contents.draw_text(x + 28, y, 212, 32, item.name.to_s)
end
end
# ——————————————————————————————————————
# 本脚本原创自www.66rpg.com,转载请保留此信息
# ——————————————————————————————————————
class Window_Item
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = text_color(item.name_color_66RPG)
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == disabled_color ? 128 : 255
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
# ——————————————————————————————————————
# 本脚本原创自www.66rpg.com,转载请保留此信息
# ——————————————————————————————————————
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 项目的描绘
# index : 项目符号
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 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 + 130, y, 16, 32, ":", 2)
self.contents.draw_text(x + 150, y, 24, 32, number.to_s, 2)
end
end
# ——————————————————————————————————————
# 本脚本原创自www.66rpg.com,转载请保留此信息
# ——————————————————————————————————————
class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
# ● 描绘羡慕
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
# 获取物品所持数
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
# 价格在所持金以下、并且所持数不是 99 的情况下为普通颜色
# 除此之外的情况设置为无效文字色
if item.price <= $game_party.gold and number < 99
self.contents.font.color = text_color(item.name_color_66RPG)
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == disabled_color ? 128 : 255
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
end
end
# ——————————————————————————————————————
# 本脚本原创自www.66rpg.com,转载请保留此信息
# ——————————————————————————————————————
class Window_ShopSell < Window_Selectable
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目标号
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
# 可以卖掉的显示为普通颜色、除此之外设置成无效文字颜色
if item.price > 0
self.contents.font.color = text_color(item.name_color_66RPG)
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == disabled_color ? 128 : 255
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
end
# ——————————————————————————————————————
# 本脚本原创自www.66rpg.com,转载请保留此信息
# ——————————————————————————————————————
class Window_Skill
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = text_color(skill.name_color_66RPG)
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == disabled_color ? 128 : 255
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
从第76行到最后面~!!
都是在原本的脚本上添加的新参数~~!!
所以你颜色脚本可以在商店拥有效果~~!
而在物品栏里没有效果~~!!
打完收工~!!
自己修改吧~~!!
作者:
天地有正气
时间:
2014-2-27 21:09
装备颜色啊,可以试试我的?设定在脚本里。。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1