| 赞 | 1 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2014-11-20 |
| 在线时间 | 378 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 378 小时
- 注册时间
- 2013-10-14
- 回帖
- 213
|
发表于 2014-7-6 19:50:53
|
显示全部楼层
jklpgh 发表于 2014-7-6 18:49 
为什么我不行.......看脸的么........
好吧你成功了~~!!!
你都不看脚本的吗~~!!?
你把这一段修改掉就好了~~!!!
你是连脚本都还没有去设置好~~!!- #==============================================================================
- # ■ RPG追加定义
- #==============================================================================
- module RPG
- #--------------------------------------------------------------------------
- # ● 物品追加
- #--------------------------------------------------------------------------
- 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 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 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
复制代码 主要是你的游戏太大了~~!!
每次上传太痛苦了~~!!
顺便给你长我修改好的物品底图~~!!
物品背景图
顺便我修改好的脚本也发给你吧~~!!!
物品分类脚本[pre lang="ruby" line="1"]#==============================================================================
# ■ RPG追加定义
#==============================================================================
module RPG
#--------------------------------------------------------------------------
# ● 物品追加
#--------------------------------------------------------------------------
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 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 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
#==============================================================================
# ■ Harts_Window_ItemCommand
#==============================================================================
class Window_ItemCommand < Window_Selectable
attr_accessor :commands
#--------------------------------------------------------------------------
# ● 初始化,生成commands窗口
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 423)
@commands = []
# 设置物品窗口透明 batfjtn
self.opacity = 0
#————————生成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.desc
push = false
end
end
if push == true
@commands.push($data_items.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.desc
push = false
end
end
if push == true
@commands.push($data_weapons.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.desc
push = false
end
end
if push == true
@commands.push($data_armors.desc)
end
end
end
if @commands == []
@commands.push("普通物品")
end
@item_max = @commands.size
self.contents = Bitmap.new(width - 32, @item_max * 32)
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(item)
#校正帮助窗口位置
@help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
end
end
#==============================================================================
# ■ Window_Item
#==============================================================================
class Window_ItemList < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(160, 0, 480, 480)
@column_max = 2
# 设置物品窗口透明 batfjtn
self.opacity = 0
refresh
self.index = 0
# 战斗中的情况下将窗口半透明化
if $game_temp.in_battle
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# ● 获取物品
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def set_item(command)
refresh
for i in 1...$data_items.size
if $game_party.item_number(i) > 0 and $data_items.desc == command
@data.push($data_items)
end
end
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and $data_weapons.desc == command
@data.push($data_weapons)
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and $data_armors.desc == command
@data.push($data_armors)
end
end
# 如果项目数不是 0 就生成位图、重新描绘全部项目
@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
#--------------------------------------------------------------------------
# ● 描绘项目
# 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 = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (208 + 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 == 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 + 170, y, 16, 32, ":", 1)
self.contents.draw_text(x + 176, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# ● 刷新帮助文本
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(item)
#校正帮助窗口位置
@help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
end
end
#==============================================================================
# ■ Scene_Item
#------------------------------------------------------------------------------
# 处理物品画面的类。
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
#■■■生成物品图片
@menu_com = Sprite.new
@menu_com.bitmap = RPG::Cache.picture("物品背景.png")
# 生成帮助窗口、物品窗口
@itemcommand_window = Window_ItemCommand.new
@command_index = @itemcommand_window.index
@itemlist_window = Window_ItemList.new
@itemlist_window.active = false
@help_window = Window_Help.new
#------------------------------------
# ● 生成金錢窗口
#------------------------------------
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 423
# 关联帮助窗口
@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
@gold_window.dispose
@menu_com.dispose
@itemcommand_window.dispose
@itemlist_window.dispose
@help_window.dispose
@target_window.dispose
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update
@gold_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
# 激活目标窗口
@menu_com = Sprite.new
@menu_com.bitmap = RPG::Cache.picture("使用物品背景.png")
@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
# 删除目标窗口
@menu_com.dispose
@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
# 公共事件 ID 有效的情况下
if @item.common_event_id > 0
# 预约调用公共事件
$game_temp.common_event_id = @item.common_event_id
# 切换到地图画面
$scene = Scene_Map.new
return
end
end
# 无法使用物品的情况下
unless used
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
[/pre]
这次可以结贴了吧~~!!
战斗界面还是用原来的物品栏~~!!!
你的第一个问题就是没有设置动画~~!!
设置下动画就OK了~~!!! |
|