Advertisement
FlipelyFlip

Actor Voice Battle

Sep 7th, 2024
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 69.75 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 = [ 6,7,8,38,39, ]
  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 = [ 996, 997, ]
  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.            "IsThereANest", 85, 100, 0,
  195.            "SendToHell", 85, 100, 0,
  196.          ],
  197.  
  198.  
  199.     # What Actor Two Will Say
  200.     2 => [
  201.            "SoMany", 85, 100, 0,
  202.          ],
  203.    
  204.    
  205.          
  206.     # You Add more voices for actors by doing the same as the above and modifying
  207.     # the number to match the actor id (ie. Terence by default is Actor 3).
  208.     # If you skip an actor, then no voice will be played for them.
  209.  
  210.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  211.   # * PARTY NEEDS HEALING?
  212.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  213.   }; PARTY_NEEDS_HEALING = { # <= Do Not Touch This Line
  214.  
  215.     # If party total HP is below this Ratio, an Actor will say something about it
  216.     # This Ratio is a percentage, so by default if your total party hp is below
  217.     # 40%, then an actor may mention that everyone is hurt
  218.     :ratio => 40 ,
  219.  
  220.    
  221.     # What Actor Two Will Say
  222.     1 => [
  223.            #"", 95, 100, 0,
  224.          ],
  225.          
  226.     # What Actor Two Will Say
  227.     2 => [
  228.            #"", 95, 100, 0,
  229.          ],
  230.        
  231.        
  232.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  233.   # * VERY WEAK ENEMIES?
  234.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                    
  235.   }; VERY_WEAK_ENEMIES = { # <= Do Not Touch This Line
  236.  
  237.     # Your stats are always 100%, so if the enemy troop stats are below
  238.     # the editable ratio below; that means they are considered VERY WEAK.
  239.     # By default this is 40%.
  240.     :ratio => 40 ,
  241.  
  242.    
  243.     # What Actor One Will Say
  244.     1 => [
  245.            "Alright", 80, 100, 0,
  246.            "FeelHonored", 80, 100, 0,
  247.            "GetThisOver", 80, 100, 0,
  248.            "GoingToHell1", 80, 100, 0,
  249.            "StraightToHell", 80, 100, 0,
  250.            "IGrowTired1", 80, 100, 0,
  251.            "IGrowTired2", 80, 100, 0,
  252.            "InferiorTrash", 80, 100, 0,
  253.            "MyPath", 80, 100, 0,
  254.            "OutOfMyWay1", 80, 100, 0,
  255.            "OutOfMyWay2", 80, 100, 0,
  256.            "RegretThis1", 80, 100, 0,
  257.            "RegretThis2", 80, 100, 0,
  258.            "Scared", 80, 100, 0,
  259.            "Serious1", 80, 100, 0,
  260.            "Serious2", 80, 100, 0,
  261.            "WannaDie", 80, 100, 0,
  262.            "OneUglier", 80, 100, 0,
  263.          ],    
  264.  
  265.  
  266.     # What Actor Two Will Say
  267.     2 => [
  268.            "SpareIt", 80, 100, 0,
  269.            "Annoying", 80, 100, 0,
  270.            "GoAway", 80, 100, 0,
  271.            "MessWithUs", 80, 100, 0,
  272.          ],
  273.  
  274.          
  275.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  276.   # * WEAK ENEMIES?
  277.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  278.   }; WEAK_ENEMIES = { # <= Do Not Touch This Line
  279.  
  280.     # Same as Very Weak Enemies, but should be higher
  281.     :ratio => 80 ,
  282.  
  283.    
  284.     # What Actor One Will Say
  285.     1 => [
  286.            "Alright", 80, 100, 0,
  287.            "FeelHonored", 80, 100, 0,
  288.            "GetThisOver", 80, 100, 0,
  289.            "GoingToHell1", 80, 100, 0,
  290.            "StraightToHell", 80, 100, 0,
  291.            "IGrowTired1", 80, 100, 0,
  292.            "IGrowTired2", 80, 100, 0,
  293.            "InferiorTrash", 80, 100, 0,
  294.            "MyPath", 80, 100, 0,
  295.            "OutOfMyWay1", 80, 100, 0,
  296.            "OutOfMyWay2", 80, 100, 0,
  297.            "PresentDeath", 80, 100, 0,
  298.            "RegretThis1", 80, 100, 0,
  299.            "RegretThis2", 80, 100, 0,
  300.            "Scared", 80, 100, 0,
  301.            "Serious1", 80, 100, 0,
  302.            "Serious2", 80, 100, 0,
  303.            "ShowMe1", 80, 100, 0,
  304.            "ShowMe2", 80, 100, 0,
  305.            "WannaDie", 80, 100, 0,
  306.            "OneUglier", 80, 100, 0,
  307.          ],
  308.  
  309.  
  310.     # What Actor Two Will Say
  311.     2 => [
  312.            "TakeCare", 80, 100, 0,
  313.            "Annoying", 80, 100, 0,
  314.            "GoAway", 80, 100, 0,
  315.            "GreedyMonsters", 80, 100, 0,
  316.            "CountOnMe", 80, 100, 0,
  317.            "YourBack", 80, 100, 0,
  318.            "MessWithUs", 80, 100, 0,
  319.          ],
  320.          
  321.          
  322.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  323.   # * EQUAL ENEMIES?
  324.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  325.   }; EQUAL_ENEMIES = { # <= Do Not Touch This Line
  326.  
  327.   # There is no Ratio for Equal Enemies
  328.  
  329.   # What Actor One Will Say
  330.   1 => [
  331.            "Alright", 80, 100, 0,
  332.            "FeelHonored", 80, 100, 0,
  333.            "GetThisOver", 80, 100, 0,
  334.            "GoingToHell1", 80, 100, 0,
  335.            "StraightToHell", 80, 100, 0,
  336.            "IGrowTired1", 80, 100, 0,
  337.            "IGrowTired2", 80, 100, 0,
  338.            "InferiorTrash", 75, 100, 0,
  339.            "MyPath", 80, 100, 0,
  340.            "OutOfMyWay1", 80, 100, 0,
  341.            "OutOfMyWay2", 80, 100, 0,
  342.            "PresentDeath", 80, 100, 0,
  343.            "RegretThis1", 80, 100, 0,
  344.            "RegretThis2", 80, 100, 0,
  345.            "Scared", 80, 100, 0,
  346.            "Serious1", 80, 100, 0,
  347.            "Serious2", 80, 100, 0,
  348.            "ShowMe1", 80, 100, 0,
  349.            "ShowMe2", 80, 100, 0,
  350.            "WannaDie", 80, 100, 0,
  351.            "OneUglier", 80, 100, 0,
  352.            "LetsHaveFun1", 80, 100, 0,
  353.            "LetsHaveFun2", 80, 100, 0,
  354.            "LetsHaveFun3", 80, 100, 0,
  355.            "NotInHell", 80, 100, 0,
  356.        ],
  357.    
  358.  
  359.   # What Actor Two Will Say
  360.   2 => [
  361.            "TakeCare", 80, 100, 0,
  362.            "GoAway", 80, 100, 0,
  363.            "GreedyMonsters", 80, 100, 0,
  364.            "GuardUP", 80, 100, 0,
  365.            "CountOnMe", 80, 100, 0,
  366.            "YourBack", 80, 100, 0,
  367.            "MessWithUs", 80, 100, 0,
  368.            "Focus", 80, 100, 0,
  369.        ],
  370.        
  371.        
  372.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  373.   # * STRONG ENEMIES?
  374.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  375.   }; STRONG_ENEMIES = { # <= Do Not Touch This Line
  376.  
  377.     # If your stats are 100% and the enemy is 120%, they are 20% stronger than you
  378.     :ratio => 120 ,
  379.    
  380.  
  381.     # What Actor One Will Say
  382.     1 => [
  383.            "Stronger", 80, 100, 0,
  384.            "Stronger2", 80, 100, 0,
  385.            "GetTough1", 80, 100, 0,
  386.            "GetTough2", 80, 100, 0,
  387.            "Difficult", 80, 100, 0,
  388.            "Fun", 80, 100, 0,
  389.            "LetsHaveFun1", 80, 100, 0,
  390.            "LetsHaveFun2", 80, 100, 0,
  391.            "LetsHaveFun3", 80, 100, 0,
  392.          ],  
  393.  
  394.          
  395.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  396.   # * VERY STRONG ENEMIES?
  397.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  398.   }; VERY_STRONG_ENEMIES = { # <= Do Not Touch This Line
  399.  
  400.     # Same as Strong Enemies, but should be higher
  401.     :ratio => 160 ,
  402.  
  403.  
  404.     # What Actor One Will Say
  405.     1 => [
  406.            "Stronger", 80, 100, 0,
  407.            "Stronger2", 80, 100, 0,
  408.            "GetTough1", 80, 100, 0,
  409.            "GetTough2", 80, 100, 0,
  410.            "Difficult", 80, 100, 0,
  411.          ],
  412.          
  413.  
  414.  
  415.   #=============================================================================
  416.   #    Battle Skills/Items Voices
  417.   #-----------------------------------------------------------------------------
  418.   #   These are generic things that your actors will say when using an skill/item
  419.   #   in battle. You can use note tags on specific skills/items, this is
  420.   #   just for the more generic skill/items (meaning your actor will always say something).
  421.   #=============================================================================
  422.  
  423.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  424.   # * WHEN USING AN ITEM
  425.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  426.   }; USING_ITEMS = { # <= Do Not Touch This Line
  427.  
  428.     # What Actor One Will Say when using an generic item
  429.     1 => [
  430.            "Here", 80, 100, 0,      # Waits 10 frames before applying item effects
  431.            "Here2", 80, 100, 0,      # Waits 10 frames before applying item effects
  432.            "ThisShouldHelp", 80, 100, 0,      # Waits 10 frames before applying item effects          
  433.          ],  
  434.  
  435.  
  436.     # What Actor Two Will Say when using an generic item
  437.     2 => [
  438.            "ThisShouldHelp", 80, 100, 10,
  439.          ],
  440.          
  441.          
  442.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  443.   # * WHEN USING A SKILL
  444.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  445.   }; USING_SKILLS = { # <= Do Not Touch This Line
  446.  
  447.     # What Actor One Will Say when using a generic skill
  448.     1 => [
  449.            #"Using Generic Skill01", 80, 100, 0,
  450.          ],  
  451.  
  452.  
  453.     # What Actor Two Will Say when using a generic skill
  454.     2 => [
  455.            #"Using Generic Skill01", 80, 100, 0,
  456.          ],
  457.  
  458.        
  459.        
  460.  
  461.  
  462.  
  463.   #=============================================================================
  464.   #    Battle Voices
  465.   #-----------------------------------------------------------------------------
  466.   #   These voices are heard throughout the battle, such as when attacking,
  467.   #   using a skill or taking damage, etc
  468.   #=============================================================================
  469.  
  470.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  471.   # * WHEN ACTOR IS ATTACKING
  472.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  473.   }; ACTOR_ATTACKING = { # <= Do Not Touch This Line
  474.  
  475.     # What Actor One Will Say when Normal Attacking
  476.     1 => [
  477.            "Attack1", 80, 100, 0,
  478.            "Attack2", 80, 100, 0,
  479.            "Attack3", 80, 100, 0,
  480.            "Attack4", 80, 100, 0,
  481.          ],
  482.  
  483.      
  484.     # What Actor Two Will Say when Normal Attacking
  485.     2 => [
  486.            "Attack1", 80, 100, 0,
  487.            "Attack2", 80, 100, 0,
  488.            "Attack3", 80, 100, 0,
  489.            "Attack4", 80, 100, 0,          
  490.          ],
  491.                  
  492.  
  493.  
  494.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  495.   # * WHEN ACTOR MISSED THE ENEMY
  496.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  497.   }; MISSED_ENEMY = { # <= Do Not Touch This Line
  498.  
  499.     # What Actor One Will Say when they missed the enemy
  500.     1 => [
  501.            "Dammit", 80, 100, 0,
  502.            "Dammit2", 80, 100, 0,
  503.            "Damn", 80, 100, 0,
  504.            "Damn2", 80, 100, 0,          
  505.            #"Missed Enemy01", 80, 100, 0,
  506.          ],
  507.  
  508.  
  509.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  510.   # * WHEN ACTOR EVADED ENEMY ATTACK
  511.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  512.   }; DODGED_ENEMY = { # <= Do Not Touch This Line
  513.  
  514.     # What Actor One Will Say when they evaded an enemy attack
  515.     1 => [
  516.            #"Dodged Enemy Attack01", 80, 100, 0,
  517.          ],
  518.        
  519.        
  520.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  521.   # * WHEN ACTOR TAKES LITTLE DAMAGE
  522.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  523.   }; LITTLE_DAMAGE = { # <= Do Not Touch This Line
  524.  
  525.     # Percentage of Health that must be lost from an individual attack for these
  526.     # to be played
  527.     :ratio => 15 ,
  528.  
  529.    
  530.     # What Actor One Will Say when Hurt this much
  531.     1 => [
  532.            "HIT", 80, 100, 10,
  533.          ],
  534.      
  535.      
  536.     # What Actor Two Will Say when Hurt this much
  537.     2 => [
  538.            "HIT1", 80, 100, 10,
  539.          ],
  540.          
  541.          
  542.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  543.   # * WHEN ACTOR TAKES SIGNIFICANT DAMAGE
  544.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  545.   }; SIGNIFICANT_DAMAGE = { # <= Do Not Touch This Line
  546.  
  547.     # Percentage of Health that must be lost from an individual attack for these
  548.     # to be played
  549.     :ratio => 35 ,
  550.  
  551.     # What Actor One Will Say when Hurt this much
  552.     1 => [
  553.            "HIT2", 80, 100, 10,
  554.            
  555.            "HIT3", 80, 100, 10,
  556.          ],  
  557.      
  558.  
  559.     # What Actor Two Will Say when Hurt this much
  560.     2 => [
  561.            "HIT2", 80, 100, 10,
  562.          ],
  563.          
  564.      
  565.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  566.   # * WHEN ACTOR TAKES HEAVY DAMAGE
  567.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  568.   }; HEAVY_DAMAGE = { # <= Do Not Touch This Line
  569.  
  570.     # Percentage of Health that must be lost from an individual attack for these
  571.     # to be played
  572.     :ratio => 50 ,
  573.  
  574.     # What Actor One Will Say when Hurt this much
  575.     1 => [
  576.            "HIT4", 80, 100, 10,
  577.            "HIT5", 80, 100, 10,
  578.          ],
  579.      
  580.  
  581.     # What Actor Two Will Say when Hurt this much
  582.     2 => [
  583.            "HIT3", 80, 100, 10,
  584.          ],
  585.          
  586.          
  587.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  588.   # * WHEN ACTOR TAKES MASSIVE DAMAGE
  589.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  590.   }; MASSIVE_DAMAGE = { # <= Do Not Touch This Line
  591.  
  592.     # Percentage of Health that must be lost from an individual attack for these
  593.     # to be played
  594.     :ratio => 65 ,
  595.  
  596.  
  597.     # What Actor One Will Say when Hurt this much
  598.     1 => [
  599.            "HIT6", 80, 100, 10,
  600.          ],  
  601.  
  602.  
  603.     # What Actor Two Will Say when Hurt this much
  604.     2 => [
  605.            "HIT3", 80, 100, 10,
  606.          ],  
  607.  
  608.          
  609.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  610.   # * WHEN ACTOR TAKES DAMAGE, BUT NOTHING THEY CAN'T SHRUG OFF
  611.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  612.   }; DEFAULT_DAMAGE = { # <= Do Not Touch This Line
  613.  
  614.  
  615.     # What Actor One Will Say when Hurt in battle
  616.     1 => [
  617.            "HIT", 80, 100, 10,
  618.          ],  
  619.  
  620.  
  621.     # What Actor Two Will Say when Hurt in battle
  622.     2 => [
  623.            "HIT1", 80, 100, 10,
  624.          ],
  625.  
  626.  
  627.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  628.   # * WHEN ACTOR HAS THEIR HP OR MP RESTORED, EITHER BY ITEMS OR MAGIC
  629.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  630.   }; HP_MP_RESTORE = { # <= Do Not Touch This Line
  631.    
  632.     # Allowed to speak if this actor healed themself?
  633.     :self_heal_speak  =>  true ,
  634.    
  635.  
  636.     # What Actor One Will Say when Healed in battle
  637.     1 => [
  638.            "JustWhatINeeded", 80, 100, 10,
  639.            "JustWhatINeeded2", 80, 100, 10,
  640.            "ThatsBetter", 80, 100, 10,
  641.            "ThatsBetter2", 80, 100, 10,
  642.          ],
  643.  
  644.  
  645.     # What Actor Two Will Say when Healed in battle
  646.     2 => [
  647.            "YokoThatsBetter", 65, 100, 40,
  648.          ],
  649.  
  650.  
  651.          
  652.          
  653.          
  654.   #=============================================================================
  655.   #    Death & Revive Voices
  656.   #-----------------------------------------------------------------------------
  657.   #   These voices are heard when an actor is knockout in battle or when they
  658.   #   are revived in battle either via magic or items
  659.   #=============================================================================
  660.  
  661.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  662.   # * WHEN ACTOR HAS JUST BEEN KO'D IN BATTLE
  663.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  664.   # Voices to play when an actor dies
  665.   }; DEATH_VOICE = { # <= Do Not Touch This Line
  666.  
  667.  
  668.     # What Actor One Will Say when they die
  669.     1 => [
  670.            "Dying", 80, 100, 10,
  671.          ],
  672.  
  673.  
  674.     # What Actor Two Will Say when they die
  675.     2 => [
  676.            "Dying", 80, 100, 10,
  677.          ],
  678.  
  679.  
  680.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  681.   # * WHEN ACTOR HAS JUST BEEN REVIVED IN BATTLE
  682.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  683.   }; REVIVED_VOICE = { # <= Do Not Touch This Line
  684.  
  685.  
  686.     # What Actor One Will Say when Revived in battle
  687.     1 => [
  688.            "PayForThat", 80, 100, 20,
  689.            "PayForThat2", 80, 100, 20,
  690.            "PayBack", 80, 100, 20,
  691.            "PayBack2", 80, 100, 20,
  692.            "SufferForThat", 80, 100, 20,
  693.            "SufferForThat2", 80, 100, 20,
  694.            "IsThatYourBest", 80, 100, 10,
  695.          ],
  696.                                                  
  697.     2 => [
  698.            "Focus", 80, 100, 0,
  699.            "GuardUP", 80, 100, 0,
  700.            "CountOnMe", 80, 100, 0,
  701.            "Close", 80, 100, 0,
  702.          ],
  703.  
  704.          
  705.          
  706.          
  707.   #=============================================================================
  708.   #    Escape Voices
  709.   #-----------------------------------------------------------------------------
  710.   #   These voices are heard when you are attempting to escape from battle and
  711.   #   includes: Escape Attempt Voices, Escape Success Voices & Escape Failure Voices.
  712.   #   An Actor will be chosen at random to speak when an Escape Attempt is performed
  713.   #=============================================================================
  714.  
  715.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  716.   # * WHEN ATTEMPTING TO ESCAPE FROM BATTLE
  717.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  718.   }; ESCAPE_ATTEMPT_VOICE = { # <= Do Not Touch This Line
  719.  
  720.  
  721.     # What Actor One Will Say when they attempt to escape battle
  722.     1 => [
  723.            "AintDyingForThis", 80, 100, 0,
  724.            "AintDyingForThis2", 80, 100, 0,
  725.            "NotWorthMyTime", 80, 100, 0,
  726.            "ScrewThat", 80, 100, 10,
  727.            "SeeYouLater", 80, 100, 0,
  728.            "TimeToGo", 80, 100, 0,
  729.            "TimeToGo2", 80, 100, 0,
  730.            "TimeToGo3", 80, 100, 0,
  731.          ],      
  732.      
  733.  
  734.     # What Actor Two Will Say when they attempt to escape battle
  735.     2 => [
  736.            "LeaveUsAlone", 90, 100, 0,
  737.          ],
  738.  
  739.  
  740.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  741.   # * WHEN ESCAPE IS SUCCESSFUL
  742.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  743.   }; SUCCESSFUL_ESCAPE = { # <= Do Not Touch This Line
  744.  
  745.  
  746.     # What Actor One Will Say when they successfully escape from battle
  747.     1 => [
  748. #           "AintDyingForThis", 80, 100, 0,
  749.          ],  
  750.  
  751.  
  752.     # What Actor Two Will Say when they successfully escape from battle
  753.     2 => [
  754. #           "Close", 80, 100, 0,
  755.          ],
  756.  
  757.  
  758.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  759.   # * WHEN ESCAPE WAS A FAILURE
  760.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  761.   }; FAILED_ESCAPE = { # <= Do Not Touch This Line
  762.  
  763.  
  764.     # What Actor One Will Say when they fail to escape from battle
  765.     1 => [
  766.            "Dammit", 80, 100, 0,
  767.            "Dammit2", 80, 100, 0,
  768.            "Damn", 80, 100, 0,
  769.            "Damn2", 80, 100, 0,          
  770.          ],  
  771.  
  772.  
  773.     # What Actor Two Will Say when they fail to escape from battle
  774.     2 => [
  775.            "OhCommon", 90, 100, 0,
  776.          ],
  777.          
  778.          
  779.          
  780.          
  781.          
  782.   #=============================================================================
  783.   #    Battle Victory Voices
  784.   #-----------------------------------------------------------------------------
  785.   #   These voices are heard when you are victorious in battle, this includes:
  786.   #   Tough Battle Voices, Long Battle Voices, Quick Battle Voices, Level Up Voices
  787.   #=============================================================================
  788.  
  789.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  790.   # * WHEN BATTLE TOOK ITS TOLL ON YOUR PARTY
  791.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  792.   }; THAT_WAS_TOUGH = { # <= Do Not Touch This Line
  793.  
  794.     # By default this is 50%, so if you win a battle with 50% LESS HP than what
  795.     # you went in with, these voices will play
  796.     :ratio => 50 ,
  797.  
  798.  
  799.     # What Actor One Will Say when this occurs
  800.     1 => [
  801.            "ThatWasClose1", 80, 100, 100,
  802.            "ThatWasClose2", 80, 100, 100,
  803.            "Underestimated", 80, 100, 100,
  804.          ],
  805.  
  806.  
  807.     # What Actor Two Will Say when this occurs
  808.     2 => [
  809.            "Close", 80, 100, 0,
  810.          ],
  811.          
  812.          
  813.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  814.   # * WHEN BATTLE DIDN'T TAKE VERY LONG
  815.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  816.   }; THAT_WAS_EASY = { # <= Do Not Touch This Line
  817.  
  818.  
  819.     # By default this is 3, so if a battle took three turns or less,
  820.     # the following voices will play
  821.     :ratio => 3 ,
  822.  
  823.  
  824.     # What Actor One Will Say when a battle didn't take too long
  825.     1 => [
  826.            "Boring1", 80, 100, 100,
  827.            "ExpectedNothing", 80, 100, 100,
  828.            "Boring2", 80, 100, 100,
  829.            "SeeYouInHell", 80, 100, 100,
  830.            "Worthless", 80, 100, 100,
  831.            "Boring3", 80, 100, 100,
  832.            "WasteOfTime1", 75, 100, 100,
  833.            "Boring4", 80, 100, 100,
  834.            "WasteOfTime2", 75, 100, 100,
  835.            "Boring5", 80, 100, 100,
  836.            "AnyDoubt", 80, 100, 100,
  837.            "BackToBusiness", 75, 100, 100,          
  838.          ],
  839.          
  840.    2 => [
  841.            "NoChoice", 80, 100, 100,
  842.            "PieceOfCake", 80, 100, 100,
  843.            "ToldYouSo", 80, 100, 100,
  844.            "ToldYouSo2", 80, 100, 100,
  845.            "DidThatHurt", 80, 100, 100,
  846.          ],
  847.  
  848.          
  849.          
  850.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  851.   # * WHEN BATTLE TOOK A VERY LONG TIME
  852.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  853.   }; BATTLE_TOOK_AGES = { # <= Do Not Touch This Line
  854.  
  855.     # By default this is 15, so it means the battle needs to have
  856.     # taken 15 turns or more for the following voices to be played
  857.     :ratio => 20 ,
  858.  
  859.  
  860.     # What Actor Two Will Say when battle took a long time
  861.     1 => [
  862.            "LongerThanExpected1", 80, 100, 100,
  863.            "LongerThanExpected2", 80, 100, 100,
  864.            "AnyDoubt", 80, 100, 100,
  865.            "SeeYouInHell", 80, 100, 100,
  866.          ],
  867.          
  868.      
  869.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  870.   # * WHEN VICTORY LEADS TO LEVEL UP
  871.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  872.   }; LEVELUP_VICTORY = { # <= Do Not Touch This Line
  873.  
  874.     # You MUST use the wait frame timer (last number per voice) per voice as
  875.     # appropriate. Due to RPGMaker liking to make everyone level up at the same
  876.     # time, the wait timer is the only way to stop everyone who just leveled up
  877.     # from talking at once.
  878.  
  879.  
  880.     # What Actor One Will Say when LevelUp Occurs
  881.     1 => [
  882.            "BowBeforeMe", 80, 100, 100,
  883.          ],
  884.          
  885.  
  886.          
  887.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  888.   # * NORMAL VICTORY
  889.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  890.   }; NORMAL_VICTORY = { # <= Do Not Touch This Line
  891.  
  892.   # This is what your actors will say normally if the aboves are not met
  893.  
  894.  
  895.     # What Actor One Will Say when a battle resulted in victory
  896.     1 => [
  897.            "BowBeforeMe", 80, 100, 100,
  898.            "TicketToAfterlife1", 80, 100, 100,
  899.            "TicketToAfterlife2", 80, 100, 100,
  900.            "ExpectedNothing", 80, 100, 100,
  901.            "SeeYouInHell", 80, 100, 100,
  902.            "Worthless", 80, 100, 100,
  903.            "WasteOfTime1", 80, 100, 100,
  904.            "WasteOfTime2", 80, 100, 100,
  905.            "Boring1", 80, 100, 100,
  906.            "AnyDoubt", 80, 100, 100,
  907.            "BackToBusiness", 80, 100, 100,
  908.          ],
  909.      
  910.      
  911.     # What Actor Two Will Say when a battle resulted in victory
  912.     2 => [
  913.            "NoChoice", 80, 100, 100,
  914.            "PieceOfCake", 80, 100, 100,
  915.            "ToldYouSo", 80, 100, 100,
  916.            "ToldYouSo2", 80, 100, 100,
  917.            "DidThatHurt", 80, 100, 100,
  918.          ],
  919.          
  920.          
  921.          
  922. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  923. #                                                        -=
  924. };    # End Of Editable Region           ////            ==
  925. #                                                        =-
  926. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.   CURRENT_VERSION = 2.6
  934.   ENEMY_VOICES_IMPORTED = !$diamondandplatinum3_scripts[:EnemyBattleVoices].nil?
  935.   #------------------------------------------------------------------------
  936.   # * New Method: Check Version Compatibility
  937.   #------------------------------------------------------------------------
  938.   def self.check_version_compatibility( version )
  939.     return :outdated_version if version > CURRENT_VERSION
  940.     return :outdated_patch   if version < CURRENT_VERSION
  941.     return :compatible
  942.   end
  943.   #------------------------------------------------------------------------
  944.   # * New Method: Play Voice
  945.   #------------------------------------------------------------------------
  946.   def self.play_voice( voice_array, actor_id )
  947.     return true if check_if_actor_muted(actor_id)
  948.    
  949.     # If voice_array is not nil AND not empty
  950.     if voice_array && !voice_array.empty?
  951.       index = rand(voice_array.size / 4) * 4
  952.       if voice_array[index].is_a?(String) && voice_array[index + 1].is_a?(Integer) && voice_array[index + 2].is_a?(Integer)
  953.        
  954.         # Get the Actor Folder Name
  955.         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] != ""
  956.           actor_folder_name = $game_system.actor_voices_names[actor_id]
  957.         else
  958.           actor_folder_name = $game_actors[actor_id].name
  959.         end
  960.        
  961.         # Get Path to File
  962.         pathtofile = "/" + FOLDER_DIRECTORY_NAME + "/" + actor_folder_name + "/" + voice_array[index]
  963.        
  964.         # Play Voice
  965.         RPG::SE.new(pathtofile, voice_array[index + 1], voice_array[index + 2]).play
  966.        
  967.         # Wait if necessary
  968. #        SceneManager.scene.wait(voice_array[index + 3]) unless !voice_array[index + 3].is_a?(Integer) || !SceneManager.scene_is?(Scene_Battle)
  969.         return true
  970.       end
  971.     end
  972.     # We return true and false because during battle start and victory, if an actor
  973.     # doesn't have a voice clip for one condition, we'll try to find another met
  974.     # condition in which the actor DOES have a voice.
  975.     return false
  976.   end
  977.   #------------------------------------------------------------------------
  978.   # * New Method: Allowed to Play Voice?
  979.   #------------------------------------------------------------------------
  980.   def self.allowed_to_play_voice?()
  981.     return SceneManager.scene_is?(Scene_Battle)
  982.   end
  983.   #------------------------------------------------------------------------
  984.   # * New Method: Allowed to Speak?
  985.   #------------------------------------------------------------------------
  986.   def self.allowed_to_speak?()
  987.     return rand(100) < VOICE_FREQUENCY
  988.   end
  989.   #------------------------------------------------------------------------
  990.   # * New Method: Check For Mute Actor
  991.   #------------------------------------------------------------------------
  992.   def self.check_if_actor_muted(actor_id)
  993.     # Don't Play Sound if Muted
  994.     return true if $game_switches[EVENT_SWITCH_ID]
  995.     return $game_actors[actor_id].states.any? { |state| SILENCE_STATES.include?(state.id) }
  996.   end
  997.   #------------------------------------------------------------------------
  998.   # * New Method: Get Random Battle Actor ID
  999.   #------------------------------------------------------------------------
  1000.   def self.get_battle_actor_id()
  1001.     # Get a Battle Actor ID, who is to speak
  1002.     actor_ids = []
  1003.     $game_party.battle_members.each do |ally|
  1004.       actor_ids.push(ally.id) if ally.alive?
  1005.     end
  1006.     return actor_ids[rand(actor_ids.size)]
  1007.   end
  1008.   #------------------------------------------------------------------------
  1009.   # * New Method: Play "Party Needs Healing" Voice
  1010.   #------------------------------------------------------------------------
  1011.   def self.play_party_needs_healing_voice(actor_id = 0)
  1012.     return true if !allowed_to_play_voice?()
  1013.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1014.     return play_voice(PARTY_NEEDS_HEALING[actor_id], actor_id)
  1015.   end
  1016.   #------------------------------------------------------------------------
  1017.   # * New Method: Play "Too Many Enemies" Voice
  1018.   #------------------------------------------------------------------------
  1019.   def self.play_too_many_enemies_voice(actor_id = 0)
  1020.     return true if !allowed_to_play_voice?()
  1021.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1022.     return play_voice(TOO_MANY_ENEMIES[actor_id], actor_id)
  1023.   end
  1024.   #------------------------------------------------------------------------
  1025.   # * New Method: Play "Very Weak Enemies" Voice
  1026.   #------------------------------------------------------------------------
  1027.   def self.play_very_weak_enemies_voice(actor_id = 0)
  1028.     return true if !allowed_to_play_voice?()
  1029.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1030.     return play_voice(VERY_WEAK_ENEMIES[actor_id], actor_id)
  1031.   end
  1032.   #------------------------------------------------------------------------
  1033.   # * New Method: Play "Weak Enemies" Voice
  1034.   #------------------------------------------------------------------------
  1035.   def self.play_weak_enemies_voice(actor_id = 0)
  1036.     return true if !allowed_to_play_voice?()
  1037.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1038.     return play_voice(WEAK_ENEMIES[actor_id], actor_id)
  1039.   end
  1040.   #------------------------------------------------------------------------
  1041.   # * New Method: Play "Equal Enemies" Voice
  1042.   #------------------------------------------------------------------------
  1043.   def self.play_equal_enemies_voice(actor_id = 0)
  1044.     return true if !allowed_to_play_voice?()
  1045.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1046.     return play_voice(EQUAL_ENEMIES[actor_id], actor_id)
  1047.   end
  1048.   #------------------------------------------------------------------------
  1049.   # * New Method: Play "Strong Enemies" Voice
  1050.   #------------------------------------------------------------------------
  1051.   def self.play_strong_enemies_voice(actor_id = 0)
  1052.     return true if !allowed_to_play_voice?()
  1053.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1054.     return play_voice(STRONG_ENEMIES[actor_id], actor_id)
  1055.   end
  1056.   #------------------------------------------------------------------------
  1057.   # * New Method: Play "Very Strong Enemies" Voice
  1058.   #------------------------------------------------------------------------
  1059.   def self.play_very_strong_enemies_voice(actor_id = 0)
  1060.     return true if !allowed_to_play_voice?()
  1061.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1062.     return play_voice(VERY_STRONG_ENEMIES[actor_id], actor_id)
  1063.   end
  1064.   #------------------------------------------------------------------------
  1065.   # * New Method: Play "I Missed Enemy" Voice
  1066.   #------------------------------------------------------------------------
  1067.   def self.play_missed_enemies_voice(actor_id)
  1068.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1069.     return play_voice(MISSED_ENEMY[actor_id], actor_id)
  1070.   end
  1071.   #------------------------------------------------------------------------
  1072.   # * New Method: Play "I Evaded Enemy" Voice
  1073.   #------------------------------------------------------------------------
  1074.   def self.play_evaded_enemy_voice(actor_id)
  1075.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1076.     return play_voice(DODGED_ENEMY[actor_id], actor_id)
  1077.   end
  1078.   #------------------------------------------------------------------------
  1079.   # * New Method: Play "Normal Attack" Voice
  1080.   #------------------------------------------------------------------------
  1081.   def self.play_normal_attack_voice(actor_id)
  1082.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1083.     return play_voice(ACTOR_ATTACKING[actor_id], actor_id)
  1084.   end
  1085.   #------------------------------------------------------------------------
  1086.   # * New Method: Play "Using Skill" Voice
  1087.   #------------------------------------------------------------------------
  1088.   def self.play_skill_voice(actor_id, skill_id)
  1089.     return true if !allowed_to_play_voice?()
  1090.     voice = []
  1091.     $data_skills[skill_id].note.scan(/~ActorVoice:\s*#{actor_id.to_s}\,*\s*\"(.+?)\"\,*\s*(\d*)\,*\s*(\d*)\,*\s*(\d*)/im).collect{ |voice_info|
  1092.       unless voice_info.empty?
  1093.         voice.push(voice_info[0])
  1094.         voice.push(voice_info[1] != "" ? voice_info[1].to_i : 80)
  1095.         voice.push(voice_info[2] != "" ? voice_info[2].to_i : 100)
  1096.         voice.push(voice_info[3] != "" ? voice_info[3].to_i : 0)
  1097.       end
  1098.     }
  1099.    
  1100.     # Modify Skill Voice to Generic Skill Voice if there is no specific voice for this Skill
  1101.     if voice.empty?
  1102.       return true if SKILLS_NOT_TO_PLAY_VOICE_FOR.include?(skill_id) || !allowed_to_speak?()
  1103.       voice = USING_SKILLS[actor_id]
  1104.     end
  1105.    
  1106.     return play_voice( voice, actor_id )
  1107.   end
  1108.   #------------------------------------------------------------------------
  1109.   # * New Method: Play "Using Item" Voice
  1110.   #------------------------------------------------------------------------
  1111.   def self.play_item_voice(actor_id, item_id)
  1112.     return true if !allowed_to_play_voice?()
  1113.     voice = []
  1114.     $data_items[item_id].note.scan(/~ActorVoice:\s*#{actor_id.to_s}\,*\s*\"(.+?)\"\,*\s*(\d*)\,*\s*(\d*)\,*\s*(\d*)/im).collect{ |voice_info|
  1115.       unless voice_info.empty?
  1116.         voice.push(voice_info[0])
  1117.         voice.push(voice_info[1] != "" ? voice_info[1].to_i : 80)
  1118.         voice.push(voice_info[2] != "" ? voice_info[2].to_i : 100)
  1119.         voice.push(voice_info[3] != "" ? voice_info[3].to_i : 0)
  1120.       end
  1121.     }
  1122.    
  1123.     # Modify Item Voice to Generic Item Voice if there is no specific voice for this item
  1124.     if voice.empty?
  1125.       return true if !allowed_to_speak?()
  1126.       voice = USING_ITEMS[actor_id]
  1127.     end
  1128.    
  1129.     return play_voice( voice, actor_id )
  1130.   end
  1131.   #------------------------------------------------------------------------
  1132.   # * New Method: Play "Using Skill/Item" Voice
  1133.   #------------------------------------------------------------------------
  1134.   def self.play_skill_or_item_voice(actor_id, item)
  1135.     #~~~~~ Using A Skill ~~~~~#
  1136.     if item.is_a?(RPG::Skill)
  1137.       if item.id == $game_actors[actor_id].attack_skill_id
  1138.         play_normal_attack_voice(actor_id)
  1139.       else # Another skill besides Attack
  1140.         play_skill_voice(actor_id, item.id)
  1141.       end
  1142.  
  1143.     #~~~~~ Using An Item ~~~~~#
  1144.     else
  1145.       play_item_voice(actor_id, item.id)
  1146.     end
  1147.   end
  1148.   #------------------------------------------------------------------------
  1149.   # * New Method: Play "Death" Voice
  1150.   #------------------------------------------------------------------------
  1151.   def self.play_death_voice(actor_id)
  1152.     return true if !allowed_to_play_voice?()
  1153.     return play_voice(DEATH_VOICE[actor_id], actor_id)
  1154.   end
  1155.   #------------------------------------------------------------------------
  1156.   # * New Method: Play "I Leveled Up" Voice
  1157.   #------------------------------------------------------------------------
  1158.   def self.play_leveledup_voice(actor_id)
  1159.     return true if !allowed_to_play_voice?()
  1160.     return false unless LEVELUP_VICTORY[actor_id] # Array is not nil
  1161.     # Wait For Actor To Finish Talking
  1162.     index = rand(LEVELUP_VICTORY[actor_id].size / 4) * 4
  1163.     voice = [LEVELUP_VICTORY[actor_id][index],      LEVELUP_VICTORY[actor_id][index + 1],
  1164.              LEVELUP_VICTORY[actor_id][index + 2],  LEVELUP_VICTORY[actor_id][index + 3]]
  1165.     # Return False if Failed to Play Voice
  1166.     return false unless play_voice(voice, actor_id)
  1167.     # Wait for Voice to Quell if Necessary
  1168.     if voice[3].is_a?(Integer)
  1169.       voice[3].times{ |i| SceneManager.scene.update_basic() }
  1170.     end
  1171.     return true
  1172.   end
  1173.   #------------------------------------------------------------------------
  1174.   # * New Method: Play "Restored HP/MP" Voice
  1175.   #------------------------------------------------------------------------
  1176.   def self.play_healed_voice(actor_id)
  1177.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1178.     return play_voice(HP_MP_RESTORE[actor_id], actor_id)
  1179.   end
  1180.   #------------------------------------------------------------------------
  1181.   # * New Method: Play "Revived" Voice
  1182.   #------------------------------------------------------------------------
  1183.   def self.play_revived_voice(actor_id)
  1184.     return true if !allowed_to_play_voice?()
  1185.     return play_voice(REVIVED_VOICE[actor_id], actor_id)
  1186.   end
  1187.   #------------------------------------------------------------------------
  1188.   # * New Method: Play "Default Damage" Voice
  1189.   #------------------------------------------------------------------------
  1190.   def self.play_default_damage_voice(actor_id)
  1191.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1192.     return play_voice(DEFAULT_DAMAGE[actor_id], actor_id)
  1193.   end
  1194.   #------------------------------------------------------------------------
  1195.   # * New Method: Play "Little Damage" Voice
  1196.   #------------------------------------------------------------------------
  1197.   def self.play_little_damage_voice(actor_id)
  1198.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1199.     return play_voice(LITTLE_DAMAGE[actor_id], actor_id)
  1200.   end
  1201.   #------------------------------------------------------------------------
  1202.   # * New Method: Play "Significant Damage" Voice
  1203.   #------------------------------------------------------------------------
  1204.   def self.play_significant_damage_voice(actor_id)
  1205.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1206.     return play_voice(SIGNIFICANT_DAMAGE[actor_id], actor_id)
  1207.   end
  1208.   #------------------------------------------------------------------------
  1209.   # * New Method: Play "Heavy Damage" Voice
  1210.   #------------------------------------------------------------------------
  1211.   def self.play_heavy_damage_voice(actor_id)
  1212.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1213.     return play_voice(HEAVY_DAMAGE[actor_id], actor_id)
  1214.   end
  1215.   #------------------------------------------------------------------------
  1216.   # * New Method: Play "Massive Damage" Voice
  1217.   #------------------------------------------------------------------------
  1218.   def self.play_massive_damage_voice(actor_id)
  1219.     return true if !allowed_to_play_voice?() || !allowed_to_speak?()
  1220.     return play_voice(MASSIVE_DAMAGE[actor_id], actor_id)
  1221.   end
  1222.   #------------------------------------------------------------------------
  1223.   # * New Method: Play "Escape Attempt" Voice
  1224.   #------------------------------------------------------------------------
  1225.   def self.play_escape_attempt_voice(actor_id)
  1226.     return true if !allowed_to_play_voice?()
  1227.     return play_voice(ESCAPE_ATTEMPT_VOICE[actor_id], actor_id)
  1228.   end
  1229.   #------------------------------------------------------------------------
  1230.   # * New Method: Play "Escape Successful" Voice
  1231.   #------------------------------------------------------------------------
  1232.   def self.play_escape_successful_voice(actor_id, force_allow = false)
  1233.     # When You Escape, you are now on Scene_Map instead of Scene_Battle
  1234.     # So force_allow will let you play the voice if you did infact just escape from battle
  1235.     return true if !allowed_to_play_voice?() && !force_allow
  1236.     return play_voice(SUCCESSFUL_ESCAPE[actor_id], actor_id)
  1237.   end
  1238.   #------------------------------------------------------------------------
  1239.   # * New Method: Play "Escape Failed" Voice
  1240.   #------------------------------------------------------------------------
  1241.   def self.play_escape_failed_voice(actor_id)
  1242.     return true if !allowed_to_play_voice?()
  1243.     return play_voice(FAILED_ESCAPE[actor_id], actor_id)
  1244.   end
  1245.   #------------------------------------------------------------------------
  1246.   # * New Method: Play "Default Victory" Voice
  1247.   #------------------------------------------------------------------------
  1248.   def self.play_default_victory_voice(actor_id = 0)
  1249.     return true if !allowed_to_play_voice?()
  1250.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1251.     return play_voice(NORMAL_VICTORY[actor_id], actor_id)
  1252.   end
  1253.   #------------------------------------------------------------------------
  1254.   # * New Method: Play "Battle Was Easy" Voice
  1255.   #------------------------------------------------------------------------
  1256.   def self.play_battle_was_easy_voice(actor_id = 0)
  1257.     return true if !allowed_to_play_voice?()
  1258.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1259.     return play_voice(THAT_WAS_EASY[actor_id], actor_id)
  1260.   end
  1261.   #------------------------------------------------------------------------
  1262.   # * New Method: Play "Very Long Battle" Voice
  1263.   #------------------------------------------------------------------------
  1264.   def self.play_very_long_battle_voice(actor_id = 0)
  1265.     return true if !allowed_to_play_voice?()
  1266.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1267.     return play_voice(BATTLE_TOOK_AGES[actor_id], actor_id)
  1268.   end
  1269.   #------------------------------------------------------------------------
  1270.   # * New Method: Play "Party Was Badly Injured" Voice
  1271.   #------------------------------------------------------------------------
  1272.   def self.play_party_was_badly_injured_voice(actor_id = 0)
  1273.     return true if !allowed_to_play_voice?()
  1274.     actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  1275.     return play_voice(THAT_WAS_TOUGH[actor_id], actor_id)
  1276.   end
  1277.  
  1278. end # BattleVoices Module
  1279. end # DiamondandPlatinum3 Module
  1280.  
  1281.  
  1282.  
  1283.  
  1284. #==============================================================================
  1285. # ** Game_System
  1286. #------------------------------------------------------------------------------
  1287. #  This class handles system data. It saves the disable state of saving and
  1288. # menus. Instances of this class are referenced by $game_system.
  1289. #==============================================================================
  1290.  
  1291. class Game_System
  1292.   #--------------------------------------------------------------------------
  1293.   # * Alias Listings
  1294.   #--------------------------------------------------------------------------
  1295.   alias dp3_gamesys_init_1s098yu9j                                 initialize
  1296.   #--------------------------------------------------------------------------
  1297.   # * Public Instance Variables
  1298.   #--------------------------------------------------------------------------
  1299.   attr_accessor :actor_voices_names
  1300.   #--------------------------------------------------------------------------
  1301.   # * Object Initialization
  1302.   #--------------------------------------------------------------------------
  1303.   def initialize(*args)
  1304.     dp3_gamesys_init_1s098yu9j(*args) # Call Original Method
  1305.     actor_voices_names = Array.new()
  1306.   end
  1307. end
  1308.  
  1309.  
  1310. #==============================================================================
  1311. # ** Game_Interpreter
  1312. #------------------------------------------------------------------------------
  1313. #  An interpreter for executing event commands. This class is used within the
  1314. # Game_Map, Game_Troop, and Game_Event classes.
  1315. #==============================================================================
  1316.  
  1317. class Game_Interpreter
  1318.   #--------------------------------------------------------------------------
  1319.   # * Set Actor Voice Name
  1320.   #--------------------------------------------------------------------------
  1321.   def set_actor_voice_name(id, name)
  1322.     unless id.is_a?(Integer); msgbox_p("You did not insert a Valid ID for the Actor"); return; end
  1323.     unless name.is_a?(String); msgbox_p("You did not insert a Valid Name for the Actor"); return; end
  1324.    
  1325.     $game_system.actor_voices_names = Array.new() if $game_system.actor_voices_names.nil?
  1326.     $game_system.actor_voices_names[id] = name
  1327.   end
  1328. end
  1329.  
  1330.  
  1331. #==============================================================================
  1332. # ** Scene_Battle
  1333. #------------------------------------------------------------------------------
  1334. #  This class performs battle screen processing.
  1335. #==============================================================================
  1336.  
  1337. class Scene_Battle < Scene_Base
  1338.   #--------------------------------------------------------------------------
  1339.   # * Alias Listings
  1340.   #--------------------------------------------------------------------------
  1341.   alias dp3_scenebattle_poststart_1s098yu9j               post_start
  1342.   alias dp3_scenebattle_applyitemeffects_1s098yu9j        apply_item_effects
  1343.  
  1344.   #--------------------------------------------------------------------------
  1345.   # * Aliased Method: Post-Start Processing
  1346.   #--------------------------------------------------------------------------
  1347.   def post_start(*args)
  1348.     dp3_play_battle_start_voice()    
  1349.     dp3_scenebattle_poststart_1s098yu9j()
  1350.   end
  1351.  
  1352.   #--------------------------------------------------------------------------
  1353.   # * New Method: Play Battle Start Voice
  1354.   #--------------------------------------------------------------------------
  1355.   def dp3_play_battle_start_voice
  1356.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1357.     # Party Needs Healing?
  1358.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1359.     party_total_hp = party_current_hp = 0
  1360.     $game_party.battle_members.each {|ally| party_total_hp += ally.mhp }
  1361.     party_current_hp = party_total_hp
  1362.     $game_party.battle_members.each {|ally| party_current_hp -= (ally.mhp - ally.hp) }
  1363.    
  1364.     if party_current_hp < party_total_hp * (DiamondandPlatinum3::BattleVoices::PARTY_NEEDS_HEALING[:ratio] * 0.01)
  1365.       return if DiamondandPlatinum3::BattleVoices::play_party_needs_healing_voice()
  1366.     end
  1367.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1368.     # Too many enemies?
  1369.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1370.     if $game_troop.members.size > $game_party.members.size + DiamondandPlatinum3::BattleVoices::TOO_MANY_ENEMIES[:ratio]
  1371.       return if DiamondandPlatinum3::BattleVoices::play_too_many_enemies_voice()
  1372.     end
  1373.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1374.     # Which side is stronger?
  1375.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1376.     strongest_enemy_stats   = [ 0, 0, 0, 0 ]
  1377.     strongest_party_stats   = [ 0, 0, 0, 0 ]
  1378.    
  1379.     $game_troop.members.each do |enemy|
  1380.       strongest_enemy_stats[0] = enemy.atk if enemy.atk > strongest_enemy_stats[0]
  1381.       strongest_enemy_stats[1] = enemy.def if enemy.def > strongest_enemy_stats[1]
  1382.       strongest_enemy_stats[2] = enemy.mat if enemy.mat > strongest_enemy_stats[2]
  1383.       strongest_enemy_stats[3] = enemy.mdf if enemy.mdf > strongest_enemy_stats[3]
  1384.     end
  1385.    
  1386.     $game_party.battle_members.each do |ally|
  1387.       strongest_party_stats[0] = ally.atk if ally.atk > strongest_party_stats[0]
  1388.       strongest_party_stats[1] = ally.def if ally.def > strongest_party_stats[1]
  1389.       strongest_party_stats[2] = ally.mat if ally.mat > strongest_party_stats[2]
  1390.       strongest_party_stats[3] = ally.mdf if ally.mdf > strongest_party_stats[3]
  1391.     end
  1392.    
  1393.    
  1394.     enemy_power = strongest_enemy_stats[0] + strongest_enemy_stats[1] + strongest_enemy_stats[2] + strongest_enemy_stats[3]
  1395.     party_power = strongest_party_stats[0] + strongest_party_stats[1] + strongest_party_stats[2] + strongest_party_stats[3]
  1396.    
  1397.    
  1398.     return DiamondandPlatinum3::BattleVoices::play_very_weak_enemies_voice()     if enemy_power < party_power * (DiamondandPlatinum3::BattleVoices::VERY_WEAK_ENEMIES[:ratio] * 0.01)
  1399.     return DiamondandPlatinum3::BattleVoices::play_weak_enemies_voice()          if enemy_power < party_power * (DiamondandPlatinum3::BattleVoices::WEAK_ENEMIES[:ratio] * 0.01)
  1400.     return DiamondandPlatinum3::BattleVoices::play_very_strong_enemies_voice()   if enemy_power > party_power * (DiamondandPlatinum3::BattleVoices::VERY_STRONG_ENEMIES[:ratio] * 0.01)
  1401.     return DiamondandPlatinum3::BattleVoices::play_strong_enemies_voice()        if enemy_power > party_power * (DiamondandPlatinum3::BattleVoices::STRONG_ENEMIES[:ratio] * 0.01)
  1402.     return DiamondandPlatinum3::BattleVoices::play_equal_enemies_voice()
  1403.   end # def dp3_play_battle_start_voice
  1404.  
  1405.  
  1406.   #--------------------------------------------------------------------------
  1407.   # * Aliased Method: Apply Skill/Item Effect
  1408.   #--------------------------------------------------------------------------
  1409.   def apply_item_effects(*args)
  1410.     # Call Original Method
  1411.     dp3_scenebattle_applyitemeffects_1s098yu9j(*args)
  1412.     args[0].dp3_set_actor_said_thank_you_already() if args[0].actor?
  1413.    
  1414.     # If Result was a Miss, and an actor was not targeting an actor
  1415.     if !args[0].result.hit?
  1416.       if !args[0].actor? && @subject.actor?
  1417.         DiamondandPlatinum3::BattleVoices::play_missed_enemies_voice(@subject.id)
  1418.       elsif args[0].actor? && !@subject.actor?
  1419.         DiamondandPlatinum3::BattleVoices::play_evaded_enemy_voice(args[0].id)
  1420.       end
  1421.     end
  1422.   end
  1423.  
  1424.   #--------------------------------------------------------------------------
  1425.   # * Overwritten Method: Show Normal Animation
  1426.   #--------------------------------------------------------------------------
  1427.   def show_normal_animation(*args)
  1428.     @dp3_speak_for_multiple_hits = true             # New Line
  1429.     animation = $data_animations[args[1]]
  1430.     if animation
  1431.       args[0].each do |target|
  1432.         dp3_on_animation_begin(target)              # New Line
  1433.         target.animation_id = args[1]
  1434.         target.animation_mirror = args[2]
  1435.         abs_wait_short unless animation.to_screen?
  1436.         dp3_on_animation_end(target)                # New Line
  1437.       end
  1438.       abs_wait_short if animation.to_screen?
  1439.     end
  1440.   end
  1441.  
  1442.   #--------------------------------------------------------------------------
  1443.   # * New Method: On Animation Begin (Multihit Included)
  1444.   #--------------------------------------------------------------------------
  1445.   def dp3_on_animation_begin(target)
  1446.     if @dp3_speak_for_multiple_hits
  1447.       if @subject.actor? && !target.actor?
  1448.         @dp3_speak_for_multiple_hits = DiamondandPlatinum3::BattleVoices::PLAY_MULTIPLE_VOICES_FOR_MULTIPLE_HITS
  1449.         DiamondandPlatinum3::BattleVoices::play_skill_or_item_voice(@subject.id, @subject.current_action.item)
  1450.       end
  1451.     end
  1452.   end
  1453.  
  1454.   #--------------------------------------------------------------------------
  1455.   # * New Method: On Animation End (Multihit Included)
  1456.   #--------------------------------------------------------------------------
  1457.   def dp3_on_animation_end(target)
  1458.   end
  1459.  
  1460. end # Class
  1461.  
  1462.  
  1463. #==============================================================================
  1464. # ** Game_Actor
  1465. #------------------------------------------------------------------------------
  1466. #  This class handles actors. It is used within the Game_Actors class
  1467. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  1468. #==============================================================================
  1469.  
  1470. class Game_Actor < Game_Battler
  1471.   #--------------------------------------------------------------------------
  1472.   # * Alias Listings
  1473.   #--------------------------------------------------------------------------
  1474.   alias dp3_gameactor_useitem_1s098yu9j                 use_item
  1475.   alias dp3_gameactor_die_1s098yu9j                     die
  1476.   alias dp3_gameactor_changeexp_1s098yu9j               change_exp
  1477.   alias dp3_gameactor_itemeffectrecoverhp_1s098yu9j     item_effect_recover_hp
  1478.   alias dp3_gameactor_itemeffectrecovermp_1s098yu9j     item_effect_recover_mp
  1479.   alias dp3_gameactor_executedamage_1s098yu9j           execute_damage
  1480.   alias dp3_gameactor_removestate_1s098yu9j             remove_state
  1481.   alias dp3_gameactor_ondamage_1s098yu9j                on_damage
  1482.  
  1483.   #--------------------------------------------------------------------------
  1484.   # * Aliased Method: Use Skill/Item
  1485.   #--------------------------------------------------------------------------
  1486.   def use_item( *args )
  1487.     #DiamondandPlatinum3::BattleVoices::play_item_voice(@actor_id, args[0].id) if args[0].is_a?(RPG::Item)
  1488.    
  1489.     # Call Original Method
  1490.     dp3_gameactor_useitem_1s098yu9j( *args )
  1491.   end
  1492.  
  1493.   #--------------------------------------------------------------------------
  1494.   # * Aliased Method: Knock Out
  1495.   #--------------------------------------------------------------------------
  1496.   def die( *args )
  1497.     DiamondandPlatinum3::BattleVoices::play_death_voice(@actor_id)
  1498.    
  1499.     # Call Original Method
  1500.     dp3_gameactor_die_1s098yu9j( *args )
  1501.   end
  1502.  
  1503.   #--------------------------------------------------------------------------
  1504.   # * Aliased Method: Change Experience
  1505.   #--------------------------------------------------------------------------
  1506.   def change_exp(*args)
  1507.     last_level = @level
  1508.     dp3_gameactor_changeexp_1s098yu9j(*args) # Call Original Method
  1509.     if @level > last_level
  1510.       DiamondandPlatinum3::BattleVoices::play_leveledup_voice(@actor_id)
  1511.     end
  1512.   end  
  1513.  
  1514.   #--------------------------------------------------------------------------
  1515.   # * Aliased Method: [HP Recovery] Effect
  1516.   #--------------------------------------------------------------------------
  1517.   def item_effect_recover_hp( *args )
  1518.     if args[0] != self && !@dp3__actor_said_thank_you
  1519.       DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  1520.       @dp3__actor_said_thank_you = true
  1521.     end
  1522.    
  1523.     # Call Original Method
  1524.     dp3_gameactor_itemeffectrecoverhp_1s098yu9j( *args )
  1525.   end
  1526.  
  1527.   #--------------------------------------------------------------------------
  1528.   # * Aliased Method: [MP Recovery] Effect
  1529.   #--------------------------------------------------------------------------
  1530.   def item_effect_recover_mp( *args )
  1531.     if args[0] != self && !@dp3__actor_said_thank_you
  1532.       DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  1533.       @dp3__actor_said_thank_you = true
  1534.     end
  1535.     # Call Original Method
  1536.     dp3_gameactor_itemeffectrecovermp_1s098yu9j( *args )
  1537.   end
  1538.  
  1539.  
  1540.   #--------------------------------------------------------------------------
  1541.   # * Aliased Method: Execute Damage
  1542.   #--------------------------------------------------------------------------
  1543.   def execute_damage(*args)
  1544.     play_voice = state?(death_state_id) && args[0] == death_state_id
  1545.     current_hp = self.hp
  1546.     current_mp = self.mp
  1547.     dp3_gameactor_executedamage_1s098yu9j(*args)
  1548.    
  1549.     if !play_voice
  1550.       # Play Healed Voice if Healed and Allowed
  1551.       if current_hp < self.hp || current_mp < self.mp
  1552.         if args[0].enemy?
  1553.           if args[0] == self
  1554.             if DiamondandPlatinum3::BattleVoices::HP_MP_RESTORE[:self_heal_speak]
  1555.               DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  1556.             end
  1557.           else
  1558.             DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  1559.           end
  1560.         end
  1561.       end
  1562.     end
  1563.   end
  1564.  
  1565.  
  1566.   #--------------------------------------------------------------------------
  1567.   # * Aliased Method: [Remove Debuff] Effect
  1568.   #--------------------------------------------------------------------------
  1569.   def remove_state(*args)
  1570.     play_voice = state?(death_state_id) && args[0] == death_state_id
  1571.     super(*args) # Call Original Method
  1572.     DiamondandPlatinum3::BattleVoices::play_revived_voice(@actor_id) if play_voice
  1573.   end
  1574.  
  1575.  
  1576.  
  1577.   #--------------------------------------------------------------------------
  1578.   # * Aliased Method: Processing When Suffering Damage
  1579.   #--------------------------------------------------------------------------
  1580.   def on_damage(*args)
  1581.     dp3_play_appropriate_actor_damage_voice( args[0] ) if args[0] > 0 && (self.hp - args[0]) > 0
  1582.    
  1583.     # Call Original Method
  1584.     dp3_gameactor_ondamage_1s098yu9j( *args )
  1585.   end
  1586.  
  1587.   #--------------------------------------------------------------------------
  1588.   # * New Method: Get Actor Damage Voice Array
  1589.   #--------------------------------------------------------------------------
  1590.   def dp3_play_appropriate_actor_damage_voice( value )
  1591.     #~~~~~ Play Massive Damage Voice ~~~~~#
  1592.     if value > self.mhp * (DiamondandPlatinum3::BattleVoices::MASSIVE_DAMAGE[:ratio] * 0.01)
  1593.       return true if DiamondandPlatinum3::BattleVoices::play_massive_damage_voice(@actor_id)
  1594.     end
  1595.     #~~~~~ Play Heavy Damage Voice ~~~~~#
  1596.     if value > self.mhp * (DiamondandPlatinum3::BattleVoices::HEAVY_DAMAGE[:ratio] * 0.01)
  1597.       return true if DiamondandPlatinum3::BattleVoices::play_heavy_damage_voice(@actor_id)
  1598.     end
  1599.     #~~~~~ Play Significant Damage Voice ~~~~~#
  1600.     if value > self.mhp * (DiamondandPlatinum3::BattleVoices::SIGNIFICANT_DAMAGE[:ratio] * 0.01)
  1601.       return true if DiamondandPlatinum3::BattleVoices::play_significant_damage_voice(@actor_id)
  1602.     end
  1603.     #~~~~~ Play Little Damage Voice ~~~~~#
  1604.     if value > self.mhp * (DiamondandPlatinum3::BattleVoices::LITTLE_DAMAGE[:ratio] * 0.01)
  1605.       return true if DiamondandPlatinum3::BattleVoices::play_little_damage_voice(@actor_id)
  1606.     end
  1607.     #~~~~~ Play Pitance Damage Voice ~~~~~#
  1608.     return DiamondandPlatinum3::BattleVoices::play_default_damage_voice(@actor_id)
  1609.   end
  1610.  
  1611.   #--------------------------------------------------------------------------
  1612.   # * New Method: Set "Thank You" Voice Availability
  1613.   #--------------------------------------------------------------------------
  1614.   def dp3_set_actor_said_thank_you_already()
  1615.     @dp3__actor_said_thank_you = false
  1616.   end
  1617. end
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627. #==============================================================================
  1628. # ** BattleManager
  1629. #------------------------------------------------------------------------------
  1630. #  This module manages battle progress.
  1631. #==============================================================================
  1632.  
  1633. module BattleManager
  1634.   class << self
  1635.     #------------------------------------------------------------------------
  1636.     # * Alias Listings
  1637.     #------------------------------------------------------------------------
  1638.     alias dp3_battlemanager_setup_1s098yu9j               setup
  1639.     alias dp3_battlemanager_processescape_1s098yu9j       process_escape
  1640.     alias dp3_battlemanager_processvictory_1s098yu9j      process_victory
  1641.     alias dp3_battlemanager_processdefeat_1s098yu9j       process_defeat
  1642.    
  1643.     #------------------------------------------------------------------------
  1644.     # * Aliased Method: Setup
  1645.     #------------------------------------------------------------------------
  1646.     def setup( *args )
  1647.       @dp3_party_start_total_hp = 0
  1648.       $game_party.battle_members.each { |ally| @dp3_party_start_total_hp += ally.hp }
  1649.    
  1650.      
  1651.       # Call Original Method
  1652.       dp3_battlemanager_setup_1s098yu9j( *args )
  1653.     end
  1654.    
  1655.     #------------------------------------------------------------------------
  1656.     # * Aliased Method: Escape Processing
  1657.     #------------------------------------------------------------------------
  1658.     def process_escape( *args )
  1659.       # Play Begin Escape Voice
  1660.       actor_to_speak = DiamondandPlatinum3::BattleVoices::get_battle_actor_id()
  1661.       DiamondandPlatinum3::BattleVoices::play_escape_attempt_voice(actor_to_speak)
  1662.      
  1663.       # Call Original Method
  1664.       escaped = dp3_battlemanager_processescape_1s098yu9j( *args )
  1665.      
  1666.       # Play Voice for either successful or unsucessful escape
  1667.       if escaped
  1668.         DiamondandPlatinum3::BattleVoices::play_escape_successful_voice(actor_to_speak, true)
  1669.       else
  1670.         DiamondandPlatinum3::BattleVoices::play_escape_failed_voice(actor_to_speak)
  1671.       end
  1672.      
  1673.       # Finish Up
  1674.       return escaped
  1675.     end
  1676.     #------------------------------------------------------------------------
  1677.     # * Aliased Method: Victory Processing
  1678.     #------------------------------------------------------------------------
  1679.     def process_victory(*args)
  1680.       dp3_play_victory_voice()
  1681.      
  1682.       # Call Original Method
  1683.       return dp3_battlemanager_processvictory_1s098yu9j(*args)
  1684.     end
  1685.    
  1686.     #--------------------------------------------------------------------------
  1687.     # * Aliased Method: Defeat Processing
  1688.     #--------------------------------------------------------------------------
  1689.     def process_defeat(*args)
  1690.       # This method is merely here in case the @can_lose instance variable is on.
  1691.       # Actors will say thank you when being revived after defeat. So to counteract
  1692.       # this we set the mute event_switch on
  1693.       es_id                   = DiamondandPlatinum3::BattleVoices::EVENT_SWITCH_ID
  1694.       es_on                   = ($game_switches[es_id] ||= false)
  1695.       $game_switches[es_id]   = true
  1696.       defeated                = dp3_battlemanager_processdefeat_1s098yu9j(*args)
  1697.       $game_switches[es_id]   = es_on
  1698.       return defeated
  1699.     end
  1700.  
  1701.     #------------------------------------------------------------------------
  1702.     # * New Method: Play Victory Voice
  1703.     #------------------------------------------------------------------------
  1704.     def dp3_play_victory_voice
  1705.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1706.       # Battle Took Ages?
  1707.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1708.       if $game_troop.turn_count >= DiamondandPlatinum3::BattleVoices::BATTLE_TOOK_AGES[:ratio]
  1709.         return if DiamondandPlatinum3::BattleVoices::play_very_long_battle_voice()
  1710.       end
  1711.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1712.       # Party Was Badly Injured?
  1713.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1714.       party_current_hp = 0
  1715.       $game_party.battle_members.each {|ally| party_current_hp += ally.hp }
  1716.       if party_current_hp < @dp3_party_start_total_hp * (DiamondandPlatinum3::BattleVoices::THAT_WAS_TOUGH[:ratio] * 0.01)
  1717.         return if DiamondandPlatinum3::BattleVoices::play_party_was_badly_injured_voice()
  1718.       end
  1719.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1720.       # Battle Was Easy?
  1721.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1722.       if $game_troop.turn_count <= DiamondandPlatinum3::BattleVoices::THAT_WAS_EASY[:ratio]
  1723.         return if DiamondandPlatinum3::BattleVoices::play_battle_was_easy_voice()
  1724.       end
  1725.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1726.       # Default Victory Speech
  1727.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1728.       DiamondandPlatinum3::BattleVoices::play_default_victory_voice()
  1729.     end # def
  1730.   end # class
  1731. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement