幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3048|回复: 14

[战斗表示]横向战斗(步行图版)

[复制链接]

218

主题

1万

帖子

10万

积分

⑧专业

赋予你第五自由

积分
108021
发表于 2005-8-3 14:47:38 | 显示全部楼层 |阅读模式
无端转载谢绝.......

示例图


#==============================================================================
# ++ サイドビューバトル(歩行グラフィック版) ver. 1.13 ++
#  Script by パラ犬
#      http://rpg.para.s3p.net/
#  修改,整理,汉化:玄天
# 战斗横版,行走图显示
#==============================================================================

module SDVA
  
  #-----------------------------总括设置--------------------------------------
  X_LINE = 500        # 横位置坐标
  Y_LINE = 200        # 纵位置左边
  X_SPACE = 15        # 横位置间隔
  Y_SPACE = 40        # 纵位置间隔
  X_POSITION = 25     # 隊列[前衛・中衛・後衛]的横間隔
  Y_POSITION = 0      # 隊列[前衛・中衛・後衛]的纵間隔
  
  ATTACK_MOVE = true  # 攻击时是否向前进一步( true / false )
  SKILL_MOVE = true   # 使用技能时是否向前进一步( true / false )
  ITEM_MOVE = false   # 使用物品时是否向前进一步( true / false )
  MOVE_STEP = 3       # 前进的步数
  MOVE_PIXEL = 10     # 每一步的象素数
  
  PARTY_POS = 1       # 初始人物面向( 0:下 / 1:左 / 2:右 / 3:上 )

  WINDOWPOS_CHANGE = true   # 在人物旁边显示指令窗口吗?( true / false )

  end
  #-------------------------下面不用修改-------------------------------------
  

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 战斗画面X坐标取得
  #--------------------------------------------------------------------------
  def screen_x
    if self.index != nil
      # 队列取得
      pos = $data_classes[self.class_id].position
      x_pos = pos * SDVA::X_POSITION
      scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos
      # 移动时候动作
      if self.current_action.move_action == true
        # 横移动
        scr_x += @shift_x
      end
      return scr_x
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # ● 战斗画面Y取得
  #--------------------------------------------------------------------------
  def screen_y
    if self.index != nil
      # 队列取得
      pos = $data_classes[self.class_id].position
      y_pos = pos * SDVA::Y_POSITION
      scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
      # 移动时候动作
      if self.current_action.move_action == true
        # 纵移动
        scr_y += @shift_y
      end
      return scr_y
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # ● 战斗画面Z坐标取得
  #--------------------------------------------------------------------------
  def screen_z
    if self.index != nil
      return self.index
    else
      return 0
    end
  end
end

#==============================================================================
# ■ Game_Battler (分割定義 1)
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # ● 公开变量
  #--------------------------------------------------------------------------
  attr_reader   :pattern        # 步行图
  attr_reader   :trans_x        # X方向移动距离
  attr_reader   :moving         # 移动中标志
  #--------------------------------------------------------------------------
  # ● 全局初期化
  #--------------------------------------------------------------------------
  alias initialize_sdva initialize
  def initialize
    initialize_sdva
    move_reset
  end
  #--------------------------------------------------------------------------
  # ○ 移动数
  #--------------------------------------------------------------------------
  def move
    @moving = 1
      if @step < SDVA::MOVE_STEP
        # 满足移动步数
        @pattern = (@pattern + 1) % 4
        @step += 1
        move_step
      else
        # 移動終了
        @pattern = 1
        @moving = 2
      end
  end
  #--------------------------------------------------------------------------
  # ○ 移动处理
  #--------------------------------------------------------------------------
  def move_step
  # 根据设定的方向改变移动坐标
  case SDVA:ARTY_POS
    when 0
      @shift_y = @step * SDVA::MOVE_PIXEL
    when 1
      @shift_x = -(@step * SDVA::MOVE_PIXEL)
    when 2
      @shift_x = @step * SDVA::MOVE_PIXEL
    when 3
      @shift_y = -(@step * SDVA::MOVE_PIXEL)
    end      
  end
  #--------------------------------------------------------------------------
  # ○ 移动复位
  #--------------------------------------------------------------------------
  def move_reset
    @moving = 0
    @pattern = 0
    @step = 0
    @shift_x = 0
    @shift_y = 0
  end
end

#==============================================================================
# ■ Game_BattleAction
#==============================================================================

class Game_BattleAction
  #--------------------------------------------------------------------------
  # ● 公开变量
  #--------------------------------------------------------------------------
  attr_accessor :move_action             # 移动的动作
  #--------------------------------------------------------------------------
  # ● クリア
  #--------------------------------------------------------------------------
  alias clear_sdva clear
  def clear
    clear_sdva
    @move_action = false
  end
end

#==============================================================================
# ■ Sprite_Battler
#==============================================================================

class Sprite_Battler < RPG::Sprite
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  alias update_sdva update
  def update
    super
    # 战斗角色在的时候
    if @battler.is_a?(Game_Actor)
      # 如果文件名或者角色与现在的不同
      # 行動中の場合
      if @battler.battler_name != @battler_name or
         @battler.battler_hue != @battler_hue or
         @battler.current_action.basic == 0 or
         @battler.current_action.kind != 3
        # 取得位图,设定
        @character_name = @battler.character_name
        @character_hue = @battler.character_hue
        # 描绘步行图
        self.bitmap = RPG::Cache.character(@character_name, @character_hue)
        cw = self.bitmap.width / 4
        ch = self.bitmap.height / 4
        @width = cw
        @height = ch
        if @battler.current_action.move_action == true
          # 使之行动
          @battler.move
        else
          @battler.move_reset
        end
        # 転送元の矩形を設定(机器:设定转送原来的矩形.我理解不能)
        sx = @battler.pattern * cw
        sy = SDVA:ARTY_POS * ch
        self.src_rect.set(sx, sy, cw, ch)
        self.ox = @width / 2
        self.oy = @height
        # 隠れ状態なら不透明度を 0 にする(机器:要是隐藏状态把不透明度做为0)
        # 本人理解不能...
        if @battler.hidden
          self.opacity = 0
        end
      end
    end
    update_sdva
  end
end
  
#==============================================================================
# ■ Scene_Battle             下面我就不翻译了,翻译不了..可恶
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● アクターコマンドウィンドウのセットアップ
  #--------------------------------------------------------------------------
  alias phase3_setup_command_window_sdva phase3_setup_command_window
  def phase3_setup_command_window
    phase3_setup_command_window_sdva
    if SDVA::WINDOWPOS_CHANGE
      # アクターコマンドウィンドウの位置を設定
      case SDVA:ARTY_POS
        when 0
          x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
          y_pos = @active_battler.screen_y
        when 1
          x_pos = @active_battler.screen_x - @actor_command_window.width - 16
          y_pos = @active_battler.screen_y - @actor_command_window.height
        when 2
          x_pos = @active_battler.screen_x + 16
          y_pos = @active_battler.screen_y - @actor_command_window.height
        when 3
          x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
          y_pos = @active_battler.screen_y - @actor_command_window.height - 48
      end
      @actor_command_window.x = x_pos >= 0 ? x_pos : 0
      @actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
      @actor_command_window.y = y_pos >= 0 ? y_pos : 0
      @actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
      # ステータスウインドウに隠れないように
      @actor_command_window.z = 9999
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  #--------------------------------------------------------------------------
  alias update_phase4_step3_sdva update_phase4_step3
  def update_phase4_step3
    if SDVA::ATTACK_MOVE
      if @active_battler.current_action.basic == 0
        @active_battler.current_action.move_action = true
      end
    end
    if SDVA::SKILL_MOVE
      if @active_battler.current_action.kind == 1
        @active_battler.current_action.move_action = true
      end
    end
    if SDVA::ITEM_MOVE
      if @active_battler.current_action.kind == 2
        @active_battler.current_action.move_action = true
      end
    end
    # バトラーがアクターに含まれ、移動アクション中
    if @active_battler.is_a?(Game_Actor) and
     @active_battler.current_action.move_action
      # 移動終了時
      if @active_battler.moving == 2
        update_phase4_step3_sdva
      end
    else
      if @active_battler.moving == 0
        update_phase4_step3_sdva
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  #--------------------------------------------------------------------------
  alias update_phase4_step6_sdva update_phase4_step6
  def update_phase4_step6
    @active_battler.current_action.move_action = false
    @active_battler.move_reset
    update_phase4_step6_sdva
  end
end

#==============================================================================
# ■ Spriteset_Battle
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ● 全局初期化
  #--------------------------------------------------------------------------
  alias initialize_sdva initialize
  def initialize
    initialize_sdva
    @viewport2.z = 1
  end
end

#==============================================================================
# ■ Arrow_Actor
#==============================================================================

class Arrow_Actor < Arrow_Base
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  alias update_sdva update
  def update
    update_sdva
    # 光标下
    if Input.repeat?(Input:OWN)
      $game_system.se_play($data_system.cursor_se)
      @index += 1
      @index %= $game_party.actors.size
    end
    # 光标上
    if Input.repeat?(Input::UP)
      $game_system.se_play($data_system.cursor_se)
      @index += $game_party.actors.size - 1
      @index %= $game_party.actors.size
    end
  end
end

#==============================================================================
# ■ Arrow_Enemy
#==============================================================================

class Arrow_Enemy < Arrow_Base
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  alias update_sdva update
  def update
    update_sdva
    # 光标下
    if Input.repeat?(Input:OWN)
      $game_system.se_play($data_system.cursor_se)
      $game_troop.enemies.size.times do
        @index += 1
        @index %= $game_troop.enemies.size
        break if self.enemy.exist?
      end
    end
    # 光标上
    if Input.repeat?(Input::UP)
      $game_system.se_play($data_system.cursor_se)
      $game_troop.enemies.size.times do
        @index += $game_troop.enemies.size - 1
        @index %= $game_troop.enemies.size
        break if self.enemy.exist?
      end
    end
  end
end


[此贴子已经被作者于2005-8-3 19:51:20编辑过]

第 五 自 由 -   5th  Freedom   -

回复

使用道具 举报

24

主题

96

帖子

1291

积分

⑥精研

死了就只有一只了

积分
1291
发表于 2005-8-3 15:40:04 | 显示全部楼层
不是我说你,你这人很无耻,这种东西有什么不能转的,是你编写的吗?你汉化不是为了给更多人看你汉了干吗,这日本人的站去过好多次了,那几句日文谁看不懂,哦,别人汉化这个就不能转了啊?别人就算转了你又什么依据?如今的年代一金山快意加理解谁翻译不出来?偶会日文过2级的朋友一把抓,真没66厚道
回复 支持 反对

使用道具 举报

218

主题

1万

帖子

10万

积分

⑧专业

赋予你第五自由

积分
108021
 楼主| 发表于 2005-8-3 16:10:47 | 显示全部楼层
并不是任意转载脚本就是厚道.......很多脚本都是禁止<二次配布>的....你觉得我无耻的话,那请无视我吧......

[此贴子已经被作者于2005-8-3 19:53:12编辑过]

第 五 自 由 -   5th  Freedom   -

回复 支持 反对

使用道具 举报

24

主题

96

帖子

1291

积分

⑥精研

死了就只有一只了

积分
1291
发表于 2005-8-3 16:27:02 | 显示全部楼层
你明知道很多脚本都是禁止<二次配布>....还发,连原作者站都不贴,如果这脚本原作者用于商业的话你这么做就是侵权,即使是现在,你也是在很不尊重原作者劳动成果,说话口气也那么,,, 你真那么想玩转载禁止就拿本事自己做点东西出来
回复 支持 反对

使用道具 举报

218

主题

1万

帖子

10万

积分

⑧专业

赋予你第五自由

积分
108021
 楼主| 发表于 2005-8-3 16:35:27 | 显示全部楼层
算了,我也不想搞得那么扫兴....我改了帖子了....谢谢你的提醒....

[此贴子已经被作者于2005-8-3 20:25:04编辑过]

第 五 自 由 -   5th  Freedom   -

回复 支持 反对

使用道具 举报

18

主题

230

帖子

3055

积分

⑥精研

积分
3055
QQ
发表于 2005-8-3 22:18:13 | 显示全部楼层
................
芝麻大的事也能吵起来
[em08]
回复 支持 反对

使用道具 举报

17

主题

96

帖子

1837

积分

⑥精研

积分
1837
QQ
发表于 2005-8-5 01:17:56 | 显示全部楼层
请问一下你那是改编程吗?
  我对XP的横版战斗很感兴趣``自己做怎么也做不出`
回复 支持 反对

使用道具 举报

3

主题

41

帖子

955

积分

⑤进阶

独孤剑

积分
955
发表于 2005-8-5 13:45:46 | 显示全部楼层
有些问题都不要搞的那么火药味十足,感觉气氛都不对了.
回复 支持 反对

使用道具 举报

12

主题

16

帖子

1271

积分

⑥精研

积分
1271
发表于 2005-8-15 22:12:04 | 显示全部楼层
弱弱的问下,这个该怎么用.....是覆盖原有的还是插入在新的地方?
回复 支持 反对

使用道具 举报

27

主题

115

帖子

2245

积分

⑥精研

菜虫

积分
2245
发表于 2005-8-19 15:43:27 | 显示全部楼层
晕~~~能用就行啊,吵啥啊,有什么好吵的啊
真正的RPG玩家只玩游戏机上的RPG... RPG神作酝酿中...
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-24 03:09 , Processed in 0.017506 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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