赞 | 1 |
VIP | 17 |
好人卡 | 3 |
积分 | 1 |
经验 | 49919 |
最后登录 | 2020-2-6 |
在线时间 | 898 小时 |
Lv1.梦旅人 矿工
- 梦石
- 0
- 星屑
- 134
- 在线时间
- 898 小时
- 注册时间
- 2012-10-5
- 帖子
- 1535
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 876加几 于 2013-10-13 17:00 编辑
因为我觉得默认的金钱系统不公平:只有主角有钱,其他角色都是穷光蛋,所以自制了个公平的金钱系统。
但是让它公平吧,脚本又出问题了。
脚本:@Person- #==============================================================================
- # ■ Game_Money
- #------------------------------------------------------------------------------
- # 处理金钱的类。本类的实例请参考$game_money。
- #==============================================================================
- class Game_Money
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_accessor :gold # 保存各角色金钱的数组
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- [url=home.php?mod=space&uid=236945]@gold[/url] = [500, 1000, 750, 10000]
- end
- end
复制代码- #==============================================================================
- # ■ Window_MenuStatus
- #------------------------------------------------------------------------------
- # 显示菜单画面和同伴状态的窗口。
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化目标
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 640, 480 - 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- x = 64
- y = i * 116 + 64
- actor = $game_party.actors[i]
- draw_actor_graphic(actor, x - 20, y + 80)
- draw_actor_name(actor, x + 44, y + 32)
- self.contents.font.color = system_color
- self.contents.draw_text(198 - 40, y + 64, 40, 32, $data_system.words.gold)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 44, y + 64, 32, 32, $game_money.gold[actor].to_s)
- #draw_actor_class(actor, x + 150, y)
- #draw_actor_level(actor, x + 44, y + 32)
- #draw_actor_state(actor, x + 250, y)
- #draw_actor_exp(actor, x + 44, y + 64)
- #draw_actor_hp(actor, x + 185, y + 32)
- #draw_actor_sp(actor, x + 185, y + 64)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- self.cursor_rect.set(0, @index * 116 + 64, 198, 96)
- refresh
- x = 64 + 189
- y = 64
- actor = $game_party.actors[@index]
- draw_actor_half(actor, x + 96, 480 - 300 - 64)
- draw_actor_head(actor, x, y)
- draw_actor_name(actor, x + 48, y)
- draw_actor_class(actor, x + 148, y)
- draw_actor_level_qq(actor, x, y + 32)
- draw_actor_state(actor, x, y + 64)
- draw_actor_exp(actor, x, y + 96)
- draw_actor_hp(actor, x, y + 128)
- draw_actor_sp(actor, x, y + 160)
- draw_actor_mor(actor, x, y + 192)
- draw_actor_fullname(actor, x, y + 200)
- end
- end
- end
复制代码 只能管第2个脚本的30~33行,其它是没有问题的。
报错文字:- 脚本"Window_MenuStatus"的第31行出现了TypeError:
- cannot convert Game_Actor into integer
复制代码 |
|