Advertisement
FlipelyFlip

Enemy Voices in Battle

Sep 11th, 2024
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 34.26 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Enemy Voices in Battle
  3. #             Version: 1.0
  4. #             Author: DiamondandPlatinum3
  5. #             Date: October 2, 2012
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #  Description:
  8. #
  9. #    This script grants you the ability to have your enemies talk throughout
  10. #    battle.
  11. #
  12. #    Enemies will say things when attacking/using skills/getting damaged/etc
  13. #
  14. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. #------------------------------------------------------------------------------
  16. #  Instructions:
  17. #  
  18. #   ~ This script was built off the Actor Voices in Battle Script.
  19. #     As such, most of the setup process of this script is similar.
  20. #       There is a Video Tutorial explaining the Actor Voices in Battle Script.
  21. #       You may watch it here:      http://www.youtube.com/watch?v=CaQhoZg_FgI
  22. #       Script Available Here:      http://diamondandplatinum3.net/rpg-maker-scripts/rgss3-vxa/battle-scripts/actor-voices-in-battle/
  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: Slime, Jellyfish, Angel
  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 manually however.
  34. #     You do this by inserting the following code into the notetag of the
  35. #     Skill/Item:
  36. #
  37. #       ~EnemyVoice: ID, "Voice_Filename"
  38. #
  39. #               or
  40. #
  41. #       ~EnemyVoice: ID, "Voice_Filename", Volume, Pitch, Wait Frames
  42. #
  43. #
  44. #     Replace the ID with the id of the enemy that 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 enemies.
  51. #
  52. #
  53. #   ~ A Screenshot example of the above may be found here:
  54. #             http://i.imgur.com/MhKFood.png    <= Notetag Example
  55. #             http://i.imgur.com/eooTs6y.png    <= Actor Voices and Enemy Voices (only if Actor Voices in Battle is imported)
  56. #
  57. #             http://i.imgur.com/Oqc9BGA.png    <= Voices Folder
  58. #             http://i.imgur.com/cq1JPBc.png    <= Individual Folders
  59. #
  60. #
  61. #
  62. #   ~ In the editable region section your enemies can have more than one thing to
  63. #     say. It the same pattern of: "filename", volume, pitch, frames_to_wait, repeat;
  64. #     until you finish it, I trust your common sense to figure out how :)
  65. #
  66. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  67. #------------------------------------------------------------------------------
  68. #  Engine Modifications:
  69. #
  70. #   ~ class Scene_Battle:
  71. #       apply_item_effects        (aliased)
  72. #
  73. #
  74. #   ~ class Game_Enemy:
  75. #       use_item                  (aliased)
  76. #       die                       (aliased)
  77. #       change_exp                (aliased)
  78. #       execute_damage            (aliased)
  79. #       on_damage                 (aliased)
  80. #
  81. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  82. ($diamondandplatinum3_scripts ||= {})[:EnemyBattleVoices] = true
  83. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  84. module DiamondandPlatinum3
  85. module EnemyBattleVoices
  86.   #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  87.   #                                                        -=
  88.   #                 Editable Region        ////            ==
  89.   #                                                        =-
  90.   #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  91.  
  92.   # You must create a new folder inside of your SE Audio folder and name it
  93.   # Whatever you decided to call it just below
  94.   FOLDER_DIRECTORY_NAME = "Battle_Voices"
  95.  
  96.  
  97.  
  98.   # This Event Switch when turned on will mute the voices from being played.
  99.   # They will still play, you just won't hear them
  100.   #
  101.   # If you leave the event switch id as zero, that means you can NEVER turn off the
  102.   # Enemy Battle Voices
  103.   EVENT_SWITCH_ID = 0
  104.  
  105.  
  106.   # If the enemy has been inflicted with any of these states, they will have their
  107.   # voices muted until it is cured.
  108.   # State No.4 by default is the Silence state, which is a reasonable state for muting
  109.   # someone. you can add more states after it by adding another ID number and a comma
  110.   #
  111.   # If you do not want any state to mute you, simply erase everything inside the square brackets
  112.   SILENCE_STATES = [ 6,7,8,38,39, ]
  113.  
  114.  
  115.   # Here you can choose the Skills which your Enemy Voices will not play for.
  116.   # By default, Skills 1-7 are skills which are used with certain commands.
  117.   # Some of those commands have their own specific Enemy Voice, such as Attacking.
  118.   # As such it is advisable to input the Skill ID referring to those
  119.   # commands in this option.
  120.   # If you are using the Default Skillset, you can leave this option as is.
  121.   # However if you're using custom skills, please make sure they're not being
  122.   # omitted inside of this option.
  123.   #
  124.   # You may also use this option to stop custom skills from having voices if you'd
  125.   # prefer.
  126.   SKILLS_NOT_TO_PLAY_VOICE_FOR = [ 996, 997, ]
  127.  
  128.  
  129.   # If you've been playing and noticed that battle voices tend to happen a bit too often
  130.   # for your liking, you may use this Option to decrease the frequency in which they will
  131.   # say general things (like attacking, using skills, etc). Non-general voices (such as
  132.   # specific skills) will still play whenever they are used.
  133.   #
  134.   #
  135.   # This works as a percentage out of 100.
  136.   VOICE_FREQUENCY = 100
  137.  
  138.  
  139.   # If an attack has multiple hits, do you want the actor in question to keep
  140.   # screaming battle cries for each hit?
  141.   PLAY_MULTIPLE_VOICES_FOR_MULTIPLE_HITS = true
  142.  
  143.  
  144.  
  145.   #=============================================================================
  146.   #    Battle Voices
  147.   #-----------------------------------------------------------------------------
  148.   #   These voices are heard throughout the battle, such as when attacking,
  149.   #   using a skill or taking damage, etc
  150.   #=============================================================================
  151.  
  152.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153.   # * WHEN ENEMY IS ATTACKING
  154.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  155.   ENEMY_ATTACKING = { # <= Do Not Touch This Line
  156.  
  157.     # What Enemy One (Default: Slime) Will Say when Normal Attacking
  158.     16 => [
  159. #          "Attack01", 80, 100, 0,
  160. #          "Attack02", 80, 100, 0,
  161.          ],
  162.  
  163.      
  164.     # What Enemy Two (Default: Bat) Will Say when Normal Attacking
  165.     16 => [
  166. #           "Attack01", 80, 100, 0,
  167. #          "Attack02", 80, 100, 0,
  168. #          "Attack03", 80, 100, 0,
  169.          ],
  170.          
  171.    
  172.     # What Enemy Nine (Default: Jellyfish) Will Say when Normal Attacking
  173.     16 => [
  174. #          "Attack01", 80, 100, 0,
  175.          ],
  176.          
  177.          
  178.     # What Enemy Twenty-Nine (Default: Demon King) Will Say when Normal Attacking
  179.     16 =>[
  180. #          "Attack01", 80, 100, 0,
  181.          ],
  182.          
  183.  
  184.  
  185.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  186.   # * WHEN USING A SKILL
  187.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  188.   }; USING_SKILLS = { # <= Do Not Touch This Line
  189.  
  190.     # What Enemy Twenty-Nine (Default: Demon King) Will Say when using a generic skill
  191.     16 =>[
  192. #          "Using Generic Skill01", 80, 100, 0,
  193.          ],  
  194.          
  195.          
  196.          
  197.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  198.   # * WHEN ENEMY MISSED THE ACTOR
  199.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  200.   }; MISSED_ACTOR_TARGET = { # <= Do Not Touch This Line
  201.  
  202.     # What Enemy Twenty-Nine (Default: Demon King) Will Say
  203.     16 =>[
  204. #          "Missed Enemy01", 80, 100, 0,
  205.          ],
  206.  
  207.  
  208.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  209.   # * WHEN ENEMY EVADED ACTOR'S ATTACK
  210.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  211.   }; DODGED_ACTOR_ATTACK = { # <= Do Not Touch This Line
  212.  
  213.     # What Enemy Twenty-Nine (Default: Demon King) Will Say
  214.     16 =>[
  215. #          "Dodged Enemy Attack01", 80, 100, 0,
  216.          ],
  217.        
  218.        
  219.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  220.   # * WHEN ENEMY TAKES LITTLE DAMAGE FROM ACTOR ATTACK
  221.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  222.   }; LITTLE_DAMAGE = { # <= Do Not Touch This Line
  223.  
  224.     # Percentage of Health that must be lost from an individual attack for these
  225.     # to be played
  226.     :ratio => 15 ,
  227.  
  228.     # Blubbschleim
  229.     2 => [
  230.            "Slime_Damage", 80, 100, 0,
  231.          ],
  232.     # Kogelschleim
  233.     3 => [
  234.            "Slime_Damage", 80, 100, 0,
  235.          ],
  236.  
  237.     # Flederratte
  238.     4 => [
  239.            "Bat_Damage", 100, 100, 0,
  240.          ],
  241.  
  242.     # Giftige Hornisse
  243.     5 => [
  244.            "Hornet_Damage", 90, 100, 0,
  245.          ],
  246.  
  247.     # Tarantula
  248.     6 => [
  249.            "Spider_Damage", 100, 100, 0,
  250.          ],
  251.  
  252.     # Skelettkrieger
  253.     9 => [
  254.            "Monster9", 80, 100, 0,
  255.          ],
  256.  
  257.     # Elfengeist
  258.     11 => [
  259.            "Ghost_Damage", 60, 100, 0,
  260.          ],
  261.  
  262.     # Bandit
  263.     12 => [
  264.            "Bandit_Damage", 80, 90, 0,
  265.          ],
  266.  
  267.     # Goblin
  268.     13 => [
  269.            "Goblin_Damage", 80, 100, 0,
  270.          ],
  271.  
  272.     # Bergwolf
  273.     14 => [
  274.            "Wolf_Damage", 65, 100, 0,
  275.          ],
  276.  
  277.     # Bergadler
  278.     15 => [
  279.            "Eagle_Damage", 70, 100, 0,
  280.          ],
  281.  
  282.     # Corvo
  283.     16 => [
  284.            "HIT! 1", 70, 85, 0,
  285.            "HIT! 2", 70, 85, 0,
  286.            "HIT! 3", 70, 85, 0,
  287.          ],
  288.      
  289.     # Mörderkrabbe
  290.     17 => [
  291.            "Crab_Damage", 100, 100, 0,          
  292.          ],
  293.      
  294.     # Flugfish
  295.     18 => [
  296.            "Fish_Damage", 80, 100, 0,          
  297.          ],
  298.  
  299.     # Bandit
  300.     19 => [
  301.            "Bandit_Damage", 80, 90, 0,
  302.          ],
  303.      
  304.     # Goliath
  305.     21 => [
  306.            "Mhh1", 85, 95, 0,
  307.            "uagh2", 85, 90, 0,
  308.          ],
  309.  
  310.     # Blutsauger
  311.     22 => [
  312.            "Bat_Damage", 100, 100, 0,
  313.          ],
  314.  
  315.     # Knochenkrieger
  316.     23 => [
  317.            "Monster9", 80, 100, 0,
  318.          ],      
  319.          
  320.          
  321.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  322.   # * WHEN ENEMY TAKES SIGNIFICANT DAMAGE FROM ACTOR ATTCK
  323.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  324.   }; SIGNIFICANT_DAMAGE = { # <= Do Not Touch This Line
  325.  
  326.     # Percentage of Health that must be lost from an individual attack for these
  327.     # to be played
  328.     :ratio => 35 ,
  329.  
  330.     # Blubbschleim
  331.     2 => [
  332.            "Slime_Damage", 80, 100, 0,
  333.          ],
  334.     # Kogelschleim
  335.     3 => [
  336.            "Slime_Damage", 80, 100, 0,
  337.          ],
  338.  
  339.     # Flederratte
  340.     4 => [
  341.            "Bat_Damage", 100, 100, 0,
  342.          ],
  343.  
  344.     # Giftige Hornisse
  345.     5 => [
  346.            "Hornet_Damage", 90, 100, 0,
  347.          ],
  348.  
  349.     # Tarantula
  350.     6 => [
  351.            "Spider_Damage", 100, 100, 0,
  352.          ],
  353.  
  354.     # Skelettkrieger
  355.     9 => [
  356.            "Monster9", 80, 100, 0,
  357.          ],
  358.  
  359.     # Elfengeist
  360.     11 => [
  361.            "Ghost_Damage", 60, 100, 0,
  362.          ],
  363.  
  364.     # Bandit
  365.     12 => [
  366.            "Bandit_Damage", 80, 90, 0,
  367.          ],
  368.  
  369.     # Goblin
  370.     13 => [
  371.            "Goblin_Damage", 80, 100, 0,
  372.          ],
  373.  
  374.     # Bergwolf
  375.     14 => [
  376.            "Wolf_Damage", 65, 100, 0,
  377.          ],
  378.  
  379.     # Bergadler
  380.     15 => [
  381.            "Eagle_Damage", 70, 100, 0,
  382.          ],
  383.  
  384.     # Corvo
  385.     16 => [
  386.            "HIT! 2", 70, 85, 0,
  387.            "HIT! 3", 70, 85, 0,
  388.            "HIT! 4", 70, 85, 0,          
  389.          ],
  390.      
  391.     # Mörderkrabbe
  392.     17 => [
  393.            "Crab_Damage", 100, 100, 0,          
  394.          ],
  395.      
  396.     # Flugfish
  397.     18 => [
  398.            "Fish_Damage", 80, 100, 0,          
  399.          ],
  400.  
  401.     # Bandit
  402.     19 => [
  403.            "Bandit_Damage", 80, 90, 0,
  404.          ],
  405.      
  406.     # Goliath
  407.     21 => [
  408.            "Uff1", 85, 90, 0,
  409.            "uagh2", 85, 90, 0,
  410.            "Ungh1", 85, 90, 0,
  411.          ],
  412.  
  413.     # Blutsauger
  414.     22 => [
  415.            "Bat_Damage", 100, 100, 0,
  416.          ],
  417.  
  418.     # Knochenkrieger
  419.     23 => [
  420.            "Monster9", 80, 100, 0,
  421.          ],              
  422.      
  423.          
  424.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  425.   # * WHEN ENEMY TAKES HEAVY DAMAGE FROM ACTOR ATTACK
  426.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  427.   }; HEAVY_DAMAGE = { # <= Do Not Touch This Line
  428.  
  429.     # Percentage of Health that must be lost from an individual attack for these
  430.     # to be played
  431.     :ratio => 50 ,
  432.  
  433.     # Blubbschleim
  434.     2 => [
  435.            "Slime_Damage", 80, 100, 0,
  436.          ],
  437.     # Kogelschleim
  438.     3 => [
  439.            "Slime_Damage", 80, 100, 0,
  440.          ],
  441.  
  442.     # Flederratte
  443.     4 => [
  444.            "Bat_Damage", 100, 100, 0,
  445.          ],
  446.  
  447.     # Giftige Hornisse
  448.     5 => [
  449.            "Hornet_Damage", 90, 100, 0,
  450.          ],
  451.  
  452.     # Tarantula
  453.     6 => [
  454.            "Spider_Damage", 100, 100, 0,
  455.          ],
  456.  
  457.     # Skelettkrieger
  458.     9 => [
  459.            "Monster9", 80, 100, 0,
  460.          ],
  461.  
  462.     # Elfengeist
  463.     11 => [
  464.            "Ghost_Damage", 60, 100, 0,
  465.          ],
  466.  
  467.     # Bandit
  468.     12 => [
  469.            "Bandit_Damage", 80, 90, 0,
  470.          ],
  471.  
  472.     # Goblin
  473.     13 => [
  474.            "Goblin_Damage", 80, 100, 0,
  475.          ],
  476.  
  477.     # Bergwolf
  478.     14 => [
  479.            "Wolf_Damage", 65, 100, 0,
  480.          ],
  481.  
  482.     # Bergadler
  483.     15 => [
  484.            "Eagle_Damage", 70, 100, 0,
  485.          ],
  486.  
  487.     # Corvo
  488.     16 => [
  489.            "HIT! 3", 70, 85, 0,
  490.          ],
  491.  
  492.     # Mörderkrabbe
  493.     17 => [
  494.            "Crab_Damage", 100, 100, 0,          
  495.          ],
  496.      
  497.     # Flugfish
  498.     18 => [
  499.            "Fish_Damage", 80, 100, 0,          
  500.          ],
  501.  
  502.     # Bandit
  503.     19 => [
  504.            "Bandit_Damage", 80, 90, 0,
  505.          ],
  506.      
  507.     # Goliath
  508.     21 => [
  509.            "Ungh1", 85, 90, 0,
  510.          ],
  511.  
  512.     # Blutsauger
  513.     22 => [
  514.            "Bat_Damage", 100, 100, 0,
  515.          ],
  516.  
  517.     # Knochenkrieger
  518.     23 => [
  519.            "Monster9", 80, 100, 0,
  520.          ],              
  521.          
  522.          
  523.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  524.   # * WHEN ENEMY TAKES MASSIVE DAMAGE FROM ACTOR ATTACK
  525.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  526.   }; MASSIVE_DAMAGE = { # <= Do Not Touch This Line
  527.  
  528.     # Percentage of Health that must be lost from an individual attack for these
  529.     # to be played
  530.     :ratio => 65 ,
  531.  
  532.  
  533.     # Blubbschleim
  534.     2 => [
  535.            "Slime_Damage", 80, 100, 0,
  536.          ],
  537.     # Kogelschleim
  538.     3 => [
  539.            "Slime_Damage", 80, 100, 0,
  540.          ],
  541.  
  542.     # Flederratte
  543.     4 => [
  544.            "Bat_Damage", 100, 100, 0,
  545.          ],
  546.  
  547.     # Giftige Hornisse
  548.     5 => [
  549.            "Hornet_Damage", 90, 100, 0,
  550.          ],
  551.  
  552.     # Tarantula
  553.     6 => [
  554.            "Spider_Damage", 100, 100, 0,
  555.          ],
  556.  
  557.     # Skelettkrieger
  558.     9 => [
  559.            "Monster9", 80, 100, 0,
  560.          ],
  561.  
  562.     # Elfengeist
  563.     11 => [
  564.            "Ghost_Damage", 60, 100, 0,
  565.          ],
  566.  
  567.     # Bandit
  568.     12 => [
  569.            "Bandit_Damage", 80, 90, 0,
  570.          ],
  571.  
  572.     # Goblin
  573.     13 => [
  574.            "Goblin_Damage", 80, 100, 0,
  575.          ],
  576.  
  577.     # Bergwolf
  578.     14 => [
  579.            "Wolf_Damage", 65, 100, 0,
  580.          ],
  581.  
  582.     # Bergadler
  583.     15 => [
  584.            "Eagle_Damage", 70, 100, 0,
  585.          ],
  586.  
  587.     # Corvo
  588.     16 => [
  589.            "HIT! 3", 70, 85, 0,
  590.          ],
  591.  
  592.      # Mörderkrabbe
  593.     17 => [
  594.            "Crab_Damage", 100, 100, 0,          
  595.          ],
  596.      
  597.     # Flugfish
  598.     18 => [
  599.            "Fish_Damage", 80, 100, 0,          
  600.          ],
  601.  
  602.     # Bandit
  603.     19 => [
  604.            "Bandit_Damage", 80, 90, 0,
  605.          ],
  606.      
  607.     # Goliath
  608.     21 => [
  609.            "uagh2", 85, 90, 0,
  610.          ],
  611.  
  612.     # Blutsauger
  613.     22 => [
  614.            "Bat_Damage", 100, 100, 0,
  615.          ],
  616.  
  617.     # Knochenkrieger
  618.     23 => [
  619.            "Monster9", 80, 100, 0,
  620.          ],      
  621.  
  622.          
  623.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  624.   # * WHEN ENEMY TAKES DAMAGE, BUT NOTHING THEY CAN'T SHRUG OFF
  625.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  626.   }; DEFAULT_DAMAGE = { # <= Do Not Touch This Line
  627.  
  628.  
  629.     # Blubbschleim
  630.     2 => [
  631.            "Slime_Damage", 90, 100, 0,
  632.          ],
  633.     # Kogelschleim
  634.     3 => [
  635.            "Slime_Damage", 90, 100, 0,
  636.          ],
  637.  
  638.     # Flederratte
  639.     4 => [
  640.            "Bat_Damage", 100, 100, 0,
  641.          ],
  642.  
  643.     # Giftige Hornisse
  644.     5 => [
  645.            "Hornet_Damage", 90, 100, 0,
  646.          ],
  647.  
  648.     # Tarantula
  649.     6 => [
  650.            "Spider_Damage", 100, 100, 0,
  651.          ],
  652.  
  653.     # Skelettkrieger
  654.     9 => [
  655.            "Monster9", 80, 100, 0,
  656.          ],
  657.  
  658.     # Elfengeist
  659.     11 => [
  660.            "Ghost_Damage", 60, 100, 0,
  661.          ],
  662.  
  663.     # Bandit
  664.     12 => [
  665.            "Bandit_Damage", 80, 90, 0,
  666.          ],
  667.  
  668.     # Goblin
  669.     13 => [
  670.            "Goblin_Damage", 80, 100, 0,
  671.          ],
  672.  
  673.     # Bergwolf
  674.     14 => [
  675.            "Wolf_Damage", 65, 100, 0,
  676.          ],
  677.  
  678.     # Bergadler
  679.     15 => [
  680.            "Eagle_Damage", 70, 100, 0,
  681.          ],
  682.  
  683.     # Corvo
  684.     16 => [
  685.            "HIT! 1", 70, 85, 0,          
  686.          ],
  687.      
  688.     # Mörderkrabbe
  689.     17 => [
  690.            "Crab_Damage", 100, 100, 0,          
  691.          ],
  692.      
  693.     # Flugfish
  694.     18 => [
  695.            "Fish_Damage", 80, 100, 0,          
  696.          ],
  697.  
  698.     # Bandit
  699.     19 => [
  700.            "Bandit_Damage", 80, 90, 0,
  701.          ],
  702.      
  703.     # Goliath
  704.     21 => [
  705.            "Mhh1", 85, 95, 0,
  706.          ],
  707.  
  708.     # Blutsauger
  709.     22 => [
  710.            "Bat_Damage", 100, 100, 0,
  711.          ],
  712.  
  713.     # Knochenkrieger
  714.     23 => [
  715.            "Monster9", 80, 100, 0,
  716.          ],      
  717.          
  718.  
  719.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  720.   # * WHEN ENEMY HAS THEIR HP OR MP RESTORED, EITHER BY ITEMS OR MAGIC
  721.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  722.   }; HP_MP_RESTORE = { # <= Do Not Touch This Line
  723.  
  724.     # Allowed to speak if this enemy healed itself?
  725.     :self_heal_speak  =>  true ,
  726.    
  727.    
  728.     # What Enemy Twenty-Nine (Default: Demon King) Will Say When HP/MP is Restored
  729.     16 =>[
  730. #          "HP_MP Restored1", 80, 100, 0,
  731.          ],
  732.  
  733.  
  734.          
  735.          
  736.          
  737.   #=============================================================================
  738.   #    Death & Revive Voices
  739.   #-----------------------------------------------------------------------------
  740.   #   These voices are heard when an enemy is defeated in battle
  741.   #=============================================================================
  742.  
  743.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  744.   # * WHEN ACTOR HAS JUST BEEN KO'D IN BATTLE
  745.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  746.   # Voices to play when an actor dies
  747.   }; DEATH_VOICE = { # <= Do Not Touch This Line
  748.  
  749.     # Blubbschleim
  750.     2 => [
  751.            "Slime_Emerge", 100, 100, 0,
  752.          ],
  753.     # Kogelschleim
  754.     3 => [
  755.            "Slime_Emerge", 100, 100, 0,
  756.          ],
  757.  
  758.     # Flederratte
  759.     4 => [
  760.            "Bat_Death", 100, 100, 0,
  761.          ],
  762.  
  763.     # Giftige Hornisse
  764.     5 => [
  765.            "Hornet_Death", 90, 130, 0,
  766.          ],
  767.  
  768.     # Tarantula
  769.     6 => [
  770.            "Spider_Death", 90, 130, 0,
  771.          ],
  772.  
  773.     # Skelettkrieger
  774.     9 => [
  775.            "Monster2", 70, 100, 0,
  776.          ],
  777.  
  778.     # Elfengeist
  779.     11 => [
  780.            "Ghost_Death", 90, 120, 0,
  781.          ],
  782.  
  783.     # Bandit
  784.     12 => [
  785.            "Bandit_Death", 80, 80, 0,
  786.          ],
  787.  
  788.     # Goblin
  789.     13 => [
  790.            "Goblin_Death", 70, 100, 0,
  791.          ],
  792.  
  793.     # Bergwolf
  794.     14 => [
  795.            "Wolf_Death", 70, 100, 0,
  796.          ],
  797.  
  798.     # Bergadler
  799.     15 => [
  800.            "Eagle_Death", 80, 100, 0,
  801.          ],
  802.  
  803.     # Corvo
  804.     16 => [
  805.            "HIT! 4", 70, 85, 0,          
  806.          ],
  807.      
  808.     # Mörderkrabbe
  809.     17 => [
  810.            "Crab_Death", 100, 100, 0,          
  811.          ],
  812.      
  813.     # Flugfish
  814.     18 => [
  815.            "Fish_Death", 80, 100, 0,          
  816.          ],
  817.  
  818.     # Bandit
  819.     19 => [
  820.            "Bandit_Death", 80, 80, 0,
  821.          ],
  822.      
  823.     # Goliath
  824.     21 => [
  825.            "uagh10", 85, 90, 0,
  826.          ],
  827.  
  828.     # Blutsauger
  829.     22 => [
  830.            "Bat_Death", 100, 100, 0,
  831.          ],
  832.  
  833.     # Knochenkrieger
  834.     23 => [
  835.            "Monster2", 70, 100, 0,
  836.          ],                                                    
  837.          
  838.          
  839. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  840. #                                                        -=
  841. };    # End Of Editable Region           ////            ==
  842. #                                                        =-
  843. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.   CURRENT_VERSION = 1.0
  851.   ACTOR_VOICES_IMPORTED = !$diamondandplatinum3_scripts[:BattleVoices].nil?
  852.   #------------------------------------------------------------------------
  853.   # * New Method: Check Version Compatibility
  854.   #------------------------------------------------------------------------
  855.   def self.check_version_compatibility( version )
  856.     return :outdated_version if version > CURRENT_VERSION
  857.     return :outdated_patch   if version < CURRENT_VERSION
  858.     return :compatible
  859.   end
  860.   #------------------------------------------------------------------------
  861.   # * New Method: Play Voice
  862.   #------------------------------------------------------------------------
  863.   def self.play_voice( voice_hash, enemy_troopmember_index )
  864.     return true if !allowed_to_speak?(enemy_troopmember_index)
  865.    
  866.     # Get Voice Array
  867.     if voice_hash.is_a?(Hash)
  868.       voice_array = voice_hash[$game_troop.members[enemy_troopmember_index].enemy_id]
  869.     elsif voice_hash.is_a?(Array)
  870.       voice_array = voice_hash
  871.     end
  872.    
  873.     # If voice_array is not empty
  874.     unless voice_array.nil? || voice_array.empty?
  875.       index = rand(voice_array.size / 4) * 4
  876.       if voice_array[index].is_a?(String) && voice_array[index + 1].is_a?(Integer) && voice_array[index + 2].is_a?(Integer)
  877.        
  878.         # Get the Enemy Folder Name
  879.         folder_name = $game_troop.members[enemy_troopmember_index].enemy.name
  880.        
  881.         # Get Path to File
  882.         pathtofile = "/" + FOLDER_DIRECTORY_NAME + "/" + folder_name + "/" + voice_array[index]
  883.        
  884.         # Play Voice
  885.         RPG::SE.new(pathtofile, voice_array[index + 1], voice_array[index + 2]).play
  886.        
  887.         # Wait if necessary
  888.         SceneManager.scene.wait(voice_array[index + 3]) unless !voice_array[index + 3].is_a?(Integer) || !SceneManager.scene_is?(Scene_Battle)
  889.         return true
  890.       end
  891.     end
  892.     # We return true and false to determine whether a voice play was successful or not
  893.     return false
  894.   end
  895.   #------------------------------------------------------------------------
  896.   # * New Method: Allowed to Speak?
  897.   #------------------------------------------------------------------------
  898.   def self.allowed_to_speak?(enemy_troopmember_index)
  899.     return false if check_if_enemy_muted(enemy_troopmember_index)
  900.     return rand(100) < VOICE_FREQUENCY
  901.   end
  902.   #------------------------------------------------------------------------
  903.   # * New Method: Check For Muted Enemy
  904.   #------------------------------------------------------------------------
  905.   def self.check_if_enemy_muted(enemy_troopmember_index)
  906.     return true if $game_switches[EVENT_SWITCH_ID]
  907.     return $game_troop.members[enemy_troopmember_index].states.any? { |state| SILENCE_STATES.include?(state.id) }
  908.   end
  909.   #------------------------------------------------------------------------
  910.   # * New Method: Play "I Missed Enemy" Voice
  911.   #------------------------------------------------------------------------
  912.   def self.play_missed_enemies_voice(enemy_troopmember_index)
  913.     return play_voice(MISSED_ACTOR_TARGET, enemy_troopmember_index)
  914.   end
  915.   #------------------------------------------------------------------------
  916.   # * New Method: Play "I Evaded Enemy" Voice
  917.   #------------------------------------------------------------------------
  918.   def self.play_evaded_enemy_voice(enemy_troopmember_index)
  919.     return play_voice(DODGED_ACTOR_ATTACK, enemy_troopmember_index)
  920.   end
  921.   #------------------------------------------------------------------------
  922.   # * New Method: Play "Normal Attack" Voice
  923.   #------------------------------------------------------------------------
  924.   def self.play_normal_attack_voice(enemy_troopmember_index)
  925.     return play_voice(ENEMY_ATTACKING, enemy_troopmember_index)
  926.   end
  927.   #------------------------------------------------------------------------
  928.   # * New Method: Play "Using Skill" Voice
  929.   #------------------------------------------------------------------------
  930.   def self.play_skill_voice(enemy_troopmember_index, skill_id)
  931.     voice = []
  932.     enemy_id = $game_troop.members[enemy_troopmember_index].enemy_id
  933.     $data_skills[skill_id].note.scan(/~EnemyVoice:\s*#{enemy_id.to_s}\,*\s*\"(.+?)\"\,*\s*(\d*)\,*\s*(\d*)\,*\s*(\d*)/im).collect{ |voice_info|
  934.       unless voice_info.empty?
  935.         voice.push(voice_info[0])
  936.         voice.push(voice_info[1] != "" ? voice_info[1].to_i : 80)
  937.         voice.push(voice_info[2] != "" ? voice_info[2].to_i : 100)
  938.         voice.push(voice_info[3] != "" ? voice_info[3].to_i : 0)
  939.       end
  940.     }
  941.    
  942.     # Modify Skill Voice to Generic Skill Voice if there is no specific voice for this Skill
  943.     if voice.empty?
  944.       return true if SKILLS_NOT_TO_PLAY_VOICE_FOR.include?(skill_id)
  945.       voice = USING_SKILLS
  946.     end
  947.    
  948.     return play_voice( voice, enemy_troopmember_index )
  949.   end
  950.   #------------------------------------------------------------------------
  951.   # * New Method: Play "Death" Voice
  952.   #------------------------------------------------------------------------
  953.   def self.play_death_voice(enemy_troopmember_index)
  954.     return play_voice(DEATH_VOICE, enemy_troopmember_index)
  955.   end
  956.   #------------------------------------------------------------------------
  957.   # * New Method: Play "Restored HP/MP" Voice
  958.   #------------------------------------------------------------------------
  959.   def self.play_healed_voice(enemy_troopmember_index)
  960.     return play_voice(HP_MP_RESTORE, enemy_troopmember_index)
  961.   end
  962.   #------------------------------------------------------------------------
  963.   # * New Method: Play "Default Damage" Voice
  964.   #------------------------------------------------------------------------
  965.   def self.play_default_damage_voice(enemy_troopmember_index)
  966.     return play_voice(DEFAULT_DAMAGE, enemy_troopmember_index)
  967.   end
  968.   #------------------------------------------------------------------------
  969.   # * New Method: Play "Little Damage" Voice
  970.   #------------------------------------------------------------------------
  971.   def self.play_little_damage_voice(enemy_troopmember_index)
  972.     return play_voice(LITTLE_DAMAGE, enemy_troopmember_index)
  973.   end
  974.   #------------------------------------------------------------------------
  975.   # * New Method: Play "Significant Damage" Voice
  976.   #------------------------------------------------------------------------
  977.   def self.play_significant_damage_voice(enemy_troopmember_index)
  978.     return play_voice(SIGNIFICANT_DAMAGE, enemy_troopmember_index)
  979.   end
  980.   #------------------------------------------------------------------------
  981.   # * New Method: Play "Heavy Damage" Voice
  982.   #------------------------------------------------------------------------
  983.   def self.play_heavy_damage_voice(enemy_troopmember_index)
  984.     return play_voice(HEAVY_DAMAGE, enemy_troopmember_index)
  985.   end
  986.   #------------------------------------------------------------------------
  987.   # * New Method: Play "Massive Damage" Voice
  988.   #------------------------------------------------------------------------
  989.   def self.play_massive_damage_voice(enemy_troopmember_index)
  990.     return play_voice(MASSIVE_DAMAGE, enemy_troopmember_index)
  991.   end
  992.  
  993.  
  994. end # BattleVoices Module
  995. end # DiamondandPlatinum3 Module
  996.  
  997.  
  998.  
  999.  
  1000. #==============================================================================
  1001. # ** Scene_Battle
  1002. #------------------------------------------------------------------------------
  1003. #  This class performs battle screen processing.
  1004. #==============================================================================
  1005.  
  1006. class Scene_Battle < Scene_Base
  1007.   #--------------------------------------------------------------------------
  1008.   # * Alias Listings
  1009.   #--------------------------------------------------------------------------
  1010.   alias dp3_ebv_scenebattle_applyitemeffects_1s098yu9j    apply_item_effects
  1011.  
  1012.   #--------------------------------------------------------------------------
  1013.   # * Aliased Method: Apply Skill/Item Effect
  1014.   #--------------------------------------------------------------------------
  1015.   def apply_item_effects(*args)
  1016.     # Call Original Method
  1017.     dp3_ebv_scenebattle_applyitemeffects_1s098yu9j(*args)
  1018.    
  1019.     # If Result was a Miss, and an enemy was not targeting an enemy
  1020.     if !args[0].result.hit?
  1021.       if !args[0].enemy? && @subject.enemy?
  1022.         DiamondandPlatinum3::EnemyBattleVoices::play_missed_enemies_voice(@subject.index)
  1023.       elsif args[0].enemy? && !@subject.enemy?
  1024.         DiamondandPlatinum3::EnemyBattleVoices::play_evaded_enemy_voice(args[0].index)
  1025.       end
  1026.     end
  1027.   end
  1028. end # Class
  1029.  
  1030.  
  1031.  
  1032. #==============================================================================
  1033. # ** Game_Enemy
  1034. #------------------------------------------------------------------------------
  1035. #  This class handles enemies. It used within the Game_Troop class
  1036. # ($game_troop).
  1037. #==============================================================================
  1038.  
  1039. class Game_Enemy < Game_Battler
  1040.   #--------------------------------------------------------------------------
  1041.   # * Alias Listings
  1042.   #--------------------------------------------------------------------------
  1043.   alias dp3_gameenemy_die_1s098yu9j                     die
  1044.   alias dp3_gameenemy_useitem_1s098yu9j                 use_item
  1045.   alias dp3_gameenemy_executedamage_1s098yu9j           execute_damage
  1046.   alias dp3_gameenemy_ondamage_1s098yu9j                on_damage
  1047.  
  1048.   #--------------------------------------------------------------------------
  1049.   # * Aliased Method: Use Skill/Item
  1050.   #--------------------------------------------------------------------------
  1051.   def use_item(*args)
  1052.     if args[0].is_a?(RPG::Skill)
  1053.       if args[0].id == attack_skill_id
  1054.         DiamondandPlatinum3::EnemyBattleVoices::play_normal_attack_voice(@index)
  1055.       else
  1056.         DiamondandPlatinum3::EnemyBattleVoices::play_skill_voice(@index, args[0].id)
  1057.       end
  1058.     end
  1059.    
  1060.     # Call Original Method
  1061.     dp3_gameenemy_useitem_1s098yu9j(*args)
  1062.   end
  1063.  
  1064.   #--------------------------------------------------------------------------
  1065.   # * Aliased Method: Knock Out
  1066.   #--------------------------------------------------------------------------
  1067.   def die( *args )
  1068.     DiamondandPlatinum3::EnemyBattleVoices::play_death_voice(@index) if !$game_temp.battle_end
  1069.    
  1070.     # Call Original Method
  1071.     dp3_gameenemy_die_1s098yu9j( *args )
  1072.   end
  1073.  
  1074.   #--------------------------------------------------------------------------
  1075.   # * Aliased Method: Execute Damage
  1076.   #--------------------------------------------------------------------------
  1077.   def execute_damage(*args)
  1078.     current_hp = self.hp
  1079.     current_mp = self.mp
  1080.     dp3_gameenemy_executedamage_1s098yu9j(*args)
  1081.    
  1082.    
  1083.     # Play Healed Voice if Healed and Allowed
  1084.     if current_hp < self.hp || current_mp < self.mp
  1085.       if args[0].enemy?
  1086.         if args[0] == self
  1087.           if DiamondandPlatinum3::EnemyBattleVoices::HP_MP_RESTORE[:self_heal_speak]
  1088.             DiamondandPlatinum3::EnemyBattleVoices::play_healed_voice(@index)
  1089.           end
  1090.         else
  1091.           DiamondandPlatinum3::EnemyBattleVoices::play_healed_voice(@index)
  1092.         end
  1093.       end
  1094.     end
  1095.   end
  1096.  
  1097.   #--------------------------------------------------------------------------
  1098.   # * Aliased Method: Processing When Suffering Damage
  1099.   #--------------------------------------------------------------------------
  1100.   def on_damage(*args)
  1101.     dp3_play_appropriate_enemy_damage_voice( args[0] ) if args[0] > 0 && (self.hp - args[0]) > 0
  1102.    
  1103.     # Call Original Method
  1104.     dp3_gameenemy_ondamage_1s098yu9j( *args )
  1105.   end
  1106.  
  1107.   #--------------------------------------------------------------------------
  1108.   # * New Method: Get Enemy Damage Voice Array
  1109.   #--------------------------------------------------------------------------
  1110.   def dp3_play_appropriate_enemy_damage_voice( value )
  1111.     #~~~~~ Play Massive Damage Voice ~~~~~#
  1112.     if value > self.mhp * (DiamondandPlatinum3::EnemyBattleVoices::MASSIVE_DAMAGE[:ratio] * 0.01)
  1113.       DiamondandPlatinum3::EnemyBattleVoices::play_massive_damage_voice(@index)
  1114.     #~~~~~ Play Heavy Damage Voice ~~~~~#
  1115.     elsif value > self.mhp * (DiamondandPlatinum3::EnemyBattleVoices::HEAVY_DAMAGE[:ratio] * 0.01)
  1116.       DiamondandPlatinum3::EnemyBattleVoices::play_heavy_damage_voice(@index)
  1117.     #~~~~~ Play Significant Damage Voice ~~~~~#
  1118.     elsif value > self.mhp * (DiamondandPlatinum3::EnemyBattleVoices::SIGNIFICANT_DAMAGE[:ratio] * 0.01)
  1119.       DiamondandPlatinum3::EnemyBattleVoices::play_significant_damage_voice(@index)
  1120.     #~~~~~ Play Little Damage Voice ~~~~~#
  1121.     elsif value > self.mhp * (DiamondandPlatinum3::EnemyBattleVoices::LITTLE_DAMAGE[:ratio] * 0.01)
  1122.       DiamondandPlatinum3::EnemyBattleVoices::play_little_damage_voice(@index)
  1123.     #~~~~~ Play Pitance Damage Voice ~~~~~#
  1124.     else
  1125.       DiamondandPlatinum3::EnemyBattleVoices::play_default_damage_voice(@index)
  1126.     end
  1127.   end
  1128. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement