| 赞 | 2 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2020-7-27 |
| 在线时间 | 1379 小时 |
- 梦石
- 0
- 星屑
- 76
- 在线时间
- 1379 小时
- 注册时间
- 2012-7-5
- 回帖
- 1643

|
发表于 2015-6-2 19:20:41
|
显示全部楼层
本帖最后由 kuerlulu 于 2016-5-17 22:42 编辑
看起来不难所以顺手写个能用的(即插即用):- # 装备需要属性 by hyrious
- # 设置姿势: [数据库] - [武器] 或 [防具] - 【说明】
- # 把需要的属性值按"@等级@力量@灵巧@速度@魔力"格式写到后面(@不可省)
- # 例: 004: 密斯利尔剑: 最高级的剑。战士可以装备。@10@@60@100@
- # 即为: 需要 10级 + 60灵巧 + 100速度 才能装备
- module RPG
- # -------------------------------------------------------------------------
- # ● 武器和防具需要的属性值
- # -------------------------------------------------------------------------
- class Weapon
- def description
- des = @description.split(/@/)[0]
- return des != nil ? des : ""
- end
- def need_lv
- need_lv = @description.split(/@/)[1]
- return need_lv != nil ? need_lv.to_i : 1
- end
- def need_str
- need_str = @description.split(/@/)[2]
- return need_str != nil ? need_str.to_i : 0
- end
- def need_dex
- need_dex = @description.split(/@/)[3]
- return need_dex != nil ? need_dex.to_i : 0
- end
- def need_agi
- need_agi = @description.split(/@/)[4]
- return need_agi != nil ? need_agi.to_i : 0
- end
- def need_int
- need_int = @description.split(/@/)[5]
- return need_int != nil ? need_int.to_i : 0
- end
- end
- # -------------------------------------------------------------------------
- class Armor
- def description
- des = @description.split(/@/)[0]
- return des != nil ? des : ""
- end
- def need_lv
- need_lv = @description.split(/@/)[1]
- return need_lv != nil ? need_lv.to_i : 1
- end
- def need_str
- need_str = @description.split(/@/)[2]
- return need_str != nil ? need_str.to_i : 0
- end
- def need_dex
- need_dex = @description.split(/@/)[3]
- return need_dex != nil ? need_dex.to_i : 0
- end
- def need_agi
- need_agi = @description.split(/@/)[4]
- return need_agi != nil ? need_agi.to_i : 0
- end
- def need_int
- need_int = @description.split(/@/)[5]
- return need_int != nil ? need_int.to_i : 0
- end
- end
- end
- # ---------------------------------------------------------------------------
- class Game_Party
- # -------------------------------------------------------------------------
- # ● 是否可以装备判定
- # -------------------------------------------------------------------------
- def item_can_equip?(actor,item)
- return true if item.nil?
- if actor.level<item.need_lv or
- actor.str<item.need_str or
- actor.dex<item.need_dex or
- actor.agi<item.need_agi or
- actor.int<item.need_int
- return false
- end
- return true
- end
- end
- # ---------------------------------------------------------------------------
- class Window_EquipItem < Window_Selectable
- # -------------------------------------------------------------------------
- # ● 描绘装备(+无效灰)
- # -------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- x = 4 + index % 2 * (288 + 32)
- y = index / 2 * 32
- item_can_equip = $game_party.item_can_equip?(@actor, item) # 喵
- 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 = item_can_equip ? normal_color : disabled_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
- # -------------------------------------------------------------------------
- # ● 帮助文本(+需要属性的说明)
- # -------------------------------------------------------------------------
- def update_help
- des = (self.item == nil ? "" : self.item.description)
- unless $game_party.item_can_equip?(@actor, item) || item == nil
- other1 = item.need_lv <= 1 ? "" : (" Lv:" + item.need_lv.to_s)
- other2 = item.need_str == 0 ? "" : (" "+$data_system.words.str+":"+item.need_str.to_s)
- other3 = item.need_dex == 0 ? "" : (" "+$data_system.words.dex+":"+item.need_dex.to_s)
- other4 = item.need_agi == 0 ? "" : (" "+$data_system.words.agi+":"+item.need_agi.to_s)
- other5 = item.need_int == 0 ? "" : (" "+$data_system.words.int+":"+item.need_int.to_s)
- des += "需要"+other1+other2+other3+other4+other5
- end
- @help_window.set_text(des)
- end
- end
- # ---------------------------------------------------------------------------
- class Scene_Equip
- # -------------------------------------------------------------------------
- # ● 装备无效化
- # -------------------------------------------------------------------------
- def update_item
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @right_window.active = true
- @item_window.active = false
- @item_window.index = -1
- return
- end
- if Input.trigger?(Input::C)
- item = @item_window.item
- unless $game_party.item_can_equip?(@actor, item) # 喵
- $game_system.se_play($data_system.buzzer_se)
- return
- else
- $game_system.se_play($data_system.equip_se)
- @actor.equip(@right_window.index, item == nil ? 0 : item.id)
- @right_window.active = true
- @item_window.active = false
- @item_window.index = -1
- @right_window.refresh
- @item_window.refresh
- return
- end
- end
- end
- end
复制代码 然后我暴力解决了一下顺便加个说明可以直接拿出来卖了 |
评分
-
查看全部评分
|