Advertisement
diamondandplatinum3

Actor Voices in Battle ~ RGSS3

Dec 10th, 2012
3,483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 66.50 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Actor Voices in Battle
  3. #             Version: 2.6
  4. #             Author: DiamondandPlatinum3
  5. #             Date: December 11, 2012     (Original)
  6. #                   October 1, 2013    (Most Recent Update)
  7. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. #  Description:
  9. #
  10. #    This script grants you the ability to have your actors talk throughout
  11. #    battle; it will pick an actor at random at the start of battle to say
  12. #    something relevant about what they expect from this battle.
  13. #    
  14. #    After that, the actors will get voices when attacking and when getting
  15. #    damaged, also when using a skill.
  16. #
  17. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. #------------------------------------------------------------------------------
  19. #  Instructions:
  20. #  
  21. #   ~ There is a Video Tutorial explaining a lot of this script. You may watch
  22. #     it here:      http://www.youtube.com/watch?v=CaQhoZg_FgI
  23. #
  24. #
  25. #   ~ In the Editable Region Below, you must set a folder to which will contain
  26. #     all of your new voices.
  27. #     In addition, inside of THAT folder, you must also create a new folder for
  28. #     each enemy and name the folder by that enemy name.
  29. #     Example: Eric, Terence, Natalie
  30. #
  31. #
  32. #   ~ You can set up most of this script in the editable region below; you can
  33. #     set up battle voices for specific skills & items manually however.
  34. #     You do this by inserting the following code into the notetag of the
  35. #     Skill/Item:
  36. #
  37. #       ~ActorVoice: ID, "Voice_Filename"
  38. #
  39. #               or
  40. #
  41. #       ~ActorVoice: ID, "Voice_Filename", Volume, Pitch, Wait Frames
  42. #
  43. #
  44. #     Replace the ID with the id of the actor who you are using this tag with.
  45. #     Replace the "Voice_Filename" with the filename of the SE you will be playing
  46. #
  47. #     You do not need to insert Volume, Pitch or Wait Frames afterwards, but you
  48. #     can if you wish to specify them.
  49. #     You may use this same tag on a skill twice to allow for more than one voice
  50. #     per skill or for different actors.
  51. #
  52. #
  53. #
  54. #   ~ In case your game allows for actors to be given custom names by the player,
  55. #      you may additionally set up a hardcoded name for them, so as to keep
  56. #      voices in one folder where they can be accessed.
  57. #         To do so, you only simply need to use the following in a script call:
  58. #
  59. #             set_actor_voice_name(id, name)
  60. #
  61. #         Where (ID = Actor_ID) and (name = "Folder Name")
  62. #
  63. #      From now on, the script will check this folder for this specific actor's
  64. #      voices rather than elsewhere.
  65. #       Also note that this can be changed at anytime, so if for whatever reason
  66. #       your Actor changes gender throughout your game, you can always change
  67. #       the folder to a more feminine sounding actor.
  68. #
  69. #
  70. #
  71. #   ~ A Screenshot example of the above may be found here:
  72. #       http://goo.gl/HO7n0   ~ Showing the usage of the notetag for skills
  73. #       http://goo.gl/zH0aO   ~ Setting up Multiple Voices
  74. #       http://goo.gl/EP0Nf   ~ Showing the usage of the notetag for items
  75. #
  76. #       http://i.imgur.com/Oqc9BGA.png  ~ Voices Folder
  77. #       http://i.imgur.com/cq1JPBc.png  ~ Individual Folders
  78. #
  79. #
  80. #
  81. #   ~ In the editable region section your actors can have more than one thing to
  82. #     say. It's the same pattern of: "filename", volume, pitch, frames_to_wait, repeat;
  83. #     until you finish it, I trust your common sense to figure out how :)
  84. #
  85. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. #------------------------------------------------------------------------------
  87. #  Engine Modifications:
  88. #
  89. #   ~ class Scene_Battle:
  90. #       post_start                (aliased)
  91. #       apply_item_effects        (aliased)
  92. #       show_normal_animation     (overwritten)
  93. #
  94. #
  95. #   ~ class Game_Actor:
  96. #       use_item                  (aliased)
  97. #       die                       (aliased)
  98. #       change_exp                (aliased)
  99. #       item_effect_recover_hp    (aliased)
  100. #       item_effect_recover_mp    (aliased)
  101. #       execute_damage            (aliased)
  102. #       remove_state              (aliased)
  103. #       on_damage                 (aliased)
  104. #
  105. #
  106. #   ~ module BattleManager
  107. #       setup                     (aliased)
  108. #       process_escape            (aliased)
  109. #       process_victory           (aliased)
  110. #       process_defeat            (aliased)
  111. #
  112. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  113. ($diamondandplatinum3_scripts ||= {})[:BattleVoices] = true
  114. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  115. module DiamondandPlatinum3
  116. module BattleVoices
  117.   #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  118.   #                                                        -=
  119.   #                 Editable Region        ////            ==
  120.   #                                                        =-
  121.   #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  122.  
  123.   # You must create a new folder inside of your SE Audio folder and name it
  124.   # Whatever you decided to call it just below
  125.   FOLDER_DIRECTORY_NAME = "Battle_Voices"
  126.  
  127.  
  128.   # This Event Switch when turned on will mute the voice being played.
  129.   # They will still play, you just won't hear them
  130.   #
  131.   # If you leave the event switch id as zero, that means you can NEVER turn off the
  132.   # Battle Voices
  133.   EVENT_SWITCH_ID = 0
  134.  
  135.  
  136.   # If your actor has been inflicted with any of these states, they will have their
  137.   # voices muted until it is cured.
  138.   # State No.4 by default is the Silence state, which is a reasonable for muting
  139.   # you. you can add more states after it by adding another ID number and a comma
  140.   #
  141.   # If you do not want any state to mute you, simply erase everything inside the square brackets
  142.   SILENCE_STATES = [ 4, ]
  143.  
  144.  
  145.   # Here you can choose the Skills which your Actor Voices will not play for.
  146.   # By default, Skills 1-7 are skills which are used with certain commands.
  147.   # Some of those commands have their own specific Actor Voice, such as Attacking
  148.   # or Escaping, as such it is advisable to input the Skill ID referring to those
  149.   # commands in this option.
  150.   # If you are using the Default Skillset, you can leave this option as is.
  151.   # However if you're using custom skills, please make sure they're not being
  152.   # omitted inside of this option.
  153.   #
  154.   # You may also use this option to stop custom skills from having voices if you'd
  155.   # prefer.
  156.   SKILLS_NOT_TO_PLAY_VOICE_FOR = [ 1, 2, 3, 4, 5, 6, 7, ]
  157.  
  158.  
  159.   # If you've been playing and noticed that battle voices tend to happen a bit too often
  160.   # for your liking, you may use this Option to decrease the frequency in which they will
  161.   # say general things (like attacking, using items, etc). Non-general voices (such as
  162.   # specific skills) will still play whenever they are used.
  163.   #
  164.   # This works as a percentage out of 100.
  165.   VOICE_FREQUENCY = 100
  166.  
  167.  
  168.   # If an attack has multiple hits, do you want the actor in question to keep
  169.   # screaming battle cries for each hit?
  170.   PLAY_MULTIPLE_VOICES_FOR_MULTIPLE_HITS = true
  171.  
  172.  
  173.   #=============================================================================
  174.   #    Battle Start Voices
  175.   #-----------------------------------------------------------------------------
  176.   #   The Editable Parts Below will only be said when a battle starts
  177.   #=============================================================================
  178.  
  179.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  180.   # * TOO MANY ENEMIES?
  181.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  182.   TOO_MANY_ENEMIES = {  # <= Do Not Touch This Line
  183.  
  184.     # If The enemy troop in battle has this many MORE members than you do,
  185.     # an actor will say something about how you are outnumbered
  186.     :ratio => 2 ,
  187.  
  188.    
  189.     # "SE Filename", Volume, Pitch, Frames_to_Wait,
  190.     #       Repeat if you want more voices
  191.    
  192.     # What Actor One Will Say
  193.     1 => [
  194.            "Encounter Too Many Enemies1", 80, 100, 0,
  195.            "Encounter Too Many Enemies2", 80, 100, 0,
  196.          ],
  197.  
  198.  
  199.     # What Actor Two Will Say
  200.     2 => [
  201.            "Encounter Too Many Enemies1", 80, 100, 0,
  202.            "Encounter Too Many Enemies2", 80, 100, 0,
  203.          ],
  204.    
  205.    
  206.          
  207.     # You Add more voices for actors by doing the same as the above and modifying
  208.     # the number to match the actor id (ie. Terence by default is Actor 3).
  209.     # If you skip an actor, then no voice will be played for them.
  210.  
  211.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  212.   # * PARTY NEEDS HEALING?
  213.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  214.   }; PARTY_NEEDS_HEALING = { # <= Do Not Touch This Line
  215.  
  216.     # If party total HP is below this Ratio, an Actor will say something about it
  217.     # This Ratio is a percentage, so by default if your total party hp is below
  218.     # 40%, then an actor may mention that everyone is hurt
  219.     :ratio => 40 ,
  220.  
  221.    
  222.     # What Actor Two Will Say
  223.     2 => [
  224.            "Encounter Party Needs Healing1", 80, 100, 0,
  225.          ],
  226.        
  227.        
  228.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  229.   # * VERY WEAK ENEMIES?
  230.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                    
  231.   }; VERY_WEAK_ENEMIES = { # <= Do Not Touch This Line
  232.  
  233.     # Your stats are always 100%, so if the enemy troop stats are below
  234.     # the editable ratio below; that means they are considered VERY WEAK.
  235.     # By default this is 40%.
  236.     :ratio => 40 ,
  237.  
  238.    
  239.     # What Actor One Will Say
  240.     1 => [
  241.            "Encounter Very Weak Enemies1", 80, 100, 0,
  242.          ],    
  243.  
  244.  
  245.     # What Actor Two Will Say
  246.     2 => [
  247.            "Encounter Very Weak Enemies1", 80, 100, 0,
  248.          ],
  249.  
  250.          
  251.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  252.   # * WEAK ENEMIES?
  253.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  254.   }; WEAK_ENEMIES = { # <= Do Not Touch This Line
  255.  
  256.     # Same as Very Weak Enemies, but should be higher
  257.     :ratio => 80 ,
  258.  
  259.    
  260.     # What Actor One Will Say
  261.     1 => [
  262.            "Encounter Weak Enemies1", 80, 100, 0,
  263.          ],
  264.  
  265.  
  266.     # What Actor Two Will Say
  267.     2 => [
  268.            "Encounter Weak Enemies1", 80, 100, 0,
  269.            "Encounter Weak Enemies2", 80, 100, 0,
  270.          ],
  271.          
  272.          
  273.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  274.   # * EQUAL ENEMIES?
  275.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  276.   }; EQUAL_ENEMIES = { # <= Do Not Touch This Line
  277.  
  278.   # There is no Ratio for Equal Enemies
  279.  
  280.   # What Actor One Will Say
  281.   1 => [
  282.          "Encounter Equal Enemies1", 80, 100, 0,
  283.          "Encounter Equal Enemies2", 80, 100, 0,
  284.          "Encounter Equal Enemies3", 80, 100, 0,
  285.        ],
  286.    
  287.  
  288.   # What Actor Two Will Say
  289.   2 => [
  290.          "Encounter Equal Enemies1", 80, 100, 0,
  291.          "Encounter Equal Enemies2", 80, 100, 0,
  292.        ],
  293.        
  294.        
  295.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  296.   # * STRONG ENEMIES?
  297.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  298.   }; STRONG_ENEMIES = { # <= Do Not Touch This Line
  299.  
  300.     # If your stats are 100% and the enemy is 120%, they are 20% stronger than you
  301.     :ratio => 120 ,
  302.    
  303.  
  304.     # What Actor One Will Say
  305.     1 => [
  306.            "Encounter Strong Enemies1", 80, 100, 0,
  307.            "Encounter Strong Enemies2", 80, 100, 0,
  308.          ],  
  309.      
  310.          
  311.     # What Actor Two Will Say
  312.     2 => [
  313.            "Encounter Strong Enemies1", 80, 100, 0,
  314.            "Encounter Strong Enemies2", 80, 100, 0,
  315.          ],
  316.  
  317.          
  318.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  319.   # * VERY STRONG ENEMIES?
  320.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  321.   }; VERY_STRONG_ENEMIES = { # <= Do Not Touch This Line
  322.  
  323.     # Same as Strong Enemies, but should be higher
  324.     :ratio => 160 ,
  325.  
  326.  
  327.     # What Actor One Will Say
  328.     1 => [
  329.            "Encounter Very Strong Enemies1", 80, 100, 0,
  330.            "Encounter Very Strong Enemies2", 80, 100, 0,
  331.          ],
  332.  
  333.      
  334.     # What Actor Two Will Say
  335.     2 => [
  336.            "Encounter Very Strong Enemies1", 80, 100, 0,
  337.            "Encounter Very Strong Enemies2", 80, 100, 0,
  338.          ],
  339.          
  340.          
  341.          
  342.          
  343.  
  344.  
  345.   #=============================================================================
  346.   #    Battle Skills/Items Voices
  347.   #-----------------------------------------------------------------------------
  348.   #   These are generic things that your actors will say when using an skill/item
  349.   #   in battle. You can use note tags on specific skills/items, this is
  350.   #   just for the more generic skill/items (meaning your actor will always say something).
  351.   #=============================================================================
  352.  
  353.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  354.   # * WHEN USING AN ITEM
  355.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  356.   }; USING_ITEMS = { # <= Do Not Touch This Line
  357.  
  358.     # What Actor One Will Say when using an generic item
  359.     1 => [
  360.            "Using Item1", 80, 100, 10,      # Waits 10 frames before applying item effects
  361.          ],  
  362.  
  363.  
  364.     # What Actor Two Will Say when using an generic item
  365.     2 => [
  366.            "Using Item1", 80, 100, 10,
  367.          ],
  368.          
  369.          
  370.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  371.   # * WHEN USING A SKILL
  372.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  373.   }; USING_SKILLS = { # <= Do Not Touch This Line
  374.  
  375.     # What Actor One Will Say when using a generic skill
  376.     1 => [
  377.            #"Using Generic Skill01", 80, 100, 0,
  378.          ],  
  379.  
  380.  
  381.     # What Actor Two Will Say when using a generic skill
  382.     2 => [
  383.            #"Using Generic Skill01", 80, 100, 0,
  384.          ],
  385.  
  386.        
  387.        
  388.  
  389.  
  390.  
  391.   #=============================================================================
  392.   #    Battle Voices
  393.   #-----------------------------------------------------------------------------
  394.   #   These voices are heard throughout the battle, such as when attacking,
  395.   #   using a skill or taking damage, etc
  396.   #=============================================================================
  397.  
  398.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  399.   # * WHEN ACTOR IS ATTACKING
  400.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  401.   }; ACTOR_ATTACKING = { # <= Do Not Touch This Line
  402.  
  403.     # What Actor One Will Say when Normal Attacking
  404.     1 => [
  405.            "Attack01", 80, 100, 0,
  406.            "Attack02", 80, 100, 0,
  407.            "Attack03", 80, 100, 0,
  408.            "Attack04", 80, 100, 0,
  409.            "Attack05", 80, 100, 0,
  410.            "Attack06", 80, 100, 0,
  411.            "Attack07", 80, 100, 0,
  412.            "Attack08", 80, 100, 0,
  413.            "Attack09", 80, 100, 0,
  414.            "Attack10", 80, 100, 0,
  415.          ],
  416.  
  417.      
  418.     # What Actor Two Will Say when Normal Attacking
  419.     2 => [
  420.            "Attack01", 80, 100, 0,
  421.            "Attack02", 80, 100, 0,
  422.            "Attack03", 80, 100, 0,
  423.          ],
  424.          
  425.          
  426.     12 =>[
  427.            "attack", 80, 100, 0,
  428.          ],
  429.          
  430.  
  431.  
  432.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  433.   # * WHEN ACTOR MISSED THE ENEMY
  434.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  435.   }; MISSED_ENEMY = { # <= Do Not Touch This Line
  436.  
  437.     # What Actor One Will Say when they missed the enemy
  438.     1 => [
  439.            #"Missed Enemy01", 80, 100, 0,
  440.          ],
  441.  
  442.  
  443.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  444.   # * WHEN ACTOR EVADED ENEMY ATTACK
  445.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  446.   }; DODGED_ENEMY = { # <= Do Not Touch This Line
  447.  
  448.     # What Actor One Will Say when they evaded an enemy attack
  449.     1 => [
  450.            #"Dodged Enemy Attack01", 80, 100, 0,
  451.          ],
  452.        
  453.        
  454.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  455.   # * WHEN ACTOR TAKES LITTLE DAMAGE
  456.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  457.   }; LITTLE_DAMAGE = { # <= Do Not Touch This Line
  458.  
  459.     # Percentage of Health that must be lost from an individual attack for these
  460.     # to be played
  461.     :ratio => 15 ,
  462.  
  463.    
  464.     # What Actor One Will Say when Hurt this much
  465.     1 => [
  466.            "Little Damage1", 80, 100, 10,
  467.            "Little Damage2", 80, 100, 10,
  468.            "Little Damage3", 80, 100, 10,
  469.          ],
  470.      
  471.      
  472.     # What Actor Two Will Say when Hurt this much
  473.     2 => [
  474.            "Little Damage1", 80, 100, 10,
  475.            "Little Damage2", 80, 100, 10,
  476.          ],
  477.          
  478.          
  479.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  480.   # * WHEN ACTOR TAKES SIGNIFICANT DAMAGE
  481.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  482.   }; SIGNIFICANT_DAMAGE = { # <= Do Not Touch This Line
  483.  
  484.     # Percentage of Health that must be lost from an individual attack for these
  485.     # to be played
  486.     :ratio => 35 ,
  487.  
  488.     # What Actor One Will Say when Hurt this much
  489.     1 => [
  490.            "Significant Damage1", 80, 100, 10,
  491.            "Significant Damage2", 80, 100, 10,
  492.            "Significant Damage3", 80, 100, 10,
  493.          ],  
  494.      
  495.  
  496.     # What Actor Two Will Say when Hurt this much
  497.     2 => [
  498.            "Significant Damage1", 80, 100, 10,
  499.          ],
  500.          
  501.      
  502.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  503.   # * WHEN ACTOR TAKES HEAVY DAMAGE
  504.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  505.   }; HEAVY_DAMAGE = { # <= Do Not Touch This Line
  506.  
  507.     # Percentage of Health that must be lost from an individual attack for these
  508.     # to be played
  509.     :ratio => 50 ,
  510.  
  511.     # What Actor One Will Say when Hurt this much
  512.     1 => [
  513.            "Heavy Damage1", 80, 100, 10,
  514.            "Heavy Damage2", 80, 100, 10,
  515.            "Heavy Damage3", 80, 100, 10,
  516.          ],
  517.      
  518.  
  519.     # What Actor Two Will Say when Hurt this much
  520.     2 => [
  521.            "Heavy Damage1", 80, 100, 10,
  522.            "Heavy Damage2", 80, 100, 10,
  523.          ],
  524.          
  525.          
  526.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  527.   # * WHEN ACTOR TAKES MASSIVE DAMAGE
  528.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  529.   }; MASSIVE_DAMAGE = { # <= Do Not Touch This Line
  530.  
  531.     # Percentage of Health that must be lost from an individual attack for these
  532.     # to be played
  533.     :ratio => 65 ,
  534.  
  535.  
  536.     # What Actor One Will Say when Hurt this much
  537.     1 => [
  538.            "Massive Damage1", 80, 100, 10,
  539.          ],  
  540.  
  541.  
  542.     # What Actor Two Will Say when Hurt this much
  543.     2 => [
  544.            "Massive Damage1", 80, 100, 10,
  545.          ],  
  546.  
  547.          
  548.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  549.   # * WHEN ACTOR TAKES DAMAGE, BUT NOTHING THEY CAN'T SHRUG OFF
  550.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  551.   }; DEFAULT_DAMAGE = { # <= Do Not Touch This Line
  552.  
  553.  
  554.     # What Actor One Will Say when Hurt in battle
  555.     1 => [
  556.            "Default Damage1", 80, 100, 10,
  557.          ],  
  558.  
  559.  
  560.     # What Actor Two Will Say when Hurt in battle
  561.     2 => [
  562.            "Default Damage1", 80, 100, 10,
  563.          ],
  564.  
  565.  
  566.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  567.   # * WHEN ACTOR HAS THEIR HP OR MP RESTORED, EITHER BY ITEMS OR MAGIC
  568.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  569.   }; HP_MP_RESTORE = { # <= Do Not Touch This Line
  570.    
  571.     # Allowed to speak if this actor healed themself?
  572.     :self_heal_speak  =>  true ,
  573.    
  574.  
  575.     # What Actor One Will Say when Healed in battle
  576.     1 => [
  577.            "HP_MP Restore1", 80, 100, 10,
  578.          ],
  579.  
  580.  
  581.     # What Actor Two Will Say when Healed in battle
  582.     2 => [
  583.            "HP_MP Restore1", 80, 100, 10,
  584.          ],
  585.  
  586.  
  587.          
  588.          
  589.          
  590.   #=============================================================================
  591.   #    Death & Revive Voices
  592.   #-----------------------------------------------------------------------------
  593.   #   These voices are heard when an actor is knockout in battle or when they
  594.   #   are revived in battle either via magic or items
  595.   #=============================================================================
  596.  
  597.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  598.   # * WHEN ACTOR HAS JUST BEEN KO'D IN BATTLE
  599.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  600.   # Voices to play when an actor dies
  601.   }; DEATH_VOICE = { # <= Do Not Touch This Line
  602.  
  603.  
  604.     # What Actor One Will Say when they die
  605.     1 => [
  606.            "Death Cry1", 80, 100, 10,
  607.          ],
  608.  
  609.  
  610.     # What Actor Two Will Say when they die
  611.     2 => [
  612.            "Death Cry1", 80, 100, 10,
  613.            "Death Cry2", 80, 100, 10,
  614.          ],
  615.  
  616.  
  617.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  618.   # * WHEN ACTOR HAS JUST BEEN REVIVED IN BATTLE
  619.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  620.   }; REVIVED_VOICE = { # <= Do Not Touch This Line
  621.  
  622.  
  623.     # What Actor One Will Say when Revived in battle
  624.     1 => [
  625.            "HP_MP Restore1", 80, 100, 10,
  626.          ],
  627.                                                  
  628.          
  629.          
  630.          
  631.          
  632.   #=============================================================================
  633.   #    Escape Voices
  634.   #-----------------------------------------------------------------------------
  635.   #   These voices are heard when you are attempting to escape from battle and
  636.   #   includes: Escape Attempt Voices, Escape Success Voices & Escape Failure Voices.
  637.   #   An Actor will be chosen at random to speak when an Escape Attempt is performed
  638.   #=============================================================================
  639.  
  640.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  641.   # * WHEN ATTEMPTING TO ESCAPE FROM BATTLE
  642.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  643.   }; ESCAPE_ATTEMPT_VOICE = { # <= Do Not Touch This Line
  644.  
  645.  
  646.     # What Actor One Will Say when they attempt to escape battle
  647.     1 => [
  648.            "Escape Attempt1", 80, 100, 10,
  649.            "Escape Attempt2", 80, 100, 10,
  650.            "Escape Attempt3", 80, 100, 10,
  651.          ],      
  652.      
  653.  
  654.     # What Actor Two Will Say when they attempt to escape battle
  655.     2 => [
  656.            "Escape Attempt1", 80, 100, 10,
  657.          ],
  658.  
  659.  
  660.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  661.   # * WHEN ESCAPE IS SUCCESSFUL
  662.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  663.   }; SUCCESSFUL_ESCAPE = { # <= Do Not Touch This Line
  664.  
  665.  
  666.     # What Actor One Will Say when they successfully escape from battle
  667.     1 => [
  668.            "Successful Escape1", 80, 100, 0,
  669.            "Successful Escape2", 80, 100, 0,
  670.          ],  
  671.  
  672.  
  673.     # What Actor Two Will Say when they successfully escape from battle
  674.     2 => [
  675.            "Successful Escape1", 80, 100, 0,
  676.          ],
  677.  
  678.  
  679.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  680.   # * WHEN ESCAPE WAS A FAILURE
  681.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  682.   }; FAILED_ESCAPE = { # <= Do Not Touch This Line
  683.  
  684.  
  685.     # What Actor One Will Say when they fail to escape from battle
  686.     1 => [
  687.            "Failed Escape1", 80, 100, 0,
  688.            "Failed Escape2", 80, 100, 0,
  689.          ],  
  690.  
  691.  
  692.     # What Actor Two Will Say when they fail to escape from battle
  693.     2 => [
  694.            "Failed Escape1", 80, 100, 0,
  695.          ],
  696.          
  697.          
  698.          
  699.          
  700.          
  701.   #=============================================================================
  702.   #    Battle Victory Voices
  703.   #-----------------------------------------------------------------------------
  704.   #   These voices are heard when you are victorious in battle, this includes:
  705.   #   Tough Battle Voices, Long Battle Voices, Quick Battle Voices, Level Up Voices
  706.   #=============================================================================
  707.  
  708.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  709.   # * WHEN BATTLE TOOK ITS TOLL ON YOUR PARTY
  710.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  711.   }; THAT_WAS_TOUGH = { # <= Do Not Touch This Line
  712.  
  713.     # By default this is 50%, so if you win a battle with 50% LESS HP than what
  714.     # you went in with, these voices will play
  715.     :ratio => 50 ,
  716.  
  717.  
  718.     # What Actor One Will Say when this occurs
  719.     1 => [
  720.            "That Was Tough Victory1", 80, 100, 0,
  721.            "That Was Tough Victory2", 80, 100, 0,
  722.          ],
  723.  
  724.  
  725.     # What Actor Two Will Say when this occurs
  726.     2 => [
  727.            "That Was Tough Victory1", 80, 100, 0,
  728.          ],
  729.          
  730.          
  731.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  732.   # * WHEN BATTLE DIDN'T TAKE VERY LONG
  733.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  734.   }; THAT_WAS_EASY = { # <= Do Not Touch This Line
  735.  
  736.  
  737.     # By default this is 3, so if a battle took three turns or less,
  738.     # the following voices will play
  739.     :ratio => 3 ,
  740.  
  741.  
  742.     # What Actor One Will Say when a battle didn't take too long
  743.     1 => [
  744.            "That Was Easy Victory1", 80, 100, 0,
  745.            "That Was Easy Victory2", 80, 100, 0,
  746.            "That Was Easy Victory3", 80, 100, 0,
  747.            "That Was Easy Victory4", 80, 100, 0,
  748.          ],
  749.      
  750.      
  751.     # What Actor Two Will Say when a battle didn't take too long
  752.     2 => [
  753.            "That Was Easy Victory1", 80, 100, 0,
  754.            "That Was Easy Victory2", 80, 100, 0,
  755.            "That Was Easy Victory3", 80, 100, 0,
  756.          ],
  757.          
  758.          
  759.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  760.   # * WHEN BATTLE TOOK A VERY LONG TIME
  761.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  762.   }; BATTLE_TOOK_AGES = { # <= Do Not Touch This Line
  763.  
  764.     # By default this is 15, so it means the battle needs to have
  765.     # taken 15 turns or more for the following voices to be played
  766.     :ratio => 15 ,
  767.  
  768.  
  769.     # What Actor Two Will Say when battle took a long time
  770.     2 => [
  771.            "Battle Took Ages Victory1", 80, 100, 0,
  772.          ],
  773.          
  774.      
  775.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  776.   # * WHEN VICTORY LEADS TO LEVEL UP
  777.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  778.   }; LEVELUP_VICTORY = { # <= Do Not Touch This Line
  779.  
  780.     # You MUST use the wait frame timer (last number per voice) per voice as
  781.     # appropriate. Due to RPGMaker liking to make everyone level up at the same
  782.     # time, the wait timer is the only way to stop everyone who just leveled up
  783.     # from talking at once.
  784.  
  785.  
  786.     # What Actor One Will Say when LevelUp Occurs
  787.     1 => [
  788.            "Normal Victory1", 80, 100, 120,
  789.          ],
  790.          
  791.     # What Actor Two Will Say when LevelUp Occurs
  792.     2 => [
  793.            "Normal Victory1", 80, 100, 120,
  794.          ],
  795.  
  796.          
  797.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  798.   # * NORMAL VICTORY
  799.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  800.   }; NORMAL_VICTORY = { # <= Do Not Touch This Line
  801.  
  802.   # This is what your actors will say normally if the aboves are not met
  803.  
  804.  
  805.     # What Actor One Will Say when a battle resulted in victory
  806.     1 => [
  807.            "Normal Victory1", 80, 100, 0,
  808.            "Normal Victory2", 80, 100, 0,
  809.            "Normal Victory3", 80, 100, 0,
  810.            "Normal Victory4", 80, 100, 0,
  811.            "Normal Victory5", 80, 100, 0,
  812.            "Normal Victory6", 80, 100, 0,
  813.          ],
  814.      
  815.      
  816.     # What Actor Two Will Say when a battle resulted in victory
  817.     2 => [
  818.            "Normal Victory1", 80, 100, 0,
  819.            "Normal Victory2", 80, 100, 0,
  820.            "Normal Victory3", 80, 100, 0,
  821.            "Normal Victory4", 80, 100, 0,
  822.            "Normal Victory5", 80, 100, 0,
  823.            "Normal Victory6", 80, 100, 0,
  824.          ],
  825.          
  826.          
  827.          
  828.          
  829.          
  830.          
  831. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  832. #                                                        -=
  833. };    # End Of Editable Region           ////            ==
  834. #                                                        =-
  835. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.   CURRENT_VERSION = 2.6
  843.   ENEMY_VOICES_IMPORTED = !$diamondandplatinum3_scripts[:EnemyBattleVoices].nil?
  844.   #------------------------------------------------------------------------
  845.   # * New Method: Check Version Compatibility
  846.   #------------------------------------------------------------------------
  847.   def self.check_version_compatibility( version )
  848.     return :outdated_version if version > CURRENT_VERSION
  849.     return :outdated_patch   if version < CURRENT_VERSION
  850.     return :compatible
  851.   end
  852.   #------------------------------------------------------------------------
  853.   # * New Method: Play Voice
  854.   #------------------------------------------------------------------------
  855.   def self.play_voice( voice_array, actor_id )
  856.     return true if check_if_actor_muted(actor_id)
  857.    
  858.     # If voice_array is not nil AND not empty
  859.     if voice_array && !voice_array.empty?
  860.       index = rand(voice_array.size / 4) * 4
  861.       if voice_array[index].is_a?(String) && voice_array[index + 1].is_a?(Integer) && voice_array[index + 2].is_a?(Integer)
  862.        
  863.         # Get the Actor Folder Name
  864.         if !$game_system.actor_voices_names.nil? && $game_system.actor_voices_names.size > actor_id && $game_system.actor_voices_names[actor_id].is_a?(String) && $game_system.actor_voices_names[actor_id] != ""
  865.           actor_folder_name = $game_system.actor_voices_names[actor_id]
  866.         else
  867.           actor_folder_name = $game_actors[actor_id].name
  868.         end
  869.        
  870.         # Get Path to File
  871.         pathtofile = "/" + FOLDER_DIRECTORY_NAME + "/" + actor_folder_name + "/" + voice_array[index]
  872.        
  873.         # Play Voice
  874.         RPG::SE.new(pathtofile, voice_array[index + 1], voice_array[index + 2]).play
  875.        
  876.         # Wait if necessary
  877.         SceneManager.scene.wait(voice_array[index + 3]) unless !voice_array[index + 3].is_a?(Integer) || !SceneManager.scene_is?(Scene_Battle)
  878.         return true
  879.       end
  880.     end
  881.     # We return true and false because during battle start and victory, if an actor
  882.     # doesn't have a voice clip for one condition, we'll try to find another met
  883.     # condition in which the actor DOES have a voice.
  884.     return false
  885.   end
  886.   #------------------------------------------------------------------------
  887.   # * New Method: Allowed to Play Voice?
  888.   #------------------------------------------------------------------------
  889.   def self.allowed_to_play_voice?()
  890.     return SceneManager.scene_is?(Scene_Battle)
  891.   end
  892.   #------------------------------------------------------------------------
  893.   # * New Method: Allowed to Speak?
  894.   #------------------------------------------------------------------------
  895.   def self.allowed_to_speak?()
  896.     return rand(100) < VOICE_FREQUENCY
  897.   end
  898.   #------------------------------------------------------------------------
  899.   # * New Method: Check For Mute Actor
  900.   #------------------------------------------------------------------------
  901.   def self.check_if_actor_muted(actor_id)
  902.     # Don't Play Sound if Muted
  903.     return true if $game_switches[EVENT_SWITCH_ID]
  904.     return $game_actors[actor_id].states.any? { |state| SILENCE_STATES.include?(state.id) }
  905.   end
  906.   #------------------------------------------------------------------------
  907.   # * New Method: Get Random Battle Actor ID
  908.   #------------------------------------------------------------------------
  909.   def self.get_battle_actor_id()
  910.     # Get a Battle Actor ID, who is to speak
  911.     actor_ids = []
  912.     $game_party.battle_members.each do |ally|
  913.       actor_ids.push(ally.id) if ally.alive?
  914.     end
  915.     return actor_ids[rand(actor_ids.size)]
  916.   end
  917.   #------------------------------------------------------------------------
  918.   # * New Method: Play "Party Needs Healing" Voice
  919.   #------------------------------------------------------------------------
  920.   def self.play_party_needs_healing_voice(actor_id = 0)
  921.     return true if !allowed_to_play_voice?()
  922.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  923.     return play_voice(PARTY_NEEDS_HEALING[actor_id], actor_id)
  924.   end
  925.   #------------------------------------------------------------------------
  926.   # * New Method: Play "Too Many Enemies" Voice
  927.   #------------------------------------------------------------------------
  928.   def self.play_too_many_enemies_voice(actor_id = 0)
  929.     return true if !allowed_to_play_voice?()
  930.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  931.     return play_voice(TOO_MANY_ENEMIES[actor_id], actor_id)
  932.   end
  933.   #------------------------------------------------------------------------
  934.   # * New Method: Play "Very Weak Enemies" Voice
  935.   #------------------------------------------------------------------------
  936.   def self.play_very_weak_enemies_voice(actor_id = 0)
  937.     return true if !allowed_to_play_voice?()
  938.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  939.     return play_voice(VERY_WEAK_ENEMIES[actor_id], actor_id)
  940.   end
  941.   #------------------------------------------------------------------------
  942.   # * New Method: Play "Weak Enemies" Voice
  943.   #------------------------------------------------------------------------
  944.   def self.play_weak_enemies_voice(actor_id = 0)
  945.     return true if !allowed_to_play_voice?()
  946.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  947.     return play_voice(WEAK_ENEMIES[actor_id], actor_id)
  948.   end
  949.   #------------------------------------------------------------------------
  950.   # * New Method: Play "Equal Enemies" Voice
  951.   #------------------------------------------------------------------------
  952.   def self.play_equal_enemies_voice(actor_id = 0)
  953.     return true if !allowed_to_play_voice?()
  954.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  955.     return play_voice(EQUAL_ENEMIES[actor_id], actor_id)
  956.   end
  957.   #------------------------------------------------------------------------
  958.   # * New Method: Play "Strong Enemies" Voice
  959.   #------------------------------------------------------------------------
  960.   def self.play_strong_enemies_voice(actor_id = 0)
  961.     return true if !allowed_to_play_voice?()
  962.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  963.     return play_voice(STRONG_ENEMIES[actor_id], actor_id)
  964.   end
  965.   #------------------------------------------------------------------------
  966.   # * New Method: Play "Very Strong Enemies" Voice
  967.   #------------------------------------------------------------------------
  968.   def self.play_very_strong_enemies_voice(actor_id = 0)
  969.     return true if !allowed_to_play_voice?()
  970.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  971.     return play_voice(VERY_STRONG_ENEMIES[actor_id], actor_id)
  972.   end
  973.   #------------------------------------------------------------------------
  974.   # * New Method: Play "I Missed Enemy" Voice
  975.   #------------------------------------------------------------------------
  976.   def self.play_missed_enemies_voice(actor_id)
  977.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  978.     return play_voice(MISSED_ENEMY[actor_id], actor_id)
  979.   end
  980.   #------------------------------------------------------------------------
  981.   # * New Method: Play "I Evaded Enemy" Voice
  982.   #------------------------------------------------------------------------
  983.   def self.play_evaded_enemy_voice(actor_id)
  984.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  985.     return play_voice(DODGED_ENEMY[actor_id], actor_id)
  986.   end
  987.   #------------------------------------------------------------------------
  988.   # * New Method: Play "Normal Attack" Voice
  989.   #------------------------------------------------------------------------
  990.   def self.play_normal_attack_voice(actor_id)
  991.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  992.     return play_voice(ACTOR_ATTACKING[actor_id], actor_id)
  993.   end
  994.   #------------------------------------------------------------------------
  995.   # * New Method: Play "Using Skill" Voice
  996.   #------------------------------------------------------------------------
  997.   def self.play_skill_voice(actor_id, skill_id)
  998.     return true if !allowed_to_play_voice?()
  999.     voice = []
  1000.     $data_skills[skill_id].note.scan(/~ActorVoice:\s*#{actor_id.to_s}\,*\s*\"(.+?)\"\,*\s*(\d*)\,*\s*(\d*)\,*\s*(\d*)/im).collect{ |voice_info|
  1001.       unless voice_info.empty?
  1002.         voice.push(voice_info[0])
  1003.         voice.push(voice_info[1] != "" ? voice_info[1].to_i : 80)
  1004.         voice.push(voice_info[2] != "" ? voice_info[2].to_i : 100)
  1005.         voice.push(voice_info[3] != "" ? voice_info[3].to_i : 0)
  1006.       end
  1007.     }
  1008.    
  1009.     # Modify Skill Voice to Generic Skill Voice if there is no specific voice for this Skill
  1010.     if voice.empty?
  1011.       return true if SKILLS_NOT_TO_PLAY_VOICE_FOR.include?(skill_id) || !allowed_to_speak?()
  1012.       voice = USING_SKILLS[actor_id]
  1013.     end
  1014.    
  1015.     return play_voice( voice, actor_id )
  1016.   end
  1017.   #------------------------------------------------------------------------
  1018.   # * New Method: Play "Using Item" Voice
  1019.   #------------------------------------------------------------------------
  1020.   def self.play_item_voice(actor_id, item_id)
  1021.     return true if !allowed_to_play_voice?()
  1022.     voice = []
  1023.     $data_items[item_id].note.scan(/~ActorVoice:\s*#{actor_id.to_s}\,*\s*\"(.+?)\"\,*\s*(\d*)\,*\s*(\d*)\,*\s*(\d*)/im).collect{ |voice_info|
  1024.       unless voice_info.empty?
  1025.         voice.push(voice_info[0])
  1026.         voice.push(voice_info[1] != "" ? voice_info[1].to_i : 80)
  1027.         voice.push(voice_info[2] != "" ? voice_info[2].to_i : 100)
  1028.         voice.push(voice_info[3] != "" ? voice_info[3].to_i : 0)
  1029.       end
  1030.     }
  1031.    
  1032.     # Modify Item Voice to Generic Item Voice if there is no specific voice for this item
  1033.     if voice.empty?
  1034.       return true if !allowed_to_speak?()
  1035.       voice = USING_ITEMS[actor_id]
  1036.     end
  1037.    
  1038.     return play_voice( voice, actor_id )
  1039.   end
  1040.   #------------------------------------------------------------------------
  1041.   # * New Method: Play "Using Skill/Item" Voice
  1042.   #------------------------------------------------------------------------
  1043.   def self.play_skill_or_item_voice(actor_id, item)
  1044.     #~~~~~ Using A Skill ~~~~~#
  1045.     if item.is_a?(RPG::Skill)
  1046.       if item.id == 1 # Attack
  1047.         play_normal_attack_voice(actor_id)
  1048.       else # Another skill besides Attack
  1049.         play_skill_voice(actor_id, item.id)
  1050.       end
  1051.  
  1052.     #~~~~~ Using An Item ~~~~~#
  1053.     else
  1054.       play_item_voice(actor_id, item.id)
  1055.     end
  1056.   end
  1057.   #------------------------------------------------------------------------
  1058.   # * New Method: Play "Death" Voice
  1059.   #------------------------------------------------------------------------
  1060.   def self.play_death_voice(actor_id)
  1061.     return true if !allowed_to_play_voice?()
  1062.     return play_voice(DEATH_VOICE[actor_id], actor_id)
  1063.   end
  1064.   #------------------------------------------------------------------------
  1065.   # * New Method: Play "I Leveled Up" Voice
  1066.   #------------------------------------------------------------------------
  1067.   def self.play_leveledup_voice(actor_id)
  1068.     return true if !allowed_to_play_voice?()
  1069.     return false unless LEVELUP_VICTORY[actor_id] # Array is not nil
  1070.     # Wait For Actor To Finish Talking
  1071.     index = rand(LEVELUP_VICTORY[actor_id].size / 4) * 4
  1072.     voice = [LEVELUP_VICTORY[actor_id][index],      LEVELUP_VICTORY[actor_id][index + 1],
  1073.              LEVELUP_VICTORY[actor_id][index + 2],  LEVELUP_VICTORY[actor_id][index + 3]]
  1074.     # Return False if Failed to Play Voice
  1075.     return false unless play_voice(voice, actor_id)
  1076.     # Wait for Voice to Quell if Necessary
  1077.     if voice[3].is_a?(Integer)
  1078.       voice[3].times{ |i| SceneManager.scene.update_basic() }
  1079.     end
  1080.     return true
  1081.   end
  1082.   #------------------------------------------------------------------------
  1083.   # * New Method: Play "Restored HP/MP" Voice
  1084.   #------------------------------------------------------------------------
  1085.   def self.play_healed_voice(actor_id)
  1086.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1087.     return play_voice(HP_MP_RESTORE[actor_id], actor_id)
  1088.   end
  1089.   #------------------------------------------------------------------------
  1090.   # * New Method: Play "Revived" Voice
  1091.   #------------------------------------------------------------------------
  1092.   def self.play_revived_voice(actor_id)
  1093.     return true if !allowed_to_play_voice?()
  1094.     return play_voice(REVIVED_VOICE[actor_id], actor_id)
  1095.   end
  1096.   #------------------------------------------------------------------------
  1097.   # * New Method: Play "Default Damage" Voice
  1098.   #------------------------------------------------------------------------
  1099.   def self.play_default_damage_voice(actor_id)
  1100.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1101.     return play_voice(DEFAULT_DAMAGE[actor_id], actor_id)
  1102.   end
  1103.   #------------------------------------------------------------------------
  1104.   # * New Method: Play "Little Damage" Voice
  1105.   #------------------------------------------------------------------------
  1106.   def self.play_little_damage_voice(actor_id)
  1107.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1108.     return play_voice(LITTLE_DAMAGE[actor_id], actor_id)
  1109.   end
  1110.   #------------------------------------------------------------------------
  1111.   # * New Method: Play "Significant Damage" Voice
  1112.   #------------------------------------------------------------------------
  1113.   def self.play_significant_damage_voice(actor_id)
  1114.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1115.     return play_voice(SIGNIFICANT_DAMAGE[actor_id], actor_id)
  1116.   end
  1117.   #------------------------------------------------------------------------
  1118.   # * New Method: Play "Heavy Damage" Voice
  1119.   #------------------------------------------------------------------------
  1120.   def self.play_heavy_damage_voice(actor_id)
  1121.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1122.     return play_voice(HEAVY_DAMAGE[actor_id], actor_id)
  1123.   end
  1124.   #------------------------------------------------------------------------
  1125.   # * New Method: Play "Massive Damage" Voice
  1126.   #------------------------------------------------------------------------
  1127.   def self.play_massive_damage_voice(actor_id)
  1128.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1129.     return play_voice(MASSIVE_DAMAGE[actor_id], actor_id)
  1130.   end
  1131.   #------------------------------------------------------------------------
  1132.   # * New Method: Play "Escape Attempt" Voice
  1133.   #------------------------------------------------------------------------
  1134.   def self.play_escape_attempt_voice(actor_id)
  1135.     return true if !allowed_to_play_voice?()
  1136.     return play_voice(ESCAPE_ATTEMPT_VOICE[actor_id], actor_id)
  1137.   end
  1138.   #------------------------------------------------------------------------
  1139.   # * New Method: Play "Escape Successful" Voice
  1140.   #------------------------------------------------------------------------
  1141.   def self.play_escape_successful_voice(actor_id, force_allow = false)
  1142.     # When You Escape, you are now on Scene_Map instead of Scene_Battle
  1143.     # So force_allow will let you play the voice if you did infact just escape from battle
  1144.     return true if !allowed_to_play_voice?() && !force_allow
  1145.     return play_voice(SUCCESSFUL_ESCAPE[actor_id], actor_id)
  1146.   end
  1147.   #------------------------------------------------------------------------
  1148.   # * New Method: Play "Escape Failed" Voice
  1149.   #------------------------------------------------------------------------
  1150.   def self.play_escape_failed_voice(actor_id)
  1151.     return true if !allowed_to_play_voice?()
  1152.     return play_voice(FAILED_ESCAPE[actor_id], actor_id)
  1153.   end
  1154.   #------------------------------------------------------------------------
  1155.   # * New Method: Play "Default Victory" Voice
  1156.   #------------------------------------------------------------------------
  1157.   def self.play_default_victory_voice(actor_id = 0)
  1158.     return true if !allowed_to_play_voice?()
  1159.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1160.     return play_voice(NORMAL_VICTORY[actor_id], actor_id)
  1161.   end
  1162.   #------------------------------------------------------------------------
  1163.   # * New Method: Play "Battle Was Easy" Voice
  1164.   #------------------------------------------------------------------------
  1165.   def self.play_battle_was_easy_voice(actor_id = 0)
  1166.     return true if !allowed_to_play_voice?()
  1167.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1168.     return play_voice(THAT_WAS_EASY[actor_id], actor_id)
  1169.   end
  1170.   #------------------------------------------------------------------------
  1171.   # * New Method: Play "Very Long Battle" Voice
  1172.   #------------------------------------------------------------------------
  1173.   def self.play_very_long_battle_voice(actor_id = 0)
  1174.     return true if !allowed_to_play_voice?()
  1175.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1176.     return play_voice(BATTLE_TOOK_AGES[actor_id], actor_id)
  1177.   end
  1178.   #------------------------------------------------------------------------
  1179.   # * New Method: Play "Party Was Badly Injured" Voice
  1180.   #------------------------------------------------------------------------
  1181.   def self.play_party_was_badly_injured_voice(actor_id = 0)
  1182.     return true if !allowed_to_play_voice?()
  1183.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1184.     return play_voice(THAT_WAS_TOUGH[actor_id], actor_id)
  1185.   end
  1186.  
  1187. end # BattleVoices Module
  1188. end # DiamondandPlatinum3 Module
  1189.  
  1190.  
  1191.  
  1192.  
  1193. #==============================================================================
  1194. # ** Game_System
  1195. #------------------------------------------------------------------------------
  1196. #  This class handles system data. It saves the disable state of saving and
  1197. # menus. Instances of this class are referenced by $game_system.
  1198. #==============================================================================
  1199.  
  1200. class Game_System
  1201.   #--------------------------------------------------------------------------
  1202.   # * Alias Listings
  1203.   #--------------------------------------------------------------------------
  1204.   alias dp3_gamesys_init_1s098yu9j                                 initialize
  1205.   #--------------------------------------------------------------------------
  1206.   # * Public Instance Variables
  1207.   #--------------------------------------------------------------------------
  1208.   attr_accessor :actor_voices_names
  1209.   #--------------------------------------------------------------------------
  1210.   # * Object Initialization
  1211.   #--------------------------------------------------------------------------
  1212.   def initialize(*args)
  1213.     dp3_gamesys_init_1s098yu9j(*args) # Call Original Method
  1214.     actor_voices_names = Array.new()
  1215.   end
  1216. end
  1217.  
  1218.  
  1219. #==============================================================================
  1220. # ** Game_Interpreter
  1221. #------------------------------------------------------------------------------
  1222. #  An interpreter for executing event commands. This class is used within the
  1223. # Game_Map, Game_Troop, and Game_Event classes.
  1224. #==============================================================================
  1225.  
  1226. class Game_Interpreter
  1227.   #--------------------------------------------------------------------------
  1228.   # * Set Actor Voice Name
  1229.   #--------------------------------------------------------------------------
  1230.   def set_actor_voice_name(id, name)
  1231.     unless id.is_a?(Integer); msgbox_p("You did not insert a Valid ID for the Actor"); return; end
  1232.     unless name.is_a?(String); msgbox_p("You did not insert a Valid Name for the Actor"); return; end
  1233.    
  1234.     $game_system.actor_voices_names = Array.new() if $game_system.actor_voices_names.nil?
  1235.     $game_system.actor_voices_names[id] = name
  1236.   end
  1237. end
  1238.  
  1239.  
  1240. #==============================================================================
  1241. # ** Scene_Battle
  1242. #------------------------------------------------------------------------------
  1243. #  This class performs battle screen processing.
  1244. #==============================================================================
  1245.  
  1246. class Scene_Battle < Scene_Base
  1247.   #--------------------------------------------------------------------------
  1248.   # * Alias Listings
  1249.   #--------------------------------------------------------------------------
  1250.   alias dp3_scenebattle_poststart_1s098yu9j               post_start
  1251.   alias dp3_scenebattle_applyitemeffects_1s098yu9j        apply_item_effects
  1252.  
  1253.   #--------------------------------------------------------------------------
  1254.   # * Aliased Method: Post-Start Processing
  1255.   #--------------------------------------------------------------------------
  1256.   def post_start(*args)
  1257.     dp3_play_battle_start_voice()    
  1258.     dp3_scenebattle_poststart_1s098yu9j()
  1259.   end
  1260.  
  1261.   #--------------------------------------------------------------------------
  1262.   # * New Method: Play Battle Start Voice
  1263.   #--------------------------------------------------------------------------
  1264.   def dp3_play_battle_start_voice
  1265.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1266.     # Party Needs Healing?
  1267.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1268.     party_total_hp = party_current_hp = 0
  1269.     $game_party.battle_members.each {|ally| party_total_hp += ally.mhp }
  1270.     party_current_hp = party_total_hp
  1271.     $game_party.battle_members.each {|ally| party_current_hp -= (ally.mhp - ally.hp) }
  1272.    
  1273.     if party_current_hp < party_total_hp * (DiamondandPlatinum3::BattleVoices::PARTY_NEEDS_HEALING[:ratio] * 0.01)
  1274.       return if DiamondandPlatinum3::BattleVoices::play_party_needs_healing_voice()
  1275.     end
  1276.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1277.     # Too many enemies?
  1278.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1279.     if $game_troop.members.size > $game_party.members.size + DiamondandPlatinum3::BattleVoices::TOO_MANY_ENEMIES[:ratio]
  1280.       return if DiamondandPlatinum3::BattleVoices::play_too_many_enemies_voice()
  1281.     end
  1282.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1283.     # Which side is stronger?
  1284.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1285.     strongest_enemy_stats   = [ 0, 0, 0, 0 ]
  1286.     strongest_party_stats   = [ 0, 0, 0, 0 ]
  1287.    
  1288.     $game_troop.members.each do |enemy|
  1289.       strongest_enemy_stats[0] = enemy.atk if enemy.atk > strongest_enemy_stats[0]
  1290.       strongest_enemy_stats[1] = enemy.def if enemy.def > strongest_enemy_stats[1]
  1291.       strongest_enemy_stats[2] = enemy.mat if enemy.mat > strongest_enemy_stats[2]
  1292.       strongest_enemy_stats[3] = enemy.mdf if enemy.mdf > strongest_enemy_stats[3]
  1293.     end
  1294.    
  1295.     $game_party.battle_members.each do |ally|
  1296.       strongest_party_stats[0] = ally.atk if ally.atk > strongest_party_stats[0]
  1297.       strongest_party_stats[1] = ally.def if ally.def > strongest_party_stats[1]
  1298.       strongest_party_stats[2] = ally.mat if ally.mat > strongest_party_stats[2]
  1299.       strongest_party_stats[3] = ally.mdf if ally.mdf > strongest_party_stats[3]
  1300.     end
  1301.    
  1302.    
  1303.     enemy_power = strongest_enemy_stats[0] + strongest_enemy_stats[1] + strongest_enemy_stats[2] + strongest_enemy_stats[3]
  1304.     party_power = strongest_party_stats[0] + strongest_party_stats[1] + strongest_party_stats[2] + strongest_party_stats[3]
  1305.    
  1306.    
  1307.     return DiamondandPlatinum3::BattleVoices::play_very_weak_enemies_voice()     if enemy_power < party_power * (DiamondandPlatinum3::BattleVoices::VERY_WEAK_ENEMIES[:ratio] * 0.01)
  1308.     return DiamondandPlatinum3::BattleVoices::play_weak_enemies_voice()          if enemy_power < party_power * (DiamondandPlatinum3::BattleVoices::WEAK_ENEMIES[:ratio] * 0.01)
  1309.     return DiamondandPlatinum3::BattleVoices::play_very_strong_enemies_voice()   if enemy_power > party_power * (DiamondandPlatinum3::BattleVoices::VERY_STRONG_ENEMIES[:ratio] * 0.01)
  1310.     return DiamondandPlatinum3::BattleVoices::play_strong_enemies_voice()        if enemy_power > party_power * (DiamondandPlatinum3::BattleVoices::STRONG_ENEMIES[:ratio] * 0.01)
  1311.     return DiamondandPlatinum3::BattleVoices::play_equal_enemies_voice()
  1312.   end # def dp3_play_battle_start_voice
  1313.  
  1314.  
  1315.   #--------------------------------------------------------------------------
  1316.   # * Aliased Method: Apply Skill/Item Effect
  1317.   #--------------------------------------------------------------------------
  1318.   def apply_item_effects(*args)
  1319.     # Call Original Method
  1320.     dp3_scenebattle_applyitemeffects_1s098yu9j(*args)
  1321.     args[0].dp3_set_actor_said_thank_you_already() if args[0].actor?
  1322.    
  1323.     # If Result was a Miss, and an actor was not targeting an actor
  1324.     if !args[0].result.hit?
  1325.       if !args[0].actor? && @subject.actor?
  1326.         DiamondandPlatinum3::BattleVoices::play_missed_enemies_voice(@subject.id)
  1327.       elsif args[0].actor? && !@subject.actor?
  1328.         DiamondandPlatinum3::BattleVoices::play_evaded_enemy_voice(args[0].id)
  1329.       end
  1330.     end
  1331.   end
  1332.  
  1333.   #--------------------------------------------------------------------------
  1334.   # * Overwritten Method: Show Normal Animation
  1335.   #--------------------------------------------------------------------------
  1336.   def show_normal_animation(*args)
  1337.     @dp3_speak_for_multiple_hits = true             # New Line
  1338.     animation = $data_animations[args[1]]
  1339.     if animation
  1340.       args[0].each do |target|
  1341.         dp3_on_animation_begin(target)              # New Line
  1342.         target.animation_id = args[1]
  1343.         target.animation_mirror = args[2]
  1344.         abs_wait_short unless animation.to_screen?
  1345.         dp3_on_animation_end(target)                # New Line
  1346.       end
  1347.       abs_wait_short if animation.to_screen?
  1348.     end
  1349.   end
  1350.  
  1351.   #--------------------------------------------------------------------------
  1352.   # * New Method: On Animation Begin (Multihit Included)
  1353.   #--------------------------------------------------------------------------
  1354.   def dp3_on_animation_begin(target)
  1355.     if @dp3_speak_for_multiple_hits
  1356.       if @subject.actor? && !target.actor?
  1357.         @dp3_speak_for_multiple_hits = DiamondandPlatinum3::BattleVoices::PLAY_MULTIPLE_VOICES_FOR_MULTIPLE_HITS
  1358.         DiamondandPlatinum3::BattleVoices::play_skill_or_item_voice(@subject.id, @subject.current_action.item)
  1359.       end
  1360.     end
  1361.   end
  1362.  
  1363.   #--------------------------------------------------------------------------
  1364.   # * New Method: On Animation End (Multihit Included)
  1365.   #--------------------------------------------------------------------------
  1366.   def dp3_on_animation_end(target)
  1367.   end
  1368.  
  1369. end # Class
  1370.  
  1371.  
  1372. #==============================================================================
  1373. # ** Game_Actor
  1374. #------------------------------------------------------------------------------
  1375. #  This class handles actors. It is used within the Game_Actors class
  1376. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  1377. #==============================================================================
  1378.  
  1379. class Game_Actor < Game_Battler
  1380.   #--------------------------------------------------------------------------
  1381.   # * Alias Listings
  1382.   #--------------------------------------------------------------------------
  1383.   alias dp3_gameactor_useitem_1s098yu9j                 use_item
  1384.   alias dp3_gameactor_die_1s098yu9j                     die
  1385.   alias dp3_gameactor_changeexp_1s098yu9j               change_exp
  1386.   alias dp3_gameactor_itemeffectrecoverhp_1s098yu9j     item_effect_recover_hp
  1387.   alias dp3_gameactor_itemeffectrecovermp_1s098yu9j     item_effect_recover_mp
  1388.   alias dp3_gameactor_executedamage_1s098yu9j           execute_damage
  1389.   alias dp3_gameactor_removestate_1s098yu9j             remove_state
  1390.   alias dp3_gameactor_ondamage_1s098yu9j                on_damage
  1391.  
  1392.   #--------------------------------------------------------------------------
  1393.   # * Aliased Method: Use Skill/Item
  1394.   #--------------------------------------------------------------------------
  1395.   def use_item( *args )
  1396.     DiamondandPlatinum3::BattleVoices::play_item_voice(@actor_id, args[0].id) if args[0].is_a?(RPG::Item)
  1397.    
  1398.     # Call Original Method
  1399.     dp3_gameactor_useitem_1s098yu9j( *args )
  1400.   end
  1401.  
  1402.   #--------------------------------------------------------------------------
  1403.   # * Aliased Method: Knock Out
  1404.   #--------------------------------------------------------------------------
  1405.   def die( *args )
  1406.     DiamondandPlatinum3::BattleVoices::play_death_voice(@actor_id)
  1407.    
  1408.     # Call Original Method
  1409.     dp3_gameactor_die_1s098yu9j( *args )
  1410.   end
  1411.  
  1412.   #--------------------------------------------------------------------------
  1413.   # * Aliased Method: Change Experience
  1414.   #--------------------------------------------------------------------------
  1415.   def change_exp(*args)
  1416.     last_level = @level
  1417.     dp3_gameactor_changeexp_1s098yu9j(*args) # Call Original Method
  1418.     if @level > last_level
  1419.       DiamondandPlatinum3::BattleVoices::play_leveledup_voice(@actor_id)
  1420.     end
  1421.   end  
  1422.  
  1423.   #--------------------------------------------------------------------------
  1424.   # * Aliased Method: [HP Recovery] Effect
  1425.   #--------------------------------------------------------------------------
  1426.   def item_effect_recover_hp( *args )
  1427.     if args[0] != self && !@dp3__actor_said_thank_you
  1428.       DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  1429.       @dp3__actor_said_thank_you = true
  1430.     end
  1431.    
  1432.     # Call Original Method
  1433.     dp3_gameactor_itemeffectrecoverhp_1s098yu9j( *args )
  1434.   end
  1435.  
  1436.   #--------------------------------------------------------------------------
  1437.   # * Aliased Method: [MP Recovery] Effect
  1438.   #--------------------------------------------------------------------------
  1439.   def item_effect_recover_mp( *args )
  1440.     if args[0] != self && !@dp3__actor_said_thank_you
  1441.       DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  1442.       @dp3__actor_said_thank_you = true
  1443.     end
  1444.     # Call Original Method
  1445.     dp3_gameactor_itemeffectrecovermp_1s098yu9j( *args )
  1446.   end
  1447.  
  1448.  
  1449.   #--------------------------------------------------------------------------
  1450.   # * Aliased Method: Execute Damage
  1451.   #--------------------------------------------------------------------------
  1452.   def execute_damage(*args)
  1453.     current_hp = self.hp
  1454.     current_mp = self.mp
  1455.     dp3_gameactor_executedamage_1s098yu9j(*args)
  1456.  
  1457.     # Play Healed Voice if Healed and Allowed
  1458.     if current_hp < self.hp || current_mp < self.mp
  1459.       if args[0].enemy?
  1460.         if args[0] == self
  1461.           if DiamondandPlatinum3::BattleVoices::HP_MP_RESTORE[:self_heal_speak]
  1462.             DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  1463.           end
  1464.         else
  1465.           DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  1466.         end
  1467.       end
  1468.     end
  1469.   end
  1470.  
  1471.  
  1472.   #--------------------------------------------------------------------------
  1473.   # * Aliased Method: [Remove Debuff] Effect
  1474.   #--------------------------------------------------------------------------
  1475.   def remove_state(*args)
  1476.     play_voice = state?(death_state_id) && args[0] == death_state_id
  1477.     dp3_gameactor_removestate_1s098yu9j(*args) # Call Original Method
  1478.     DiamondandPlatinum3::BattleVoices::play_revived_voice(@actor_id) if play_voice
  1479.   end
  1480.  
  1481.  
  1482.  
  1483.   #--------------------------------------------------------------------------
  1484.   # * Aliased Method: Processing When Suffering Damage
  1485.   #--------------------------------------------------------------------------
  1486.   def on_damage(*args)
  1487.     dp3_play_appropriate_actor_damage_voice( args[0] ) if args[0] > 0 && (self.hp - args[0]) > 0
  1488.    
  1489.     # Call Original Method
  1490.     dp3_gameactor_ondamage_1s098yu9j( *args )
  1491.   end
  1492.  
  1493.   #--------------------------------------------------------------------------
  1494.   # * New Method: Get Actor Damage Voice Array
  1495.   #--------------------------------------------------------------------------
  1496.   def dp3_play_appropriate_actor_damage_voice( value )
  1497.     #~~~~~ Play Massive Damage Voice ~~~~~#
  1498.     if value > self.mhp * (DiamondandPlatinum3::BattleVoices::MASSIVE_DAMAGE[:ratio] * 0.01)
  1499.       return true if DiamondandPlatinum3::BattleVoices::play_massive_damage_voice(@actor_id)
  1500.     end
  1501.     #~~~~~ Play Heavy Damage Voice ~~~~~#
  1502.     if value > self.mhp * (DiamondandPlatinum3::BattleVoices::HEAVY_DAMAGE[:ratio] * 0.01)
  1503.       return true if DiamondandPlatinum3::BattleVoices::play_heavy_damage_voice(@actor_id)
  1504.     end
  1505.     #~~~~~ Play Significant Damage Voice ~~~~~#
  1506.     if value > self.mhp * (DiamondandPlatinum3::BattleVoices::SIGNIFICANT_DAMAGE[:ratio] * 0.01)
  1507.       return true if DiamondandPlatinum3::BattleVoices::play_significant_damage_voice(@actor_id)
  1508.     end
  1509.     #~~~~~ Play Little Damage Voice ~~~~~#
  1510.     if value > self.mhp * (DiamondandPlatinum3::BattleVoices::LITTLE_DAMAGE[:ratio] * 0.01)
  1511.       return true if DiamondandPlatinum3::BattleVoices::play_little_damage_voice(@actor_id)
  1512.     end
  1513.     #~~~~~ Play Pitance Damage Voice ~~~~~#
  1514.     return DiamondandPlatinum3::BattleVoices::play_default_damage_voice(@actor_id)
  1515.   end
  1516.  
  1517.   #--------------------------------------------------------------------------
  1518.   # * New Method: Set "Thank You" Voice Availability
  1519.   #--------------------------------------------------------------------------
  1520.   def dp3_set_actor_said_thank_you_already()
  1521.     @dp3__actor_said_thank_you = false
  1522.   end
  1523. end
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533. #==============================================================================
  1534. # ** BattleManager
  1535. #------------------------------------------------------------------------------
  1536. #  This module manages battle progress.
  1537. #==============================================================================
  1538.  
  1539. module BattleManager
  1540.   class << self
  1541.     #------------------------------------------------------------------------
  1542.     # * Alias Listings
  1543.     #------------------------------------------------------------------------
  1544.     alias dp3_battlemanager_setup_1s098yu9j               setup
  1545.     alias dp3_battlemanager_processescape_1s098yu9j       process_escape
  1546.     alias dp3_battlemanager_processvictory_1s098yu9j      process_victory
  1547.     alias dp3_battlemanager_processdefeat_1s098yu9j       process_defeat
  1548.    
  1549.     #------------------------------------------------------------------------
  1550.     # * Aliased Method: Setup
  1551.     #------------------------------------------------------------------------
  1552.     def setup( *args )
  1553.       @dp3_party_start_total_hp = 0
  1554.       $game_party.battle_members.each { |ally| @dp3_party_start_total_hp += ally.hp }
  1555.    
  1556.      
  1557.       # Call Original Method
  1558.       dp3_battlemanager_setup_1s098yu9j( *args )
  1559.     end
  1560.    
  1561.     #------------------------------------------------------------------------
  1562.     # * Aliased Method: Escape Processing
  1563.     #------------------------------------------------------------------------
  1564.     def process_escape( *args )
  1565.       # Play Begin Escape Voice
  1566.       actor_to_speak = DiamondandPlatinum3::BattleVoices::get_battle_actor_id()
  1567.       DiamondandPlatinum3::BattleVoices::play_escape_attempt_voice(actor_to_speak)
  1568.      
  1569.       # Call Original Method
  1570.       escaped = dp3_battlemanager_processescape_1s098yu9j( *args )
  1571.      
  1572.       # Play Voice for either successful or unsucessful escape
  1573.       if escaped
  1574.         DiamondandPlatinum3::BattleVoices::play_escape_successful_voice(actor_to_speak, true)
  1575.       else
  1576.         DiamondandPlatinum3::BattleVoices::play_escape_failed_voice(actor_to_speak)
  1577.       end
  1578.      
  1579.       # Finish Up
  1580.       return escaped
  1581.     end
  1582.     #------------------------------------------------------------------------
  1583.     # * Aliased Method: Victory Processing
  1584.     #------------------------------------------------------------------------
  1585.     def process_victory(*args)
  1586.       dp3_play_victory_voice()
  1587.      
  1588.       # Call Original Method
  1589.       return dp3_battlemanager_processvictory_1s098yu9j(*args)
  1590.     end
  1591.    
  1592.     #--------------------------------------------------------------------------
  1593.     # * Aliased Method: Defeat Processing
  1594.     #--------------------------------------------------------------------------
  1595.     def process_defeat(*args)
  1596.       # This method is merely here in case the @can_lose instance variable is on.
  1597.       # Actors will say thank you when being revived after defeat. So to counteract
  1598.       # this we set the mute event_switch on
  1599.       es_id                   = DiamondandPlatinum3::BattleVoices::EVENT_SWITCH_ID
  1600.       es_on                   = ($game_switches[es_id] ||= false)
  1601.       $game_switches[es_id]   = true
  1602.       defeated                = dp3_battlemanager_processdefeat_1s098yu9j(*args)
  1603.       $game_switches[es_id]   = es_on
  1604.       return defeated
  1605.     end
  1606.  
  1607.     #------------------------------------------------------------------------
  1608.     # * New Method: Play Victory Voice
  1609.     #------------------------------------------------------------------------
  1610.     def dp3_play_victory_voice
  1611.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1612.       # Battle Took Ages?
  1613.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1614.       if $game_troop.turn_count >= DiamondandPlatinum3::BattleVoices::BATTLE_TOOK_AGES[:ratio]
  1615.         return if DiamondandPlatinum3::BattleVoices::play_very_long_battle_voice()
  1616.       end
  1617.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1618.       # Party Was Badly Injured?
  1619.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1620.       party_current_hp = 0
  1621.       $game_party.battle_members.each {|ally| party_current_hp += ally.hp }
  1622.       if party_current_hp < @dp3_party_start_total_hp * (DiamondandPlatinum3::BattleVoices::THAT_WAS_TOUGH[:ratio] * 0.01)
  1623.         return if DiamondandPlatinum3::BattleVoices::play_party_was_badly_injured_voice()
  1624.       end
  1625.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1626.       # Battle Was Easy?
  1627.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1628.       if $game_troop.turn_count <= DiamondandPlatinum3::BattleVoices::THAT_WAS_EASY[:ratio]
  1629.         return if DiamondandPlatinum3::BattleVoices::play_battle_was_easy_voice()
  1630.       end
  1631.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1632.       # Default Victory Speech
  1633.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1634.       DiamondandPlatinum3::BattleVoices::play_default_victory_voice()
  1635.     end # def
  1636.   end # class
  1637. end # module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement