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

Project1

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

45度战斗脚本与其它脚本冲突

 关闭 [复制链接]

Lv1.梦旅人

music◆小流

梦石
0
星屑
50
在线时间
25 小时
注册时间
2008-1-23
帖子
498
跳转到指定楼层
1
发表于 2008-3-2 23:42:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x


如题,就这张图,脚本错误如下:

  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  3. # ————————————————————————————————————

  4. #==============================================================================
  5. # ■ Game_Actor
  6. #------------------------------------------------------------------------------
  7. #  处理角色的类。本类在 Game_Actors 类 ($game_actors)
  8. # 的内部使用、Game_Party 类请参考 ($game_party) 。
  9. #==============================================================================

  10. class Game_Actor < Game_Battler
  11. #--------------------------------------------------------------------------
  12. # ● 取得战斗画面的 X 坐标
  13. #--------------------------------------------------------------------------
  14. def screen_x
  15. case self.index
  16. when 0
  17.    return 350
  18. when 1
  19.    return 430
  20. when 2
  21.    return 510
  22. when 3
  23.    return 580
  24. else
  25.    return 600

  26.   end
  27. end
  28. #--------------------------------------------------------------------------
  29. # ● 取得战斗画面的 Y 坐标
  30. #--------------------------------------------------------------------------
  31. def screen_y
  32. case self.index
  33. when 0
  34.    return 430
  35. when 1
  36.    return 395
  37. when 2
  38.    return 360
  39. when 3
  40.    return 325
  41. else
  42.    return 1000
  43.   end
  44. end
  45. #--------------------------------------------------------------------------
  46. # ● 取得战斗画面的 Z 坐标
  47. #--------------------------------------------------------------------------
  48. def screen_z
  49. case self.index
  50. when 0
  51.    return 10
  52. when 1
  53.    return 9
  54. when 2
  55.    return 8
  56. when 3
  57.    return 7
  58. else
  59.    return 0
  60.    end
  61. end
  62. end


  63. #==============================================================================
  64. # ■ Window_Base
  65. #------------------------------------------------------------------------------
  66. #  游戏中全部窗口的超级类。
  67. #==============================================================================

  68. class Window_Base < Window
  69. #--------------------------------------------------------------------------
  70. # ● 描绘 HP
  71. #     actor : 角色
  72. #     x     : 描画目标 X 坐标
  73. #     y     : 描画目标 Y 坐标
  74. #     width : 描画目标的宽
  75. #--------------------------------------------------------------------------
  76. def draw_actor_hp1(actor, x, y, width = 72)
  77.    # 描绘字符串 "HP"
  78.    self.contents.font.color = system_color
  79.    self.contents.draw_text(x, y, 24, 24, $data_system.words.hp)
  80.    # 计算描绘 MaxHP 所需的空间
  81.    if width - 24 >= 32
  82.      hp_x = x + 32# + width - 24
  83.    end
  84.    # 描绘 HP
  85.    self.contents.font.color = actor.hp == 0 ? knockout_color :
  86.      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  87.    self.contents.draw_text(hp_x, y, 32, 24, actor.hp.to_s, 2)
  88. end
  89. #--------------------------------------------------------------------------
  90. # ● 描绘 SP
  91. #     actor : 角色
  92. #     x     : 描画目标 X 坐标
  93. #     y     : 描画目标 Y 坐标
  94. #     width : 描画目标的宽
  95. #--------------------------------------------------------------------------
  96. def draw_actor_sp1(actor, x, y, width = 72)
  97.    # 描绘字符串 "SP"
  98.    self.contents.font.color = system_color
  99.    self.contents.draw_text(x, y, 24, 24, $data_system.words.sp)
  100.    # 计算描绘 MaxSP 所需的空间
  101.    if width - 24 >= 32
  102.      sp_x = x + 32# + width - 24
  103.    end
  104.    # 描绘 SP
  105.    self.contents.font.color = actor.sp == 0 ? knockout_color :
  106.      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  107.    self.contents.draw_text(sp_x, y, 32, 24, actor.sp.to_s, 2)
  108. end
  109. end





  110. #==============================================================================
  111. # ■ Window_BattleStatus
  112. #------------------------------------------------------------------------------
  113. #  显示战斗画面同伴状态的窗口。
  114. #==============================================================================

  115. class Window_BattleStatus < Window_Base
  116. #--------------------------------------------------------------------------
  117. # ● 初始化对像
  118. #--------------------------------------------------------------------------
  119. #$data_system_level_up_me = "Audio/ME/升级音乐"
  120. def initialize
  121.    super(0, 0, 640, 480)
  122.    self.contents = Bitmap.new(width - 10, height - 32)
  123.    self.opacity = 0
  124.    @level_up_flags = [false, false, false, false]
  125.    refresh
  126. end
  127. #--------------------------------------------------------------------------
  128. # ● 释放
  129. #--------------------------------------------------------------------------
  130. def dispose
  131.    super
  132. end
  133. #--------------------------------------------------------------------------
  134. # ● 设置升级标志
  135. #     actor_index : 角色索引
  136. #--------------------------------------------------------------------------
  137. def level_up(actor_index)
  138.    @level_up_flags[actor_index] = true
  139. end
  140. #--------------------------------------------------------------------------
  141. # ● 刷新
  142. #--------------------------------------------------------------------------
  143. def refresh
  144.    self.contents.clear
  145.    @item_max = $game_party.actors.size
  146.     for i in 0...$game_party.actors.size
  147.      actor = $game_party.actors[i]
  148.      case i
  149.        when 0
  150.         x = 310
  151.         y = 390
  152.        when 1
  153.         x = 390
  154.         y = 340
  155.        when 2
  156.         x = 480
  157.         y = 300
  158.        when 3
  159.         x = 550
  160.         y = 270
  161.       end
  162.      if @level_up_flags[i]
  163.        self.contents.font.color = normal_color
  164.        self.contents.draw_text(x, y, 80, 24, "LEVEL UP!")
  165.        Audio.me_stop
  166. #        Audio.me_play($data_system_level_up_me)
  167.      else
  168.      draw_actor_hp1(actor, x-15, y-15, 80)
  169.      draw_actor_sp1(actor, x-15, y+5, 80)
  170.     end
  171.    end
  172. end

  173. #--------------------------------------------------------------------------
  174. # ● 刷新画面
  175. #--------------------------------------------------------------------------
  176. def update
  177.    super
  178.    # 主界面的不透明度下降
  179.    if $game_temp.battle_main_phase
  180.      self.contents_opacity -= 50 if self.contents_opacity > 1
  181.    else
  182.      self.contents_opacity += 50 if self.contents_opacity < 255
  183.    end
  184. end
  185. end





  186. #==============================================================================
  187. # ■ Window_BattleStatus
  188. #==============================================================================
  189. class Window_BattleStatus < Window_Base
  190. #--------------------------------------------------------------------------
  191. # ● 初始化
  192. #--------------------------------------------------------------------------
  193. alias xrxs_bp2_refresh refresh
  194. def refresh
  195.    xrxs_bp2_refresh
  196.    @item_max = $game_party.actors.size
  197.     for i in 0...$game_party.actors.size
  198.      actor = $game_party.actors[i]
  199.      case i
  200.        when 0
  201.         x = 310
  202.         y = 390
  203.        when 1
  204.         x = 390
  205.         y = 340
  206.        when 2
  207.         x = 480
  208.         y = 300
  209.        when 3
  210.         x = 550
  211.         y = 270
  212.       end
  213.      draw_actor_hp_meter(actor, x, y, 50)
  214.      draw_actor_sp_meter(actor, x, y + 8, 50)
  215.    end
  216. end
  217. end
  218. #==============================================================================
  219. # ■ Window_Base
  220. #==============================================================================
  221. class Window_Base < Window
  222. #--------------------------------------------------------------------------
  223. # ● HP描画
  224. #--------------------------------------------------------------------------
  225. def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  226.    if type == 1 and actor.hp == 0
  227.      return
  228.    end
  229.    self.contents.font.color = system_color
  230.    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 25))
  231.    w = width * actor.hp / actor.maxhp
  232.    self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
  233.    self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
  234.    self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
  235.    self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
  236.    
  237.    end
  238. #--------------------------------------------------------------------------
  239. # ● SP描画
  240. #--------------------------------------------------------------------------
  241. def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
  242.    if type == 1 and actor.hp == 0
  243.      return
  244.    end
  245.    self.contents.font.color = system_color
  246.    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  247.    w = width * actor.sp / actor.maxsp
  248.    self.contents.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
  249.    self.contents.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
  250.    self.contents.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
  251.    self.contents.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
  252. end
  253. end
  254. #==========================================================================
  255. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  256. #==========================================================================

  257. XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。

  258. #==============================================================================
  259. # ■ Window_XY
  260. #------------------------------------------------------------------------------
  261. #  显示坐标的窗口。
  262. #==============================================================================
  263. class Window_xy < Window_Base#注意前面那个window_xy是文件名
  264. #--------------------------------------------------------------------------
  265. # ● 初始化窗口
  266. #--------------------------------------------------------------------------
  267. def initialize
  268.    super(0, 0, 160, 96)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
  269.    self.contents = Bitmap.new(width - 32, height - 32)
  270.    self.back_opacity = 255  # 这个是背景透明
  271.    self.opacity = 255       # 这个是边框和背景都透明
  272.    self.contents_opacity = 255       # 这个是内容透明
  273.    self.visible = false
  274.    refresh
  275.    @x = $game_player.x
  276.    @y = $game_player.y
  277.    @id = $game_map.map_id
  278. end

  279. #--------------------------------------------------------------------------
  280. # ● 刷新
  281. #--------------------------------------------------------------------------
  282. def refresh
  283.    if $game_switches[XY_SWITCH] #确定开关是否打开,可以自己改变开关
  284.      @x = $game_player.x #获取角色X坐标
  285.      @y = $game_player.y #获取角色Y坐标
  286.      @id = $game_map.map_id  #获取地图编号
  287.     self.contents.clear #清除以前的东西
  288.     $mapnames = load_data("Data/MapInfos.rxdata") #读取地图名文件
  289.     map_name = $mapnames[@id].name #获得地图名
  290.     self.contents.font.color = normal_color#颜色,这里是白色~
  291.     self.contents.draw_text(0, 0, 116, 32, map_name,2)
  292.     self.contents.font.color = system_color#颜色,暗蓝色
  293.     self.contents.draw_text(0, 32, 120, 32, "X:")#显示X这个字的位置,引号里面的内容随便改,比如"X坐标地址"
  294.     self.contents.font.color = normal_color#颜色,这里是白色~
  295.     self.contents.draw_text(0, 32, 52, 32, @x.to_s,2)
  296.     self.contents.font.color = system_color#上面那个是X坐标的变量,可以自己更改变量名~
  297.     self.contents.draw_text(64, 32, 128, 32, "Y:")#显示Y这个字~
  298.     self.contents.font.color = normal_color
  299.     self.contents.draw_text(0, 32, 116, 32, @y.to_s,2)
  300.    end
  301. end
  302. #--------------------------------------------------------------------------
  303. # ● 判断文字刷新。节约内存用
  304. #--------------------------------------------------------------------------
  305. def judge
  306.    return true if @x != $game_player.x
  307.    return true if @y != $game_player.y
  308.    return true if @id != $game_map.map_id
  309.    return false
  310. end
  311. end
  312. ###########################################################################
  313. #                           下面的东西不需要掌握~                         #
  314. ###########################################################################

  315. class Scene_Map
  316. alias xy_66rpg_main main
  317. def main
  318.    @xy_window = Window_xy.new
  319.    @xy_window.x = 640 - 160
  320.    @xy_window.y = 480 - 96
  321.    @xy_window.opacity = 0
  322.    xy_66rpg_main
  323.    @xy_window.dispose
  324. end
  325. #--------------------------------------------------------------------------
  326. # ● 刷新画面
  327. #--------------------------------------------------------------------------
  328. alias xy_66rpg_update update
  329. def update
  330.    xy_66rpg_update
  331.    if $game_switches[XY_SWITCH]
  332.      @xy_window.visible = true      
  333.      @xy_window.refresh if @xy_window.judge
  334.    else
  335.      @xy_window.visible = false
  336.    end
  337. end
  338. end
  339. #==========================================================================
  340. # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
  341. #==========================================================================
复制代码

此贴于 2008-3-7 0:02:04 被版主水迭澜提醒,请楼主看到后对本贴做出回应。


----------------版务----------------
如果问题未解决,请继续提问
如果问题已解决,请结贴
若到末贴发贴时间后一周仍未结贴
管理员会自动为你过期帖子、结贴或强行认可答案(好人卡-1)

Lv1.梦旅人

梦石
0
星屑
50
在线时间
36 小时
注册时间
2006-8-4
帖子
375
2
发表于 2008-3-3 00:08:22 | 只看该作者
没问题。

详细吧。
哟~迷路了~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

music◆小流

梦石
0
星屑
50
在线时间
25 小时
注册时间
2008-1-23
帖子
498
3
 楼主| 发表于 2008-3-3 00:48:18 | 只看该作者
我也不知道啊,可他就冲突{/gg}
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

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

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-15 03:53

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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