设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2743|回复: 4
打印 上一主题 下一主题

[已经解决] 谁可幇制作轮盘式血槽系统?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1206 小时
注册时间
2010-10-23
帖子
328
跳转到指定楼层
1
 楼主| 发表于 2013-1-26 21:13:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1星屑
如题: 小弟制作中的游戏需要以轮盘式血槽来显示HP, MP和TP,便于增減hp值等等... 这样显示会比较好。
它的特点是当你受到致命伤害时你不会立即死亡,轮盘是会不断下降直到HP下降到0的时候你才会死亡。
有谁懂得写伤害数值显示的可以幇做一个轮盘式血槽系统吗? thx~

跟earthbound的一样或者是其他轮盘式血槽都可以。

最佳答案

查看完整内容

写完领奖- -b http://rpg.blue/thread-281095-1-1.html

Lv1.梦旅人

梦石
0
星屑
50
在线时间
270 小时
注册时间
2010-2-4
帖子
1305
2
发表于 2013-1-26 21:13:50 | 只看该作者

点评

这个ok, 谢谢你  发表于 2013-1-28 22:37
好歹当年也当过大魔王过,orz
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
95
在线时间
211 小时
注册时间
2011-8-16
帖子
300
3
发表于 2013-1-26 21:16:39 | 只看该作者
有心无力,坐等好心人。我去试试。
RPGMaker 脚本/学习交流群:143356012
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
133 小时
注册时间
2012-8-23
帖子
126
4
发表于 2013-1-31 16:10:24 | 只看该作者
轮盘式血槽(放在mian前面):

#转轮血条
#章半仙制作
module RollBar
ROLL_UNIT = 1       #每次转轮扣的血
ROLL_TIME = 0.05    #每次转轮花的秒数
DEFAULT_SYS= false  #如果是默认系统设为true会略微提升一点效率- -b
VERSION = 0.92
end
class Game_Actor
include RollBar
def hp=(hp)
    fucker_hp = [[hp, mhp].min, 0].max - @hp
    rec = fucker_hp > 0
    Thread.new do
     (fucker_hp / ROLL_UNIT).truncate.abs.times do
       rec ? @hp = [@hp + ROLL_UNIT, mhp].min  : @hp = [@hp - ROLL_UNIT, 0].max
       refresh
       sleep(ROLL_TIME)
      end
    end
end
def mp=(mp)
    fucker_mp = [[mp, mmp].min, 0].max - @mp
    rec = fucker_mp > 0
    Thread.new do
     (fucker_mp  / ROLL_UNIT).truncate.abs.times do
       rec ? @mp = [@mp + ROLL_UNIT, mmp].min : @mp = [@mp - ROLL_UNIT, 0].max
       refresh
       sleep(ROLL_TIME)
      end
    end
end
def tp=(tp)
    fucker_tp = [[tp, max_tp].min, 0].max - @tp
    rec = fucker_tp > 0
    Thread.new do
     (fucker_tp / ROLL_UNIT).truncate.abs.times do
       rec ? @tp = [@tp + ROLL_UNIT, max_tp].min : @tp = [@tp - ROLL_UNIT, 0].max
       sleep(ROLL_TIME)
      end
    end
  end
  alias fucker_clear_actions clear_actions
  def clear_actions
    fucker_clear_actions
    @actions.push Game_Action.new(self)
  end
end
class Window_Base
  include RollBar
  alias fucker_draw_actor_hp draw_actor_hp
  alias fucker_draw_actor_mp draw_actor_mp
  alias fucker_draw_actor_tp draw_actor_tp
  alias fucker_dispose dispose
  def draw_actor_hp(actor, x, y, width = 124)
    reg_window
    unless DEFAULT_SYS
     @hp_need_refresh.each_key do |i|
      @hp_need_refresh.delete(i) if i[1] == x && i[2] == y
     end
    end
    fucker_draw_actor_hp(actor, x, y, width)
  end
  def draw_actor_mp(actor, x, y, width = 124)
    reg_window
    unless DEFAULT_SYS
      @mp_need_refresh.each_key do |i|
       @mp_need_refresh.delete(i) if i[1] == x && i[2] == y
      end
    end
    fucker_draw_actor_mp(actor, x, y, width)
  end
  def draw_actor_tp(actor, x, y, width = 124)
    reg_window
    unless DEFAULT_SYS
      @tp_need_refresh.each_key do |i|
       @tp_need_refresh.delete(i) if i[1] == x && i[2] == y
      end
    end
    fucker_draw_actor_tp(actor, x, y, width)
  end
  def dispose
    unreg_window
    fucker_dispose
  end
  def reg_window
    unless @reg
      @reg = true     
      Graphics.reg_window(self)
      return if DEFAULT_SYS
      @hp_need_refresh = {}
      @mp_need_refresh = {}
      @tp_need_refresh = {}
      class << self
        def roll_bar_refresh
          @hp_need_refresh.each_pair do |p,v|
           next if p[0].hp == v
           contents.clear_rect(p[1], p[2], p[3], line_height)
           fucker_draw_actor_hp(*p)
          end
          @mp_need_refresh.each_pair do |p,v|
           next if p[0].mp == v
           contents.clear_rect(p[1], p[2], p[3], line_height)
           fucker_draw_actor_mp(*p)   
          end
          @tp_need_refresh.each_pair do |p,v|
           next if p[0].tp == v
           contents.clear_rect(p[1], p[2], p[3], line_height)
           fucker_draw_actor_tp(*p)
         end
        end
        def fucker_draw_actor_hp(*args)
          @hp_need_refresh[args] = args[0].hp
          #super
          self.class.instance_method(:fucker_draw_actor_hp).bind(self).call(*args)
        end
        def fucker_draw_actor_mp(*args)        
          @mp_need_refresh[args] = args[0].mp
          #super
          self.class.instance_method(:fucker_draw_actor_mp).bind(self).call(*args)
        end   
        def fucker_draw_actor_tp(*args)
          @tp_need_refresh[args] = args[0].tp
          #super
          self.class.instance_method(:fucker_draw_actor_tp).bind(self).call(*args)
        end
      end
    end
  end
  def unreg_window
    @reg = false
    Graphics.unreg_window(self)
  end
end
class << Graphics
  alias fucker_update update
  def reg_window(window)
    @need_refresh ||= []
    @need_refresh.push window unless @need_refresh.include? window
  end
  def unreg_window(window)
    @need_refresh.delete window if @need_refresh.is_a? Array
  end
  def update
    fucker_update   
    unless @need_refresh.nil?
     for i in @need_refresh
       i.roll_bar_refresh if i.visible
     end
    end
  end
end
if RollBar::DEFAULT_SYS
#以下解决效率问题,可能会造成冲突- -b
class Window_BattleStatus
  def roll_bar_refresh
    for i in 0...$game_party.battle_members.size
      actor = $game_party.battle_members
      x = gauge_area_rect(i).x
      y = gauge_area_rect(i).y
      height = line_height
      @fucker_hp ||= []
      if @fucker_hp != actor.hp
         contents.clear_rect(x, y, 72, height)
         draw_actor_hp(actor, x, y,72)
         @fucker_hp = actor.hp
       end
      @fucker_mp ||= []
      if @fucker_mp != actor.mp
         contents.clear_rect(x + 82, y, 64, height)
         draw_actor_mp(actor, x + 82, y, 64)
         @fucker_mp = actor.mp
       end   
      @fucker_tp ||= []
      if @fucker_tp != actor.tp
         contents.clear_rect( x + 156, y, 64, height)
         draw_actor_tp(actor, x + 156, y, 64)
         @fucker_tp = actor.tp
      end        
    end
  end
end
class Window_MenuStatus
  def roll_bar_refresh
    for i in 0...$game_party.battle_members.size
      actor = $game_party.battle_members
       x = item_rect(i).x  + 108 + 120
       y = item_rect(i).y + line_height / 2
       width = 124
       height = line_height
       @fucker_hp ||= []
       if @fucker_hp != actor.hp
         contents.clear_rect(x, y + line_height, width, height)
         draw_actor_hp(actor, x, y + line_height)
         @fucker_hp = actor.hp
       end
       @fucker_mp ||= []
       if @fucker_mp != actor.mp
         contents.clear_rect(x, y + line_height * 2, width, height)
         draw_actor_mp(actor, x, y + line_height * 2)
         @fucker_mp = actor.mp
       end
    end
  end
end
class Window_SkillStatus
  def roll_bar_refresh
    x = 108 + 120
    y = line_height / 2
    width = 124
    height = line_height  
    if @fucker_hp != @actor.hp
      contents.clear_rect(x, y +  line_height, width, height)
      draw_actor_hp(@actor, x, y + line_height)
      @fucker_hp = @actor.hp
    end
    if @fucker_mp != @actor.mp
      contents.clear_rect(x, y + line_height * 2, width, height)
      draw_actor_mp(@actor, x, y + line_height * 2)
      @fucker_mp = @actor.mp
    end
  end
end
class Window_Status
  def roll_bar_refresh
    x = 136
    y = line_height * 3
    width = 124
    height = line_height
    if @fucker_hp != @actor.hp
      contents.clear_rect(x, y +  line_height, width, height)
      draw_actor_hp(@actor, x, y + line_height)
      @fucker_hp = @actor.hp
    end
    if @fucker_mp != @actor.mp
      contents.clear_rect(x, y + line_height * 2, width, height)
      draw_actor_mp(@actor, x, y + line_height * 2)
      @fucker_mp = @actor.mp
    end
  end
end
end
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
帖子
1543
5
发表于 2013-1-31 19:16:28 | 只看该作者
没玩过这种游戏,现在才知道轮盘式血槽的意思,不过好像数字都一样很慢,2楼的我调到 0.0001 也一样跟不上战斗速度,很久才会跑完,5楼也没比较快,是极限了吗?
修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-16 21:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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