Project1

标题: 道具产生错误问题求解! [打印本页]

作者: TheRebirth    时间: 2012-1-12 18:09
标题: 道具产生错误问题求解!
本帖最后由 TheRebirth 于 2012-1-12 18:10 编辑

(唉...这讨厌的表情...)

如下图和脚本:
class TShoot_Enemy6 < TShoot_Enemy
  def set_type
    @hp = 80 + $difficulty * 20
    @point = 4
    @power = 4
    @file_name = "Monster2.png"
    @file_index = 1
    @vy = 2 << 10
    @cnt_shot_reset = 180
  end
  def action
    whirl_shot(2 + $difficulty / 3 * 2,768,rand(4),2)
    basic_move3(1200)
  end
end

根据脚本,击破该敌人后应该产生四个"点"和四个"pOWER",但是这里只有"pOWER",一个"点"也木有...(↓)



虽然说我弄的东西配色的确拙了点,但是这个应该也无关紧要了吧...

个人认为是不是这里出问题了?

def set_item
    n = @score + @power + @life + @bomb + @money + @bigmoney + @bigpower
    return if n == 0
    a = -Math::PI / 2
    for i in 0...@score
      d = Math::PI * 2 / @score
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 0)
      a += d
    end
    for i in 0...@power
      d = Math::PI * 2 / @power
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 1)
      a += d
    end
    for i in 0...@life
      d = Math::PI * 2 / @life
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 2)
      a += d
    end
    for i in 0...@bomb
      d = Math::PI * 2 / @bomb
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 3)
      a += d
    end
    for i in 0...@money
      d = Math::PI * 2 / @money
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 4)
      a += d
    end
    for i in 0...@bigmoney
      d = Math::PI * 2 / @bigmoney
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 5)
      a += d
    end
    for i in 0...@bigpower
      d = Math::PI * 2 / @bigpower
      $scene.add_item((@sx >> 10) + 8, self.y + 8, (Math.cos(a) * 768).to_i,
        (Math.sin(a) * 768).to_i, 6)
      a += d
    end
  end

全脚本在此...
Scripts.rvdata (156.8 KB, 下载次数: 33) dsu_plus_rewardpost_czw




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1