赞 | 0 |
VIP | 0 |
好人卡 | 1 |
积分 | 1 |
经验 | 1174 |
最后登录 | 2013-8-21 |
在线时间 | 40 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 40 小时
- 注册时间
- 2005-12-30
- 帖子
- 41
|
4楼
楼主 |
发表于 2012-10-8 21:43:48
|
只看该作者
- def draw_item(index)
- rect = item_rect(index)
- self.contents.clear_rect(rect)
- actor = @data[index]
-
- if $actor_fighted == nil
- #以ACTORS数组大小生成新数组
- p $game_actors
-
- #自行计算ACTOR长度
- #~ actors_size = 0
- #~ for i in $game_actors
- #~ actors_size += 1
- #~ end
-
- $actor_fighted=Array.new($game_actors.size)#(actors_size)#
- #将新数组内容均置为0
- for i in $actor_fighted
- i=0
- end
- end
-
- if actor != nil
- if TSRPG::MAP_ACTOR_FORCED[@map_id] != nil and
- TSRPG::MAP_ACTOR_FORCED[@map_id].include?(actor.id)
- self.contents.font.color = knockout_color
- self.contents.draw_text(rect, actor.name + "(强制战斗)")
- elsif TSRPG::MAP_ACTOR_STOP[@map_id] != nil and
- TSRPG::MAP_ACTOR_STOP[@map_id].include?(actor.id)
- self.contents.font.color = crisis_color
- self.contents.draw_text(rect, actor.name + "(禁止战斗)")
- elsif $game_actors[actor.id].hp <= 0
- self.contents.font.color = knockout_color
- self.contents.draw_text(rect, actor.name + "(昏迷 OTL)")
-
- elsif $actor_fighted[actor.id] != 0 #出战一次后休息
- self.contents.font.color = crisis_color
- self.contents.draw_text(rect, actor.name + "(战累了要休息)")
-
- else
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = selected?(index) ? 255 : 128
- self.contents.draw_text(rect, "#{actor.name}(#{$game_actors[actor.id].hp}/#{$game_actors[actor.id].maxhp})")
- end
- end
- end
复制代码 @protosssonny
我把代码写到这个类的方法里面,然后p $game_actors有显示了,不过$game_actors.size还是不行,显示未定义size
错误信息:
NoMethodError occurred
undefined method 'size' for #<Game_Actors:0x2b4a860>
|
|