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

Project1

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

[已经过期] 求一个脚本,米娜桑来帮帮忙吧

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-3-9
帖子
39
跳转到指定楼层
1
发表于 2014-10-19 00:02:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我想在战斗之前加入一个队友选择系统,就是说每次开始战斗之前可以自己选择除主角之外的战斗人员。
我对脚本一窍不通,想请高手帮忙设计一个这样的脚本好哦?
P.S.队伍人数四个,游戏里装了队友仓库和横版战斗系统,队友选择系统最好是可以自己设定在哪些战斗之前可以启动的......难度好像有点大哦,但各位大触还是帮帮忙吧,感激不尽!

点评

最好把队员仓库和横版脚本发上来,以便根据其修改。  发表于 2014-10-19 19:56

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-3-9
帖子
39
2
 楼主| 发表于 2014-10-24 22:21:13 | 只看该作者
本帖最后由 RyanBern 于 2014-10-25 09:36 编辑

RUBY 代码复制
  1. =begin
  2. ###############################################################################
  3.  
  4. 全局行走图战斗 v1.1
  5. 本版本只经低测试,可能存在某些bug。
  6. 请注意更新
  7. [url]http://rpg.blue/viewthread.php?tid=129875&extra=page%3D1[/url]
  8. 1.00  支持敌人行走图战斗
  9.  
  10.    修正与RTAB并用的bug
  11.  
  12. 1.01  与RTAB并用无bug完整版~
  13.  
  14. 1.02  支持敌人远程攻击
  15.  
  16. ###############################################################################
  17. ------------------------------------------------------------------------------
  18. 经过了两次的修改,终于完全实现了远距离攻击的效果(弓箭、铳类)
  19. 另外,也实现了简单的回旋攻击(类似回力镖的攻击)和攻击道具(类似石头或炸弹)
  20.  
  21. 这个脚本的更动分为2部分:
  22. 1)战斗动作 - 新加了数个动作,如:“弓箭攻击”、“远距离发动”等等
  23. 2)战斗动画 - 基本上是脚本原带的。只是这个功能被隐藏起来了。现在已恢复。
  24.  
  25. 用法:
  26. 在相应的脚本行加入武器/技能/道具的数据库id(id之间要用“,”来分开)
  27. 如果不要某些功能的话就随便填一个外太空id就行了(没有用到的id)
  28. 1)战斗动作(角色/行走图的动作)
  29. 脚本355行:  远程武器的id  (普通攻击时使用远程射击)
  30. 脚本357行:  回旋武器的id  (普通攻击时会飞回手上的武器,如:回力镖)
  31. 脚本370行:  远程技能的id  (使用技能时是远程射击)
  32. 脚本372行:  回旋技能的id  (使用技能时,飞出的武器会飞回手上)
  33.  
  34. 2)战斗动画(显示‘对象方的动画’之前先显示‘飞行武器射去敌人身上’的动画)
  35. 脚本453行:  回旋武器的id  (攻击时会显示一段类似回力镖的动画)
  36. 脚本455行:  弓箭武器的id  (攻击时会显示箭射去敌人身上的动画)
  37. 脚本457行:  铳类武器的id  (攻击时会显示子弹射去敌人身上的动画)
  38. 脚本470行:  回旋技能的id  (技能使用时会显示一段类似回力镖的动画)
  39. 脚本472行:  弓箭技能的id  (技能使用时会显示箭射去敌人身上的动画)
  40. 脚本474行:  铳类技能的id  (技能使用时会显示子弹射去敌人身上的动画)
  41. 脚本486行:  抛击道具的id  (使用该道具时,道具被丢到敌人身上)
  42.  
  43. 〉注意:
  44. 〉‘飞行武器射去敌人身上’的动画是在设定id之后的那句脚本里面设置
  45. 〉例子:(脚本第455和456行)
  46. 〉       when 17,18,19,20    #远程武器1(弓箭类)的id
  47. 〉       return [101,32,false,false]
  48. 〉这样,武器17~20(都是弓箭)在显示‘对象方的动画’之前会先显示第101号动画
  49. 〉而动画的轨道是从使用者身上直到敌人身上(实现子弹射出的效果)
  50.  
  51. 还有:
  52. 战斗队伍的画面位置已经被修改过,
  53. 让角色的位置与默认的战斗背景图不会有视觉上的冲突。
  54. 如果要更改请去脚本第113-116行改改就行了。
  55.  
  56. 脚本‘Arrow_Enemy’和‘Arrow_Actor’被稍微修改过(可以无视)
  57.  
  58. 这个范例附带了
  59. 一张经过修改的战斗背景图(027-castle03),其他的战斗背景图可以使用默认的。
  60. 一套横版的默认敌人的战斗图(从行走图改过来的)
  61.  
  62. =end                                                        #modify by darkten
  63.  
  64. ###############################################################################
  65.  
  66. =begin
  67.  
  68. 此版本更新了以下几点:
  69.  1.支持敌人行走图战斗
  70.  2.修正与RTAB并用的bug。
  71.  3.支持敌人也玩小石头
  72.  
  73. 使用方法:
  74.  1.敌人的战斗图名称要与敌人的行走图名称相一致,具体查看本范例编号为2的敌人。
  75.  2.请自行设置 160 ~ 173 行的内容。
  76.  
  77.                                                                   by ONEWateR
  78. =end
  79. ###############################################################################
  80.  
  81. module Side_view
  82.   #--------------------------------------------------------------------------
  83.   # ● 是否与RATB并用 ☆自动识别(这到是不错~省了~)
  84.   #    在Scene_Battle计算方法是否是方法synthe?
  85.   #    在自动不想认识的时候,请重写。
  86.   #--------------------------------------------------------------------------
  87.   if Scene_Battle.method_defined?("synthe?")
  88.     RTAB = true
  89.   else
  90.     RTAB = false
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ● 改正RATB中的位置误差 ☆自动识别
  94.   #    在自动不想认识的时候,请重写。
  95.   #--------------------------------------------------------------------------
  96.   def camera_correctness
  97.     return false if !RTAB
  98.     begin
  99.       return $scene.drive
  100.     rescue
  101.       return false
  102.     end
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # ● 队伍中的最大人数
  106.   #--------------------------------------------------------------------------
  107.   Party_max = 4
  108.   #--------------------------------------------------------------------------
  109.   # ● 战斗图的扩大率(1.0的时候是保持原有大小)
  110.   #--------------------------------------------------------------------------
  111.   CHAR_ZOOM = 1.0
  112.   #--------------------------------------------------------------------------
  113.   # ● 光标的位置修正(基本不需要改~)
  114.   #--------------------------------------------------------------------------
  115.   ARROW_OX = 0
  116.   ARROW_OY = 64
  117.   #--------------------------------------------------------------------------
  118.   # ● 名状态作为飞行管理的排列(不知道什么意思....)
  119.   #--------------------------------------------------------------------------
  120.   FLY_STATES = ["飛行"]
  121.   #--------------------------------------------------------------------------
  122.   # ● 战斗画面的位置
  123.   #--------------------------------------------------------------------------
  124.   PARTY_X = 455     # 队伍 X 位置
  125.   PARTY_Y = 200     # 队伍 Y 位置
  126.   FORMATION_X = 15  # 各个角色之间的间隔 X
  127.   FORMATION_Y = 35  # 各个角色之间的间隔 Y
  128.   #--------------------------------------------------------------------------
  129.   # ● 自定义常数
  130.   #--------------------------------------------------------------------------
  131.   NORMAL   = "NORMAL"
  132.   WALK_R   = "WALK_R"
  133.   WALK_L   = "WALK_L"
  134.   ATTACK   = "ATTACK"
  135.   ATTACK_R = "ATTACK_R"
  136.   ATTACK_L = "ATTACK_L"
  137.   MAGIC    = "MAGIC"
  138.   ITEM     = "ITEM"
  139.   # 动画的设定
  140.   ANIME = {
  141.     # [画像ID,是否循环,アニメスピード,动画速度,不能指向动画,武器放在右手or左手]
  142.     NORMAL            => [1,true , 0,false, true ,""    ], # 通常待击
  143.     WALK_R            => [2,true , 2,false, false,""    ], # 右移动
  144.     WALK_L            => [1,true , 2,false, false,""    ], # 左移动
  145.     ATTACK_R          => [1,false, 2,true , false,"右手"], # 右手攻击
  146.     ATTACK_L          => [1,false, 2,true , false,"左手"], # 左手攻击
  147.     MAGIC             => [1,false, 2,false, false,""    ], # 右手攻击
  148.     ITEM              => [1,false, 2,false, false,""    ], # 左手攻击
  149.     }
  150.  
  151.   # 债务不履行声明价值的设定(一个字一个字翻译的,不知道啥意思)  
  152.   ANIME.default = [1,false,12,false,"",""]
  153.  
  154.   # 在行动设定的时候 右手攻击 or 左手攻击 辨别を(这个不知道什么意思)的ANIME
  155.   # "角色动画变更#ATTACK"在玩了と(还是不知道啥意思..)的时候,辨别ATTACK_R或者ATTACK_L
  156.   DUAL_WEAPONS_ANIME = [ATTACK]
  157.  
  158.  
  159.   #--------------------------------------------------------------------------
  160.   # ● 战斗图不是行走图的敌人编号
  161.   #--------------------------------------------------------------------------
  162.   NOT_CHARACTER_EMEMY = [3]
  163.   #--------------------------------------------------------------------------
  164.   # ● 敌人使用的武器
  165.   #    敌人编号=>武器编号
  166.   #--------------------------------------------------------------------------
  167.   EMEMY_WEAPO = {32=>1,15=>1,19=>1,21=>2,23=>2,25=>3,27=>3,29=>4,32=>30}
  168.   #--------------------------------------------------------------------------
  169.   # ● 敌人使用的武器 (二刀流)
  170.   #    敌人编号=>武器编号
  171.   #--------------------------------------------------------------------------
  172.   EMEMY_WEAPO2 = {}
  173.  
  174.  
  175.   #--------------------------------------------------------------------------
  176.   # ● 摇晃的设定
  177.   #--------------------------------------------------------------------------
  178.   SHAKE_FILE = "摇晃"  # 文件名
  179.   SHAKE_POWER = 5          # 强度
  180.   SHAKE_SPEED = 5          # 速度
  181.   SHAKE_DURATION = 5      # 时间
  182.   #--------------------------------------------------------------------------
  183.   # ● 上下反转地的设定
  184.   #--------------------------------------------------------------------------
  185.   UPSIDE_DOWN_FILE = "上下反转" # 文件名
  186.   #--------------------------------------------------------------------------
  187.   # ● 左右反转地的设定
  188.   #--------------------------------------------------------------------------
  189.   REVERSE_FILE = "左右反转" # 文件名
  190.   #--------------------------------------------------------------------------
  191.   # ● 回转地的设定
  192.   #--------------------------------------------------------------------------
  193.   TURNING_FILE = "回转" # 文件名
  194.   TURNING_DIRECTION = 1 # 方向(1.逆时针,-1.顺时针)(|||-_-汗..怎么还有用-1做带入值的...)
  195.   TURNING_SPEED = 40    # 速度
  196.   TURNING_DURATION = 1  # 回转数
  197.   #--------------------------------------------------------------------------
  198.   # ● 移动的设定
  199.   #--------------------------------------------------------------------------
  200.   MOVE_FILE = "移动"             # 文件名
  201.   MOVE_RETURN = 1                # 回到原来的位置吗?(光写了个1,也不知道不回到该怎么写?0?)
  202.   MOVE_SPEED = 32                # 速度
  203.   MOVE_COORDINATES = [0,-640]    # 原来位置的相对坐标
  204.   #--------------------------------------------------------------------------
  205.   # ● 动画追加的设定
  206.   #--------------------------------------------------------------------------
  207.   ADD_ANIME_FILE = "动画追加"  # 文件名
  208.   ADD_ANIME_ID = 0               # 动画的ID
  209.   #--------------------------------------------------------------------------
  210.   # ● 债务不履行声明和RTAB的数据转换
  211.   #--------------------------------------------------------------------------
  212.   def convert_battler
  213.     return RTAB ? @active_actor : @active_battler
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ● 债务不履行声明和RTAB的数据转换2
  217.   #--------------------------------------------------------------------------
  218.   def convert_battler2(*arg)
  219.     return RTAB ? arg[0] : @active_battler
  220.   end
  221. end
  222.  
  223. #--------------------------------------------------------------------------
  224. # ● 行动設定
  225. #--------------------------------------------------------------------------
  226. module BattleActions
  227.  
  228.   # 下のものはあくまでも一例なので
  229.   # 独自に作ってください。
  230.  
  231.   Actions = {
  232.  
  233.   "通常攻撃" => [
  234.  
  235.   "閃きアニメ",
  236.   "アクターアニメ変更#WALK_L",
  237.   "移動#target,32,0,64,0",
  238.   "行動アニメ",
  239.   "アクターアニメ変更#ATTACK",
  240.   "遠距離アニメ",
  241.   "対象アニメ",
  242.   "アクターアニメ変更#WALK_L",
  243.   "SEの演奏#016-Jump02,80,100",
  244.   "移動#self,0,0,48,32",
  245.   "終了"
  246.   ],
  247.  
  248.   "エネミー攻撃" => [
  249.  
  250.   "閃きアニメ",
  251.   "アクターアニメ変更#WALK_L",
  252.   "移動#self,-36,0,12,0",
  253.   "行動アニメ",
  254.   "アクターアニメ変更#ATTACK",
  255.   "遠距離アニメ",
  256.   "対象アニメ",
  257.   "アクターアニメ変更#WALK_L",
  258.   "移動#self,0,0,12,0",
  259.   "終了"
  260.   ],
  261.  
  262.   "術発動" => [
  263.  
  264.   "閃きアニメ",
  265.   "アクターアニメ変更#WALK_L",
  266.   "移動#self,-32,0,4,0",
  267.   "アクターアニメ変更#MAGIC",
  268.   "行動アニメ",
  269.   "ウエイト#15",
  270.   "遠距離アニメ",
  271.   "対象アニメ",
  272.   "アクターアニメ変更#WALK_L",
  273.   "移動#self,0,0,4,2",
  274.   "終了"
  275.   ],
  276.  
  277.   "アイテム使用" => [
  278.  
  279.   "閃きアニメ",
  280.   "アクターアニメ変更#WALK_L",
  281.   "移動#self,-32,0,4,0",
  282.   "行動アニメ",
  283.   "アクターアニメ変更#ITEM",
  284.   "ウエイト#15",
  285.   "遠距離アニメ",
  286.   "対象アニメ",
  287.   "アクターアニメ変更#WALK_L",
  288.   "移動#self,0,0,4,2",
  289.   "終了"
  290.   ],
  291.  
  292.   "払い抜け" => [
  293.  
  294.   "閃きアニメ",
  295.   "アクターアニメ変更#WALK_L",
  296.   "移動#target_near,50,0,48,30",  
  297.   "左右反転",
  298.   "アクターアニメ固定#ATTACK#3",
  299.   "行動アニメ",
  300.   "SEの演奏#135-Light01,100,100",
  301.   "アニメーションの表示#self,42",
  302.   "ウエイト#15",
  303.   "左右反転",
  304.   "残像表示",
  305.   "移動#target_far,-50,0,48,0",
  306.   "対象アニメ",
  307.   "残像消去",
  308.   "アニメ固定解除",
  309.   "アクターアニメ変更#WALK_L",
  310.   "移動#self,0,0,48,1,0",
  311.   "終了"
  312.   ],
  313.  
  314.   "弓箭攻撃" => [
  315.  
  316.   "閃きアニメ",
  317.   "アクターアニメ変更#WALK_L",
  318.   "移動#self,-32,0,4,0",
  319.   "行動アニメ",
  320.   "アクターアニメ変更#ATTACK",
  321.   "遠距離アニメ",
  322.   "対象アニメ",
  323.   "アクターアニメ変更#WALK_L",
  324.   "移動#self,0,0,4,2",
  325.   "終了"
  326.   ],
  327.  
  328.   "回旋攻撃" => [
  329.  
  330.   "閃きアニメ",
  331.   "アクターアニメ変更#WALK_L",
  332.   "移動#self,-32,0,4,0",
  333.   "行動アニメ",
  334.   "アクターアニメ変更#STAND_L",  
  335.   "遠距離アニメ",
  336.   "対象アニメ",
  337.   "アクターアニメ変更#WALK_L",
  338.   "移動#self,0,0,4,2",
  339.   "終了"
  340.   ],
  341.  
  342.   "远距离発動" => [
  343.  
  344.   "閃きアニメ",
  345.   "アクターアニメ変更#WALK_L",
  346.   "移動#self,-32,0,4,0",
  347.   "アクターアニメ変更#MAGIC",
  348.   "行動アニメ",
  349.   "アクターアニメ変更#ATTACK",
  350.   "遠距離アニメ",
  351.   "対象アニメ",
  352.   "アクターアニメ変更#WALK_L",
  353.   "移動#self,0,0,4,2",
  354.   "終了"
  355.   ],
  356.  
  357.   "回旋発動" => [
  358.  
  359.   "閃きアニメ",
  360.   "アクターアニメ変更#WALK_L",
  361.   "移動#self,-32,0,4,0",
  362.   "アクターアニメ変更#MAGIC",
  363.   "行動アニメ",
  364.   "アクターアニメ変更#STAND_L",  
  365.   "遠距離アニメ",
  366.   "対象アニメ",
  367.   "アクターアニメ変更#WALK_L",
  368.   "移動#self,0,0,4,2",
  369.   "終了"
  370.   ],
  371.  
  372.   } # ここで終わり 消さないでください
  373.  
  374. end
  375.  
  376. module RPG
  377.   class Weapon
  378.     #--------------------------------------------------------------------------
  379.     # ● アクション設定
  380.     #--------------------------------------------------------------------------
  381.     def battle_actions
  382.       case @id
  383.       when 17,18,19,20,21,22,23,24  # 远程武器的id回旋攻撃
  384.         return BattleActions::Actions["弓箭攻撃"]
  385.       when 34                       # 回旋武器的id
  386.         return BattleActions::Actions["回旋攻撃"]
  387.       end
  388.       else
  389.       return BattleActions::Actions["通常攻撃"]
  390.     end
  391.   end
  392.   class Skill
  393.     #--------------------------------------------------------------------------
  394.     # ● アクション設定
  395.     #--------------------------------------------------------------------------
  396.     def battle_actions
  397.       case @id
  398.       when 73,74,75,76,77,78,79,80  # 远程技能的id
  399.         return BattleActions::Actions["远距离発動"]
  400.       when 82                       # 回旋技能的id
  401.         return BattleActions::Actions["回旋発動"]
  402.       end
  403.       else
  404.       if self.magic?
  405.         return BattleActions::Actions["術発動"]
  406.       else
  407.         return BattleActions::Actions["払い抜け"]
  408.       end
  409.     end
  410.   end
  411.   class Item
  412.     #--------------------------------------------------------------------------
  413.     # ● アクション設定
  414.     #--------------------------------------------------------------------------
  415.     def battle_actions
  416.       return BattleActions::Actions["アイテム使用"]
  417.     end
  418.   end
  419. end
  420. #class Game_Enemy < Game_Battler
  421.   #--------------------------------------------------------------------------
  422.   # ● アクション設定
  423.   #--------------------------------------------------------------------------
  424. #~  def battle_actions
  425. #~    return BattleActions::Actions["エネミー攻撃"]
  426. #~  end
  427. #end
  428. =begin
  429. #--------------------------------------------------------------------------
  430. # ● 遠距離アニメーション
  431. #--------------------------------------------------------------------------
  432.  ☆ 説明
  433.  
  434.    行動者から対象者にアニメを飛ばします。
  435.    飛ばすアニメを データベース‐アニメーション で作ります。
  436.     [アニメーションID, スピード, 往復するか?,直線(false)or曲線(true)] で指定します。
  437.  
  438.  
  439.   ● カスタマイズ方法
  440.     
  441.     case @id
  442.     when 17,18,19,20
  443.       return [101,32,false,false]
  444.     when 21,22,23,24
  445.       return [102,32,false,false]
  446.     end
  447.     return 0
  448.     
  449.     のように描くとID別に指定可能です。
  450.     
  451.     
  452.   ● アニメーションID
  453.  
  454.   飛ばすアニメーションIDです。短い場合は繰り返しで表示されます。
  455.  
  456.     
  457.   ● スピード
  458.  
  459.   大きいほうが早い(0だとアニメは移動しません)
  460.  
  461.   1 = 1フレームで1ドット進むと考えてください。
  462.  
  463.   ● 往復するか?
  464.  
  465.   true とした場合、ブーメランのようにアニメが戻ります。
  466.  
  467.   ● 直線(false)or曲線(true)
  468.  
  469.   true  = 対象に向かって曲線で、アニメが飛びます。(修正の余地ありですが・・・)
  470.   false = 対象に向かって直線で、アニメが飛びます。
  471.     
  472. =end
  473. module RPG
  474.   class Weapon
  475.     #--------------------------------------------------------------------------
  476.     # ● 遠距離アニメーション
  477.     #--------------------------------------------------------------------------
  478.     def flying_anime
  479.       # ID 指定 の例(武器的id,分类是根据飞行武器的动画id)
  480.       case @id
  481.       when 34             #回旋武器(类似回力镖)的id
  482.         return [103,32,true,true]
  483.       when 17,18,19,20    #远程武器1(弓箭类)的id
  484.         return [101,32,false,false]
  485.       when 21,22,23,24    #远程武器2(铳类)的id
  486.         return [102,32,false,false]
  487.       end
  488.       return [0,0,false,false]
  489.     end
  490.   end
  491.   class Skill
  492.     #--------------------------------------------------------------------------
  493.     # ● 遠距離アニメーション
  494.     #--------------------------------------------------------------------------
  495.     def flying_anime
  496.       # ID 指定 の例(技能的id,分类是根据飞行武器的动画id)
  497.       case @id
  498.       when 82             #回旋技能(类似回力镖)的id
  499.         return [103,32,true,true]
  500.       when 73,74,75,76    #远程技能1(弓箭类)的id
  501.         return [101,32,false,false]
  502.       when 77,78,79,80    #远程技能2(铳类)的id
  503.         return [102,32,false,false]
  504.       end
  505.       return [0,0,false,false]
  506.     end
  507.   end
  508.   class Item
  509.     #--------------------------------------------------------------------------
  510.     # ● 遠距離アニメーション
  511.     #--------------------------------------------------------------------------
  512.     def flying_anime
  513.       case @id
  514.       when 34    #抛击类道具(如炸弹一类)的id
  515.         return [104,32,false,true]
  516.       end
  517.       return [0,0,false,false]
  518.     end
  519.   end
  520. end
  521.  
  522. #class Game_Enemy < Game_Battler
  523.   #--------------------------------------------------------------------------
  524.   # ● 遠距離アニメーション
  525.   #--------------------------------------------------------------------------
  526. #~  def flying_anime
  527. #~    return [0,0,false,false]
  528. #~  end
  529. #end
  530.  
  531.  
  532.  
  533. #==============================================================================
  534. # ■ Game_Battler
  535. #==============================================================================
  536. class Game_Battler
  537.   include Side_view
  538.   #--------------------------------------------------------------------------
  539.   # ● 追加・公開インスタンス変数
  540.   #--------------------------------------------------------------------------
  541.   attr_accessor :height                  # 画像の高さ
  542.   attr_accessor :real_x                  # X座標補正
  543.   attr_accessor :real_y                  # Y座標補正
  544.   attr_accessor :real_zoom               # 拡大率
  545.   attr_accessor :wait_count              # アニメーション 待ち時間
  546.   attr_accessor :wait_count2             # アニメーション 待ち時間2
  547.   attr_accessor :pattern                 # アニメーション カウント(キャラ)
  548.   attr_accessor :shake                   # シェイク開始フラッグ
  549.   attr_accessor :reverse                 # 左右反転フラッグ
  550.   attr_accessor :shadow                  # 残像フラッグ
  551.   attr_accessor :flash_flag              # 閃きフラッグ
  552.   attr_reader   :ox                      # X座標補正
  553.   attr_reader   :oy                      # Y座標補正
  554.   attr_reader   :flying_x                # 遠距離アニメX座標
  555.   attr_reader   :flying_y                # 遠距離アニメY座標
  556.   attr_reader   :flying_anime            # 遠距離アニメ
  557.   attr_reader   :animation1_on           # 行動アニメ開始フラッグ
  558.   attr_reader   :animation2_on           # 対象アニメ開始フラッグ
  559.   #--------------------------------------------------------------------------
  560.   # ● デフォルトのアニメーション待ち時間を取得
  561.   #--------------------------------------------------------------------------
  562.   def animation_duration=(animation_duration)
  563.     @_animation_duration = animation_duration
  564.   end
  565.   #--------------------------------------------------------------------------
  566.   # ● バトル開始時のセットアップ
  567.   #--------------------------------------------------------------------------
  568.   def start_battle
  569.     [url=home.php?mod=space&uid=291977]@height[/url] = 0
  570.     @real_x = 0
  571.     @real_y = 0
  572.     @real_zoom = 1.0
  573.     @battler_condition = ""
  574.     @action = nil
  575.     @battle_actions = []
  576.     @battler_action = false
  577.     [url=home.php?mod=space&uid=2129346]@step[/url] = 0
  578.     @anime_on = false
  579.     @wait_count = 0
  580.     @wait_count2 = 0
  581.     @ox = 0
  582.     @oy = 0
  583.     @pattern = 0
  584.     @pattern_log = true
  585.     @pattern_freeze = false
  586.     @condition_freeze = false
  587.     @active = false
  588.     @move_distance = nil
  589.     @move_wait = 0
  590.     @move_coordinates = [0,0,0,0]
  591.     @flying_distance = nil
  592.     @flying_wait = 0
  593.     @flying_x = 0
  594.     @flying_y = 0
  595.     @flash_flag = {}
  596.     self.flying_clear
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # ● 移動中判定
  600.   #--------------------------------------------------------------------------
  601.   def moving?
  602.     # X座標補正または、Y座標補正が0でなければ、移動中
  603.     return (@ox != 0 or @oy != 0)
  604.   end
  605.   #--------------------------------------------------------------------------
  606.   # ● 移動終了判定
  607.   #--------------------------------------------------------------------------
  608.   def move_end?
  609.     return (@ox == @move_coordinates[0] and @oy == @move_coordinates[1])
  610.   end
  611.   #--------------------------------------------------------------------------
  612.   # ● アクション開始設定
  613.   #--------------------------------------------------------------------------
  614.   def action(flag = true)
  615.     @battler_action = flag
  616.     @animation1_on = false
  617.     @animation2_on = false
  618.     [url=home.php?mod=space&uid=2129346]@step[/url] = "setup"
  619.   end   
  620.   #--------------------------------------------------------------------------
  621.   # ● アクション中判定
  622.   #--------------------------------------------------------------------------
  623.   def action?
  624.     return @battler_action
  625.   end
  626.   #--------------------------------------------------------------------------
  627.   # ● 閃き判定
  628.   #--------------------------------------------------------------------------
  629.   def flash?
  630.     return @flash_flg
  631.   end
  632.   #--------------------------------------------------------------------------
  633.   # ● 戦闘不能判定
  634.   #--------------------------------------------------------------------------
  635.   def anime_dead?
  636.     if $game_temp.in_battle and !RTAB
  637.       if [2,3,4,5].include?($scene.phase4_step)
  638.         return @last_dead
  639.       end
  640.     end
  641.     return @last_dead = self.dead?
  642.   end
  643.   #--------------------------------------------------------------------------
  644.   # ● ピンチ状態判定
  645.   #--------------------------------------------------------------------------
  646.   def crisis?
  647.     if $game_temp.in_battle and !RTAB
  648.       if [2,3,4,5].include?($scene.phase4_step)
  649.         return @last_crisis
  650.       end
  651.     end
  652.     return @last_crisis = (self.hp <= self.maxhp / 4 or badstate?)
  653.   end
  654.   #--------------------------------------------------------------------------
  655.   # ● バッドステート判定
  656.   #--------------------------------------------------------------------------
  657.   def badstate?
  658.     for i in @states
  659.       unless $data_states[i].nonresistance
  660.         return true
  661.       end
  662.     end
  663.     return false
  664.   end
  665.   #--------------------------------------------------------------------------
  666.   # ● 飛行
  667.   #--------------------------------------------------------------------------
  668.   def fly
  669.     if [url=home.php?mod=space&uid=14121]@fly[/url] != nil
  670.       return @fly
  671.     end
  672.     for id in @states
  673.       if FLY_STATES.include?($data_states[id].name)
  674.         return 60
  675.       end
  676.     end
  677.     return 0
  678.   end
  679.   #--------------------------------------------------------------------------
  680.   # ● 遠距離アニメ目標座標の計算
  681.   #--------------------------------------------------------------------------
  682.   def flying_setup
  683.     # 二度目は実行しない
  684.     return if @flying_distance != nil && !camera_correctness
  685.     if RTAB
  686.       targets = @target
  687.     else
  688.       targets = $scene.target_battlers
  689.     end
  690.     # 目的座標を計算
  691.     @f_target_x = 0
  692.     @f_target_y = 0
  693.     for t in targets
  694.       @f_target_x += t.screen_x
  695.       @f_target_y += t.screen_y
  696.     end
  697.     if targets != []
  698.       @f_target_x /= targets.size
  699.       @f_target_y /= targets.size
  700.     else
  701.       @flying_distance = 0
  702.       return
  703.     end
  704.     # 距離の計算
  705.     @flying_distance = (self.screen_x - @f_target_x).abs + (self.screen_y - @f_target_y).abs
  706.   end
  707.   #--------------------------------------------------------------------------
  708.   # ● 遠距離アニメ
  709.   #--------------------------------------------------------------------------
  710.   def flying_animation
  711.     # 戻る
  712.     if @step != "flying" or @flying_distance.nil?
  713.       return [false,true]
  714.     end
  715.     # あらかじめ計算
  716.     self_x = self.screen_x
  717.     self_y = self.screen_y
  718.     @flying_distance = @flying_distance == 0 ? 1 : @flying_distance
  719.     n1 = @flying_wait / @flying_distance.to_f
  720.     if @flying_distance - @flying_wait > @flying_distance / 2
  721.       n2 = 1.0 + 10.0 * @flying_wait / @flying_distance.to_f
  722.     else
  723.       n2 = 1.0 + 10.0 * (@flying_distance - @flying_wait) / @flying_distance.to_f
  724.     end
  725.     if !@flying_anime[4]
  726.       # 直線移動
  727.       x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  728.       y = (self_y + 1.0 * (@f_target_y - self_y) * n1).to_i
  729.     else
  730.       # 曲線移動
  731.       if !@flying_proceed_end
  732.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  733.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 - n2**2).to_i
  734.       else
  735.         x = (self_x + 1.0 * (@f_target_x - self_x) * n1).to_i
  736.         y = (self_y + 1.0 * (@f_target_y - self_y) * n1 + n2**2).to_i
  737.       end
  738.     end
  739.     # 座標代入
  740.     @flying_x = x
  741.     @flying_y = y
  742.     # ウエイト
  743.     if !@flying_proceed_end
  744.       # 開始
  745.       @flying_proceed_start = @flying_wait == 0
  746.       @flying_wait += @flying_anime[1]
  747.       @flying_wait = [@flying_wait,@flying_distance].min
  748.       @flying_proceed_end = @flying_wait == @flying_distance
  749.     else
  750.       # 開始
  751.       @flying_return_start = @flying_wait == @flying_distance
  752.       @flying_wait -= @flying_anime[1]
  753.       @flying_wait = [@flying_wait,0].max
  754.       @flying_return_end = @flying_wait == 0
  755.     end
  756.     if @flying_anime[1] == 0
  757.       @flying_end = true
  758.     elsif !@flying_anime[2]
  759.       @flying_end = @flying_proceed_end
  760.     else
  761.       @flying_end = @flying_return_end
  762.     end
  763.     # 値を返す(アニメ開始,アニメ終了)
  764.     return [@flying_proceed_start,@flying_end]
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # ● 遠距離アニメ初期化
  768.   #--------------------------------------------------------------------------
  769.   def flying_clear
  770.     @flying_proceed_start = false
  771.     @flying_proceed_end = false
  772.     @flying_return_start = false
  773.     @flying_return_end = false
  774.     @flying_end = false
  775.     @flying_anime = [0,0,false]
  776.   end
  777.   #--------------------------------------------------------------------------
  778.   # ● 移動
  779.   #--------------------------------------------------------------------------
  780.   def move
  781.     # 距離の計算
  782.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  783.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  784.     if @move_distance > 0
  785.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  786.       array = @move_coordinates
  787.       # ジャンプ補正値の計算
  788.       if @move_distance - @move_wait > @move_distance / 2
  789.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  790.       else
  791.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  792.       end
  793.       jump = @move_action[4] > 0 ? -jump : jump
  794.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  795.  
  796.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  797.       # ウエイト
  798.       @move_wait -= @move_action[3]
  799.       @move_wait = [@move_wait,0].max
  800.     end
  801.   end
  802.   #--------------------------------------------------------------------------
  803.   # ● 移動アクションの取得
  804.   #--------------------------------------------------------------------------
  805.   def get_move_action
  806.     string = @action.split(/#/)[1]
  807.     string = string.split(/,/)
  808.     @move_action = [string[0],string[1].to_i,string[2].to_i,string[3].to_i,string[4].to_i,string[5].to_i]
  809.   end
  810.   #--------------------------------------------------------------------------
  811.   # ● アクションの取得
  812.   #--------------------------------------------------------------------------
  813.   def get_step
  814.     if @action.nil?
  815.       @step = "finish"
  816.       return
  817.     end
  818.     string = @action.split(/#/)[0]
  819.     if string =~ "移動"
  820.       @step = "moving_setup"
  821.     elsif string =~ "アクターアニメ実行"
  822.       @step = "action"
  823.     elsif string =~ "遠距離アニメ"
  824.       @step = "flying"
  825.     elsif string =~ "アクターアニメ変更"
  826.       @step = "change"
  827.     elsif string =~ "行動アニメ"
  828.       @step = "animation1"
  829.     elsif string =~ "対象アニメ"
  830.       @step = "animation2"
  831.     elsif string =~ "ウエイト"
  832.       @step = "wait"
  833.     elsif string =~ "左右反転"
  834.       @step = "reverse"
  835.     elsif string =~ "閃きアニメ"
  836.       @step = "flash"
  837.     elsif string =~ "残像表示"
  838.       @step = "shadow_on"
  839.     elsif string =~ "残像消去"
  840.       @step = "shadow_off"
  841.     elsif string =~ "アクターアニメ固定"
  842.       @step = "freeze"
  843.     elsif string =~ "アニメ固定解除"
  844.       @step = "freeze_lifting"
  845.     elsif string =~ "アニメーションの表示"
  846.       @step = "animation_start"
  847.     elsif string =~ "SEの演奏"
  848.       @step = "play_se"
  849.     else
  850.       @step = "finish"
  851.     end
  852.   end
  853.   #--------------------------------------------------------------------------
  854.   # ● フレーム更新 (次のアクションへ)
  855.   #--------------------------------------------------------------------------
  856.   def update_next
  857.     @action = @battle_actions.shift
  858.     @step = get_step
  859.   end
  860.   #--------------------------------------------------------------------------
  861.   # ● フレーム更新 (動作取得)
  862.   #--------------------------------------------------------------------------
  863.   def update_setup
  864.     # アクションの取得
  865.     self.get_actions
  866.     @action = @battle_actions.shift
  867.     @step = get_step
  868.   end
  869.   #--------------------------------------------------------------------------
  870.   # ● フレーム更新 (移動取得)
  871.   #--------------------------------------------------------------------------
  872.   def update_moving_setup
  873.     # 移動アクションの取得
  874.     self.get_move_action
  875.     # 移動目標の設定
  876.     self.move_setup
  877.     @step = "moving"
  878.   end
  879.   #--------------------------------------------------------------------------
  880.   # ● フレーム更新 (移動)
  881.   #--------------------------------------------------------------------------
  882.   def update_moving
  883.     # 移動
  884.     self.move
  885.     self.condition = @battler_condition
  886.     # 移動完了したら次のステップへ
  887.     if move_end?
  888.       @wait_count = 2
  889.       @action = @battle_actions.shift
  890.       @step = get_step
  891.     end
  892.   end
  893.   #--------------------------------------------------------------------------
  894.   # ● フレーム更新 (アニメ実行)
  895.   #--------------------------------------------------------------------------
  896.   def update_action
  897.     con = @action.split(/#/)[1]
  898.     # 右手・左手を分ける
  899.     if DUAL_WEAPONS_ANIME.include?(con)
  900.       if !@first_weapon and @second_weapon
  901.         con = con + "_L"
  902.       else
  903.         con = con + "_R"
  904.       end
  905.     end
  906.     # アニメ変更
  907.     self.condition = con
  908.     # ループか否か
  909.     if !ANIME[@battler_condition][1]
  910.       self.anime_on
  911.     end
  912.     @action = @battle_actions.shift
  913.     @step = get_step
  914.   end
  915.   #--------------------------------------------------------------------------
  916.   # ● フレーム更新 (遠距離アニメ)
  917.   #--------------------------------------------------------------------------
  918.   def update_flying
  919.     # 目標の設定
  920.     self.flying_setup
  921.     # 遠距離アニメ終了
  922.     if @flying_end
  923.       self.flying_clear
  924.       @action = @battle_actions.shift
  925.       @step = get_step
  926.     end
  927.   end
  928.   #--------------------------------------------------------------------------
  929.   # ● フレーム更新 (アニメ変更)
  930.   #--------------------------------------------------------------------------
  931.   def update_change
  932.     con = @action.split(/#/)[1]
  933.     # 右手・左手を分ける
  934.     if DUAL_WEAPONS_ANIME.include?(con)
  935.       if !@first_weapon and @second_weapon
  936.         con = con + "_L"
  937.       else
  938.         con = con + "_R"
  939.       end
  940.     end
  941.     # アニメ変更
  942.     self.condition = con
  943.     # ループか否か
  944.     if !ANIME[@battler_condition][1]
  945.       self.anime_on
  946.     end
  947.     @action = @battle_actions.shift
  948.     @step = get_step
  949.   end
  950.   #--------------------------------------------------------------------------
  951.   # ● フレーム更新 (行動アニメ)
  952.   #--------------------------------------------------------------------------
  953.   def update_animation1
  954.     @animation1_on = true
  955.     # 行動アニメの後に行動を開始する
  956.     if $scene.phase4_step == 3
  957.       id = RTAB ? @anime1 : $scene.animation1_id
  958.       animation = $data_animations[id]
  959.       frame_max = animation != nil ? animation.frame_max : 0
  960.       @wait_count2 = frame_max * 2
  961.       return
  962.     end
  963.     @action = @battle_actions.shift
  964.     @step = get_step
  965.   end
  966.   #--------------------------------------------------------------------------
  967.   # ● フレーム更新 (対象アニメ)
  968.   #--------------------------------------------------------------------------
  969.   def update_animation2
  970.     @animation2_on = true
  971.     # 行動アニメの後に行動を開始する
  972.     if $scene.phase4_step == 4
  973.       id = RTAB ? @anime2 : $scene.animation2_id
  974.       animation = $data_animations[id]
  975.       frame_max = animation != nil ? animation.frame_max : 0
  976.       @wait_count2 = frame_max * 2
  977.       return
  978.     end
  979.     @action = @battle_actions.shift
  980.     @step = get_step
  981.   end
  982.   #--------------------------------------------------------------------------
  983.   # ● フレーム更新 (ウエイト)
  984.   #--------------------------------------------------------------------------
  985.   def update_wait
  986.     @wait_count2 = @action.split(/#/)[1].to_i
  987.     @action = @battle_actions.shift
  988.     @step = get_step
  989.   end
  990.   #--------------------------------------------------------------------------
  991.   # ● フレーム更新 (残像表示)
  992.   #--------------------------------------------------------------------------
  993.   def update_shadow_on
  994.     [url=home.php?mod=space&uid=31758]@Shadow[/url] = true
  995.     @action = @battle_actions.shift
  996.     @step = get_step
  997.   end
  998.   #--------------------------------------------------------------------------
  999.   # ● フレーム更新 (残像消去)
  1000.   #--------------------------------------------------------------------------
  1001.   def update_shadow_off
  1002.     [url=home.php?mod=space&uid=31758]@Shadow[/url] = false
  1003.     @action = @battle_actions.shift
  1004.     @step = get_step
  1005.   end
  1006.   #--------------------------------------------------------------------------
  1007.   # ● フレーム更新 (左右反転)
  1008.   #--------------------------------------------------------------------------
  1009.   def update_reverse
  1010.     [url=home.php?mod=space&uid=30269]@reverse[/url] = [url=home.php?mod=space&uid=30269]@reverse[/url] ? false : true
  1011.     @action = @battle_actions.shift
  1012.     @step = get_step
  1013.   end
  1014.   #--------------------------------------------------------------------------
  1015.   # ● フレーム更新 (閃きアニメ)
  1016.   #--------------------------------------------------------------------------
  1017.   def update_flash
  1018.     # 閃きアニメの後に行動を開始する
  1019.     if @flash_flag["normal"]
  1020.       @wait_count = $scene.flash_duration
  1021.       @flash_flag["normal"] = false
  1022.       return
  1023.     end
  1024.     @action = @battle_actions.shift
  1025.     @step = get_step
  1026.   end
  1027.   #--------------------------------------------------------------------------
  1028.   # ● フレーム更新 (SEの演奏)
  1029.   #--------------------------------------------------------------------------
  1030.   def update_play_se
  1031.     data = @action.split(/#/)[1]
  1032.     data = data.split(/,/)
  1033.     # SE を演奏
  1034.     Audio.se_play("Audio/SE/" + data[0], data[1].to_i, data[2].to_i)
  1035.     @action = @battle_actions.shift
  1036.     @step = get_step
  1037.   end
  1038.   #--------------------------------------------------------------------------
  1039.   # ● フレーム更新 (アクターアニメ固定)
  1040.   #--------------------------------------------------------------------------
  1041.   def update_freeze
  1042.     con = @action.split(/#/)[1]
  1043.     # 右手・左手を分ける
  1044.     if DUAL_WEAPONS_ANIME.include?(con)
  1045.       if !@first_weapon and @second_weapon
  1046.         con = con + "_L"
  1047.       else
  1048.         con = con + "_R"
  1049.       end
  1050.     end
  1051.     # アニメ変更
  1052.     self.condition = con
  1053.     @pattern = @action.split(/#/)[2].to_i
  1054.     @pattern_freeze = true
  1055.     @condition_freeze = true
  1056.     @action = @battle_actions.shift
  1057.     @step = get_step
  1058.   end
  1059.   #--------------------------------------------------------------------------
  1060.   # ● フレーム更新 (アクターアニメ固定解除)
  1061.   #--------------------------------------------------------------------------
  1062.   def update_freeze_lifting
  1063.     @pattern_freeze = false
  1064.     @condition_freeze = false
  1065.     @action = @battle_actions.shift
  1066.     @step = get_step
  1067.   end
  1068.   #--------------------------------------------------------------------------
  1069.   # ● フレーム更新 (アニメーションの表示)
  1070.   #--------------------------------------------------------------------------
  1071.   def update_animation_start
  1072.     data = @action.split(/#/)[1]
  1073.     data = data.split(/,/)
  1074.     target = data[0]
  1075.     animation_id = data[1].to_i
  1076.     if RTAB
  1077.       case target
  1078.       when "self"
  1079.         @animation.push([animation_id,true])
  1080.       when "target"
  1081.         for tar in @target
  1082.           tar.animation.push([animation_id, true])
  1083.         end
  1084.       end
  1085.     else
  1086.       case target
  1087.       when "self"
  1088.         @animation_id = animation_id
  1089.         @animation_hit = true
  1090.       when "target"
  1091.         for tar in $scene.target_battlers
  1092.           tar.animation_id = animation_id
  1093.           tar.animation_hit = true
  1094.         end
  1095.       end
  1096.     end
  1097.     @action = @battle_actions.shift
  1098.     @step = get_step
  1099.   end
  1100.   #--------------------------------------------------------------------------
  1101.   # ● フレーム更新 (動作終了)
  1102.   #--------------------------------------------------------------------------
  1103.   def update_finish
  1104.     # 動作終了
  1105.     @battler_action = false
  1106.     @step = "setup"
  1107.   end
  1108.   #--------------------------------------------------------------------------
  1109.   # ● バトラーの状態 変更(バトラーグラフィックのタイプ)
  1110.   #--------------------------------------------------------------------------
  1111.   def condition=(condition)
  1112.     return if @condition_freeze
  1113.     @battler_condition = condition
  1114.     @wait_count = ANIME[condition][2]
  1115.   end
  1116.   #--------------------------------------------------------------------------
  1117.   # ● バトラーの状態(バトラーグラフィックのタイプ)
  1118.   #--------------------------------------------------------------------------
  1119.   def condition
  1120.     return @battler_condition
  1121.   end
  1122.   #--------------------------------------------------------------------------
  1123.   # ● フレーム更新
  1124.   #--------------------------------------------------------------------------
  1125.   def update
  1126.     # ウェイト中の場合
  1127.     if @wait_count > 0
  1128.       return
  1129.     end
  1130.     # パターン更新
  1131.     self.char_animation
  1132.     # ウェイト中の場合
  1133.     if @wait_count2 > 0
  1134.       return
  1135.     end
  1136.  
  1137.     # 行動アニメーション
  1138.     if @battler_action
  1139.       method("update_" + @step).call
  1140.       return
  1141.     end
  1142.  
  1143.     # データ初期化
  1144.     @animation1_on = false
  1145.     @animation2_on = false
  1146.     @action = nil
  1147.     @battle_actions = []
  1148.     @move_wait = 0
  1149.     @move_distance = nil
  1150.     @flying_wait = 0
  1151.     @flying_distance = nil
  1152.     [url=home.php?mod=space&uid=14082]@Flash[/url] = false
  1153.  
  1154.     # RTAB対応
  1155.     # 通常・待機
  1156.     return self.condition = NORMAL
  1157.   end
  1158.   #--------------------------------------------------------------------------
  1159.   # ● アクションの取得
  1160.   #--------------------------------------------------------------------------
  1161.   def get_actions
  1162.     skill = $data_skills[self.current_action.skill_id]
  1163.     item = $data_items[self.current_action.item_id]
  1164.     kind = self.current_action.kind
  1165.     # 動作取得
  1166.     @battle_actions = []
  1167.     # スキル
  1168.     if skill != nil && kind == 1
  1169.       @battle_actions = skill.battle_actions.dup
  1170.       @flying_anime = skill.flying_anime
  1171.     # アイテム
  1172.     elsif item != nil && kind == 2
  1173.       @battle_actions = item.battle_actions.dup
  1174.       @flying_anime = item.flying_anime
  1175.     # 左手攻撃
  1176.     elsif !@first_weapon and @second_weapon and (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce))
  1177.  
  1178.       @battle_actions = self.battle_actions2.dup
  1179.       @flying_anime = self.flying_anime2
  1180.     # 右手攻撃
  1181.     elsif self.current_action.basic == 0 and
  1182.       (self.is_a?(Game_Actor) or (!self.is_a?(Game_Actor) and !self.nce)) and self.current_action.kind == 0
  1183.       @battle_actions = self.battle_actions1.dup
  1184.       @flying_anime = self.flying_anime1
  1185.     # 通常攻撃
  1186.     elsif self.current_action.basic == 0 and self.current_action.kind == 0
  1187.       # 这里啊~~ =。=b
  1188.       if !self.is_a?(Game_Actor) and !self.nce
  1189.         @battle_actions = self.battle_actions1.dup
  1190.       else
  1191.         @battle_actions = BattleActions::Actions["エネミー攻撃"].dup
  1192.       end
  1193.       @flying_anime = self.flying_anime
  1194.     else
  1195.       @battle_actions = ["終了"]
  1196.       @flying_anime = [0,0,false,false]
  1197.     end
  1198.   end
  1199.   #--------------------------------------------------------------------------
  1200.   # ● ループしないアニメのセット
  1201.   #--------------------------------------------------------------------------
  1202.   def anime_on
  1203.     @pattern = 0
  1204.     @pattern_log = true
  1205.     return
  1206.   end
  1207.   #--------------------------------------------------------------------------
  1208.   # ● パターン更新
  1209.   #--------------------------------------------------------------------------
  1210.   def char_animation
  1211.     # パタン固定の場合もどる
  1212.     return if @pattern_freeze
  1213.     # ループしないアニメの場合 1234 で止まる
  1214.     if !ANIME[@battler_condition][1] && @pattern == 3
  1215.       return
  1216.     end
  1217.     # アニメさせない場合 1 で止まる
  1218.     if ANIME[@battler_condition][4]
  1219.       @pattern = 0
  1220.       return
  1221.     end
  1222.     @pattern = (@pattern + 1) % 4
  1223.   end
  1224.   #--------------------------------------------------------------------------
  1225.   # ● アニメタイプ
  1226.   #--------------------------------------------------------------------------
  1227.   def anime_type
  1228.     return ANIME[self.condition] != nil ? ANIME[self.condition][0] : 0
  1229.   end
  1230. end
  1231. #==============================================================================
  1232. # ■ Game_Actor
  1233. #==============================================================================
  1234. class Game_Actor < Game_Battler
  1235.   include Side_view
  1236.   #--------------------------------------------------------------------------
  1237.   # ● セットアップ
  1238.   #--------------------------------------------------------------------------
  1239.   alias side_view_setup setup
  1240.   def setup(actor_id)
  1241.     side_view_setup(actor_id)
  1242.     start_battle
  1243.   end
  1244.   #--------------------------------------------------------------------------
  1245.   # ● 二刀武器のID取得 ※エラー回避用
  1246.   #--------------------------------------------------------------------------
  1247.   def weapon2_id
  1248.     return @weapon2_id != nil ? @weapon2_id : 0
  1249.   end
  1250.   #--------------------------------------------------------------------------
  1251.   # ● X方向 ポジション 取得 (陣形スクリプト拡張用)
  1252.   #--------------------------------------------------------------------------
  1253.   def position
  1254.     return $data_classes[@class_id].position
  1255.   end
  1256.   #--------------------------------------------------------------------------
  1257.   # ● Y方向 ポジション 取得 (陣形スクリプト拡張用)
  1258.   #--------------------------------------------------------------------------
  1259.   def position2
  1260.     return self.index
  1261.   end
  1262.   #--------------------------------------------------------------------------
  1263.   # ● 武器アニメタイプ
  1264.   #--------------------------------------------------------------------------
  1265.   def weapon_anime_type(type)
  1266.     file_name  = weapon_anime_type0(type)
  1267.     visible   = weapon_anime_type1(type)
  1268.     z         = weapon_anime_type2(type)
  1269.     return [file_name,visible,z]
  1270.   end
  1271.   # 武器アイコン取得
  1272.   def weapon_anime_type0(type)
  1273.     type = ANIME[type][5]
  1274.     return weapon_anime1 if type == "右手"
  1275.     return weapon_anime2 if type == "左手"
  1276.     return nil
  1277.   end
  1278.   # 表示・非表示の取得
  1279.   def weapon_anime_type1(type)
  1280.     return ANIME[type][3]
  1281.   end
  1282.   # バトラーより上に表示するかどうか
  1283.   def weapon_anime_type2(type)
  1284.     type = ANIME[type][5]
  1285.     return true if type == "左手"
  1286.     return false
  1287.   end
  1288.   #--------------------------------------------------------------------------
  1289.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1290.   #--------------------------------------------------------------------------
  1291.   def true_x
  1292.     return PARTY_X + position * FORMATION_X + @ox
  1293.   end
  1294.   #--------------------------------------------------------------------------
  1295.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1296.   #--------------------------------------------------------------------------
  1297.   def true_y
  1298.     # パーティ内の並び順から Y 座標を計算して返す
  1299.     if self.index != nil
  1300.       y = position2 * FORMATION_Y + PARTY_Y + @oy - [url=home.php?mod=space&uid=291977]@height[/url] / 2
  1301.       return y
  1302.     else
  1303.       return 0
  1304.     end
  1305.   end
  1306.   #--------------------------------------------------------------------------
  1307.   # ● バトル画面 X 座標の取得
  1308.   #--------------------------------------------------------------------------
  1309.   def screen_x(true_x = self.true_x)
  1310.     return 320 + (true_x - 320) * @real_zoom + @real_x
  1311.   end
  1312.   #--------------------------------------------------------------------------
  1313.   # ● バトル画面 Y 座標の取得
  1314.   #--------------------------------------------------------------------------
  1315.   def screen_y(true_y = self.true_y)
  1316.     return true_y * @real_zoom + @real_y
  1317.   end
  1318.   #--------------------------------------------------------------------------
  1319.   # ● バトル画面 Z 座標の取得
  1320.   #--------------------------------------------------------------------------
  1321.   def screen_z
  1322.     return screen_y + 1000
  1323.   end
  1324.   #--------------------------------------------------------------------------
  1325.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1326.   #--------------------------------------------------------------------------
  1327.   def base_x
  1328.     return 320 + (true_x - @ox - 320) * @real_zoom + @real_x
  1329.   end
  1330.   #--------------------------------------------------------------------------
  1331.   # ● バトル画面 Y 座標の取得
  1332.   #--------------------------------------------------------------------------
  1333.   def base_y
  1334.     return (true_y - @oy) * @real_zoom + @real_y
  1335.   end
  1336.   #--------------------------------------------------------------------------
  1337.   # ● バトル画面 拡大率の取得
  1338.   #--------------------------------------------------------------------------
  1339.   def zoom
  1340.     return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) *
  1341.                           (true_x + @fly) / 480 + $scene.zoom_rate[0]
  1342.   end
  1343.   #--------------------------------------------------------------------------
  1344.   # ● 攻撃用、バトル画面 X 座標の取得
  1345.   #--------------------------------------------------------------------------
  1346.   def attack_x(z)
  1347.     return (320 - true_x) * z * 0.75
  1348.   end
  1349.   #--------------------------------------------------------------------------
  1350.   # ● 攻撃用、バトル画面 Y 座標の取得
  1351.   #--------------------------------------------------------------------------
  1352.   def attack_y(z)
  1353.     return (160 - (true_y + fly / 4) * z + @height * zoom * z / 2) * 0.75
  1354.   end
  1355.   #--------------------------------------------------------------------------
  1356.   # ● 閃き待ち時間
  1357.   #--------------------------------------------------------------------------
  1358.   def flash_duration
  1359.     return $scene.flash_duration
  1360.   end
  1361.   #--------------------------------------------------------------------------
  1362.   # ● アニメーション取得
  1363.   #--------------------------------------------------------------------------
  1364.   def battle_actions1
  1365.     weapon = $data_weapons[@weapon_id]
  1366.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1367.   end
  1368.   #--------------------------------------------------------------------------
  1369.   # ● アニメーション取得
  1370.   #--------------------------------------------------------------------------
  1371.   def battle_actions2
  1372.     weapon = $data_weapons[@weapon2_id]
  1373.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1374.   end
  1375.   #--------------------------------------------------------------------------
  1376.   # ● 武器アニメーション取得
  1377.   #--------------------------------------------------------------------------
  1378.   def weapon_anime1
  1379.     weapon = $data_weapons[@weapon_id]
  1380.     return weapon != nil ? weapon.icon_name : ""
  1381.   end
  1382.   #--------------------------------------------------------------------------
  1383.   # ● 武器アニメーション取得
  1384.   #--------------------------------------------------------------------------
  1385.   def weapon_anime2
  1386.     weapon = $data_weapons[@weapon2_id]
  1387.     return weapon != nil ? weapon.icon_name : ""
  1388.   end
  1389.   #--------------------------------------------------------------------------
  1390.   # ● 遠距離アニメーション取得
  1391.   #--------------------------------------------------------------------------
  1392.   def flying_anime1
  1393.     weapon = $data_weapons[@weapon_id]
  1394.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1395.   end
  1396.   #--------------------------------------------------------------------------
  1397.   # ● 遠距離アニメーション取得
  1398.   #--------------------------------------------------------------------------
  1399.   def flying_anime2
  1400.     weapon = $data_weapons[@weapon2_id]
  1401.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1402.   end
  1403.   #--------------------------------------------------------------------------
  1404.   # ● 移動目標座標の計算
  1405.   #--------------------------------------------------------------------------
  1406.   def move_setup
  1407.     if RTAB
  1408.       targets = @target
  1409.     else
  1410.       targets = $scene.target_battlers
  1411.     end
  1412.     case @move_action[0]
  1413.     when "self" # 自分
  1414.       @target_x = self.base_x
  1415.       @target_y = self.base_y
  1416.     when "target_near" # 一番近くのターゲット
  1417.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1418.       targets.reverse!
  1419.       if targets != []
  1420.         @target_x = targets[0].screen_x
  1421.         @target_y = targets[0].screen_y
  1422.       else
  1423.         @target_x = self.base_x
  1424.         @target_y = self.base_y
  1425.       end
  1426.     when "target_far" # 一番遠くのターゲット
  1427.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1428.       if targets != []
  1429.         @target_x = targets[0].screen_x
  1430.         @target_y = targets[0].screen_y
  1431.       else
  1432.         @target_x = self.base_x
  1433.         @target_y = self.base_y
  1434.       end
  1435.     when "target" # ターゲット中央
  1436.       @target_x = 0
  1437.       @target_y = 0
  1438.       for t in targets
  1439.         @target_x += t.screen_x
  1440.         @target_y += t.screen_y
  1441.       end
  1442.       if targets != []
  1443.         @target_x /= targets.size
  1444.         @target_y /= targets.size
  1445.       end
  1446.     when "troop" # "トループ中央"
  1447.       @target_x = 0
  1448.       @target_y = 0
  1449.       for t in $game_troop.enemies
  1450.         @target_x += t.screen_x
  1451.         @target_y += t.screen_y
  1452.       end
  1453.       if $game_troop.enemies != []
  1454.         @target_x /= $game_troop.enemies.size
  1455.         @target_y /= $game_troop.enemies.size
  1456.       end
  1457.     when "party" # "パーティ中央"
  1458.       @target_x = 0
  1459.       @target_y = 0
  1460.       for t in $game_party.actors
  1461.         @target_x += t.screen_x
  1462.         @target_y += t.screen_y
  1463.       end
  1464.       if $game_party.actors != []
  1465.         @target_x /= $game_party.actors.size
  1466.         @target_y /= $game_party.actors.size
  1467.       end
  1468.     when "screen" # "画面"
  1469.       @target_x = self.base_x
  1470.       @target_y = self.base_y
  1471.     end
  1472.     # 補正
  1473.     @target_x += @move_action[1] - self.base_x
  1474.     @target_y += @move_action[2] - self.base_y
  1475.     # 移動目標の座標をセット
  1476.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1477.     # 距離の計算(ウエイトの設定)
  1478.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1479.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1480.   end
  1481. end
  1482. #==============================================================================
  1483. # ■ Game_Enemy
  1484. #==============================================================================
  1485. class Game_Enemy < Game_Battler
  1486.   attr_reader   :nce
  1487.   #--------------------------------------------------------------------------
  1488.   # ● セットアップ
  1489.   #--------------------------------------------------------------------------
  1490.   alias side_view_initialize initialize
  1491.   def initialize(troop_id, member_index)
  1492.     side_view_initialize(troop_id, member_index)
  1493.     start_battle
  1494.     @nce = NOT_CHARACTER_EMEMY.include? @enemy_id
  1495.     @weapon_id  = EMEMY_WEAPO[@enemy_id] != nil ? EMEMY_WEAPO[@enemy_id] : 0
  1496.     @weapon_id2  = EMEMY_WEAPO2[@enemy_id] != nil ? EMEMY_WEAPO2[@enemy_id] : 0
  1497.   end
  1498.   def character_name
  1499.     return self.battler_name
  1500.   end
  1501.   def character_hue
  1502.     return self.battler_hue
  1503.   end
  1504.   #--------------------------------------------------------------------------
  1505.   # ● 移動
  1506.   #--------------------------------------------------------------------------
  1507.   def move
  1508.     # 距離の計算
  1509.     @move_distance = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1510.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1511.     if @move_distance > 0
  1512.       return if @ox == @move_coordinates[0] and @oy == @move_coordinates[1]
  1513.       array = @move_coordinates
  1514.       # ジャンプ補正値の計算
  1515.       if @move_distance - @move_wait > @move_distance / 2
  1516.         jump = (@move_action[4] * @move_wait / @move_distance.to_f)**2        
  1517.       else
  1518.         jump = (@move_action[4] * (@move_distance - @move_wait) / @move_distance.to_f)**2
  1519.       end
  1520.       jump = @move_action[4] > 0 ? -jump : jump
  1521.       jump = 0 if @weapon_id + @weapon_id2 == 0
  1522.       @ox = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @move_wait) / @move_distance.to_f).to_i
  1523.       @oy = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @move_wait) / @move_distance.to_f + jump).to_i
  1524.       # ウエイト
  1525.       @move_wait -= @move_action[3]
  1526.       @move_wait = [@move_wait,0].max
  1527.     end
  1528.   end
  1529.   #--------------------------------------------------------------------------
  1530.   # ● 武器アニメタイプ
  1531.   #--------------------------------------------------------------------------
  1532.   def weapon_anime_type(type)
  1533.     file_name  = weapon_anime_type0(type)
  1534.     visible   = weapon_anime_type1(type)
  1535.     z         = weapon_anime_type2(type)
  1536.     return [file_name,visible,z]
  1537.   end
  1538.   # 武器アイコン取得
  1539.   def weapon_anime_type0(type)
  1540.     type = ANIME[type][5]
  1541.     return weapon_anime1 if type == "右手"
  1542.     return weapon_anime2 if type == "左手"
  1543.     return nil
  1544.   end
  1545.   # 表示・非表示の取得
  1546.   def weapon_anime_type1(type)
  1547.     return ANIME[type][3]
  1548.   end
  1549.   # バトラーより上に表示するかどうか
  1550.   def weapon_anime_type2(type)
  1551.     type = ANIME[type][5]
  1552.     return true if type == "左手"
  1553.     return false
  1554.   end
  1555.  
  1556.   #--------------------------------------------------------------------------
  1557.   # ● 移動目標座標の計算
  1558.   #--------------------------------------------------------------------------
  1559.   def move_setup
  1560.     if RTAB
  1561.       targets = @target
  1562.     else
  1563.       targets = $scene.target_battlers
  1564.     end
  1565.     case @move_action[0]
  1566.     when "self" # 自分
  1567.       @target_x = self.base_x
  1568.       @target_y = self.base_y
  1569.     when "target_near" # 一番近くのターゲット
  1570.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1571.       if targets != []
  1572.         @target_x = targets[0].screen_x
  1573.         @target_y = targets[0].screen_y
  1574.       else
  1575.         @target_x = self.base_x
  1576.         @target_y = self.base_y
  1577.       end
  1578.     when "target_far" # 一番遠くのターゲット
  1579.       targets.sort!{|a,b| a.screen_x<=>b.screen_x }
  1580.       targets.reverse!
  1581.       if targets != []
  1582.         @target_x = targets[0].screen_x
  1583.         @target_y = targets[0].screen_y
  1584.       else
  1585.         @target_x = self.base_x
  1586.         @target_y = self.base_y
  1587.       end
  1588.     when "target" # ターゲット中央
  1589.       @target_x = 0
  1590.       @target_y = 0
  1591.       for t in targets
  1592.         @target_x += t.screen_x
  1593.         @target_y += t.screen_y
  1594.       end
  1595.       if targets != []
  1596.         @target_x /= targets.size
  1597.         @target_y /= targets.size
  1598.       end
  1599.     when  "party" # "トループ中央"
  1600.       @target_x = 0
  1601.       @target_y = 0
  1602.       for t in $game_troop.enemies
  1603.         @target_x += t.screen_x
  1604.         @target_y += t.screen_y
  1605.       end
  1606.       if $game_troop.enemies != []
  1607.         @target_x /= $game_troop.enemies.size
  1608.         @target_y /= $game_troop.enemies.size
  1609.       end
  1610.     when "troop" # "パーティ中央"
  1611.       @target_x = 0
  1612.       @target_y = 0
  1613.       for t in $game_party.actors
  1614.         @target_x += t.screen_x
  1615.         @target_y += t.screen_y
  1616.       end
  1617.       if $game_party.actors != []
  1618.         @target_x /= $game_party.actors.size
  1619.         @target_y /= $game_party.actors.size
  1620.       end
  1621.     when "screen" # "画面"
  1622.       @target_x = self.base_x
  1623.       @target_y = self.base_y
  1624.     end
  1625.     # 補正
  1626.     @target_x -= @move_action[1] + self.base_x
  1627.     @target_y -= @move_action[2] + self.base_y
  1628.     # 移動目標の座標をセット
  1629.     @move_coordinates = [@target_x.to_i,@target_y.to_i,@move_coordinates[0],@move_coordinates[1]]
  1630.     # 距離の計算(ウエイトの設定)
  1631.     @move_wait     = (@move_coordinates[2] - @move_coordinates[0]).abs +
  1632.                      (@move_coordinates[3] - @move_coordinates[1]).abs
  1633.   end
  1634.   if RTAB
  1635.   alias original_x true_x
  1636.   alias original_y true_y
  1637.   else
  1638.   alias original_x screen_x
  1639.   alias original_y screen_y
  1640.   end
  1641.   #--------------------------------------------------------------------------
  1642.   # ● バトル画面 X 座標の取得(カメラ補正無し)
  1643.   #--------------------------------------------------------------------------
  1644.   def true_x
  1645.     return original_x + @ox
  1646.   end
  1647.   #--------------------------------------------------------------------------
  1648.   # ● バトル画面 Y 座標の取得(カメラ補正無し)
  1649.   #--------------------------------------------------------------------------
  1650.   def true_y
  1651.     return original_y - @height / 2 + @oy
  1652.   end
  1653.   #--------------------------------------------------------------------------
  1654.   # ● バトル画面 X 座標の取得
  1655.   #--------------------------------------------------------------------------
  1656.   def screen_x(true_x = self.true_x)
  1657.     return true_x * @real_zoom + @real_x
  1658.   end
  1659.   #--------------------------------------------------------------------------
  1660.   # ● バトル画面 Y 座標の取得
  1661.   #--------------------------------------------------------------------------
  1662.   def screen_y(true_y = self.true_y)
  1663.     return true_y * @real_zoom + @real_y
  1664.   end
  1665.   #--------------------------------------------------------------------------
  1666.   # ● バトル画面 X 座標の取得(移動などしていない場合)
  1667.   #--------------------------------------------------------------------------
  1668.   def base_x(true_x = self.true_x)
  1669.     return (true_x - @ox) * @real_zoom + @real_x
  1670.   end
  1671.   #--------------------------------------------------------------------------
  1672.   # ● バトル画面 Y 座標の取得(移動などしていない場合)
  1673.   #--------------------------------------------------------------------------
  1674.   # ● アニメーション取得
  1675.   #--------------------------------------------------------------------------
  1676.   def battle_actions1
  1677.     weapon = $data_weapons[@weapon_id]
  1678.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1679.   end
  1680.   #--------------------------------------------------------------------------
  1681.   # ● アニメーション取得
  1682.   #--------------------------------------------------------------------------
  1683.   def battle_actions2
  1684.     weapon = $data_weapons[@weapon2_id]
  1685.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1686.   end
  1687.   #--------------------------------------------------------------------------
  1688.   # ● 武器アニメーション取得
  1689.   #--------------------------------------------------------------------------
  1690.   def weapon_anime1
  1691.     weapon = $data_weapons[@weapon_id]
  1692.     return weapon != nil ? weapon.icon_name : ""
  1693.   end
  1694.   #--------------------------------------------------------------------------
  1695.   # ● 武器アニメーション取得
  1696.   #--------------------------------------------------------------------------
  1697.   def weapon_anime2
  1698.     weapon = $data_weapons[@weapon2_id]
  1699.     return weapon != nil ? weapon.icon_name : ""
  1700.   end
  1701.   #--------------------------------------------------------------------------
  1702.   # ● 遠距離アニメーション取得
  1703.   #--------------------------------------------------------------------------
  1704.   def flying_anime1
  1705.     weapon = $data_weapons[@weapon_id]
  1706.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1707.   end
  1708.   #--------------------------------------------------------------------------
  1709.   # ● 遠距離アニメーション取得
  1710.   #--------------------------------------------------------------------------
  1711.   def flying_anime2
  1712.     weapon = $data_weapons[@weapon2_id]
  1713.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1714.   end
  1715.   def base_y(true_y = self.true_y)
  1716.     return (true_y - @oy) * @real_zoom + @real_y
  1717.   end
  1718.   #--------------------------------------------------------------------------
  1719.  
  1720.  
  1721.  
  1722.   #--------------------------------------------------------------------------
  1723.   # ● アニメーション取得
  1724.   #--------------------------------------------------------------------------
  1725.   def battle_actions1
  1726.     weapon = $data_weapons[@weapon_id]
  1727.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1728.   end
  1729.   #--------------------------------------------------------------------------
  1730.   # ● アニメーション取得
  1731.   #--------------------------------------------------------------------------
  1732.   def battle_actions2
  1733.     weapon = $data_weapons[@weapon2_id]
  1734.     return weapon != nil ? weapon.battle_actions : BattleActions::Actions["通常攻撃"]
  1735.   end
  1736.   #--------------------------------------------------------------------------
  1737.   # ● 武器アニメーション取得
  1738.   #--------------------------------------------------------------------------
  1739.   def weapon_anime1
  1740.     weapon = $data_weapons[@weapon_id]
  1741.     return weapon != nil ? weapon.icon_name : ""
  1742.   end
  1743.   #--------------------------------------------------------------------------
  1744.   # ● 武器アニメーション取得
  1745.   #--------------------------------------------------------------------------
  1746.   def weapon_anime2
  1747.     weapon = $data_weapons[@weapon2_id]
  1748.     return weapon != nil ? weapon.icon_name : ""
  1749.   end
  1750.   #--------------------------------------------------------------------------
  1751.   # ● 遠距離アニメーション取得
  1752.   #--------------------------------------------------------------------------
  1753.   def flying_anime1
  1754.     weapon = $data_weapons[@weapon_id]
  1755.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1756.   end
  1757.   #--------------------------------------------------------------------------
  1758.   # ● 遠距離アニメーション取得
  1759.   #--------------------------------------------------------------------------
  1760.   def flying_anime2
  1761.     weapon = $data_weapons[@weapon2_id]
  1762.     return weapon != nil ? weapon.flying_anime : [0,0,false,false]
  1763.   end  
  1764. end
  1765. #==============================================================================
  1766. # ■ Game_Party
  1767. #==============================================================================
  1768. class Game_Party
  1769.   #--------------------------------------------------------------------------
  1770.   # ● アクターを加える
  1771.   #     actor_id : アクター ID
  1772.   #--------------------------------------------------------------------------
  1773.   alias side_view_add_actor add_actor
  1774.   def add_actor(actor_id)
  1775.     # アクターを取得
  1776.     actor = $game_actors[actor_id]
  1777.     # サイドビューデータの初期化
  1778.     actor.start_battle
  1779.     # 戻す
  1780.     side_view_add_actor(actor_id)
  1781.   end
  1782. end
  1783.  
  1784. class Spriteset_Battle
  1785.   include Side_view
  1786.   #--------------------------------------------------------------------------
  1787.   # ● オブジェクト初期化
  1788.   #--------------------------------------------------------------------------
  1789.   alias side_veiw_initialize initialize
  1790.   def initialize
  1791.     side_veiw_initialize
  1792.     # アクタースプライトを解放
  1793.     for sprite in @actor_sprites
  1794.       sprite.dispose
  1795.     end
  1796.     # アクタースプライトを作成
  1797.     @actor_sprites = []
  1798.     for i in 1..Party_max
  1799.       @actor_sprites.push(Sprite_Battler.new(@viewport1))
  1800.     end
  1801.     update
  1802.   end
  1803.   #--------------------------------------------------------------------------
  1804.   # ● 画面のスクロール
  1805.   #--------------------------------------------------------------------------
  1806.   if method_defined?("screen_scroll")
  1807.   alias side_view_screen_scroll screen_scroll
  1808.   def screen_scroll
  1809.     side_view_screen_scroll
  1810.     # アクターの位置補正
  1811.     for actor in $game_party.actors
  1812.       actor.real_x = @real_x
  1813.       actor.real_y = @real_y
  1814.       actor.real_zoom = @real_zoom
  1815.     end
  1816.   end
  1817.   end
  1818. end
  1819.  
  1820. class Sprite_Battler < RPG::Sprite
  1821.   include Side_view
  1822.   #--------------------------------------------------------------------------
  1823.   # ● オブジェクト初期化
  1824.   #     viewport : ビューポート
  1825.   #     battler  : バトラー (Game_Battler)
  1826.   #--------------------------------------------------------------------------
  1827.   def initialize(viewport, battler = nil)
  1828.     super(viewport)
  1829.     @battler = battler
  1830.     @battler_visible = false
  1831.     @weapon = Sprite_Weapon.new(viewport, battler)
  1832.     @flying = Sprite_Flying.new(viewport, battler)
  1833.     @shadow = []
  1834.     [url=home.php?mod=space&uid=14121]@fly[/url] = 0
  1835.     @fly_direction = 1
  1836.     @rand = rand(10)
  1837.     self.effect_clear
  1838.   end
  1839.   #--------------------------------------------------------------------------
  1840.   # ● 解放
  1841.   #--------------------------------------------------------------------------
  1842.   alias side_view_dispose dispose
  1843.   def dispose
  1844.     side_view_dispose
  1845.     @weapon.dispose
  1846.     @flying.dispose
  1847.     if @_target_sprite != nil
  1848.       @_target_sprite.bitmap.dispose
  1849.       @_target_sprite.dispose
  1850.       @_target_sprite = nil
  1851.     end
  1852.   end
  1853.   #--------------------------------------------------------------------------
  1854.   # ● フレーム更新
  1855.   #--------------------------------------------------------------------------
  1856.   def update
  1857.     super
  1858.     # バトラーが nil の場合
  1859.     if @battler == nil
  1860.       self.bitmap = nil
  1861.       @weapon.bitmap = nil
  1862.       loop_animation(nil)
  1863.       return
  1864.     end
  1865.     # バトラー更新
  1866.     @battler.update
  1867.     # バトラーアニメのデータ取得
  1868.     @anime_type = @battler.anime_type
  1869.     # ファイル名か色相が現在のものと異なる場合
  1870.     if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  1871.       change = (@battler.character_name != @battler_name or @battler.character_hue != @battler_hue)
  1872.     elsif @battler.is_a?(Game_Enemy)
  1873.       change = (@battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue)
  1874.     else
  1875.       return
  1876.     end
  1877.     if change
  1878.       # ビットマップを取得、設定
  1879.       if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  1880.         @battler_name = @battler.character_name
  1881.         @battler_hue = @battler.character_hue
  1882.         self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
  1883.         @width = bitmap.width / 4
  1884.         @height = bitmap.height / 4
  1885.       else
  1886.         @battler_name = @battler.battler_name
  1887.         @battler_hue = @battler.battler_hue
  1888.         self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
  1889.         @width = bitmap.width
  1890.         @height = bitmap.height
  1891.       end
  1892.       self.ox = @width / 2
  1893.       self.oy = @height / 2
  1894.       @battler.height = @height
  1895.       @flag = true
  1896.       # 戦闘不能または隠れ状態なら不透明度を 0 にする
  1897.       if @battler.dead? or @battler.hidden
  1898.         self.opacity = 0
  1899.       end
  1900.     end
  1901.     if (@battler.is_a?(Game_Actor) and
  1902.       (@battler.anime_type != @anime_type or @battler.pattern != @pattern or @flag)) or
  1903.       (!@battler.is_a?(Game_Actor) and !@battler.nce)
  1904.       # ビットマップを取得、設定
  1905.       @pattern = @battler.pattern
  1906.       self.ox = @width / 2
  1907.       self.oy = @height / 2
  1908.       @sx = @pattern * @width
  1909.       sy = @anime_type % 4 * @height
  1910.       x   = sy / (@height * 2) + 4
  1911.       if !@battler.is_a?(Game_Actor) and !@battler.nce and x == 4
  1912.         x = 6
  1913.       end    # here!!
  1914.       @sy = (x - 2) / 2 * @height
  1915.       self.src_rect.set(@sx, @sy, @width, @height)
  1916.       self.zoom_x = CHAR_ZOOM
  1917.       self.zoom_y = CHAR_ZOOM
  1918.       @battler.height = @height
  1919.       @flag = false
  1920.     end
  1921.     # 飛行
  1922.     update_fly
  1923.     # シェイク
  1924.     update_shake
  1925.     # 回転
  1926.     update_turning
  1927.     # 反転
  1928.     update_reverse   
  1929.     # 移動
  1930.     update_moving
  1931.     # 追加アニメ
  1932.     update_add_anime
  1933.     # エフェクト効果の適用
  1934.     update_effect
  1935.     # アニメーション ID が現在のものと異なる場合
  1936.     flag = RTAB ? true : @battler.damage == nil
  1937.     if flag and @battler.state_animation_id != @state_animation_id
  1938.       @state_animation_id = @battler.state_animation_id
  1939.       loop_animation($data_animations[@state_animation_id])
  1940.     end
  1941.     # シェイク
  1942.     if @battler.shake
  1943.       self.start_shake(5, 5, 5)
  1944.       @battler.shake = false
  1945.     end
  1946.     # 明滅
  1947.     if @battler.blink
  1948.       blink_on
  1949.     else
  1950.       blink_off
  1951.     end
  1952.     # 不可視の場合
  1953.     unless @battler_visible
  1954.       flag = RTAB ? (@battler.damage.size < 2 or @battler.damage_pop.size < 2) :
  1955.                     (@battler.damage == nil or @battler.damage_pop)
  1956.       # 出現
  1957.       if not @battler.hidden and not @battler.dead? and flag
  1958.         appear
  1959.         @battler_visible = true
  1960.       end
  1961.     end
  1962.     if RTAB
  1963.     # ダメージ
  1964.     for battler in @battler.damage_pop
  1965.       if battler[0].class == Array
  1966.         if battler[0][1] >= 0
  1967.           $scene.skill_se
  1968.         else
  1969.           $scene.levelup_se
  1970.         end
  1971.         damage(@battler.damage[battler[0]], false, 2)
  1972.       else
  1973.         damage(@battler.damage[battler[0]], @battler.critical[battler[0]])
  1974.       end
  1975.       if @battler.damage_sp.include?(battler[0])
  1976.         damage(@battler.damage_sp[battler[0]],
  1977.                 @battler.critical[battler[0]], 1)
  1978.         @battler.damage_sp.delete(battler[0])
  1979.       end
  1980.       @battler.damage_pop.delete(battler[0])
  1981.       @battler.damage.delete(battler[0])
  1982.       @battler.critical.delete(battler[0])
  1983.     end
  1984.     end
  1985.     # 可視の場合
  1986.     if @battler_visible
  1987.       # 武器アニメ
  1988.       @weapon.battler = @battler
  1989.       @weapon.update
  1990.       # 遠距離アニメ
  1991.       @flying.battler = @battler
  1992.       @flying.update
  1993.       # 逃走
  1994.       if @battler.hidden
  1995.         $game_system.se_play($data_system.escape_se)
  1996.         escape
  1997.         @battler_visible = false
  1998.       end
  1999.       # 白フラッシュ
  2000.       if @battler.white_flash
  2001.         whiten
  2002.         @battler.white_flash = false
  2003.       end
  2004.       if RTAB
  2005.       # アニメーション
  2006.       if !@battler.animation.empty?
  2007.         for animation in @battler.animation.reverse
  2008.           if animation[2]
  2009.             animation($data_animations[animation[0]], animation[1], true)
  2010.           else
  2011.             animation($data_animations[animation[0]], animation[1])
  2012.           end
  2013.           @battler.animation.delete(animation)
  2014.         end
  2015.       end
  2016.       else
  2017.       # アニメーション
  2018.       if @battler.animation_id != 0
  2019.         animation = $data_animations[@battler.animation_id]
  2020.         animation(animation, @battler.animation_hit)
  2021.         @battler.animation_id = 0
  2022.       end
  2023.       end
  2024.       # ダメージ
  2025.       if !RTAB and @battler.damage_pop
  2026.         damage(@battler.damage, @battler.critical)
  2027.         @battler.damage = nil
  2028.         @battler.critical = false
  2029.         @battler.damage_pop = false
  2030.       end
  2031.       flag = RTAB ? (@battler.damage.empty? and $scene.dead_ok?(@battler)) :
  2032.                      @battler.damage == nil
  2033.       # コラプス
  2034.       if flag and @battler.dead?
  2035.         if @battler.is_a?(Game_Actor)
  2036.           $game_system.se_play($data_system.actor_collapse_se)
  2037.         elsif @battler.is_a?(Game_Enemy)
  2038.           $game_system.se_play($data_system.enemy_collapse_se)
  2039.         end
  2040.         collapse
  2041.         @battler_visible = false
  2042.       end
  2043.     end
  2044.     # スプライトの座標を設定
  2045.     self.x = @battler.screen_x + @effect_ox
  2046.     self.y = @battler.screen_y + @effect_oy
  2047.     self.z = @battler.screen_z
  2048.     self.zoom_x = @battler.real_zoom
  2049.     self.zoom_y = @battler.real_zoom
  2050.     # ウェイトカウントを減らす
  2051.     @battler.wait_count -= 1
  2052.     @battler.wait_count2 -= 1
  2053.     # アニメーション待ち時間取得
  2054.     @battler.animation_duration = @_animation_duration
  2055.     if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  2056.       self.zoom_x *= CHAR_ZOOM
  2057.       self.zoom_y *= CHAR_ZOOM
  2058.       @weapon.x = self.x + 2
  2059.       @weapon.y = self.y + 6
  2060.       @weapon.angle = 75 - (4 - @battler.pattern) * 45
  2061.       if self.mirror
  2062.         @weapon.angle += @weapon.angle - 180
  2063.       end
  2064.       if (!@battler.is_a?(Game_Actor) and !@battler.nce)
  2065.         @weapon.angle = [email]-@weapon.angle[/email]-90
  2066.       end
  2067.     end
  2068.     # 残像
  2069.     if @battler.shadow
  2070.       if Graphics.frame_count % 2 == 0
  2071.         shadow = ::Sprite.new(self.viewport)
  2072.         shadow.bitmap = self.bitmap.dup
  2073.         shadow.x = self.x
  2074.         shadow.y = self.y
  2075.         shadow.ox = self.ox
  2076.         shadow.oy = self.oy
  2077.         shadow.mirror = self.mirror
  2078.         shadow.angle = self.angle
  2079.         shadow.opacity = 160
  2080.         shadow.zoom_x = self.zoom_x
  2081.         shadow.zoom_y = self.zoom_y
  2082.         if @battler.is_a?(Game_Actor) or (!@battler.is_a?(Game_Actor) and !@battler.nce)
  2083.           shadow.src_rect.set(@sx, @sy, @width, @height)
  2084.         else
  2085.           shadow.src_rect.set(0, 0, @width, @height)
  2086.         end
  2087.         @shadow.push([shadow,duration = 10,@battler.true_x + @effect_ox,@battler.true_y + @effect_oy])
  2088.       end
  2089.     end
  2090.     for s in @shadow
  2091.       if !s[0].disposed?
  2092.         s[0].update
  2093.         s[1] -= 1
  2094.         if s[1] < 1
  2095.           if s[0].bitmap != nil
  2096.             s[0].bitmap.dispose
  2097.           end
  2098.           s[0].dispose
  2099.         else
  2100.           s[0].x = @battler.screen_x(s[2])
  2101.           s[0].y = @battler.screen_y(s[3])
  2102.         end
  2103.       else
  2104.         s = nil
  2105.       end
  2106.     end
  2107.     @shadow.compact!
  2108.   end
  2109.   #--------------------------------------------------------------------------
  2110.   # ● エフェクトによる座標系の更新
  2111.   #--------------------------------------------------------------------------
  2112.   def update_effect
  2113.     # 角度の修正
  2114.     if @_upside_down
  2115.       self.angle = (@_turning + 180) % 360
  2116.     else
  2117.       self.angle = @_turning
  2118.     end
  2119.     # X 座標の修正値
  2120.     @effect_ox = @_shake + @_moving[0]
  2121.     # Y 座標の修正値
  2122.     @effect_oy = -@fly + @_moving[1]
  2123.     if  @_animation == nil or (RTAB and @_animation.empty?)
  2124.       self.effect_clear
  2125.     end
  2126.   end
  2127.   #--------------------------------------------------------------------------
  2128.   # ● シェイク更新
  2129.   #--------------------------------------------------------------------------
  2130.   def update_shake
  2131.     if @_shake_duration >= 1 or @_shake != 0
  2132.       delta = (@_shake_power * @_shake_speed * @_shake_direction) / 10.0
  2133.       if @_shake_duration <= 1 and @_shake * (@_shake + delta) < 0
  2134.         @_shake = 0
  2135.       else
  2136.         @_shake += delta
  2137.       end
  2138.       if @_shake > @_shake_power * 2
  2139.         @_shake_direction = -1
  2140.       end
  2141.       if @_shake < - @_shake_power * 2
  2142.         @_shake_direction = 1
  2143.       end
  2144.       if @_shake_duration >= 1
  2145.         @_shake_duration -= 1
  2146.       end
  2147.     end
  2148.   end
  2149.   #--------------------------------------------------------------------------
  2150.   # ● 飛行更新
  2151.   #--------------------------------------------------------------------------
  2152.   def update_fly
  2153.     if @rand > 0
  2154.       @rand -= 1
  2155.       return
  2156.     end
  2157.     if @battler.fly != 0
  2158.       if @fly < @battler.fly / 4
  2159.         @fly_direction = 1
  2160.       elsif @fly > @battler.fly / 2
  2161.         @fly_direction = -1
  2162.       end
  2163.       @fly += 0.5 * @fly_direction
  2164.     end
  2165.   end
  2166.   #--------------------------------------------------------------------------
  2167.   # ● 回転更新
  2168.   #--------------------------------------------------------------------------
  2169.   def update_turning
  2170.     if @_turning_duration > 0 or @_turning != 0
  2171.       @_turning += @_turning_direction * @_turning_speed / 2.0
  2172.       # 残り回転数を減らす
  2173.       if @_turning_direction == -1
  2174.         if @_turning_duration > 0 and @_turning < 0
  2175.           @_turning_duration -= 1
  2176.         end
  2177.       elsif @_turning_direction == 1
  2178.         if @_turning_duration > 0 and @_turning >= 360
  2179.           @_turning_duration -= 1
  2180.         end
  2181.       end
  2182.       # 以下補正
  2183.       while @_turning < 0
  2184.         @_turning += 360
  2185.       end
  2186.       if @_turning_duration <= 0
  2187.         @_turning = 0
  2188.       end
  2189.       @_turning %= 360
  2190.     end
  2191.   end
  2192.   #--------------------------------------------------------------------------
  2193.   # ● 左右反転更新
  2194.   #--------------------------------------------------------------------------
  2195.   def update_reverse
  2196.     if @last_reverse != (@_reverse or @battler.reverse)
  2197.       self.mirror = (@_reverse or @battler.reverse)
  2198.       @last_reverse = (@_reverse or @battler.reverse)
  2199.     end
  2200.   end
  2201.   #--------------------------------------------------------------------------
  2202.   # ● 移動更新
  2203.   #--------------------------------------------------------------------------
  2204.   def update_moving
  2205.     @move_distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2206.                      (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2207.     if @move_distance > 0
  2208.       return if @_moving[0] == @_move_coordinates[0] and @_moving[1] == @_move_coordinates[1]
  2209.       array = @_move_coordinates
  2210.       x = (array[2] + 1.0 * (array[0] - array[2]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2211.       y = (array[3] + 1.0 * (array[1] - array[3]) * (@move_distance - @_move_duration) / @move_distance.to_f).to_i
  2212.       @_moving = [x, y]
  2213.       if @_move_quick_return and @_move_duration == 0
  2214.         @_move_coordinates = [0,0,array[0],array[1]]
  2215.         @_move_duration = @move_distance
  2216.       end
  2217.       @_move_duration -= @_move_speed
  2218.       @_move_duration = [@_move_duration, 0].max
  2219.     end
  2220.   end
  2221.   #--------------------------------------------------------------------------
  2222.   # ● 追加アニメ更新 (RTAB限定機能)
  2223.   #--------------------------------------------------------------------------
  2224.   def update_add_anime
  2225.     if RTAB
  2226.     # アニメーション
  2227.     if @_add_anime_id != 0
  2228.       animation = $data_animations[@_add_anime_id]
  2229.       animation(animation, true)
  2230.       @_add_anime_id = 0
  2231.     end
  2232.     end
  2233.   end
  2234.   #--------------------------------------------------------------------------
  2235.   # ● エフェクト初期化
  2236.   #--------------------------------------------------------------------------
  2237.   def effect_clear
  2238.     @_effect_ox = 0
  2239.     @_effect_oy = 0
  2240.     @_shake_power = 0
  2241.     @_shake_speed = 0
  2242.     @_shake_duration = 0
  2243.     @_shake_direction = 1
  2244.     @_shake = 0
  2245.     @_upside_down = false
  2246.     @_reverse = false
  2247.     @_turning_direction = 1
  2248.     @_turning_speed = 0
  2249.     @_turning_duration = 0
  2250.     @_turning = 0
  2251.     @_move_quick_return = true
  2252.     @_move_speed = 0
  2253.     @_move_coordinates = [0,0,0,0]
  2254.     @_move_jump = false
  2255.     @_move_duration = 0
  2256.     @_moving = [0,0]
  2257.     @_add_anime_id = 0
  2258.   end
  2259.   #--------------------------------------------------------------------------
  2260.   # ● シェイクの開始
  2261.   #     power    : 強さ
  2262.   #     speed    : 速さ
  2263.   #     duration : 時間
  2264.   #--------------------------------------------------------------------------
  2265.   def start_shake(power, speed, duration)
  2266.     @_shake_power = power
  2267.     @_shake_speed = speed
  2268.     @_shake_duration = duration
  2269.   end
  2270.   #--------------------------------------------------------------------------
  2271.   # ● 上下反転を開始
  2272.   #--------------------------------------------------------------------------
  2273.   def start_upside_down
  2274.     @_upside_down = @_upside_down ? false : true
  2275.   end
  2276.   #--------------------------------------------------------------------------
  2277.   # ● 左右反転を開始
  2278.   #--------------------------------------------------------------------------
  2279.   def start_reverse
  2280.     @_reverse = @_reverse ? false : true
  2281.   end
  2282.   #--------------------------------------------------------------------------
  2283.   # ● 回転を開始
  2284.   #     direction: 方向
  2285.   #     speed    : 速さ
  2286.   #     duration : 時間
  2287.   #--------------------------------------------------------------------------
  2288.   def start_turning(direction, speed, duration)
  2289.     @_turning_direction = direction
  2290.     @_turning_speed = speed
  2291.     @_turning_duration = duration
  2292.     @_turning = @_turning_direction == 1 ? 0 : 360
  2293.   end
  2294.   #--------------------------------------------------------------------------
  2295.   # ● 移動を開始
  2296.   #     quick_return : 戻るかどうか
  2297.   #     speed        : 速さ
  2298.   #     x            : X 座標
  2299.   #     y            : Y 座標
  2300.   #--------------------------------------------------------------------------
  2301.   def start_moving(quick_return, speed, x, y)
  2302.     @_move_quick_return = quick_return == 0 ? false : true
  2303.     @_move_speed = speed
  2304.     @_move_coordinates = [x,y,@_move_coordinates[0],@_move_coordinates[1]]
  2305.     distance = (@_move_coordinates[2] - @_move_coordinates[0]).abs +
  2306.                (@_move_coordinates[3] - @_move_coordinates[1]).abs
  2307.     @_move_duration = distance
  2308.   end
  2309.   #--------------------------------------------------------------------------
  2310.   # ● アニメ追加を開始
  2311.   #     id           : ID
  2312.   #     hit          : 命中フラッグ
  2313.   #--------------------------------------------------------------------------
  2314.   def start_add_anime(id)
  2315.     @_add_anime_id = id
  2316.   end
  2317.   #--------------------------------------------------------------------------
  2318.   # ● 各種エフェクトの開始判定
  2319.   #--------------------------------------------------------------------------
  2320.   if !method_defined?("side_view_animation_process_timing")
  2321.     alias side_view_animation_process_timing animation_process_timing
  2322.   end
  2323.   def animation_process_timing(timing, hit)
  2324.     side_view_animation_process_timing(timing, hit)
  2325.     if (timing.condition == 0) or
  2326.        (timing.condition == 1 and hit == true) or
  2327.        (timing.condition == 2 and hit == false)
  2328.       if timing.se.name =~ SHAKE_FILE
  2329.         names = timing.se.name.split(/#/)
  2330.         power    = names[1].nil? ? SHAKE_POWER    : names[1].to_i
  2331.         speed    = names[2].nil? ? SHAKE_SPEED    : names[2].to_i
  2332.         duration = names[3].nil? ? SHAKE_DURATION : names[3].to_i
  2333.         # シェイクを開始
  2334.         self.start_shake(power, speed, duration)
  2335.       end
  2336.       if timing.se.name == UPSIDE_DOWN_FILE
  2337.         # 上下反転を開始
  2338.         self.start_upside_down
  2339.       end
  2340.       if timing.se.name == REVERSE_FILE
  2341.         # 左右反転を開始
  2342.         self.start_reverse
  2343.       end
  2344.       if timing.se.name =~ TURNING_FILE
  2345.         names = timing.se.name.split(/#/)
  2346.         direction = names[1].nil? ? TURNING_DIRECTION : names[1].to_i
  2347.         speed     = names[2].nil? ? TURNING_SPEED     : names[2].to_i
  2348.         duration  = names[3].nil? ? TURNING_DURATION  : names[3].to_i
  2349.         # 回転を開始
  2350.         self.start_turning(direction, speed, duration)
  2351.       end
  2352.       if timing.se.name =~ MOVE_FILE
  2353.         names = timing.se.name.split(/#/)
  2354.         quick_return= names[1].nil? ? MOVE_RETURN      : names[1].to_i
  2355.         speed       = names[2].nil? ? MOVE_SPEED       : names[2].to_i
  2356.         x           = names[3].nil? ? MOVE_COORDINATES[0] : names[3].to_i
  2357.         y           = names[3].nil? ? MOVE_COORDINATES[1] : names[4].to_i
  2358.         # 移動を開始
  2359.         self.start_moving(quick_return, speed, x, y)
  2360.       end
  2361.       if timing.se.name =~ ADD_ANIME_FILE
  2362.         names = timing.se.name.split(/#/)
  2363.         id = names[1].nil? ? ADD_ANIME_ID      : names[1].to_i
  2364.         # アニメ追加を開始
  2365.         self.start_add_anime(id)
  2366.       end
  2367.     end
  2368.   end
  2369. end
  2370.  
  2371. #==============================================================================
  2372. # ■ Sprite_Weapon
  2373. #------------------------------------------------------------------------------
  2374. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2375. # スプライトの状態を自動的に変化させます。
  2376. #==============================================================================
  2377.  
  2378. class Sprite_Weapon < RPG::Sprite
  2379.   include Side_view
  2380.   #--------------------------------------------------------------------------
  2381.   # ● 公開インスタンス変数
  2382.   #--------------------------------------------------------------------------
  2383.   attr_accessor :battler                  # バトラー
  2384.   attr_reader   :cw                       # グラフィックの幅
  2385.   attr_reader   :ch                       # グラフィックの高さ
  2386.   #--------------------------------------------------------------------------
  2387.   # ● オブジェクト初期化
  2388.   #     viewport : ビューポート
  2389.   #     battler  : バトラー (Game_Battler)
  2390.   #--------------------------------------------------------------------------
  2391.   def initialize(viewport, battler = nil)
  2392.     super(viewport)
  2393.     @battler = battler
  2394.     @battler_visible = false
  2395.   end
  2396.   #--------------------------------------------------------------------------
  2397.   # ● 解放
  2398.   #--------------------------------------------------------------------------
  2399.   def dispose
  2400.     if self.bitmap != nil
  2401.       self.bitmap.dispose
  2402.     end
  2403.     super
  2404.   end
  2405.   #--------------------------------------------------------------------------
  2406.   # ● フレーム更新
  2407.   #--------------------------------------------------------------------------
  2408.   def update
  2409.     super
  2410.     # バトラーが nil の場合
  2411.     if @battler == nil or (!@battler.is_a?(Game_Actor) and @battler.nce)
  2412.       self.bitmap = nil
  2413.       return
  2414.     end
  2415.     # ウエポンアニメのデータ取得
  2416.     @weapon_anime_type = @battler.weapon_anime_type(@battler.condition)
  2417.     # 設定が「非表示」の場合
  2418.     if !@weapon_anime_type[1] or @weapon_anime_type[0].nil?
  2419.       self.visible = false
  2420.       return
  2421.     else
  2422.       self.visible = true
  2423.     end
  2424.     # ファイル名が現在のものと異なる場合
  2425.     if @weapon_anime_type[0] != @weapon_name
  2426.       @weapon_name = @weapon_anime_type[0]
  2427.       # ビットマップを取得、設定
  2428.       self.bitmap = RPG::Cache.icon(@weapon_name)
  2429.       @width = bitmap.width
  2430.       @height = bitmap.height
  2431.       @flag = true
  2432.     end
  2433.     # 現在アニメパターンが現在のものと異なる場合
  2434.     if @pattern != @battler.pattern or @flag or @condition != @battler.condition
  2435.       @pattern = @battler.pattern
  2436.       @condition = @battler.condition
  2437.       self.ox = @width
  2438.       self.oy = @height
  2439.       self.z = battler.screen_z
  2440.       self.zoom_x = @battler.real_zoom * CHAR_ZOOM
  2441.       self.zoom_y = @battler.real_zoom * CHAR_ZOOM
  2442.       self.src_rect.set(0, 0, @width, @height)
  2443.       self.opacity = 255
  2444.       # バトラーより手前に表示
  2445.       if @weapon_anime_type[2]
  2446.         self.z += 10
  2447.       # バトラーより奥に表示
  2448.       else
  2449.         self.z -= 10
  2450.       end
  2451.       @flag = false
  2452.     end
  2453.   end
  2454. end
  2455.  
  2456. #==============================================================================
  2457. # ■ Sprite_Flying
  2458. #------------------------------------------------------------------------------
  2459. #  バトラー表示用のスプライトです。Game_Battler クラスのインスタンスを監視し、
  2460. # スプライトの状態を自動的に変化させます。
  2461. #==============================================================================
  2462.  
  2463. class Sprite_Flying < RPG::Sprite
  2464.   include Side_view
  2465.   #--------------------------------------------------------------------------
  2466.   # ● 公開インスタンス変数
  2467.   #--------------------------------------------------------------------------
  2468.   attr_accessor :battler                  # バトラー
  2469.   #--------------------------------------------------------------------------
  2470.   # ● オブジェクト初期化
  2471.   #     viewport : ビューポート
  2472.   #     battler  : バトラー (Game_Battler)
  2473.   #--------------------------------------------------------------------------
  2474.   def initialize(viewport, battler = nil)
  2475.     super(viewport)
  2476.     @battler = battler
  2477.     @battler_visible = false
  2478.   end
  2479.   #--------------------------------------------------------------------------
  2480.   # ● 解放
  2481.   #--------------------------------------------------------------------------
  2482.   def dispose
  2483.     if self.bitmap != nil
  2484.       self.bitmap.dispose
  2485.     end
  2486.     super
  2487.   end
  2488.   #--------------------------------------------------------------------------
  2489.   # ● フレーム更新
  2490.   #--------------------------------------------------------------------------
  2491.   def update
  2492.     super
  2493.     # バトラーが nil の場合
  2494.     if @battler == nil
  2495.       self.bitmap = nil
  2496.       loop_animation(nil)
  2497.       return
  2498.     end
  2499.     # 遠距離アニメ
  2500.     flying_animation = @battler.flying_animation
  2501.     flying_start = flying_animation[0]
  2502.     flying_end   = flying_animation[1]
  2503.     # アニメーション ID が現在のものと異なる場合
  2504.     if @anime_id != @battler.flying_anime[0]
  2505.       @anime_id = @battler.flying_anime[0]
  2506.       @animation = $data_animations[@anime_id]
  2507.     end
  2508.     # アニメーション 開始
  2509.     if flying_start
  2510.       loop_animation(@animation)
  2511.     elsif flying_end
  2512.       loop_animation(nil)
  2513.     end
  2514.     self.x = @battler.flying_x
  2515.     self.y = @battler.flying_y
  2516.     self.z = @battler.screen_z + 1000
  2517.   end
  2518. end
  2519.  
  2520. module RPG
  2521.   class Skill
  2522.     #--------------------------------------------------------------------------
  2523.     # ● 魔法かどうかの判断
  2524.     #--------------------------------------------------------------------------
  2525.     def magic?
  2526.       if @atk_f == 0
  2527.         return true
  2528.       else
  2529.         return false
  2530.       end
  2531.     end
  2532.   end
  2533. end
  2534.  
  2535. # アローカーソルの位置修正
  2536.  
  2537. class Arrow_Actor < Arrow_Base
  2538.   include Side_view
  2539.   #--------------------------------------------------------------------------
  2540.   # ● フレーム更新
  2541.   #--------------------------------------------------------------------------
  2542.   alias side_view_update update
  2543.   def update
  2544.     side_view_update
  2545.     # スプライトの座標を設定
  2546.     if self.actor != nil && (self.x != self.actor.screen_x + ARROW_OX or self.y != self.actor.screen_y + ARROW_OY)
  2547.       self.x = self.actor.screen_x + ARROW_OX
  2548.       self.y = self.actor.screen_y + ARROW_OY
  2549.     end
  2550.   end
  2551. end
  2552. class Arrow_Enemy < Arrow_Base
  2553.   include Side_view
  2554.   #--------------------------------------------------------------------------
  2555.   # ● フレーム更新
  2556.   #--------------------------------------------------------------------------
  2557.   alias side_view_update update
  2558.   def update
  2559.     side_view_update
  2560.     # スプライトの座標を設定
  2561.     if self.enemy != nil && self.y != self.enemy.screen_y + self.enemy.height/2
  2562.       self.x = self.enemy.screen_x
  2563.       self.y = self.enemy.screen_y + self.enemy.height/2
  2564.     end
  2565.   end
  2566. end
  2567. module Rtab_use
  2568.   def update_phase4_step3(battler)
  2569.     # ヘルプウィンドウの更新。アクションの種別で分岐
  2570.     case battler.current_action.kind
  2571.     when 0  # 基本
  2572.       if battler.current_action.basic == 1
  2573.         @help_window.set_text($data_system.words.guard, 1)
  2574.         @help_wait = @help_time
  2575.       end
  2576.       if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2
  2577.         @help_window.set_text("逃げる", 1)
  2578.         @help_wait = @help_time
  2579.       end
  2580.     when 1  # スキル
  2581.       skill =  $data_skills[battler.current_action.skill_id]
  2582.       @help_window.set_text(skill.name, 1)
  2583.       @help_wait = @help_time
  2584.     when 2  # アイテム
  2585.       item = $data_items[battler.current_action.item_id]
  2586.       @help_window.set_text(item.name, 1)
  2587.       @help_wait = @help_time
  2588.     end
  2589.     # 行動側アニメーション (ID が 0 の場合は白フラッシュ)
  2590.     if battler.anime1 == 0
  2591.       battler.white_flash = true
  2592.       battler.wait = 5
  2593.       # カメラ設定
  2594.       if battler.target[0].is_a?(Game_Enemy)
  2595.         camera_set(battler)
  2596.       end
  2597.     else
  2598.       battler.animation.push([battler.anime1, true])
  2599.       speller = synthe?(battler)
  2600.       if speller != nil
  2601.         for spell in speller
  2602.           if spell != battler
  2603.             if spell.current_action.spell_id == 0
  2604.               spell.animation.push([battler.anime1, true])
  2605.             else
  2606.               skill = spell.current_action.spell_id
  2607.               spell.animation.push([$data_skills[skill].animation1_id, true])
  2608.               spell.current_action.spell_id = 0
  2609.             end
  2610.           end
  2611.         end
  2612.       end
  2613.       battler.wait = 2 * $data_animations[battler.anime1].frame_max - 10
  2614.       battler.anime1 = 0
  2615.     end
  2616.     # ステップ 4 に移行
  2617.     battler.phase = 4 if !(!battler.animation1_on and battler.action? and !battler.flash?)
  2618.   end
  2619. end
  2620.  
  2621. #==============================================================================
  2622. # ■ Scene_Battle
  2623. #==============================================================================
  2624. class Scene_Battle
  2625.   include Side_view
  2626.   include Rtab_use if RTAB
  2627.   #--------------------------------------------------------------------------
  2628.   # ● 公開インスタンス変数
  2629.   #--------------------------------------------------------------------------
  2630.   attr_reader   :phase            # フェーズ
  2631.   attr_reader   :phase4_step      # フェーズ4ステップ
  2632.   attr_reader   :active_battler   # 対象の配列
  2633.   attr_reader   :target_battlers  # 対象の配列
  2634.   attr_reader   :animation1_id    # 行動アニメID
  2635.   attr_reader   :animation2_id    # 対象アニメID
  2636.   #--------------------------------------------------------------------------
  2637.   # ● メイン処理
  2638.   #--------------------------------------------------------------------------
  2639.   alias side_view_main main
  2640.   def main
  2641.     # バトラー初期化
  2642.     for battler in $game_party.actors + $game_troop.enemies
  2643.       battler.start_battle
  2644.     end
  2645.     # 戻す
  2646.     side_view_main
  2647.   end
  2648.   #--------------------------------------------------------------------------
  2649.   # ● 閃き判定
  2650.   #--------------------------------------------------------------------------
  2651.   def flash?
  2652.     return @flash_flag ? true : false
  2653.   end  
  2654.   #--------------------------------------------------------------------------
  2655.   # ● 閃きアニメ待ち時間取得
  2656.   #--------------------------------------------------------------------------
  2657.   def flash_duration
  2658.     animation = nil
  2659.     if FLASH_ANIME
  2660.       animation = $data_animations[FLASH_ANIMATION_ID]
  2661.     end
  2662.     return animation != nil ? animation.frame_max * 2 + 2 : 0
  2663.   end
  2664.   #--------------------------------------------------------------------------
  2665.   # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  2666.   #--------------------------------------------------------------------------
  2667.   alias side_view_update_phase4_step2 update_phase4_step2
  2668.   def update_phase4_step2(*arg)
  2669.     battler = convert_battler2(*arg)
  2670.     battler.action
  2671.     side_view_update_phase4_step2(*arg)
  2672.   end
  2673.   #--------------------------------------------------------------------------
  2674.   # ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
  2675.   #--------------------------------------------------------------------------
  2676.   alias side_view_update_phase4_step3 update_phase4_step3
  2677.   def update_phase4_step3(*arg)
  2678.     battler = convert_battler2(*arg)
  2679.     if battler.flash? and FLASH_ANIME
  2680.       battler.flash_flag["normal"] = true
  2681.     end
  2682.     side_view_update_phase4_step3(*arg)
  2683.   end
  2684.   #--------------------------------------------------------------------------
  2685.   # ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
  2686.   #--------------------------------------------------------------------------
  2687.   alias side_view_update_phase4_step4 update_phase4_step4
  2688.   def update_phase4_step4(*arg)
  2689.     battler = convert_battler2(*arg)
  2690.     targets = RTAB ? battler.target : @target_battlers
  2691.     return if !battler.animation2_on and battler.action? if !RTAB
  2692.     side_view_update_phase4_step4(*arg)
  2693.     for target in targets
  2694.       if RTAB
  2695.         value = nil
  2696.         if target.damage_sp.include?(battler)
  2697.           value = target.damage_sp[battler]
  2698.         end
  2699.         if target.damage.include?(battler)
  2700.           if value == nil or value == "Miss"
  2701.             value = target.damage[battler]
  2702.           elsif value.is_a?(Numeric) && value > 0
  2703.             value = target.damage[battler] == "Miss" ? value : target.damage[battler]
  2704.           end
  2705.         end
  2706.       else
  2707.         value = target.damage
  2708.       end
  2709.       if target.is_a?(Game_Actor)
  2710.         # ダメージの場合
  2711.         if value.is_a?(Numeric) && value > 0
  2712.           # シェイクを開始
  2713.           target.shake = true
  2714.         end
  2715.       elsif target.is_a?(Game_Enemy)
  2716.         # ダメージの場合
  2717.         if value.is_a?(Numeric) && value > 0
  2718.           # シェイクを開始
  2719.           target.shake = true
  2720.         end
  2721.       end
  2722.     end
  2723.   end
  2724.   #--------------------------------------------------------------------------
  2725.   # ● プレバトルフェーズ開始
  2726.   #--------------------------------------------------------------------------
  2727.   alias start_phase1_correct start_phase1
  2728.   def start_phase1
  2729.     # カメラの設定
  2730.     # 元々フロントビュー向けの数値になっているため
  2731.     @zoom_rate = [1.0, 1.0]
  2732.     start_phase1_correct
  2733.   end
  2734.   #--------------------------------------------------------------------------
  2735.   # ● アクターコマンドフェーズ開始
  2736.   #--------------------------------------------------------------------------
  2737.   alias start_phase3_correct start_phase3
  2738.   def start_phase3
  2739.     battler = convert_battler
  2740.     start_phase3_correct
  2741.     if RTAB
  2742.       # カメラの設定
  2743.       # 元々フロントビュー向けの数値になっているため
  2744.       @camera = "command"
  2745. #      @spriteset.screen_target(0, 0, 1.0)
  2746.     end
  2747.   end
  2748.  
  2749.  
  2750.   def action_phase(battler)
  2751.     # action が 1 の場合、バトラーが行動中かどうか確認
  2752.     if @action == 1 and battler.phase < 3
  2753.       for target in battler.target
  2754.         speller = synthe?(target)
  2755.         if speller == nil
  2756.           # ターゲットが通常行動中の場合
  2757.           if @action_battlers.include?(target)
  2758.             if target.phase > 2
  2759.               return
  2760.             end
  2761.           end
  2762.         else
  2763.           # ターゲットが連携スキル発動中の場合
  2764.           for spell in speller
  2765.             if @action_battlers.include?(spell)
  2766.               if spell.phase > 2
  2767.                 return
  2768.               end
  2769.             end
  2770.           end
  2771.         end
  2772.       end
  2773.     end
  2774. case battler.phase
  2775.   when 1
  2776.     update_phase4_step1(battler)
  2777.   when 2
  2778.     update_phase4_step2(battler)
  2779.   when 3  
  2780.     update_phase4_step3(battler) if !(!battler.animation1_on and battler.action? and !battler.flash?)
  2781.   when 4
  2782.     update_phase4_step4(battler) if !(!battler.animation2_on and battler.action?)
  2783.   when 5
  2784.     update_phase4_step5(battler)
  2785.   when 6
  2786.     update_phase4_step6(battler)
  2787.   end
  2788. end
  2789. end
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-3-9
帖子
39
3
 楼主| 发表于 2014-10-24 22:21:36 | 只看该作者
本帖最后由 RyanBern 于 2014-10-25 09:35 编辑

RUBY 代码复制
  1. #==============================================================================
  2. # ■ chaochao的人物仓库ver1.02正式版
  3. # 修改了Game_Party
  4. # 功能:
  5. # 用来存放角色的仓库……
  6. # 召唤画面用$scene = Chaochao_Scene_Party.new
  7. # 其它使用说明在代码里已经备注。
  8. #------------------------------------------------------------------------------
  9. # 作者:chaochao
  10. # [url]http://zhuchao.go1.icpcn.com[/url]
  11. #==============================================================================
  12. class Chaochao_Window_PartyLeft < Window_Selectable
  13.   def initialize
  14.     super(0, 0, 320, 224)
  15.     self.contents = Bitmap.new(width - 32, height - 32)
  16.     self.index = 0
  17.     refresh
  18.   end
  19.   def actor
  20.     return @actors[self.index]
  21.   end
  22.   def refresh
  23.     if self.contents != nil
  24.       self.contents.dispose
  25.       self.contents = nil
  26.     end
  27.     @actors = []
  28.     for i in 0...$game_party.actors.size
  29.       @actors.push($game_party.actors[i])
  30.     end
  31.  
  32.     @item_max = 4
  33.     if @item_max > 0
  34.       self.contents = Bitmap.new(width - 32, (row_max+1) * 32)
  35.       for i in 0...@item_max
  36.         draw_item(i)
  37.       end
  38.     end
  39.   end
  40.   def draw_item(index)
  41.     if @actors[index] != nil
  42.       actor = @actors[index]
  43.       text = @actors[index].name
  44.       lv = @actors[index].level.to_s + " "
  45.       if $game_party.chaochao.include?(actor.id) or $game_party.actors.size <= 1
  46.         self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色
  47.       else
  48.         self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色
  49.       end
  50.       self.contents.draw_text(4, index * 32 + 32, 288, 32, text)
  51.       self.contents.font.color = normal_color
  52.       self.contents.font.size = 16
  53.       self.contents.draw_text(4, index * 32 + 36, 288, 32,  "Level:   ", 2)
  54.       colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max
  55.       colory = [255.0000 / 60 * @actors[index].level,255].min
  56.       self.contents.font.color = Color.new(colorx, colory, 0)
  57.       self.contents.draw_text(4, index * 32 + 36, 288, 32,  lv, 2)
  58.       self.contents.font.color = normal_color
  59.       self.contents.font.size = 22
  60.     else
  61.       self.contents.draw_text(4, index * 32 + 32, 288, 32,  "Nobody")
  62.     end
  63.   end
  64.   def update_cursor_rect
  65.     if @index < 0
  66.       self.cursor_rect.empty
  67.       return
  68.     end
  69.     row = @index / @column_max
  70.     if row < self.top_row
  71.       self.top_row = row
  72.     end
  73.     if row > self.top_row + (self.page_row_max - 1)
  74.       self.top_row = row - (self.page_row_max - 1)
  75.     end
  76.     cursor_width = self.width / @column_max - 32
  77.     x = @index % @column_max * (cursor_width + 32)
  78.     y = @index / @column_max * 32 - self.oy + 32
  79.     self.cursor_rect.set(x, y, cursor_width, 32)
  80.   end
  81.   def item_max
  82.     return @item_max
  83.   end
  84.   def actor?(index)
  85.     return @actors[index] == nil ? false : true
  86.   end
  87.   def set_index(x)
  88.     @index = x
  89.   end
  90. end
  91.  
  92. #------------------------------------------------------------------------------
  93.  
  94. class Chaochao_Window_PartyRight < Window_Selectable
  95.   def initialize
  96.     super(320, 0, 320, 224)
  97.     self.contents = Bitmap.new(width - 32, height - 32)
  98.     self.index = -1
  99.     refresh
  100.   end
  101.   def actor
  102.     return @actors[self.index]
  103.   end
  104.   def refresh
  105.     if self.contents != nil
  106.       self.contents.dispose
  107.       self.contents = nil
  108.     end
  109.     @actors = []
  110.     for i in 0...$game_party.actors2.size
  111.       @actors.push($game_party.actors2[i])
  112.     end
  113.  
  114.     @item_max = $game_party.actors2.size
  115.     if @item_max > 0
  116.       self.contents = Bitmap.new(width - 32, row_max * 32)
  117.       for i in 0...@item_max
  118.         draw_item(i)
  119.       end
  120.     elsif @item_max == 0
  121.  
  122.     end
  123.   end
  124.   def draw_item(index)
  125.     actor = @actors[index]
  126.     text = @actors[index].name
  127.     lv = @actors[index].level.to_s + " "
  128.     if $game_party.chaochao2.include?(actor.id) or $game_party.actors.size >= 4
  129.         self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色
  130.       else
  131.         self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色
  132.       end
  133.     self.contents.draw_text(4, index * 32, 288, 32, text)
  134.     self.contents.font.color = normal_color
  135.     self.contents.font.size = 16
  136.     self.contents.draw_text(4, index * 32 + 4, 288, 32,  "Level:   ", 2)
  137.     colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max
  138.     colory = [255.0000 / 60 * @actors[index].level,255].min
  139.     self.contents.font.color = Color.new(colorx, colory, 0)
  140.     self.contents.draw_text(4, index * 32 + 4, 288, 32,  lv, 2)
  141.     self.contents.font.color = normal_color
  142.     self.contents.font.size = 22
  143.   end
  144.   def update_cursor_rect
  145.     if @index < 0
  146.       self.cursor_rect.empty
  147.       return
  148.     end
  149.     row = @index / @column_max
  150.     if row < self.top_row
  151.       self.top_row = row
  152.     end
  153.     if row > self.top_row + (self.page_row_max - 1)
  154.       self.top_row = row - (self.page_row_max - 1)
  155.     end
  156.     cursor_width = self.width / @column_max - 32
  157.     x = @index % @column_max * (cursor_width + 32)
  158.     y = @index / @column_max * 32 - self.oy
  159.     self.cursor_rect.set(x, y, cursor_width, 32)
  160.   end
  161.   def item_max
  162.     return @item_max
  163.   end
  164.   def actor?(index)
  165.     return @actors[index] == nil ? false : true
  166.   end
  167.   def set_index(x)
  168.     @index = x
  169.   end
  170. end
  171.  
  172. #------------------------------------------------------------------------------
  173.  
  174. class Chaochao_Window_PartyData < Window_Base
  175.  
  176.   def initialize
  177.     super(0, 224, 640, 256)
  178.     self.contents = Bitmap.new(width - 32, height - 32)
  179.     @actor = nil
  180.   end
  181.  
  182.   def set_actor(actor)
  183.     self.contents.clear
  184.     draw_actor_name(actor, 4, 0)
  185.     draw_actor_state(actor, 140, 0)
  186.     draw_actor_hp(actor, 284, 0)
  187.     draw_actor_sp(actor, 460, 0)
  188.     @actor = actor
  189.     self.visible = true
  190.   end
  191.   def clear
  192.     self.contents.clear
  193.   end
  194. end
  195.  
  196. #------------------------------------------------------------------------------
  197.  
  198. class Game_Party
  199.   attr_reader   :actors2
  200.   attr_reader   :chaochao#不能从队伍向备用角色移动的角色ID
  201.   attr_reader   :chaochao2#不能从备用角色向队伍移动的角色ID
  202.   def initialize
  203.     @actors = []
  204.     @gold = 0
  205.     @steps = 0
  206.     @items = {}
  207.     @weapons = {}
  208.     @armors = {}
  209.     @actors2 = []
  210.     [url=home.php?mod=space&uid=9543]@chaochao[/url] = []
  211.     @chaochao2 = []
  212.   end
  213.   def add_actor(actor_id,type=1)#type为1是向队伍中添加,为2则相反。
  214.     case type
  215.     when 1
  216.       if $game_actors[actor_id] != nil
  217.         actor = $game_actors[actor_id]
  218.         #如果队伍没有满和队伍中没有此角色
  219.         if @actors.size < 4 and not @actors.include?(actor) and not @actors2.include?(actor)
  220.           @actors.push(actor)
  221.           $game_player.refresh
  222.         end
  223.       end
  224.     when 2
  225.       if $game_actors[actor_id] != nil
  226.         actor = $game_actors[actor_id]
  227.         #如果角色不在队伍中和不在备用角色队伍中的情况下
  228.         #向备用角色中添加角色
  229.         if not @actors.include?(actor) and not @actors2.include?(actor)
  230.           @actors2.push(actor)
  231.           $game_player.refresh
  232.         end
  233.       end
  234.     end
  235.   end
  236.  
  237.   def huanren(index,type=1)#type为1是从备用角色向队伍中移动,为2则相反。
  238.     actor = $game_actors[index]
  239.     case type
  240.     when 1
  241.       if @actors.size < 4 and @actors2.include?(actor) and not @chaochao2.include?(index) and not @actors.include?(actor)
  242.         @actors.push(actor)
  243.         @actors2.delete(actor)
  244.         $game_system.se_play($data_system.decision_se)
  245.         $game_player.refresh
  246.       end
  247.     when 2
  248.       if @actors.include?(actor) and not @chaochao.include?(index) and not @actors2.include?(actor)
  249.         @actors2.push(actor)
  250.         @actors.delete(actor)
  251.         $game_system.se_play($data_system.decision_se)
  252.         $game_player.refresh
  253.       end
  254.     end
  255.   end
  256.  
  257.   #type1,1是操作队伍中的角色能否向备用队伍移动,2则相反。
  258.   #type2,1是添加不能移动的,2是删除不能移动的。
  259.   def yidong(actor_id,type1,type2=1)
  260.     case type2
  261.     when 1
  262.       case type1
  263.       when 1
  264.         @chaochao.push(actor_id)
  265.       when 2
  266.         @chaochao2.push(actor_id)
  267.       end
  268.     when 2
  269.       case type1
  270.       when 1
  271.         @chaochao.delete(actor_id)
  272.       when 2
  273.         @chaochao2.delete(actor_id)
  274.       end
  275.     end
  276.   end
  277.  
  278.   #type,1从队伍中离开,2从备用角色中离开,3从队伍和备用角色中离开。
  279.   def remove_actor(actor_id,type=1)
  280.     actor = $game_actors[actor_id]
  281.     case type
  282.     when 1
  283.       @actors.delete(actor)
  284.       $game_player.refresh
  285.     when 2
  286.       @actors2.delete(actor)
  287.       $game_player.refresh
  288.     when 3
  289.       @actors.delete(actor)
  290.       @actors2.delete(actor)
  291.       $game_player.refresh
  292.     end
  293.   end
  294.  
  295.   def refresh
  296.     new_actors = []
  297.     new_actors2 = []
  298.     for i in [email]0...@actors.size[/email]
  299.       if $data_actors[@actors[i].id] != nil
  300.         new_actors.push($game_actors[@actors[i].id])
  301.       end
  302.     end
  303.     @actors = new_actors
  304.     for i in [email]0...@actors2.size[/email]
  305.       if $data_actors[@actors2[i].id] != nil
  306.         new_actors2.push($game_actors[@actors2[i].id])
  307.       end
  308.     end
  309.     @actors2 = new_actors2
  310.   end
  311. end
  312.  
  313. #------------------------------------------------------------------------------
  314.  
  315. class Chaochao_Scene_Party
  316.   def main
  317.     @left_temp_command = 0
  318.     @right_temp_command = 0
  319.     [url=home.php?mod=space&uid=263426]@temp[/url] = 0
  320.     @left_window = Chaochao_Window_PartyLeft.new
  321.     @left_window.active = true
  322.     @right_window = Chaochao_Window_PartyRight.new
  323.     @right_window.active = false
  324.     @data_window = Chaochao_Window_PartyData.new
  325.     update_data
  326.     Graphics.transition
  327.     loop do
  328.       Graphics.update
  329.       Input.update
  330.       update
  331.       if $scene != self
  332.         break
  333.       end
  334.     end
  335.     Graphics.freeze
  336.     @left_window.dispose
  337.     @right_window.dispose
  338.     @data_window.dispose
  339.   end
  340.  
  341.   def update
  342.     @left_window.update
  343.     @right_window.update
  344.     @data_window.update
  345.     update_command
  346.     update_data
  347.   end
  348.  
  349.   def update_command
  350.     if Input.trigger?(Input::B)
  351.       $game_system.se_play($data_system.cancel_se)
  352.       #画面切换
  353.       $scene = Scene_Map.new
  354.       return
  355.     end
  356.     if @left_window.active
  357.       update_left
  358.       return
  359.     end
  360.     if @right_window.active
  361.       update_right
  362.       return
  363.     end
  364.   end
  365.  
  366.   def update_left
  367.     if Input.trigger?(Input::RIGHT)
  368.       if @right_window.item_max > 0
  369.         @left_temp_command = @left_window.index
  370.         @left_window.set_index(-1)
  371.         $game_system.se_play($data_system.cursor_se)
  372.         @left_window.active = false
  373.         @right_window.active = true
  374.         @left_window.refresh
  375.         @right_window.refresh
  376.         @right_window.set_index(@right_temp_command)
  377.         return
  378.       else
  379.         $game_system.se_play($data_system.buzzer_se)
  380.         return
  381.       end
  382.     end
  383.     if Input.trigger?(Input::C)
  384.       if @left_window.active and @left_window.actor?(@left_window.index) and $game_party.actors.size > 1 and not $game_party.chaochao.include?($game_party.actors[@left_window.index].id)
  385.         $game_party.huanren($game_party.actors[@left_window.index].id,2)#type为1是从备用角色向队伍中移动,为2则相反。
  386.         @left_window.refresh
  387.         @right_window.refresh
  388.       else
  389.         $game_system.se_play($data_system.buzzer_se)
  390.       end
  391.     end
  392.     return
  393.   end
  394.  
  395.   def update_right
  396.     if Input.trigger?(Input::LEFT)
  397.       if @left_window.item_max > 0
  398.         @right_temp_command = @right_window.index
  399.         @right_window.set_index(-1)
  400.         $game_system.se_play($data_system.cursor_se)
  401.         @left_window.active = true
  402.         @right_window.active = false
  403.         @left_window.refresh
  404.         @right_window.refresh
  405.         @left_window.set_index(@left_temp_command)
  406.         return
  407.       else
  408.         $game_system.se_play($data_system.buzzer_se)
  409.         return
  410.       end
  411.     end
  412.     if Input.trigger?(Input::C)
  413.       if $game_party.actors.size >= 4
  414.         $game_system.se_play($data_system.buzzer_se)
  415.         return
  416.       end
  417.       if @right_window.active and @right_window.actor?(@right_window.index) and not $game_party.chaochao2.include?($game_party.actors2[@right_window.index].id)
  418.         $game_party.huanren($game_party.actors2[@right_window.index].id,1)#type为1是从备用角色向队伍中移动,为2则相反。
  419.         if $game_party.actors2.size == 0
  420.           @right_temp_command = @right_window.index
  421.           @right_window.set_index(-1)
  422.           $game_system.se_play($data_system.cursor_se)
  423.           @left_window.active = true
  424.           @right_window.active = false
  425.           @left_window.refresh
  426.           @right_window.refresh
  427.           @left_window.set_index(@left_temp_command)
  428.         end
  429.         if @right_window.index > 0
  430.           @right_window.set_index(@right_window.index-1)
  431.         end
  432.         @left_window.refresh
  433.         @right_window.refresh
  434.       else
  435.         $game_system.se_play($data_system.buzzer_se)
  436.       end
  437.     end
  438.     return
  439.   end
  440.  
  441.   def update_data
  442.     if @left_window.active
  443.       if $game_party.actors[@left_window.index] != nil
  444.         @data_window.set_actor($game_party.actors[@left_window.index])
  445.       else
  446.         @data_window.clear
  447.       end
  448.       return
  449.     end
  450.     if @right_window.active
  451.       if $game_party.actors2[@right_window.index] != nil
  452.         @data_window.set_actor($game_party.actors2[@right_window.index])
  453.       else
  454.         @data_window.clear
  455.       end
  456.       return
  457.     end
  458.   end
  459. end
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-3-9
帖子
39
4
 楼主| 发表于 2014-10-24 22:25:27 | 只看该作者
这两个就是偶现在用的脚本,那个...可以直接改的话当然很好,但我还放了几个字幕地图名得失物品提示嘲讽技能名字输入血条显示装备界面改良等等等等的脚本,不知道会不会不兼容,所以还是觉得重新写比较好......突然觉得自己有点作死诶......不过真的很麻烦各位大师,先谢谢你们啦!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-3-9
帖子
39
5
 楼主| 发表于 2014-10-24 22:57:37 | 只看该作者
附注:所需脚本效果:
1:战斗前选择出战队友
2:因为要有选择所以人物仓库上限至少45人
3:选择队友的系统可以自己设定在哪场战斗前启用
4:队友选择界面显示人物行走图和携带技能,因为我的设定是一个角色带一个技能,等级和职业就不用了因为都是固定的(嘿嘿剧情需要嘛)

难度似乎很高哈......又在做死了我.....也许还有其他的需要看情况再说好了......
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-3-9
帖子
39
6
 楼主| 发表于 2014-10-25 22:55:47 | 只看该作者
自顶一个好了...怕没人看见......
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-5 05:55

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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