- UID
- 104
- 帖子
- 8462
- 主题
- 169
- 精华
- 3
- 积分
- 13212
- 历练
- 7
- 声望
- 24
- 人气
- 2448
- 经验
- 12327
- 金钱
- 1193
- 注册时间
- 2009-8-27
- 最后登录
- 2024-11-21
- 在线时间
- 922 小时
- 阅读权限
- 100
TA的每日心情 | 开心 昨天 00:01 |
---|
签到天数: 889 天 [LV.10]以坛为家III - 精华
- 3
- 积分
- 13212
- 历练
- 7
- 声望
- 24
- 人气
- 2448
|
- return
- else
- $game_system.se_play($data_system.decision_se)
- if $mShop_use_variable == 0
- $game_party.gain_gold(-@skill.price)
- $mShop_gold -= @skill.price
- else
- $game_variables[$mShop_use_variable] -= @skill.price
- $mShop_gold -= @skill.price
- end
- $game_party.actors[@status_window.index].learn_skill(@skill.id)
- @gold_window.refresh
- @buy_window.refresh
- @status_window.refresh
- @status_window.active = false
- @status_window.index = -1
- @buy_window.active = true
- end
- end
- end
- end
- #==============================================================================
- # ■ Window_MShopStatus
- #------------------------------------------------------------------------------
- # 特技商店画面、显示物品所持数与角色装备的窗口。
- #==============================================================================
- class Window_MShopStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(368, 64, 272, 352)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.size = 18
- @skill = nil
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- draw_actor_graphic(actor,12,80*i+64)
- self.contents.font.color = system_color
- self.contents.draw_text(44, 80*i, 240, 32, actor.name)
- self.contents.draw_text(0, 80*i , 240-20,32,"等级",2)
- self.contents.font.color = normal_color
- self.contents.draw_text(0, 80*i, 240, 32, actor.level.to_s , 2)
- self.contents.font.color = system_color
- self.contents.draw_text(44, 80*i+22, 45, 32, $data_system.words.hp)
- self.contents.font.color = normal_color
- self.contents.draw_text(44, 80*i+22, 90, 32, actor.maxhp.to_s,2)
- self.contents.font.color = system_color
- self.contents.draw_text(150, 80*i+22, 45, 32, $data_system.words.sp)
- self.contents.font.color = normal_color
- self.contents.draw_text(150, 80*i+22, 90, 32, actor.maxsp.to_s,2)
- if actor.skill_learn?(@skill.id)
- self.contents.font.color = Color.new(255,255,255,128)
- self.contents.draw_text(44, 80*i+44, 196, 32, "⊙此项特技已经学习⊙",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(44, 80*i+44, 240, 32, "★此项特技尚未学习★")
- end
- end
- @item_max = $game_party.actors.size
- end
- #--------------------------------------------------------------------------
- # ● 设置物品
- # item : 新的物品
- #--------------------------------------------------------------------------
- def skill=(skill)
- if @skill != skill
- @skill = skill
- refresh
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
- end
- end
- end
- #==============================================================================
- # ■ Window_MShopBuy
- #------------------------------------------------------------------------------
- # 特技商店画面、浏览显示可以购买的商品的窗口。
- #==============================================================================
- class Window_MShopBuy < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # shop_goods : 商品
- #--------------------------------------------------------------------------
- def initialize(id)
- super(0, 64, 368, 416)
- @id = id
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def skill
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- for skill_id in @id
- skill = $data_skills[skill_id]
- if skill != nil
- @data.push(skill)
- end
- end
- @item_max = @data.size
- if @item_max > 0
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max
- draw_item(i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘羡慕
- # index : 项目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- skill = @data[index]
- # 除此之外的情况设置为无效文字色
- if skill.price <= $mShop_gold
- self.contents.font.color = normal_color
- 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(skill.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, skill.name, 0)
- self.contents.draw_text(x + 240, y, 88, 32, skill.price.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(self.skill == nil ? "" : self.skill.description)
- end
- end
- #==============================================================================
- # ■ RPG原装定义
- #==============================================================================
- module RPG
- class Skill
- def description
- description = @description.split(/@/)[0]
- return description != nil ? description : ''
- end
- def price
- price = @description.split(/@/)[1]
- return price != nil ? price.to_i : 0
- end
- end
- end
复制代码 |
|