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

Project1

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

横板战斗脚本写在哪

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-12
帖子
43
跳转到指定楼层
1
发表于 2008-7-14 00:53:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如题
此贴于 2008-7-21 22:46:12 被版主火鸡三毛老大提醒,请楼主看到后对本贴做出回应。
版务信息:本贴由楼主自主结贴~
好久没上

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-12
帖子
43
2
 楼主| 发表于 2008-7-14 00:58:26 | 只看该作者
这个
  1. #==============================================================================
  2. # ■ Game_CommonEvent
  3. #------------------------------------------------------------------------------
  4. #  处理公共事件的类。包含执行并行事件的功能。
  5. # 本类在 Game_Map 类 ($game_map) 的内部使用。
  6. #==============================================================================

  7. class Game_CommonEvent
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化对像
  10.   #     common_event_id : 公共事件 ID
  11.   #--------------------------------------------------------------------------
  12.   def initialize(common_event_id)
  13.     @common_event_id = common_event_id
  14.     @interpreter = nil
  15.     refresh
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 获取名称
  19.   #--------------------------------------------------------------------------
  20.   def name
  21.     return $data_common_events[@common_event_id].name
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 获取触发条件
  25.   #--------------------------------------------------------------------------
  26.   def trigger
  27.     return $data_common_events[@common_event_id].trigger
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 获取触发条件开关ID
  31.   #--------------------------------------------------------------------------
  32.   def switch_id
  33.     return $data_common_events[@common_event_id].switch_id
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 获取执行内容
  37.   #--------------------------------------------------------------------------
  38.   def list
  39.     return $data_common_events[@common_event_id].list
  40.   end
  41.   #--------------------------------------------------------------------------
  42.   # ● 刷新
  43.   #--------------------------------------------------------------------------
  44.   def refresh
  45.     if self.trigger == 2 and $game_switches[self.switch_id] == true
  46.       @interpreter = Game_Interpreter.new if @interpreter == nil
  47.     else
  48.       @interpreter = nil
  49.     end
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # ● 更新画面
  53.   #--------------------------------------------------------------------------
  54.   def update
  55.     if @interpreter != nil                # 并行处理有效的情况下
  56.       unless @interpreter.running?        # 如果不是在执行中就设置
  57.         @interpreter.setup(self.list)
  58.       end
  59.       @interpreter.update                 # 更新解释器
  60.     end
  61.   end
  62. end
复制代码
好久没上
回复 支持 反对

使用道具 举报

Lv1.梦旅人

蚂蚁卡卡

梦石
0
星屑
116
在线时间
66 小时
注册时间
2007-12-16
帖子
3081
3
发表于 2008-7-14 00:59:30 | 只看该作者
写在哪儿?
写在脚本编译器里……
F11
《隋唐乱》完整解密版点击进入
米兰,让我怎么说离开……

曾经我也是一个有志青年,直到我膝盖中了一箭……

《隋唐乱》博客地址
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-12
帖子
43
4
 楼主| 发表于 2008-7-14 01:04:37 | 只看该作者
我就说写在编辑器的哪里
好久没上
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-12
帖子
43
5
 楼主| 发表于 2008-7-14 01:11:54 | 只看该作者
刚才发错了[code][#==============================================================================
# ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh
#------------------------------------------------------------------------------
module Battle_Formation
#------------------------------------------------------------------------------
  FORM = {
    #    [角色1x.y]  [角色2x.y]  [角色3x.y]  [角色4x.y]
    0 => [[380,150], [400, 230], [460, 170], [480, 250]]
  }
#------------------------------------------------------------------------------
end

#==============================================================================
# ■ Game_System
#==============================================================================
class Game_System
  attr_accessor :battle_formation                # Formation ID
  #--------------------------------------------------------------------------
  # ● 对象初始化
  #--------------------------------------------------------------------------
  alias init_game_system initialize
  def initialize
    init_game_system
    @battle_formation = 0              # Initial formation
  end
end

#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● Are sprites used? [Redefinition]
  #--------------------------------------------------------------------------
  def use_sprite?
    return true
  end
  #--------------------------------------------------------------------------
  # ● Battle Screen Acquiring X Coordinate
  #--------------------------------------------------------------------------
  def screen_x
    return Battle_Formation::FORM[$game_system.battle_formation][self.index][0]
  end
  #--------------------------------------------------------------------------
  # ● Battle Screen Acquiring Y Coordinate
  #--------------------------------------------------------------------------
  def screen_y
    return Battle_Formation::FORM[$game_system.battle_formation][self.index][1]
  end
  #--------------------------------------------------------------------------
  # ● Battle Screen Acquiring Z Coordinate
  #--------------------------------------------------------------------------
  def screen_z
    bitmap = Cache.character(self.character_name)
    return screen_y + bitmap.height / 4
  end
end



#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # ● Battle Screen Acquiring Z Coordinate  [Redefinition]
  #--------------------------------------------------------------------------
  def screen_z
    bitmap = Cache.battler(self.battler_name, self.battler_hue)
    return screen_y + bitmap.height
  end
end

#==============================================================================
# ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh
#------------------------------------------------------------------------------
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ●  Battle Start Process
  #--------------------------------------------------------------------------
  alias process_battle_start_sideview process_battle_start
  def process_battle_start
    for battler in $game_party.members + $game_troop.members
      battler.move_mode = SideView::M_MODE_WAIT
    end
    process_battle_start_sideview
  end
  #--------------------------------------------------------------------------
  # ● Victory Process
  #--------------------------------------------------------------------------
  alias process_victory_sideview process_victory
  def process_victory
    for actor in $game_party.members
      actor.move_mode = SideView::M_MODE_WIN
    end
    process_victory_sideview
  end
  #--------------------------------------------------------------------------
  # ● Wait Until Motion Control Is Finished
  #--------------------------------------------------------------------------
  def wait_for_motion
    while @active_battler.motion_stop
      update_basic
    end
  end
  #--------------------------------------------------------------------------
  # ● Execute Combat Operations: Attack [Redefinition]
  #--------------------------------------------------------------------------
  def execute_action_attack
    text = sprintf(Vocab::DoAttack, @active_battler.name)
    @message_window.add_instant_text(text)
    targets = @active_battler.action.make_targets
    #---Enemy attack sound reproduced.
    if @active_battler.is_a?(Game_Enemy)
      Sound.play_enemy_attack
      wait(15, true)
    end
    #--- Proximity (Going)
    SideView.set_target_point(@active_battler, targets[0])
    @active_battler.move_mode = SideView::M_MODE_ATK1
    @active_battler.motion_stop = true
    wait_for_motion
    #--- Attack
    wait(5)
    @active_battler.move_mode = SideView::M_MODE_ATK2
    #---
    display_attack_animation(targets)
    wait(20)
    for target in targets
      target.attack_effect(@active_battler)
      display_action_effects(target)
    end
    #--- Proximity (Return)
    @active_battler.move_mode = SideView::M_MODE_ATK3
    @active_battler.motion_stop = true
    wait_for_motion
    #---Wait
    for target in targets
      target.move_mode = SideView::M_MODE_WAIT
    end
    @active_battler.move_mode = SideView::M_MODE_WAIT
    #---
  end
  #--------------------------------------------------------------------------
  # ● Execute Combat Operations: Skill [Redefinition]
  #--------------------------------------------------------------------------
  def execute_action_skill
    skill = @active_battler.action.skill
    text = @active_battler.name + skill.message1
    @message_window.add_instant_text(text)
    unless skill.message2.empty?
      wait(10)
      @message_window.add_instant_text(skill.message2)
    end
    #--- Enemy attack sound reproduced.
    if @active_battler.is_a?(Game_Enemy)
      Sound.play_enemy_attack
      wait(15, true)
    end
    #--- Long distance attack.
    @active_battler.move_mode = SideView::M_MODE_MAGI
    #---
    targets = @active_battler.action.make_targets
    display_animation(targets, skill.animation_id)
    @active_battler.mp -= @active_battler.calc_mp_cost(skill)
    $game_temp.common_event_id = skill.common_event_id
    for target in targets
      target.skill_effect(@active_battler, skill)
      display_action_effects(target, skill)
    end
    #---Wait
    for target in targets
      target.move_mode = SideView::M_MODE_WAIT
    end
    @active_battler.move_mode = SideView::M_MODE_WAIT
    #---
  end
  #--------------------------------------------------------------------------
  # Execute Combat Operations: Item [Redefinition]
  #--------------------------------------------------------------------------
  def execute_action_item
    item = @active_battler.action.item
    text = sprintf(Vocab::UseItem, @active_battler.name, item.name)
    @message_window.add_instant_text(text)
    #--- Enemy attack sound reproduced.
    if @active_battler.is_a?(Game_Enemy)
      Sound.play_enemy_attack
      wait(15, true)
    end
    #--- Long distance attack
    @active_battler.move_mode = SideView::M_MODE_MAGI
    #---
    targets = @active_battler.action.make_targets
    display_animation(targets, item.animation_id)
    $game_party.consume_item(item)
    $game_temp.common_event_id = item.common_event_id
    for target in targets
      target.item_effect(@active_battler, item)
      display_action_effects(target, item)
    end
    #---Wait
    for target in targets
      target.move_mode = SideView::M_MODE_WAIT
    end
    @active_battler.move_mode = SideView::M_MODE_WAIT
    #---
  end
  #--------------------------------------------------------------------------
  # ● Attack Animation Display [Redefinition]
  #     Targets : Object's Arrangement
  #--------------------------------------------------------------------------
  # 【Changed part】
  #  Enemy sound effect is changed so it can be used in each phase of operation.
  #  It changes so that the attack animation of an enemy can be displayed.
  #--------------------------------------------------------------------------
  def display_attack_animation(targets)
    display_normal_animation(targets, @active_battler.atk_animation_id, false)
    display_normal_animation(targets, @active_battler.atk_animation_id2, true)
    wait_for_animation
  end
  #--------------------------------------------------------------------------
  # ● HP Damage display [Redefinition]
  #    Target : Candidate
  #    object : Skill or item
  #--------------------------------------------------------------------------
  def display_hp_damage(target, obj = nil)
    if target.hp_damage == 0                # No damage
      return if obj != nil and obj.damage_to_mp
      return if obj != nil and obj.base_damage == 0
      fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage
      text = sprintf(fmt, target.name)
    elsif target.absorbed                   # Absorption
      fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
      text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage)
    elsif target.hp_damage > 0              # Damage
      if target.actor?
        text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage)
        Sound.play_actor_damage
        $game_troop.screen.start_shake(5, 5, 10)
        target.blink = true # Only adds here
      else
        text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)
        Sound.play_enemy_damage
        target.blink = true
      end
    else                                    # Recovery
      fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
      text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage)
      Sound.play_recovery
    end
    @message_window.add_instant_text(text)
    wait(30)
  end
end

#==============================================================================
# ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh
#==============================================================================
module SideView
#----------------------------------------------------------------------------
  #-----[操作设定]-----
  # 操作速度
  MOTION_SPEED = 15

  #-----[动画设置]-----
  # 通常敌人攻击动画设定。
  E_ANIME = {
    1 => [1, 0]
  }

#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
  # 行动控制方式
  M_MODE_WAIT = 0     # Standby
  M_MODE_MAGI = 1     # Attack
  M_MODE_DAMG = 2     # Non-Damage Attack
  M_MODE_WIN  = 3     # Victory
  M_MODE_ATK1 = 4     # Direct Attack (Approaching)
  M_MODE_ATK2 = 5     # Direct Attack (Attacking)
  M_MODE_ATK3 = 6     # Direct Attack (Returning)

  module_function
  #--------------------------------------------------------------------------
  # ● Movement-Zone Calculation
  #--------------------------------------------------------------------------
  def set_target_point(attacker, target)
    case target
    when Game_Actor
      bits = Cache.character(target.character_name)
      attacker.target_x = target.screen_x + (bits.width / 8)
      attacker.target_y = target.screen_y
    when Game_Enemy
      bits = Cache.battler(target.battler_name, target.battler_hue)
      attacker.target_x = target.screen_x + (bits.width / 2)
      attacker.target_y = target.screen_y
    end
  end
end

class Game_Battler
  attr_accessor   :move_mode       # Operation Mode
  # 0:Standby   1:Attack   2: Un-useless   3:Victory
  attr_accessor   :motion_stop     # Operation Stop Flag (Under Movement Flag)
  attr_accessor   :target_x        # Move Position(x)
  attr_accessor   :target_y        # Move Position(y)
  #--------------------------------------------------------------------------
  # ● Object Initialization
  #--------------------------------------------------------------------------
  alias initialize_sdva_corpse initialize
  def initialize
    initialize_sdva_corpse
    @move_mode = 0
    @motion_stop = false
    @target_x = 0
    @target_y = 0
  end
end

#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # ● Attack Animation ID Acquisition
  #--------------------------------------------------------------------------
  def atk_animation_id
    return 0 if SideView::E_ANIME[@enemy_id].nil?
    return SideView::E_ANIME[@enemy_id][0]
  end
  #--------------------------------------------------------------------------
  # ● Attack Animation ID Acquisition  (2 Sword Style : 2 Weapons )
  #--------------------------------------------------------------------------
  def atk_animation_id2
    return 0 if SideView::E_ANIME[@enemy_id].nil?
    return SideView::E_ANIME[@enemy_id][1]
  end
end



#==============================================================================
# ■ Sprite_Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
  #--------------------------------------------------------------------------
# ● Object Initialization
#     Viewport : View Port
#     Battler  : Battler (Game_Battler)
  #--------------------------------------------------------------------------
  alias initialize_sideview initialize
  def initialize(viewport, battler = nil)
    initialize_sideview(viewport, battler)
    init_direct_attack
  end
  #--------------------------------------------------------------------------
  # ● Set Proximity Value For Attack
  #--------------------------------------------------------------------------
  def init_direct_attack
    @direct_attack_cnt = 0
    @direct_attack_phase = 0
    @direct_move_cnt = 0
    @battler_x_plus = 0
    @battler_y_plus = 0
    @moving_mode = 0
    @pattern = 0
    @direction = 0
  end
  #--------------------------------------------------------------------------
  # ● Frame Renewal [Redefinition]
  #--------------------------------------------------------------------------
  def update
    super
    if @battler == nil
      self.bitmap = nil
    else
      @use_sprite = @battler.use_sprite?
      if @use_sprite
        self.x = @battler.screen_x + @battler_x_plus
        self.y = @battler.screen_y + @battler_y_plus
        self.z = @battler.screen_z
        update_battler_bitmap
      end
      setup_new_effect
      update_effect
    end
  end
  #--------------------------------------------------------------------------
  # ● Bitmap Transfer Source Renewal
  #--------------------------------------------------------------------------
  alias update_battler_bitmap_sideview update_battler_bitmap
  def update_battler_bitmap
    case @battler
    when Game_Actor
      if @battler.character_name != @battler_name or
         @battler.character_index != @battler_hue
        @battler_name = @battler.character_name
        @battler_hue = @battler.character_index
        draw_pre_character
        draw_character
        if (@battler.dead? or @battler.hidden)
          self.opacity = 0
        end
      end
    when Game_Enemy
      if @battler.battler_name != @battler_name or
         @battler.battler_hue != @battler_hue
        @battler_name = @battler.battler_name
        @battler_hue = @battler.battler_hue
        draw_battler
        if (@battler.dead? or @battler.hidden)
          self.opacity = 0
        end
      end
    end
    motion_control
  end
  #--------------------------------------------------------------------------
  # ● Battler Drawing
  #--------------------------------------------------------------------------
  def draw_battler
    self.bitmap = Cache.battler(@battler_name, @battler_hue)
    @width = bitmap.width
    @height = bitmap.height
    self.ox = @width / 2
    self.oy = @height
  end
  #--------------------------------------------------------------------------
  # ● Pre-Character Drawing [Common]
  #--------------------------------------------------------------------------
  def draw_pre_character
    self.bitmap = Cache.character(@battler_name)
    sign = @battler_name[/^[\!\$]./]
    if sign != nil and sign.include?('$')
      @width = bitmap.width / 3
      @height = bitmap.height / 4
    else
      @width = bitmap.width / 12
      @height = bitmap.height / 8
    end
    self.ox = @width / 2
    self.oy = @height
  end
  #--------------------------------------------------------------------------
  # ● Character Drawing [Common]
  #--------------------------------------------------------------------------
  def draw_character
    index = @battler_hue
    pattern = @pattern < 3 ? @pattern : 1
    sx = (index % 4 * 3 + pattern) * @width
    sy = (index / 4 * 4 + (@direction - 2) / 2) * @height
    self.src_rect.set(sx, sy, @width, @height)
  end
  #--------------------------------------------------------------------------
  # ● Motion Control
  #--------------------------------------------------------------------------
  def motion_control
    # Memory Operation Mode
    @moving_mode = @battler.move_mode
    # Battler Drawing
    case @battler
    when Game_Actor # Actor
      actor_motion_control
    when Game_Enemy # Enemy
      enemy_motion_control
    end
  end
  #--------------------------------------------------------------------------
  # ● Motion Control (Actor)
  #--------------------------------------------------------------------------
  def actor_motion_control
    # Operation Change
    case @moving_mode
    when SideView::M_MODE_WAIT  # Standby
      init_direct_attack
      @battler_x_plus = 0
      @direction = 4
      @pattern = 1
    when SideView::M_MODE_MAGI  # Attack
      @battler_x_plus = -10
      @direction = 4
      @pattern = 3
    when SideView::M_MODE_DAMG  # Non-Damage Attack
      @battler_x_plus = 10
      @direction = 4
      @pattern = 3
    when SideView::M_MODE_WIN  # Victory
      @direction = 2
      @pattern = 1
    when SideView::M_MODE_ATK1  # Direct Attack (Approaching)
      exe_moving_attack_start
      @end_pos_x = @battler_x_plus
    when SideView::M_MODE_ATK2  # Direct Attack (Attacking)
      @battler_x_plus = @end_pos_x - 10
    when SideView::M_MODE_ATK3  # Direct Attack (Returning)
      exe_moving_attack_end
    else
      p "error:Sprite_Battler>> @moving_mode"
    end
    draw_character
  end
  #--------------------------------------------------------------------------
  # ● Motion Control (Enemy)
  #--------------------------------------------------------------------------
  def enemy_motion_control
    # Operation Change
    case @moving_mode
    when SideView::M_MODE_WAIT  # Standby
      init_direct_attack
    when SideView::M_MODE_MAGI  # Attack
      @battler_x_plus = 10
    when SideView::M_MODE_DAMG  # Non-Damage Attack
      @battler_x_plus = -10
      @shake_flg = true
    when SideView::M_MODE_ATK1  # Direct Attack (Approaching)
      exe_moving_attack_start
      @end_pos_x = @battler_x_plus
    when SideView::M_MODE_ATK2  # Direct Attack (Attacking)
      @battler_x_plus = @end_pos_x + 10
    when SideView::M_MODE_ATK3  # Direct Attack (Returning)
      exe_moving_attack_end
    else
      p "error:Sprite_Battler>> @moving_mode", @moving_mode
    end
  end
  #--------------------------------------------------------------------------
  # ● Proximity Attack Execution Method
  #--------------------------------------------------------------------------
  def exe_moving_attack_start
    return unless @battler.motion_stop
    case @direct_attack_phase
    when 0  # Start Operation Preparation
      diratk_start
    when 1  # Move Operation (Going)
      diratk_move
    when 2  # After-Movement Wait
      diratk_wait
    end
  end
  def exe_moving_attack_end
    case @direct_attack_phase
    when 0  # Attack Operation
      diratk_attack
    when 1  # Move Operation (Return)
      diratk_back
    when 2  # Operation End
      diratk_end
    end
  end
  #--------------------------------------------------------------------------
  # ● Proximity Attack Execution [Start Operation Preparation]
  #--------------------------------------------------------------------------
  def diratk_start
    # Pose Change
    @pattern = 1
    # The number of frames needed is the distance between current position and
    # target position.
    pos_x = @battler.target_x - self.x
    pos_y = @battler.target_y - self.y
    # Caculation for ammount of frames needed.
    @direct_move_cnt = @direct_attack_cnt = (pos_x.abs / SideView::MOTION_SPEED).round
    # NEXT Phase
    @direct_attack_phase += 1
  end
  #--------------------------------------------------------------------------
  # ● Proximity Attack Execution [Move Operation (Going)]
  #--------------------------------------------------------------------------
  def diratk_move
    case @battler
    when Game_Actor
      x_plus = @width
      y_plus = -@height / 4
    when Game_Enemy
      x_plus = -@width - 10
      y_plus = @height / 4
    end
    # The next movement location is figured out by the distance between
    # current position and target position.
    pos_x = @battler.target_x - self.x + x_plus
    pos_y = @battler.target_y - self.y + y_plus
    @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0
    @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0
    # End count
    @direct_attack_cnt -= 1
    # Last movement (Insurance: Last correction)
    if @direct_attack_cnt <= 0
      @battler_x_plus = @battler.target_x - @battler.screen_x + x_plus
      @battler_y_plus = @battler.target_y - @battler.screen_y + y_plus
      # NEXTフェーズ
      @direct_attack_cnt = 5
      @direct_attack_phase += 1
    end
  end
  #--------------------------------------------------------------------------
  # ● Proximity Attack Execution [Attack Operation Return]
  #--------------------------------------------------------------------------
  def diratk_wait
    # End Count
    @direct_attack_cnt -= 1
    # Last Movement
    if @direct_attack_cnt <= 0
      # Pose Change
      @pattern = 3
      # END Phase
      @direct_attack_phase = 0
      @battler.motion_stop = false
    end
  end
  #--------------------------------------------------------------------------
  # ● Proximity Attack Execution [Attack Operation Return]
  #--------------------------------------------------------------------------
  def diratk_attack
    # Pose Change
    @pattern = 1
    # End Wait Count
    @direct_attack_cnt = @direct_move_cnt
    # NEXT Phase
    @direct_attack_phase += 1
  end
  #--------------------------------------------------------------------------
  # ● Proximity Attack Execution [Move Operation (Return)]
  #--------------------------------------------------------------------------
  def diratk_back
    # The next movement location is figured out by the distance between
    # current position and target position.
    pos_x = @battler.screen_x - self.x
    pos_y = @battler.screen_y - self.y
    @battler_x_plus += pos_x / @direct_attack_cnt if @direct_attack_cnt != 0
    @battler_y_plus += pos_y / @direct_attack_cnt if @direct_attack_cnt != 0
    # End Count
    @direct_attack_cnt -= 1
    # Last Movement
    if @direct_attack_cnt == 0
      @battler_x_plus = 0
      @battler_y_plus = 0
      # NEXT Phase
      @direct_attack_phase += 1
    end
  end
  #--------------------------------------------------------------------------
  # ● Proximity attack execution [Operation End]
  #--------------------------------------------------------------------------
  def diratk_end
    init_direct_attack
    @battler.motion_stop = false
    # END Phase
    @direct_attack_phase = 0
  end
end/CODE]
好久没上
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-12
帖子
43
6
 楼主| 发表于 2008-7-14 01:12:53 | 只看该作者
  1. #==============================================================================
  2. # ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh
  3. #------------------------------------------------------------------------------
  4. module Battle_Formation
  5. #------------------------------------------------------------------------------
  6.   FORM = {
  7.     #    [角色1x.y]  [角色2x.y]  [角色3x.y]  [角色4x.y]
  8.     0 => [[380,150], [400, 230], [460, 170], [480, 250]]
  9.   }
  10. #------------------------------------------------------------------------------
  11. end

  12. #==============================================================================
  13. # ■ Game_System
  14. #==============================================================================
  15. class Game_System
  16.   attr_accessor :battle_formation                # Formation ID
  17.   #--------------------------------------------------------------------------
  18.   # ● 对象初始化
  19.   #--------------------------------------------------------------------------
  20.   alias init_game_system initialize
  21.   def initialize
  22.     init_game_system
  23.     @battle_formation = 0              # Initial formation
  24.   end
  25. end

  26. #==============================================================================
  27. # ■ Game_Actor
  28. #==============================================================================
  29. class Game_Actor < Game_Battler
  30.   #--------------------------------------------------------------------------
  31.   # ● Are sprites used? [Redefinition]
  32.   #--------------------------------------------------------------------------
  33.   def use_sprite?
  34.     return true
  35.   end
  36.   #--------------------------------------------------------------------------
  37.   # ● Battle Screen Acquiring X Coordinate
  38.   #--------------------------------------------------------------------------
  39.   def screen_x
  40.     return Battle_Formation::FORM[$game_system.battle_formation][self.index][0]
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ● Battle Screen Acquiring Y Coordinate
  44.   #--------------------------------------------------------------------------
  45.   def screen_y
  46.     return Battle_Formation::FORM[$game_system.battle_formation][self.index][1]
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● Battle Screen Acquiring Z Coordinate
  50.   #--------------------------------------------------------------------------
  51.   def screen_z
  52.     bitmap = Cache.character(self.character_name)
  53.     return screen_y + bitmap.height / 4
  54.   end
  55. end



  56. #==============================================================================
  57. # ■ Game_Enemy
  58. #==============================================================================
  59. class Game_Enemy < Game_Battler
  60.   #--------------------------------------------------------------------------
  61.   # ● Battle Screen Acquiring Z Coordinate  [Redefinition]
  62.   #--------------------------------------------------------------------------
  63.   def screen_z
  64.     bitmap = Cache.battler(self.battler_name, self.battler_hue)
  65.     return screen_y + bitmap.height
  66.   end
  67. end

  68. #==============================================================================
  69. # ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh
  70. #------------------------------------------------------------------------------
  71. # ■ Scene_Battle
  72. #==============================================================================
  73. class Scene_Battle < Scene_Base
  74.   #--------------------------------------------------------------------------
  75.   # ●  Battle Start Process
  76.   #--------------------------------------------------------------------------
  77.   alias process_battle_start_sideview process_battle_start
  78.   def process_battle_start
  79.     for battler in $game_party.members + $game_troop.members
  80.       battler.move_mode = SideView::M_MODE_WAIT
  81.     end
  82.     process_battle_start_sideview
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● Victory Process
  86.   #--------------------------------------------------------------------------
  87.   alias process_victory_sideview process_victory
  88.   def process_victory
  89.     for actor in $game_party.members
  90.       actor.move_mode = SideView::M_MODE_WIN
  91.     end
  92.     process_victory_sideview
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● Wait Until Motion Control Is Finished
  96.   #--------------------------------------------------------------------------
  97.   def wait_for_motion
  98.     while @active_battler.motion_stop
  99.       update_basic
  100.     end
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● Execute Combat Operations: Attack [Redefinition]
  104.   #--------------------------------------------------------------------------
  105.   def execute_action_attack
  106.     text = sprintf(Vocab::DoAttack, @active_battler.name)
  107.     @message_window.add_instant_text(text)
  108.     targets = @active_battler.action.make_targets
  109.     #---Enemy attack sound reproduced.
  110.     if @active_battler.is_a?(Game_Enemy)
  111.       Sound.play_enemy_attack
  112.       wait(15, true)
  113.     end
  114.     #--- Proximity (Going)
  115.     SideView.set_target_point(@active_battler, targets[0])
  116.     @active_battler.move_mode = SideView::M_MODE_ATK1
  117.     @active_battler.motion_stop = true
  118.     wait_for_motion
  119.     #--- Attack
  120.     wait(5)
  121.     @active_battler.move_mode = SideView::M_MODE_ATK2
  122.     #---
  123.     display_attack_animation(targets)
  124.     wait(20)
  125.     for target in targets
  126.       target.attack_effect(@active_battler)
  127.       display_action_effects(target)
  128.     end
  129.     #--- Proximity (Return)
  130.     @active_battler.move_mode = SideView::M_MODE_ATK3
  131.     @active_battler.motion_stop = true
  132.     wait_for_motion
  133.     #---Wait
  134.     for target in targets
  135.       target.move_mode = SideView::M_MODE_WAIT
  136.     end
  137.     @active_battler.move_mode = SideView::M_MODE_WAIT
  138.     #---
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● Execute Combat Operations: Skill [Redefinition]
  142.   #--------------------------------------------------------------------------
  143.   def execute_action_skill
  144.     skill = @active_battler.action.skill
  145.     text = @active_battler.name + skill.message1
  146.     @message_window.add_instant_text(text)
  147.     unless skill.message2.empty?
  148.       wait(10)
  149.       @message_window.add_instant_text(skill.message2)
  150.     end
  151.     #--- Enemy attack sound reproduced.
  152.     if @active_battler.is_a?(Game_Enemy)
  153.       Sound.play_enemy_attack
  154.       wait(15, true)
  155.     end
  156.     #--- Long distance attack.
  157.     @active_battler.move_mode = SideView::M_MODE_MAGI
  158.     #---
  159.     targets = @active_battler.action.make_targets
  160.     display_animation(targets, skill.animation_id)
  161.     @active_battler.mp -= @active_battler.calc_mp_cost(skill)
  162.     $game_temp.common_event_id = skill.common_event_id
  163.     for target in targets
  164.       target.skill_effect(@active_battler, skill)
  165.       display_action_effects(target, skill)
  166.     end
  167.     #---Wait
  168.     for target in targets
  169.       target.move_mode = SideView::M_MODE_WAIT
  170.     end
  171.     @active_battler.move_mode = SideView::M_MODE_WAIT
  172.     #---
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # Execute Combat Operations: Item [Redefinition]
  176.   #--------------------------------------------------------------------------
  177.   def execute_action_item
  178.     item = @active_battler.action.item
  179.     text = sprintf(Vocab::UseItem, @active_battler.name, item.name)
  180.     @message_window.add_instant_text(text)
  181.     #--- Enemy attack sound reproduced.
  182.     if @active_battler.is_a?(Game_Enemy)
  183.       Sound.play_enemy_attack
  184.       wait(15, true)
  185.     end
  186.     #--- Long distance attack
  187.     @active_battler.move_mode = SideView::M_MODE_MAGI
  188.     #---
  189.     targets = @active_battler.action.make_targets
  190.     display_animation(targets, item.animation_id)
  191.     $game_party.consume_item(item)
  192.     $game_temp.common_event_id = item.common_event_id
  193.     for target in targets
  194.       target.item_effect(@active_battler, item)
  195.       display_action_effects(target, item)
  196.     end
  197.     #---Wait
  198.     for target in targets
  199.       target.move_mode = SideView::M_MODE_WAIT
  200.     end
  201.     @active_battler.move_mode = SideView::M_MODE_WAIT
  202.     #---
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● Attack Animation Display [Redefinition]
  206.   #     Targets : Object's Arrangement
  207.   #--------------------------------------------------------------------------
  208.   # 【Changed part】
  209.   #  Enemy sound effect is changed so it can be used in each phase of operation.
  210.   #  It changes so that the attack animation of an enemy can be displayed.
  211.   #--------------------------------------------------------------------------
  212.   def display_attack_animation(targets)
  213.     display_normal_animation(targets, @active_battler.atk_animation_id, false)
  214.     display_normal_animation(targets, @active_battler.atk_animation_id2, true)
  215.     wait_for_animation
  216.   end
  217.   #--------------------------------------------------------------------------
  218.   # ● HP Damage display [Redefinition]
  219.   #    Target : Candidate
  220.   #    object : Skill or item
  221.   #--------------------------------------------------------------------------
  222.   def display_hp_damage(target, obj = nil)
  223.     if target.hp_damage == 0                # No damage
  224.       return if obj != nil and obj.damage_to_mp
  225.       return if obj != nil and obj.base_damage == 0
  226.       fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage
  227.       text = sprintf(fmt, target.name)
  228.     elsif target.absorbed                   # Absorption
  229.       fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
  230.       text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage)
  231.     elsif target.hp_damage > 0              # Damage
  232.       if target.actor?
  233.         text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage)
  234.         Sound.play_actor_damage
  235.         $game_troop.screen.start_shake(5, 5, 10)
  236.         target.blink = true # Only adds here
  237.       else
  238.         text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)
  239.         Sound.play_enemy_damage
  240.         target.blink = true
  241.       end
  242.     else                                    # Recovery
  243.       fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
  244.       text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage)
  245.       Sound.play_recovery
  246.     end
  247.     @message_window.add_instant_text(text)
  248.     wait(30)
  249.   end
  250. end

  251. #==============================================================================
  252. # ■ VX-RGSS2 简易横版战斗系统[Ver.1.0.1]       by Claimh
  253. #==============================================================================
  254. module SideView
  255. #----------------------------------------------------------------------------
  256.   #-----[操作设定]-----
  257.   # 操作速度
  258.   MOTION_SPEED = 15

  259.   #-----[动画设置]-----
  260.   # 通常敌人攻击动画设定。
  261.   E_ANIME = {
  262.     1 => [1, 0]
  263.   }

  264. #----------------------------------------------------------------------------
  265. #----------------------------------------------------------------------------
  266.   # 行动控制方式
  267.   M_MODE_WAIT = 0     # Standby
  268.   M_MODE_MAGI = 1     # Attack
  269.   M_MODE_DAMG = 2     # Non-Damage Attack
  270.   M_MODE_WIN  = 3     # Victory
  271.   M_MODE_ATK1 = 4     # Direct Attack (Approaching)
  272.   M_MODE_ATK2 = 5     # Direct Attack (Attacking)
  273.   M_MODE_ATK3 = 6     # Direct Attack (Returning)

  274.   module_function
  275.   #--------------------------------------------------------------------------
  276.   # ● Movement-Zone Calculation
  277.   #--------------------------------------------------------------------------
  278.   def set_target_point(attacker, target)
  279.     case target
  280.     when Game_Actor
  281.       bits = Cache.character(target.character_name)
  282.       attacker.target_x = target.screen_x + (bits.width / 8)
  283.       attacker.target_y = target.screen_y
  284.     when Game_Enemy
  285.       bits = Cache.battler(target.battler_name, target.battler_hue)
  286.       attacker.target_x = target.screen_x + (bits.width / 2)
  287.       attacker.target_y = target.screen_y
  288.     end
  289.   end
  290. end

  291. class Game_Battler
  292.   attr_accessor   :move_mode       # Operation Mode
  293.   # 0:Standby   1:Attack   2: Un-useless   3:Victory
  294.   attr_accessor   :motion_stop     # Operation Stop Flag (Under Movement Flag)
  295.   attr_accessor   :target_x        # Move Position(x)
  296.   attr_accessor   :target_y        # Move Position(y)
  297.   #--------------------------------------------------------------------------
  298.   # ● Object Initialization
  299.   #--------------------------------------------------------------------------
  300.   alias initialize_sdva_corpse initialize
  301.   def initialize
  302.     initialize_sdva_corpse
  303.     @move_mode = 0
  304.     @motion_stop = false
  305.     @target_x = 0
  306.     @target_y = 0
  307.   end
  308. end

  309. #==============================================================================
  310. # ■ Game_Enemy
  311. #==============================================================================
  312. class Game_Enemy < Game_Battler
  313.   #--------------------------------------------------------------------------
  314.   # ● Attack Animation ID Acquisition
  315.   #--------------------------------------------------------------------------
  316.   def atk_animation_id
  317.     return 0 if SideView::E_ANIME[@enemy_id].nil?
  318.     return SideView::E_ANIME[@enemy_id][0]
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # ● Attack Animation ID Acquisition  (2 Sword Style : 2 Weapons )
  322.   #--------------------------------------------------------------------------
  323.   def atk_animation_id2
  324.     return 0 if SideView::E_ANIME[@enemy_id].nil?
  325.     return SideView::E_ANIME[@enemy_id][1]
  326.   end
  327. end



  328. #==============================================================================
  329. # ■ Sprite_Battler
  330. #==============================================================================
  331. class Sprite_Battler < Sprite_Base
  332.   #--------------------------------------------------------------------------
  333. # ● Object Initialization
  334. #     Viewport : View Port
  335. #     Battler  : Battler (Game_Battler)
  336.   #--------------------------------------------------------------------------
  337.   alias initialize_sideview initialize
  338.   def initialize(viewport, battler = nil)
  339.     initialize_sideview(viewport, battler)
  340.     init_direct_attack
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # ● Set Proximity Value For Attack
  344.   #--------------------------------------------------------------------------
  345.   def init_direct_attack
  346.     @direct_attack_cnt = 0
  347.     @direct_attack_phase = 0
  348.     @direct_move_cnt = 0
  349.     @battler_x_plus = 0
  350.     @battler_y_plus = 0
  351.     @moving_mode = 0
  352.     @pattern = 0
  353.     @direction = 0
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # ● Frame Renewal [Redefinition]
  357.   #--------------------------------------------------------------------------
  358.   def update
  359.     super
  360.     if @battler == nil
  361.       self.bitmap = nil
  362.     else
  363.       @use_sprite = @battler.use_sprite?
  364.       if @use_sprite
  365.         self.x = @battler.screen_x + @battler_x_plus
  366.         self.y = @battler.screen_y + @battler_y_plus
  367.         self.z = @battler.screen_z
  368.         update_battler_bitmap
  369.       end
  370.       setup_new_effect
  371.       update_effect
  372.     end
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # ● Bitmap Transfer Source Renewal
  376.   #--------------------------------------------------------------------------
  377.   alias update_battler_bitmap_sideview update_battler_bitmap
  378.   def update_battler_bitmap
  379.     case @battler
  380.     when Game_Actor
  381.       if @battler.character_name != @battler_name or
  382.          @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
复制代码
好久没上
回复 支持 反对

使用道具 举报

Lv1.梦旅人

忘记

梦石
0
星屑
55
在线时间
4 小时
注册时间
2007-12-15
帖子
3062
7
发表于 2008-7-14 01:16:55 | 只看该作者
这个脚本直接插在MAIN之前就好了啦- -|
因为你哭泣的时候有我想你你被人嘲笑时有我陪你在你感觉最无助的那一刻有个声音鼓励
<font color=#8600E9>忘记</font>
回复 支持 反对

使用道具 举报

Lv1.梦旅人

忆颐

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-4-26
帖子
2048
8
发表于 2008-7-14 01:26:53 | 只看该作者
開玩笑= =

打紅匡的就是 腳本編輯器
我已经没有当时刚来6R时的那种激情了啊。
看来6R中的人又变了一轮,让我很陌生。
当时我只是路过,什么都没留下。
因为记得我的人已经不多了吧。
http://hi.baidu.com/fantasylen
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-15
帖子
255
9
发表于 2008-7-14 02:16:26 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3304
在线时间
3619 小时
注册时间
2006-9-6
帖子
37400

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

10
发表于 2008-7-14 02:17:01 | 只看该作者
放在MAIN前面。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-26 20:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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