| 赞 | 14 |
| VIP | |
| 好人卡 | |
| 积分 | 6 |
| 经验 | |
| 最后登录 | 2026-8-9 |
| 在线时间 | 797 小时 |
- 梦石
- 0
- 星屑
- 606
- 在线时间
- 797 小时
- 注册时间
- 2014-7-1
- 回帖
- 501

|
楼主 |
发表于 2017-2-23 12:56:00
|
显示全部楼层
p $game_system.items_record 这个读取的{0=>{10=>1}}
角色ID都是0 我把我脚本贴出来
- #$scene =Scene_Tian.new
- $任脉天赋 = [10,11,12,13,14]
- $督脉天赋 = [20,21,22,23,24]
- $冲脉天赋 = [30,31,32,33,34]
- $带脉天赋 = [40,41,42,43,44]
- $消耗记录 = [10,11,12,13,14]
-
- class Scene_Tian
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor_index : 角色索引
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0, menu_index = 0)
- @actor_index = actor_index
- @menu_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- # 获取角色
- @actor = $game_party.actors[@actor_index]
- # 生成状态窗口
- @status_window = Window_Tian.new(@actor)
- s1 = "天赋进阶:任脉:"
- s2 = "天赋进阶:督脉:"
- s3 = "天赋进阶:冲脉:"
- s4 = "天赋进阶:带脉:"
- s5 = "天赋重生:慎用"
- @commandy_window = Window_Aommand.new(175, [s1,s2,s3,s4,s5])
- @commandy_window.index = @menu_index
- @commandy_window.opacity = 0
- @commandy_window.active = true
- @commandy_window.x+=90
- @commandy_window.y+=150
-
- @item_window = Window_Etem.new(@actor)
- @item_window.active = false
- # @item_window.visible = false
- # @item_window.opacity = 0
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面被切换的话就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @status_window.dispose
- @commandy_window.dispose
- @item_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- @item_window.update
- @commandy_window.update
- if @commandy_window.active
- update_commandy
- return
- end
-
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- $scene = Scene_Menu.new(3)
- return
- end
- end
-
- def update_commandy
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- $scene = Scene_Menu.new(3)
- return
- end
-
- if Input.repeat?(Input::C)
- $game_system.se_play($data_system.decision_se)
- @actor = $game_party.actors[@actor_index]
- @item = @item_window.item
- case @commandy_window.index
- when 0 #任脉
- #=======================================
- if @actor.renlv == 4 && @actor.ren==6
- p "全部完成"
- else
- if @actor.ren==6
- @actor.ren = 0
- @actor.renlv += 1
- Audio.se_play("Audio/SE/Y_se_item02")
- @item_window.refresh
- @status_window.refresh
- else
- if $game_party.item_number($任脉天赋[@actor.renlv])>=1
- @actor.ren+=1
- $game_party.lose_item($任脉天赋[@actor.renlv],1)
- p $game_system.items_record
- @status_window.refresh
- @item_window.refresh
- Audio.se_play("Audio/SE/006-System06")
- else
- Audio.se_play("Audio/SE/004-System04")
- p "缺少升级所需要的对应天赋"
- end
- end
- end
-
- #=======================================
- when 1 #督脉
- if @actor.dulv == 4 && @actor.du==6
- p "全部完成"
- else
- if @actor.du==6
- @actor.du = 0
- @actor.dulv += 1
- Audio.se_play("Audio/SE/Y_se_item02")
- @item_window.refresh
- @status_window.refresh
- else
- if $game_party.item_number($督脉天赋[@actor.dulv])>=1
- @actor.du+=1
- $game_party.lose_item($督脉天赋[@actor.dulv],1)
- @status_window.refresh
- @item_window.refresh
- Audio.se_play("Audio/SE/006-System06")
- else
- Audio.se_play("Audio/SE/004-System04")
- p "缺少升级所需要的对应天赋"
- end
- end
- end
- when 2 #冲脉
- if @actor.chonglv == 4 && @actor.chong==6
- p "全部完成"
- else
- if @actor.chong==6
- @actor.chong = 0
- @actor.chonglv += 1
- Audio.se_play("Audio/SE/Y_se_item02")
- @status_window.refresh
- @item_window.refresh
- else
- if $game_party.item_number($冲脉天赋[@actor.chonglv])>=1
- @actor.chong+=1
- $game_party.lose_item($冲脉天赋[@actor.chonglv],1)
- @status_window.refresh
- @item_window.refresh
- Audio.se_play("Audio/SE/006-System06")
- else
- Audio.se_play("Audio/SE/004-System04")
- p "缺少升级所需要的对应天赋"
- end
- end
- end
- when 3 #带脉
- if @actor.dailv == 4 && @actor.dai==6
- p "全部完成"
- else
- if @actor.dai==6
- @actor.dai = 0
- @actor.dailv += 1
- Audio.se_play("Audio/SE/Y_se_item02")
- @item_window.refresh
- @status_window.refresh
- else
- if $game_party.item_number($带脉天赋[@actor.dailv])>=1
- @actor.dai+=1
- $game_party.lose_item($带脉天赋[@actor.dailv],1)
- @status_window.refresh
- @item_window.refresh
- Audio.se_play("Audio/SE/006-System06")
- else
- Audio.se_play("Audio/SE/004-System04")
- p "缺少升级所需要的对应天赋"
- end
- end
- end
- when 4 #重生
-
- $game_system.items_record[@actor.id].each_pair{|key, value|$game_party.gain_item(key, value)}
-
- @actor.ren = 0
- @actor.du = 0
- @actor.chong = 0
- @actor.dai = 0
- @actor.renlv = 0
- @actor.dulv = 0
- @actor.chonglv = 0
- @actor.dailv = 0
- Audio.se_play("Audio/SE/Y_se_item06")
- @status_window.refresh
- @item_window.refresh
- p "重生成功,返还所有资源,退化英雄经脉"
-
- end
- end
-
- # 按下 R 键的情况下
- if Input.trigger?(Input::R)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至下一位角色
- @actor_index += 1
- @actor_index %= $game_party.actors.size
- # 切换到别的状态画面
- $scene = Scene_Tian.new(@actor_index)
- return
- end
- # 按下 L 键的情况下
- if Input.trigger?(Input::L)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至上一位角色
- @actor_index += $game_party.actors.size - 1
- @actor_index %= $game_party.actors.size
- # 切换到别的状态画面
- $scene = Scene_Tian.new(@actor_index)
- return
- end
- end
- #-----------------------
- end
复制代码
|
|