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

Project1

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

这个横版战斗脚本的问题?HELP!

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
60
在线时间
8 小时
注册时间
2008-3-26
帖子
23
跳转到指定楼层
1
发表于 2008-9-17 22:58:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
脚本:
  1. #==============================================================================
  2. # ■ 行走图横版战斗[Ver.1.0.1]   
  3. #------------------------------------------------------------------------------
  4. module Battle_Formation
  5. #------------------------------------------------------------------------------
  6. FORM = {
  7. # 战斗位置 =>
  8.   #    [角色1x.y]  [角色2x.y]  [角色3x.y]  [角色4x.y]
  9.   0 => [[460,130], [480, 170], [460, 210], [480, 250]]
  10. }
  11. #------------------------------------------------------------------------------
  12. end
  13. #==============================================================================
  14. # ■ Game_System
  15. #==============================================================================
  16. class Game_System
  17. attr_accessor :battle_formation                # Formation ID
  18. #--------------------------------------------------------------------------
  19. # ● オブジェクト初期化
  20. #--------------------------------------------------------------------------
  21. alias init_game_system initialize
  22. def initialize
  23.   init_game_system
  24.   @battle_formation = 0              # 初步形成
  25. end
  26. end

  27. #==============================================================================
  28. # ■ Game_Actor
  29. #==============================================================================
  30. class Game_Actor < Game_Battler
  31. #--------------------------------------------------------------------------
  32. # ● 是Sprite的使用? [重新界定]
  33. #--------------------------------------------------------------------------
  34. def use_sprite?
  35.   return true
  36. end
  37. #--------------------------------------------------------------------------
  38. # ● 战斗画面获取X坐标
  39. #--------------------------------------------------------------------------
  40. def screen_x
  41.   return Battle_Formation::FORM[$game_system.battle_formation][self.index][0]
  42. end
  43. #--------------------------------------------------------------------------
  44. # ● 战斗画面获取Y坐标
  45. #--------------------------------------------------------------------------
  46. def screen_y
  47.   return Battle_Formation::FORM[$game_system.battle_formation][self.index][1]
  48. end
  49. #--------------------------------------------------------------------------
  50. # ● 战斗画面获取z坐标
  51. #--------------------------------------------------------------------------
  52. def screen_z
  53.   bitmap = Cache.character(self.character_name)
  54.   # Height + Y Coordinates
  55.   return screen_y + bitmap.height / 4
  56. end
  57. end



  58. #==============================================================================
  59. # ■ Game_Enemy
  60. #==============================================================================
  61. class Game_Enemy < Game_Battler
  62. #--------------------------------------------------------------------------
  63. # ● 战斗画面获取z坐标[重新界定]
  64. #--------------------------------------------------------------------------
  65. def screen_z
  66.   bitmap = Cache.battler(self.battler_name, self.battler_hue)
  67.   # Height + Y Coordinates
  68.   return screen_y + bitmap.height
  69. end
  70. end
  71. #==============================================================================
  72. # ■ VX-RGSS2-6 サイドビュー战斗[Ver.1.0.1]
  73. #------------------------------------------------------------------------------
  74. # 战斗实况告知
  75. #==============================================================================

  76. #==============================================================================
  77. # ■ Scene_Battle
  78. #==============================================================================
  79. class Scene_Battle < Scene_Base
  80. #--------------------------------------------------------------------------
  81. # ●  战斗开始进程
  82. #--------------------------------------------------------------------------
  83. alias process_battle_start_sideview process_battle_start
  84. def process_battle_start
  85.   for battler in $game_party.members + $game_troop.members
  86.     battler.move_mode = SideView::M_MODE_WAIT
  87.   end
  88.   process_battle_start_sideview
  89. end
  90. #--------------------------------------------------------------------------
  91. # ● 胜利进程
  92. #--------------------------------------------------------------------------
  93. alias process_victory_sideview process_victory
  94. def process_victory
  95.   for actor in $game_party.members
  96.     actor.move_mode = SideView::M_MODE_WIN
  97.   end
  98.   process_victory_sideview
  99. end
  100. #--------------------------------------------------------------------------
  101. # ● 等到活动控制完毕
  102. #--------------------------------------------------------------------------
  103. def wait_for_motion
  104.   while @active_battler.motion_stop
  105.     update_basic
  106.   end
  107. end
  108. #--------------------------------------------------------------------------
  109. # ● 执行作战:攻击[重新界定]
  110. #--------------------------------------------------------------------------
  111. def execute_action_attack
  112.   text = sprintf(Vocab::DoAttack, @active_battler.name)
  113.   @message_window.add_instant_text(text)
  114.   targets = @active_battler.action.make_targets
  115.   #---Enemy attack sound reproduced.
  116.   if @active_battler.is_a?(Game_Enemy)
  117.     Sound.play_enemy_attack
  118.     wait(15, true)
  119.   end
  120.   #--- Proximity (Going)
  121.   SideView.set_target_point(@active_battler, targets[0])
  122.   @active_battler.move_mode = SideView::M_MODE_ATK1
  123.   @active_battler.motion_stop = true
  124.   wait_for_motion
  125.   #--- Attack
  126.   wait(5)
  127.   @active_battler.move_mode = SideView::M_MODE_ATK2
  128.   #---
  129.   display_attack_animation(targets)
  130.   wait(20)
  131.   for target in targets
  132.     target.attack_effect(@active_battler)
  133.     display_action_effects(target)
  134.   end
  135.   #--- Proximity (Return)
  136.   @active_battler.move_mode = SideView::M_MODE_ATK3
  137.   @active_battler.motion_stop = true
  138.   wait_for_motion
  139.   #---Wait
  140.   for target in targets
  141.     target.move_mode = SideView::M_MODE_WAIT
  142.   end
  143.   @active_battler.move_mode = SideView::M_MODE_WAIT
  144.   #---
  145. end
  146. #--------------------------------------------------------------------------
  147. # ● 执行作战:技能[重新界定]
  148. #--------------------------------------------------------------------------
  149. def execute_action_skill
  150.   skill = @active_battler.action.skill
  151.   text = @active_battler.name + skill.message1
  152.   @message_window.add_instant_text(text)
  153.   unless skill.message2.empty?
  154.     wait(10)
  155.     @message_window.add_instant_text(skill.message2)
  156.   end
  157.   #--- Enemy attack sound reproduced.
  158.   if @active_battler.is_a?(Game_Enemy)
  159.     Sound.play_enemy_attack
  160.     wait(15, true)
  161.   end
  162.   #--- Long distance attack.
  163.   @active_battler.move_mode = SideView::M_MODE_MAGI
  164.   #---
  165.   targets = @active_battler.action.make_targets
  166.   display_animation(targets, skill.animation_id)
  167.   @active_battler.mp -= @active_battler.calc_mp_cost(skill)
  168.   $game_temp.common_event_id = skill.common_event_id
  169.   for target in targets
  170.     target.skill_effect(@active_battler, skill)
  171.     display_action_effects(target, skill)
  172.   end
  173.   #---Wait
  174.   for target in targets
  175.     target.move_mode = SideView::M_MODE_WAIT
  176.   end
  177.   @active_battler.move_mode = SideView::M_MODE_WAIT
  178.   #---
  179. end
  180. #--------------------------------------------------------------------------
  181. # 执行作战:物品???[重新界定]
  182. #--------------------------------------------------------------------------
  183. def execute_action_item
  184.   item = @active_battler.action.item
  185.   text = sprintf(Vocab::UseItem, @active_battler.name, item.name)
  186.   @message_window.add_instant_text(text)
  187.   #--- Enemy attack sound reproduced.
  188.   if @active_battler.is_a?(Game_Enemy)
  189.     Sound.play_enemy_attack
  190.     wait(15, true)
  191.   end
  192.   #--- Long distance attack
  193.   @active_battler.move_mode = SideView::M_MODE_MAGI
  194.   #---
  195.   targets = @active_battler.action.make_targets
  196.   display_animation(targets, item.animation_id)
  197.   $game_party.consume_item(item)
  198.   $game_temp.common_event_id = item.common_event_id
  199.   for target in targets
  200.     target.item_effect(@active_battler, item)
  201.     display_action_effects(target, item)
  202.   end
  203.   #---Wait
  204.   for target in targets
  205.     target.move_mode = SideView::M_MODE_WAIT
  206.   end
  207.   @active_battler.move_mode = SideView::M_MODE_WAIT
  208.   #---
  209. end
  210. #--------------------------------------------------------------------------
  211. # ● 攻击动画展示[重新界定]
  212. #     对象:对象的安排
  213. #--------------------------------------------------------------------------
  214. # 【改变一部分】
  215. #  敌人的声音效果是改变了,所以可以用在每一个阶段的运作情况。
  216. #  它改变了,所以这起攻击动画的一个敌人可以被显示出来。
  217. #--------------------------------------------------------------------------
  218. def display_attack_animation(targets)
  219.   display_normal_animation(targets, @active_battler.atk_animation_id, false)
  220.   display_normal_animation(targets, @active_battler.atk_animation_id2, true)
  221.   wait_for_animation
  222. end
  223. #--------------------------------------------------------------------------
  224. # ● HP损害显示[重新界定]
  225. #    对象:候选人
  226. #    对象:技能,还是物品?
  227. #--------------------------------------------------------------------------
  228. def display_hp_damage(target, obj = nil)
  229.   if target.hp_damage == 0                # 任何破坏
  230.     return if obj != nil and obj.damage_to_mp
  231.     return if obj != nil and obj.base_damage == 0
  232.     fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage
  233.     text = sprintf(fmt, target.name)
  234.   elsif target.absorbed                   # 吸收
  235.     fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
  236.     text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage)
  237.   elsif target.hp_damage > 0              # 损坏
  238.     if target.actor?
  239.       text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage)
  240.       Sound.play_actor_damage
  241.       $game_troop.screen.start_shake(5, 5, 10)
  242.       target.blink = true # Only adds here
  243.     else
  244.       text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)
  245.       Sound.play_enemy_damage
  246.       target.blink = true
  247.     end
  248.   else                                    # 回收
  249.     fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
  250.     text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage)
  251.     Sound.play_recovery
  252.   end
  253.   @message_window.add_instant_text(text)
  254.   wait(30)
  255. end
  256. end
  257. #==============================================================================
  258. # ■ VX-RGSS2-6 サイドビュー战斗[Ver.1.0.1]
  259. #------------------------------------------------------------------------------

  260. module SideView
  261. #----------------------------------------------------------------------------
  262. #-----[运行格局]-----
  263. #运行速度
  264. MOTION_SPEED = 20

  265. #-----[アニメーション設定]-----
  266. # 通常敌人攻击动画设置
  267. E_ANIME = {
  268. # EnemyID => [Usually atttack and additional attack animations.]
  269.   1 => [1, 0]
  270. }

  271. #----------------------------------------------------------------------------
  272. #----------------------------------------------------------------------------
  273. # Motion Control Mode
  274. M_MODE_WAIT = 0     # Standby
  275. M_MODE_MAGI = 1     # Attack
  276. M_MODE_DAMG = 2     # Non-Damage Attack
  277. M_MODE_WIN  = 3     # Victory
  278. M_MODE_ATK1 = 4     # Direct Attack (Approaching)
  279. M_MODE_ATK2 = 5     # Direct Attack (Attacking)
  280. M_MODE_ATK3 = 6     # Direct Attack (Returning)

  281. module_function
  282. #--------------------------------------------------------------------------
  283. # ● 活动区域计算
  284. #--------------------------------------------------------------------------
  285. def set_target_point(attacker, target)
  286.   case target
  287.   when Game_Actor
  288.     bits = Cache.character(target.character_name)
  289.     attacker.target_x = target.screen_x + (bits.width / 8)
  290.     attacker.target_y = target.screen_y
  291.   when Game_Enemy
  292.     bits = Cache.battler(target.battler_name, target.battler_hue)
  293.     attacker.target_x = target.screen_x + (bits.width / 2)
  294.     attacker.target_y = target.screen_y
  295.   end
  296. end
  297. end

  298. class Game_Battler
  299. attr_accessor   :move_mode       # Operation Mode
  300. # 0:Standby   1:Attack   2: Un-useless   3:Victory
  301. attr_accessor   :motion_stop     # Operation Stop Flag (Under Movement Flag)
  302. attr_accessor   :target_x        # Move Position(x)
  303. attr_accessor   :target_y        # Move Position(y)
  304. #--------------------------------------------------------------------------
  305. # ● 对象初始化
  306. #--------------------------------------------------------------------------
  307. alias initialize_sdva_corpse initialize
  308. def initialize
  309.   initialize_sdva_corpse
  310.   @move_mode = 0
  311.   @motion_stop = false
  312.   @target_x = 0
  313.   @target_y = 0
  314. end
  315. end

  316. #==============================================================================
  317. # ■ Game_Enemy
  318. #==============================================================================
  319. class Game_Enemy < Game_Battler
  320. #--------------------------------------------------------------------------
  321. # ● 攻击动画ID采集
  322. #--------------------------------------------------------------------------
  323. def atk_animation_id
  324.   return 0 if SideView::E_ANIME[@enemy_id].nil?
  325.   return SideView::E_ANIME[@enemy_id][0]
  326. end
  327. #--------------------------------------------------------------------------
  328. # ● 攻击动画ID采集( 2剑式: 2武器)
  329. #--------------------------------------------------------------------------
  330. def atk_animation_id2
  331.   return 0 if SideView::E_ANIME[@enemy_id].nil?
  332.   return SideView::E_ANIME[@enemy_id][1]
  333. end
  334. end



  335. #==============================================================================
  336. # ■ Sprite_Battler
  337. #==============================================================================
  338. class Sprite_Battler < Sprite_Base
  339. #--------------------------------------------------------------------------
  340. # ● Object Initialization
  341. #     Viewport : View Port
  342. #     Battler  : Battler (Game_Battler)
  343. #--------------------------------------------------------------------------
  344. alias initialize_sideview initialize
  345. def initialize(viewport, battler = nil)
  346.   initialize_sideview(viewport, battler)
  347.   init_direct_attack
  348. end
  349. #--------------------------------------------------------------------------
  350. # ● 一套价值接近攻击
  351. #--------------------------------------------------------------------------
  352. def init_direct_attack
  353.   @direct_attack_cnt = 0
  354.   @direct_attack_phase = 0
  355.   @direct_move_cnt = 0
  356.   @battler_x_plus = 0
  357.   @battler_y_plus = 0
  358.   @moving_mode = 0
  359.   @pattern = 0
  360.   @direction = 0
  361. end
  362. #--------------------------------------------------------------------------
  363. # ● 帧重建[重新界定]
  364. #--------------------------------------------------------------------------
  365. def update
  366.   super
  367.   if @battler == nil
  368.     self.bitmap = nil
  369.   else
  370.     @use_sprite = @battler.use_sprite?
  371.     if @use_sprite
  372.       self.x = @battler.screen_x + @battler_x_plus
  373.       self.y = @battler.screen_y + @battler_y_plus
  374.       self.z = @battler.screen_z
  375.       update_battler_bitmap
  376.     end
  377.     setup_new_effect
  378.     update_effect
  379.   end
  380. end
  381. #--------------------------------------------------------------------------
  382. # ● 点阵图转让源重建
  383. #--------------------------------------------------------------------------
  384. alias update_battler_bitmap_sideview update_battler_bitmap
  385. def update_battler_bitmap
  386.   case @battler
  387.   when Game_Actor
  388.     if @battler.character_name != @battler_name or
  389.        @battler.character_index != @battler_hue
  390.       @battler_name = @battler.character_name
  391.       @battler_hue = @battler.character_index
  392.       draw_pre_character
  393.       draw_character
  394.       if (@battler.dead? or @battler.hidden)
  395.         self.opacity = 0
  396.       end
  397.     end
  398.   when Game_Enemy
  399.     if @battler.battler_name != @battler_name or
  400.        @battler.battler_hue != @battler_hue
  401.       @battler_name = @battler.battler_name
  402.       @battler_hue = @battler.battler_hue
  403.       draw_battler
  404.       if (@battler.dead? or @battler.hidden)
  405.         self.opacity = 0
  406.       end
  407.     end
  408.   end
  409.   motion_control
  410. end
  411. #--------------------------------------------------------------------------
  412. # ● battler制图
  413. #--------------------------------------------------------------------------
  414. def draw_battler
  415.   self.bitmap = Cache.battler(@battler_name, @battler_hue)
  416.   @width = bitmap.width
  417.   @height = bitmap.height
  418.   self.ox = @width / 2
  419.   self.oy = @height
  420. end
  421. #--------------------------------------------------------------------------
  422. # ● 预字制图[普通]
  423. #--------------------------------------------------------------------------
  424. def draw_pre_character
  425.   self.bitmap = Cache.character(@battler_name)
  426.   sign = @battler_name[/^[\!\$]./]
  427.   if sign != nil and sign.include?('$')
  428.     @width = bitmap.width / 3
  429.     @height = bitmap.height / 4
  430.   else
  431.     @width = bitmap.width / 12
  432.     @height = bitmap.height / 8
  433.   end
  434.   self.ox = @width / 2
  435.   self.oy = @height
  436. end
  437. #--------------------------------------------------------------------------
  438. # ● 性格绘画[普通]
  439. #--------------------------------------------------------------------------
  440. def draw_character
  441.   index = @battler_hue
  442.   pattern = @pattern < 3 ? @pattern : 1
  443.   sx = (index % 4 * 3 + pattern) * @width
  444.   sy = (index / 4 * 4 + (@direction - 2) / 2) * @height
  445.   self.src_rect.set(sx, sy, @width, @height)
  446. end
  447. #--------------------------------------------------------------------------
  448. # ● 活动控制
  449. #--------------------------------------------------------------------------
  450. def motion_control
  451.   # Memory Operation Mode
  452.   @moving_mode = @battler.move_mode
  453.   # Battler Drawing
  454.   case @battler
  455.   when Game_Actor # Actor
  456.     actor_motion_control
  457.   when Game_Enemy # Enemy
  458.     enemy_motion_control
  459.   end
  460. end
  461. #--------------------------------------------------------------------------
  462. # ● 运动控制(角色)
  463. #--------------------------------------------------------------------------
  464. def actor_motion_control
  465.   # Operation Change
  466.   case @moving_mode
  467.   when SideView::M_MODE_WAIT  # Standby
  468.     init_direct_attack
  469.     @battler_x_plus = 0
  470.     @direction = 4
  471.     @pattern = 1
  472.   when SideView::M_MODE_MAGI  # Attack
  473.     @battler_x_plus = -10
  474.     @direction = 4
  475.     @pattern = 3
  476.   when SideView::M_MODE_DAMG  # Non-Damage Attack
  477.     @battler_x_plus = 10
  478.     @direction = 4
  479.     @pattern = 3
  480.   when SideView::M_MODE_WIN  # Victory
  481.     @direction = 2
  482.     @pattern = 1
  483.   when SideView::M_MODE_ATK1  # Direct Attack (Approaching)
  484.     exe_moving_attack_start
  485.     @end_pos_x = @battler_x_plus
  486.   when SideView::M_MODE_ATK2  # Direct Attack (Attacking)
  487.     @battler_x_plus = @end_pos_x - 10
  488.   when SideView::M_MODE_ATK3  # Direct Attack (Returning)
  489.     exe_moving_attack_end
  490.   else
  491.     p "error:Sprite_Battler>> @moving_mode"
  492.   end
  493.   draw_character
  494. end
  495. #--------------------------------------------------------------------------
  496. # ● 运动控制(敌人)
  497. #--------------------------------------------------------------------------
  498. def enemy_motion_control
  499.   # Operation Change
  500.   case @moving_mode
  501.   when SideView::M_MODE_WAIT  # Standby
  502.     init_direct_attack
  503.   when SideView::M_MODE_MAGI  # Attack
  504.     @battler_x_plus = 10
  505.   when SideView::M_MODE_DAMG  # Non-Damage Attack
  506.     @battler_x_plus = -10
  507.     @shake_flg = true
  508.   when SideView::M_MODE_ATK1  # Direct Attack (Approaching)
  509.     exe_moving_attack_start
  510.     @end_pos_x = @battler_x_plus
  511.   when SideView::M_MODE_ATK2  # Direct Attack (Attacking)
  512.     @battler_x_plus = @end_pos_x + 10
  513.   when SideView::M_MODE_ATK3  # Direct Attack (Returning)
  514.     exe_moving_attack_end
  515.   else
  516.     p "error:Sprite_Battler>> @moving_mode", @moving_mode
  517.   end
  518. end
  519. #--------------------------------------------------------------------------
  520. # ● 接近攻击执行方法
  521. #--------------------------------------------------------------------------
  522. def exe_moving_attack_start
  523.   return unless @battler.motion_stop
  524.   case @direct_attack_phase
  525.   when 0  # Start Operation Preparation
  526.     diratk_start
  527.   when 1  # Move Operation (Going)
  528.     diratk_move
  529.   when 2  # After-Movement Wait
  530.     diratk_wait
  531.   end
  532. end
  533. def exe_moving_attack_end
  534.   case @direct_attack_phase
  535.   when 0  # Attack Operation
  536.     diratk_attack
  537.   when 1  # Move Operation (Return)
  538.     diratk_back
  539.   when 2  # Operation End
  540.     diratk_end
  541.   end
  542. end
  543. #--------------------------------------------------------------------------
  544. # ● 接近攻击执行[开始运作准备]
  545. #--------------------------------------------------------------------------
  546. def diratk_start
  547.   # Pose Change
  548.   @pattern = 1
  549.   # The number of frames needed is the distance between current position and
  550.   # target position.
  551.   pos_x = @battler.target_x - self.x
  552.   pos_y = @battler.target_y - self.y
  553.   # Caculation for ammount of frames needed.
  554.   @direct_move_cnt = @direct_attack_cnt = (pos_x.abs / SideView::MOTION_SPEED).round
  555.   # NEXT Phase
  556.   @direct_attack_phase += 1
  557. end
  558. #--------------------------------------------------------------------------
  559. # ● 接近攻击执行[移到对象(去) ]
  560. #--------------------------------------------------------------------------
  561. def diratk_move
  562.   case @battler
  563.   when Game_Actor
  564.     x_plus = @width
  565.     y_plus = -@height / 4
  566.   when Game_Enemy
  567.     x_plus = -@width - 10
  568.     y_plus = @height / 4
  569.   end
  570.   # The next movement location is figured out by the distance between
  571.   # current position and target position.
  572.   pos_x = @battler.target_x - self.x + x_plus
  573.   pos_y = @battler.target_y - self.y + y_plus
  574.   @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0
  575.   @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0
  576.   # End count
  577.   @direct_attack_cnt -= 1
  578.   # Last movement (Insurance: Last correction)
  579.   if @direct_attack_cnt <= 0
  580.     @battler_x_plus = @battler.target_x - @battler.screen_x + x_plus
  581.     @battler_y_plus = @battler.target_y - @battler.screen_y + y_plus
  582.     # NEXTフェーズ
  583.     @direct_attack_cnt = 5
  584.     @direct_attack_phase += 1
  585.   end
  586. end
  587. #--------------------------------------------------------------------------
  588. # ● 接近攻击执行[攻击行动回报]
  589. #--------------------------------------------------------------------------
  590. def diratk_wait
  591.   # End Count
  592.   @direct_attack_cnt -= 1
  593.   # Last Movement
  594.   if @direct_attack_cnt <= 0
  595.     # Pose Change
  596.     @pattern = 3
  597.     # END Phase
  598.     @direct_attack_phase = 0
  599.     @battler.motion_stop = false
  600.   end
  601. end
  602. #--------------------------------------------------------------------------
  603. # ● 接近攻击执行[攻击行动回报]
  604. #--------------------------------------------------------------------------
  605. def diratk_attack
  606.   # Pose Change
  607.   @pattern = 1
  608.   # End Wait Count
  609.   @direct_attack_cnt = @direct_move_cnt
  610.   # NEXT Phase
  611.   @direct_attack_phase += 1
  612. end
  613. #--------------------------------------------------------------------------
  614. # ● 接近攻击执行[移到运行(往返) ]
  615. #--------------------------------------------------------------------------
  616. def diratk_back
  617.   # The next movement location is figured out by the distance between
  618.   # current position and target position.
  619.   pos_x = @battler.screen_x - self.x
  620.   pos_y = @battler.screen_y - self.y
  621.   @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0
  622.   @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0
  623.   # End Count
  624.   @direct_attack_cnt -= 1
  625.   # Last Movement
  626.   if @direct_attack_cnt == 0
  627.     @battler_x_plus = 0
  628.     @battler_y_plus = 0
  629.     # NEXT Phase
  630.     @direct_attack_phase += 1
  631.   end
  632. end
  633. #--------------------------------------------------------------------------
  634. # ● 接近攻击执行[运行完]
  635. #--------------------------------------------------------------------------
  636. def diratk_end
  637.   init_direct_attack
  638.   @battler.motion_stop = false
  639.   # END Phase
  640.   @direct_attack_phase = 0
  641. end
  642. end
复制代码


敌人移动攻击的时候,会移到主角的后面,怎么办?应该在前面才对,求达人帮忙!
本贴由论坛斑竹火鸡三毛老大结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^

Lv1.梦旅人

kissye的宠物<

梦石
0
星屑
61
在线时间
1563 小时
注册时间
2008-8-11
帖子
6174

贵宾

2
发表于 2008-9-18 07:17:53 | 只看该作者
把敌人队伍里的初始状态去掉……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
8 小时
注册时间
2008-3-26
帖子
23
3
 楼主| 发表于 2008-9-21 00:08:28 | 只看该作者
具体在哪里去掉?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-30 00:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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