| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2022-1-17 |
| 在线时间 | 1083 小时 |
- 梦石
- 0
- 星屑
- 70
- 在线时间
- 1083 小时
- 注册时间
- 2013-3-29
- 回帖
- 2158
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
不会更新了……
状态界面则显示卸下了手斧之后str下降了15点的
相关脚本如下:(被我改了不少。。求指点哪里错了)
equipstatus(只改了窗口透明)[pre lang="ruby"]#encoding:utf-8
#==============================================================================
# ■ Window_EquipStatus
#------------------------------------------------------------------------------
# 装备画面中,显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
self.opacity = 0
@actor = nil
@temp_actor = nil
refresh
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 208
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
fitting_height(visible_line_number)
end
#--------------------------------------------------------------------------
# ● 获取显示行数
#--------------------------------------------------------------------------
def visible_line_number
return 7
end
#--------------------------------------------------------------------------
# ● 设置角色
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_actor_name(@actor, 4, 0) if @actor
6.times {|i| draw_item(0, line_height * (1 + i), 2 + i) }
end
#--------------------------------------------------------------------------
# ● 设置更换装备后的临时角色
#--------------------------------------------------------------------------
def set_temp_actor(temp_actor)
return if @temp_actor == temp_actor
@temp_actor = temp_actor
refresh
end
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(x, y, param_id)
draw_param_name(x + 4, y, param_id)
draw_current_param(x + 94, y, param_id) if @actor
draw_right_arrow(x + 126, y)
draw_new_param(x + 150, y, param_id) if @temp_actor
end
#--------------------------------------------------------------------------
# ● 绘制能力值的名字
#--------------------------------------------------------------------------
def draw_param_name(x, y, param_id)
change_color(system_color)
draw_text(x, y, 80, line_height, Vocab::param(param_id))
end
#--------------------------------------------------------------------------
# ● 绘制当前能力值
#--------------------------------------------------------------------------
def draw_current_param(x, y, param_id)
change_color(normal_color)
draw_text(x, y, 32, line_height, @actor.param(param_id), 2)
end
#--------------------------------------------------------------------------
# ● 绘制右方向箭头
#--------------------------------------------------------------------------
def draw_right_arrow(x, y)
change_color(system_color)
draw_text(x, y, 22, line_height, "→", 1)
end
#--------------------------------------------------------------------------
# ● 绘制更换装备后的能力值
#--------------------------------------------------------------------------
def draw_new_param(x, y, param_id)
new_value = @temp_actor.param(param_id)
change_color(param_change_color(new_value - @actor.param(param_id)))
draw_text(x, y, 32, line_height, new_value, 2)
end
end
[/pre]
scene_equip(改了不少。。)[pre lang="ruby"]#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
# This class performs the equipment screen processing.
#==============================================================================
class Scene_Equip < Scene_MenuBase
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_status_window
create_slot_window
create_item_window
end
def create_background
@background_sprite = Sprite.new
@background_sprite.bitmap = Cache.title1("Menu_equip")
end
#--------------------------------------------------------------------------
# * Create Status Window
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_EquipStatus.new(0, 80)
@status_window.viewport = @viewport
@status_window.actor = @actor
end
#--------------------------------------------------------------------------
# * Create Slot Window
#--------------------------------------------------------------------------
def create_slot_window
wx = @status_window.width
wy = 80
ww = 544 - @status_window.width
@slot_window = Window_EquipSlot.new(wx, wy, ww)
@slot_window.viewport = @viewport
@slot_window.help_window = @help_window
@slot_window.status_window = @status_window
@slot_window.actor = @actor
@slot_window.set_handler(:ok, method(:on_slot_ok))
@slot_window.set_handler(:cancel, method(:return_scene))
@slot_window.set_handler(:pagedown, method(:next_actor))
@slot_window.set_handler(:pageup, method(:prev_actor))
@slot_window.activate
@slot_window.select(0)
end
#--------------------------------------------------------------------------
# * Create Item Window
#--------------------------------------------------------------------------
def create_item_window
wx = @status_window.width
wy = @slot_window.y + @slot_window.height
ww = 544 - @status_window.width
wh = 96
@item_window = Window_EquipItem.new(wx, wy, ww, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.status_window = @status_window
@item_window.actor = @actor
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@slot_window.item_window = @item_window
end
#--------------------------------------------------------------------------
# * Slot [OK]
#--------------------------------------------------------------------------
def on_slot_ok
@item_window.activate
@item_window.select(0)
end
#--------------------------------------------------------------------------
# * Item [OK]
#--------------------------------------------------------------------------
def on_item_ok
Sound.play_equip
@actor.change_equip(@slot_window.index, @item_window.item)
@slot_window.activate
@slot_window.refresh
@item_window.unselect
@item_window.refresh
end
#--------------------------------------------------------------------------
# * Item [Cancel]
#--------------------------------------------------------------------------
def on_item_cancel
@slot_window.activate
@item_window.unselect
end
#--------------------------------------------------------------------------
# * Change Actors
#--------------------------------------------------------------------------
def on_actor_change
@status_window.actor = @actor
@slot_window.actor = @actor
@item_window.actor = @actor
@slot_window.activate
end
end
[/pre] |
|