赞 | 23 |
VIP | 207 |
好人卡 | 31 |
积分 | 31 |
经验 | 48797 |
最后登录 | 2024-5-11 |
在线时间 | 1535 小时 |
Lv3.寻梦者 孤独守望
- 梦石
- 0
- 星屑
- 3133
- 在线时间
- 1535 小时
- 注册时间
- 2006-10-16
- 帖子
- 4321
 
|
烦烦烦烦……没想到这么一个东西花了我这么长时间XD
- class Window_MMusic < Window_Selectable
- def initialize
- super(0, 0, 640, 480)
- @column_max = 2
- #对应0级1级2级,等级标准是带队角色等级
- @orzorzorz = ["001-Battle01","002-Battle02","003-Battle03","004-Battle04"]
- @name = ["战斗01","战斗02","战斗03","战斗04"]
- $gold_need = [10,10,10,10]
- refresh
- self.index = 0
- end
- def item
- return @data[self.index]
- end
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- for i in 0..$game_party.actors[0].level
- @data.push(@orzorzorz[i])
- 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
- def draw_item(index)
- item = @data[index]
- self.contents.font.color = normal_color
- x = 4 + index % 2 * (288 + 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))
- opacity = 255
- self.contents.draw_text(x + 28, y, 212, 32, @name[index], 0)
- end
- end
- class Scene_MMusic
- def main
- # 生成命令窗口
- @window = Window_MMusic.new
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入情报
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @window.dispose
- end
- def update
- @window.update
- if Input.trigger?(Input::B)
- $scene = Scene_Map.new
- end
- if Input.trigger?(Input::C)
- if $gold_need[@window.index] > $game_party.gold
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- Audio.bgm_play("Audio/BGM/" + @window.item)
- $game_party.lose_gold($gold_need[@window.index])
- end
- end
- end
复制代码
召唤方法:$scene = Scene_MMusic.new 系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~ |
|