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

Project1

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

[已经解决] 【非伸手=-=】求简易版横版战斗

[复制链接]

Lv1.梦旅人

梦石
0
星屑
191
在线时间
835 小时
注册时间
2012-9-16
帖子
1811
跳转到指定楼层
1
发表于 2014-1-24 09:16:10 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
之前记得在哪里看过,似乎只要一个脚本,那个简易的横版战斗脚本,...因为很多横战都很麻烦,我要收录一下这个脚本,但是搜了半天也没有=-=
我记得提问区以前有人提问过关于横战的问题,然后记得有人回答给了个简易横版战斗脚本的说=-=

@protosssonny  

——旧坑欢迎戳

Lv1.梦旅人

梦石
0
星屑
50
在线时间
11 小时
注册时间
2014-1-24
帖子
17
2
发表于 2014-1-24 18:27:08 | 只看该作者
  1. #==============================================================================

  2. # ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh

  3. #------------------------------------------------------------------------------

  4. 不谢。

  5. module Battle_Formation

  6. #------------------------------------------------------------------------------

  7.   FORM = {

  8.     #    [角色1x.y]  [角色2x.y]  [角色3x.y]  [角色4x.y]

  9.     0 => [[380,150], [400, 230], [460, 170], [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              # Initial formation

  25.   end

  26. end


  27. #==============================================================================

  28. # ■ Game_Actor

  29. #==============================================================================

  30. class Game_Actor < Game_Battler

  31.   #--------------------------------------------------------------------------

  32.   # ● Are sprites used? [Redefinition]

  33.   #--------------------------------------------------------------------------

  34.   def use_sprite?

  35.     return true

  36.   end

  37.   #--------------------------------------------------------------------------

  38.   # ● Battle Screen Acquiring X Coordinate

  39.   #--------------------------------------------------------------------------

  40.   def screen_x

  41.     return Battle_Formation::FORM[$game_system.battle_formation][self.index][0]

  42.   end

  43.   #--------------------------------------------------------------------------

  44.   # ● Battle Screen Acquiring Y Coordinate

  45.   #--------------------------------------------------------------------------

  46.   def screen_y

  47.     return Battle_Formation::FORM[$game_system.battle_formation][self.index][1]

  48.   end

  49.   #--------------------------------------------------------------------------

  50.   # ● Battle Screen Acquiring Z Coordinate

  51.   #--------------------------------------------------------------------------

  52.   def screen_z

  53.     bitmap = Cache.character(self.character_name)

  54.     return screen_y + bitmap.height / 4

  55.   end

  56. end




  57. #==============================================================================

  58. # ■ Game_Enemy

  59. #==============================================================================

  60. class Game_Enemy < Game_Battler

  61.   #--------------------------------------------------------------------------

  62.   # ● Battle Screen Acquiring Z Coordinate  [Redefinition]

  63.   #--------------------------------------------------------------------------

  64.   def screen_z

  65.     bitmap = Cache.battler(self.battler_name, self.battler_hue)

  66.     return screen_y + bitmap.height

  67.   end

  68. end


  69. #==============================================================================

  70. # ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh

  71. #------------------------------------------------------------------------------

  72. # ■ Scene_Battle

  73. #==============================================================================

  74. class Scene_Battle < Scene_Base

  75.   #--------------------------------------------------------------------------

  76.   # ●  Battle Start Process

  77.   #--------------------------------------------------------------------------

  78.   alias process_battle_start_sideview process_battle_start

  79.   def process_battle_start

  80.     for battler in ($game_party.members + $game_troop.members)

  81.       battler.move_mode = SideView::M_MODE_WAIT

  82.     end

  83.     process_battle_start_sideview

  84.   end

  85.   #--------------------------------------------------------------------------

  86.   # ● Victory Process

  87.   #--------------------------------------------------------------------------

  88.   alias process_victory_sideview process_victory

  89.   def process_victory

  90.     for actor in $game_party.members

  91.       actor.move_mode = SideView::M_MODE_WIN

  92.     end

  93.     process_victory_sideview

  94.   end

  95.   #--------------------------------------------------------------------------

  96.   # ● Wait Until Motion Control Is Finished

  97.   #--------------------------------------------------------------------------

  98.   def wait_for_motion

  99.     while @active_battler.motion_stop

  100.       update_basic

  101.     end

  102.   end

  103.   #--------------------------------------------------------------------------

  104.   # ● Execute Combat Operations: Attack [Redefinition]

  105.   #--------------------------------------------------------------------------

  106.   def execute_action_attack

  107.     text = sprintf(Vocab::DoAttack, @active_battler.name)

  108.     @message_window.add_instant_text(text)

  109.     targets = @active_battler.action.make_targets

  110.     #---Enemy attack sound reproduced.

  111.     if @active_battler.is_a?(Game_Enemy)

  112.       Sound.play_enemy_attack

  113.       wait(15, true)

  114.     end

  115.     #--- Proximity (Going)

  116.     SideView.set_target_point(@active_battler, targets[0])

  117.     @active_battler.move_mode = SideView::M_MODE_ATK1

  118.     @active_battler.motion_stop = true

  119.     wait_for_motion

  120.     #--- Attack

  121.     wait(5)

  122.     @active_battler.move_mode = SideView::M_MODE_ATK2

  123.     #---

  124.     display_attack_animation(targets)

  125.     wait(20)

  126.     for target in targets

  127.       target.attack_effect(@active_battler)

  128.       display_action_effects(target)

  129.     end

  130.     #--- Proximity (Return)

  131.     @active_battler.move_mode = SideView::M_MODE_ATK3

  132.     @active_battler.motion_stop = true

  133.     wait_for_motion

  134.     #---Wait

  135.     for target in targets

  136.       target.move_mode = SideView::M_MODE_WAIT

  137.     end

  138.     @active_battler.move_mode = SideView::M_MODE_WAIT

  139.     #---

  140.   end

  141.   #--------------------------------------------------------------------------

  142.   # ● Execute Combat Operations: Skill [Redefinition]

  143.   #--------------------------------------------------------------------------

  144.   def execute_action_skill

  145.     skill = @active_battler.action.skill

  146.     text = @active_battler.name + skill.message1

  147.     @message_window.add_instant_text(text)

  148.     unless skill.message2.empty?

  149.       wait(10)

  150.       @message_window.add_instant_text(skill.message2)

  151.     end

  152.     #--- Enemy attack sound reproduced.

  153.     if @active_battler.is_a?(Game_Enemy)

  154.       Sound.play_enemy_attack

  155.       wait(15, true)

  156.     end

  157.     #--- Long distance attack.

  158.     @active_battler.move_mode = SideView::M_MODE_MAGI

  159.     #---

  160.     targets = @active_battler.action.make_targets

  161.     display_animation(targets, skill.animation_id)

  162.     @active_battler.mp -= @active_battler.calc_mp_cost(skill)

  163.     $game_temp.common_event_id = skill.common_event_id

  164.     for target in targets

  165.       target.skill_effect(@active_battler, skill)

  166.       display_action_effects(target, skill)

  167.     end

  168.     #---Wait

  169.     for target in targets

  170.       target.move_mode = SideView::M_MODE_WAIT

  171.     end

  172.     @active_battler.move_mode = SideView::M_MODE_WAIT

  173.     #---

  174.   end

  175.   #--------------------------------------------------------------------------

  176.   # Execute Combat Operations: Item [Redefinition]

  177.   #--------------------------------------------------------------------------

  178.   def execute_action_item

  179.     item = @active_battler.action.item

  180.     text = sprintf(Vocab::UseItem, @active_battler.name, item.name)

  181.     @message_window.add_instant_text(text)

  182.     #--- Enemy attack sound reproduced.

  183.     if @active_battler.is_a?(Game_Enemy)

  184.       Sound.play_enemy_attack

  185.       wait(15, true)

  186.     end

  187.     #--- Long distance attack

  188.     @active_battler.move_mode = SideView::M_MODE_MAGI

  189.     #---

  190.     targets = @active_battler.action.make_targets

  191.     display_animation(targets, item.animation_id)

  192.     $game_party.consume_item(item)

  193.     $game_temp.common_event_id = item.common_event_id

  194.     for target in targets

  195.       target.item_effect(@active_battler, item)

  196.       display_action_effects(target, item)

  197.     end

  198.     #---Wait

  199.     for target in targets

  200.       target.move_mode = SideView::M_MODE_WAIT

  201.     end

  202.     @active_battler.move_mode = SideView::M_MODE_WAIT

  203.     #---

  204.   end

  205.   #--------------------------------------------------------------------------

  206.   # ● Attack Animation Display [Redefinition]

  207.   #     Targets : Object's Arrangement

  208.   #--------------------------------------------------------------------------

  209.   # 【Changed part】

  210.   #  Enemy sound effect is changed so it can be used in each phase of operation.

  211.   #  It changes so that the attack animation of an enemy can be displayed.

  212.   #--------------------------------------------------------------------------

  213.   def display_attack_animation(targets)

  214.     display_normal_animation(targets, @active_battler.atk_animation_id, false)

  215.     display_normal_animation(targets, @active_battler.atk_animation_id2, true)

  216.     wait_for_animation

  217.   end

  218.   #--------------------------------------------------------------------------

  219.   # ● HP Damage display [Redefinition]

  220.   #    Target : Candidate

  221.   #    object : Skill or item

  222.   #--------------------------------------------------------------------------

  223.   def display_hp_damage(target, obj = nil)

  224.     if target.hp_damage == 0                # No damage

  225.       return if obj != nil and obj.damage_to_mp

  226.       return if obj != nil and obj.base_damage == 0

  227.       fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage

  228.       text = sprintf(fmt, target.name)

  229.     elsif target.absorbed                   # Absorption

  230.       fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain

  231.       text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage)

  232.     elsif target.hp_damage > 0              # Damage

  233.       if target.actor?

  234.         text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage)

  235.         Sound.play_actor_damage

  236.         $game_troop.screen.start_shake(5, 5, 10)

  237.         target.blink = true # Only adds here

  238.       else

  239.         text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)

  240.         Sound.play_enemy_damage

  241.         target.blink = true

  242.       end

  243.     else                                    # Recovery

  244.       fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery

  245.       text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage)

  246.       Sound.play_recovery

  247.     end

  248.     @message_window.add_instant_text(text)

  249.     wait(30)

  250.   end

  251. end


  252. #==============================================================================

  253. # ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh

  254. #==============================================================================

  255. module SideView

  256. #----------------------------------------------------------------------------

  257.   #-----[操作设定]-----

  258.   # 操作速度

  259.   MOTION_SPEED = 15


  260.   #-----[动画设置]-----

  261.   # 通常敌人攻击动画设定。

  262.   E_ANIME = {

  263.     1 => [1, 0]

  264.   }


  265. #----------------------------------------------------------------------------

  266. #----------------------------------------------------------------------------

  267.   # 行动控制方式

  268.   M_MODE_WAIT = 0     # Standby

  269.   M_MODE_MAGI = 1     # Attack

  270.   M_MODE_DAMG = 2     # Non-Damage Attack

  271.   M_MODE_WIN  = 3     # Victory

  272.   M_MODE_ATK1 = 4     # Direct Attack (Approaching)

  273.   M_MODE_ATK2 = 5     # Direct Attack (Attacking)

  274.   M_MODE_ATK3 = 6     # Direct Attack (Returning)


  275.   module_function

  276.   #--------------------------------------------------------------------------

  277.   # ● Movement-Zone Calculation

  278.   #--------------------------------------------------------------------------

  279.   def set_target_point(attacker, target)

  280.     case target

  281.     when Game_Actor

  282.       bits = Cache.character(target.character_name)

  283.       attacker.target_x = target.screen_x + (bits.width / 8)

  284.       attacker.target_y = target.screen_y

  285.     when Game_Enemy

  286.       bits = Cache.battler(target.battler_name, target.battler_hue)

  287.       attacker.target_x = target.screen_x + (bits.width / 2)

  288.       attacker.target_y = target.screen_y

  289.     end

  290.   end

  291. end


  292. class Game_Battler

  293.   attr_accessor   :move_mode       # Operation Mode

  294.   # 0:Standby   1:Attack   2: Un-useless   3:Victory

  295.   attr_accessor   :motion_stop     # Operation Stop Flag (Under Movement Flag)

  296.   attr_accessor   :target_x        # Move Position(x)

  297.   attr_accessor   :target_y        # Move Position(y)

  298.   #--------------------------------------------------------------------------

  299.   # ● Object Initialization

  300.   #--------------------------------------------------------------------------

  301.   alias initialize_sdva_corpse initialize

  302.   def initialize

  303.     initialize_sdva_corpse

  304.     @move_mode = 0

  305.     @motion_stop = false

  306.     @target_x = 0

  307.     @target_y = 0

  308.   end

  309. end


  310. #==============================================================================

  311. # ■ Game_Enemy

  312. #==============================================================================

  313. class Game_Enemy < Game_Battler

  314.   #--------------------------------------------------------------------------

  315.   # ● Attack Animation ID Acquisition

  316.   #--------------------------------------------------------------------------

  317.   def atk_animation_id

  318.     return 0 if SideView::E_ANIME[@enemy_id].nil?

  319.     return SideView::E_ANIME[@enemy_id][0]

  320.   end

  321.   #--------------------------------------------------------------------------

  322.   # ● Attack Animation ID Acquisition  (2 Sword Style : 2 Weapons )

  323.   #--------------------------------------------------------------------------

  324.   def atk_animation_id2

  325.     return 0 if SideView::E_ANIME[@enemy_id].nil?

  326.     return SideView::E_ANIME[@enemy_id][1]

  327.   end

  328. end




  329. #==============================================================================

  330. # ■ Sprite_Battler

  331. #==============================================================================

  332. class Sprite_Battler < Sprite_Base

  333.   #--------------------------------------------------------------------------

  334. # ● Object Initialization

  335. #     Viewport : View Port

  336. #     Battler  : Battler (Game_Battler)

  337.   #--------------------------------------------------------------------------

  338.   alias initialize_sideview initialize

  339.   def initialize(viewport, battler = nil)

  340.     initialize_sideview(viewport, battler)

  341.     init_direct_attack

  342.   end

  343.   #--------------------------------------------------------------------------

  344.   # ● Set Proximity Value For Attack

  345.   #--------------------------------------------------------------------------

  346.   def init_direct_attack

  347.     @direct_attack_cnt = 0

  348.     @direct_attack_phase = 0

  349.     @direct_move_cnt = 0

  350.     @battler_x_plus = 0

  351.     @battler_y_plus = 0

  352.     @moving_mode = 0

  353.     @pattern = 0

  354.     @direction = 0

  355.   end

  356.   #--------------------------------------------------------------------------

  357.   # ● Frame Renewal [Redefinition]

  358.   #--------------------------------------------------------------------------

  359.   def update

  360.     super

  361.     if @battler == nil

  362.       self.bitmap = nil

  363.     else

  364.       @use_sprite = @battler.use_sprite?

  365.       if @use_sprite

  366.         self.x = @battler.screen_x + @battler_x_plus

  367.         self.y = @battler.screen_y + @battler_y_plus

  368.         self.z = @battler.screen_z

  369.         update_battler_bitmap

  370.       end

  371.       setup_new_effect

  372.       update_effect

  373.     end

  374.   end

  375.   #--------------------------------------------------------------------------

  376.   # ● Bitmap Transfer Source Renewal

  377.   #--------------------------------------------------------------------------

  378.   alias update_battler_bitmap_sideview update_battler_bitmap

  379.   def update_battler_bitmap

  380.     case @battler

  381.     when Game_Actor

  382.       if @battler.character_name != @battler_name or @battler.character_index != @battler_hue

  383.         @battler_name = @battler.character_name

  384.         @battler_hue = @battler.character_index

  385.         draw_pre_character

  386.         draw_character

  387.         if (@battler.dead? or @battler.hidden)

  388.           self.opacity = 0

  389.         end

  390.       end

  391.     when Game_Enemy

  392.       if @battler.battler_name != @battler_name or

  393.          @battler.battler_hue != @battler_hue

  394.         @battler_name = @battler.battler_name

  395.         @battler_hue = @battler.battler_hue

  396.         draw_battler

  397.         if (@battler.dead? or @battler.hidden)

  398.           self.opacity = 0

  399.         end

  400.       end

  401.     end

  402.     motion_control

  403.   end

  404.   #--------------------------------------------------------------------------

  405.   # ● Battler Drawing

  406.   #--------------------------------------------------------------------------

  407.   def draw_battler

  408.     self.bitmap = Cache.battler(@battler_name, @battler_hue)

  409.     @width = bitmap.width

  410.     @height = bitmap.height

  411.     self.ox = @width / 2

  412.     self.oy = @height

  413.   end

  414.   #--------------------------------------------------------------------------

  415.   # ● Pre-Character Drawing [Common]

  416.   #--------------------------------------------------------------------------

  417.   def draw_pre_character

  418.     self.bitmap = Cache.character(@battler_name)

  419.     sign = @battler_name[/^[\!\$]./]

  420.     if sign != nil and sign.include?(')

  421.       @width = bitmap.width / 3

  422.       @height = bitmap.height / 4

  423.     else

  424.       @width = bitmap.width / 12

  425.       @height = bitmap.height / 8

  426.     end

  427.     self.ox = @width / 2

  428.     self.oy = @height

  429.   end

  430.   #--------------------------------------------------------------------------

  431.   # ● Character Drawing [Common]

  432.   #--------------------------------------------------------------------------

  433.   def draw_character

  434.     index = @battler_hue

  435.     pattern = @pattern < 3 ? @pattern : 1

  436.     sx = (index % 4 * 3 + pattern) * @width

  437.     sy = (index / 4 * 4 + (@direction - 2) / 2) * @height

  438.     self.src_rect.set(sx, sy, @width, @height)

  439.   end

  440.   #--------------------------------------------------------------------------

  441.   # ● Motion Control

  442.   #--------------------------------------------------------------------------

  443.   def motion_control

  444.     # Memory Operation Mode

  445.     @moving_mode = @battler.move_mode

  446.     # Battler Drawing

  447.     case @battler

  448.     when Game_Actor # Actor

  449.       actor_motion_control

  450.     when Game_Enemy # Enemy

  451.       enemy_motion_control

  452.     end

  453.   end

  454.   #--------------------------------------------------------------------------

  455.   # ● Motion Control (Actor)

  456.   #--------------------------------------------------------------------------

  457.   def actor_motion_control

  458.     # Operation Change

  459.     case @moving_mode

  460.     when SideView::M_MODE_WAIT  # Standby

  461.       init_direct_attack

  462.       @battler_x_plus = 0

  463.       @direction = 4

  464.       @pattern = 1

  465.     when SideView::M_MODE_MAGI  # Attack

  466.       @battler_x_plus = -10

  467.       @direction = 4

  468.       @pattern = 3

  469.     when SideView::M_MODE_DAMG  # Non-Damage Attack

  470.       @battler_x_plus = 10

  471.       @direction = 4

  472.       @pattern = 3

  473.     when SideView::M_MODE_WIN  # Victory

  474.       @direction = 2

  475.       @pattern = 1

  476.     when SideView::M_MODE_ATK1  # Direct Attack (Approaching)

  477.       exe_moving_attack_start

  478.       @end_pos_x = @battler_x_plus

  479.     when SideView::M_MODE_ATK2  # Direct Attack (Attacking)

  480.       @battler_x_plus = @end_pos_x - 10

  481.     when SideView::M_MODE_ATK3  # Direct Attack (Returning)

  482.       exe_moving_attack_end

  483.     else

  484.       p "error:Sprite_Battler>> @moving_mode"

  485.     end

  486.     draw_character

  487.   end

  488.   #--------------------------------------------------------------------------

  489.   # ● Motion Control (Enemy)

  490.   #--------------------------------------------------------------------------

  491.   def enemy_motion_control

  492.     # Operation Change

  493.     case @moving_mode

  494.     when SideView::M_MODE_WAIT  # Standby

  495.       init_direct_attack

  496.     when SideView::M_MODE_MAGI  # Attack

  497.       @battler_x_plus = 10

  498.     when SideView::M_MODE_DAMG  # Non-Damage Attack

  499.       @battler_x_plus = -10

  500.       @shake_flg = true

  501.     when SideView::M_MODE_ATK1  # Direct Attack (Approaching)

  502.       exe_moving_attack_start

  503.       @end_pos_x = @battler_x_plus

  504.     when SideView::M_MODE_ATK2  # Direct Attack (Attacking)

  505.       @battler_x_plus = @end_pos_x + 10

  506.     when SideView::M_MODE_ATK3  # Direct Attack (Returning)

  507.       exe_moving_attack_end

  508.     else

  509.       p "error:Sprite_Battler>> @moving_mode", @moving_mode

  510.     end

  511.   end

  512.   #--------------------------------------------------------------------------

  513.   # ● Proximity Attack Execution Method

  514.   #--------------------------------------------------------------------------

  515.   def exe_moving_attack_start

  516.     return unless @battler.motion_stop

  517.     case @direct_attack_phase

  518.     when 0  # Start Operation Preparation

  519.       diratk_start

  520.     when 1  # Move Operation (Going)

  521.       diratk_move

  522.     when 2  # After-Movement Wait

  523.       diratk_wait

  524.     end

  525.   end

  526.   def exe_moving_attack_end

  527.     case @direct_attack_phase

  528.     when 0  # Attack Operation

  529.       diratk_attack

  530.     when 1  # Move Operation (Return)

  531.       diratk_back

  532.     when 2  # Operation End

  533.       diratk_end

  534.     end

  535.   end

  536.   #--------------------------------------------------------------------------

  537.   # ● Proximity Attack Execution [Start Operation Preparation]

  538.   #--------------------------------------------------------------------------

  539.   def diratk_start

  540.     # Pose Change

  541.     @pattern = 1

  542.     # The number of frames needed is the distance between current position and

  543.     # target position.

  544.     pos_x = @battler.target_x - self.x

  545.     pos_y = @battler.target_y - self.y

  546.     # Caculation for ammount of frames needed.

  547.     @direct_move_cnt = @direct_attack_cnt = (pos_x.abs / SideView::MOTION_SPEED).round

  548.     # NEXT Phase

  549.     @direct_attack_phase += 1

  550.   end

  551.   #--------------------------------------------------------------------------

  552.   # ● Proximity Attack Execution [Move Operation (Going)]

  553.   #--------------------------------------------------------------------------

  554.   def diratk_move

  555.     case @battler

  556.     when Game_Actor

  557.       x_plus = @width

  558.       y_plus = -@height / 4

  559.     when Game_Enemy

  560.       x_plus = -@width - 10

  561.       y_plus = @height / 4

  562.     end

  563.     # The next movement location is figured out by the distance between

  564.     # current position and target position.

  565.     pos_x = @battler.target_x - self.x + x_plus

  566.     pos_y = @battler.target_y - self.y + y_plus

  567.     @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0

  568.     @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0

  569.     # End count

  570.     @direct_attack_cnt -= 1

  571.     # Last movement (Insurance: Last correction)

  572.     if @direct_attack_cnt <= 0

  573.       @battler_x_plus = @battler.target_x - @battler.screen_x + x_plus

  574.       @battler_y_plus = @battler.target_y - @battler.screen_y + y_plus

  575.       # NEXTフェーズ

  576.       @direct_attack_cnt = 5

  577.       @direct_attack_phase += 1

  578.     end

  579.   end

  580.   #--------------------------------------------------------------------------

  581.   # ● Proximity Attack Execution [Attack Operation Return]

  582.   #--------------------------------------------------------------------------

  583.   def diratk_wait

  584.     # End Count

  585.     @direct_attack_cnt -= 1

  586.     # Last Movement

  587.     if @direct_attack_cnt <= 0

  588.       # Pose Change

  589.       @pattern = 3

  590.       # END Phase

  591.       @direct_attack_phase = 0

  592.       @battler.motion_stop = false

  593.     end

  594.   end

  595.   #--------------------------------------------------------------------------

  596.   # ● Proximity Attack Execution [Attack Operation Return]

  597.   #--------------------------------------------------------------------------

  598.   def diratk_attack

  599.     # Pose Change

  600.     @pattern = 1

  601.     # End Wait Count

  602.     @direct_attack_cnt = @direct_move_cnt

  603.     # NEXT Phase

  604.     @direct_attack_phase += 1

  605.   end

  606.   #--------------------------------------------------------------------------

  607.   # ● Proximity Attack Execution [Move Operation (Return)]

  608.   #--------------------------------------------------------------------------

  609.   def diratk_back

  610.     # The next movement location is figured out by the distance between

  611.     # current position and target position.

  612.     pos_x = @battler.screen_x - self.x

  613.     pos_y = @battler.screen_y - self.y

  614.     @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0

  615.     @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0

  616.     # End Count

  617.     @direct_attack_cnt -= 1

  618.     # Last Movement

  619.     if @direct_attack_cnt == 0

  620.       @battler_x_plus = 0

  621.       @battler_y_plus = 0

  622.       # NEXT Phase

  623.       @direct_attack_phase += 1

  624.     end

  625.   end

  626.   #--------------------------------------------------------------------------

  627.   # ● Proximity attack execution [Operation End]

  628.   #--------------------------------------------------------------------------

  629.   def diratk_end

  630.     init_direct_attack

  631.     @battler.motion_stop = false

  632.     # END Phase

  633.     @direct_attack_phase = 0

  634.   end

  635. end
复制代码

评分

参与人数 2星屑 +180 收起 理由
铃仙·优昙华院·因幡 + 100 认可答案
丿梁丶小柒 + 80 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
191
在线时间
835 小时
注册时间
2012-9-16
帖子
1811
3
 楼主| 发表于 2014-1-24 20:10:34 | 只看该作者
本帖最后由 yangjunyin2002 于 2014-1-24 20:15 编辑
抠脚大妈 发表于 2014-1-24 18:27



等会儿啊!!!!@抠脚大妈 脚本出现如下错误,顺便@protosssonny 帮忙也看下:

另外你哪里拿的脚本,居然还加了个“不谢”=-=

谢谢了啊~不过今天没有糖(私人糖)了...@丿梁丶小柒 我懒得去提问认可贴了,直接处理一下吧,顺便帮我分下类吧谢谢(版规里似乎说LZ不能自己分类为解决=-=) ←-←还是等这个脚本问题解决了再说吧。。。

——旧坑欢迎戳
回复 支持 反对

使用道具 举报

Lv1.梦旅人

狂気の月兔

梦石
0
星屑
231
在线时间
1245 小时
注册时间
2009-4-7
帖子
879

贵宾

4
发表于 2014-1-24 21:10:47 | 只看该作者
咱只能说那个变量没有初始化

点评

脚本盲一只。。。脚本已经在上面了,帮忙解决一下吧。。。  发表于 2014-1-25 08:04
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
11 小时
注册时间
2014-1-24
帖子
17
5
发表于 2014-1-25 10:24:19 | 只看该作者
yangjunyin2002 发表于 2014-1-24 20:10
等会儿啊!!!!@抠脚大妈 脚本出现如下错误,顺便@protosssonny 帮忙也看下:

另外你哪里拿的脚本, ...

这好像是以前瞎逛提问区的时候顺手扒下来的,不知道什么情况啊,再说,有那么多牛B的战斗系统,咱就非得用个简易的横版吗。
额。。

点评

我自己的游戏不是用这个的,我只是要弄个整合,用简易横版战斗。。。  发表于 2014-1-25 12:56
回复 支持 反对

使用道具 举报

Lv1.梦旅人

狂気の月兔

梦石
0
星屑
231
在线时间
1245 小时
注册时间
2009-4-7
帖子
879

贵宾

6
发表于 2014-1-25 12:56:57 | 只看该作者
882 是 “ index = @battler_hue”

看不出会出现这个错误的。

点评

。。。对啊,882行就是这个啊...就算注释了还是保留都会出错。。。QQ上说下吧。。。  发表于 2014-1-25 13:05
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
165
在线时间
16 小时
注册时间
2016-1-6
帖子
14
7
发表于 2016-1-6 23:05:57 | 只看该作者
我用了这段代码提示854行:发生了syntaxerr  

求问这是啥道理?

点评

不知道。。还有这都是两年前的帖子了好吧!  发表于 2016-1-8 19:25

评分

参与人数 1星屑 -200 收起 理由
taroxd -200 版规21

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 18:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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