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

Project1

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

[已经过期] 橫版戰鬥

[复制链接]

Lv1.梦旅人

梦石
0
星屑
560
在线时间
6 小时
注册时间
2013-6-11
帖子
3
跳转到指定楼层
1
发表于 2014-2-8 04:16:47 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 gm741852963 于 2014-2-8 04:20 编辑

關於橫版戰鬥,有錯誤的地方我都直接註解掉
結果最後發生角色掉下去的事情...
不要懷疑真的是掉下去...
錯誤的地方我有註解掉(854.868.870)

這裡是完整的腳本:
RUBY 代码复制下载
  1. #==============================================================================
  2.  
  3. # ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh
  4.  
  5. #------------------------------------------------------------------------------
  6.  
  7. #不谢。
  8.  
  9. module Battle_Formation
  10.  
  11. #------------------------------------------------------------------------------
  12.  
  13.   FORM = {
  14.  
  15.     #    [角色1x.y]  [角色2x.y]  [角色3x.y]  [角色4x.y]
  16.  
  17.     0 => [[380,150], [400, 230], [460, 170], [480, 250]]
  18.  
  19.   }
  20.  
  21. #------------------------------------------------------------------------------
  22.  
  23. end
  24.  
  25.  
  26. #==============================================================================
  27.  
  28. # ■ Game_System
  29.  
  30. #==============================================================================
  31.  
  32. class Game_System
  33.  
  34.   attr_accessor :battle_formation                # Formation ID
  35.  
  36.   #--------------------------------------------------------------------------
  37.  
  38.   # ● 对象初始化
  39.  
  40.   #--------------------------------------------------------------------------
  41.  
  42.   alias init_game_system initialize
  43.  
  44.   def initialize
  45.  
  46.     init_game_system
  47.  
  48.     @battle_formation = 0              # Initial formation
  49.  
  50.   end
  51.  
  52. end
  53.  
  54.  
  55. #==============================================================================
  56.  
  57. # ■ Game_Actor
  58.  
  59. #==============================================================================
  60.  
  61. class Game_Actor < Game_Battler
  62.  
  63.   #--------------------------------------------------------------------------
  64.  
  65.   # ● Are sprites used? [Redefinition]
  66.  
  67.   #--------------------------------------------------------------------------
  68.  
  69.   def use_sprite?
  70.  
  71.     return true
  72.  
  73.   end
  74.  
  75.   #--------------------------------------------------------------------------
  76.  
  77.   # ● Battle Screen Acquiring X Coordinate
  78.  
  79.   #--------------------------------------------------------------------------
  80.  
  81.   def screen_x
  82.  
  83.     return Battle_Formation::FORM[$game_system.battle_formation][self.index][0]
  84.  
  85.   end
  86.  
  87.   #--------------------------------------------------------------------------
  88.  
  89.   # ● Battle Screen Acquiring Y Coordinate
  90.  
  91.   #--------------------------------------------------------------------------
  92.  
  93.   def screen_y
  94.  
  95.     return Battle_Formation::FORM[$game_system.battle_formation][self.index][1]
  96.  
  97.   end
  98.  
  99.   #--------------------------------------------------------------------------
  100.  
  101.   # ● Battle Screen Acquiring Z Coordinate
  102.  
  103.   #--------------------------------------------------------------------------
  104.  
  105.   def screen_z
  106.  
  107.     bitmap = Cache.character(self.character_name)
  108.  
  109.     return screen_y + bitmap.height / 4
  110.  
  111.   end
  112.  
  113. end
  114.  
  115.  
  116.  
  117.  
  118. #==============================================================================
  119.  
  120. # ■ Game_Enemy
  121.  
  122. #==============================================================================
  123.  
  124. class Game_Enemy < Game_Battler
  125.  
  126.   #--------------------------------------------------------------------------
  127.  
  128.   # ● Battle Screen Acquiring Z Coordinate  [Redefinition]
  129.  
  130.   #--------------------------------------------------------------------------
  131.  
  132.   def screen_z
  133.  
  134.     bitmap = Cache.battler(self.battler_name, self.battler_hue)
  135.  
  136.     return screen_y + bitmap.height
  137.  
  138.   end
  139.  
  140. end
  141.  
  142.  
  143. #==============================================================================
  144.  
  145. # ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh
  146.  
  147. #------------------------------------------------------------------------------
  148.  
  149. # ■ Scene_Battle
  150.  
  151. #==============================================================================
  152.  
  153. class Scene_Battle < Scene_Base
  154.  
  155.   #--------------------------------------------------------------------------
  156.  
  157.   # ●  Battle Start Process
  158.  
  159.   #--------------------------------------------------------------------------
  160.  
  161.   alias process_battle_start_sideview process_battle_start
  162.  
  163.   def process_battle_start
  164.  
  165.     for battler in ($game_party.members + $game_troop.members)
  166.  
  167.       battler.move_mode = SideView::M_MODE_WAIT
  168.  
  169.     end
  170.  
  171.     process_battle_start_sideview
  172.  
  173.   end
  174.  
  175.   #--------------------------------------------------------------------------
  176.  
  177.   # ● Victory Process
  178.  
  179.   #--------------------------------------------------------------------------
  180.  
  181.   alias process_victory_sideview process_victory
  182.  
  183.   def process_victory
  184.  
  185.     for actor in $game_party.members
  186.  
  187.       actor.move_mode = SideView::M_MODE_WIN
  188.  
  189.     end
  190.  
  191.     process_victory_sideview
  192.  
  193.   end
  194.  
  195.   #--------------------------------------------------------------------------
  196.  
  197.   # ● Wait Until Motion Control Is Finished
  198.  
  199.   #--------------------------------------------------------------------------
  200.  
  201.   def wait_for_motion
  202.  
  203.     while @active_battler.motion_stop
  204.  
  205.       update_basic
  206.  
  207.     end
  208.  
  209.   end
  210.  
  211.   #--------------------------------------------------------------------------
  212.  
  213.   # ● Execute Combat Operations: Attack [Redefinition]
  214.  
  215.   #--------------------------------------------------------------------------
  216.  
  217.   def execute_action_attack
  218.  
  219.     text = sprintf(Vocab::DoAttack, @active_battler.name)
  220.  
  221.     @message_window.add_instant_text(text)
  222.  
  223.     targets = @active_battler.action.make_targets
  224.  
  225.     #---Enemy attack sound reproduced.
  226.  
  227.     if @active_battler.is_a?(Game_Enemy)
  228.  
  229.       Sound.play_enemy_attack
  230.  
  231.       wait(15, true)
  232.  
  233.     end
  234.  
  235.     #--- Proximity (Going)
  236.  
  237.     SideView.set_target_point(@active_battler, targets[0])
  238.  
  239.     @active_battler.move_mode = SideView::M_MODE_ATK1
  240.  
  241.     @active_battler.motion_stop = true
  242.  
  243.     wait_for_motion
  244.  
  245.     #--- Attack
  246.  
  247.     wait(5)
  248.  
  249.     @active_battler.move_mode = SideView::M_MODE_ATK2
  250.  
  251.     #---
  252.  
  253.     display_attack_animation(targets)
  254.  
  255.     wait(20)
  256.  
  257.     for target in targets
  258.  
  259.       target.attack_effect(@active_battler)
  260.  
  261.       display_action_effects(target)
  262.  
  263.     end
  264.  
  265.     #--- Proximity (Return)
  266.  
  267.     @active_battler.move_mode = SideView::M_MODE_ATK3
  268.  
  269.     @active_battler.motion_stop = true
  270.  
  271.     wait_for_motion
  272.  
  273.     #---Wait
  274.  
  275.     for target in targets
  276.  
  277.       target.move_mode = SideView::M_MODE_WAIT
  278.  
  279.     end
  280.  
  281.     @active_battler.move_mode = SideView::M_MODE_WAIT
  282.  
  283.     #---
  284.  
  285.   end
  286.  
  287.   #--------------------------------------------------------------------------
  288.  
  289.   # ● Execute Combat Operations: Skill [Redefinition]
  290.  
  291.   #--------------------------------------------------------------------------
  292.  
  293.   def execute_action_skill
  294.  
  295.     skill = @active_battler.action.skill
  296.  
  297.     text = @active_battler.name + skill.message1
  298.  
  299.     @message_window.add_instant_text(text)
  300.  
  301.     unless skill.message2.empty?
  302.  
  303.       wait(10)
  304.  
  305.       @message_window.add_instant_text(skill.message2)
  306.  
  307.     end
  308.  
  309.     #--- Enemy attack sound reproduced.
  310.  
  311.     if @active_battler.is_a?(Game_Enemy)
  312.  
  313.       Sound.play_enemy_attack
  314.  
  315.       wait(15, true)
  316.  
  317.     end
  318.  
  319.     #--- Long distance attack.
  320.  
  321.     @active_battler.move_mode = SideView::M_MODE_MAGI
  322.  
  323.     #---
  324.  
  325.     targets = @active_battler.action.make_targets
  326.  
  327.     display_animation(targets, skill.animation_id)
  328.  
  329.     @active_battler.mp -= @active_battler.calc_mp_cost(skill)
  330.  
  331.     $game_temp.common_event_id = skill.common_event_id
  332.  
  333.     for target in targets
  334.  
  335.       target.skill_effect(@active_battler, skill)
  336.  
  337.       display_action_effects(target, skill)
  338.  
  339.     end
  340.  
  341.     #---Wait
  342.  
  343.     for target in targets
  344.  
  345.       target.move_mode = SideView::M_MODE_WAIT
  346.  
  347.     end
  348.  
  349.     @active_battler.move_mode = SideView::M_MODE_WAIT
  350.  
  351.     #---
  352.  
  353.   end
  354.  
  355.   #--------------------------------------------------------------------------
  356.  
  357.   # Execute Combat Operations: Item [Redefinition]
  358.  
  359.   #--------------------------------------------------------------------------
  360.  
  361.   def execute_action_item
  362.  
  363.     item = @active_battler.action.item
  364.  
  365.     text = sprintf(Vocab::UseItem, @active_battler.name, item.name)
  366.  
  367.     @message_window.add_instant_text(text)
  368.  
  369.     #--- Enemy attack sound reproduced.
  370.  
  371.     if @active_battler.is_a?(Game_Enemy)
  372.  
  373.       Sound.play_enemy_attack
  374.  
  375.       wait(15, true)
  376.  
  377.     end
  378.  
  379.     #--- Long distance attack
  380.  
  381.     @active_battler.move_mode = SideView::M_MODE_MAGI
  382.  
  383.     #---
  384.  
  385.     targets = @active_battler.action.make_targets
  386.  
  387.     display_animation(targets, item.animation_id)
  388.  
  389.     $game_party.consume_item(item)
  390.  
  391.     $game_temp.common_event_id = item.common_event_id
  392.  
  393.     for target in targets
  394.  
  395.       target.item_effect(@active_battler, item)
  396.  
  397.       display_action_effects(target, item)
  398.  
  399.     end
  400.  
  401.     #---Wait
  402.  
  403.     for target in targets
  404.  
  405.       target.move_mode = SideView::M_MODE_WAIT
  406.  
  407.     end
  408.  
  409.     @active_battler.move_mode = SideView::M_MODE_WAIT
  410.  
  411.     #---
  412.  
  413.   end
  414.  
  415.   #--------------------------------------------------------------------------
  416.  
  417.   # ● Attack Animation Display [Redefinition]
  418.  
  419.   #     Targets : Object's Arrangement
  420.  
  421.   #--------------------------------------------------------------------------
  422.  
  423.   # 【Changed part】
  424.  
  425.   #  Enemy sound effect is changed so it can be used in each phase of operation.
  426.  
  427.   #  It changes so that the attack animation of an enemy can be displayed.
  428.  
  429.   #--------------------------------------------------------------------------
  430.  
  431.   def display_attack_animation(targets)
  432.  
  433.     display_normal_animation(targets, @active_battler.atk_animation_id, false)
  434.  
  435.     display_normal_animation(targets, @active_battler.atk_animation_id2, true)
  436.  
  437.     wait_for_animation
  438.  
  439.   end
  440.  
  441.   #--------------------------------------------------------------------------
  442.  
  443.   # ● HP Damage display [Redefinition]
  444.  
  445.   #    Target : Candidate
  446.  
  447.   #    object : Skill or item
  448.  
  449.   #--------------------------------------------------------------------------
  450.  
  451.   def display_hp_damage(target, obj = nil)
  452.  
  453.     if target.hp_damage == 0                # No damage
  454.  
  455.       return if obj != nil and obj.damage_to_mp
  456.  
  457.       return if obj != nil and obj.base_damage == 0
  458.  
  459.       fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage
  460.  
  461.       text = sprintf(fmt, target.name)
  462.  
  463.     elsif target.absorbed                   # Absorption
  464.  
  465.       fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
  466.  
  467.       text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage)
  468.  
  469.     elsif target.hp_damage > 0              # Damage
  470.  
  471.       if target.actor?
  472.  
  473.         text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage)
  474.  
  475.         Sound.play_actor_damage
  476.  
  477.         $game_troop.screen.start_shake(5, 5, 10)
  478.  
  479.         target.blink = true # Only adds here
  480.  
  481.       else
  482.  
  483.         text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)
  484.  
  485.         Sound.play_enemy_damage
  486.  
  487.         target.blink = true
  488.  
  489.       end
  490.  
  491.     else                                    # Recovery
  492.  
  493.       fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
  494.  
  495.       text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage)
  496.  
  497.       Sound.play_recovery
  498.  
  499.     end
  500.  
  501.     @message_window.add_instant_text(text)
  502.  
  503.     wait(30)
  504.  
  505.   end
  506.  
  507. end
  508.  
  509.  
  510. #==============================================================================
  511.  
  512. # ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh
  513.  
  514. #==============================================================================
  515.  
  516. module SideView
  517.  
  518. #----------------------------------------------------------------------------
  519.  
  520.   #-----[操作设定]-----
  521.  
  522.   # 操作速度
  523.  
  524.   MOTION_SPEED = 15
  525.  
  526.  
  527.   #-----[动画设置]-----
  528.  
  529.   # 通常敌人攻击动画设定。
  530.  
  531.   E_ANIME = {
  532.  
  533.     1 => [1, 0]
  534.  
  535.   }
  536.  
  537.  
  538. #----------------------------------------------------------------------------
  539.  
  540. #----------------------------------------------------------------------------
  541.  
  542.   # 行动控制方式
  543.  
  544.   M_MODE_WAIT = 0     # Standby
  545.  
  546.   M_MODE_MAGI = 1     # Attack
  547.  
  548.   M_MODE_DAMG = 2     # Non-Damage Attack
  549.  
  550.   M_MODE_WIN  = 3     # Victory
  551.  
  552.   M_MODE_ATK1 = 4     # Direct Attack (Approaching)
  553.  
  554.   M_MODE_ATK2 = 5     # Direct Attack (Attacking)
  555.  
  556.   M_MODE_ATK3 = 6     # Direct Attack (Returning)
  557.  
  558.  
  559.   module_function
  560.  
  561.   #--------------------------------------------------------------------------
  562.  
  563.   # ● Movement-Zone Calculation
  564.  
  565.   #--------------------------------------------------------------------------
  566.  
  567.   def set_target_point(attacker, target)
  568.  
  569.     case target
  570.  
  571.     when Game_Actor
  572.  
  573.       bits = Cache.character(target.character_name)
  574.  
  575.       attacker.target_x = target.screen_x + (bits.width / 8)
  576.  
  577.       attacker.target_y = target.screen_y
  578.  
  579.     when Game_Enemy
  580.  
  581.       bits = Cache.battler(target.battler_name, target.battler_hue)
  582.  
  583.       attacker.target_x = target.screen_x + (bits.width / 2)
  584.  
  585.       attacker.target_y = target.screen_y
  586.  
  587.     end
  588.  
  589.   end
  590.  
  591. end
  592.  
  593.  
  594. class Game_Battler
  595.  
  596.   attr_accessor   :move_mode       # Operation Mode
  597.  
  598.   # 0:Standby   1:Attack   2: Un-useless   3:Victory
  599.  
  600.   attr_accessor   :motion_stop     # Operation Stop Flag (Under Movement Flag)
  601.  
  602.   attr_accessor   :target_x        # Move Position(x)
  603.  
  604.   attr_accessor   :target_y        # Move Position(y)
  605.  
  606.   #--------------------------------------------------------------------------
  607.  
  608.   # ● Object Initialization
  609.  
  610.   #--------------------------------------------------------------------------
  611.  
  612.   alias initialize_sdva_corpse initialize
  613.  
  614.   def initialize
  615.  
  616.     initialize_sdva_corpse
  617.  
  618.     @move_mode = 0
  619.  
  620.     @motion_stop = false
  621.  
  622.     @target_x = 0
  623.  
  624.     @target_y = 0
  625.  
  626.   end
  627.  
  628. end
  629.  
  630.  
  631. #==============================================================================
  632.  
  633. # ■ Game_Enemy
  634.  
  635. #==============================================================================
  636.  
  637. class Game_Enemy < Game_Battler
  638.  
  639.   #--------------------------------------------------------------------------
  640.  
  641.   # ● Attack Animation ID Acquisition
  642.  
  643.   #--------------------------------------------------------------------------
  644.  
  645.   def atk_animation_id
  646.  
  647.     return 0 if SideView::E_ANIME[@enemy_id].nil?
  648.  
  649.     return SideView::E_ANIME[@enemy_id][0]
  650.  
  651.   end
  652.  
  653.   #--------------------------------------------------------------------------
  654.  
  655.   # ● Attack Animation ID Acquisition  (2 Sword Style : 2 Weapons )
  656.  
  657.   #--------------------------------------------------------------------------
  658.  
  659.   def atk_animation_id2
  660.  
  661.     return 0 if SideView::E_ANIME[@enemy_id].nil?
  662.  
  663.     return SideView::E_ANIME[@enemy_id][1]
  664.  
  665.   end
  666.  
  667. end
  668.  
  669.  
  670.  
  671.  
  672. #==============================================================================
  673.  
  674. # ■ Sprite_Battler
  675.  
  676. #==============================================================================
  677.  
  678. class Sprite_Battler < Sprite_Base
  679.  
  680.   #--------------------------------------------------------------------------
  681.  
  682. # ● Object Initialization
  683.  
  684. #     Viewport : View Port
  685.  
  686. #     Battler  : Battler (Game_Battler)
  687.  
  688.   #--------------------------------------------------------------------------
  689.  
  690.   alias initialize_sideview initialize
  691.  
  692.   def initialize(viewport, battler = nil)
  693.  
  694.     initialize_sideview(viewport, battler)
  695.  
  696.     init_direct_attack
  697.  
  698.   end
  699.  
  700.   #--------------------------------------------------------------------------
  701.  
  702.   # ● Set Proximity Value For Attack
  703.  
  704.   #--------------------------------------------------------------------------
  705.  
  706.   def init_direct_attack
  707.  
  708.     @direct_attack_cnt = 0
  709.  
  710.     @direct_attack_phase = 0
  711.  
  712.     @direct_move_cnt = 0
  713.  
  714.     @battler_x_plus = 0
  715.  
  716.     @battler_y_plus = 0
  717.  
  718.     @moving_mode = 0
  719.  
  720.     @pattern = 0
  721.  
  722.     @direction = 0
  723.  
  724.   end
  725.  
  726.   #--------------------------------------------------------------------------
  727.  
  728.   # ● Frame Renewal [Redefinition]
  729.  
  730.   #--------------------------------------------------------------------------
  731.  
  732.   def update
  733.  
  734.     super
  735.  
  736.     if @battler == nil
  737.  
  738.       self.bitmap = nil
  739.  
  740.     else
  741.  
  742.       @use_sprite = @battler.use_sprite?
  743.  
  744.       if @use_sprite
  745.  
  746.         self.x = @battler.screen_x + @battler_x_plus
  747.  
  748.         self.y = @battler.screen_y + @battler_y_plus
  749.  
  750.         self.z = @battler.screen_z
  751.  
  752.         update_battler_bitmap
  753.  
  754.       end
  755.  
  756.       setup_new_effect
  757.  
  758.       update_effect
  759.  
  760.     end
  761.  
  762.   end
  763.  
  764.   #--------------------------------------------------------------------------
  765.  
  766.   # ● Bitmap Transfer Source Renewal
  767.  
  768.   #--------------------------------------------------------------------------
  769.  
  770.   alias update_battler_bitmap_sideview update_battler_bitmap
  771.  
  772.   def update_battler_bitmap
  773.  
  774.     case @battler
  775.  
  776.     when Game_Actor
  777.  
  778.       if @battler.character_name != @battler_name or @battler.character_index != @battler_hue
  779.  
  780.         @battler_name = @battler.character_name
  781.  
  782.         @battler_hue = @battler.character_index
  783.  
  784.         draw_pre_character
  785.  
  786.         draw_character
  787.  
  788.         if (@battler.dead? or @battler.hidden)
  789.  
  790.           self.opacity = 0
  791.  
  792.         end
  793.  
  794.       end
  795.  
  796.     when Game_Enemy
  797.  
  798.       if @battler.battler_name != @battler_name or
  799.  
  800.          @battler.battler_hue != @battler_hue
  801.  
  802.         @battler_name = @battler.battler_name
  803.  
  804.         @battler_hue = @battler.battler_hue
  805.  
  806.         draw_battler
  807.  
  808.         if (@battler.dead? or @battler.hidden)
  809.  
  810.           self.opacity = 0
  811.  
  812.         end
  813.  
  814.       end
  815.  
  816.     end
  817.  
  818.     motion_control
  819.  
  820.   end
  821.  
  822.   #--------------------------------------------------------------------------
  823.  
  824.   # ● Battler Drawing
  825.  
  826.   #--------------------------------------------------------------------------
  827.  
  828.   def draw_battler
  829.  
  830.     self.bitmap = Cache.battler(@battler_name, @battler_hue)
  831.  
  832.     @width = bitmap.width
  833.  
  834.     @height = bitmap.height
  835.  
  836.     self.ox = @width / 2
  837.  
  838.     self.oy = @height
  839.  
  840.   end
  841.  
  842.   #--------------------------------------------------------------------------
  843.  
  844.   # ● Pre-Character Drawing [Common]
  845.  
  846.   #--------------------------------------------------------------------------
  847.  
  848.   def draw_pre_character
  849.  
  850.     self.bitmap = Cache.character(@battler_name)
  851.  
  852.     sign = @battler_name[/^[\!\$]./]
  853.  
  854. #    if sign != nil and sign.include?(')
  855.  
  856.       @width = bitmap.width / 3
  857.  
  858.       @height = bitmap.height / 4
  859.  
  860.     else
  861.  
  862.       @width = bitmap.width / 12
  863.  
  864.       @height = bitmap.height / 8
  865.  
  866.     end
  867.  
  868. #    self.ox = @width / 2
  869.  
  870. #    self.oy = @height
  871.  
  872. end
  873.  
  874.   #--------------------------------------------------------------------------
  875.  
  876.   # ● Character Drawing [Common]
  877.  
  878.   #--------------------------------------------------------------------------
  879.  
  880.   def draw_character
  881.  
  882.     index = @battler_hue
  883.  
  884.     pattern = @pattern < 3 ? @pattern : 1
  885.  
  886.     sx = (index % 4 * 3 + pattern) * @width
  887.  
  888.     sy = (index / 4 * 4 + (@direction - 2) / 2) * @height
  889.  
  890.     self.src_rect.set(sx, sy, @width, @height)
  891.  
  892.   end
  893.  
  894.   #--------------------------------------------------------------------------
  895.  
  896.   # ● Motion Control
  897.  
  898.   #--------------------------------------------------------------------------
  899.  
  900.   def motion_control
  901.  
  902.     # Memory Operation Mode
  903.  
  904.     @moving_mode = @battler.move_mode
  905.  
  906.     # Battler Drawing
  907.  
  908.     case @battler
  909.  
  910.     when Game_Actor # Actor
  911.  
  912.       actor_motion_control
  913.  
  914.     when Game_Enemy # Enemy
  915.  
  916.       enemy_motion_control
  917.  
  918.     end
  919.  
  920.   end
  921.  
  922.   #--------------------------------------------------------------------------
  923.  
  924.   # ● Motion Control (Actor)
  925.  
  926.   #--------------------------------------------------------------------------
  927.  
  928.   def actor_motion_control
  929.  
  930.     # Operation Change
  931.  
  932.     case @moving_mode
  933.  
  934.     when SideView::M_MODE_WAIT  # Standby
  935.  
  936.       init_direct_attack
  937.  
  938.       @battler_x_plus = 0
  939.  
  940.       @direction = 4
  941.  
  942.       @pattern = 1
  943.  
  944.     when SideView::M_MODE_MAGI  # Attack
  945.  
  946.       @battler_x_plus = -10
  947.  
  948.       @direction = 4
  949.  
  950.       @pattern = 3
  951.  
  952.     when SideView::M_MODE_DAMG  # Non-Damage Attack
  953.  
  954.       @battler_x_plus = 10
  955.  
  956.       @direction = 4
  957.  
  958.       @pattern = 3
  959.  
  960.     when SideView::M_MODE_WIN  # Victory
  961.  
  962.       @direction = 2
  963.  
  964.       @pattern = 1
  965.  
  966.     when SideView::M_MODE_ATK1  # Direct Attack (Approaching)
  967.  
  968.       exe_moving_attack_start
  969.  
  970.       @end_pos_x = @battler_x_plus
  971.  
  972.     when SideView::M_MODE_ATK2  # Direct Attack (Attacking)
  973.  
  974.       @battler_x_plus = @end_pos_x - 10
  975.  
  976.     when SideView::M_MODE_ATK3  # Direct Attack (Returning)
  977.  
  978.       exe_moving_attack_end
  979.  
  980.     else
  981.  
  982.       p "error:Sprite_Battler>> @moving_mode"
  983.  
  984.     end
  985.  
  986.     draw_character
  987.  
  988.   end
  989.  
  990.   #--------------------------------------------------------------------------
  991.  
  992.   # ● Motion Control (Enemy)
  993.  
  994.   #--------------------------------------------------------------------------
  995.  
  996.   def enemy_motion_control
  997.  
  998.     # Operation Change
  999.  
  1000.     case @moving_mode
  1001.  
  1002.     when SideView::M_MODE_WAIT  # Standby
  1003.  
  1004.       init_direct_attack
  1005.  
  1006.     when SideView::M_MODE_MAGI  # Attack
  1007.  
  1008.       @battler_x_plus = 10
  1009.  
  1010.     when SideView::M_MODE_DAMG  # Non-Damage Attack
  1011.  
  1012.       @battler_x_plus = -10
  1013.  
  1014.       @shake_flg = true
  1015.  
  1016.     when SideView::M_MODE_ATK1  # Direct Attack (Approaching)
  1017.  
  1018.       exe_moving_attack_start
  1019.  
  1020.       @end_pos_x = @battler_x_plus
  1021.  
  1022.     when SideView::M_MODE_ATK2  # Direct Attack (Attacking)
  1023.  
  1024.       @battler_x_plus = @end_pos_x + 10
  1025.  
  1026.     when SideView::M_MODE_ATK3  # Direct Attack (Returning)
  1027.  
  1028.       exe_moving_attack_end
  1029.  
  1030.     else
  1031.  
  1032.       p "error:Sprite_Battler>> @moving_mode", @moving_mode
  1033.  
  1034.     end
  1035.  
  1036.   end
  1037.  
  1038.   #--------------------------------------------------------------------------
  1039.  
  1040.   # ● Proximity Attack Execution Method
  1041.  
  1042.   #--------------------------------------------------------------------------
  1043.  
  1044.   def exe_moving_attack_start
  1045.  
  1046.     return unless @battler.motion_stop
  1047.  
  1048.     case @direct_attack_phase
  1049.  
  1050.     when 0  # Start Operation Preparation
  1051.  
  1052.       diratk_start
  1053.  
  1054.     when 1  # Move Operation (Going)
  1055.  
  1056.       diratk_move
  1057.  
  1058.     when 2  # After-Movement Wait
  1059.  
  1060.       diratk_wait
  1061.  
  1062.     end
  1063.  
  1064.   end
  1065.  
  1066.   def exe_moving_attack_end
  1067.  
  1068.     case @direct_attack_phase
  1069.  
  1070.     when 0  # Attack Operation
  1071.  
  1072.       diratk_attack
  1073.  
  1074.     when 1  # Move Operation (Return)
  1075.  
  1076.       diratk_back
  1077.  
  1078.     when 2  # Operation End
  1079.  
  1080.       diratk_end
  1081.  
  1082.     end
  1083.  
  1084.   end
  1085.  
  1086.   #--------------------------------------------------------------------------
  1087.  
  1088.   # ● Proximity Attack Execution [Start Operation Preparation]
  1089.  
  1090.   #--------------------------------------------------------------------------
  1091.  
  1092.   def diratk_start
  1093.  
  1094.     # Pose Change
  1095.  
  1096.     @pattern = 1
  1097.  
  1098.     # The number of frames needed is the distance between current position and
  1099.  
  1100.     # target position.
  1101.  
  1102.     pos_x = @battler.target_x - self.x
  1103.  
  1104.     pos_y = @battler.target_y - self.y
  1105.  
  1106.     # Caculation for ammount of frames needed.
  1107.  
  1108.     @direct_move_cnt = @direct_attack_cnt = (pos_x.abs / SideView::MOTION_SPEED).round
  1109.  
  1110.     # NEXT Phase
  1111.  
  1112.     @direct_attack_phase += 1
  1113.  
  1114.   end
  1115.  
  1116.   #--------------------------------------------------------------------------
  1117.  
  1118.   # ● Proximity Attack Execution [Move Operation (Going)]
  1119.  
  1120.   #--------------------------------------------------------------------------
  1121.  
  1122.   def diratk_move
  1123.  
  1124.     case @battler
  1125.  
  1126.     when Game_Actor
  1127.  
  1128.       x_plus = @width
  1129.  
  1130.       y_plus = -@height / 4
  1131.  
  1132.     when Game_Enemy
  1133.  
  1134.       x_plus = -@width - 10
  1135.  
  1136.       y_plus = @height / 4
  1137.  
  1138.     end
  1139.  
  1140.     # The next movement location is figured out by the distance between
  1141.  
  1142.     # current position and target position.
  1143.  
  1144.     pos_x = @battler.target_x - self.x + x_plus
  1145.  
  1146.     pos_y = @battler.target_y - self.y + y_plus
  1147.  
  1148.     @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0
  1149.  
  1150.     @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0
  1151.  
  1152.     # End count
  1153.  
  1154.     @direct_attack_cnt -= 1
  1155.  
  1156.     # Last movement (Insurance: Last correction)
  1157.  
  1158.     if @direct_attack_cnt <= 0
  1159.  
  1160.       @battler_x_plus = @battler.target_x - @battler.screen_x + x_plus
  1161.  
  1162.       @battler_y_plus = @battler.target_y - @battler.screen_y + y_plus
  1163.  
  1164.       # NEXTフェーズ
  1165.  
  1166.       @direct_attack_cnt = 5
  1167.  
  1168.       @direct_attack_phase += 1
  1169.  
  1170.     end
  1171.  
  1172.   end
  1173.  
  1174.   #--------------------------------------------------------------------------
  1175.  
  1176.   # ● Proximity Attack Execution [Attack Operation Return]
  1177.  
  1178.   #--------------------------------------------------------------------------
  1179.  
  1180.   def diratk_wait
  1181.  
  1182.     # End Count
  1183.  
  1184.     @direct_attack_cnt -= 1
  1185.  
  1186.     # Last Movement
  1187.  
  1188.     if @direct_attack_cnt <= 0
  1189.  
  1190.       # Pose Change
  1191.  
  1192.       @pattern = 3
  1193.  
  1194.       # END Phase
  1195.  
  1196.       @direct_attack_phase = 0
  1197.  
  1198.       @battler.motion_stop = false
  1199.  
  1200.     end
  1201.  
  1202.   end
  1203.  
  1204.   #--------------------------------------------------------------------------
  1205.  
  1206.   # ● Proximity Attack Execution [Attack Operation Return]
  1207.  
  1208.   #--------------------------------------------------------------------------
  1209.  
  1210.   def diratk_attack
  1211.  
  1212.     # Pose Change
  1213.  
  1214.     @pattern = 1
  1215.  
  1216.     # End Wait Count
  1217.  
  1218.     @direct_attack_cnt = @direct_move_cnt
  1219.  
  1220.     # NEXT Phase
  1221.  
  1222.     @direct_attack_phase += 1
  1223.  
  1224.   end
  1225.  
  1226.   #--------------------------------------------------------------------------
  1227.  
  1228.   # ● Proximity Attack Execution [Move Operation (Return)]
  1229.  
  1230.   #--------------------------------------------------------------------------
  1231.  
  1232.   def diratk_back
  1233.  
  1234.     # The next movement location is figured out by the distance between
  1235.  
  1236.     # current position and target position.
  1237.  
  1238.     pos_x = @battler.screen_x - self.x
  1239.  
  1240.     pos_y = @battler.screen_y - self.y
  1241.  
  1242.     @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0
  1243.  
  1244.     @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0
  1245.  
  1246.     # End Count
  1247.  
  1248.     @direct_attack_cnt -= 1
  1249.  
  1250.     # Last Movement
  1251.  
  1252.     if @direct_attack_cnt == 0
  1253.  
  1254.       @battler_x_plus = 0
  1255.  
  1256.       @battler_y_plus = 0
  1257.  
  1258.       # NEXT Phase
  1259.  
  1260.       @direct_attack_phase += 1
  1261.  
  1262.     end
  1263.  
  1264.   end
  1265.  
  1266.   #--------------------------------------------------------------------------
  1267.  
  1268.   # ● Proximity attack execution [Operation End]
  1269.  
  1270.   #--------------------------------------------------------------------------
  1271.  
  1272.   def diratk_end
  1273.  
  1274.     init_direct_attack
  1275.  
  1276.     @battler.motion_stop = false
  1277.  
  1278.     # END Phase
  1279.  
  1280.     @direct_attack_phase = 0
  1281.  
  1282.   end
  1283.  
  1284. # end

1.png (776.19 KB, 下载次数: 24)

1.png

2.png (651.18 KB, 下载次数: 24)

2.png

3.png (646.98 KB, 下载次数: 20)

3.png

4.png (210.26 KB, 下载次数: 23)

4.png

Lv1.梦旅人

梦石
0
星屑
560
在线时间
6 小时
注册时间
2013-6-11
帖子
3
2
 楼主| 发表于 2014-2-12 14:43:50 | 只看该作者
難道就沒有人能夠幫助我嗎QAQ
我希望我這款遊戲能夠盡快的完成
本遊戲已經花費了1年了
目前是希望能夠更改為使用橫板戰鬥方式
希望大家能夠幫助我謝謝~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
191
在线时间
835 小时
注册时间
2012-9-16
帖子
1811
3
发表于 2014-2-12 14:50:27 | 只看该作者
图都快挂了=-=
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-4-19 05:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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