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

Project1

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

[已经过期] 这两个脚本的作用是什么?

[复制链接]

Lv2.观梦者

梦石
0
星屑
293
在线时间
398 小时
注册时间
2011-5-20
帖子
128
跳转到指定楼层
1
发表于 2013-11-9 17:38:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - Battle Cry (V1.0) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]http://www.atelier-rgss.com[/url]
  6. #==============================================================================
  7. # Sistema de execução de multiplas vozes aleatórias durante a batalha.
  8. # O sistema funciona tanto para inimigos como para os personagens.
  9. #===============================================================================
  10. module MOG_BATTLE_CRY
  11.  
  12.   # Não modifique essa parte.
  13.   # ☢CAUTION!!☢ Don't Touch.^_^
  14.   ACTOR_SKILL = []
  15.   ACTOR_ITEM = []
  16.   ACTOR_GENERAL_ACTION = []
  17.   ACTOR_DAMAGE = []
  18.   ACTOR_RECOVER = []
  19.   ACTOR_DEFEATED = []
  20.   ACTOR_BATTLE_START = []  
  21.   ACTOR_BATTLE_END = []
  22.   ACTOR_BATTLE_ESCAPE = []
  23.   ACTOR_TURN_ACTIVE = []
  24.   ACTOR_LEVEL_UP = []  
  25.   ENEMY_SKILL = []
  26.   ENEMY_GENERAL_ACTION = []
  27.   ENEMY_DAMAGE = []
  28.   ENEMY_RECOVER = []
  29.   ENEMY_DEFEATED = []
  30.  
  31.   # ----------------------------------------------------------------------------
  32.   # Definição do volume da voz.
  33.   VOLUME = 130
  34.  
  35.   # Exemplo de configuração geral, o modo de configurar é igual para todas as
  36.   # ações do battler.
  37.   #
  38.   # ACTOR_SKILL[ A ] = {  B=>["C","C","C"],
  39.   #
  40.   # A - ID do battler.
  41.   # B - ID da skill. (Caso necessário)
  42.   # C - Nome do arquivo de som.
  43.  
  44.  
  45.   #----------------------------------------------------------------------------
  46.   # BATTLE START
  47.   #----------------------------------------------------------------------------  
  48.   ACTOR_BATTLE_START[1] = ["V_ACT1_START_1","V_ACT1_START_2"]
  49.   ACTOR_BATTLE_START[2] = ["V_ACT2_START_1","V_ACT2_START_2","V_ACT2_START_3"]
  50.   ACTOR_BATTLE_START[3] = ["V_ACT3_START_1","V_ACT3_START_2"]
  51.   ACTOR_BATTLE_START[4] = ["V_ACT4_START_1","V_ACT4_START_2","V_ACT4_START_3"]
  52.  
  53.   #----------------------------------------------------------------------------
  54.   # BATTLE END
  55.   #----------------------------------------------------------------------------   
  56.   ACTOR_BATTLE_END[1] = ["V_ACT1_WIN_1","V_ACT1_WIN_2"]
  57.   ACTOR_BATTLE_END[2] = ["V_ACT2_WIN_1","V_ACT2_WIN_2","V_ACT2_WIN_3"]
  58.   ACTOR_BATTLE_END[3] = ["V_ACT3_WIN_1","V_ACT3_WIN_2","V_ACT3_WIN_3"]
  59.   ACTOR_BATTLE_END[4] = ["V_ACT4_WIN_1","V_ACT4_WIN_2"]
  60.  
  61.   #----------------------------------------------------------------------------
  62.   # BATTLE ESCAPE
  63.   #----------------------------------------------------------------------------      
  64.   ACTOR_BATTLE_ESCAPE[1] = ["V_ACT1_SKILL_9"]
  65.   ACTOR_BATTLE_ESCAPE[2] = ["V_ACT2_SKILL_4"]
  66.   ACTOR_BATTLE_ESCAPE[3] = ["V_ACT3_SKILL_4"]
  67.   ACTOR_BATTLE_ESCAPE[4] = ["V_ACT4_SKILL_7"]
  68.  
  69.   #----------------------------------------------------------------------------
  70.   # ACTOR TURN ACTIVE
  71.   #----------------------------------------------------------------------------
  72.   # Funciona apenas com script MOG AT SYSTEM.
  73.   ACTOR_TURN_ACTIVE[1] = ["V_ACT1_TURN_1","V_ACT1_TURN_2","V_ACT1_TURN_3"]
  74.   ACTOR_TURN_ACTIVE[2] = ["V_ACT2_TURN_1","V_ACT2_TURN_2","V_ACT2_TURN_3"]
  75.   ACTOR_TURN_ACTIVE[3] = ["V_ACT3_TURN_1","V_ACT3_TURN_2","V_ACT3_TURN_3"]
  76.   ACTOR_TURN_ACTIVE[4] = ["V_ACT4_TURN_1","V_ACT4_TURN_2","V_ACT4_TURN_3"]  
  77.  
  78.   #----------------------------------------------------------------------------
  79.   # ACTOR LEVEL UP
  80.   #----------------------------------------------------------------------------  
  81.   ACTOR_LEVEL_UP[1] = ["V_ACT1_TURN_1"]
  82.   ACTOR_LEVEL_UP[2] = ["V_ACT2_TURN_1"]
  83.   ACTOR_LEVEL_UP[3] = ["V_ACT3_TURN_1"]
  84.   ACTOR_LEVEL_UP[4] = ["V_ACT4_TURN_1"]
  85.  
  86.   #----------------------------------------------------------------------------
  87.   # ACTOR SKILL
  88.   #----------------------------------------------------------------------------
  89.   ACTOR_SKILL[1] = {
  90.   1=>["V_ACT1_ATTACK_1","V_ACT1_ATTACK_2","V_ACT1_ATTACK_3"],
  91.   2=>["V_ACT1_WIN_1","V_ACT1_WIN_2"]
  92.   }  
  93.  
  94.   ACTOR_SKILL[2] = {
  95.   1=>["V_ACT2_ATTACK_1","V_ACT2_ATTACK_2","V_ACT2_ATTACK_3"],
  96.   2=>["V_ACT2_WIN_1","V_ACT2_WIN_2","V_ACT2_WIN_3"],
  97.   26=>["V_ACT2_SKILL_6","V_ACT2_SKILL_7","V_ACT2_SKILL_8"],
  98.   29=>["V_ACT2_SKILL_6","V_ACT2_SKILL_7","V_ACT2_SKILL_8"],
  99.   32=>["V_ACT2_SKILL_6","V_ACT2_SKILL_7","V_ACT2_SKILL_8"],
  100.   33=>["V_ACT2_SKILL_6","V_ACT2_SKILL_7","V_ACT2_SKILL_8"],
  101.   }
  102.  
  103.   ACTOR_SKILL[3] = {
  104.   1=>["V_ACT3_ATTACK_1","V_ACT3_ATTACK_2","V_ACT3_ATTACK_3"],
  105.   2=>["V_ACT3_SKILL_4"],
  106.   26=>["V_ACT3_SKILL_3","V_ACT3_SKILL_6","V_ACT3_SKILL_7"],
  107.   76=>["V_ACT3_SKILL_3","V_ACT3_SKILL_6","V_ACT3_SKILL_7"],
  108.   77=>["V_ACT3_SKILL_3","V_ACT3_SKILL_6","V_ACT3_SKILL_7"],
  109.   78=>["V_ACT3_SKILL_3","V_ACT3_SKILL_6","V_ACT3_SKILL_7"]
  110.   }
  111.  
  112.   ACTOR_SKILL[4] = {
  113.   1=>["V_ACT4_ATTACK_1","V_ACT4_ATTACK_2","V_ACT4_ATTACK_3"],
  114.   2=>["V_ACT4_SKILL_3","V_ACT4_SKILL_8"],
  115.   51=>["V_ACT4_SKILL_1","V_ACT4_SKILL_4","V_ACT4_SKILL_6","V_ACT4_SKILL_9"],
  116.   53=>["V_ACT4_SKILL_1","V_ACT4_SKILL_4","V_ACT4_SKILL_6","V_ACT4_SKILL_9"],
  117.   61=>["V_ACT4_SKILL_1","V_ACT4_SKILL_4","V_ACT4_SKILL_6","V_ACT4_SKILL_9"],
  118.   66=>["V_ACT4_SKILL_1","V_ACT4_SKILL_4","V_ACT4_SKILL_6","V_ACT4_SKILL_9"],
  119.   74=>["V_ACT4_SKILL_1","V_ACT4_SKILL_4","V_ACT4_SKILL_6","V_ACT4_SKILL_9"]
  120.   }
  121.  
  122.   #----------------------------------------------------------------------------
  123.   # ACTOR ITEM
  124.   #----------------------------------------------------------------------------
  125.   ACTOR_ITEM[1] = {
  126.   1=>["V_ACT1_SKILL_6","V_ACT1_SKILL_7"], 2=>["V_ACT1_SKILL_6","V_ACT1_SKILL_7"],
  127.   3=>["V_ACT1_SKILL_6","V_ACT1_SKILL_7"], 4=>["V_ACT1_SKILL_6","V_ACT1_SKILL_7"],
  128.   5=>["V_ACT1_SKILL_6","V_ACT1_SKILL_7"], 6=>["V_ACT1_SKILL_6","V_ACT1_SKILL_7"],
  129.   7=>["V_ACT1_SKILL_6","V_ACT1_SKILL_7"], 8=>["V_ACT1_SKILL_6","V_ACT1_SKILL_7"],
  130.   17=>["V_ACT1_SKILL_6","V_ACT1_SKILL_7"]
  131.   }  
  132.  
  133.   ACTOR_ITEM[2] = {
  134.   1=>["V_ACT2_RECOVER_2"],  2=>["V_ACT2_RECOVER_2"],  3=>["V_ACT2_RECOVER_2"],
  135.   4=>["V_ACT2_RECOVER_2"],  5=>["V_ACT2_RECOVER_2"],  6=>["V_ACT2_RECOVER_2"],
  136.   7=>["V_ACT2_RECOVER_2"],  8=>["V_ACT2_RECOVER_2"],  17=>["V_ACT2_RECOVER_2"]
  137.   }
  138.  
  139.   ACTOR_ITEM[3] = {
  140.   1=>["V_ACT3_WIN_2"],  2=>["V_ACT3_WIN_2"],  3=>["V_ACT3_WIN_2"],
  141.   4=>["V_ACT3_WIN_2"],  5=>["V_ACT3_WIN_2"],  6=>["V_ACT3_WIN_2"],
  142.   7=>["V_ACT3_WIN_2"],  8=>["V_ACT3_WIN_2"],  17=>["V_ACT3_WIN_2"]
  143.   }  
  144.  
  145.   ACTOR_ITEM[4] = {
  146.   1=>["V_ACT4_START_3"],  2=>["V_ACT4_START_3"],  3=>["V_ACT4_START_3"],
  147.   4=>["V_ACT4_START_3"],  5=>["V_ACT4_START_3"],  6=>["V_ACT4_START_3"],
  148.   7=>["V_ACT4_START_3"],  8=>["V_ACT4_START_3"],  17=>["V_ACT4_START_3"]
  149.   }  
  150.  
  151.   #----------------------------------------------------------------------------
  152.   # ACTOR GENERAL ACTION *( STANDARD / FOR ALL SKILLS / ITEMS)
  153.   #----------------------------------------------------------------------------  
  154.   # Definição das vozes para habilidades não especificas. Essas vozes serão
  155.   # ativadas em todas habilidades que não estejam definidas na função ACTOR SKILL.
  156.   # Naturalmente se não desejar essa função basta não definir nada.
  157.   ACTOR_GENERAL_ACTION[2] = ["V_ACT2_ATTACK_1","V_ACT2_ATTACK_2","V_ACT2_ATTACK_3"]
  158.  
  159.   #----------------------------------------------------------------------------
  160.   # ACTOR DAMAGE
  161.   #----------------------------------------------------------------------------
  162.   ACTOR_DAMAGE[1] = ["V_ACT1_DAMAGE_1","V_ACT1_DAMAGE_2"]
  163.   ACTOR_DAMAGE[2] = ["V_ACT2_DAMAGE_1","V_ACT2_DAMAGE_2","V_ACT2_DAMAGE_3"]
  164.   ACTOR_DAMAGE[3] = ["V_ACT3_DAMAGE_1","V_ACT3_DAMAGE_2","V_ACT3_DAMAGE_3"]
  165.   ACTOR_DAMAGE[4] = ["V_ACT4_DAMAGE_1","V_ACT4_DAMAGE_2","V_ACT4_DAMAGE_3"]
  166.  
  167.   #----------------------------------------------------------------------------
  168.   # ACTOR RECOVER
  169.   #----------------------------------------------------------------------------
  170.   ACTOR_RECOVER[1] = ["V_ACT1_RECOVER_1","V_ACT1_RECOVER_2"]
  171.   ACTOR_RECOVER[2] = ["V_ACT2_RECOVER_1","V_ACT2_RECOVER_2"]
  172.   ACTOR_RECOVER[3] = ["V_ACT3_RECOVER_1","V_ACT3_RECOVER_2"]
  173.   ACTOR_RECOVER[4] = ["V_ACT4_RECOVER_1","V_ACT4_RECOVER_2"]
  174.  
  175.   #----------------------------------------------------------------------------
  176.   # ACTOR DEFEATED
  177.   #----------------------------------------------------------------------------
  178.   ACTOR_DEFEATED[1] = ["V_ACT1_DEFEAT_1"]
  179.   ACTOR_DEFEATED[2] = ["V_ACT2_DEFEAT_1"]
  180.   ACTOR_DEFEATED[3] = ["V_ACT3_DEFEAT_1"]
  181.   ACTOR_DEFEATED[4] = ["V_ACT4_DEFEAT_1","V_ACT4_DEFEAT_2"]  
  182.  
  183.   #----------------------------------------------------------------------------
  184.   # ENEMY SKILL
  185.   #----------------------------------------------------------------------------
  186.   ENEMY_SKILL[7] = {
  187.   135=>["V_ENE1_SKILL_3"]
  188.   }   
  189.   ENEMY_SKILL[9] = {
  190.   137=>["Cel_Attack_01","Cel_Attack_02","Cel_Attack_03","Cel_Attack_04"]
  191.   }      
  192.  
  193.  
  194.   #----------------------------------------------------------------------------
  195.   # ENEMY GENERAL SKILLS
  196.   #----------------------------------------------------------------------------  
  197.   ENEMY_GENERAL_ACTION[7] = ["V_ENE1_ATTACK_1","V_ENE1_ATTACK_2","V_ENE1_ATTACK_3"]
  198.  
  199.   #----------------------------------------------------------------------------
  200.   # ENEMY DAMAGE
  201.   #----------------------------------------------------------------------------
  202.   ENEMY_DAMAGE[7] = ["V_ENE1_DAMAGE_1","V_ENE1_DAMAGE_2","V_ENE1_DAMAGE_3"]
  203.   ENEMY_DAMAGE[9] = ["Cel_Damage1","Cel_Damage2"]
  204.  
  205.   #----------------------------------------------------------------------------
  206.   # ENEMY RECOVER
  207.   #----------------------------------------------------------------------------
  208.   ENEMY_RECOVER[7] = []
  209.  
  210.   #----------------------------------------------------------------------------
  211.   # ENEMY DEFEATED
  212.   #----------------------------------------------------------------------------
  213.   ENEMY_DEFEATED[7] =  ["V_ENE1_DEFEAT_1"]
  214.  
  215. end
  216.  
  217. #===============================================================================
  218. # ■ Battle Cry
  219. #===============================================================================
  220. module BATTLE_CRY
  221.  
  222.   include MOG_BATTLE_CRY
  223.  
  224.   #--------------------------------------------------------------------------
  225.   # ● Execute Battle Cry
  226.   #--------------------------------------------------------------------------      
  227.   def execute_battle_cry(type = 0, skill_id = nil, battler = nil)
  228.       @type = type
  229.       @skill_id = skill_id
  230.       [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  231.       case @type
  232.          when 0 # START #
  233.            check_members_alive
  234.            voice_list = ACTOR_BATTLE_START[@battler.id] rescue nil         
  235.          when 1 # END   #
  236.             check_members_alive
  237.             voice_list = ACTOR_BATTLE_END[@battler.id] rescue nil
  238.          when 2 # SKILL #
  239.             if @battler.is_a?(Game_Actor)
  240.                voice = ACTOR_SKILL[@battler.id] rescue nil     
  241.             else  
  242.                voice = ENEMY_SKILL[@battler.enemy_id] rescue nil
  243.             end
  244.             voice_list = voice[@skill_id] rescue nil
  245.             if voice_list == nil # GENERAL ACTION
  246.                if @battler.is_a?(Game_Actor)
  247.                   voice_list = ACTOR_GENERAL_ACTION[@battler.id] rescue nil     
  248.                else  
  249.                   voice_list = ENEMY_GENERAL_ACTION[@battler.enemy_id] rescue nil
  250.                end
  251.             end  
  252.          when 3 # DAMAGE #
  253.             if @battler.hp > 0
  254.                if @battler.is_a?(Game_Actor)
  255.                   voice_list = ACTOR_DAMAGE[@battler.id] rescue nil     
  256.                else  
  257.                   voice_list = ENEMY_DAMAGE[@battler.enemy_id] rescue nil
  258.                end            
  259.             else # DEFEATED #
  260.                if @battler.is_a?(Game_Actor)
  261.                   voice_list = ACTOR_DEFEATED[@battler.id] rescue nil     
  262.                else  
  263.                   voice_list = ENEMY_DEFEATED[@battler.enemy_id] rescue nil
  264.                end                        
  265.             end
  266.          when 4 # RECOVER #
  267.               if @battler.is_a?(Game_Actor)
  268.                  voice_list = ACTOR_RECOVER[@battler.id] rescue nil     
  269.               else  
  270.                  voice_list = ENEMY_RECOVER[@battler.enemy_id] rescue nil
  271.               end            
  272.          when 5 # ITEM #
  273.                voice = ACTOR_ITEM[@battler.id] rescue nil     
  274.                voice_list = voice[@skill_id] rescue nil
  275.             if voice_list == nil # GENERAL SKILLS
  276.                voice_list = ACTOR_GENERAL_ACTION[@battler.id] rescue nil     
  277.             end         
  278.          when 6 # START #
  279.                check_members_alive
  280.                voice_list = ACTOR_BATTLE_ESCAPE[@battler.id] rescue nil
  281.          when 7 # TURN #
  282.                voice_list = ACTOR_TURN_ACTIVE[@battler.id] rescue nil            
  283.       end
  284.       play_battle_cry(voice_list)
  285.       check_battle_addons
  286.   end
  287.  
  288.   #--------------------------------------------------------------------------
  289.   # ● Play Battle Cry
  290.   #--------------------------------------------------------------------------      
  291.   def play_battle_cry(voice_list)
  292.       return if voice_list == nil
  293.       voice_id = voice_list[rand(voice_list.size)]
  294.       Audio.se_play("Audio/SE/" + voice_id.to_s,VOLUME,100) rescue nil      
  295.   end
  296.  
  297.   #--------------------------------------------------------------------------
  298.   # ● Check Members Alive
  299.   #--------------------------------------------------------------------------        
  300.   def check_members_alive
  301.       alive_members = []
  302.       id = 0
  303.       for i in $game_party.battle_members
  304.           alive_members.push(i) if i.hp > 0
  305.       end   
  306.       members_id = rand(alive_members.size)
  307.       for i in alive_members
  308.           if members_id == id
  309.              @battler = i
  310.              break
  311.           end   
  312.           id += 1
  313.        end            
  314.        @battler = alive_members[members_id]
  315.   end     
  316.  
  317.   #--------------------------------------------------------------------------
  318.   # ● Check Battle Addons
  319.   #--------------------------------------------------------------------------      
  320.   def check_battle_addons
  321.       if $mog_rgss3_battle_hud != nil and MOG_BATTLE_HUD::BATTLER_FACE_ENABLE and
  322.          @battler != nil and @battler.is_a?(Game_Actor)
  323.          if @type == 0 or @type == 1 or @type == 6
  324.             @battler.battler_face = [2,3,50]
  325.          elsif @type == 7
  326.             @battler.battler_face = [0,3,50]
  327.          end   
  328.       end  
  329.   end  
  330.  
  331. end
  332.  
  333. #==============================================================================
  334. # ■ BattleManager
  335. #==============================================================================
  336. class << BattleManager
  337.   include BATTLE_CRY
  338.  
  339.   #--------------------------------------------------------------------------
  340.   # ● Battle Start
  341.   #--------------------------------------------------------------------------  
  342.   alias mog_battle_cry_battle_start battle_start
  343.   def battle_start
  344.       mog_battle_cry_battle_start
  345.     #  execute_battle_cry(0, nil, nil)
  346.   end  
  347.  
  348.   #--------------------------------------------------------------------------
  349.   # ● Process Victory
  350.   #--------------------------------------------------------------------------   
  351.   alias mog_battle_cry_process_victory process_victory
  352.   def process_victory
  353.       execute_battle_cry(1, nil, nil)         
  354.       mog_battle_cry_process_victory
  355.   end  
  356.  
  357.   #--------------------------------------------------------------------------
  358.   # ● Process Abort
  359.   #--------------------------------------------------------------------------      
  360.   alias mog_battle_cry_process_abort process_abort
  361.   def process_abort
  362.       execute_battle_cry(6, nil, nil)
  363.       mog_battle_cry_process_abort
  364.   end  
  365.  
  366. end
  367.  
  368. #==============================================================================
  369. # ■ Game Battler
  370. #==============================================================================
  371. class Game_Battler < Game_BattlerBase
  372.   include BATTLE_CRY
  373.  
  374.   #--------------------------------------------------------------------------
  375.   # ● Execute Damage
  376.   #--------------------------------------------------------------------------      
  377.   alias mog_battle_cry_execute_damage execute_damage
  378.   def execute_damage(user)
  379.       mog_battle_cry_execute_damage(user)   
  380.       execute_battle_cry_damage
  381.   end
  382.  
  383.   #--------------------------------------------------------------------------
  384.   # ● Execute Battle Cry Damage
  385.   #--------------------------------------------------------------------------        
  386.   def execute_battle_cry_damage
  387.       if @result.hp_damage > 0
  388.          execute_battle_cry(3, nil, self)
  389.       elsif @result.hp_damage < 0   
  390.          execute_battle_cry(4, nil, self)
  391.       else
  392.          if @result.hp_damage == 0
  393.             if @result.mp_damage > 0
  394.                execute_battle_cry(3, nil, self)
  395.             elsif @result.mp_damage < 0
  396.                execute_battle_cry(4, nil, self)
  397.             end   
  398.          end   
  399.       end
  400.   end  
  401.  
  402.   #--------------------------------------------------------------------------
  403.   # ● Item Effect Recover HP
  404.   #--------------------------------------------------------------------------         
  405.   alias mog_battle_cry_item_effect_recover_hp item_effect_recover_hp  
  406.   def item_effect_recover_hp(user, item, effect)
  407.       chp = self.hp
  408.       mog_battle_cry_item_effect_recover_hp(user, item, effect)
  409.       if self.hp > chp
  410.          execute_battle_cry(4, nil, self)
  411.       elsif self.hp < chp
  412.          execute_battle_cry(3, nil, self)
  413.       end  
  414.   end
  415.  
  416.   #--------------------------------------------------------------------------
  417.   # ● Item Effect Reover MP
  418.   #--------------------------------------------------------------------------            
  419.   alias mog_battle_cry_item_effect_recover_mp item_effect_recover_mp
  420.   def item_effect_recover_mp(user, item, effect)
  421.       cmp = self.mp
  422.       mog_battle_cry_item_effect_recover_mp(user, item, effect)
  423.       if self.mp > cmp
  424.          execute_battle_cry(4, nil, self)
  425.       elsif self.mp < cmp
  426.          execute_battle_cry(3, nil, self)
  427.       end        
  428.   end  
  429.  
  430. end
  431.  
  432. #==============================================================================
  433. # ■ Game Action
  434. #==============================================================================
  435. class Scene_Battle < Scene_Base
  436. include BATTLE_CRY
  437.  
  438.   #--------------------------------------------------------------------------
  439.   # ● Show Animations
  440.   #--------------------------------------------------------------------------     
  441.   alias mog_battle_cry_show_animation show_animation
  442.   def show_animation(targets, animation_id)
  443.       if @subject.is_a?(Game_Actor) and @subject.current_action.item.is_a?(RPG::Item)
  444.           execute_battle_cry(5, @subject.current_action.item.id, @subject)
  445.       else   
  446.           execute_battle_cry(2, @subject.current_action.item.id, @subject)
  447.       end  
  448.       mog_battle_cry_show_animation(targets, animation_id)
  449.   end
  450.  
  451.   if $mog_rgss3_at_system != nil
  452.   #--------------------------------------------------------------------------
  453.   # ● Update AT Actor
  454.   #--------------------------------------------------------------------------            
  455.   alias mog_battle_cry_update_at_actor update_at_actor
  456.   def update_at_actor(battler)   
  457.        mog_battle_cry_update_at_actor(battler)  
  458.        execute_battle_cry(7, nil, battler) if battler.is_a?(Game_Actor)
  459.   end   
  460.   end   
  461.  
  462.   #--------------------------------------------------------------------------
  463.   # ● Battle Start
  464.   #--------------------------------------------------------------------------  
  465.   alias mog_battle_cry_update_battle update
  466.   def update
  467.       mog_battle_cry_update_battle
  468.       execute_battle_cry_start
  469.   end   
  470.  
  471.   #--------------------------------------------------------------------------
  472.   # ● Execite Battle Cry Start
  473.   #--------------------------------------------------------------------------   
  474.   def execute_battle_cry_start
  475.       return if @battle_cry_start != nil
  476.       @battle_cry_start = true
  477.       execute_battle_cry(0, nil, nil)
  478.   end
  479. end  
  480.  
  481. $mog_rgss3_battle_cry = true

RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - Kekkai (Bounded Field) (v1.2) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]http://www.atelier-rgss.com/[/url]
  6. #==============================================================================
  7. # Permite o inimigo invocar uma barreira mágica (Kekkai / Bounded Field)
  8. # onde serão adicionadas regras no campo de batalha. O sistema inclúi
  9. # efeitos animados simulando o Kekkai ativado.
  10. #==============================================================================
  11.  
  12. #==============================================================================
  13. # ● UTILIZAÇÃO
  14. #==============================================================================
  15. # Modo 1 (Event)
  16. # Use o comando abaixo através do comando chamar script.
  17. #
  18. # kekkai(ID)
  19. #
  20. # ID do Kekkai
  21. #
  22. #==============================================================================
  23. # Modo 2 (Skill)
  24. # Coloque o comentário abaixo na caixa de notas de habilidades .
  25. #
  26. # <Kekkai = ID>
  27. #
  28. #==============================================================================
  29. # Para cancelar o Kekkai use o comando abaixo.
  30. #
  31. # kekkai_clear
  32. #
  33. # ou
  34. #
  35. # kekkai(nil)
  36. #
  37. #==============================================================================
  38.  
  39. #==============================================================================
  40. # ● As imagens devem ser gravadas na pasta Graphics/Pictures/
  41. #==============================================================================
  42. module MOG_KEKKAI
  43.  
  44.   BOUNDED_FIELD = [] # ☢CAUTION!!☢ Don't Touch.^_^
  45.  
  46.   #BOUNDED_FIELD[A] = [B,C,D]
  47.   # A = FIELD ID.
  48.   # B = Description (Kekkai Title).
  49.   #
  50.   # C = Effect Type.
  51.   #       0 - Enemy Power UP
  52.   #       1 - Enemy Defense UP
  53.   #       2 - Enemy Invulnerable.
  54.   #       3 - Party Damage Reverse.
  55.   #       4 - Party always 1 HP or 0 HP.
  56.   #       5 - Party always 0 MP.
  57.   #       6 - Party Power Down.
  58.   #       7 - Party Defense Down.
  59.   #       8 - Seal Skill & Guard Command.
  60.   #       9 - Seal All Commands. (Except Guard Command)
  61.   #      10 - Slip HP Damage.
  62.   #      11 - Slip MP Damage.
  63.   #
  64.   # D = Background File Name.
  65.   # E = Background Animation Type.
  66.   #       0 - Scrolling
  67.   #       1 - Wave
  68.   # F = Scroll Speed X / Wave Power. (0 - 10)
  69.   # G = Scroll Speed Y / Wave Speed. (0 - 10)
  70.   # H = Opacity. (0,255)
  71.   # I = Blend Type. (0- Normal / 1 - Add / 2 - Substract)
  72.  
  73.   BOUNDED_FIELD[1] = ["Curse  of  Dreams  and  Reality.", #Kekkai Name
  74.                        3,          # Effect Type
  75.                        "Background_1",  # Picture file Name
  76.                        1,          # Animation Type
  77.                        4,          # Scroll Speed X
  78.                        4,          # Scroll Speed Y
  79.                        150,        # Opacity
  80.                        0           # Blend Type
  81.                        ]                       
  82.   BOUNDED_FIELD[2] = ["Balance of Motion and Stillness.",5, "Kekkai1", 0,1,1,255,0]
  83.   BOUNDED_FIELD[3] = ["Mesh of Light and Darkness.",9, "Background_1", 1,4,10,250,2]
  84.   BOUNDED_FIELD[4] = ["Boundary of Humans and Youkai",2, "Background_5", 1,4,4,155,0]
  85.   BOUNDED_FIELD[5] = ["Boundary of Life and Death.",4, "Background_8", 0,0,0,255,0]
  86.   BOUNDED_FIELD[6] = ["Boundary of Life and Death.",4, "Background_8", 1,1,1,255,0]
  87.  
  88.   #Definição do poder de ataque do campo.
  89.   ATTACK_PERC = 100
  90.  
  91.   #Definição do poder de defesa do campo.
  92.   DEFENSE_PERC = 100
  93.  
  94.   #Porcentagem de dano no efeito Slip.
  95.   SLIP_DAMAGE_PERC = 20
  96.  
  97.   #Posição do texto (Title). (x,y)
  98.   TEXT_POSITION = [310,0]
  99.  
  100.   #Ativar o efeito de zoom no texto.
  101.   TEXT_ZOOM_EFFECT = true
  102.  
  103.   #Definição da cor da fonte.  
  104.   FONT_COLOR = Color.new(255,255,255)
  105.  
  106.   #Apresentar os efeitos em danos. (*É preciso ter o script MOG_Damage_Popup)
  107.   EFFECT_POPUP = true
  108.   EFFECT_POPUP_WORD = "Kekkai Effect"
  109.   EFFECT_POPUP_INVUNERABLE_WORD = "Invulnerable"
  110.   EFFECT_POPUP_REVERSE_DAMAGE_WORD = "Reverse Effect"
  111. end
  112. #==============================================================================
  113. # ● Histórico (Version History)
  114. #==============================================================================
  115. # v 1.2 - Correção na compatibilidade com o script Advanced Battle Hud.
  116. #         No efeito Drain.
  117. # v 1.1 - Melhoria na codificação.
  118. #==============================================================================
  119.  
  120. #==============================================================================
  121. # ■ Game Temp
  122. #==============================================================================
  123. class Game_Temp
  124.  
  125.   attr_accessor :kekkai
  126.   attr_accessor :battle_end
  127.  
  128.   #--------------------------------------------------------------------------
  129.   # ● Initialize
  130.   #--------------------------------------------------------------------------  
  131.   alias mog_bounded_field_initialize initialize
  132.   def initialize
  133.       @kekkai = [false,nil,nil]
  134.       @battle_end = false
  135.       mog_bounded_field_initialize
  136.   end  
  137.  
  138. end
  139.  
  140. #==============================================================================
  141. # ■ Game Interpreter
  142. #==============================================================================
  143. class Game_Interpreter
  144.  
  145.   #--------------------------------------------------------------------------
  146.   # ● Bounded Field
  147.   #--------------------------------------------------------------------------  
  148.   def kekkai(id = nil)
  149.       id = nil if id < 1
  150.       $game_temp.kekkai = [true,id]
  151.   end
  152.  
  153.   #--------------------------------------------------------------------------
  154.   # ● Clear  Kekkai
  155.   #--------------------------------------------------------------------------   
  156.   def kekkai_clear
  157.       $game_temp.kekkai = [true,nil]
  158.   end  
  159.  
  160.   #--------------------------------------------------------------------------
  161.   # ● Clear Bounded Field
  162.   #--------------------------------------------------------------------------   
  163.   def clear_bounded_field
  164.       $game_temp.kekkai = [true,nil]
  165.   end
  166.  
  167. end
  168.  
  169. #==============================================================================
  170. # ■ Bounded Field
  171. #==============================================================================
  172. class Bounded_Field
  173.  
  174.   include MOG_KEKKAI
  175.  
  176.   #--------------------------------------------------------------------------
  177.   # ● Initialize
  178.   #--------------------------------------------------------------------------  
  179.   def initialize(viewport = nil)
  180.       $game_temp.kekkai = [false,nil]
  181.       $game_temp.battle_end = false
  182.       @effect = ["",0,"",0,0,0,0,0]
  183.       @phase = 0
  184.       create_kekkai_text(viewport)
  185.   end
  186.  
  187.   #--------------------------------------------------------------------------
  188.   # ● Create Kekkai Layer
  189.   #--------------------------------------------------------------------------   
  190.   def create_kekkai_layer
  191.       if @effect[3] == 0
  192.          @kekkai_1 = Plane.new
  193.          @kekkai_1.bitmap = Cache.picture(@effect[2].to_s)
  194.        else
  195.          range = (@effect[4] + 1) * 10
  196.          range = 500 if range > 500
  197.          speed = (@effect[5] + 1) * 100
  198.          speed = 1000 if speed > 1000                  
  199.          @kekkai_image = Cache.picture(@effect[2].to_s)
  200.          @kekkai_1 = Sprite.new
  201.          @kekkai_1.x = -range
  202.          @kekkai_1.wave_amp = range
  203.          @kekkai_1.wave_length = Graphics.width
  204.          @kekkai_1.wave_speed = speed
  205.          @kekkai_1.bitmap = Bitmap.new(Graphics.width + (range * 2),Graphics.height)
  206.          @kekkai_1.bitmap.stretch_blt(@kekkai_1.bitmap.rect, @kekkai_image, @kekkai_image.rect)
  207.       end  
  208.   end
  209.  
  210.   #--------------------------------------------------------------------------
  211.   # ● Refresh Kekkai Layer
  212.   #--------------------------------------------------------------------------      
  213.   def refresh_kekkai_layer
  214.       dispose_kekkai_layer
  215.       create_kekkai_layer
  216.       @kekkai_1.viewport = @kekkai_text.viewport rescue nil
  217.       @kekkai_1.z = 9
  218.       @kekkai_1.opacity = 0
  219.       @kekkai_1.blend_type = @effect[7]
  220.       @kekkai_1.visible = true
  221.   end
  222.  
  223.   #--------------------------------------------------------------------------
  224.   # ● Dispose
  225.   #--------------------------------------------------------------------------   
  226.   def dispose
  227.       dispose_kekkai_layer
  228.       dispose_kekkai_text
  229.       $game_temp.kekkai = [false,nil]
  230.   end
  231.  
  232.   #--------------------------------------------------------------------------
  233.   # ● Dispose Kekkai Layer
  234.   #--------------------------------------------------------------------------      
  235.   def dispose_kekkai_layer
  236.       return if @kekkai_1 == nil
  237.       if @kekkai_1.bitmap != nil
  238.          @kekkai_1.bitmap.dispose
  239.          @kekkai_1.bitmap = nil
  240.       end   
  241.       @kekkai_1.dispose
  242.       @kekkai_1 = nil
  243.       if @kekkai_image != nil
  244.          @kekkai_image.dispose
  245.          @kekkai_image = nil
  246.       end   
  247.   end   
  248.  
  249.   #--------------------------------------------------------------------------
  250.   # ● Dispose kekkai Text Bitmap
  251.   #--------------------------------------------------------------------------            
  252.   def dispose_kekkai_text_bitmap
  253.       return if @kekkai_text == nil
  254.       return if @kekkai_text.bitmap == nil
  255.       @kekkai_text.bitmap.dispose
  256.       @kekkai_text.bitmap = nil
  257.   end   
  258.  
  259.   #--------------------------------------------------------------------------
  260.   # ● Dispose Kekkai Text
  261.   #--------------------------------------------------------------------------      
  262.   def dispose_kekkai_text
  263.       return if @kekkai_text == nil
  264.       dispose_kekkai_text_bitmap
  265.       @kekkai_text.dispose
  266.       @kekkai_text = nil
  267.   end
  268.  
  269.   #--------------------------------------------------------------------------
  270.   # ● Create Kekkai Text
  271.   #--------------------------------------------------------------------------        
  272.   def create_kekkai_text(viewport)
  273.       @kekkai_text_duration = 0
  274.       @kekkai_text = Sprite.new
  275.       @kekkai_text.viewport = viewport
  276.       @kekkai_text.z = 11
  277.       @kekkai_text.ox = 120
  278.       @kekkai_text.oy = 16
  279.       @kekkai_text.x = @kekkai_text.ox + TEXT_POSITION[0]
  280.       @kekkai_text.y = @kekkai_text.oy + TEXT_POSITION[1]
  281.       @kekkai_text.visible = false
  282.       refresh_kekkai_text
  283.   end
  284.  
  285.   #--------------------------------------------------------------------------
  286.   # ● Refresh Kekkai Text
  287.   #--------------------------------------------------------------------------         
  288.   def refresh_kekkai_text
  289.       dispose_kekkai_text_bitmap
  290.       @kekkai_text_duration = 0
  291.       @kekkai_text.bitmap = Bitmap.new(240,32)
  292.       text = @effect[0]
  293.       @kekkai_text.bitmap.font.size = 22
  294.       @kekkai_text.bitmap.font.name = "Georgia"
  295.       @kekkai_text.bitmap.font.bold = true
  296.       @kekkai_text.bitmap.font.color = Color.new(0,0,0)
  297.       @kekkai_text.bitmap.draw_text(0,0,240,32,text.to_s, 1)
  298.       @kekkai_text.bitmap.font.color = FONT_COLOR
  299.       @kekkai_text.bitmap.draw_text(2,2,240,32,text.to_s, 1)
  300.       @kekkai_text.zoom_x = 1.00
  301.       @kekkai_text.zoom_y = 1.00
  302.       @kekkai_text.opacity = 0
  303.       @kekkai_text.visible = true
  304.   end  
  305.  
  306.  
  307.   #--------------------------------------------------------------------------
  308.   # ● Update
  309.   #--------------------------------------------------------------------------   
  310.   def update
  311.       refresh_kekkai if can_refresh_kekkai?
  312.       update_kekkai if can_update_kekkai?
  313.   end
  314.  
  315.   #--------------------------------------------------------------------------
  316.   # ● Can Refresh Kekkain?
  317.   #--------------------------------------------------------------------------      
  318.   def can_refresh_kekkai?
  319.       return false if !$game_temp.kekkai[0]
  320.       return true
  321.   end
  322.  
  323.   #--------------------------------------------------------------------------
  324.   # ● Can Update Kekkai?
  325.   #--------------------------------------------------------------------------        
  326.   def can_update_kekkai?
  327.       return false if @phase == 0
  328.       return true
  329.   end
  330.  
  331.   #--------------------------------------------------------------------------
  332.   # ● Refresh Kekkai
  333.   #--------------------------------------------------------------------------      
  334.   def refresh_kekkai
  335.       $game_temp.kekkai[0] = false
  336.       @effect = BOUNDED_FIELD[$game_temp.kekkai[1]] rescue nil
  337.       if @effect != nil
  338.          refresh_party_effects
  339.          refresh_kekkai_layer
  340.          refresh_kekkai_text
  341.          @phase = 1
  342.       else
  343.          @phase = 2
  344.       end  
  345.   end  
  346.  
  347.   #--------------------------------------------------------------------------
  348.   # ● Refresh Party Effects
  349.   #--------------------------------------------------------------------------        
  350.   def refresh_party_effects
  351.       if @effect[1] == 4 or @effect[1] == 5
  352.          index = 0
  353.          for i in $game_party.members
  354.              i.hp = 1 if i.hp != 0 and @effect[1] == 4
  355.              i.mp = 0 if @effect[1] == 5
  356.              if $mog_rgss3_battle_hud != nil
  357.                 i.battler_face = [3,0,40]
  358.              end   
  359.              if $mog_rgss3_damage_pop != nil and MOG_KEKKAI::EFFECT_POPUP
  360.                 i.damage.push([MOG_KEKKAI::EFFECT_POPUP_WORD,"Kekkai Effect"])
  361.              end                    
  362.              index += 1
  363.              break if index >= $game_party.max_battle_members
  364.          end  
  365.       end
  366.   end  
  367.  
  368.   #--------------------------------------------------------------------------
  369.   # ● Update Kekkai
  370.   #--------------------------------------------------------------------------        
  371.   def update_kekkai
  372.       update_kekkai_layer
  373.       update_kekkai_text
  374.       if !$game_temp.battle_end
  375.           if @phase == 1
  376.              if  @kekkai_1.opacity < @effect[6]
  377.                  @kekkai_1.opacity += 5
  378.                  @kekkai_1.opacity = @effect[6] if @kekkai_1.opacity > @effect[6]
  379.              end   
  380.              @kekkai_text.opacity += 5
  381.           elsif @phase == 2
  382.              update_kekkai_clear
  383.           end
  384.       else
  385.           update_fade_sprite
  386.       end  
  387.   end  
  388.  
  389.   #--------------------------------------------------------------------------
  390.   # ● Update Kekkai Layer
  391.   #--------------------------------------------------------------------------         
  392.   def update_kekkai_layer
  393.       return if @kekkai_1 == nil
  394.       return if @effect == nil
  395.       if @effect[3] == 0
  396.          @kekkai_1.ox += @effect[4]
  397.          @kekkai_1.oy += @effect[5]
  398.       else
  399.          @kekkai_1.update
  400.       end
  401.   end  
  402.  
  403.   #--------------------------------------------------------------------------
  404.   # ● Update Kekkai Text
  405.   #--------------------------------------------------------------------------         
  406.   def update_kekkai_text
  407.       return if @kekkai_text == nil
  408.       return if !@kekkai_text.visible
  409.       return if !TEXT_ZOOM_EFFECT
  410.       @kekkai_text_duration += 1
  411.       case @kekkai_text_duration
  412.          when 1..20
  413.            @kekkai_text.zoom_x += 0.005
  414.            @kekkai_text.zoom_y += 0.005         
  415.          when 21..40
  416.            @kekkai_text.zoom_x -= 0.005
  417.            @kekkai_text.zoom_y -= 0.005                  
  418.          else  
  419.            @kekkai_text.zoom_x = 1.00
  420.            @kekkai_text.zoom_y = 1.00
  421.            @kekkai_text_duration = 0
  422.       end
  423.   end  
  424.  
  425.   #--------------------------------------------------------------------------
  426.   # ● Update Kekkai Clear
  427.   #--------------------------------------------------------------------------         
  428.   def update_kekkai_clear
  429.       return if @phase == 0
  430.       return if @kekkai_1 == nil
  431.       @kekkai_1.opacity -= 5
  432.       @kekkai_text.opacity -= 5
  433.       if @kekkai_1.opacity == 0
  434.          dispose_kekkai_layer
  435.          dispose_kekkai_text_bitmap
  436.          @kekkai_text.visible = false
  437.          @phase = 0
  438.       end   
  439.   end
  440.  
  441.   #--------------------------------------------------------------------------
  442.   # ● Update Fade Sprite
  443.   #--------------------------------------------------------------------------            
  444.   def update_fade_sprite
  445.       if @kekkai_1 != nil
  446.          @kekkai_1.opacity -= 5
  447.       end
  448.       if @kekkai_text != nil
  449.          @kekkai_text.opacity -= 5
  450.       end  
  451.   end  
  452.  
  453. end
  454.  
  455. #==============================================================================
  456. # ■ Spriteset_Battle
  457. #==============================================================================
  458. class Spriteset_Battle
  459.  
  460.   #--------------------------------------------------------------------------
  461.   # ● Initialize
  462.   #--------------------------------------------------------------------------  
  463.   alias mog_bounded_field_initialize initialize
  464.   def initialize
  465.       mog_bounded_field_initialize
  466.       create_bounded_field
  467.   end
  468.  
  469.   #--------------------------------------------------------------------------
  470.   # ● Dispose
  471.   #--------------------------------------------------------------------------  
  472.   alias mog_bounded_field_dispose dispose
  473.   def dispose
  474.       dispose_bounded_field
  475.       mog_bounded_field_dispose      
  476.   end
  477.  
  478.   #--------------------------------------------------------------------------
  479.   # ● Update
  480.   #--------------------------------------------------------------------------  
  481.   alias mog_bounded_field_update update
  482.   def update
  483.       mog_bounded_field_update
  484.       update_bounded_field
  485.   end
  486.  
  487.   #--------------------------------------------------------------------------
  488.   # ● Create Bounded Field
  489.   #--------------------------------------------------------------------------   
  490.   def create_bounded_field
  491.       @bounded_field = Bounded_Field.new(@viewport1)
  492.   end
  493.  
  494.   #--------------------------------------------------------------------------
  495.   # ● Dispose Bounded Field
  496.   #--------------------------------------------------------------------------   
  497.   def dispose_bounded_field
  498.       return if @bounded_field == nil
  499.       @bounded_field.dispose
  500.   end
  501.  
  502.   #--------------------------------------------------------------------------
  503.   # ● Update Bounded Field
  504.   #--------------------------------------------------------------------------   
  505.   def update_bounded_field
  506.       return if @bounded_field == nil
  507.       @bounded_field.update
  508.   end
  509.  
  510. end
  511.  
  512. #==============================================================================
  513. # ■ Game_Battler
  514. #==============================================================================
  515. class Game_Battler < Game_BattlerBase
  516.  
  517.   #--------------------------------------------------------------------------
  518.   # ● Bounded Effect
  519.   #--------------------------------------------------------------------------        
  520.   def bounded_effect
  521.       MOG_KEKKAI::BOUNDED_FIELD[$game_temp.kekkai[1]] rescue nil
  522.   end   
  523.  
  524.   #--------------------------------------------------------------------------
  525.   # ● Execute Damage
  526.   #--------------------------------------------------------------------------      
  527.   alias mog_bounded_field_execute_damage execute_damage
  528.   def execute_damage(user)      
  529.       execute_bounded_field_effects_before(user,bounded_effect) if bounded_effect != nil
  530.       mog_bounded_field_execute_damage(user)
  531.       execute_bounded_field_effects_after(user,bounded_effect) if bounded_effect != nil
  532.   end
  533.  
  534.   #--------------------------------------------------------------------------
  535.   # ● Item Apply
  536.   #--------------------------------------------------------------------------        
  537.   alias mog_bounded_field_item_apply item_apply
  538.   def item_apply(user, item)
  539.       return if bounded_nil_effect_enemy?(user)
  540.       mog_bounded_field_item_apply(user, item)
  541.   end
  542.  
  543.   #--------------------------------------------------------------------------
  544.   # ● Bounded Nil Effect Enemy?
  545.   #--------------------------------------------------------------------------         
  546.   def bounded_nil_effect_enemy?(user)
  547.       return false if bounded_effect == nil
  548.       return false if self.is_a?(Game_Actor)
  549.       return false if user.is_a?(Game_Enemy)
  550.       return false if bounded_effect[1] != 2
  551.       if $mog_rgss3_damage_pop != nil and MOG_KEKKAI::EFFECT_POPUP
  552.          self.damage.push([MOG_KEKKAI::EFFECT_POPUP_INVUNERABLE_WORD,"Invunerable"]) if bounded_effect[1] == 2
  553.       end
  554.       @result.clear
  555.       return true
  556.   end  
  557.  
  558.   #--------------------------------------------------------------------------
  559.   # ● Execute Bounded Field Effects Before
  560.   #--------------------------------------------------------------------------        
  561.   def execute_bounded_field_effects_before(user,bounded_effect)
  562.       case bounded_effect[1]
  563.           when 0; bounded_power_effect(user)
  564.           when 1; bounded_defense_effect(user)
  565.           when 2; bounded_invunerable_effect(user)
  566.           when 3; bounded_reverse_damage_effect(user)
  567.           when 4; bounded_nil_drain_hp(user)
  568.           when 5; bounded_nil_drain_mp(user)
  569.           when 6; bounded_power_effect_actor(user)
  570.           when 7; bounded_defense_effect_actor(user)            
  571.       end
  572.   end
  573.  
  574.   #--------------------------------------------------------------------------
  575.   # ● Execute Bounded Field Effects After
  576.   #--------------------------------------------------------------------------        
  577.   def execute_bounded_field_effects_after(user,bounded_effect)
  578.       case bounded_effect[1]
  579.            when 4; bounded_nil_actor_recover_hp(user)
  580.            when 5; bounded_nil_actor_recover_mp(user)
  581.       end
  582.   end  
  583.  
  584.   #--------------------------------------------------------------------------
  585.   # ● Bounded Power Effect
  586.   #--------------------------------------------------------------------------         
  587.   def bounded_power_effect(user)
  588.       return if self.is_a?(Game_Enemy)
  589.       return if user.is_a?(Game_Actor)
  590.       dam = @result.hp_damage * MOG_KEKKAI::ATTACK_PERC / 100
  591.       dam = 0 if dam < 0
  592.       @result.hp_damage += dam
  593.   end
  594.  
  595.   #--------------------------------------------------------------------------
  596.   # ● Bounded Power Effect User
  597.   #--------------------------------------------------------------------------         
  598.   def bounded_power_effect_actor(user)
  599.       return if user.is_a?(Game_Enemy)
  600.       return if @result.hp_damage < 0
  601.       dam = @result.hp_damage * MOG_KEKKAI::ATTACK_PERC / 100
  602.       dam = 0 if dam < 0
  603.       @result.hp_damage -= dam
  604.       @result.hp_damage = 0 if @result.hp_damage < 0
  605.   end  
  606.  
  607.   #--------------------------------------------------------------------------
  608.   # ● Bounded Defense Effect
  609.   #--------------------------------------------------------------------------         
  610.   def bounded_defense_effect(user)
  611.       return if self.is_a?(Game_Actor)
  612.       return if user.is_a?(Game_Enemy)
  613.       dam = @result.hp_damage * MOG_KEKKAI::DEFENSE_PERC / 100
  614.       dam2 = @result.hp_damage - dam
  615.       dam2 = 0 if dam2 < 0
  616.       @result.hp_damage = dam2
  617.   end  
  618.  
  619.   #--------------------------------------------------------------------------
  620.   # ● Bounded Defense Effect Actor
  621.   #--------------------------------------------------------------------------         
  622.   def bounded_defense_effect_actor(user)
  623.       return if self.is_a?(Game_Enemy)
  624.       dam = @result.hp_damage * MOG_KEKKAI::DEFENSE_PERC / 100
  625.       dam2 = @result.hp_damage + dam
  626.       dam2 = 0 if dam2 < 0
  627.       @result.hp_damage = dam2
  628.   end   
  629.  
  630.   #--------------------------------------------------------------------------
  631.   # ● Bounded Invunerable Effect
  632.   #--------------------------------------------------------------------------         
  633.   def bounded_invunerable_effect(user)
  634.       return if self.is_a?(Game_Actor)
  635.       return if user.is_a?(Game_Enemy)
  636.       @result.hp_damage = 0
  637.   end
  638.  
  639.   #--------------------------------------------------------------------------
  640.   # ● Bounded Reverse Damage Effect
  641.   #--------------------------------------------------------------------------         
  642.   def bounded_reverse_damage_effect(user)
  643.       return if @result.hp_damage == 0
  644.       return if user.is_a?(Game_Enemy)
  645.       if $mog_rgss3_damage_pop != nil and MOG_KEKKAI::EFFECT_POPUP
  646.          self.damage.push([MOG_KEKKAI::EFFECT_POPUP_REVERSE_DAMAGE_WORD,"Reverse Effect"])
  647.       end         
  648.       @result.hp_damage = [email]-@result.hp_damage[/email]
  649.       if @result.hp_drain != nil and @result.hp_drain != 0
  650.          @result.hp_drain = [email]-@result.hp_drain[/email]
  651.          if $mog_rgss3_battle_hud != nil
  652.             user.battler_face = [3,0,40]
  653.          end
  654.       end
  655.   end
  656.  
  657.   #--------------------------------------------------------------------------
  658.   # ● Bounded Nil Drain HP
  659.   #--------------------------------------------------------------------------              
  660.   def bounded_nil_drain_hp(user)
  661.       return if self.is_a?(Game_Actor)
  662.       @result.hp_drain = 0
  663.   end
  664.  
  665.   #--------------------------------------------------------------------------
  666.   # ● Bounded Nil Actor Recover HP
  667.   #--------------------------------------------------------------------------            
  668.   def bounded_nil_actor_recover_hp(user)
  669.       return if self.is_a?(Game_Enemy)
  670.       @result.hp_drain = 0
  671.       self.hp = 1 if self.hp > 1
  672.   end  
  673.  
  674.   #--------------------------------------------------------------------------
  675.   # ● Bounded Nil Drain MP
  676.   #--------------------------------------------------------------------------              
  677.   def bounded_nil_drain_mp(user)
  678.       return if self.is_a?(Game_Actor)
  679.       @result.mp_drain = 0
  680.   end
  681.  
  682.   #--------------------------------------------------------------------------
  683.   # ● Bounded Nil Actor Recover MP
  684.   #--------------------------------------------------------------------------            
  685.   def bounded_nil_actor_recover_mp(user)
  686.       return if self.is_a?(Game_Enemy)
  687.       self.mp = 0
  688.   end
  689.  
  690.   #--------------------------------------------------------------------------
  691.   # ● Item Effect Recover HP
  692.   #--------------------------------------------------------------------------
  693.   alias mog_bounded_field_item_effect_recover_hp item_effect_recover_hp
  694.   def item_effect_recover_hp(user, item, effect)
  695.       if bounded_effect != nil and bounded_effect[1] == 3
  696.          execute_bounded_reverse_item_hp(user, item, effect)
  697.          return
  698.       end  
  699.       mog_bounded_field_item_effect_recover_hp(user, item, effect)
  700.       if bounded_effect != nil and self.is_a?(Game_Actor)
  701.          execute_bounded_seal_hp
  702.       end
  703.   end   
  704.  
  705.   #--------------------------------------------------------------------------
  706.   # ● Execute Bounded Reverse Item HP
  707.   #--------------------------------------------------------------------------  
  708.   def execute_bounded_reverse_item_hp(user, item, effect)
  709.       if $mog_rgss3_damage_pop != nil and MOG_KEKKAI::EFFECT_POPUP
  710.          self.damage.push(["Reverse Effect","Reverse Effect"])
  711.       end   
  712.       value = (mhp * effect.value1 + effect.value2) * rec
  713.       value *= user.pha if item.is_a?(RPG::Item)
  714.       value = -value.to_i
  715.       @result.hp_damage -= value
  716.       @result.success = true
  717.       self.hp += value
  718.   end
  719.  
  720.   #--------------------------------------------------------------------------
  721.   # ● Execute Bounded seal HP
  722.   #--------------------------------------------------------------------------  
  723.   def execute_bounded_seal_hp
  724.       return if bounded_effect[1] != 4
  725.       self.hp = 1 if self.hp > 0
  726.   end
  727.  
  728.   #--------------------------------------------------------------------------
  729.   # ● Item Effect Recover MP
  730.   #--------------------------------------------------------------------------
  731.   alias mog_bounded_field_item_effect_recover_mp item_effect_recover_mp
  732.   def item_effect_recover_mp(user, item, effect)
  733.       mog_bounded_field_item_effect_recover_mp(user, item, effect)
  734.       if bounded_effect != nil and self.is_a?(Game_Actor)
  735.          execute_bounded_seal_mp
  736.       end   
  737.   end
  738.  
  739.   #--------------------------------------------------------------------------
  740.   # ● Execute Bounded seal MP
  741.   #--------------------------------------------------------------------------  
  742.   def execute_bounded_seal_mp
  743.       return if bounded_effect[1] != 5
  744.       self.mp = 0 if self.mp > 0
  745.   end
  746.  
  747.   #--------------------------------------------------------------------------
  748.   # ● Regenerate HP
  749.   #--------------------------------------------------------------------------            
  750.   alias mog_bounded_field_regenerate_hp regenerate_hp
  751.   def regenerate_hp
  752.       mog_bounded_field_regenerate_hp
  753.       if bounded_effect != nil and self.is_a?(Game_Actor)
  754.          execute_bounded_slip_hp
  755.          execute_bounded_seal_hp
  756.       end
  757.   end  
  758.  
  759.   #--------------------------------------------------------------------------
  760.   # ● Regenerate mp
  761.   #--------------------------------------------------------------------------              
  762.   alias mog_bounded_field_regenerate_mp regenerate_mp
  763.   def regenerate_mp
  764.       mog_bounded_field_regenerate_mp
  765.       if bounded_effect != nil and self.is_a?(Game_Actor)
  766.          execute_bounded_slip_mp
  767.          execute_bounded_seal_mp
  768.       end
  769.   end   
  770.  
  771.   #--------------------------------------------------------------------------
  772.   # ● Execute Bounded Slip HP
  773.   #--------------------------------------------------------------------------               
  774.   def execute_bounded_slip_hp
  775.       return if bounded_effect[1] != 10
  776.       return if self.hp <= 1
  777.       dmg = self.mhp * MOG_KEKKAI::SLIP_DAMAGE_PERC  / 100
  778.       dmg = 1 if dmg < 1
  779.       dmg = self.hp - 1 if dmg > self.hp
  780.       self.hp -= dmg if self.hp > 0
  781.       if $mog_rgss3_damage_pop != nil and MOG_KEKKAI::EFFECT_POPUP
  782.          self.damage.push([dmg,"HP"])
  783.          self.damage.push([MOG_KEKKAI::EFFECT_POPUP_WORD,"Kekkai Effect"])
  784.       end      
  785.   end
  786.  
  787.   #--------------------------------------------------------------------------
  788.   # ● Execute Bounded Slip MP
  789.   #--------------------------------------------------------------------------               
  790.   def execute_bounded_slip_mp
  791.       return if bounded_effect[1] != 11
  792.       return if self.mp == 0
  793.       dmg = self.mmp * MOG_KEKKAI::SLIP_DAMAGE_PERC  / 100
  794.       self.mp -= dmg
  795.       if $mog_rgss3_damage_pop != nil and MOG_KEKKAI::EFFECT_POPUP
  796.          self.damage.push([dmg,"MP"])
  797.          self.damage.push([MOG_KEKKAI::EFFECT_POPUP_WORD,"Kekkai Effect"])
  798.       end      
  799.   end  
  800.  
  801. end
  802.  
  803. #==============================================================================
  804. # ■ Game_Interpreter
  805. #==============================================================================
  806. class Game_Interpreter
  807.  
  808.   #--------------------------------------------------------------------------
  809.   # ● Bounded Effect
  810.   #--------------------------------------------------------------------------        
  811.   def bounded_effect
  812.       MOG_KEKKAI::BOUNDED_FIELD[$game_temp.kekkai[1]] rescue nil
  813.   end     
  814.  
  815.   #--------------------------------------------------------------------------
  816.   # ● Kekkai Effect
  817.   #--------------------------------------------------------------------------   
  818.   def kekkai_effect
  819.       return if !SceneManager.scene_is?(Scene_Battle)
  820.       return if bounded_effect == nil
  821.       index = 0
  822.       for i in $game_party.members
  823.           break if index >= $game_party.max_battle_members
  824.           i.hp = 1 if bounded_effect[1] == 4 and i.hp > 1
  825.           i.mp = 0 if bounded_effect[1] == 5
  826.           index += 1
  827.       end  
  828.   end
  829.  
  830.   #--------------------------------------------------------------------------
  831.   # ● Command 311
  832.   #--------------------------------------------------------------------------  
  833.   alias mog_kekkai_command_311 command_311
  834.   def command_311
  835.       mog_kekkai_command_311
  836.       kekkai_effect
  837.   end
  838.  
  839.   #--------------------------------------------------------------------------
  840.   # ● Command 312
  841.   #--------------------------------------------------------------------------  
  842.   alias mog_kekkai_command_312 command_312
  843.   def command_312
  844.       mog_kekkai_command_312
  845.       kekkai_effect
  846.   end  
  847.  
  848.   #--------------------------------------------------------------------------
  849.   # ● Command 314
  850.   #--------------------------------------------------------------------------  
  851.   alias mog_kekkai_command_314 command_314
  852.   def command_314
  853.       mog_kekkai_command_314
  854.       kekkai_effect
  855.   end   
  856.  
  857. end
  858.  
  859. #==============================================================================
  860. # ■ Scene_Battle
  861. #==============================================================================
  862. class Scene_Battle < Scene_Base
  863.  
  864.   #--------------------------------------------------------------------------
  865.   # ● Use Item
  866.   #--------------------------------------------------------------------------
  867.   alias mog_kekkai_use_item use_item
  868.   def use_item
  869.       check_kekkai_effect
  870.       mog_kekkai_use_item
  871.   end
  872.  
  873.   #--------------------------------------------------------------------------
  874.   # ● Check Kekkai Effect
  875.   #--------------------------------------------------------------------------   
  876.   def check_kekkai_effect
  877.       return if @subject.is_a?(Game_Actor)
  878.       skill = @subject.current_action.item
  879.       if skill.note =~ /<Kekkai = (\d+)>/i
  880.          id = $1.to_i
  881.          id = nil if id < 1
  882.          $game_temp.kekkai = [true,id]
  883.       end  
  884.   end
  885.  
  886. end   
  887.  
  888. #==============================================================================
  889. # ■ BattleManager
  890. #==============================================================================
  891. class << BattleManager
  892.  
  893.   #--------------------------------------------------------------------------
  894.   # ● Init Members
  895.   #--------------------------------------------------------------------------         
  896.   alias mog_kekkai_init_members init_members
  897.   def init_members
  898.       $game_temp.battle_end = false
  899.       mog_kekkai_init_members
  900.   end  
  901.  
  902.   #--------------------------------------------------------------------------
  903.   # ● Process Victory
  904.   #--------------------------------------------------------------------------            
  905.   alias mog_kekkai_process_victory process_victory
  906.   def process_victory
  907.       $game_temp.battle_end = true
  908.       mog_kekkai_process_victory
  909.   end
  910.  
  911.   #--------------------------------------------------------------------------
  912.   # ● Process Abort
  913.   #--------------------------------------------------------------------------            
  914.   alias mog_kekkai_process_abort process_abort
  915.   def process_abort
  916.       $game_temp.battle_end = true
  917.       mog_kekkai_process_abort
  918.   end
  919.  
  920.   #--------------------------------------------------------------------------
  921.   # ● Process Defeat
  922.   #--------------------------------------------------------------------------            
  923.   alias mog_kekkai_process_defeat process_defeat
  924.   def process_defeat
  925.       $game_temp.battle_end = true
  926.       mog_kekkai_process_defeat
  927.   end
  928.  
  929. end
  930.  
  931. #==============================================================================
  932. # ■ Window Base
  933. #==============================================================================
  934. class Window_Base < Window
  935.  
  936.   #--------------------------------------------------------------------------
  937.   # ● Bounded Effect
  938.   #--------------------------------------------------------------------------        
  939.   def bounded_effect
  940.       MOG_KEKKAI::BOUNDED_FIELD[$game_temp.kekkai[1]] rescue nil
  941.   end  
  942.  
  943. end
  944.  
  945. #==============================================================================
  946. # ■ Window ActorCommand
  947. #==============================================================================
  948. class Window_ActorCommand < Window_Command
  949.  
  950.   #--------------------------------------------------------------------------
  951.   # ● Make Command List
  952.   #--------------------------------------------------------------------------         
  953.   alias mog_kekkai_make_command_list make_command_list
  954.   def make_command_list
  955.       return if kekkai_enabled?
  956.       mog_kekkai_make_command_list
  957.   end  
  958.  
  959.   #--------------------------------------------------------------------------
  960.   # ● Kekkai Enabled?
  961.   #--------------------------------------------------------------------------         
  962.   def kekkai_enabled?
  963.       if bounded_effect != nil and (bounded_effect[1] == 8 or bounded_effect[1] == 9)
  964.          if [url=home.php?mod=space&uid=95897]@actor[/url] != nil
  965.             if bounded_effect[1] == 8
  966.                add_attack_command
  967.                add_item_command
  968.             else
  969.                add_guard_command
  970.             end
  971.          end
  972.          return true
  973.       end
  974.       return false
  975.   end  
  976.  
  977. end
  978.  
  979. $mog_rgss3_kekkai = true

这两个脚本的作用是什么,使用方法是什么?

Lv5.捕梦者

梦石
0
星屑
22958
在线时间
8638 小时
注册时间
2011-12-31
帖子
3367
2
发表于 2013-11-9 18:03:08 | 只看该作者
第一個是指定在戦鬥中的音响可以随機播放(在指定数個音响文件随機使同其中一個)
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
293
在线时间
398 小时
注册时间
2011-5-20
帖子
128
3
 楼主| 发表于 2013-11-9 18:22:04 | 只看该作者
tseyik 发表于 2013-11-9 18:03
第一個是指定在戦鬥中的音响可以随機播放(在指定数個音响文件随機使同其中一個) ...

那第二个是什么作用?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 04:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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