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

Project1

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

[已经过期] 战斗脚本问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
163 小时
注册时间
2012-1-15
帖子
67
跳转到指定楼层
1
发表于 2013-7-21 08:25:01 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 q6625765 于 2013-7-21 10:10 编辑

谁有这张图的战斗脚本呀,就是血条显示在头上的,主角的位置是在左边怪物是在右边的,游戏是横版的。 素材是这个, 战斗是这个

Lv1.梦旅人

梦石
0
星屑
50
在线时间
470 小时
注册时间
2010-6-25
帖子
316
2
发表于 2013-7-21 10:30:19 | 只看该作者
角色和敌人的左边右边可以自己调整的。
敌人的话直接在数据库里拉一下就好了。
角色的你在脚本编辑器里全局搜索“取得战斗画面的 X 坐标”“取得战斗画面的 Y 坐标”改改数字就有了。
头上显示血量的话应该有很多现成的脚本。下面这个只显示我方血量的。敌方的话你再搜索一下什么的。
另外战斗的话你可以使用“超级横版脚本”“全动画脚本”或者看下癫狂侠客的视频的战斗篇教学,就可以实现待机了。



  1. #==============================================================================
  2. # ■ Window_BattleStatus
  3. #------------------------------------------------------------------------------
  4. #  显示战斗画面同伴状态的窗口。
  5. #==============================================================================

  6. class Window_BattleStatus2 < Window_Base
  7. #--------------------------------------------------------------------------
  8. # ● 初始化对像
  9. #--------------------------------------------------------------------------
  10. #$data_system_level_up_me = "Audio/ME/升级音乐"
  11. def initialize
  12.    super(0, 0, 640, 480)
  13.    self.contents = Bitmap.new(width - 10, height - 32)
  14.    self.opacity = 0
  15.    @level_up_flags = [false, false, false, false]
  16.    refresh
  17. end
  18. #--------------------------------------------------------------------------
  19. # ● 释放
  20. #--------------------------------------------------------------------------
  21. def dispose
  22.    super
  23. end
  24. #--------------------------------------------------------------------------
  25. # ● 设置升级标志
  26. #     actor_index : 角色索引
  27. #--------------------------------------------------------------------------
  28. def level_up(actor_index)
  29.    @level_up_flags[actor_index] = true
  30. end
  31. #--------------------------------------------------------------------------
  32. # ● 刷新
  33. #--------------------------------------------------------------------------
  34. def refresh
  35.    self.contents.clear
  36.    @item_max = $game_party.actors.size
  37.     for i in 0...$game_party.actors.size
  38.      actor2 = $game_party.actors[i]
  39.      case i
  40.        when 0
  41.         x = 390
  42.         y = 100
  43.        when 1
  44.         x = 430
  45.         y = 120
  46.        when 2
  47.         x = 470
  48.         y = 140
  49.        when 3
  50.         x = 510
  51.         y = 160
  52.       end
  53.      if @level_up_flags[i]
  54.        self.contents.font.color = normal_color
  55.        self.contents.draw_text(x, y, 80, 24, "级别提升")
  56.        Audio.me_stop
  57. #        Audio.me_play($data_system_level_up_me)
  58.      else
  59. #     draw_actor_hp1(actor, x-15, y-15, 80)
  60. #     draw_actor_sp1(actor, x-15, y+5, 80)
  61.     end
  62.    end
  63. end

  64. #--------------------------------------------------------------------------
  65. # ● 刷新画面
  66. #--------------------------------------------------------------------------
  67. def update
  68.    super
  69.    # 主界面的不透明度下降
  70.    if $game_temp.battle_main_phase
  71.      self.contents_opacity -= 50 if self.contents_opacity > 1
  72.    else
  73.      self.contents_opacity += 50 if self.contents_opacity < 255
  74.    end
  75. end
  76. end





  77. #==============================================================================
  78. # ■ Window_BattleStatus
  79. #==============================================================================
  80. class Window_BattleStatus2 < Window_Base
  81. #--------------------------------------------------------------------------
  82. # ● 初始化
  83. #--------------------------------------------------------------------------
  84. alias xrxs_bp2_refresh refresh
  85. def refresh
  86.    xrxs_bp2_refresh
  87.    @item_max = $game_party.actors.size
  88.     for i in 0...$game_party.actors.size
  89.      actor2 = $game_party.actors[i]
  90.      case i
  91.        when 0
  92.         x = 385
  93.         y = 80
  94.        when 1
  95.         x = 420
  96.         y = 110
  97.        when 2
  98.         x = 455
  99.         y = 140
  100.        when 3
  101.         x = 490
  102.         y = 170
  103.       end
  104.      draw_actor_hp_meter2(actor2, x, y, 50)
  105.      draw_actor_sp_meter2(actor2, x, y + 4, 50)
  106.    end
  107. end
  108. end
  109. #==============================================================================
  110. # ■ Window_Base
  111. #==============================================================================
  112. class Window_Base < Window
  113. #--------------------------------------------------------------------------
  114. # ● HP描画
  115. #--------------------------------------------------------------------------
  116. def draw_actor_hp_meter2(actor2, x, y, width = 156, type = 0)
  117.    if type == 1 and actor2.hp == 0
  118.      return
  119.    end
  120.    self.contents.font.color = system_color
  121. #  self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 25))
  122.    w = width * actor2.hp / actor2.maxhp
  123.    
  124.    self.contents.fill_rect(x, y+28, width,1, Color.new(99, 99, 99, 255))
  125.    self.contents.fill_rect(x, y+29, width,1, Color.new(50, 50, 50, 255))
  126.    self.contents.fill_rect(x, y+30, width,1, Color.new(50, 50, 50, 255))
  127.    self.contents.fill_rect(x, y+31, width,1, Color.new(70, 70, 70, 255))

  128.    
  129.    
  130.    self.contents.fill_rect(x, y+28, w,1, Color.new(24, 162, 32, 255))
  131.    self.contents.fill_rect(x, y+29, w,1, Color.new(49, 198, 57, 255))
  132.    self.contents.fill_rect(x, y+30, w,1, Color.new(24, 162, 32, 255))
  133.    self.contents.fill_rect(x, y+31, w,1, Color.new(18, 127, 24, 255))
  134.    
  135.    end
  136. #--------------------------------------------------------------------------
  137. # ● SP描画
  138. #--------------------------------------------------------------------------
  139. def draw_actor_sp_meter2(actor2, x, y, width = 156, type = 0)
  140.    if type == 1 and actor2.hp == 0
  141.      return
  142.    end
  143.    self.contents.font.color = system_color
  144. #  self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  145.    w = width * actor2.sp / actor2.maxsp
  146.    
  147.    
  148.    self.contents.fill_rect(x, y+28, width,1, Color.new(99, 99, 99, 255))
  149.    self.contents.fill_rect(x, y+29, width,1, Color.new(50, 50, 50, 255))
  150.    self.contents.fill_rect(x, y+30, width,1, Color.new(50, 50, 50, 255))
  151.    self.contents.fill_rect(x, y+31, width,1, Color.new(70, 70, 70, 255))
  152.    
  153.    self.contents.fill_rect(x, y+28, w,1, Color.new(25, 95, 225, 255))
  154.    self.contents.fill_rect(x, y+29, w,1, Color.new(62, 129, 225, 255))
  155.    self.contents.fill_rect(x, y+30, w,1, Color.new(25, 95, 225, 255))
  156.    self.contents.fill_rect(x, y+31, w,1, Color.new(18, 63, 147, 255))
  157. end
  158. end
复制代码

点评

纠正你一点 脚底下血条的现成的可以搜到 头上顶血条的话 要在这基础上修改 你想想每个战斗图高度不同的 你血条要顶的准 每个角色要加个身高参数  发表于 2013-7-21 12:13

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
163 小时
注册时间
2012-1-15
帖子
67
3
 楼主| 发表于 2013-7-21 16:17:40 | 只看该作者
腐琴琴 发表于 2013-7-21 10:30
角色和敌人的左边右边可以自己调整的。
敌人的话直接在数据库里拉一下就好了。
角色的你在脚本编辑器里全局 ...

哦,谢了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
163 小时
注册时间
2012-1-15
帖子
67
4
 楼主| 发表于 2013-7-23 22:23:32 | 只看该作者
腐琴琴 发表于 2013-7-21 10:30
角色和敌人的左边右边可以自己调整的。
敌人的话直接在数据库里拉一下就好了。
角色的你在脚本编辑器里全局 ...

file:///C:/Documents%20and%20Settings/Administrator/桌面/QQ截图20130723221941.png帮我看一下我的这个战斗图要怎样修改呀
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
470 小时
注册时间
2010-6-25
帖子
316
5
发表于 2013-8-1 10:10:40 | 只看该作者
q6625765 发表于 2013-7-23 22:23
帮我看一下我的这个战斗图要怎样修改呀

你这个貌似是本地图片的地址啊……我看不到。

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-28 15:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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