Project1
标题:
再问个问题厄~怎么样设置装备需求
[打印本页]
作者:
holwar天下
时间:
2008-2-6 00:31
提示:
作者被禁止或删除 内容自动屏蔽
作者:
superufo
时间:
2008-2-6 00:34
提示:
作者被禁止或删除 内容自动屏蔽
作者:
越前リョーマ
时间:
2008-2-6 00:39
这个XP里也有人写过,
找LS的S大叔专门写一个好了……{/hx}
作者:
holwar天下
时间:
2008-2-6 00:41
提示:
作者被禁止或删除 内容自动屏蔽
作者:
superufo
时间:
2008-2-6 00:45
提示:
作者被禁止或删除 内容自动屏蔽
作者:
越前リョーマ
时间:
2008-2-6 00:46
以下引用
superufo于2008-2-5 16:45:36
的发言:
一般来说200积分吧
很便宜呀……{/hx}
作者:
superufo
时间:
2008-2-6 00:48
提示:
作者被禁止或删除 内容自动屏蔽
作者:
holwar天下
时间:
2008-2-6 01:46
提示:
作者被禁止或删除 内容自动屏蔽
作者:
亿万星辰
时间:
2008-2-6 02:05
这个简单,几分钟就OK了...{/hx}
写的比较仓促,在默认系统下的装备界面中应该无误。
#==============================================================================
# BY 亿万星辰@1012 脚本屋
# 使用方法:武器、防具名称后用@分隔等级,如:长剑@2,就代表长剑需要2级才可装备。
#==============================================================================
module RPG
class Weapon
def name
return @name.split("@")[0]
end
def level
return @name.split("@")[1].to_i
end
end
class Armor
def name
return @name.split("@")[0]
end
def level
return @name.split("@")[1].to_i
end
end
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
# 装備画面で、装備変更の候補となるアイテムの一覧を表示するウィンドウです。
#==============================================================================
class Window_EquipItem < Window_Item
#--------------------------------------------------------------------------
# ● 項目の描画
# index : 項目番号
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
if item != nil
number = $game_party.item_number(item)
enabled = enable?(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enabled)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
#--------------------------------------------------------------------------
# ● アイテムを許可状態で表示するかどうか
# item : アイテム
#--------------------------------------------------------------------------
def enable?(item)
return @actor.level >= item.level
end
#--------------------------------------------------------------------------
# ● 当前是否可装备
#--------------------------------------------------------------------------
def enabled?
return true if self.item.nil?
return @actor.level >= @data[self.index].level
end
end
#==============================================================================
# ■ Scene_Equip
#------------------------------------------------------------------------------
# 装備画面の処理を行うクラスです。
#==============================================================================
class Scene_Equip < Scene_Base
#--------------------------------------------------------------------------
# ● アイテム選択の更新
#--------------------------------------------------------------------------
def update_item_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@equip_window.active = true
@item_window.active = false
@item_window.index = -1
elsif Input.trigger?(Input::C)
if @item_window.enabled?
Sound.play_equip
@actor.change_equip(@equip_window.index, @item_window.item)
@equip_window.active = true
@item_window.active = false
@item_window.index = -1
@equip_window.refresh
for item_window in @item_windows
item_window.refresh
end
else
Sound.play_buzzer
end
end
end
end
复制代码
[LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者:
holwar天下
时间:
2008-2-6 02:16
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1