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

Project1

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

[已经解决] 战斗中事件处理对话框的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
23 小时
注册时间
2013-8-30
帖子
27
跳转到指定楼层
1
发表于 2014-1-10 00:22:18 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 桃戊喵喵 于 2014-1-10 00:24 编辑

想在战斗中插入一段回忆作为战斗教程,结果发现对话框却在上面,我想按照平常一样在下面来着,用了更改文章选项也没有用,求大神帮忙看看


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


对话加强脚本是用这个:

代码复制
  1. #===============================================================
  2. #
  3. #    呼出对话框 ver. 1.31 By パラ犬(日)
  4. #  来自 [url]http://rpg.para.s3p.net/[/url]
  5. #
  6. #  汉化修改 66RPG bbschat(2006.1.5)
  7. #    来自
  8. #
  9. #    脚本更新:by KKME◎66RPG.com,2007年2月
  10. #
  11. #===============================================================
  12. #    ●准备工作-窗口Skin
  13. #
  14. #    首先,确认自己使用的对话框窗口Skin,(数据库-系统-窗口外观图形)
  15. #    然后根据该窗口Skin制作对话框尾部使用的两个箭头图形
  16. #    尾部箭头图形命名方式:“窗口skin名-top”,“窗口skin名-under”
  17. #    将该图形文件存放在“Graphics/Windowskins”文件夹下。
  18. #
  19. #    本演示游戏内置2套窗口和箭头图形,
  20. #    一套是游戏默认的“001-Blue01”,一套是定制的“fk”
  21. #    玩家可以根据自己的需要参照样本定制自己的呼出对话框窗口Skin。
  22. #
  23. #  ★●使用方法 edit by KKME◎66RPG.com
  24. #
  25. #    方法一:传统方法:输入脚本:chat(事件编号, "角色姓名")。这样就可以正常显示。
  26. #            这种方法虽然使用麻烦,但是有时候也会用到(比如不显示姓名的对话)。这种方法比方法二优先度高。
  27. #            当不需要这种对话功能时候,直接输入一个脚本:chat,就能全部清空。
  28. #
  29. #    方法二:新方法:直接输入对话,会自动读取人名。
  30. #            举例:首先将事件NPC命名,比如命名为“王小二”
  31. #            则输入对话:
  32. #               王小二:
  33. #               今天天气真好啊。
  34. #    这样就能直接将对话显示在这个NPC头上。如果姓名是我方队员则可自动显示在主角头上。
  35. #    这种方法对于我方队员的情况支持 \n[1]这样的效果。如
  36. #               \n[1]:
  37. #               明天听说要下雨。
  38. #    也能正确显示。对于一般的游戏制作这样已经足够了,如果还有特殊需求——小生是
  39. #    知道有可能需要什么特殊需求的:),其实也设置了接口可以满足,不过需要你自己研究一下。
  40. #            
  41. #
  42. #  ★●角色名字窗口使用角色图片的方法(汉化特别追加功能,原脚本只能使用文字)
  43. #   
  44. #    如果能在对应文件夹中找到文件名和角色名字相同的图片,   
  45. #    则角色名字窗口显示角色头像图片,角色图片最好能包括角色的名字。
  46. #    默认头像图片保存目录为“Graphics/Heads/”,玩家可自行修改。
  47. #
  48. #    如果不想使用角色名字直接作为头像文件名。可以使用下面在 Game_Temp 类里增加的namebmp属性。
  49. #    重新设定角色名字与文件名的对应关系。
  50. #
  51. #  KKME注:这里修改了原有算法,可以支持中文名。小生以为不再需要Game_Temp类了。
  52. #          这里小生知道也会有特殊需求,也是设置好接口了的。如果需要再自己研究或问我吧。不然说多了容易误导。  
  53. #
  54. #    ●信息表示速度的变更方法
  55. #
  56. #    在事件命令行使用[脚本]将数值代入[$mes_speed]
  57. #    速度为 0 即瞬间显示全部信息,数字越大,信息表示速度越慢。
  58. #   (举例:$mes_speed=1)
  59. #
  60. #    ●其他设置
  61. #    \o[150]: 设置对话文字透明度,用来模拟将死之人。<---------沉影不器
  62. #    \a[60]: 设置对话框自动关闭时间,数字是关闭的帧数。省略时间\a默认为45帧。<---------沉影不器
  63. #
  64. #    请参照下面的注释
  65. #===============================================================
  66.  
  67. module FUKI
  68.  
  69.   # 头像图片保存目录的设定
  70.   HEAD_PIC_DIR = "Graphics/Heads/"
  71.  
  72.   # 是否显示尾部图标
  73.   TAIL_SHOW = true
  74.  
  75.   # Skin的设定
  76.   # 使用数据库默认窗口Skin情况下这里使用[""]
  77.   FUKI_SKIN_NAME = ""   # 呼出对话框用Skin
  78.   NAME_SKIN_NAME = ""   # 角色名字窗口用Skin
  79.  
  80.   # 字体大小
  81.   MES_FONT_SIZE = 18    # 呼出对话框
  82.   NAME_FONT_SIZE = 18   # 角色名字窗口
  83.  
  84.   # 字体颜色
  85.   #(设定为 Color.new(0, 0, 0, 0) 表示使用普通文字色)
  86.   FUKI_COLOR = Color.new(255, 255, 255, 255)  # 呼出对话框
  87.   NAME_COLOR = Color.new(255, 255, 255, 255)  # 角色名字窗口
  88.  
  89.   # 窗口透明度
  90.   # 如修改窗口透明度请同时修改尾部箭头图形内部的透明度
  91.   FUKI_OPACITY = 160   # 呼出对话框
  92.   MES_OPACITY = 160     # 默认信息窗口
  93.   NAME_OPACITY =160    # 角色名字窗口
  94.  
  95.   # 角色名字窗口的相对位置
  96.   NAME_SHIFT_X = 0      # 横坐标
  97.   NAME_SHIFT_Y = 16     # 纵坐标
  98.  
  99.   # 窗口表示时是否根据画面大小自动检查窗口出现的位置,
  100.   # 自动改变位置( true / false )
  101.   # 设置成 true 在某些变态情况下可能出现箭头图标颠倒的问题 <- bbschat <= KKME
  102.   POS_FIX = true
  103.  
  104.   # 在画面最边缘表示时的稍微挪动
  105.   # 使用圆形Skin的角和方框的角重合的情况下为 true
  106.   CORNER_SHIFT = false
  107.   SHIFT_PIXEL = 4   # true 时挪动的象素
  108.  
  109.   # 角色高度尺寸
  110.   CHARACTOR_HEIGHT = 48
  111.   # 呼出对话框的相对位置(纵坐标)
  112.   POP_SHIFT_TOP = 0         # 表示位置为上的时候
  113.   POP_SHIFT_UNDER = 0       # 表示位置为下的时候
  114.  
  115.   # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  116.   # 游戏中 可随时用数字代入 $mes_speed 来改变消息表示速度。
  117.   MES_SPEED = 0
  118.   # 默认的文字自动消失时间为45帧
  119.   DEFAULT_AUTO_CLOSE_TIME = 45
  120. end
  121.  
  122.  
  123. #===============================================================
  124. # 初始化两个变量,不要动(by KKME◎66RPG.com)
  125. #===============================================================
  126. $mes_name = ""
  127. $mes_id   = nil
  128.  
  129.  
  130. #===============================================================
  131. # 方便用户同时设置2个常用参数而使用的函数
  132. #===============================================================
  133. def chat(id = nil,name = "")
  134.   $mes_id = id
  135.   $mes_name = name
  136. end
  137.  
  138. #===============================================================
  139. # □ Game_Temp
  140. #===============================================================
  141.  
  142. class Game_Temp
  143.   attr_accessor  :namebmp              #保存头像图片的Hash表
  144.   alias initialize_fuki initialize
  145.   def initialize
  146.     initialize_fuki
  147.     # 如果不想使用角色名字直接作为头像文件名
  148.     # 可在这里重新设定角色名字与文件名的对应关系
  149.     @namebmp ={}
  150.     end
  151. end
  152.  
  153. #===============================================================
  154. # □ Window_Message
  155. #===============================================================
  156.  
  157. class Window_Message < Window_Selectable
  158.  
  159.   #-----------------------------------------------------------
  160.   # ● 初始化状态
  161.   #-----------------------------------------------------------
  162.   def initialize
  163.     super(0, 160, 640, 160)
  164.     self.contents = Bitmap.new(width - 32, height - 32)
  165.     self.visible = false
  166.     self.z = 9998
  167.     @fade_in = false
  168.     @fade_out = false
  169.     @contents_showing = false
  170.     @cursor_width = 0
  171.     @kkme_name = ""
  172.     self.active = false
  173.     self.index = -1
  174.     @w = 0
  175.     @h = 0
  176.     @wait = 0
  177.     @dx = 0
  178.     @dy = 0
  179.     @auto_close=-1
  180.     $mes_speed = FUKI::MES_SPEED
  181.   end
  182.  
  183.   #-----------------------------------------------------------
  184.   # ○ 决定窗口尺寸并生成窗口
  185.   #-----------------------------------------------------------
  186.   def refresh_create
  187.     @kkme_name = ""
  188.     begin
  189.       @kkme_name = $game_temp.message_text.split(":")[0] if $game_temp.message_text.split(":")[1] != nil
  190.       $game_temp.message_text = $game_temp.message_text[@kkme_name.size + 4,$game_temp.message_text.size] if @kkme_name != ""
  191.     rescue
  192.     end
  193.     self.contents.clear
  194.     self.contents.font.color = normal_color
  195.     self.contents.font.size = FUKI::MES_FONT_SIZE
  196.     # 取得窗口尺寸
  197.     get_windowsize
  198.     w = @w + 32 + 8
  199.     h = @h * (self.contents.font.size + 10) + 26
  200.     # 生成呼出窗口
  201.     set_fukidasi(self.x, self.y, w, h)
  202.     # 生成角色名字窗口
  203.     set_namewindow
  204.     # 初始化信息表示使用的变量
  205.     @dx = @dy = 0
  206.     @cursor_width = 0
  207.     @contents_drawing = true
  208.     # 瞬间表示的情况下
  209.     if $mes_speed == 0
  210.       # 循环信息描绘处理
  211.       while $game_temp.message_text != ""
  212.         draw_massage
  213.       end
  214.       draw_opt_text
  215.       @contents_showing_end = true
  216.       @contents_drawing = false
  217.     else
  218.       # 一个一个描绘文字
  219.       refresh_drawtext
  220.     end
  221.   end
  222.  
  223.   #-----------------------------------------------------------
  224.   # ○ 一个一个描绘文字
  225.   #-----------------------------------------------------------
  226.   def refresh_drawtext
  227.     if $game_temp.message_text != nil
  228.       if @wait > 0
  229.         @wait -= 1
  230.       elsif @wait == 0
  231.         # 描绘处理
  232.         draw_massage
  233.         @wait = $mes_speed
  234.       end
  235.     end
  236.     # 描绘结束
  237.     if $game_temp.message_text == ""
  238.       draw_opt_text
  239.       @contents_showing_end = true
  240.       @contents_drawing = false
  241.     end
  242.   end
  243.  
  244.   #-----------------------------------------------------------
  245.   # ○ 取得窗口尺寸
  246.   #-----------------------------------------------------------
  247.   def get_windowsize
  248.     x = y = 0
  249.     @h = @w = 0
  250.     @cursor_width = 0
  251.     # 有选择项的话,处理字的缩进
  252.     if $game_temp.choice_start == 0
  253.       x = 16
  254.     end
  255.     # 有等待显示的文字的情况下
  256.     if $game_temp.message_text != nil
  257.     text = $game_temp.message_text.clone
  258.       # 限制文字处理
  259.       begin
  260.         last_text = text.clone
  261.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  262.       end until text == last_text
  263.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  264.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  265.       end
  266.       # 为了方便、将 "\\\\" 变换为 "\000"
  267.       text.gsub!(/\\\\/) { "\000" }
  268.       # "\\C" 变为 "\001" 、"\\G" 变为 "\002"
  269.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001" }
  270.       text.gsub!(/\\[Gg]/) { "\002" }
  271.       text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\003[#{$1}]" }
  272.       text.slice!(/\\[Aa]\[(\w+)\]/) { "" }
  273.       # c 获取 1 个字 (如果不能取得文字就循环)
  274.       while ((c = text.slice!(/./m)) != nil)
  275.         # \\ 的情况下
  276.         if c == "\000"
  277.           # 还原为本来的文字
  278.           c = "\\"
  279.         end
  280.         # \C[n] 或者 \G 的情况下
  281.         if c == "\001" or c == "\002"
  282.           # 下面的文字
  283.           next
  284.         end
  285.         # 另起一行文字的情况下
  286.         if c == "\n"
  287.           # y 累加 1
  288.           y += 1
  289.           # 取得纵横尺寸
  290.           @h = y
  291.           @w = x > @w ? x : @w
  292.           if y >= $game_temp.choice_start
  293.             @w = x + 8 > @w ? x + 8 : @w
  294.           end
  295.           x = 0
  296.           # 移动到选择项的下一行
  297.           if y >= $game_temp.choice_start
  298.             x = 8
  299.           end
  300.           # 下面的文字
  301.           next
  302.         end
  303.         # x 为要描绘文字的宽度加法运算
  304.         x += self.contents.text_size(c).width
  305.       end
  306.     end
  307.     # 输入数值的情况
  308.     if $game_temp.num_input_variable_id > 0
  309.       digits_max = $game_temp.num_input_digits_max
  310.       number = $game_variables[$game_temp.num_input_variable_id]
  311.       @h += 1
  312.       x = digits_max * self.contents.font.size + 16
  313.       @w = x > @w ? x : @w
  314.     end
  315.   end
  316.  
  317.   #-----------------------------------------------------------
  318.   # ○ 描绘信息处理
  319.   #-----------------------------------------------------------
  320.   def draw_massage
  321.     # 有等待显示的文字的情况下
  322.     if $game_temp.message_text != nil
  323.       text = $game_temp.message_text
  324.       # 限制文字处理
  325.       begin
  326.         last_text = text.clone
  327.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  328.       end until text == last_text
  329.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  330.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  331.       end
  332.       # 为了方便、将 "\\\\" 变换为 "\000"
  333.       text.gsub!(/\\\\/) { "\000" }
  334.       # "\\C" 变为 "\001"、"\\G" 变为 "\002"
  335.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  336.       text.gsub!(/\\[Gg]/) { "\002" }
  337.       text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\003[#{$1}]" }
  338.       if text.slice!(/\\[Aa]\[(\w+)\]/)!=nil
  339.         @auto_close=$1.to_i
  340.       else
  341.         if text.slice!(/\\[Aa]/)!=nil
  342.           @auto_close = FUKI::DEFAULT_AUTO_CLOSE_TIME
  343.         end
  344.       end
  345.       # c 获取 1 个字
  346.       if ((c = text.slice!(/./m)) != nil)
  347.         # 选择项的情况
  348.         if @dy >= $game_temp.choice_start
  349.           # 处理字的缩进
  350.           @dx = 8
  351.           # 描绘文字
  352.           self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  353.           # x 为要描绘文字宽度的加法运算
  354.           @dx += self.contents.text_size(c).width
  355.           # 循环
  356.           while ((c = text.slice!(/./m)) != "\n")
  357.             # 描绘文字
  358.             self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  359.             # x 为要描绘文字宽度的加法运算
  360.             @dx += self.contents.text_size(c).width
  361.           end
  362.           if c == "\n"
  363.             # 更新光标宽度
  364.             @cursor_width = [@cursor_width, @dx].max
  365.             # dy 累加 1
  366.             @dy += 1
  367.             @dx = 0
  368.           end
  369.           return
  370.         end
  371.         # \\ 的情况下
  372.         if c == "\000"
  373.           # 还原为本来的文字
  374.           c = "\\"
  375.         end
  376.  
  377.         #\C[n] 的情况下
  378.         if c == "\001"
  379.           # 更改文字色
  380.           text.sub!(/\[([0-9]+)\]/, "")
  381.           color = $1.to_i
  382.           if color >= 0 and color <= 7
  383.             self.contents.font.color = text_color(color)
  384.           end
  385.           return
  386.         end
  387.  
  388.         # \G 的情况下
  389.         if c == "\002"
  390.           # 生成金钱窗口
  391.           if @gold_window == nil
  392.             @gold_window = Window_Gold.new
  393.             @gold_window.x = 560 - @gold_window.width
  394.             if $game_temp.in_battle
  395.               @gold_window.y = 192
  396.             else
  397.               @gold_window.y = self.y >= 128 ? 32 : 384
  398.             end
  399.             @gold_window.opacity = self.opacity
  400.             @gold_window.back_opacity = self.back_opacity
  401.           end
  402.           return
  403.         end
  404.  
  405.         if c == "\003"
  406.           text.sub!(/\[([0-9]+)\]/, "")
  407.           self.contents.font.color.alpha = [[0, $1.to_i].max, 255].min
  408.           return
  409.         end
  410.  
  411.         # 另起一行文字的情况下
  412.         if c == "\n"
  413.           # dy 累加 1
  414.           @dy += 1
  415.           @dx = 0
  416.           return
  417.         end
  418.  
  419.         # 描绘文字
  420.         self.contents.font.size = FUKI::MES_FONT_SIZE
  421.         font_size = self.contents.font.size     
  422.         self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c)
  423.         # dx 为要描绘文字的宽度加法运算
  424.         @dx += self.contents.text_size(c).width
  425.       end
  426.     end
  427.   end
  428.  
  429.   #-----------------------------------------------------------
  430.   # ○ 选择项和输入数值的情况下
  431.   #-----------------------------------------------------------
  432.   def draw_opt_text
  433.     # 选择项的情况下
  434.     if $game_temp.choice_max > 0
  435.       @item_max = $game_temp.choice_max
  436.       self.active = true
  437.       self.index = 0
  438.     end
  439.     # 输入数值的情况下
  440.     if $game_temp.num_input_variable_id > 0
  441.       digits_max = $game_temp.num_input_digits_max
  442.       number = $game_variables[$game_temp.num_input_variable_id]
  443.       @input_number_window = Window_InputNumber.new(digits_max)
  444.       @input_number_window.number = number
  445.       @input_number_window.x = self.x + 8
  446.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  447.     end
  448.   end
  449.  
  450.   #-----------------------------------------------------------
  451.   # ○ 设置呼出对话框
  452.   #-----------------------------------------------------------
  453.   def set_fukidasi(x, y, width, height)
  454.     begin
  455.       # 不显示暂停标志
  456.       self.pause = false
  457.       # 取得对话框位置
  458.       pos = get_fuki_pos(width, height)
  459.       x = pos[0]
  460.       y = pos[1]
  461.       skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name
  462.       # 生成呼出对话框
  463.       self.windowskin = RPG::Cache.windowskin(skin)
  464.       self.x = x
  465.       self.y = y
  466.       self.height = height
  467.       self.width = width
  468.       self.contents.dispose
  469.       self.contents = Bitmap.new(width - 32, height - 32)
  470.       self.back_opacity = FUKI::FUKI_OPACITY
  471.       self.contents.clear
  472.       self.contents.font.color = normal_color
  473.       self.contents.font.size = FUKI::MES_FONT_SIZE
  474.       # 描绘尾部图标
  475.       if $game_system.message_frame == 0
  476.         # 取得位置
  477.         tale_pos = get_tale_pos
  478.         @tale = Sprite.new
  479.         # 是否显示尾部图标 <- bbschat
  480.         if FUKI::TAIL_SHOW == true
  481.           case @message_position
  482.             when 0  # 上
  483.               @tale.bitmap = RPG::Cache.windowskin(skin + "-top")
  484.               @tale.x = tale_pos[0]
  485.               @tale.y = tale_pos[1]
  486.               @tale.z = self.z + 1
  487.             when 1  # 中
  488.               @tale.dispose
  489.               @tale = nil
  490.             when 2  # 下
  491.               @tale.bitmap = RPG::Cache.windowskin(skin + "-under")
  492.               @tale.x = tale_pos[0]
  493.               @tale.y = tale_pos[1]
  494.               @tale.z = self.z + 1
  495.           end
  496.         end
  497.       end
  498.     rescue
  499.       del_fukidasi
  500.       reset_window(width, height)
  501.     end
  502.   end
  503.   #-----------------------------------------------------------
  504.   # ○ 新功能:根据输入文章计算呼出对话框的位置
  505.   #-----------------------------------------------------------
  506.   def get_character_KKME
  507.     if @kkme_name == "" or @kkme_name == nil
  508.       return nil
  509.     else
  510.       @kkme_name.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  511.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  512.       end
  513.       $mes_name = @kkme_name
  514.       for ev in $game_map.events.values
  515.         if ev.name == @kkme_name
  516.           return ev
  517.         end
  518.       end
  519.       for actor in $game_party.actors
  520.         if actor.name == @kkme_name
  521.           return $game_player
  522.         end
  523.       end
  524.       return nil
  525.     end
  526.   end
  527.  
  528.  
  529.   #-----------------------------------------------------------
  530.   # ○ 计算呼出对话框的位置
  531.   #-----------------------------------------------------------
  532.   def get_fuki_pos(width, height)
  533.  
  534.     # 取得角色
  535.     if $mes_id != nil
  536.       @character = get_character($mes_id)
  537.     else
  538.       @character = get_character_KKME
  539.     end
  540.     if @character == nil
  541.       # 角色不存在的情况下使用默认信息框
  542.       del_fukidasi
  543.       reset_window(width, height)
  544.       return
  545.     end
  546.     # 处理坐标
  547.     x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2)
  548.     # 为尽量显示在画面内而移动横坐标
  549.     if x + width > 640
  550.       x = 640 - width
  551.     elsif x < 0
  552.       x = 0
  553.     end
  554.     # 决定窗口位置
  555.     case $game_system.message_position
  556.       when 0  # 上
  557.         y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  558.       when 1  # 中
  559.         y = (480 - height) / 2
  560.         x = (640 - width) / 2
  561.       when 2  # 下
  562.         y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  563.     end
  564.     # 纪录文章显示位置
  565.     @message_position = $game_system.message_position
  566.     # 如果选择自动修正,则如果文章会显示到画面外则自动改变窗口的尺寸(高度)
  567.     if FUKI::POS_FIX
  568.       case @message_position
  569.         when 0  # 上
  570.           if y <= 0
  571.             @message_position = 2
  572.             y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  573.           end
  574.         when 2  # 下
  575.           if y + height >= 480
  576.             @message_position = 0
  577.             y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  578.           end
  579.       end
  580.     end
  581.     return [x,y]
  582.  
  583.   end
  584.  
  585.   #-----------------------------------------------------------
  586.   # ○ 计算尾部图标的位置
  587.   #-----------------------------------------------------------
  588.   def get_tale_pos
  589.     case @message_position
  590.       when 0  # 上
  591.         # 处理坐标
  592.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  593.         # 画面边缘的话则移动位置
  594.         if FUKI::CORNER_SHIFT
  595.           if x == 0
  596.             x = FUKI::SHIFT_PIXEL
  597.           elsif x == 640 - 32
  598.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  599.           end
  600.         end
  601.         y = self.y + self.height - 16
  602.       when 1  # 中
  603.         x = nil
  604.         y = nil
  605.       when 2  # 下
  606.         # 处理坐标
  607.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  608.         # 画面边缘的话则移动位置
  609.         if FUKI::CORNER_SHIFT
  610.           if x == 0
  611.             x = FUKI::SHIFT_PIXEL
  612.           elsif @tale.x == 640 - 32
  613.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  614.           end
  615.         end
  616.         y = self.y - 16
  617.     end
  618.     return [x,y]
  619.   end
  620.  
  621.   #-----------------------------------------------------------
  622.   # ○ 计算名字窗口的位置
  623.   #-----------------------------------------------------------
  624.   def get_name_pos
  625.     case @face_pic_txt
  626.       when 0  # 文字
  627.         x = self.x + FUKI::NAME_SHIFT_X
  628.         y = self.y - FUKI::NAME_FONT_SIZE - 16 + FUKI::NAME_SHIFT_Y
  629.       when 1  # 图片
  630.         if self.x >= @pic_width + 5
  631.           # 默认头像显示在对话框左边
  632.           x = self.x-@pic_width-5
  633.         else
  634.           # 对话框左边放不下时头像显示在右边
  635.           x = self.x + self.width
  636.         end
  637.         y = self.y+self.height/2 - (@pic_height + 5)/2
  638.       end
  639.  
  640.     return [x,y]
  641.   end
  642.  
  643.   #-----------------------------------------------------------
  644.   # ○ 设置角色名字窗口
  645.   #-----------------------------------------------------------
  646.   def set_namewindow
  647.  
  648.     # $mes_name为空时不显示角色名字窗口
  649.     if $mes_name == nil or $mes_name == ""
  650.       return
  651.     else
  652.       # 设定变量
  653.       mes_name = $mes_name
  654.       skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name
  655.  
  656.       #判断名称是否有对应的图片"Graphics/heads/" +
  657.       if $game_temp.namebmp[mes_name] == nil then
  658.         sFile = FUKI::HEAD_PIC_DIR + mes_name + ".png"
  659.       else
  660.         sFile = FUKI::HEAD_PIC_DIR + $game_temp.namebmp[mes_name] + ".png"
  661.       end
  662.  
  663.       #if FileTest.exist?(sFile) == true then
  664.       begin
  665.  
  666.         @face_pic_txt = 1                       #名字窗口使用头像<- bbschat
  667.  
  668.         # 生成头像
  669.         bmp = Bitmap.new(sFile)
  670.         @pic_width = bmp.width
  671.         @pic_height = bmp.height
  672.  
  673.         if self.x >= @pic_width + 5
  674.           # 默认头像显示在对话框右边
  675.           name_x = self.x + self.width
  676.         else
  677.           # 对话框右边放不下时头像显示在左边
  678.           name_x = self.x-@pic_width-5
  679.         end
  680.         name_y = self.y+self.height/2 - (@pic_height + 5)/2
  681.  
  682.         # 生成角色头像窗口
  683.         @name_win = Window_Base.new(name_x, name_y, @pic_width + 5, @pic_height + 5)
  684.         @name_win.windowskin = RPG::Cache.windowskin(skin)
  685.         @name_win.back_opacity =0     
  686.         @name_win.z = self.z + 1
  687.  
  688.         @name_contents = Sprite.new
  689.         @name_contents.x = name_x + 2
  690.         @name_contents.y = name_y + 2
  691.         @name_contents.bitmap = bmp
  692.         @name_contents.z = 999
  693.         #@name_contents.z = @name_win.z + 2     #这个用了似乎效果不好<- bbschat
  694.  
  695.       rescue
  696.  
  697.         @face_pic_txt = 0                       #名字窗口使用文字<- bbschat
  698.  
  699.         # 生成名字
  700.         name_width = mes_name.size / 2 * FUKI::NAME_FONT_SIZE
  701.         name_height = FUKI::NAME_FONT_SIZE
  702.         name_x = self.x + FUKI::NAME_SHIFT_X
  703.         name_y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y
  704.  
  705.         # 生成角色名字窗口(只有边框)
  706.         @name_win = Window_Base.new(name_x, name_y, name_width + 16, name_height + 16)
  707.         @name_win.windowskin = RPG::Cache.windowskin(skin)
  708.         @name_win.back_opacity = FUKI::NAME_OPACITY
  709.         @name_win.z = self.z + 1
  710.  
  711.         # 为了使空白比Windows类限定的更小使用双重结构
  712.         @name_contents = Sprite.new
  713.         @name_contents.x = name_x + 12
  714.         @name_contents.y = name_y + 8
  715.         @name_contents.bitmap = Bitmap.new(name_width, name_height)
  716.         @name_contents.z = @name_win.z + 2
  717.  
  718.         # 设定文字色
  719.         nil_color = Color.new(0,0,0,0)
  720.         if FUKI::NAME_COLOR != nil_color
  721.           @name_contents.bitmap.font.color = FUKI::NAME_COLOR
  722.         else
  723.           @name_contents.bitmap.font.color = normal_color
  724.         end
  725.         @name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE
  726.         # 调整窗口尺寸
  727.         rect = @name_contents.bitmap.text_size(mes_name)
  728.         @name_win.width = rect.width + 32
  729.         # 描画名字
  730.         @name_contents.bitmap.draw_text(rect, mes_name)
  731.       end
  732.     end
  733.  
  734.   end
  735.  
  736.   #-----------------------------------------------------------
  737.   # ○ 释放呼出对话框和角色名字窗口
  738.   #-----------------------------------------------------------
  739.   def del_fukidasi
  740.     if @tale != nil
  741.       @tale.dispose
  742.       @tale = nil
  743.     end
  744.     if @name_win != nil
  745.       @name_win.dispose
  746.       @name_win = nil
  747.       @name_contents.dispose
  748.       @name_contents = nil
  749.     end
  750.     self.opacity = 0
  751.     self.x = 80
  752.     self.width = 480
  753.     self.height = 160
  754.     self.contents.dispose
  755.     self.contents = Bitmap.new(width - 32, height - 32)
  756.     self.pause = true
  757.   end
  758.  
  759.   #-----------------------------------------------------------
  760.   # ○ 取得角色
  761.   #     parameter : 参数
  762.   #-----------------------------------------------------------
  763.   def get_character(parameter)
  764.     # 参数分歧
  765.     case parameter
  766.     when -1  # 玩家
  767.       return $game_player
  768.     when 0   # 该事件
  769.       events = $game_map.events
  770.       return events == nil ? nil : events[$active_event_id]
  771.     else     # 特定事件
  772.       events = $game_map.events
  773.       return events == nil ? nil : events[parameter]
  774.     end
  775.   end
  776.  
  777.   #-----------------------------------------------------------
  778.   # ● 设定窗口位置和不透明度
  779.   #-----------------------------------------------------------
  780.   def reset_window(width = nil, height = nil)
  781.     if height != nil and width != nil
  782.       self.x = (640 - width) / 2
  783.       self.width = width
  784.       self.height = height
  785.       self.contents.dispose
  786.       self.contents = Bitmap.new(width - 32, height - 32)
  787.     end
  788.  
  789.     if $game_temp.in_battle
  790.       self.y = 16
  791.     else
  792.       case $game_system.message_position
  793.       when 0  # 上
  794.         self.y = 16
  795.       when 1  # 中
  796.         self.y = 160
  797.       when 2  # 下
  798.         self.y = 304
  799.       end
  800.     end
  801.     if $game_system.message_frame == 0
  802.       self.opacity = 255
  803.     else
  804.       self.opacity = 0
  805.     end
  806.     self.back_opacity = FUKI::MES_OPACITY
  807.   end
  808.  
  809.   #-----------------------------------------------------------
  810.   # ● 刷新画面
  811.   #-----------------------------------------------------------
  812.   def update
  813.     super
  814.     # 呼出模式下跟随事件移动
  815.     if @tale != nil
  816.       pos = get_fuki_pos(self.width, self.height)
  817.       self.x = pos[0]
  818.       self.y = pos[1]
  819.  
  820.       tale_pos = get_tale_pos
  821.       @tale.x = tale_pos[0]
  822.       @tale.y = tale_pos[1]
  823.  
  824.       if @name_win != nil
  825.         name_pos = get_name_pos
  826.         @name_win.x = name_pos[0]
  827.         @name_win.y = name_pos[1]
  828.         case @face_pic_txt
  829.           when 0  # 文字
  830.             @name_contents.x = @name_win.x + 12
  831.             @name_contents.y = @name_win.y + 8
  832.           when 1  # 图片
  833.             @name_contents.x = @name_win.x + 2
  834.             @name_contents.y = @name_win.y + 2
  835.           end
  836.       end
  837.     end
  838.  
  839.     # 渐变的情况下
  840.     if @fade_in
  841.       self.contents_opacity += 24
  842.       if @name_win != nil
  843.         @name_win.opacity += 24
  844.       end
  845.       if @tale != nil
  846.         @tale.opacity += 24
  847.       end
  848.       if @input_number_window != nil
  849.         @input_number_window.contents_opacity += 24
  850.       end
  851.       if self.contents_opacity == 255
  852.         @fade_in = false
  853.       end
  854.       return
  855.     end
  856.     # 显示信息中的情况下
  857.     if @contents_drawing
  858.       refresh_drawtext
  859.       return
  860.     end
  861.     # 输入数值的情况下
  862.     if @input_number_window != nil
  863.       @input_number_window.update
  864.       # 确定
  865.       if Input.trigger?(Input::C)
  866.         $game_system.se_play($data_system.decision_se)
  867.         $game_variables[$game_temp.num_input_variable_id] =
  868.           @input_number_window.number
  869.         $game_map.need_refresh = true
  870.         # 释放输入数值窗口
  871.         @input_number_window.dispose
  872.         @input_number_window = nil
  873.         terminate_message
  874.       end
  875.       return
  876.     end
  877.     # 显示信息结束的情况下
  878.     if @contents_showing_end
  879.       # 不是显示选择项且不是呼出对话模式则显示暂停标志
  880.       if $game_temp.choice_max == 0 and @tale == nil
  881.         self.pause = true
  882.       else
  883.         self.pause = false
  884.       end
  885.       # 取消
  886.       if Input.trigger?(Input::B)
  887.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  888.           $game_system.se_play($data_system.cancel_se)
  889.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  890.           terminate_message
  891.         end
  892.       end
  893.       # 自动关闭
  894.       @auto_close > 0 ? @auto_close-=1 : @auto_close=-1
  895.       if @auto_close==0
  896.         # 文字还没有处理完的时候
  897.           # 选择项
  898.           if $game_temp.choice_max > 0
  899.             $game_system.se_play($data_system.decision_se)
  900.             $game_temp.choice_proc.call(self.index)
  901.           end
  902.           terminate_message
  903.           del_fukidasi
  904.         end
  905.       # 确定
  906.       if Input.trigger?(Input::C) and @auto_close == -1
  907.         if $game_temp.choice_max > 0
  908.           $game_system.se_play($data_system.decision_se)
  909.           $game_temp.choice_proc.call(self.index)
  910.         end
  911.         terminate_message
  912.         # 释放呼出窗口
  913.         del_fukidasi
  914.       end
  915.       return
  916.     end
  917.     # 在渐变以外的状态下有等待显示的信息与选择项的场合
  918.     if @fade_out == false and $game_temp.message_text != nil
  919.       @contents_showing = true
  920.       $game_temp.message_window_showing = true
  921.       reset_window
  922.       refresh_create
  923.       if @name_win != nil
  924.         @name_win.opacity = 0
  925.       end
  926.       if @tale != nil
  927.         @tale.opacity = 0
  928.       end
  929.       Graphics.frame_reset
  930.       self.visible = true
  931.       self.contents_opacity = 0
  932.       if @input_number_window != nil
  933.         @input_number_window.contents_opacity = 0
  934.       end
  935.       @fade_in = true
  936.       return
  937.     end
  938.     # 没有可以显示的信息、但是窗口为可见的情况下
  939.     if self.visible
  940.       @fade_out = true
  941.       self.opacity -= 48
  942.       if @name_win != nil
  943.         @name_win.opacity -= 48
  944.       end
  945.       if @tale != nil
  946.         @tale.opacity -= 48
  947.       end
  948.       if self.opacity == 0
  949.         self.visible = false
  950.         @fade_out = false
  951.         $game_temp.message_window_showing = false
  952.         del_fukidasi
  953.       end
  954.       return
  955.     end
  956.   end
  957.  
  958.   #-----------------------------------------------------------
  959.   # ● 释放
  960.   #-----------------------------------------------------------
  961.   def dispose
  962.     terminate_message
  963.     $game_temp.message_window_showing = false
  964.     if @input_number_window != nil
  965.       @input_number_window.dispose
  966.     end
  967.     super
  968.   end
  969.  
  970.   #-----------------------------------------------------------
  971.   # ● 信息结束处理
  972.   #-----------------------------------------------------------
  973.   def terminate_message
  974.     @auto_close = -1
  975.     self.active = false
  976.     self.pause = false
  977.     self.index = -1
  978.     self.contents.clear
  979.     # 清除显示中标志
  980.     @contents_showing = false
  981.     @contents_showing_end = false
  982.     unless @kkme_name == "" or @kkme_name == nil
  983.       $mes_name = ""
  984.       @kkme_name = ""
  985.     end
  986.     # 呼叫信息调用
  987.     if $game_temp.message_proc != nil
  988.       $game_temp.message_proc.call
  989.     end
  990.     # 清除文章、选择项、输入数值的相关变量
  991.     $game_temp.message_text = nil
  992.     $game_temp.message_proc = nil
  993.     $game_temp.choice_start = 99
  994.     $game_temp.choice_max = 0
  995.     $game_temp.choice_cancel_type = 0
  996.     $game_temp.choice_proc = nil
  997.     $game_temp.num_input_start = 99
  998.     $game_temp.num_input_variable_id = 0
  999.     $game_temp.num_input_digits_max = 0
  1000.     # 释放金钱窗口
  1001.     if @gold_window != nil
  1002.       @gold_window.dispose
  1003.       @gold_window = nil
  1004.     end
  1005.   end
  1006.  
  1007.   #-----------------------------------------------------------
  1008.   # ● 刷新光标矩形
  1009.   #-----------------------------------------------------------
  1010.   def update_cursor_rect
  1011.     if @index >= 0
  1012.       n = $game_temp.choice_start + @index
  1013.       self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  1014.     else
  1015.       self.cursor_rect.empty
  1016.     end
  1017.   end
  1018.   #-----------------------------------------------------------
  1019.   # ● 取得普通文字色
  1020.   #-----------------------------------------------------------
  1021.   def normal_color
  1022.     nil_color = Color.new(0,0,0,0)
  1023.     if FUKI::FUKI_COLOR != nil_color
  1024.       color = FUKI::FUKI_COLOR
  1025.     else
  1026.       color = super
  1027.     end
  1028.     return color
  1029.   end
  1030. end
  1031.  
  1032.  
  1033. #===============================================================
  1034. # ■ Window_InputNumber
  1035. #===============================================================
  1036.  
  1037. class Window_InputNumber < Window_Base
  1038.   #-----------------------------------------------------------
  1039.   # ● 初始化对像
  1040.   #     digits_max : 位数
  1041.   #-----------------------------------------------------------
  1042.   def initialize(digits_max)
  1043.     @digits_max = digits_max
  1044.     @number = 0
  1045.     # 从数字的幅度计算(假定与 0~9 等幅)光标的幅度
  1046.     dummy_bitmap = Bitmap.new(32, 32)
  1047.     dummy_bitmap.font.size = FUKI::MES_FONT_SIZE
  1048.     @cursor_width = dummy_bitmap.text_size("0").width + 8
  1049.     dummy_bitmap.dispose
  1050.     super(0, 0, @cursor_width * @digits_max + 32, 64)
  1051.     self.contents = Bitmap.new(width - 32, height - 32)
  1052.     self.contents.font.size = FUKI::MES_FONT_SIZE
  1053.     self.z += 9999
  1054.     self.opacity = 0
  1055.     @index = 0
  1056.     refresh
  1057.     update_cursor_rect
  1058.   end
  1059. end
  1060.  
  1061. #============================================================
  1062. # Game_Map,把events变量公开
  1063. #============================================================
  1064. class Game_Map
  1065.   attr_reader   :events
  1066. end
  1067.  
  1068. #============================================================
  1069. # 便于返回姓名
  1070. #============================================================
  1071. class Game_Event < Game_Character
  1072.   def name
  1073.     return @event.name
  1074.   end
  1075.   def name=(na)
  1076.     @event.name = na
  1077.   end
  1078. end
  1079.  
  1080. #============================================================
  1081. # 增加变量$active_event_id,用于在“本事件”显示对话
  1082. #============================================================
  1083. class Interpreter
  1084. #-----------------------------------------------------------
  1085. # ● 设置事件
  1086. #     event_id : 事件 ID
  1087. #-----------------------------------------------------------
  1088. alias setup_fuki setup
  1089. def setup(list, event_id)
  1090.    setup_fuki(list, event_id)
  1091.    # 如果不是战斗中
  1092.    if !($game_temp.in_battle)
  1093.      # 记录事件 ID
  1094.      $active_event_id = event_id
  1095.    end
  1096. end
  1097. end
  

评分

参与人数 1星屑 +35 收起 理由
︶ㄣ牛排ぶ + 35 手动认可奖励

查看全部评分

Lv4.逐梦者

「Pemercyia」


Urhurrenna

梦石
0
星屑
9340
在线时间
2745 小时
注册时间
2008-9-5
帖子
3540

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

2
发表于 2014-1-10 10:40:14 | 只看该作者
在对话框脚本里Ctrl+F搜索
  1. if $scene.is_a?(Scene_Battle)
复制代码
或者直接搜索
  1. Scene_Battle
复制代码
应该有对应的设定y值的句子~

点评

虽然按照你说的去搜索没搜到,不过倒是提供了一个思路哈,于是我果断把搜索词换成“battle”一项项检查,终于找到了嘎嘎,谢啦  发表于 2014-1-10 19:28

评分

参与人数 1星屑 +80 收起 理由
︶ㄣ牛排ぶ + 80 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-4 09:52

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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