幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1412|回复: 0

关于王者归来复刻2003超级横板战斗问题?

[复制链接]

16

主题

46

帖子

1665

积分

⑥精研

积分
1665
发表于 2005-8-7 22:16:10 | 显示全部楼层 |阅读模式
为什么直接用下面的代码,@frame_height = tempbitmap.height/picturephase.to_i,会出现error 不能除以0,,谁知道为什么?


class Sprite_Battler < Animated_Sprite

attr_accessor :battler
attr_reader   :index
attr_accessor :target_index
attr_accessor :frame_width

  
def initialize(viewport, battler = nil)
   super(viewport)
   @battler = battler
   @pattern_b = 0 #
   @counter_b = 0 #
   @index = 0     #
   if @battler != nil
     tempbitmap = RPG::Cache.battler(@battler.battler_name, @battler.battler_hue)
     @frame_width = tempbitmap.width/4
     picturephase = @battler.picturephase
     if picturephase == "66RPG"
       @frame_height = tempbitmap.height/8
     else
       @frame_height = tempbitmap.height/picturephase.to_i
     end     
   else
     @frame_width, @frame_height = 1,1
   end   
   # start sprite
   @battler.is_a?(Game_Enemy) ? enemy_pose(1) : pose(1)
   @battler_visible = false
   if $target_index == nil
     $target_index = 0
   end
end
  
def index=(index) #
   @index = index  #
   update          #
end               #
  
def dispose
   if self.bitmap != nil
     self.bitmap.dispose
   end
   super
end
  
def enemy                                             #
   $target_index += $game_troop.enemies.size
   $target_index %= $game_troop.enemies.size
   return $game_troop.enemies[$target_index]           #
end                                                   #
  
def actor                                             #
   $target_index += $game_party.actors.size
   $target_index %= $game_party.actors.size
   return $game_party.actors[$target_index]            #
end            
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-23 05:25 , Processed in 0.009636 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表