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

Project1

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

怎么调 血条,名字的Z直

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-26
帖子
206
跳转到指定楼层
1
发表于 2008-5-3 03:59:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv1.梦旅人

梦石
0
星屑
142
在线时间
264 小时
注册时间
2006-11-22
帖子
1057
2
发表于 2008-5-3 04:02:50 | 只看该作者
越后描画Z值越高,这些东西好像无法手动调Z,Bitmap中都没Z值的方法。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-26
帖子
206
3
 楼主| 发表于 2008-5-3 04:07:03 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-29
帖子
826
4
发表于 2008-5-3 04:11:04 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

蚂蚁卡卡

梦石
0
星屑
116
在线时间
66 小时
注册时间
2007-12-16
帖子
3081
5
发表于 2008-5-3 04:17:10 | 只看该作者
在X,Y下面新加一个z值
再设置z的值
像66录像横版战斗那样 可不可以呢
《隋唐乱》完整解密版点击进入
米兰,让我怎么说离开……

曾经我也是一个有志青年,直到我膝盖中了一箭……

《隋唐乱》博客地址
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-26
帖子
206
6
 楼主| 发表于 2008-5-3 04:24:27 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
1 小时
注册时间
2007-12-15
帖子
238
7
发表于 2008-5-3 04:36:18 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-26
帖子
206
8
 楼主| 发表于 2008-5-3 04:39:27 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
142
在线时间
264 小时
注册时间
2006-11-22
帖子
1057
9
发表于 2008-5-3 04:43:58 | 只看该作者
以下引用小包子于2008-5-2 20:39:27的发言:


以下引用lldjjf于2008-5-2 20:36:18的发言:

需要在战斗准备阶段,生成两个新窗口,一个用来描绘敌人名字。另一个生成血条窗口,开始的时候让其不可见。刷新部分,血条窗口刷新,如果25号开关打开,血条窗口可见就行了。这两个脚本站上都有。


地址贴上来好吗?
要不 我在这发贴干什么...
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. # ■ エネミーHP&SP(ver 0.98)

  5. # □ カスタマイズポイント
  6. #==============================================================================
  7. module PLAN_HPSP_DRAW
  8. FONT_NAME         = ["黑体", "楷体", "宋体"]    # フォント
  9. FONT_SIZE         =  14                               # フォントサイズ
  10. FONT_BOLD         = true                              # 太字
  11. FONT_ITALIC       = true                              # 斜体

  12. DRAW_NAME         = true                             # 名前の描画
  13. DRAW_HP           = true                              # HP の描画
  14. DRAW_SP           = true                              # SP の描画

  15. DRAW_WIDTH        =  80                               # 描画幅
  16. DRAW_HEIGHT       = 3 * 32                            # 描画高さ
  17. DRAW_SPACE        =   0                               # 行間
  18. DRAW_Y            =  36                               # Y 座標修正値
  19. end


  20. #==============================================================================
  21. # ■ Sprite_Battler
  22. #==============================================================================

  23. class Sprite_Battler < RPG::Sprite
  24. #--------------------------------------------------------------------------
  25. # ● オブジェクト初期化
  26. #--------------------------------------------------------------------------
  27. alias plan_enemy_hpsp_draw_initialize initialize
  28. def initialize(viewport, battler = nil)
  29.    # 元のメソッドに戻す
  30.    plan_enemy_hpsp_draw_initialize(viewport, battler)
  31.    # エネミーの場合
  32.    if @battler.is_a?(Game_Enemy)
  33.      width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
  34.      height = PLAN_HPSP_DRAW::DRAW_HEIGHT + 32
  35.      x = @battler.screen_x - width / 2
  36.      y = @battler.screen_y - height + 32 + PLAN_HPSP_DRAW::DRAW_Y
  37.      @enemy_hpsp_window = Window_Base.new(x, y, width, height)
  38.      @enemy_hpsp_window.contents = Bitmap.new(width - 32, height - 32)
  39.      @enemy_hpsp_window.contents.font.name = PLAN_HPSP_DRAW::FONT_NAME
  40.      @enemy_hpsp_window.contents.font.size = PLAN_HPSP_DRAW::FONT_SIZE
  41.      @enemy_hpsp_window.contents.font.bold = PLAN_HPSP_DRAW::FONT_BOLD
  42.      @enemy_hpsp_window.contents.font.italic = PLAN_HPSP_DRAW::FONT_ITALIC
  43.      y = 0
  44.      @old_enemy_hpsp = []
  45.      one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
  46.      if PLAN_HPSP_DRAW::DRAW_NAME
  47.        @enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
  48.        y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
  49.        @old_enemy_hpsp.push(@battler.name)
  50.      end
  51.      if PLAN_HPSP_DRAW::DRAW_HP
  52.        @enemy_hpsp_window.draw_actor_hp2222(@battler, 0, y, width - 32)
  53.        y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
  54.        @old_enemy_hpsp.push(@battler.hp)
  55.      end
  56.      if PLAN_HPSP_DRAW::DRAW_SP
  57.        @enemy_hpsp_window.draw_actor_sp2222(@battler, 0, y, width - 32)
  58.        @old_enemy_hpsp.push(@battler.sp)
  59.      end
  60.      @enemy_hpsp_window.opacity = 0
  61.      @enemy_hpsp_window.contents_opacity = 0
  62.      @enemy_hpsp_window.z = -2
  63.    end
  64. end
  65. #--------------------------------------------------------------------------
  66. # ● 解放
  67. #--------------------------------------------------------------------------
  68. alias plan_enemy_hpsp_draw_dispose dispose
  69. def dispose
  70.    # エネミーの場合
  71.    if @battler.is_a?(Game_Enemy)
  72.      @enemy_hpsp_window.dispose
  73.    end
  74.    # 元のメソッドに戻す
  75.    plan_enemy_hpsp_draw_dispose
  76. end
  77. #--------------------------------------------------------------------------
  78. # ● フレーム更新
  79. #--------------------------------------------------------------------------
  80. alias plan_enemy_hpsp_draw_update update
  81. def update
  82.    # 元のメソッドに戻す
  83.    plan_enemy_hpsp_draw_update
  84.    if $game_switches[25] == true
  85.      @enemy_hpsp_window.visible = true
  86.    else
  87.      @enemy_hpsp_window.visible = false
  88.    end
  89.    # エネミーの場合
  90.    if @battler.is_a?(Game_Enemy)
  91.      @enemy_hpsp_window.visible = @battler_visible
  92.    # スプライトの座標を設定
  93.      width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
  94.      @enemy_hpsp_window.x = self.x - width / 2
  95.      @now_enemy_hpsp = []
  96.      if PLAN_HPSP_DRAW::DRAW_NAME
  97.        @now_enemy_hpsp.push(@battler.name)
  98.      end
  99.      if PLAN_HPSP_DRAW::DRAW_HP
  100.        @now_enemy_hpsp.push(@battler.hp)
  101.      end
  102.      if PLAN_HPSP_DRAW::DRAW_SP
  103.        @now_enemy_hpsp.push(@battler.sp)
  104.      end
  105.      if @old_enemy_hpsp != @now_enemy_hpsp and $game_temp.enemy_hpsp_refresh
  106.        @old_enemy_hpsp = @now_enemy_hpsp
  107.        @enemy_hpsp_window.contents.clear
  108.        y = 0
  109.        width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
  110.        one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
  111.        if PLAN_HPSP_DRAW::DRAW_NAME
  112.          @enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
  113.          y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
  114.        end
  115.        if PLAN_HPSP_DRAW::DRAW_HP
  116.          @enemy_hpsp_window.draw_actor_hp2222(@battler, 0, y, width - 32)
  117.          y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
  118.        end
  119.        if PLAN_HPSP_DRAW::DRAW_SP
  120.          @enemy_hpsp_window.draw_actor_sp2222(@battler, 0, y, width - 32)
  121.        end
  122.        Graphics.frame_reset
  123.      end
  124.    end
  125. end
  126. #--------------------------------------------------------------------------
  127. # ● visible の設定
  128. #--------------------------------------------------------------------------
  129. if !method_defined?("plan_enemy_hpsp_draw_visible=")
  130.    alias plan_enemy_hpsp_draw_visible= visible=
  131. end
  132. def visible=(bool)
  133.    # エネミーの場合
  134.    if @battler.is_a?(Game_Enemy)
  135.      @enemy_hpsp_window.visible = bool
  136.    end
  137.    # 元のメソッドに戻す
  138.    self.plan_enemy_hpsp_draw_visible=(bool)
  139. end
  140. #--------------------------------------------------------------------------
  141. # ● 不透明度の設定
  142. #--------------------------------------------------------------------------
  143. if !method_defined?("plan_enemy_hpsp_draw_opacity=")
  144.    alias plan_enemy_hpsp_draw_opacity= opacity=
  145. end
  146. def opacity=(n)
  147.    # 元のメソッドに戻す
  148.    self.plan_enemy_hpsp_draw_opacity=(n)
  149.    # エネミーの場合
  150.    if @battler.is_a?(Game_Enemy)
  151.      @enemy_hpsp_window.contents_opacity = n
  152.    end
  153. end
  154. #--------------------------------------------------------------------------
  155. # ● ダメージ
  156. #--------------------------------------------------------------------------
  157. def damage(value, critical)
  158.    super(value, critical)
  159.    bitmap = @_damage_sprite.bitmap
  160.    @_damage_sprite.dispose
  161.    @_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
  162.    @_damage_sprite.bitmap = bitmap
  163.    @_damage_sprite.ox = 80
  164.    @_damage_sprite.oy = 20
  165.    @_damage_sprite.x = self.x
  166.    @_damage_sprite.y = self.y - self.oy / 2
  167.    @_damage_sprite.viewport.z = self.viewport.z + 1
  168.    @_damage_sprite.z = 3000
  169.    @_damage_duration = 40
  170. end
  171. #--------------------------------------------------------------------------
  172. # ● ダメージ解放
  173. #--------------------------------------------------------------------------
  174. def dispose_damage
  175.    if @_damage_sprite != nil
  176.      @_damage_sprite.viewport.dispose
  177.    end
  178.    super
  179. end
  180. end





  181. #==============================================================================
  182. # ■ Game_Temp
  183. #==============================================================================

  184. class Game_Temp
  185. #--------------------------------------------------------------------------
  186. # ● 公開インスタンス変数
  187. #--------------------------------------------------------------------------
  188. attr_accessor :enemy_hpsp_refresh
  189. #--------------------------------------------------------------------------
  190. # ● オブジェクト初期化
  191. #--------------------------------------------------------------------------
  192. alias plan_enemy_hpsp_draw_initialize initialize
  193. def initialize
  194.    # 元のメソッドに戻す
  195.    plan_enemy_hpsp_draw_initialize
  196.    @enemy_hpsp_refresh = false
  197. end
  198. end

  199. #==============================================================================
  200. # ■ Scene_Battle
  201. #==============================================================================

  202. class Scene_Battle
  203. #--------------------------------------------------------------------------
  204. # ● プレバトルフェーズ開始 (エネミー名+アルファベット用)
  205. #--------------------------------------------------------------------------
  206. alias plan_enemy_hpsp_draw_start_phase1 start_phase1
  207. def start_phase1
  208.    $game_temp.enemy_hpsp_refresh = true
  209.    # 元のメソッドに戻す
  210.    plan_enemy_hpsp_draw_start_phase1
  211. end
  212. #--------------------------------------------------------------------------
  213. # ● パーティコマンドフェーズ開始 (エネミー名+アルファベット用)
  214. #--------------------------------------------------------------------------
  215. alias plan_enemy_hpsp_draw_start_phase2 start_phase2
  216. def start_phase2
  217.    $game_temp.enemy_hpsp_refresh = false
  218.    # 元のメソッドに戻す
  219.    plan_enemy_hpsp_draw_start_phase2
  220. end
  221. #--------------------------------------------------------------------------
  222. # ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
  223. #--------------------------------------------------------------------------
  224. alias plan_enemy_hpsp_draw_update_phase4_step5 update_phase4_step5
  225. def update_phase4_step5
  226.    # 元のメソッドに戻す
  227.    plan_enemy_hpsp_draw_update_phase4_step5
  228.    $game_temp.enemy_hpsp_refresh = true
  229. end
  230. #--------------------------------------------------------------------------
  231. # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  232. #--------------------------------------------------------------------------
  233. alias plan_enemy_hpsp_draw_update_phase4_step6 update_phase4_step6
  234. def update_phase4_step6
  235.    # 元のメソッドに戻す
  236.    plan_enemy_hpsp_draw_update_phase4_step6
  237.    $game_temp.enemy_hpsp_refresh = false
  238. end
  239. end


  240. #==============================================================================
  241. # ■ Window_Base
  242. #==============================================================================

  243. class Window_Base < Window
  244. #--------------------------------------------------------------------------
  245. # ● 名前の描画
  246. #--------------------------------------------------------------------------
  247. def draw_actor_name(actor, x, y, width = 120, align = 0)
  248.    self.contents.font.color = normal_color
  249.    align = 1 if $scene.is_a?(Scene_Battle)
  250.    self.contents.draw_text(x, y, width, 32, actor.name, align)
  251. end
  252. #--------------------------------------------------------------------------
  253. # ● ステートの描画
  254. #--------------------------------------------------------------------------
  255. def draw_actor_state(actor, x, y, width = 120)
  256.    # 元のメソッドに戻す
  257.    text = make_battler_state_text(actor, width, true)
  258.    self.contents.draw_text(x, y, width, 32, text, 1)
  259. end
  260. end


  261. #==============================================================================
  262. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  263. #==============================================================================

  264. class Window_Base < Window
  265.   def draw_actor_hp2222(actor, x, y, width = 100, height=8)
  266.     y+=3
  267.     olx = x
  268.     oly = y
  269.     w = width * actor.hp / [actor.maxhp,1].max
  270.     hp_color_1 = Color.new(255, 0, 0, 192)
  271.     hp_color_2 = Color.new(255, 255, 0, 192)
  272.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  273.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  274.     x -= 1
  275.     y += (height/4).floor
  276.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  277.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  278.     x -= 1
  279.     y += (height/4).ceil
  280.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  281.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  282.     x -= 1
  283.     y += (height/4).ceil
  284.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  285.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  286.     x = olx
  287.     y = oly-14   
  288.     # 描绘字符串 "HP"
  289.     self.contents.font.color = system_color
  290.     self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
  291.     # 计算描绘 MaxHP 所需的空间
  292.     if width - 32 >= 108
  293.       hp_x = x + width - 108
  294.       flag = true
  295.     elsif width - 32 >= 48
  296.       hp_x = x + width - 48
  297.       flag = false
  298.     end
  299.     # 描绘 HP
  300.     self.contents.font.color = actor.hp == 0 ? knockout_color :
  301.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  302.     self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
  303.     # 描绘 MaxHP
  304.     if flag
  305.       self.contents.font.color = normal_color
  306.       self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
  307.       self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
  308.     end   
  309.   end
  310.   def draw_actor_sp2222(actor, x, y, width = 100, height = 8)
  311.     y+=3
  312.     olx = x
  313.     oly = y
  314.     w = width * actor.sp / [actor.maxsp,1].max
  315.     hp_color_1 = Color.new( 0, 0, 255, 192)
  316.     hp_color_2 = Color.new( 0, 255, 255, 192)
  317.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  318.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  319.     x -= 1
  320.     y += (height/4).floor
  321.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  322.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  323.     x -= 1
  324.     y += (height/4).ceil
  325.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  326.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  327.     x -= 1
  328.     y += (height/4).ceil
  329.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  330.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  331.     x = olx
  332.     y = oly-14
  333.     # 描绘字符串 "SP"
  334.     self.contents.font.color = system_color
  335.     self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
  336.     # 计算描绘 MaxSP 所需的空间
  337.     if width - 32 >= 108
  338.       sp_x = x + width - 108
  339.       flag = true
  340.     elsif width - 32 >= 48
  341.       sp_x = x + width - 48
  342.       flag = false
  343.     end
  344.     # 描绘 SP
  345.     self.contents.font.color = actor.sp == 0 ? knockout_color :
  346.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  347.     self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
  348.     # 描绘 MaxSP
  349.     if flag
  350.       self.contents.font.color = normal_color
  351.       self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
  352.       self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
  353.     end   
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # ● ライン描画 by 桜雅 在土
  357.   #--------------------------------------------------------------------------
  358.   def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  359.     # 描写距離の計算。大きめに直角時の長さ。
  360.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  361.     # 描写開始
  362.     if end_color == start_color
  363.       for i in 1..distance
  364.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  365.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  366.         if width == 1
  367.           self.contents.set_pixel(x, y, start_color)
  368.         else
  369.           self.contents.fill_rect(x, y, width, width, start_color)
  370.         end
  371.       end
  372.     else
  373.       for i in 1..distance
  374.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  375.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  376.         r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  377.         g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  378.         b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  379.         a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  380.         if width == 1
  381.           self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  382.         else
  383.           self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  384.         end
  385.       end
  386.     end
  387.   end
  388. end
  389. #==============================================================================
  390. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  391. #==============================================================================
复制代码
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-26
帖子
206
10
 楼主| 发表于 2008-5-3 17:29:47 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-24 01:55

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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