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

Project1

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

[转载] 设定汉化-VA宠物小帮手系统-Falcao Pets Servants System 1.3

[复制链接]

Lv4.逐梦者

梦石
1
星屑
14790
在线时间
2106 小时
注册时间
2017-9-28
帖子
662
跳转到指定楼层
1
发表于 2017-12-5 23:35:45 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 Nil2018 于 2017-12-6 18:38 编辑

原网址:https://falcaorgss.wordpress.com/category/pets-servants-1-3/
作者:Falcao

RUBY 代码复制
  1. #==============================================================================#
  2. #  #*****************#                                                         #
  3. #  #*** By Falcao ***#          * Falcao Pets Servants System 1.3              #
  4. #  #*****************#          This script allow you to have pet servants     #
  5. #                               that perform a avance command system helping   #
  6. #       RMVXACE                 the game player to complete tasks.             #
  7. #                               Date: Octuber 4 2012                           #
  8. #                                                                              #
  9. # Falcao RGSS site:  [url=http://falcaorgss.wordpress.com]http://falcaorgss.wordpress.com[/url]                           #
  10. # Falcao Forum site: [url=http://makerpalace.com]http://makerpalace.com[/url]                                    #
  11. #                                                                              #
  12. #==============================================================================#
  13.  
  14. # 1.3 change log
  15. # - Fixed minor bug when mood overload with other mood commands
  16. # - Added option to enable or disable the followers spot for the pet
  17.  
  18. #-------------------------------------------------------------------------------
  19. # * Installation
  20. #
  21. # Paste this script above main, no graphics required just copy and paste it into
  22. # your project, 5 item have been created in the database, witch are the gift
  23. # bundle items, if you are using my FA Interactive system 2.0 paste this script
  24. # below it, commons events has been created, to show how to make custom commands
  25. #
  26. #-------------------------------------------------------------------------------
  27. # * 特点
  28. #
  29. # - 在宠物工厂里可以创造N多你想要的宠物
  30. # - 给宠物下达命令(可以下达无数个命令)
  31. # - 宠物可以升级
  32. # - 宠物有情绪值
  33. # - 当宠物情绪值满时可以获得小礼物
  34. # - 每只宠物在使用时都会获得特殊的队伍增益
  35. # - 指令行动包括:偷东西,拾取物品,触发对象,攀爬等等,
  36. # - 在宠物商店里购买宠物!
  37. # - 您可以为每个宠物分配独特的命令
  38. # - 宠物可以: 创造物品,武器,防具,金币,治疗队员,在你和它一起跳舞或玩耍时提升情绪值。
  39. # - 可以通过创建自定义事件实现自定义命令
  40. # - 命令冷却系统
  41. # - 支持该作者写的的鼠标系统
  42.  
  43. #-------------------------------------------------------------------------------
  44. # * 兼容性
  45. #
  46. # 尽管这个系统很复杂, 我认为它可以兼容任何其他系统的脚本(作者自信满满),
  47. # 已测试过ABS系统,像素移动系统等
  48. #-------------------------------------------------------------------------------
  49. # * 许可
  50. #
  51. # 只允许适用于非商业游戏
  52. # 如果你要用于商业游戏请联系我:  [email protected]
  53. #-------------------------------------------------------------------------------
  54.  
  55. #-------------------------------------------------------------------------------
  56. #                            * 脚本使用方法
  57. #
  58. # 在有行走图的事件指令中添加注释,位置任意,可多条都放在一个事件里
  59. #
  60. # /PET TRIGGER             - 触发事件页内容,可以使用'Trigger Targets cmd'(触发目标命令)
  61. # /PET CLIMB               - 事件可以让宠物攀爬,宠物攀爬过后可以带上角色一齐上去
  62. # /PET GRAB                - 事件可以被宠物拾取,宠物会翻山越岭把事件带到角色身边
  63. #
  64. # /PET STEAL ITEM x        - 可以从事件偷取物品x. 例如: PET STEAL ITEM 1
  65. # /PET STEAL WEAPON x      - 可以从事件偷取武器x. 例如: /PET STEAL WEAPON 5
  66. # /PET STEAL ARMOR x       - 可以从事件偷取防具x. 例如: /PET STEAL ARMOR 3
  67. # /PET STEAL GOLD x        - 可以从事件偷取金币x. 例如: /PET STEAL GOLD 35
  68. #                           
  69. # /PET STEAL CHANCE 1 / x  - 宠物偷任何东西的几率变为 1/x
  70. #                            例如: /PET STEAL CHANCE 1 / 3 (三分之一的几率)
  71. # /IGNORE TARGETING          The tags above use a event target to perform action
  72. #                            上面的标签使用事件目标来执行操作(?),
  73. #                             这将避免在地图上的事件被指定为目标
  74. #
  75. # 重要事项:
  76. # 宠物只能在每个事件的命令中执行一个任务,所以如果一个事件里同时存在可以偷物品的注释
  77. # 和可以偷钱的注释,那宠物只会去偷东西而不会偷钱。
  78. #-------------------------------------------------------------------------------
  79. #                       * 脚本呼出
  80. #
  81. # SceneManager.call(Scene_PetShop)      呼出宠物商店
  82. # SceneManager.call(Scene_PetCommands)  手动呼出宠物命令窗口
  83. #
  84. # $game_player.gamepet.mood_cmd(x)      添加提升心情命令X
  85.  
  86. # $game_player.adopt_pet(x)         如果你不想通过从商店购买宠物的方式来获得宠物
  87. #                          你可以手动添加它们,x为要添加的宠物id(在宠物工厂里设置)
  88. #
  89. # 在游戏demo里有细节和例子.
  90. #-------------------------------------------------------------------------------
  91.  
  92. module FalPet
  93.  
  94. #=============================================================================
  95. # * 宠物通用设定
  96.  
  97. # 起始最大情绪值
  98.   StartingMoodMax = 30
  99.  
  100. # 在获得第几个礼物之后宠物会升级?
  101.   Growing = 3
  102.  
  103. # 当宠物升级时,宠物最大情绪值的增长量(等级越高,越难伺候)
  104.   MoodMaxPlus = 18
  105.  
  106. # 当升级时宠物会给你一个礼物,在此定义礼物id和获得等级
  107. # 最高级获得最大的礼物
  108. # 格式: A => B        A = 宠物等级   B = 物品 id
  109.   GiftBundle = {
  110.  
  111.   1 => 17,
  112.   2 => 18,
  113.   3 => 19,
  114.   4 => 20,
  115.   5 => 21,
  116.  
  117.   }
  118.  
  119. # 宠物玩耍时显示的心情气泡
  120.   BalloonPlaying = 1
  121.  
  122. # 宠物死亡时显示的心情气泡
  123.   PlayDeadBalloon = 8
  124.  
  125. # 宠物舞蹈时播放的背景音乐
  126.   DancingBgm = "Town7"
  127.  
  128. # 当宠物情绪低落时显示的文本
  129.   MoodLowText = '有点伤心...'
  130.  
  131. # 当宠物情绪欣喜若狂时显示的文本(好像作者设定错了)
  132.   MoodOverageText = '啊啊啊'
  133.  
  134. # 当宠物情绪不高不低时显示的文本
  135.   MoodMediumText = '嘿嘿~'
  136.  
  137. # 当宠物情绪愉悦时显示的文本
  138.   MoodHight = '好开心啊啊啊!'
  139.  
  140. # 当选择事件目标时显示的指针图标索引
  141.   CursorIcon = 389
  142.  
  143. # 在宠物进行攀爬或拾取物品等动作时可能会被障碍物卡住,
  144. # 在被卡住几次后宠物会放弃?例如设定为3,那么前两次它被障碍物挡道时会跳过去,
  145. # 第三次则会放弃回来.
  146.   StuckCount = 5
  147.  
  148. # 呼出宠物命令的按钮, (默认的 :R 为键盘上的 W 键 )
  149.   CommandsKey = :R
  150.  
  151. # 是否可以使用呼出宠物命令的按钮
  152.   UseKey = true
  153.  
  154. # 允许主人为宠物叮嘱吗?(?)
  155.   YieldSpot = true
  156.  
  157. #=============================================================================
  158. #                      * 宠物工厂
  159. #
  160. # 在这里你想设定多少宠物就设定多少个, 设置它们的价格、特殊技能,给队伍的群体增益
  161. # 以下是10个已经设定好了的例子.(索引就是在8个角色的行走图中按从左到右,从上到下
  162. # 的顺序排序,最左上角的是0号,最右下角的是7号)
  163. #
  164.  
  165.   Pets = {
  166.                                                 #-----------------------------#
  167.                                                 #           * 叫声         #
  168.                                                 #
  169. # 宠物Id    行走图文件名  索引    宠物名   叫声音效文件名  音量     音调
  170.     1   =>  ["Animal",     0,    "斗罗",       "Dog",       80,     150],
  171.     2   =>  ["Animal",     1,    "蜜茶",       "Cat",       80,     100],
  172.     3   =>  ["Spiritual",  5,    "纳维斯",     "Ice1",      100,    100],
  173.     4   =>  ["Animal",     3,    "够多",       "Coin",      80,     100],
  174.     5   =>  ["Animal",     4,    "放屁牛",     "Cow",       80,     100],
  175.     6   =>  ["Animal",     5,    "懒懒",       "Horse",     80,     120],
  176.     7   =>  ["Animal",     6,    "尤特",       "Wolf",     100,     150],
  177.     8   =>  ["Monster3",   5,    "抓狂",       "Monster6",  80,     150],
  178.     9   =>  ["Monster3",   7,    "胆小鬼",     "Monster3",  80,     150],
  179.     10  =>  ["Monster3",   4,    "莱特",       "Miss",      80,     100],
  180.  
  181.   }
  182.  
  183. # 在宠物商店里显示的宠物售价
  184.   Price = {
  185.  
  186. #   宠物id   价格
  187.      1  =>   10000,
  188.      2  =>   200,
  189.      3  =>   700,
  190.      4  =>   100,
  191.      5  =>   500,
  192.      6  =>   3000,
  193.      7  =>   6000,
  194.      8  =>   8000,
  195.      9  =>   5000,
  196.      10 =>   900,
  197.  
  198.  
  199.  
  200.   }
  201.  
  202. # 你可以为每只宠物分配特殊命令(包括动作、施放和自定义三种),下边有16种命令.
  203. # 特殊命令不可以通过脚本更改(列出的只是默认的, 你可以创建更多其他的!)
  204.  
  205. # 10 = 触发目标     14 = 治疗队伍    18 = 获得金币    22 = 自定义1
  206. # 11 = 偷窃物品     15 = 获得物品    19 = 打起精神    23 = 自定义2
  207. # 12 = 拾取物品     16 = 获得武器    20 = 睡觉        24 = 自定义3
  208. # 13 = 攀爬         17 = 获得防具    21 = 钢铁身躯    25 = 自定义4
  209. #
  210. # 技能id要放在箭头后的括号里
  211.   Speciality = {
  212.  
  213. # 宠物id    命令id
  214.     1  =>  [10, 11, 12, 13, 14, 15, 16, 17, 18,19,20,28,29],
  215.     2  =>  [16],
  216.     3  =>  [14, 19, 21],
  217.     4  =>  [17],
  218.     5  =>  [15],
  219.     6  =>  [12],
  220.     7  =>  [11],
  221.     8  =>  [10, 20],
  222.     9  =>  [13],
  223.     10 =>  [18],
  224.  
  225.   }
  226.  
  227. #  在使用特定宠物时,队伍会获得增益,每个属性的变化都会在使用对应宠物时被添加
  228. #  在更换宠物时被消除。游戏里可以改变最大hp、物理攻击、魔法防御等8个属性,这让
  229. #  宠物可以各有所长。以下为例子。
  230.  
  231.   Bonus = {
  232.  
  233. # 宠物id                 * 属性变化
  234.     1  => [mhp =  10,   mmp =   0,   atk =   0,  defe =   0,
  235.            mat =   0,   mdf =   0,   agi =   0,  luk  =   0],
  236.  
  237.     2  => [mhp =  20,   mmp =  20,   atk =   2,  defe =  10,
  238.            mat =   1,   mdf =   1,   agi =  10,  luk  =  10],
  239.  
  240.     3  => [mhp = 200,   mmp = 200,   atk =   0,  defe =   20,
  241.            mat =   6,   mdf =   6,   agi =   0,  luk  =   0],
  242.  
  243.     4  => [mhp =   0,   mmp =   0,   atk =  10,  defe =   120,
  244.            mat =   0,   mdf =   0,   agi =   0,  luk  =   0],
  245.  
  246.     5  => [mhp = 100,   mmp =  50,   atk =   0,  defe =   0,
  247.            mat =   0,   mdf =   0,   agi =   0,  luk  =   0],
  248.  
  249.     6  => [mhp =   0,   mmp =   0,   atk =  10,  defe =   0,
  250.            mat =   0,   mdf =   0,   agi =   0,  luk  =  50],
  251.  
  252.     7  => [mhp =   0,   mmp =   0,   atk =   0,  defe =  60,
  253.            mat =   0,   mdf =  11,   agi =  10,  luk  =  10],
  254.  
  255.     8  => [mhp =  60,   mmp =  60,   atk =   9,  defe =   0,
  256.            mat =   0,   mdf =   0,   agi =   0,  luk  =   0],
  257.  
  258.     9  => [mhp =  50,   mmp =  50,   atk =  10,  defe =   0,
  259.            mat =   0,   mdf =   0,   agi =   0,  luk  =   0],
  260.  
  261.     10 => [mhp =   0,   mmp =   0,   atk =   0,  defe =  6,
  262.            mat =   0,   mdf =   0,   agi =  14,  luk  =  11],   
  263.  
  264.   }
  265.  
  266.  
  267. #=============================================================================
  268. #               * 宠物命令设定
  269. #
  270. # 有三种可以使用的命令: 默认、情绪值和特殊
  271. #
  272. #- 默认命令是最基础的,任何时候都可以对宠物使用
  273. #- 提升心情的命令就是可以增加宠物情绪值的动作,例如一起玩耍、跳舞等等
  274. #- 特殊命令就是给宠物下达任务,这个类别分为三个子类别: 动作, 施放 和自定义
  275. #
  276. # 术语解释
  277. #
  278. # Cmd_Name           - 命令名称
  279. # Cmd_IconIndex      - 命令图标索引
  280. # Cmd_Description    - 命令简短介绍
  281. # Cmd_CoolDown       - 下达第二个命令需要的等待时间,以秒计算
  282. #
  283. # Cmd_MoodGain       - 当使用提升心情命令时增加的情绪值数量
  284. # Cmd_ActionTime     - 命令实施所用时间,以帧计算(仅适用于特殊命令中的自定义)
  285. #
  286.  
  287. #===============================================================================
  288. # * 默认命令
  289.  
  290.   # 命令 1
  291.   Cmd1_Name = '切换宠物'
  292.   Cmd1_IconIndex = 217
  293.   Cmd1_Description = '将当前宠物切换'
  294.   Cmd1_CoolDown = 0
  295.  
  296.   # 命令 26
  297.   Cmd26_Name = '已获得宠物'
  298.   Cmd26_IconIndex = 168
  299.   Cmd26_Description = '查看已获得宠物的列表'
  300.   Cmd26_CoolDown = 0
  301.  
  302. #=============================================================================
  303. # * 提升心情命令
  304. #
  305. # 下边是8种默认的提升心情命令
  306. #
  307. # 2 = 跳跃         4 = 喘口气       6 = 转圈圈        8 = 跳舞
  308. # 3 = 转身         5 = 边跳边追赶   7 = 装死          9 = 蹦床
  309. #
  310. # 非默认提升心情命令只能通过事件脚本添加至菜单
  311. # $game_player.gamepet.mood_cmd(id)       id = 提升心情命令的id
  312.  
  313. # 设定默认提升心情命令,它们将会被自动添加至菜单
  314.   DeafaultMoodCommands = [2]
  315.  
  316.   # 命令 2
  317.   Cmd2_Name = '跳跃'
  318.   Cmd2_IconIndex = 122
  319.   Cmd2_Description = '通过跳跃来表达自己的喜悦'
  320.   Cmd2_CoolDown = 8
  321.   Cmd2_MoodGain = 4
  322.  
  323.   # 命令 3
  324.   Cmd3_Name = '转身'
  325.   Cmd3_IconIndex = 12
  326.   Cmd3_Description = '命令其转身'
  327.   Cmd3_CoolDown = 20
  328.   Cmd3_MoodGain = 8
  329.  
  330.   # 命令 4
  331.   Cmd4_Name = '喘口气'
  332.   Cmd4_IconIndex = 177
  333.   Cmd4_Description = '宠物喘一口大气'
  334.   Cmd4_CoolDown = 10
  335.   Cmd4_MoodGain = 6
  336.  
  337.   # 命令 5
  338.   Cmd5_Name = '边跳边追赶'
  339.   Cmd5_IconIndex = 176
  340.   Cmd5_Description = '奔向它帅气的主人'
  341.   Cmd5_CoolDown = 18
  342.   Cmd5_MoodGain = 10
  343.  
  344.   # 命令 6
  345.   Cmd6_Name = '转圈圈'
  346.   Cmd6_IconIndex = 103
  347.   Cmd6_Description = '疯狂转圈圈'
  348.   Cmd6_CoolDown = 30
  349.   Cmd6_MoodGain = 16
  350.  
  351.   # 命令 7
  352.   Cmd7_Name = '装死'
  353.   Cmd7_IconIndex = 1
  354.   Cmd7_Description = '假装自己死了'
  355.   Cmd7_CoolDown = 60
  356.   Cmd7_MoodGain = 22
  357.  
  358.   # 命令 8
  359.   Cmd8_Name = '跳舞'
  360.   Cmd8_IconIndex = 118
  361.   Cmd8_Description = '宠物开始翩翩起舞!'
  362.   Cmd8_CoolDown = 120
  363.   Cmd8_MoodGain = 46
  364.  
  365.   # 命令 9
  366.   Cmd9_Name = '蹦床'
  367.   Cmd9_IconIndex = 119
  368.   Cmd9_Description = '假装我们在玩蹦床!'
  369.   Cmd9_CoolDown = 120
  370.   Cmd9_MoodGain = 36
  371.  
  372. #=============================================================================
  373. # * 特殊命令设定
  374. #=============================================================================
  375. # * 动作命令
  376.  
  377.   # 命令 10
  378.   Cmd10_Name = '触发目标'
  379.   Cmd10_IconIndex = 398
  380.   Cmd10_Description = '命令宠物触发选中的目标'
  381.   Cmd10_CoolDown = 0
  382.  
  383.   # 命令 11
  384.   Cmd11_Name = '偷东西'
  385.   Cmd11_IconIndex = 9
  386.   Cmd11_Description = '命令宠物去偷东西或偷钱'
  387.   Cmd11_CoolDown = 0
  388.  
  389.   # 命令 12
  390.   Cmd12_Name = '拾取物品'
  391.   Cmd12_IconIndex = 491
  392.   Cmd12_Description = '命令宠物拾取选中的物品'
  393.   Cmd12_CoolDown = 0
  394.  
  395.   # 命令 13
  396.   Cmd13_Name = '攀爬'
  397.   Cmd13_IconIndex = 275
  398.   Cmd13_Description = '命令宠物帮助主人攀爬'
  399.   Cmd13_CoolDown = 0
  400.  
  401. #=============================================================================
  402. # * 施放命令
  403.  
  404.   # 命令 14
  405.   Cmd14_Name = '治疗队伍'
  406.   Cmd14_IconIndex = 14
  407.   Cmd14_Description = '为全体队员回复固定百分比的HP和MP'
  408.   Cmd14_CoolDown = 60
  409.  
  410.   # 回复的百分比有四种: '25%'  '50%'   '75%'  '100%'
  411.   HealPercent = '75%'
  412. #---------------------
  413.  
  414.   # 命令 15
  415.   Cmd15_Name = '获得物品'
  416.   Cmd15_IconIndex = 213
  417.   Cmd15_Description = '获得随机物品'
  418.   Cmd15_CoolDown = 120
  419.  
  420.   # 在宠物获得物品时播放的动画id
  421.   ItemAnime = 107
  422.  
  423.   # 设定可以获得的物品和几率
  424.   # A => B     A = 物品 id    B = 几率
  425.   RandomItems = {
  426.  
  427.   1 =>  10,
  428.   2 =>  25,
  429.   6 =>  35,
  430.  
  431.   }
  432. #-----------------------
  433.  
  434.   # 命令 16
  435.   Cmd16_Name = '获得武器'
  436.   Cmd16_IconIndex = 402
  437.   Cmd16_Description = '获得随机武器'
  438.   Cmd16_CoolDown = 240
  439.  
  440.   # 在宠物获得武器时播放的动画id
  441.   WeaponAnime = 107
  442.  
  443.   # 设定可以获得的武器和几率
  444.   # A => B     A = 武器 id    B = 几率
  445.   RandomWeapons = {
  446.  
  447.   1 => 11,
  448.   2 => 2,
  449.   6 => 7,
  450.  
  451.   }
  452. #-------------------------
  453.  
  454.   # 命令 17
  455.   Cmd17_Name = '获得防具'
  456.   Cmd17_IconIndex = 170
  457.   Cmd17_Description = '获得随机防具'
  458.   Cmd17_CoolDown = 300
  459.  
  460.   # 在宠物获得防具时播放的动画id
  461.   ArmorAnime = 107
  462.  
  463.   # 设定可以获得的武器和几率
  464.   # A => B     A = 武器 id    B = 几率
  465.   RandomArmors = {
  466.  
  467.   1 => 17,
  468.   2 => 2,
  469.   6 => 8,
  470.  
  471.   }
  472. #--------------------------
  473.   # 命令 18
  474.   Cmd18_Name = '获得金币'
  475.   Cmd18_IconIndex = 344
  476.   Cmd18_Description = '获得随机数量的金币'
  477.   Cmd18_CoolDown = 180
  478.  
  479.   # 在宠物获得金币时播放的动画id
  480.   GoldAnime = 107
  481.  
  482.   # 在括号里设定可以获得的金币数值
  483.   RandomGold = [100, 25, 77, 45, 88]
  484.  
  485.  
  486. #--------------------------
  487.   # 命令 19
  488.   Cmd19_Name = '打起精神'
  489.   Cmd19_IconIndex = 112
  490.   Cmd19_Description = '在短时间内瞬间完成技能冷却!'
  491.   Cmd19_CoolDown = 600
  492.  
  493.   # 瞬间完成冷却的状态持续时间
  494.   BuffDuration = 60
  495.  
  496. #=============================================================================
  497. # * 自定义命令
  498. #
  499. # 自定义命令通过公共事件来执行, 在命令执行时一个开关会被开启,命令结束时则关闭开关
  500. # 所以公共事件的触发条件应该设定为:并行处理
  501.  
  502.   # 当自定义命令执行时开启的开关号
  503.   CustomSwitch = 2
  504.  
  505. # 下面为当自定义命令执行时可以在公共事件里使用的脚本
  506. #
  507. # * 基础
  508. #
  509. # pet                  获取当前使用的宠物
  510. # pet.cmd(id)          获取宠物指令 (id为命令id)
  511. # pet.time?(x)         获取当前命令行动时间(x为整数)
  512. # pet.level            获取当前宠物的等级
  513. # pet.ending?          检查动作时间命令是否完成
  514. #
  515. # * 行动
  516. #
  517. # pet.prepare          玩家和宠物面对面   
  518. # pet.liedown          宠物躺下                 
  519. # pet.reset_liedown    宠物起身
  520. # pet.cast             宠物做出释放姿态
  521. # pet.jump_high(x,y,h) 比平时跳得更高
  522. # pet.play_voice       播放宠物叫声
  523. # pet.pop_mood         宠物开始获得主人下达的自定义心情命令
  524. # pet.pop_text("t",time) 宠物头上弹出自定义文本窗口。t 改为 '要显示的文字'
  525. #                      time 为显示的时间(秒)。
  526. # pet.zoom(x, y)       宠物开始缩放, x、y 可以带小数.
  527. # pet.reset_zoom       宠物缩放复原         
  528. #
  529. # 这些是宠物的特殊命令,因为宠物也是一个行走图,所以特可以使用任何事件中的移动
  530. # 路线指令,例如:向上移动、远离玩家,等等.
  531.  
  532.  
  533.  
  534.  
  535.   # 命令 20
  536.   Cmd20_Name = '睡觉'
  537.   Cmd20_IconIndex = 6
  538.   Cmd20_Description = '开始睡觉'
  539.   Cmd20_CoolDown = 40
  540.   Cmd20_MoodGain = 12
  541.   Cmd20_ActionTime = 300
  542.   Cmd20_Type = 'Mood +'
  543.  
  544.   # 命令 21
  545.   Cmd21_Name = '钢铁身躯'
  546.   Cmd21_IconIndex = 13
  547.   Cmd21_Description = '释放魔法护盾'
  548.   Cmd21_CoolDown = 120
  549.   Cmd21_MoodGain = 0
  550.   Cmd21_ActionTime = 200
  551.   Cmd21_Type = 'Casting'
  552.  
  553.   # 命令 22
  554.   Cmd22_Name = '命令名称'
  555.   Cmd22_IconIndex = 111
  556.   Cmd22_Description = '任何描述'
  557.   Cmd22_CoolDown = 5
  558.   Cmd22_MoodGain = 0
  559.   Cmd22_ActionTime = 200
  560.   Cmd22_Type = 'Casting'
  561.  
  562.   # 命令 23
  563.   Cmd23_Name = '命令名称'
  564.   Cmd23_IconIndex = 344
  565.   Cmd23_Description = '任何描述'
  566.   Cmd23_CoolDown = 5
  567.   Cmd23_MoodGain = 0
  568.   Cmd23_ActionTime = 200
  569.   Cmd23_Type = ''
  570.  
  571.   # 命令 24
  572.   Cmd24_Name = '命令名称'
  573.   Cmd24_IconIndex = 344
  574.   Cmd24_Description = '任何描述'
  575.   Cmd24_CoolDown = 5
  576.   Cmd24_MoodGain = 0
  577.   Cmd24_ActionTime = 200
  578.   Cmd24_Type = ''
  579.  
  580.   # 命令 25
  581.   Cmd25_Name = '命令名称'
  582.   Cmd25_IconIndex = 344
  583.   Cmd25_Description = '任何描述'
  584.   Cmd25_CoolDown = 5
  585.   Cmd25_MoodGain = 0
  586.   Cmd25_ActionTime = 200
  587.   Cmd25_Type = ''
  588.  
  589.   #-----------------------------------------------------------------------------
  590.   # * 命令数据库(不需要你来设定)
  591.   Commands = {
  592.   #切换宠物
  593.   1 =>  [Cmd1_Name,   c = 1, ii = Cmd1_IconIndex,  t = 0,   tg = false, nil,
  594.          Cmd1_Description, Cmd1_CoolDown, 0, ty = '触发'],
  595.   #跳跃
  596.   2 =>  [Cmd2_Name,  c = 2, Cmd2_IconIndex,      t = 160, tg = false, nil,
  597.          Cmd2_Description, Cmd2_CoolDown, Cmd2_MoodGain, ty = '提升心情'],
  598.   #转身
  599.   3 =>  [Cmd3_Name, c = 3, Cmd3_IconIndex, t = 160, tg = false, nil,
  600.          Cmd3_Description, Cmd3_CoolDown, Cmd3_MoodGain, ty = '提升心情'],
  601.   #喘口气
  602.   4 =>  [Cmd4_Name,      c = 4, ii = Cmd4_IconIndex,  t = 160, tg = false, nil,
  603.          Cmd4_Description, Cmd4_CoolDown, Cmd4_MoodGain, ty = '提升心情'],
  604.  
  605.   5 =>  [Cmd5_Name,      c = 5, Cmd5_IconIndex,  t = 160, tg = false, nil,
  606.          Cmd5_Description, Cmd5_CoolDown, Cmd5_MoodGain, ty = '提升心情'],
  607.  
  608.   6 =>  [Cmd6_Name,      c = 6, Cmd6_IconIndex,  t = 200, tg = false, nil,
  609.          Cmd6_Description, Cmd6_CoolDown, Cmd6_MoodGain, ty = '提升心情'],
  610.  
  611.   7 =>  [Cmd7_Name,      c = 7, Cmd7_IconIndex,  t = 500, tg = false, nil,
  612.          Cmd7_Description, Cmd7_CoolDown, Cmd7_MoodGain, ty = '提升心情'],
  613.  
  614.   8 =>  [Cmd8_Name,      c = 8, Cmd8_IconIndex,  t = 500, tg = false, nil,
  615.          Cmd8_Description, Cmd8_CoolDown, Cmd8_MoodGain, ty = '提升心情'],
  616.  
  617.   9 =>  [Cmd9_Name,      c = 9, Cmd9_IconIndex,  t = 400, tg = false, nil,
  618.          Cmd9_Description, Cmd9_CoolDown, Cmd9_MoodGain, ty = '提升心情'],
  619.   #----------------------- 行动
  620.  
  621.   10 => [Cmd10_Name,    c = 10,  Cmd10_IconIndex, t = 0,   tg = true, nil,
  622.          Cmd10_Description, Cmd10_CoolDown, 0, ty = '行动'],
  623.  
  624.   11 => [Cmd11_Name,    c = 11,  Cmd11_IconIndex, t = 0,   tg = true, nil,
  625.          Cmd11_Description, Cmd11_CoolDown, 0, ty = '行动'],
  626.  
  627.   12 => [Cmd12_Name,    c = 12,  Cmd12_IconIndex, t = 0,   tg = true, nil,
  628.          Cmd12_Description, Cmd12_CoolDown, 0, ty = '行动'],
  629.  
  630.   13 => [Cmd13_Name,    c = 13,  Cmd13_IconIndex, t = 0,   tg = true, nil,
  631.          Cmd13_Description, Cmd13_CoolDown, 0, ty = '行动'],
  632.   #-------------------- 释放
  633.  
  634.   14 => [Cmd14_Name,    c = 14,  Cmd14_IconIndex, t = 300,   tg = false, nil,
  635.          Cmd14_Description, Cmd14_CoolDown, 0, ty = '释放'],
  636.  
  637.   15 => [Cmd15_Name,    c = 15,  Cmd15_IconIndex, t = 200,   tg = false, nil,
  638.          Cmd15_Description, Cmd15_CoolDown, 0, ty = '释放'],
  639.  
  640.   16 => [Cmd16_Name,    c = 16,  Cmd16_IconIndex, t = 200,   tg = false, nil,
  641.          Cmd16_Description, Cmd16_CoolDown, 0, ty = '释放'],
  642.  
  643.   17 => [Cmd17_Name,    c = 17,  Cmd17_IconIndex, t = 200,   tg = false, nil,
  644.          Cmd17_Description, Cmd17_CoolDown, 0, ty = '释放'],
  645.  
  646.   18 => [Cmd18_Name,    c = 18,  Cmd18_IconIndex, t = 200,   tg = false, nil,
  647.          Cmd18_Description, Cmd18_CoolDown, 0, ty = '释放'],
  648.  
  649.   19 => [Cmd19_Name,    c = 19,  Cmd19_IconIndex, t = 200,   tg = false, nil,
  650.          Cmd19_Description, Cmd19_CoolDown, 0, ty = '释放'],
  651.  
  652.   #----------------------- 自定义      
  653.   #睡觉
  654.   20 => [Cmd20_Name, c = 20, Cmd20_IconIndex, Cmd20_ActionTime, tg = false, nil,
  655.          Cmd20_Description, Cmd20_CoolDown, Cmd20_MoodGain, Cmd20_Type],
  656.   #钢铁身躯
  657.   21 => [Cmd21_Name, c = 21, Cmd21_IconIndex, Cmd21_ActionTime, tg = false, nil,
  658.          Cmd21_Description, Cmd21_CoolDown, Cmd21_MoodGain, Cmd21_Type],
  659.  
  660.   22 => [Cmd22_Name, c = 22, Cmd22_IconIndex, Cmd22_ActionTime, tg = false, nil,
  661.          Cmd22_Description, Cmd22_CoolDown, Cmd22_MoodGain, Cmd22_Type],
  662.  
  663.   23 => [Cmd23_Name, c = 23, Cmd23_IconIndex, Cmd23_ActionTime, tg = false, nil,
  664.          Cmd23_Description, Cmd23_CoolDown, Cmd23_MoodGain, Cmd23_Type],
  665.  
  666.   24 => [Cmd24_Name, c = 24, Cmd24_IconIndex, Cmd24_ActionTime, tg = false, nil,
  667.          Cmd24_Description, Cmd24_CoolDown, Cmd24_MoodGain, Cmd24_Type],
  668.  
  669.   25 => [Cmd25_Name, c = 25, Cmd25_IconIndex, Cmd25_ActionTime, tg = false, nil,
  670.          Cmd25_Description, Cmd25_CoolDown, Cmd25_MoodGain, Cmd25_Type],
  671.   #--------------------------------------------------------------
  672.  
  673.   26 => [Cmd26_Name,    c = 26,  Cmd26_IconIndex, t = 0,   tg = false, s = true,
  674.          Cmd26_Description, Cmd26_CoolDown, 0, ty = '列表'],
  675.  
  676.   #----这是脚本的返回,不要改它
  677.  
  678.   27 => [nil, nil, nil, nil, nil, nil,
  679.          nil, nil, nil, nil],
  680.  
  681.   #-----------------------------------------------------------------------------
  682.   # 需要更多的自定义命令吗?你可以创造任意数量的自定义命令
  683.   # 在已设定的命令数据库中已有27个命令,下一个命令为28号,下边为28号的格式
  684.   #  28 => ['名称', id, 图标索引, 行动时间, false, nil,
  685.   #          '描述',冷却时间, 获得情绪值, 类型],
  686.   #
  687.   #  所以28号的设定可以这样写:
  688.   #
  689.   # 28 => ['吃瓜', id = 28,  19,  200, false, nil,
  690.   #        '吃瓜看戏美滋滋', 5, 200, '提升心情'],
  691.   #
  692.   #
  693.   # 不要更改数据中的"false, nil" 他们是行动命令的默认设定
  694.   #-----------------------------------------------------------------------------
  695.   # * 在下面的空白处,括号之前设计自己想要的命令吧!
  696.  
  697.  
  698.  
  699.  
  700.  
  701.   }
  702.  
  703. end
  704.  
  705.  
  706. #-------------------------------------------------------------------------------
  707. # Game Pet class
  708.  
  709. class Game_Pet < Game_Character
  710.   include FalPet
  711.   attr_accessor :command, :stucked, :lastspot, :action_time, :short_jump
  712.   attr_accessor :chase_event_id, :mood, :cooldown, :unlock_command,:reservedmood
  713.   attr_accessor :pet_level, :grow_inflation, :lvup_pop, :stealed_item, :pet_id
  714.   attr_accessor :character_name, :character_index, :petname, :sounds, :casting
  715.   attr_accessor :randomitem, :custom_mode, :stuck_count, :instantcd, :through
  716.   def initialize
  717.     super
  718.     @pet_id = 0
  719.     @priority_type = 1
  720.     @mood = 0
  721.     @pet_level = 1
  722.     @cooldown = []
  723.     FalPet::Commands.keys.size.times do ; @cooldown.push(0) ; end
  724.     @unlock_command = DeafaultMoodCommands
  725.     @grow_inflation = [StartingMoodMax, grow = 0, GiftBundle.max_by{|k,v| v}[0]]
  726.     @lvup_pop = false
  727.     @instantcd = 0
  728.     @reservedmood = 0
  729.     reset_pet
  730.   end
  731.  
  732.   def reset_pet
  733.     @command = 0
  734.     @stucked = 0
  735.     @action_time = 0
  736.     @short_jump = false
  737.     @lastspot = nil
  738.     @casting = false
  739.     @custom_mode = nil
  740.     @stuck_count = 0
  741.     @through = true
  742.     $game_switches[CustomSwitch] = false if $game_switches[CustomSwitch]
  743.   end
  744.  
  745.   # set up
  746.   def setup_pet(id)
  747.     get_bonus(@pet_id, sub = true) if @pet_id > 0
  748.     @pet_id = id
  749.     set = Pets[@pet_id]
  750.     @character_name = set[0]
  751.     @character_index = set[1]
  752.     @petname = set[2]
  753.     @sounds = [set[3], set[4], set[5]]
  754.     @balloon_id = 1 if SceneManager.scene_is?(Scene_Map)
  755.     play_voice
  756.     get_bonus(@pet_id)
  757.   end
  758.  
  759.   def get_bonus(id, sub=false)
  760.     set = Bonus[id]
  761.     for member in $game_party.members
  762.       for i in 0...8
  763.         sub ? member.add_param(i, -set[i]) : member.add_param(i, set[i])
  764.       end
  765.     end
  766.   end
  767.  
  768.   def play_voice
  769.     RPG::SE.new(@sounds[0],@sounds[1],@sounds[2]).play
  770.   end
  771.  
  772.   def busy?
  773.     @command > 0
  774.   end
  775.  
  776.   def custom_command?
  777.     return true if @command.between?(20, 25)
  778.     return true if @command.between?(28, FalPet::Commands.keys.size)
  779.     return false
  780.   end
  781.  
  782.   def time?(t)
  783.     t == @action_time
  784.   end
  785.  
  786.   def prepare
  787.     $game_player.prepare_petact
  788.   end
  789.  
  790.   def pop_text(text, time)
  791.     $game_player.gamepet.custom_mode = text
  792.     $game_player.petpop_time = time * 60
  793.   end
  794.  
  795.   def pop_mood
  796.     $game_player.start_poping_window(1, 3)
  797.   end
  798.  
  799.   def level
  800.     return @pet_level
  801.   end
  802.  
  803.   def cast
  804.     @casting = true
  805.   end
  806.  
  807.   def ending?
  808.     @action_time == 2
  809.   end
  810.  
  811.   def cmd?(c)
  812.     c == @command
  813.   end
  814.  
  815.   def play_balloon
  816.     @balloon_id = BalloonPlaying
  817.   end
  818.  
  819.   def zoom(x, y)
  820.     @zoomfx_x = x
  821.     @zoomfx_y = y
  822.   end
  823.  
  824.   def reset_zoom
  825.     @zoomfx_x = 1.0
  826.     @zoomfx_y = 1.0
  827.   end
  828.  
  829.   def gain_mood(n)
  830.     @mood = [[@mood + n, 0].max, @grow_inflation[0]].min
  831.   end
  832.  
  833.   def gain_level(n)
  834.     @pet_level = [[@pet_level + n, 0].max, @grow_inflation[2]].min
  835.   end
  836.  
  837.   def mood_full?
  838.     @mood == @grow_inflation[0]
  839.   end
  840.  
  841.   # apply pet growing
  842.   def apply_growing
  843.     @grow_inflation[1] += 1
  844.     if @grow_inflation[1] == Growing
  845.       if @pet_level != @grow_inflation[2]
  846.         @grow_inflation[0] = @grow_inflation[0] + MoodMaxPlus
  847.         gain_level(1)
  848.         @lvup_pop = true
  849.       end
  850.       @grow_inflation[1] = 0
  851.     end
  852.   end
  853.  
  854.   def twist(value, m)
  855.     set_direction(2) if @action_time == value
  856.     set_direction(4) if @action_time == value - m
  857.     set_direction(6) if @action_time == value - m - m
  858.     set_direction(8) if @action_time == value - m - m - m
  859.   end
  860.  
  861.   def mood_cmd(id)
  862.     return unless id.between?(2, 9)
  863.     @unlock_command.push(id) unless @unlock_command.include?(id)
  864.   end
  865.  
  866.   # gift item
  867.   def mood_item
  868.     FalPet::GiftBundle.each do |level, item_id|
  869.       if level == @pet_level
  870.         item = $data_items[item_id]
  871.         return item if !item.nil?
  872.       end
  873.     end
  874.     return $data_items[1]
  875.   end
  876.  
  877.   # radom items
  878.   def get_randomitem(type, variable)
  879.     case type
  880.     when 'item'   ; operand = $data_items
  881.     when 'weapon' ; operand = $data_weapons
  882.     when 'armor'  ; operand = $data_armors
  883.     when 'gold'   ; operand = nil
  884.     end
  885.     if operand != nil
  886.       data = []
  887.       variable.each {|id, value|  data.push([id, value])}
  888.       item = data[rand(data.size)]
  889.       @randomitem = [operand[item[0]], item[1]]
  890.     else
  891.       gold = variable[rand(variable.size)]
  892.       @randomitem = [gold]
  893.     end
  894.   end
  895.  
  896.   def update
  897.     @pattern = 0 if @casting
  898.     @move_speed = $game_player.real_move_speed if !busy?
  899.     if custom_command?
  900.       $game_switches[CustomSwitch] = true if !$game_switches[CustomSwitch]
  901.     end
  902.     for event in $game_map.events.values
  903.       if event.check_evcom("/PET GRAB")
  904.         event.priority_type = 1 if event.priority_type != 1
  905.       end
  906.     end
  907.     super
  908.   end
  909.  
  910.   def cast_item_producing(anime, ct=false)
  911.     case @action_time
  912.     when 180 ; jump_high(0, 0, 16) ; @casting = true
  913.     when 160 ; ct ? $game_player.animation_id = anime : @animation_id = anime
  914.     when 6   ; play_balloon ; play_voice
  915.     when 1   ; RPG::SE.new("Item3",80).play if !ct
  916.     ct ? $game_player.start_poping_window(13, 2) :
  917.     $game_player.start_poping_window(11, 3)
  918.     end
  919.   end
  920.  
  921.   def update_anime_pattern
  922.     @casting ? return : super
  923.   end
  924. end
  925.  
  926. #-------------------------------------------------------------------------------
  927. # * Character base new methods and variabbles
  928.  
  929. class Game_CharacterBase
  930.   attr_accessor :x, :y, :direction, :priority_type, :pattern, :through
  931.   attr_accessor :step_anime, :direction_fix, :move_speed, :egrabbing
  932.   attr_accessor :zoomfx_x
  933.   attr_accessor :zoomfx_y
  934.   attr_accessor :anglefx
  935.  
  936.   alias falcao_zoomfx_ini initialize
  937.   def initialize
  938.     @zoomfx_x = 1.0
  939.     @zoomfx_y = 1.0
  940.     @anglefx = 0.0
  941.     @layingdown = false
  942.     falcao_zoomfx_ini
  943.   end
  944.  
  945.   def liedown
  946.     set_direction(8)
  947.     @anglefx = 100
  948.     @layingdown = true
  949.   end
  950.  
  951.   def reset_liedown
  952.     @anglefx = 0.0
  953.     @layingdown = false
  954.   end
  955.  
  956.   def move_toward_char(character)
  957.     sx = distance_x_from(character.x)
  958.     sy = distance_y_from(character.y)
  959.     if sx != 0 && sy != 0
  960.       move_diagonal(sx > 0 ? 4 : 6, sy > 0 ? 8 : 2)
  961.     elsif sx != 0
  962.       move_straight(sx > 0 ? 4 : 6)
  963.     elsif sy != 0
  964.       move_straight(sy > 0 ? 8 : 2)
  965.     end
  966.   end
  967.  
  968.   # jump to specific tiles
  969.   def jumpto_tile(x, y)
  970.     jumpto(0, [x, y])
  971.   end
  972.  
  973.   # jumpto character ( 0 = Game Player, 1 and up event id)
  974.   def jumpto(char_id, tilexy=nil)
  975.     char_id > 0 ? char = $game_map.events[char_id] : char = $game_player
  976.     tilexy.nil? ? condxy = [char.x, char.y] : condxy = [tilexy[0], tilexy[1]]
  977.     jx = + eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] >= @x
  978.     jy = - eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] <= @y
  979.     jx = - eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] <= @x
  980.     jy = - eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] <= @y
  981.     jx = - eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] <= @x
  982.     jy = + eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] >= @y
  983.     jx = + eval_distance(tilexy.nil? ? char : tilexy)[0] if condxy[0] >= @x
  984.     jy = + eval_distance(tilexy.nil? ? char : tilexy)[1] if condxy[1] >= @y
  985.     jump(jx, jy)
  986.   end
  987.  
  988.   def eval_distance(target)
  989.     if target.is_a?(Array)
  990.       distance_x = (@x - target[0]).abs
  991.       distance_y = (@y - target[1]).abs
  992.     else
  993.       distance_x = (@x - target.x).abs
  994.       distance_y = (@y - target.y).abs
  995.     end
  996.     return [distance_x, distance_y]
  997.   end
  998.  
  999.   # climb area
  1000.   def climb_area?(target, size)
  1001.     distance = (@x - target.x).abs + (@y - target.y).abs
  1002.     enable   = (distance <= size-1)
  1003.     return true if enable
  1004.     return false
  1005.   end
  1006.  
  1007.   # controlled jump x, y , height
  1008.   def jump_high(x_plus, y_plus, heigh)
  1009.     if x_plus.abs > y_plus.abs
  1010.       set_direction(x_plus < 0 ? 4 : 6) if x_plus != 0
  1011.     else
  1012.       set_direction(y_plus < 0 ? 8 : 2) if y_plus != 0
  1013.     end
  1014.     @x += x_plus
  1015.     @y += y_plus
  1016.     distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
  1017.     @jump_peak = heigh + distance - @move_speed
  1018.     @jump_count = @jump_peak * 2
  1019.     @stop_count = 0
  1020.     straighten ; @priority_type = 2
  1021.   end
  1022.  
  1023.   def samepos?(target)
  1024.     @x == target.x and @y == target.y
  1025.   end
  1026.  
  1027.   # get distance passable tile_x and tile_y
  1028.   def tiles_pass
  1029.     dir = @direction
  1030.     operand = 17 if dir == 4 || dir == 6
  1031.     operand = 13 if dir == 2 || dir == 8
  1032.     for i in 1...operand
  1033.       return [@x, @y + i] if dir == 2 and $game_map.passable?(@x, @y + i, dir)
  1034.       return [@x, @y - i] if dir == 8 and $game_map.passable?(@x, @y - i, dir)
  1035.       return [@x - i, @y] if dir == 4 and $game_map.passable?(@x - i, @y, dir)  
  1036.       return [@x + i, @y] if dir == 6 and $game_map.passable?(@x + i, @y, dir)  
  1037.     end
  1038.     return nil
  1039.   end
  1040.  
  1041.   def adjustpxy
  1042.     push_x, push_y =   0,   1 if @direction == 2
  1043.     push_x, push_y = - 1,   0 if @direction == 4
  1044.     push_x, push_y =   1,   0 if @direction == 6
  1045.     push_x, push_y =   0, - 1 if @direction == 8
  1046.     return [push_x, push_y]
  1047.   end
  1048.  
  1049. end
  1050.  
  1051. #-------------------------------------------------------------------------------
  1052. # * Game player new methods and variabbles
  1053.  
  1054. class Game_Player < Game_Character
  1055.   attr_reader   :gamepet
  1056.   attr_reader   :showing_pet
  1057.   attr_accessor :petpop_time
  1058.   attr_accessor :petpop_refresh
  1059.   attr_accessor :petpop_type
  1060.   attr_accessor :adopted_pets
  1061.   attr_accessor :just_jumped
  1062.   alias falcao_pet_ini initialize
  1063.   def initialize
  1064.     @gamepet = Game_Pet.new
  1065.     @showing_pet = false
  1066.     @petpop_refresh = false
  1067.     @petpop_time = 0
  1068.     @petpop_type = 0
  1069.     @climb_wait = 0
  1070.     @adopted_pets = []
  1071.     @just_jumped = false
  1072.     falcao_pet_ini
  1073.   end
  1074.  
  1075.   alias falcao_pet_main_update update
  1076.   def update
  1077.     update_gamepet
  1078.     falcao_pet_main_update
  1079.   end
  1080.  
  1081.   def adopt_pet(id)
  1082.     @adopted_pets.include?(id) ? return :  @adopted_pets.push(id)
  1083.     @gamepet.setup_pet(id)
  1084.     @showing_pet = true
  1085.   end
  1086.  
  1087.   def have_pet?
  1088.     !@adopted_pets.empty?
  1089.   end
  1090.  
  1091.   def update_gamepet
  1092.     return unless have_pet?
  1093.  
  1094.     if @gamepet.action_time > 0
  1095.       @gamepet.action_time -= 1
  1096.       globalpet_reset if @gamepet.action_time == 0
  1097.     end
  1098.     @petpop_time -= 1 if @petpop_time > 0
  1099.     @climb_wait -= 1 if @climb_wait > 0
  1100.     @gamepet.update if @showing_pet
  1101.     update_path_manager
  1102.     update_call_commands
  1103.     case @gamepet.command
  1104.     when 1
  1105.       update_command_showhide
  1106.     when 2..9
  1107.       update_command_play
  1108.     when 10
  1109.       update_command_startevet(@gamepet.chase_event_id)
  1110.     when 11
  1111.       update_command_steal(@gamepet.chase_event_id)
  1112.     when 12
  1113.       update_command_grab(@gamepet.chase_event_id)
  1114.     when 13
  1115.       update_command_climb(@gamepet.chase_event_id)
  1116.     when 14
  1117.       update_command_heal
  1118.     when 15
  1119.       update_command_randomitems
  1120.     when 16
  1121.       update_command_randomweapons
  1122.     when 17
  1123.       update_command_randomarmors
  1124.     when 18
  1125.       update_command_randomgold
  1126.     when 19
  1127.       update_command_instantcd
  1128.     when 27
  1129.       update_command_return
  1130.     end
  1131.     update_poppetwindow
  1132.   end
  1133.  
  1134.   def update_call_commands
  1135.     return unless FalPet::UseKey
  1136.     SceneManager.call(Scene_PetCommands) if Input.trigger?(FalPet::CommandsKey)
  1137.   end
  1138.  
  1139.   # command return
  1140.   def update_command_return
  1141.     @gamepet.move_toward_character(self) unless @gamepet.moving?
  1142.     globalpet_reset if @gamepet.x == @x and @gamepet.y == @y
  1143.   end
  1144.  
  1145.   # path manager
  1146.   def update_path_manager
  1147.     return unless @gamepet.command == 27 || @gamepet.command.between?(10, 13)
  1148.     @gamepet.stucked += 1 if not @gamepet.moving?
  1149.     @gamepet.stucked = 0 if @gamepet.moving?
  1150.     @gamepet.stucked = 0 if @climb_wait > 0 and !@gamepet.moving?
  1151.     if @gamepet.stuck_count >= FalPet::StuckCount
  1152.       @gamepet.command = 27
  1153.       @gamepet.stuck_count = 0
  1154.       start_poping_window(12, 3)
  1155.     end
  1156.     #------------------------------------------
  1157.     if @gamepet.stucked == 45
  1158.       if @gamepet.command == 27
  1159.         event = $game_map.events[@gamepet.chase_event_id] rescue nil
  1160.         @gamepet.turn_toward_character(self)
  1161.         if @gamepet.tiles_pass != nil
  1162.           tilex, tiley = @gamepet.tiles_pass[0], @gamepet.tiles_pass[1]
  1163.           @gamepet.jumpto_tile(tilex, tiley)
  1164.           event.jumpto_tile(tilex,tiley) if !event.nil? && !event.egrabbing.nil?
  1165.         else
  1166.           @gamepet.jumpto(0)
  1167.           event.jumpto(0) if !event.nil? and !event.egrabbing.nil?
  1168.         end
  1169.  
  1170.         # command activate / steal / grab / climb
  1171.       elsif @gamepet.command.between?(10, 13)
  1172.         event = $game_map.events[@gamepet.chase_event_id]
  1173.         @gamepet.turn_toward_character(event)
  1174.         if @gamepet.tiles_pass != nil
  1175.           if @gamepet.climb_area?(event, 3)
  1176.             @gamepet.jumpto(@gamepet.chase_event_id)
  1177.             return
  1178.           end
  1179.           @gamepet.jumpto_tile(@gamepet.tiles_pass[0], @gamepet.tiles_pass[1])
  1180.         else
  1181.           @gamepet.jumpto(@gamepet.chase_event_id)
  1182.         end
  1183.       end
  1184.       @gamepet.stucked = 0
  1185.       @gamepet.stuck_count += 1
  1186.     end
  1187.   end
  1188.  
  1189.   def start_poping_window(type, time, seconds=true)
  1190.     @petpop_type = type
  1191.     seconds ? @petpop_time = time * 60 : @petpop_time = time
  1192.   end
  1193.  
  1194.   # comand showhide
  1195.   def update_command_showhide
  1196.     # hide
  1197.     if @showing_pet
  1198.       @gamepet.balloon_id = 1
  1199.       unless @gamepet.jumping?
  1200.         @showing_pet = false
  1201.         @gamepet.reset_pet
  1202.       end
  1203.       # show
  1204.     else
  1205.       @gamepet.balloon_id = 4
  1206.       @showing_pet = true
  1207.       @gamepet.reset_pet
  1208.     end
  1209.   end
  1210.  
  1211.   # play with pet
  1212.   def update_command_play
  1213.     prepare_petact
  1214.     time = @gamepet.action_time
  1215.     case @gamepet.command
  1216.     when 2 # jump jump
  1217.       @gamepet.jump(0,0) if time == 130
  1218.       @gamepet.jump(0,0) if time == 100
  1219.       @gamepet.jump(0,0) if time == 70
  1220.       @gamepet.play_balloon if time == 40
  1221.       @gamepet.play_voice  if time == 20
  1222.  
  1223.     when 3 # tun r around
  1224.       @gamepet.jump(0,0) if time == 130
  1225.       @gamepet.twist(100, 10)
  1226.       @gamepet.turn_toward_character(self) if time == 50
  1227.       @gamepet.play_balloon if time == 30
  1228.       @gamepet.play_voice if time == 20
  1229.  
  1230.     when 4 # zoom
  1231.       if time > 90 and time < 130
  1232.         @gamepet.zoomfx_x += 0.02
  1233.         @gamepet.zoomfx_y += 0.02
  1234.       elsif time > 30 and time < 70
  1235.         @gamepet.zoomfx_x -= 0.02
  1236.         @gamepet.zoomfx_y -= 0.02
  1237.       end
  1238.       @gamepet.play_balloon if time == 30
  1239.       @gamepet.play_voice if time == 20
  1240.  
  1241.     when 5 #chase jump
  1242.       if time == 130
  1243.         @gamepet.lastspot = [@gamepet.x, @gamepet.y]
  1244.         @gamepet.jumpto(0)
  1245.       elsif time == 90
  1246.         @gamepet.jumpto_tile(@gamepet.lastspot[0], @gamepet.lastspot[1])
  1247.       end
  1248.       @gamepet.move_forward if time == 70
  1249.       @gamepet.turn_toward_character(self) if time == 50
  1250.       @gamepet.move_forward if time == 10
  1251.       @gamepet.play_balloon if time == 30
  1252.       @gamepet.play_voice if time == 20
  1253.  
  1254.     when 6 # twist
  1255.       @gamepet.move_away_from_player if time == 170
  1256.       @gamepet.turn_toward_character(self) if time == 150
  1257.       @gamepet.twist(140, 5) ; @gamepet.twist(120, 5)
  1258.       @gamepet.twist(100, 5) ; @gamepet.twist(80, 5)
  1259.       @gamepet.twist(60, 5)  ; @gamepet.twist(40, 10)
  1260.       @gamepet.play_balloon if time == 20
  1261.       @gamepet.play_voice if time == 10
  1262.       @gamepet.jump(0,0) if time == 10
  1263.       @gamepet.turn_toward_character(self) if time == 10
  1264.  
  1265.     when 7 # play dead
  1266.       @gamepet.move_away_from_player if time == 470
  1267.       @gamepet.turn_toward_character(self) if time == 450
  1268.       @gamepet.balloon_id = FalPet::PlayDeadBalloon if  time == 400
  1269.       @gamepet.liedown if time == 430
  1270.       @gamepet.play_balloon if time == 20
  1271.       @gamepet.play_voice if time == 10
  1272.       @gamepet.turn_toward_character(self) if time == 10
  1273.  
  1274.     when 8 # dance
  1275.       RPG::BGM.fade(1 * 1000) if time == 590
  1276.       @gamepet.move_away_from_player if time == 470
  1277.       @gamepet.turn_toward_character(self) if time == 450
  1278.       if time == 410
  1279.         $game_system.save_bgm
  1280.         RPG::BGM.new(FalPet::DancingBgm,80).play
  1281.         @gamepet.step_anime = true
  1282.         @gamepet.move_speed = 5
  1283.       end
  1284.       @gamepet.move_forward if time == 320
  1285.       @gamepet.move_backward if time == 260
  1286.       @gamepet.jump(0, 0) if time == 220
  1287.       @gamepet.jump(0, 0) if time == 205
  1288.       @gamepet.twist(180, 5) ; @gamepet.twist(160, 5)
  1289.       @gamepet.turn_toward_character(self) if time == 130
  1290.       @gamepet.move_speed = 4 if time == 125
  1291.       @gamepet.liedown if time == 120
  1292.       @gamepet.reset_liedown if time == 110
  1293.       @gamepet.play_balloon if time == 40
  1294.       @gamepet.play_voice if time == 40
  1295.       @gamepet.move_toward_player if time == 30
  1296.       $game_system.replay_bgm if time == 2
  1297.  
  1298.     when 9 # trampoline
  1299.       case time
  1300.       when 350; @gamepet.jump_high(0,0, 20); RPG::SE.new("Jump2",80,).play
  1301.       when 300; jump_high(0, 0, 20); ; RPG::SE.new("Jump2",80,).play
  1302.       when 250; @gamepet.jump_high(0,0, 20); RPG::SE.new("Jump2",80,).play
  1303.       when 200; jump_high(0, 0, 20); ; RPG::SE.new("Jump2",80,).play
  1304.       when 150; @gamepet.jump_high(0,0, 20); RPG::SE.new("Jump2",80,).play
  1305.       when 112; @gamepet.liedown; RPG::SE.new("Crossbow",80,).play
  1306.                 $game_map.screen.start_shake(7, 7, 20)
  1307.       when 80;  @gamepet.play_balloon; RPG::SE.new("Miss",80,).play
  1308.       when 10;  @gamepet.reset_liedown; @gamepet.play_voice
  1309.                 @gamepet.turn_toward_player
  1310.       end
  1311.     end
  1312.     start_poping_window(1, 3) if time == 1
  1313.   end
  1314.  
  1315.   # reseting
  1316.   def globalpet_reset
  1317.     @gamepet.reset_pet
  1318.     @gamepet.zoomfx_x = 1.0
  1319.     @gamepet.zoomfx_y = 1.0
  1320.     @gamepet.reset_liedown
  1321.     @vastored = nil
  1322.     @gamepet.step_anime = false
  1323.     @gamepet.direction_fix = false
  1324.     @gamepet.priority_type = 1
  1325.     @climb_wait = 0
  1326.     if @gamepet.chase_event_id != nil
  1327.       event = $game_map.events[@gamepet.chase_event_id]
  1328.       if !event.nil? and !event.egrabbing.nil?
  1329.         event.egrabbing = nil
  1330.         event.move_speed = @gvdata[0]
  1331.         event.move_type = @gvdata[1]
  1332.         event.priority_type = @gvdata[2]
  1333.       end
  1334.     end
  1335.   end
  1336.  
  1337.   def update_poppetwindow
  1338.     if @gamepet.lvup_pop and @petpop_time == 0
  1339.       start_poping_window(3, 80, false)
  1340.       @petpop_refresh = true
  1341.       @gamepet.lvup_pop = false
  1342.       RPG::SE.new("Up1",80).play
  1343.       @gamepet.jump(0, 0)
  1344.     end
  1345.     if @petpop_time == 2 * 60 and @petpop_type == 1 and
  1346.       @gamepet.reservedmood != 0
  1347.       @gamepet.gain_mood(@gamepet.reservedmood)
  1348.       @gamepet.mood_full? ? @petpop_type = 2 : @petpop_type = 1
  1349.       @petpop_refresh = true
  1350.       @gamepet.reservedmood = 0
  1351.     end
  1352.   end
  1353.  
  1354. #-------------------------------------------------------------------------------
  1355. # Pet trigger targets
  1356.   def update_command_startevet(id)
  1357.     event = $game_map.events[id]
  1358.     @gamepet.through = false if @gamepet.through
  1359.     @gamepet.move_toward_character(event) unless @gamepet.moving?
  1360.     if @gamepet.samepos?(event) && @gamepet.command == 10 && !@gamepet.jumping?
  1361.       event.check_evcom("/PET TRIGGER") ? event.start : start_poping_window(4,2)
  1362.       @gamepet.command = 27
  1363.     end
  1364.   end
  1365.  
  1366.   #-----------------------------------------------------------------------------
  1367.   # steal
  1368.  
  1369.   def update_command_steal(id)
  1370.     event = $game_map.events[id]
  1371.     @gamepet.through = false if @gamepet.through
  1372.     @gamepet.move_toward_character(event) unless @gamepet.moving?
  1373.     if @gamepet.samepos?(event) && @gamepet.command == 11 && !@gamepet.jumping?
  1374.       item   = event.check_evvar("/PET STEAL ITEM")
  1375.       weapon = event.check_evvar("/PET STEAL WEAPON")
  1376.       armor  = event.check_evvar("/PET STEAL ARMOR")
  1377.       gold   = event.check_evvar("/PET STEAL GOLD")
  1378.       chance = event.check_evvar("/PET STEAL CHANCE 1 / ")
  1379.       chance = 1 if chance == 0
  1380.       have_something = item > 0 || weapon > 0 || gold > 0 || armor > 0
  1381.       unless have_something
  1382.         start_poping_window(7, 3)
  1383.         @gamepet.play_voice
  1384.         @gamepet.command = 27
  1385.         return
  1386.       end
  1387.       if rand(chance) == 0
  1388.         if item != 0
  1389.           gain_stealed_item($data_items[item])
  1390.         elsif weapon != 0
  1391.           gain_stealed_item($data_weapons[weapon])
  1392.         elsif armor != 0
  1393.           gain_stealed_item($data_armors[armor])
  1394.         elsif gold != 0
  1395.           @gamepet.stealed_item = gold
  1396.           $game_party.gain_gold(gold)
  1397.           RPG::SE.new("Shop",80).play
  1398.           start_poping_window(5, 3)
  1399.         end
  1400.       else
  1401.         start_poping_window(6, 3)
  1402.         @gamepet.play_voice
  1403.       end
  1404.       @gamepet.command = 27
  1405.     end
  1406.   end
  1407.  
  1408.   def gain_stealed_item(stealed)
  1409.     @gamepet.stealed_item = stealed
  1410.     $game_party.gain_item(stealed, 1)
  1411.     RPG::SE.new("Item3",80).play
  1412.     start_poping_window(5, 3)
  1413.   end
  1414.  
  1415.   #-----------------------------------------------------------------------------
  1416.   # Grab
  1417.  
  1418.   def update_command_grab(id)
  1419.     event = $game_map.events[id]
  1420.     @gamepet.through = false if @gamepet.through
  1421.     @gamepet.move_toward_character(event) unless @gamepet.moving?
  1422.     if @gamepet.samepos?(event) && @gamepet.command == 12 && !@gamepet.jumping?
  1423.       @gvdata = [event.move_speed, event.move_type, event.priority_type]
  1424.       event.check_evcom("/PET GRAB") ? event.egrabbing = true :
  1425.       start_poping_window(8, 2)
  1426.       @gamepet.command = 27
  1427.     end
  1428.   end
  1429.  
  1430.   #-----------------------------------------------------------------------------
  1431.   # Climb CLIMB MIERDDAAAAAAAAAAAAAAAAAAAA
  1432.  
  1433.   def update_command_climb(id)
  1434.     event = $game_map.events[id]
  1435.     event.priority_type = 0 if event.priority_type != 0
  1436.     event.through = true if !event.through
  1437.     @gamepet.through = false if @gamepet.through
  1438.     @gamepet.move_toward_character(event) if !@gamepet.moving? and
  1439.     @climb_wait == 0
  1440.     @gamepet.turn_toward_character(self) if @climb_wait > 0
  1441.     if @climb_wait == 1 and @gamepet.x == event.x and @gamepet.y == event.y
  1442.       @gamepet.command = 27
  1443.       return
  1444.     end
  1445.     if climb_area?(event, 7) and @climb_wait > 0 and !moving?
  1446.       if @gamepet.x == @x and @gamepet.y == @y
  1447.         globalpet_reset
  1448.         return
  1449.       end
  1450.       # jump to cimb aerea player
  1451.       if !passable?(@x, @y, @direction) and @gamepet.x == event.x and
  1452.         @gamepet.y == event.y and Input.dir8 != 0
  1453.         jumpto(event.id)
  1454.         self.followers.reverse_each do |f|
  1455.           f.move_toward_player ; f.move_toward_player ; f.move_toward_player
  1456.           f.jumpto(event.id)
  1457.         end
  1458.         RPG::SE.new("Shot1",80).play
  1459.         globalpet_reset
  1460.       end
  1461.     end
  1462.     if @gamepet.samepos?(event) && @climb_wait == 0 && !@gamepet.jumping?
  1463.       if event.check_evcom("/PET CLIMB")
  1464.         unless @gamepet.x == @x and @gamepet.y == @y
  1465.           start_poping_window(9, 1)
  1466.           @gamepet.play_voice
  1467.           @gamepet.jump(0, 0)
  1468.           @climb_wait = 12 * 60
  1469.         end
  1470.       end
  1471.     end
  1472.   end
  1473.  
  1474.   # preparation for pet acting
  1475.   def prepare_petact
  1476.     if @vastored.nil?
  1477.       turn_toward_character(@gamepet) ; @gamepet.turn_toward_character(self)
  1478.       @vastored = true ; followers.gather
  1479.     end
  1480.   end
  1481.  
  1482.   #-----------------------------------------------------------------------------
  1483.   # heal command
  1484.  
  1485.   def update_command_heal
  1486.     prepare_petact
  1487.     @gamepet.move_away_from_player if @gamepet.action_time == 270
  1488.     @gamepet.turn_toward_character(self) if @gamepet.action_time == 250
  1489.     if @gamepet.action_time == 210
  1490.       @gamepet.jump_high(0, 0, 18)
  1491.       @gamepet.casting = true
  1492.     end
  1493.     $game_map.screen.start_shake(5, 5, 60) if @gamepet.action_time == 160
  1494.     if @gamepet.action_time == 120
  1495.       @gamepet.balloon_id = 1
  1496.       @gamepet.play_voice
  1497.     end
  1498.     self.animation_id = 40 if @gamepet.action_time == 100
  1499.     if @gamepet.action_time == 1
  1500.       for member in $game_party.members
  1501.         case FalPet::HealPercent
  1502.         when '25%'  ; hp = 4    ; when '50%'  ; hp = 2
  1503.         when '75%'  ; hp = 1.32 ; when '100%' ; hp = 1
  1504.         end
  1505.         member.change_hp((member.mhp  / hp).truncate, false)
  1506.         member.mp += (member.mmp  / hp).truncate
  1507.         start_poping_window(10, 3)
  1508.       end
  1509.     end
  1510.   end
  1511.  
  1512.   #-----------------------------------------------------------------------------
  1513.   # Make random item
  1514.   def update_command_randomitems
  1515.     prepare_petact
  1516.     @gamepet.cast_item_producing(FalPet::ItemAnime)
  1517.     if @gamepet.action_time == 2
  1518.       @gamepet.get_randomitem('item', FalPet::RandomItems)
  1519.       $game_party.gain_item(@gamepet.randomitem[0], @gamepet.randomitem[1])
  1520.     end
  1521.   end
  1522.  
  1523.   #-----------------------------------------------------------------------------
  1524.   # Make random weapon
  1525.   def update_command_randomweapons
  1526.     prepare_petact
  1527.     @gamepet.cast_item_producing(FalPet::WeaponAnime)
  1528.     if @gamepet.action_time == 2
  1529.       @gamepet.get_randomitem('weapon', FalPet::RandomWeapons)
  1530.       $game_party.gain_item(@gamepet.randomitem[0], @gamepet.randomitem[1])
  1531.     end
  1532.   end
  1533.  
  1534.   #-----------------------------------------------------------------------------
  1535.   # Make random armor
  1536.   def update_command_randomarmors
  1537.     prepare_petact
  1538.     @gamepet.cast_item_producing(FalPet::ArmorAnime)
  1539.     if @gamepet.action_time == 2
  1540.       @gamepet.get_randomitem('armor', FalPet::RandomArmors)
  1541.       $game_party.gain_item(@gamepet.randomitem[0], @gamepet.randomitem[1])
  1542.     end
  1543.   end
  1544.  
  1545.   #-----------------------------------------------------------------------------
  1546.   # Make random gold
  1547.   def update_command_randomgold
  1548.     prepare_petact
  1549.     @gamepet.cast_item_producing(FalPet::GoldAnime)
  1550.     if @gamepet.action_time == 2
  1551.       @gamepet.get_randomitem('gold', FalPet::RandomGold)
  1552.       $game_party.gain_gold(@gamepet.randomitem[0])
  1553.       RPG::SE.new("Shop",80).play
  1554.     end
  1555.   end
  1556.  
  1557.   #-----------------------------------------------------------------------------
  1558.   # Command instant cooldown
  1559.   def update_command_instantcd
  1560.     prepare_petact
  1561.     @gamepet.cast_item_producing(FalPet::GoldAnime, true)
  1562.     if @gamepet.action_time == 2
  1563.       @gamepet.instantcd = FalPet::BuffDuration * 60
  1564.     end
  1565.   end
  1566.  
  1567.   #-----------------------------------------------------------------------------
  1568.   alias falcaopet_move_straight move_straight
  1569.   def move_straight(d, turn_ok = true)
  1570.     return if @layingdown
  1571.     @gamepet.move_toward_char(self) if passable?(@x, @y, d) and
  1572.     not @gamepet.busy?
  1573.     falcaopet_move_straight(d, turn_ok = true)
  1574.     @just_jumped = false if @just_jumped
  1575.   end
  1576.  
  1577.   alias falcaopet_move_diagonal move_diagonal
  1578.   def move_diagonal(horz, vert)
  1579.     @gamepet.move_toward_char(self) if diagonal_passable?(@x,@y, horz, vert) and
  1580.     not @gamepet.busy?
  1581.     falcaopet_move_diagonal(horz, vert)
  1582.   end
  1583.  
  1584.   alias falcaopet_perform_transfer perform_transfer
  1585.   def perform_transfer
  1586.     $game_system.replay_bgm if @gamepet.command == 8
  1587.     globalpet_reset
  1588.     falcaopet_perform_transfer
  1589.     @gamepet.moveto(@x, @y)
  1590.     @gamepet.set_direction(@direction)
  1591.   end
  1592.  
  1593.   alias falcaopet_get_on_vehicle get_on_vehicle
  1594.   def get_on_vehicle
  1595.     falcaopet_get_on_vehicle
  1596.     if vehicle
  1597.       @showing_pet = false
  1598.       $game_system.replay_bgm if @gamepet.command == 8 ; globalpet_reset
  1599.     end
  1600.   end
  1601. end
  1602.  
  1603. # sprite set
  1604. class Spriteset_Map
  1605.   alias falcao_pet_create_characters create_characters
  1606.   def create_characters
  1607.     create_pet_sprite
  1608.     falcao_pet_create_characters
  1609.   end
  1610.  
  1611.   alias falcao_pet_dispose dispose
  1612.   def dispose
  1613.     dispose_pet_sprite
  1614.     dispose_petpop_window
  1615.     falcao_pet_dispose
  1616.   end
  1617.  
  1618.   def create_petpop_window
  1619.     return if not @mood_window.nil?
  1620.     @mood_window = Window_Base.new(544 / 2 - 230 / 2, 0, 230, 76)
  1621.     refresh_petpop_window
  1622.   end
  1623.  
  1624.   # refresh pet pop
  1625.   def refresh_petpop_window
  1626.     return if @mood_window.nil?
  1627.     @mood_window.contents.clear
  1628.     pet = $game_player.gamepet
  1629.     if pet.custom_mode != nil
  1630.       draw_extra_text(pet.custom_mode, 0, 20)
  1631.       return
  1632.     end
  1633.     case $game_player.petpop_type
  1634.  
  1635.     # Gain mood
  1636.     when 1
  1637.       @mood_window.draw_petmoodbar(0, 38)
  1638.       case (pet.mood.to_f / pet.grow_inflation[0].to_f * 100.0)
  1639.       when  0..25  ;  text = FalPet::MoodLowText
  1640.       when 26..50  ;  text = FalPet::MoodOverageText
  1641.       when 51..75  ;  text = FalPet::MoodMediumText
  1642.       when 76..100  ; text = FalPet::MoodHight
  1643.       end
  1644.       draw_extra_text(text, 100, 5, @mood_window.normal_color)
  1645.       # Giving gift
  1646.     when 2
  1647.       @mood_window.draw_petgift(110, 20)
  1648.       draw_extra_text('给我一个礼物吧', 0, 20)
  1649.       return if pet.mood == 0
  1650.       $game_party.gain_item(pet.mood_item, 1)
  1651.       RPG::SE.new("Item3",80).play
  1652.       pet.mood = 0
  1653.       pet.apply_growing
  1654.  
  1655.     when 3;  draw_extra_text('升级了!', 0, 20, Color.new(255, 120, 0, 255))
  1656.     when 4;  draw_extra_text('没有效果...', 0, 20)
  1657.     when 5;  @mood_window.draw_stealed_item(0, 20)
  1658.              @mood_window.draw_petname(0, -8)
  1659.     when 6;  draw_extra_text('偷不了的!', 0, 20)
  1660.     when 7;  draw_extra_text('啥也没偷到!', 0, 20)
  1661.     when 8;  draw_extra_text('我拿不了这!', 0, 20)
  1662.     when 9;  draw_extra_text('嘿,来这里!', 0, 20)  
  1663.     when 10
  1664.       draw_extra_text("你的队伍被#{FalPet::HealPercent}治疗了!",0, 20)
  1665.     when 11
  1666.       item = pet.randomitem
  1667.       @mood_window.contents.fill_rect(166, -6, 30, 30, Color.new(0, 0, 0, 60))
  1668.       if item[0].is_a? Fixnum
  1669.         @mood_window.draw_icon(344, 168, 0)
  1670.         draw_extra_text("给你 x#{item[0]} #{Vocab::currency_unit}!", 0, 20)
  1671.       else
  1672.         @mood_window.draw_icon(item[0].icon_index, 168, 0)
  1673.         draw_extra_text("给你 #{item[0].name} x#{item[1]}!", 0, 20)
  1674.       end
  1675.     when 12; draw_extra_text('卧槽!', 0, 20)
  1676.     when 13; draw_extra_text('冷却时间变即时了!', 0, 20)  
  1677.     end
  1678.   end
  1679.  
  1680.   def draw_extra_text(text, x, y, color=nil)
  1681.     @mood_window.contents.font.color = color if !color.nil?
  1682.     @mood_window.draw_petname(0, -8)
  1683.     @mood_window.contents.font.size = 18
  1684.     @mood_window.contents.draw_text(x, y, @mood_window.width, 32, text)
  1685.   end
  1686.  
  1687.   def dispose_petpop_window
  1688.     return if @mood_window.nil?
  1689.     @mood_window.dispose
  1690.     @mood_window = nil
  1691.   end
  1692.  
  1693.   alias falcao_pet_update update
  1694.   def update
  1695.     if $game_player.petpop_refresh
  1696.       refresh_petpop_window
  1697.       $game_player.petpop_refresh = false
  1698.     end
  1699.     $game_player.showing_pet ? create_pet_sprite : dispose_pet_sprite
  1700.     $game_player.petpop_time > 0 ? create_petpop_window : dispose_petpop_window
  1701.     @pet_sprite.update unless @pet_sprite.nil?
  1702.     falcao_pet_update
  1703.   end
  1704.  
  1705.   def create_pet_sprite
  1706.     return if not @pet_sprite.nil?
  1707.     @pet_sprite = Sprite_Character.new(@viewport1, $game_player.gamepet)
  1708.   end
  1709.  
  1710.   def dispose_pet_sprite
  1711.     return if @pet_sprite.nil?
  1712.     @pet_sprite.dispose
  1713.     @pet_sprite = nil
  1714.   end
  1715. end
  1716.  
  1717. class Game_Event < Game_Character
  1718.   attr_accessor  :move_type
  1719.   attr_accessor  :target_index
  1720.   def check_evcom(comment)
  1721.     return false if @list.nil? or @list.size <= 0
  1722.     for item in @list
  1723.       if item.code == 108 or item.code == 408
  1724.         if item.parameters[0].include?(comment)
  1725.           return true
  1726.         end
  1727.       end
  1728.     end
  1729.     return false
  1730.   end
  1731.  
  1732.   def check_evvar(comment)
  1733.     return 0 if @list.nil? or @list.size <= 0
  1734.     for item in @list
  1735.       if item.code == 108 or item.code == 408
  1736.         if item.parameters[0] =~ /#{comment}[ ]?(\d+)?/
  1737.           return $1.to_i
  1738.         end
  1739.       end
  1740.     end
  1741.     return 0
  1742.   end
  1743.  
  1744.   def on_current_screen?
  1745.     px = ($game_map.display_x).truncate
  1746.     py = ($game_map.display_y).truncate
  1747.     distance_x = @x - px
  1748.     distance_y = @y - py
  1749.     return true if distance_x.between?(0, 16) and distance_y.between?(0, 12)
  1750.     return false
  1751.   end
  1752. end
  1753.  
  1754. # data manager
  1755. class << DataManager
  1756.   alias falcaopet_setup_new_game setup_new_game unless $@
  1757.   def setup_new_game
  1758.     falcaopet_setup_new_game
  1759.     $game_player.gamepet.moveto($data_system.start_x, $data_system.start_y)
  1760.   end
  1761. end
  1762.  
  1763. # Sprite character
  1764. class Sprite_Character < Sprite_Base
  1765.   alias falcaopet_zoom_update update
  1766.   def update
  1767.     self.zoom_x = @character.zoomfx_x
  1768.     self.zoom_y = @character.zoomfx_y
  1769.     self.angle = @character.anglefx
  1770.     falcaopet_zoom_update
  1771.   end
  1772.  
  1773.   alias falcaopet_update_pos update_position
  1774.   def update_position
  1775.     falcaopet_update_pos
  1776.     if @character.egrabbing
  1777.       self.x = $game_player.gamepet.screen_x
  1778.       self.y = $game_player.gamepet.screen_y - 14
  1779.       @character.x = $game_player.gamepet.x
  1780.       @character.y = $game_player.gamepet.y
  1781.       @character.set_direction($game_player.gamepet.direction) unless
  1782.       @character.direction_fix
  1783.       @character.move_speed = 6
  1784.       @character.move_type = 0
  1785.       @character.priority_type = 1
  1786.     end
  1787.   end
  1788. end
  1789.  
  1790. # get custom command data
  1791. class Game_Interpreter
  1792.   def pet
  1793.     return $game_player.gamepet
  1794.   end
  1795. end
  1796.  
  1797. # Game followers plugin, this fit the pet with followers members
  1798. class Game_Follower < Game_Character
  1799.   def chase_preceding_character
  1800.     unless moving?
  1801.       prechar = @preceding_character
  1802.       if $game_player.showing_pet
  1803.         if prechar.is_a?(Game_Player) and !prechar.followers.gathering? and
  1804.            !prechar.just_jumped and FalPet::YieldSpot
  1805.           sx = distance_x_from(prechar.x - prechar.adjustpxy[0])
  1806.           sy = distance_y_from(prechar.y - prechar.adjustpxy[1])
  1807.         else
  1808.           sx = distance_x_from(prechar.x) ; sy = distance_y_from(prechar.y)
  1809.         end
  1810.       else
  1811.         sx = distance_x_from(prechar.x) ; sy = distance_y_from(prechar.y)
  1812.       end
  1813.       if sx != 0 && sy != 0
  1814.         move_diagonal(sx > 0 ? 4 : 6, sy > 0 ? 8 : 2)
  1815.       elsif sx != 0
  1816.         move_straight(sx > 0 ? 4 : 6)
  1817.       elsif sy != 0
  1818.         move_straight(sy > 0 ? 8 : 2)
  1819.       end
  1820.     end
  1821.   end
  1822. end
  1823.  
  1824. #===============================================================================
  1825. # * Scenes and Windows
  1826. #===============================================================================
  1827.  
  1828. # Window base new methods
  1829. class Window_Base < Window
  1830.   def draw_petmoodbar(x, y)
  1831.     contents.font.color = normal_color
  1832.     mood = $game_player.gamepet.mood
  1833.     max = $game_player.gamepet.grow_inflation[0]
  1834.     contents.fill_rect(x, y, 102, 10, Color.new(0, 0, 0))
  1835.     contents.fill_rect(x+1, y+1, 100 *mood / max, 4, Color.new(180, 225, 245))
  1836.     contents.fill_rect(x+1, y+5, 100 *mood / max, 4, Color.new(20, 160, 225))
  1837.     contents.font.size = 16
  1838.     contents.draw_text(x,y -24,self.width, 32, '情绪值: ' + mood.to_s + "/#{max}")
  1839.   end
  1840.  
  1841.   def draw_petname(x, y, a=0)
  1842.     contents.font.size = 18
  1843.     contents.font.color = normal_color
  1844.     lv = $game_player.gamepet.pet_level ; name = $game_player.gamepet.petname
  1845.     contents.draw_text(x, y, self.width, 32, name + " Lv #{lv}", a)
  1846.   end
  1847.  
  1848.   def draw_petgift(x, y)
  1849.     contents.fill_rect(x, y - 18, 106, 76, Color.new(0, 0, 0, 60))
  1850.     item = $game_player.gamepet.mood_item
  1851.     draw_icon(item.icon_index, x + 30, y - 3)
  1852.     contents.font.size = 15
  1853.     contents.font.color = normal_color
  1854.     contents.draw_text(x -2, y - 24, 90, 32, '礼物', 1)
  1855.     contents.draw_text(x, y + 10, 90, 32, item.name, 1)
  1856.   end
  1857.  
  1858.   def draw_stealed_item(x, y)
  1859.     contents.fill_rect(x + 160, y - 21, 30, 30, Color.new(0, 0, 0, 60))
  1860.     contents.font.color = normal_color
  1861.     contents.font.size = 18
  1862.     item = $game_player.gamepet.stealed_item
  1863.     if item.is_a? Fixnum
  1864.       draw_icon(344, x + 163, y - 19)
  1865.       text = item.to_s + " #{Vocab::currency_unit}"
  1866.     else
  1867.       text = item.name
  1868.       draw_icon(item.icon_index, x + 163, y - 19)
  1869.     end
  1870.     contents.draw_text(x, y + 1, 200, 32, "偷到了 #{text}!")
  1871.   end
  1872. end
  1873.  
  1874. #-------------------------------------------------------------------------------
  1875. # Pets commands selectable
  1876. class Window_PetCommands < Window_Selectable
  1877.   def initialize(x=0, y=0, w=350, h=242) #192
  1878.     super(x, y + 76,  w, h)
  1879.     self.z = 101
  1880.     refresh
  1881.     self.index = 0
  1882.     activate if !busy?
  1883.   end
  1884.  
  1885.   def busy?
  1886.     return true if $game_player.gamepet.busy? || $game_player.in_airship? ||
  1887.     $game_player.in_boat? || $game_player.in_ship?
  1888.     return false
  1889.   end
  1890.  
  1891.   def item
  1892.     return @data[self.index]
  1893.   end
  1894.  
  1895.   def refresh
  1896.     self.contents.clear if self.contents != nil
  1897.     @data = []
  1898.     FalPet::Commands.sort.reverse.each do |id, command |
  1899.       next if id == 27
  1900.       @data.push(command) if id == 1 or id == 26
  1901.       @data.push(command) if $game_player.gamepet.unlock_command.include?(id)
  1902.       next if id == 26
  1903.       next unless id.between?(10, FalPet::Commands.keys.size)
  1904.       @data.push(command) if
  1905.       FalPet::Speciality[$game_player.gamepet.pet_id].include?(id)
  1906.     end
  1907.     @item_max = @data.size
  1908.     if @item_max > 0
  1909.       self.contents = Bitmap.new(width - 32, row_max * 26)
  1910.       for i in 0...@item_max
  1911.         draw_item(i)
  1912.       end
  1913.     end
  1914.   end
  1915.  
  1916.   def draw_item(index)
  1917.     item = @data[index]
  1918.     x, y = index % col_max * (145 + 32), index / col_max  * 24
  1919.     self.contents.font.size = 18
  1920.     draw_icon(item[2], x, y, !$game_player.gamepet.busy? )
  1921.     unless busy?
  1922.       cool_down(item[1]) > 0 ? self.contents.font.color = disable_color :
  1923.       self.contents.font.color = normal_color
  1924.     else
  1925.       self.contents.font.color = disable_color
  1926.     end
  1927.     self.contents.font.color = disable_color  if item[1] != 1 and
  1928.     !$game_player.showing_pet
  1929.     self.contents.draw_text(x + 24, y, 212, 32, item[0], 0)
  1930.   end
  1931.  
  1932.   def disable_color
  1933.     return Color.new(255, 255, 255, 128)
  1934.   end
  1935.  
  1936.   def cool_down(i)
  1937.     cd = $game_player.gamepet
  1938.     cooldown = 0
  1939.     FalPet::Commands.each do |id, cmd |
  1940.       cooldown = cd.cooldown[cmd[1]-1] if i == id and cd.cooldown[cmd[1] -1] > 0
  1941.     end
  1942.     return cooldown
  1943.   end
  1944.  
  1945.   def cool_data(i)
  1946.     data = [false, nil]
  1947.     FalPet::Commands.each do |id, cmd |
  1948.       data = [true, cmd[1] - 1] if i == id
  1949.     end
  1950.     return data
  1951.   end
  1952.  
  1953.   def item_max
  1954.     return @item_max.nil? ? 0 : @item_max
  1955.   end
  1956.  
  1957.   def col_max
  1958.     return 2
  1959.   end
  1960. end
  1961.  
  1962. #-------------------------------------------------------------------------------
  1963. # Scene pet commands
  1964. class Scene_PetCommands < Scene_Base
  1965.   def start
  1966.     super
  1967.     @pet = $game_player.gamepet
  1968.     x, y  = 544 / 2 - 350 / 2, 10
  1969.     @info_window = Window_Base.new(x, y, 350, 76)
  1970.     @color = Color.new(255, 120, 0, 255)
  1971.     @petCommand_window = Window_PetCommands.new(x, y)
  1972.     @mood_window = Window_Base.new(x, y + 76 + 242, 350, 76)
  1973.     @mood_window.draw_petmoodbar(0, 38)
  1974.     @mood_window.draw_petname(0, -8)
  1975.     @mood_window.draw_character(@pet.character_name,@pet.character_index,170,54)
  1976.     @mood_window.draw_petgift(236, 20)
  1977.     @background_sprite = Sprite.new
  1978.     @background_sprite.bitmap = SceneManager.background_bitmap
  1979.     @refresh_delay = 0
  1980.     refresh_info
  1981.   end
  1982.  
  1983.   def refresh_info
  1984.     @info_window.contents.clear
  1985.     @info_window.contents.font.size = 18
  1986.     @info_window.contents.font.color = @info_window.normal_color
  1987.     @petCommand_window.busy? ? text = '你的宠物正忙...' :
  1988.     text = @petCommand_window.item[6]
  1989.     @info_window.contents.draw_text(- 10, 0,@info_window.width, 32, text, 1)
  1990.     action = @petCommand_window.item[9]
  1991.     mood = @petCommand_window.item[8]
  1992.     mood = '' if mood == 0
  1993.     @info_window.contents.draw_text(0, 28, @info_window.width, 32,
  1994.     '类型: ' + action + " #{mood}")
  1995.     cooldown > 0 ? operand = cooldown : operand = @petCommand_window.item[7] *60
  1996.     operand = @pet.instantcd if @pet.instantcd > 0
  1997.     total_sec = operand / Graphics.frame_rate
  1998.     cd = sprintf("%02d:%02d", total_sec / 60, total_sec % 60)
  1999.     if @pet.instantcd > 0
  2000.       text = "冷却时间:  #{cd}"
  2001.       @info_window.contents.font.color = @color
  2002.     else
  2003.       text = "冷却时间:  #{cd}"
  2004.     end
  2005.     @info_window.contents.draw_text(-50, 28, 350, 32, text, 2)
  2006.   end
  2007.  
  2008.   def cooldown
  2009.     return @petCommand_window.cool_down(@petCommand_window.item[1])
  2010.   end
  2011.  
  2012.   def update
  2013.     super
  2014.     if Input.trigger?(:B)
  2015.       SceneManager.goto(Scene_Map)
  2016.       Sound.play_cancel
  2017.     end
  2018.     return if @petCommand_window.busy?
  2019.     update_refresh
  2020.     if Input.trigger?(:C)
  2021.       cmd = @petCommand_window
  2022.       if cmd.item[1] != 1
  2023.         if cooldown > 0 || !$game_player.showing_pet
  2024.           Sound.play_buzzer
  2025.           return
  2026.         end
  2027.       end
  2028.       Sound.play_ok
  2029.       if @petCommand_window.item[4]
  2030.         apply_cooldown(cmd)
  2031.         SceneManager.callp(Scene_Event, @petCommand_window.item[1])
  2032.       elsif @petCommand_window.item[5]
  2033.         apply_cooldown(cmd)
  2034.         SceneManager.goto(Scene_Pets)
  2035.       else
  2036.         apply_cooldown(cmd)
  2037.         @pet.command = @petCommand_window.item[1]
  2038.         @pet.action_time = @petCommand_window.item[3]
  2039.         if @pet.custom_command?
  2040.           @pet.action_time = @pet.action_time + 1 if (@pet.action_time%2 == 0)
  2041.         end
  2042.         @pet.jumpto(0) if @petCommand_window.item[1] == 1 and
  2043.         $game_player.showing_pet
  2044.         $game_player.petpop_time =0 if @pet.reservedmood > 0 and cmd.item[8] > 0
  2045.         @pet.reservedmood = cmd.item[8]
  2046.         SceneManager.goto(Scene_Map)
  2047.       end
  2048.     end
  2049.   end
  2050.  
  2051.   def update_refresh
  2052.     refresh_info if cooldown > 0 || @pet.instantcd > 0
  2053.     if @index != @petCommand_window.index
  2054.       @index = @petCommand_window.index
  2055.       refresh_info
  2056.     end
  2057.     @refresh_delay -= 1 if @refresh_delay > 0
  2058.     @refresh_delay = 2 if @pet.instantcd == 1
  2059.     if @refresh_delay == 1
  2060.       @petCommand_window.refresh
  2061.       refresh_info
  2062.     end
  2063.     for i in 0...@pet.cooldown.size
  2064.       if @pet.cooldown[i] == 1
  2065.         @refresh_delay = 2
  2066.       end
  2067.     end
  2068.   end
  2069.  
  2070.   def apply_cooldown(cmd)
  2071.     if cmd.cool_data(cmd.item[1])[0] and cmd.cool_down(cmd.item[1]) == 0
  2072.       index = cmd.cool_data(cmd.item[1])[1]
  2073.       @pet.cooldown[index] = @petCommand_window.item[7] * 60
  2074.     end
  2075.   end
  2076.  
  2077.   def terminate
  2078.     super
  2079.     @petCommand_window.dispose
  2080.     @background_sprite.dispose
  2081.     @info_window.dispose
  2082.   end
  2083. end
  2084.  
  2085. #-------------------------------------------------------------------------------
  2086. # Invisible window event selection
  2087. class Window_Event < Window_Selectable
  2088.   attr_reader   :participants
  2089.   def initialize(x=0, y=0, w=150, h=192)
  2090.     super(x, y,  w, h)
  2091.     self.z = 101
  2092.     @participants = []
  2093.     refresh
  2094.     self.index = 0
  2095.     self.visible = false
  2096.     activate
  2097.   end
  2098.  
  2099.   def item
  2100.     return @data[self.index]
  2101.   end
  2102.  
  2103.   def refresh
  2104.     self.contents.clear if self.contents != nil
  2105.     @data = []
  2106.     for event in $game_map.events.values
  2107.       if event.on_current_screen?
  2108.         next if event.tile_id == 0 and event.character_name == ""
  2109.         next if event.check_evcom("/IGNORE TARGETING")
  2110.         @data.push(event)
  2111.         event.target_index = @data.size - 1
  2112.         @participants.push(event)
  2113.       end
  2114.     end
  2115.     @item_max = @data.size
  2116.     if @item_max > 0
  2117.       self.contents = Bitmap.new(width - 32, row_max * 26)
  2118.       for i in 0...@item_max
  2119.         draw_item(i)
  2120.       end
  2121.     end
  2122.   end
  2123.  
  2124.   def draw_item(index)
  2125.     item = @data[index]
  2126.     x, y = index % col_max * (120 + 32), index / col_max  * 24
  2127.     self.contents.font.size = 16
  2128.     self.contents.draw_text(x + 24, y, 212, 32, item.id.to_s, 0)
  2129.   end
  2130.  
  2131.   def item_max
  2132.     return @item_max.nil? ? 0 : @item_max
  2133.   end
  2134.  
  2135.   def col_max
  2136.     return 1
  2137.   end
  2138. end
  2139.  
  2140. #-------------------------------------------------------------------------------
  2141. # Scenen events selection target
  2142. class Scene_Event < Scene_Base
  2143.   def initialize(command)
  2144.     @command = command
  2145.   end
  2146.  
  2147.   def start
  2148.     super
  2149.     @mouse_exist = defined?(Map_Buttons).is_a?(String)
  2150.     @event_window = Window_Event.new
  2151.     @info_window = Sprite.new
  2152.     @info_window.bitmap = Bitmap.new(300, 60)
  2153.     @info_window.z = 900; @info_window.x = 544/2 -200/2; @info_window.y = 180
  2154.     @info_window.bitmap.font.size = 28; @info_window.bitmap.font.bold = true
  2155.     @event_window.item.nil? ? t = '没有目标!' : t = '选择目标'
  2156.     @info_window.bitmap.draw_text(-30, 0, @info_window.width, 32, t, 1)
  2157.     @background_sprite = Sprite.new
  2158.     @background_sprite.bitmap = SceneManager.background_bitmap
  2159.     @info_time = 60
  2160.     create_cursor unless @event_window.item.nil?
  2161.   end
  2162.  
  2163.   def refresh_info(type)
  2164.     @info_window.bitmap.clear
  2165.     t = '我爬不了这!' if type == 1
  2166.     t = '无效的目标!' if type == 2
  2167.     @info_window.bitmap.draw_text(-30, 0, @info_window.width, 32, t, 1)
  2168.   end
  2169.  
  2170.   def create_cursor
  2171.     if @mouse_exist
  2172.       @cursor = $mouse_cursor
  2173.       @cursor_zooming = 0 ; update_cursor_position
  2174.       return
  2175.     end
  2176.  
  2177.     @cursor = Sprite.new
  2178.     icon = FalPet::CursorIcon
  2179.     @cursor.bitmap = Bitmap.new(24, 24)
  2180.     bitmap = Cache.system("Iconset")
  2181.     rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
  2182.     @cursor.bitmap.blt(0, 0, bitmap, rect)
  2183.     @cursor_zooming = 0
  2184.     update_cursor_position
  2185.   end
  2186.  
  2187.   def update
  2188.     super
  2189.     if Input.trigger?(:B)
  2190.       SceneManager.goto(Scene_PetCommands)
  2191.       Sound.play_cancel
  2192.     end
  2193.     @info_time -= 1 if @info_time > 0
  2194.     if @info_time == 0
  2195.       @info_window.opacity -= 8 if @info_window.opacity > 0
  2196.       if @info_window.opacity == 0 and @event_window.item.nil?
  2197.         Sound.play_cancel
  2198.         SceneManager.goto(Scene_PetCommands)
  2199.       end
  2200.     end
  2201.  
  2202.     return if @event_window.item.nil?
  2203.     update_cursor_position
  2204.     update_target_selection
  2205.   end
  2206.  
  2207.   # target selection
  2208.   def update_target_selection
  2209.     if Input.trigger?(:C)
  2210.       if @mouse_exist
  2211.         for event in @event_window.participants
  2212.           if Mouse.map_grid[0] == event.x and Mouse.map_grid[1] == event.y
  2213.             @event_window.select(event.target_index)
  2214.             @selected = true
  2215.           end
  2216.         end
  2217.         if @selected.nil?
  2218.           refresh_info(2)
  2219.           @info_time = 60; @info_window.opacity = 255
  2220.           Sound.play_buzzer
  2221.           return
  2222.         end
  2223.       end
  2224.       if @command == 13 and not @event_window.item.check_evcom("/PET CLIMB")
  2225.         refresh_info(1)
  2226.         @info_time = 60; @info_window.opacity = 255
  2227.         Sound.play_buzzer
  2228.         return
  2229.       end
  2230.       Sound.play_ok
  2231.       $game_player.gamepet.chase_event_id = @event_window.item.id
  2232.       $game_player.gamepet.command = @command
  2233.       SceneManager.goto(Scene_Map)
  2234.     end
  2235.   end
  2236.  
  2237.   def update_cursor_position
  2238.     if @mouse_exist
  2239.       @cursor.x = Mouse.pos[0]
  2240.       @cursor.y = Mouse.pos[1]
  2241.     else
  2242.       @cursor.x = @event_window.item.screen_x
  2243.       @cursor.y = @event_window.item.screen_y - 16
  2244.     end
  2245.     @cursor_zooming += 1
  2246.     case @cursor_zooming
  2247.     when 1..10 ; @cursor.zoom_x -= 0.01 ; @cursor.zoom_y -= 0.01
  2248.     when 11..20; @cursor.zoom_x += 0.01 ; @cursor.zoom_y += 0.01
  2249.     when 21..30; @cursor.zoom_x = 1.0   ; @cursor.zoom_y = 1.0
  2250.       @cursor_zooming = 0
  2251.     end
  2252.   end
  2253.  
  2254.   def terminate
  2255.     super
  2256.     @event_window.dispose
  2257.     @background_sprite.dispose
  2258.     @info_window.dispose
  2259.     @info_window.bitmap.dispose
  2260.     if @mouse_exist
  2261.       @cursor.zoom_x = 1.0   ; @cursor.zoom_y = 1.0 ; @selected = nil
  2262.     else
  2263.       @cursor.dispose unless @cursor.nil?
  2264.       @cursor.bitmap.dispose unless @cursor.nil?
  2265.     end
  2266.   end
  2267. end
  2268.  
  2269. #-------------------------------------------------------------------------------
  2270. # Window pets
  2271. class Window_Pets < Window_Selectable
  2272.   def initialize(shop)
  2273.     super(0, 0,  406, 122)
  2274.     self.z = 101
  2275.     @shop = shop
  2276.     refresh
  2277.     self.index = 0
  2278.     activate
  2279.   end
  2280.  
  2281.   def item
  2282.     return @data[self.index]
  2283.   end
  2284.  
  2285.   def refresh
  2286.     self.contents.clear if self.contents != nil
  2287.     @data = []
  2288.     FalPet::Pets.each do |id , pet|
  2289.       pet.push(id) unless pet.include?(id)
  2290.       @data.push(pet) if @shop
  2291.       @data.push(pet) if $game_player.adopted_pets.include?(id) and !@shop
  2292.     end
  2293.     @item_max = @data.size
  2294.     if @item_max > 0
  2295.       self.contents = Bitmap.new(width - 32, row_max * 26)
  2296.       for i in 0...@item_max
  2297.         draw_item(i)
  2298.       end
  2299.     end
  2300.   end
  2301.  
  2302.   def draw_item(index)
  2303.     item = @data[index]
  2304.     x, y = index % col_max * (107 + 32), index / col_max  * 24
  2305.     self.contents.font.size = 18
  2306.     self.contents.draw_text(x, y, 212, 32, item[2], 0)
  2307.   end
  2308.  
  2309.   def item_max
  2310.     return @item_max.nil? ? 0 : @item_max
  2311.   end
  2312.  
  2313.   def col_max
  2314.     return 3
  2315.   end
  2316. end
  2317.  
  2318. #-------------------------------------------------------------------------------
  2319. # Scene pets base, refered at pep shop and pets adopted
  2320. class Scene_PetsBase < Scene_Base
  2321.   def start
  2322.     super
  2323.     @pet = $game_player.gamepet
  2324.     SceneManager.scene_is?(Scene_PetShop) ? @shop = true : @shop = false
  2325.     @pet_window = Window_Pets.new(@shop)
  2326.     x, y = 544 / 2 -406 / 2, 0
  2327.     @pet_window.x = x
  2328.     @pet_window.y = y + 110
  2329.     @info_window = Window_Base.new(x, y, 406, 110)
  2330.     @bonus_window = Window_Base.new(x, y + 122 + 110, 406, 184)
  2331.     @background_sprite = Sprite.new
  2332.     @background_sprite.bitmap = SceneManager.background_bitmap
  2333.     refresh_infodata
  2334.   end
  2335.  
  2336.   def refresh_infodata
  2337.     @info_window.contents.clear
  2338.     @info_window.contents.font.size = 18
  2339.     @shop ? xy = [0, 0] : xy = [286, 0]
  2340.     @info_window.contents.fill_rect(xy[0], xy[1],90,76, Color.new(0,0,0,60))
  2341.     @info_window.draw_character(@pet_window.item[0],
  2342.     @pet_window.item[1], xy[0] + 45, xy[1] + 64)
  2343.     @info_window.draw_text(xy[0] + 20, xy[1] + 66, 350, 32, '')
  2344.     create_price_info if @shop
  2345.     refresh_bonus
  2346.     return if @shop
  2347.     @info_window.contents.fill_rect(0, -18, 90, 90, Color.new(0, 0, 0, 60))
  2348.     @info_window.draw_text(0, 64, @info_window.width, 32, '当前宠物')
  2349.     @info_window.draw_text(-16, 0, @info_window.width, 32, @pet.petname, 1)
  2350.     @info_window.draw_character(@pet.character_name,@pet.character_index,45,64)
  2351.   end
  2352.  
  2353.   def refresh_bonus
  2354.     @bonus_window.contents.clear
  2355.     @bonus_window.contents.font.size = 20
  2356.     y = 0; manager = 0
  2357.     @bonus_window.contents.font.color = Color.new(255, 120, 0, 255)
  2358.     @bonus_window.draw_text(40, -6, 406, 32, '特殊技能', 1)
  2359.     @bonus_window.draw_text(0, -6, 406, 32, '增益')
  2360.     @bonus_window.contents.font.color = @bonus_window.normal_color
  2361.  
  2362.     # draw speciality
  2363.     @bonus_window.contents.font.size = 16
  2364.     enable = FalPet::Speciality[@pet_window.item[6]]
  2365.     FalPet::Commands.each do |id, command |
  2366.       if enable.include?(id)
  2367.         manager += 1
  2368.         (manager%2 == 0) ? x = 260 : y += 17
  2369.         x = 128 unless (manager%2 == 0)
  2370.         @bonus_window.draw_text(x, y, @bonus_window.width, 32, command[0])
  2371.       end
  2372.     end
  2373.  
  2374.     #draw bonus parameters
  2375.     bonus = FalPet::Bonus[@pet_window.item[6]]
  2376.     y = 0
  2377.     for i in 0...8
  2378.       y += 17
  2379.       @bonus_window.draw_text(0, y, 406, 32, Vocab.param(i))
  2380.       @bonus_window.draw_text(58, y, 406, 32, "=> #{bonus[i].to_s}")
  2381.     end
  2382.   end
  2383.  
  2384.   def create_price_info
  2385.     @info_window.contents.font.size = 22
  2386.     @info_window.draw_text(156, 0, @info_window.width, 32, '宠物商店')
  2387.     @info_window.contents.font.size = 18
  2388.     @info_window.draw_text(156, 32, 350, 32, "名字: #{@pet_window.item[2]}")
  2389.     v = pet_price
  2390.     @info_window.draw_text(156,64,350,18,"价格: $#{v} " + Vocab::currency_unit)
  2391.     @info_window.contents.fill_rect(320, -18, 62, 56, Color.new(0, 0, 0, 60))
  2392.     @info_window.draw_text(28, 0, 350, 18, $game_party.gold.to_s, 2)
  2393.     @info_window.draw_text(28, 18, 350, 18, Vocab::currency_unit, 2)
  2394.   end
  2395.  
  2396.   def pet_price
  2397.     return FalPet::Price[@pet_window.item[6]]
  2398.   end
  2399.  
  2400.   def terminate
  2401.     super
  2402.     @bonus_window.dispose
  2403.     @background_sprite.dispose
  2404.     @info_window.dispose
  2405.     @pet_window.dispose
  2406.   end
  2407. end
  2408.  
  2409. #-------------------------------------------------------------------------------
  2410. # Scene pet adopted
  2411. class Scene_Pets < Scene_PetsBase
  2412.  
  2413.   def start() super end
  2414.   def update
  2415.     super
  2416.     if Input.trigger?(:B)
  2417.       SceneManager.goto(Scene_PetCommands)
  2418.       Sound.play_cancel
  2419.     end
  2420.     if @index != @pet_window.index
  2421.       @index = @pet_window.index
  2422.       refresh_infodata
  2423.     end
  2424.     if Input.trigger?(:C)
  2425.       @pet.setup_pet(@pet_window.item[6])
  2426.       refresh_infodata   
  2427.     end
  2428.   end
  2429. end
  2430.  
  2431. #-------------------------------------------------------------------------------
  2432. # Scene pet shop
  2433.  
  2434. class Scene_PetShop < Scene_PetsBase
  2435.  
  2436.   def start
  2437.     super
  2438.     @pop_window = Window_Base.new(200, 170, 150, 110)
  2439.     @pop_window.z = 500
  2440.     @pop_time = 0
  2441.     @pop_window.visible = false
  2442.   end
  2443.  
  2444.   def refresh_pop(type)
  2445.     @pop_window.contents.clear
  2446.     @pop_window.contents.font.size = 18
  2447.     case type
  2448.     when 1
  2449.       @pop_window.draw_text(0, 0, @pop_window.width, 32, "成功买入!")
  2450.       @pop_window.draw_text(0, 22, @pop_window.width, 32, @pet_window.item[2])
  2451.       @pop_window.draw_text(0, 44, @pop_window.width, 32,
  2452.       Vocab::currency_unit + " -#{pet_price}")
  2453.     when 2
  2454.       @pop_window.draw_text(0, 0, 200, 32, "你没有")
  2455.       @pop_window.draw_text(0, 22, 200, 32, "足够的#{Vocab::currency_unit}")
  2456.     when 3
  2457.       @pop_window.draw_text(0, 0, @pop_window.width, 32, "你已经拥有了!")
  2458.       @pop_window.draw_text(0, 22, @pop_window.width, 32, @pet_window.item[2])
  2459.     end
  2460.   end
  2461.  
  2462.   def update
  2463.     super
  2464.     if Input.trigger?(:B)
  2465.       SceneManager.goto(Scene_Map)
  2466.       Sound.play_cancel
  2467.     end
  2468.     if @index != @pet_window.index
  2469.       @index = @pet_window.index
  2470.       refresh_infodata
  2471.     end
  2472.     update_buying
  2473.   end
  2474.  
  2475.   def update_buying
  2476.     @pop_time -= 1 if @pop_time > 0
  2477.     @pop_time > 0 ? @pop_window.visible = true : @pop_window.visible = false
  2478.     if Input.trigger?(:C)
  2479.       if $game_player.adopted_pets.include?(@pet_window.item[6])
  2480.         refresh_pop(3)
  2481.         @pop_time = 2 * 60
  2482.         Sound.play_cancel
  2483.         return
  2484.       end
  2485.       if $game_party.gold >= pet_price
  2486.         $game_party.lose_gold(pet_price)
  2487.         RPG::SE.new("Shop", 80,).play
  2488.         $game_player.adopt_pet(@pet_window.item[6])
  2489.         refresh_infodata
  2490.         refresh_pop(1)
  2491.         @pop_time = 2 * 60
  2492.       else
  2493.         refresh_pop(2)
  2494.         @pop_time = 2 * 60
  2495.         Sound.play_buzzer
  2496.       end
  2497.     end
  2498.   end
  2499.  
  2500.   def terminate
  2501.     super
  2502.     @pop_window.dispose
  2503.   end
  2504. end
  2505.  
  2506. #-------------------------------------------------------------------------------
  2507.  
  2508. # update global cool down
  2509. class << Input
  2510.   unless self.method_defined?(:falcaopet_ccd_update)
  2511.     alias_method :falcaopet_ccd_update,   :update
  2512.   end
  2513.  
  2514.   def update
  2515.     update_cooldown_system
  2516.     falcaopet_ccd_update
  2517.   end
  2518.  
  2519.   def update_cooldown_system
  2520.     player = $game_player
  2521.     unless player.nil?
  2522.       player.gamepet.instantcd -= 1 if player.gamepet.instantcd > 0
  2523.       for i in 0...player.gamepet.cooldown.size
  2524.         if player.gamepet.cooldown[i] > 0 and player.gamepet.instantcd > 0   
  2525.           player.gamepet.cooldown[i] = 0 if not i == 19 - 1
  2526.         end
  2527.         player.gamepet.cooldown[i] -= 1 if player.gamepet.cooldown[i] > 0
  2528.       end
  2529.     end
  2530.   end
  2531. end
  2532.  
  2533. module SceneManager
  2534.   def self.callp(scene_class, *args)
  2535.     @scene = scene_class.new(*args)
  2536.   end
  2537. end
  2538.  
  2539. #-------------------------------------------------------------------------------
  2540. # FA Interactive System 2.0 pet plug-ins
  2541.  
  2542. class Game_Player < Game_Character
  2543.   if defined?(FalInt).is_a?(String)
  2544.     alias falcaopetplugins_fall player_start_falling
  2545.     def player_start_falling
  2546.       @showing_pet = false
  2547.       $game_system.replay_bgm if @gamepet.command == 8 ; globalpet_reset
  2548.       falcaopetplugins_fall
  2549.     end
  2550.   end
  2551. end
  2552.  
  2553. class Game_CharacterBase
  2554.   if defined?(FalInt).is_a?(String)
  2555.     alias falcaopetplugins_start_jump start_jump
  2556.     def start_jump(power)
  2557.       player = self.is_a?(Game_Player)
  2558.       if player and Input.dir4 != 0
  2559.         self.followers.reverse_each {|f| f.move_toward_player }
  2560.         self.gamepet.move_toward_player ; self.gamepet.move_toward_player
  2561.         self.gamepet.jump(0,  power)  if @direction == 2
  2562.         self.gamepet.jump(- power, 0) if @direction == 4
  2563.         self.gamepet.jump(power,  0)  if @direction == 6
  2564.         self.gamepet.jump(0, - power) if @direction == 8
  2565.         self.just_jumped = true
  2566.       end
  2567.       falcaopetplugins_start_jump(power)
  2568.     end
  2569.   end
  2570. end

附加:宠物显示踏步动画的脚本
RUBY 代码复制
  1. # set up (around line 747 for me)
  2.   def setup_pet(id)
  3.     get_bonus(@pet_id, sub = true) if @pet_id > 0
  4.     @pet_id = id
  5.     set = Pets[@pet_id]
  6.     @character_name = set[0]
  7.     @character_index = set[1]
  8.     @petname = set[2]
  9.     @sounds = [set[3], set[4], set[5]]
  10.     @balloon_id = 1 if SceneManager.scene_is?(Scene_Map)
  11.  
  12.     if @pet_id == 11       # 11号宠物显示踏步动画(模拟飞行效果)
  13.       @step_anime = true   
  14.  
  15.       elsif @pet_id == 12    # 如果你要设置多个显示踏步动画的宠物
  16.       @step_anime = true     # 复制这两行,粘贴到else前
  17.  
  18.       else                  
  19.       @step_anime = false  
  20.     end                     
  21.     play_voice
  22.     get_bonus(@pet_id)
  23.   end

作者发布的demo失效已多年,附带我自己做了一个粗糙的demo
宠物小帮手系统.rar (1.46 MB, 下载次数: 239)




360截图-35415019.jpg (38.29 KB, 下载次数: 15)

360截图-35415019.jpg

评分

参与人数 1星屑 +200 收起 理由
唯道集虚 + 200 塞糖

查看全部评分

VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm

Lv4.逐梦者

梦石
0
星屑
9489
在线时间
580 小时
注册时间
2017-4-17
帖子
196

开拓者

2
发表于 2017-12-6 01:25:10 | 只看该作者
谢谢了 这可是真正古董了
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

3
发表于 2017-12-6 16:23:43 | 只看该作者
标题改一下吧···注明一下是va的
因为第一眼看着也有点像mv或者vx···

点评

啊,忘记了,感谢提醒  发表于 2017-12-6 18:22
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

梦石
0
星屑
3105
在线时间
741 小时
注册时间
2015-2-28
帖子
816

开拓者

4
发表于 2017-12-8 15:43:53 | 只看该作者
楼主辛苦啦~
这个也算是老古董了,不过真的是蛮不错的。
依稀当初我用这个宠物系统的时候因为没有汉化所以琢磨了很久的说(x

点评

感觉汉化完之后也不是很懂最后自定义命令那里, 自己试来试去也只能使用一种自定义动作T T  发表于 2017-12-8 15:57
器识为先,文艺其从。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-4 02:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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