Advertisement
estriole

EST - RING SYSTEM

Jun 12th, 2014
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 45.74 KB | None | 0 0
  1. =begin
  2.  ■ Information      ╒═════════════════════════════════════════════════════════╛
  3. #==============================================================================
  4. # EST - RING SYSTEM
  5. #==============================================================================
  6. # Author  : Estriole
  7. # Version : 1.3
  8. #==============================================================================
  9.  
  10.   #==============================================================================
  11.   # Boneless R.I.B.S. [Ring Only] VX
  12.   #==============================================================================
  13.   # Author  : OriginalWij
  14.   # Version : 1.0
  15.   #==============================================================================
  16.  
  17.     #========================================================================#
  18.     # Draw Line VX                                                           #
  19.     #========================================================================#
  20.     # Author  : modern algebra                                               #
  21.     # Version : 1.0                                                          #
  22.     #========================================================================#    
  23.      
  24.  ■ Changelog        ╒═════════════════════════════════════════════════════════╛
  25.  v1.0 2014.06.12     >     Initial Release
  26.  v1.1 2014.06.12     >     fix the logic for [good_count, crit_count] setting.
  27.                            compatibility patch to THEO battle system
  28.  v1.2 2014.06.13        MAJOR UPDATE
  29.                      >     change how the ring drawn so you can use the transparent
  30.                            color for wedge without seeing behind the ring.
  31.                      >     add configuration for ring z value
  32.                      >     dispose the ring image correctly instead hiding it only
  33.                      >     Bugfix enemy cannot damage the actor
  34.                      >     change setting symbol :barspeed to :bar_speed so it match :add_wedge,etc
  35.                      >     compatibility with Theo SBS
  36.                            split the "ring setting grab" and "ring call". then save it
  37.                            so we can use it in the middle of attack (if using Theo SBS)
  38.                      >     remove the <anim_first> notetags for now. (might add it later)
  39.                      >     add ring setting replace and ring setting mod feature
  40.                            actor / class / equipment / states can affect ring settings
  41.                            replace can only used once (priority: states > equip > class > actor)
  42.                            while mod stacks.
  43.                      >     add $imported["EST - RING SYSTEM"] variable for other scripter to
  44.                            make compatibility patch.
  45.                      >     change the Graphic.update and Input.update to update_basic.
  46.                            so the scene not freeze. more compatible with victor animated battle
  47.                            and Theo SBS now.
  48.  v1.3 2014.06.14     >     add $game_system.ring_active to check the ring currently running or not.
  49.                      >     add method to reset ring miss/crit/null evade.
  50.  
  51.                            
  52.  ■ License        ╒═════════════════════════════════════════════════════════╛
  53.  Free to use in all project (except the one containing pornography)
  54.  as long as i credited (ESTRIOLE).
  55.  
  56.  This script written based (also take some code) from Boneless RIBS (Ring Only) VX
  57.  script written by OriginalWij (which have some draw line code from modern algebra)
  58.  so you need to credit both (OriginalWij and modern algebra) too if you want to use
  59.  this script
  60.  
  61.  ■ Introduction     ╒═════════════════════════════════════════════════════════╛
  62.     This script create ring system where you need to hit the ring in the right
  63.  spot to achieve certain result you configured. you can use this system for
  64.  eventing OR for battle.
  65.  
  66.  This script written by request of Lionheart_84 from www.rpgmakervxace.net
  67.  
  68.  ■ Requirement     ╒═════════════════════════════════════════════════════════╛
  69.    Just RPG MAKER VX ACE program :D
  70.  
  71.  ■ Compatibility     ╒═════════════════════════════════════════════════════════╛
  72.  battle system that i already tested:
  73.  > Default Battle System
  74.  > Yanfly Ace Battle Engine
  75.  > MOGHUNTER battle system
  76.  > Victor Animated battle system
  77.  > Theo Sideview Battle System (ring repeat feature not compatible but INSTEAD
  78.                                 you can change the whole skill sequence based
  79.                                 on ring result !!)
  80.                                  
  81.  tell me if there's other battle system compatible or not so i can add it to
  82.  this list. :D.
  83.    
  84.  ■ How to Use     ╒═════════════════════════════════════════════════════════╛  
  85.  ================================================================================
  86.   Event Script Commands:
  87.  ================================================================================
  88.   Place any of the following script commands in an event 'script' box:
  89.   [Event Commands : Page 3 : Bottom-Right-Most Button]
  90.  ================================================================================
  91.  1)  To call the ring on the map:
  92.  
  93.        do_ring(x, y, wedge, degrees, times)
  94.        
  95.     x : X coordinate of the Ring (upper left corner)
  96.     y : Y coordinate of the Ring (upper left corner)
  97.     wedge : wedge-set (wedge size & placement array) [start1, stop1, start2, stop2, ...]
  98.     degrees : degrees to start the ring bar at (default = 0)
  99.     times : how many rotation before the ring end (default = 3)
  100.  
  101.   NOTE: The only real limit on the number of start/stop pairings in the wedge
  102.        is how many you can fit in 360°. [practical limit = 10]
  103.  
  104.   THE RESULT WILL BE SAVED IN VARIABLES YOU DEFINE IN THE MODULE BELOW !!!!!
  105.   so you can use that for eventing in conditional branch easily.
  106.  
  107.   RING_HIT_COUNT_VAR => variable you set here will save any hit (good or crit)
  108.   GOOD_COUNT_VAR => variable you set here will save the GOOD hit
  109.   CRIT_COUNT_VAR => variable you set here will save the CRIT hit
  110.   SCORE_COUNT_VAR => variable you set here will save the score (good hit = 1, crit hit = 2)
  111.        
  112.   NOTE2: GOOD hit mean you hit it in normal zone. CRIT hit mean you hit it in
  113.          stike zone.
  114.          
  115.   THE RESULT ALSO SAVED IN $game_system
  116.   (for example if you want to use it in Theo SBS :if sequence)
  117.   $game_system.ring_hit_count   => store value of any hit (good or crit)
  118.   $game_system.good_count       => store value of good hit
  119.   $game_system.crit_count       => store value of crit hit
  120.   $game_system.score_count      => store the score (good hit = 1, crit hit = 2)
  121.          
  122.  2)  To change the bar speed:
  123.        $game_system.bar_speed = new_bar_speed
  124.        
  125.  3)  To disable strike zones (for next ring call only) (as used in Shops)
  126.        $game_system.no_strike = true
  127.        
  128.  4)  To modify the size of strike size
  129.        $game_system.strike_size = value
  130.      the strike size here mean percentage from the wedge size that count as crit/strike
  131.        
  132.  ================================================================================
  133.   SKILL / ITEM Notetags:
  134.  ================================================================================
  135.  
  136.  1)  To make skill / item use ring system add this notetags:
  137.  
  138.     <use_ring>
  139.  
  140.  2)  You can customize each skill/item RING by adding this notetags:
  141.     <ring_setting>
  142.     :x => a,
  143.     :y => b,
  144.     :wedge => c,
  145.     :bar_speed => d,
  146.     :strike=> e,
  147.     :no_strike => f,
  148.     </ring_setting>
  149.    
  150.     a: coordinate x of the ring (number)
  151.     b: coordinate y of the ring (number)
  152.     c: array that will determine the wedge. format:
  153.        [start1, stop1, start2, stop2, ...]
  154.        for example: [10,50,70,120]
  155.        first wedge will be between 10 - 50 degree
  156.        second wedge will be between 70 - 120 degree
  157.     d: rotation speed of the bar
  158.     e: percentage of the strike zone based on wedge zone (1-99) (number)
  159.     f: true -> the ring will have no strike zone
  160.        false -> the ring will have strike zone (default: false)
  161.    
  162.     [everything optional]
  163.        
  164.     example notetags:
  165.     <ring_setting>
  166.     :x=> 10,
  167.     :y=> 10,
  168.     :wedge=>[10,80, 120,170],
  169.     :bar_speed=>4,
  170.     :strike=> 10,
  171.     </ring_setting>
  172.    
  173.     will put the ring at coordinate x:10 y:10. also have two wedge [10,80] and [120,170]
  174.     and have the rotation speed of 4. also the strike zone will be 10% of wedge zone.
  175.  
  176.   WARNING : DO NOT FORGET THE COMA AFTER EACH SETTING ENTRY!!!
  177.  
  178.  3)  You can have the skill MISS when the number of good/crit hit below certain value:
  179.     IGNORE skill setting in database that make you ALWAYS HIT
  180.    
  181.     <ring_miss: x>
  182.    
  183.     x: number of hits MINIMUM so the skill WON'T miss
  184.    
  185.     example notetags:
  186.     <ring_miss: 1>   => you have to hit at least 1 good OR crit hit.
  187.  
  188.  4)  You can have the skill 100% CRIT when the number of CRIT hit the
  189.     same or above certain value
  190.    
  191.     <ring_crit: x>
  192.    
  193.     x: number of CRIT hits REQUIRED so the skill 100% CRITICAL.
  194.    
  195.     example notetags:
  196.     <ring_crit: 2>   => you have to hit at least 2 CRIT hit to 100% critical.
  197.    
  198.  5)  You can have the skill/item NULLIFY TARGET EVADE (mean the skill will ignore evade)
  199.     when the number of good OR crit hit same or above certain value
  200.     NOTE: you can still miss if your hit rate suck. but the enemy cannot evade.
  201.     if you want certain hit just set the skill to always hit in database.
  202.     don't worry. ring_miss notetags ignore that. so you can still miss.
  203.    
  204.     <ring_null_evade: x>
  205.    
  206.     x: number of good OR crit hit required to NULLIFY TARGET EVADE
  207.    
  208.     example notetags:
  209.     <ring_null_evade: 3> => you have to hit at least 3 (either good/crit) times
  210.  
  211.  6)  You can have the skill/item NULLIFY TARGET EVADE (mean the skill will ignore evade)
  212.     when the number of CRIT hit (ONLY) same or above certain value
  213.     NOTE: you can still miss if your hit rate suck. but the enemy cannot evade.
  214.     if you want certain hit just set the skill to always hit in database.
  215.     don't worry. ring_miss notetags ignore that. so you can still miss.
  216.    
  217.     <ring_crit_null_evade: x>
  218.    
  219.     x: number of good OR crit hit required to NULLIFY TARGET EVADE
  220.    
  221.     example notetags:
  222.     <ring_crit_null_evade: 1> => you have to hit at least 1 CRIT
  223.  
  224.  7)  You can modify how many times the skill REPEATS (like in database repeat times).
  225.     when you met certain requirement:
  226.      
  227.     <ring_repeats>
  228.     key => value,
  229.     </ring_repeats>
  230.  
  231.     key => you have two format that you can use:
  232.            array system -> [good_hit, crit_hit] ex: [1,1]
  233.            score system -> good hit = 1, crit hit = 2 ex: 3
  234.            
  235.            array system setting have HIGHER priority than score system.
  236.            so if the both condition met it will use array system setting.
  237.            
  238.     value => number of hits
  239.    
  240.     example notetags:
  241.     <ring_repeats>
  242.     [1,0] => 2,
  243.     [1,1] => 3,
  244.     [0,2] => 10,
  245.     3 => 20,
  246.     </ring_repeats>
  247.    
  248.     means:
  249.     1 good hit only => 2 hits
  250.     1 good hit + 1 crit hit => 3 hits
  251.     2 crit hits => 10 hits
  252.     3 score => 20 hits
  253.    
  254.     (assuming you have 3 set of wedge)
  255.     as you can see... there's many way of achieving 3 score.
  256.     example: 1 good + 1 crit OR 3 good  
  257.     so in case above. you will only get 20 repeats ONLY if you get 3 good.
  258.     since you have another setting for 1 good + 1 crit using array system.
  259.     it will prioritize it.
  260.  
  261.   WARNING : DO NOT FORGET THE COMA AFTER EACH SETTING ENTRY!!!
  262.   NOTE : putting 0 or negative value will make the skill weird.
  263.   just use ring_miss feature instead.
  264.   NOTE2 : this can BYPASS the database limit of 9 hits
  265.  
  266.  8) You can modify the damage formula for the skills based on the ring result.
  267.  
  268.  > first add this inside the DAMAGE FORMULA of the SKILL / ITEM:
  269.   (the capital word means you need to replace it with your own)
  270.   (the other text stay at it is. don't change it at all)
  271.  
  272.   a.ring(a,b,DEFAULT_FORMULA)
  273.  
  274.   DEFAULT_FORMULA => formula that will be use by the enemy or when there's
  275.                      no setting for the ring result.
  276.                      
  277.   example: a.ring(a,b,a.atk * 4 - b.def * 2)
  278.                      
  279.  > then add this notetags in the skill/item notes
  280.     <ring_result>
  281.     key => formulainstring,
  282.     </ring_result>
  283.     key => you have two format that you can use:
  284.            array system -> [good_hit, crit_hit] ex: [1,1]
  285.            score system -> good hit = 1, crit hit = 2 ex: 3
  286.            
  287.            array system setting have HIGHER priority than score system.
  288.            so if the both condition met it will use array system setting.
  289.            
  290.     formulainstring => your formula as string (inside "")
  291.     there's shortcut letter that you can use for the formula:
  292.     a = skill/item user
  293.     b = skill/item target
  294.     v = $game_variables
  295.     s = $game_switches
  296.     pt = $game_party
  297.     l = $game_party.leader  
  298.     f = default formula you enter inside DAMAGE FORMULA as explained above
  299.     id = current_action.item.id
  300.     sk = current skill/item (RPG::Skill or RPG::Item object)
  301.  
  302.     example notetags:
  303.     <ring_result>
  304.     [0,0] => "f/2",
  305.     [1,0] => "f",
  306.     [0,1] => "f + 1000",
  307.     [1,1] => "f*2 + 1000",
  308.     3 => "1000000",
  309.     </ring_result>    
  310.    
  311.     means:
  312.     when miss entirely => default formula / 2
  313.     1 good hit only => default formula
  314.     1 crit hit only => default formula + 1000 damage
  315.     1 good hit + 1 crit hit => default formula x 2 + 1000 damage
  316.     3 score => 1000000 damage
  317.    
  318.     (assuming you have 3 set of wedge)
  319.     as you can see... there's many way of achieving 3 score.
  320.     example: 1 good + 1 crit OR 3 good  
  321.     so in case above. you will only get 1000000 damage ONLY if you get 3 good.
  322.     since you have another setting for 1 good + 1 crit using array system.
  323.     it will prioritize it.
  324.  
  325.   WARNING : DO NOT FORGET THE COMA AFTER EACH SETTING ENTRY!!!
  326.    
  327.  ================================================================================
  328.     v 1.2 MAJOR UPDATE
  329.    
  330.     Ring Setting Replace and Ring Setting Mod feature
  331.    
  332.  ===============================================================================  
  333.     WARNING: this feature is a harder to use. need a little bit scripting
  334.     understanding like knowledge about HASH format.
  335.     this feature also consume quite space on the NOTETAGS. :D. sorry.
  336.  ===============================================================================
  337.  
  338.     you can add notetags in: actor, class, equipment, state and it can affect
  339.     the ring.
  340.    
  341.   1) Ring replace feature. this will REPLACE the ring setting in the skill notetags.
  342.   ONLY one change can be done (unfortunately). if multiple changes done. it will use this concept:
  343.  
  344.   state > equipment > class > actor
  345.  
  346.   the latest state would take more priority than the earlier state
  347.   the lower equipment would take more priority than the upper equipment
  348.  
  349.   put this notetags:
  350.  
  351.   <ring_setting_replace>
  352.   key => hash,
  353.   </ring_setting_replace>
  354.    
  355.   key: [:skill]  -> means this affect ALL skills
  356.        [:item]   -> means this affect ALL items
  357.        [:skill,id] -> change id to any number and it only affect skill with that id
  358.        [:item,id] -> change id to any number and it only affect skill with that id
  359.   hash: this hash format like the ring_setting notetags above:
  360.         {
  361.         :x => a,
  362.         :y => b,
  363.         :wedge => c,
  364.         :bar_speed => d,
  365.         :strike=> e,
  366.         :no_strike => f,
  367.         },
  368.     a: coordinate x of the ring (number)
  369.     b: coordinate y of the ring (number)
  370.     c: array that will determine the wedge. format:
  371.        [start1, stop1, start2, stop2, ...]
  372.        for example: [10,50,70,120]
  373.        first wedge will be between 10 - 50 degree
  374.        second wedge will be between 70 - 120 degree
  375.     d: rotation speed of the bar
  376.     e: percentage of the strike zone based on wedge zone (1-99) (number)
  377.     f: true -> the ring will have no strike zone
  378.        false -> the ring will have strike zone (default: false)
  379.    
  380.   example usage:    
  381.   <ring_setting_replace>
  382.   [:skill] => {
  383.   :x => 10,
  384.   :y => 10,
  385.   :wedge => [10,50,70,120,150,200],
  386.   :bar_speed => 4,
  387.   },
  388.   </ring_setting_replace>
  389.   will replace ALL skill ring setting to this settings:
  390.   x = 10, y = 10, wedge = [10,50,70,120,150,200] and bar speed of 4
  391.  
  392.   another example:
  393.   <ring_setting_replace>
  394.   [:skill,1] => {
  395.   :x => 10,
  396.   :y => 10,
  397.   :wedge => [10,50,70,120,150,200],
  398.   :bar_speed => 4,
  399.   },
  400.   [:skill,2] => {
  401.   :x => 10,
  402.   :y => 10,
  403.   :wedge => [10,50,70,120,150,200],
  404.   :bar_speed => 4,
  405.   },
  406.   </ring_setting_replace>
  407.   the same as above but it will ONLY change ring setting for SKILL 1 and SKILL 2
  408.   (you can have different changes for the skill 1 and 2 if you want)
  409.  
  410.   WARNING: DO NOT FORGET THE COMA. you need to understand how hash works !!
  411.  
  412.   IDEA OF IMPLEMENTATION:
  413.   > you can put the ring setting replace notetags for each actor.
  414.   and each actor will have DIFFERENT RINGS.
  415.   > put it in class... it's the same as above actually... not new idea...
  416.   > put it in equipment -> equip this and your skill will become
  417.                            super large wedges style ring.
  418.  
  419.   2) Ring Setting Mod feature. we can have equipment that alter the way
  420.   the ring setting works. THIS FEATURE STACKS. so you can have multiple mods
  421.   and it added up together (except no_strike setting. it will take the latest entry).
  422.  
  423.   RING SETTING MOD takes effect AFTER RING SETTING REPLACE.
  424.   so you can combine BOTH feature !!!!!
  425.  
  426.   to use this feature... add this note to actor / class / equip / state notetags:
  427.   <ring_setting_mod>
  428.   key => hash,
  429.   </ring_setting_mod>
  430.  
  431.   key: [:skill]  -> means this affect ALL skills
  432.        [:item]   -> means this affect ALL items
  433.        [:skill,id] -> change id to any number and it only affect skill with that id
  434.        [:item,id] -> change id to any number and it only affect skill with that id
  435.   hash: this hash format like the ring_setting notetags above:
  436.         {
  437.         :x => a,
  438.         :y => b,
  439.         :add_wedge => c,
  440.         :add_wedge => d,
  441.         :bar_speed => e,
  442.         :strike=> f,
  443.         :no_strike => g,
  444.         },
  445.     a: coordinate x OFFSET can be plus or minus number
  446.     b: coordinate y OFFSET can be plus or minus number
  447.     c: wedge set that to be add to the array (must be array of two. ex: [100, 130]
  448.        the first member must be smaller than second member. also you cannot
  449.        have one member already included in wedge set while the other not.
  450.        it can break the wedge. (wedge set must be set of two)
  451.     d: wedge set that to be removed to the array (any number here will remove from wedge set array)
  452.        be careful! it can break the wedge entirely. if used incorrectly.
  453.     e: rotation speed of the bar OFFSET. can be plus or minus number
  454.     f: percentage of the strike zone OFFSET. can be plus or minus number
  455.     g: true -> the ring will have no strike zone
  456.        false -> the ring will have strike zone (default: false)
  457.  
  458.   example usage:
  459.   since this mod the ring (not replacing it). you can only have 1 or 2 entry.
  460.   not like the replace feature above that require you to complete the setting.
  461.  
  462.   <ring_setting_mod>
  463.   [:skill] =>{
  464.   :bar_speed => -100,
  465.   },
  466.   </ring_setting_mod>
  467.   it will slow all skills bar speed by 100 points.
  468.  
  469.   another example:
  470.   <ring_setting_mod>
  471.   [:skill,1] =>{
  472.   :bar_speed => -100,
  473.   :x => 15,
  474.   :y => -15,
  475.   :add_wedge => [10,30],
  476.   },
  477.   </ring_setting_mod>
  478.   it will modify skill 1 only. reducing bar speed by 100 point
  479.   mod the x coordinate +15 point. mod the y coordinate -15 point.
  480.   add a new wedge set [10,30]  
  481.  
  482.   IDEA FOR IMPLEMENTATION:
  483.   you can create accessory that slow down the bar speed.
  484.   you can create cursed equipment that make bar speed faster and make the wedge smaller.
  485.  
  486.   WARNING: DO NOT FORGET THE COMA. you need to understand how hash works !!  
  487.  
  488.   WARNING: this two feature can be confusing to configure. you need to really
  489.   keep track record on how each character rings look like.
  490.  
  491.  ===============================================================================
  492.  for scripters: to check the ring currently active or not:
  493.  $game_system.ring_active
  494.  it will return true when the ring still there.
  495.  
  496.  ■ Future Plan     ╒═════════════════════════════════════════════════════════╛  
  497.  > scene for modifying rings freely using soul fragment
  498.  (requested by lionheart). but this take least priority because it will be hard
  499.  
  500. =end
  501.  
  502. $imported = {} if $imported.nil?
  503. $imported["EST - RING SYSTEM"] = true
  504.  
  505. module ESTRIOLE
  506.   module OW_RIBS
  507.  
  508.   # RING
  509.   # Ring skin image filename [default = 'Default_Ring']
  510.   RING_SKIN = 'Default_Ring'
  511.   # Ring size (ring-skin width & height} [default = 192]
  512.   RING_SIZE = 192
  513.   # Strike 'wedge' size (as a percent [%] of the main 'wedge') [default = 20]
  514.   STRIKE_SIZE = 20
  515.   RING_Z = 1000
  516.  
  517.   # POSITION BAR
  518.   # Bar rotation speed (in degrees, higher number = faster) [default = 2]
  519.   BAR_SPEED = 2
  520.   # Bar size (also 'wedge' radius) [default = 72]
  521.   BAR_SIZE = 72
  522.    
  523.   # COLOR
  524.   # Bar color [default = Color.new(0, 0, 255)]
  525.   BAR_COLOR = Color.new(0, 120, 255)  
  526.   # 'Wedge' color [default = Color.new(255, 0, 0, 200)]
  527.   WEDGE_COLOR = Color.new(255, 0, 0,200)
  528.   # 'Wedge' color (when strike activated) [default = Color.new(0, 255, 255, 200)]
  529.   STRIKE_COLOR = Color.new(0, 255, 255, 200)
  530.   # Strike 'wedge' color [default = Color.new(255, 128, 0, 200)]
  531.   STRIKE = Color.new(255, 128, 0,200)
  532.   # Strike 'wedge' active color [default = Color.new(255, 255, 0, 200)]
  533.   STRIKE_ACTIVE = Color.new(255, 255, 0,200)
  534.   # Activated 'wedge' color [default = Color.new(0, 255, 0, 200)]
  535.   ACTIVE = Color.new(0, 255, 0,200)
  536.  
  537.   # SOUNDS
  538.  
  539.   # Sound to play on a CORRECT button press [default = 'Audio/SE/Chime2']
  540.   BUTTON_SOUND = 'Audio/SE/Chime2'
  541.   # Sound to play on a CORRECT bonus button press [default = 'Audio/SE/Flash2']
  542.   STRIKE_SOUND = 'Audio/SE/Flash2'
  543.   # Sound to play on an INCORRECT button press [default = 'Audio/SE/Buzzer1']
  544.   BUZZER_SOUND = 'Audio/SE/Buzzer1'
  545.  
  546.   # VARIABLES (For Saving the ring result) Mainly for eventing
  547.   # Variable to store how many hit (crit or not)
  548.   RING_HIT_COUNT_VAR = 97
  549.   # Variable to store how many good hit only (not crit)
  550.   GOOD_COUNT_VAR = 98
  551.   # Variable to store how many crit hit only
  552.   CRIT_COUNT_VAR = 99
  553.   # Variable to store the ring score (good hit = 1 point, crit = 2 point)
  554.   SCORE_COUNT_VAR = 100
  555.  
  556.   # MISCELLANEOUS
  557.  
  558.   # Button to press to activate a wedge [default = Input::C]
  559.   BUTTON = Input::C
  560.  
  561.   # SHARED METHOD
  562.     def reset_ring
  563.       $game_system.score_count = nil
  564.       $game_system.good_count  = nil
  565.       $game_system.crit_count = nil
  566.       $game_system.ring_hit_count   = nil
  567.       $game_system.current_action = nil
  568.       $game_system.bar_speed = nil
  569.       $game_system.no_strike = nil
  570.       $game_system.strike_size = nil
  571.       $game_system.ring_setting = nil
  572.  
  573.       $game_system.ring_miss = nil
  574.       $game_system.ring_crit = nil
  575.       $game_system.ring_null_evade = nil
  576.       $game_system.ring_repeats     = nil
  577.     end
  578.     def reset_ring_effect
  579.       $game_system.ring_miss = nil
  580.       $game_system.ring_crit = nil
  581.       $game_system.ring_null_evade = nil
  582.       $game_system.ring_repeats     = nil
  583.     end
  584.  
  585.   end
  586. end
  587.  
  588. #===============================================================================
  589. # Bitmap
  590. #===============================================================================
  591.  
  592. class Bitmap
  593.   #----------------------------------------------------------------------------
  594.   # Draw Line (modified version of Draw Line by modern algebra)
  595.   #----------------------------------------------------------------------------
  596.   def draw_line(x1, y1, x2, y2, color = Color.new(255, 255, 255), width = 1)
  597.     cx = x2 - x1
  598.     cy = y2 - y1
  599.     if cx.abs > cy.abs
  600.       return if cx == 0
  601.       if x2 < x1
  602.         temp = x2
  603.         x2 = x1
  604.         x1 = temp
  605.         temp = y2
  606.         y2 = y1
  607.         y1 = temp
  608.       end
  609.       for i in 0..cx.abs
  610.         y = y1 + cy * i / cx
  611.         set_pixel(x1 + i, y, color)
  612.         if width > 1
  613.           for j in 2..width
  614.             if (j & 1) == 0
  615.               set_pixel(x1 + i, y - j / 2, color)
  616.             else
  617.               set_pixel(x1 + i, y + j / 2, color)
  618.             end
  619.           end
  620.         end
  621.       end
  622.     else
  623.       return if cy == 0
  624.       if y2 < y1
  625.         temp = x2
  626.         x2 = x1
  627.         x1 = temp
  628.         temp = y2
  629.         y2 = y1
  630.         y1 = temp
  631.       end
  632.       for i in 0..cy.abs
  633.         x = x1 + cx * i / cy
  634.         set_pixel(x, y1 + i, color)
  635.         if width != 1
  636.           for j in 2..width
  637.             if j & 1
  638.               set_pixel(x - j / 2, y1 + i, color)
  639.             else
  640.               set_pixel(x + j / 2, y1 + i, color)
  641.             end
  642.           end
  643.         end
  644.       end
  645.     end
  646.   end
  647. end
  648.  
  649. #==============================================================================
  650. # Game_System
  651. #==============================================================================
  652.  
  653.  
  654. #==============================================================================
  655. # Ring_Window (New)
  656. #==============================================================================
  657.  
  658. class Ring_Window < Window_Base
  659.   #--------------------------------------------------------------------------
  660.   # Include
  661.   #--------------------------------------------------------------------------
  662.   include ESTRIOLE::OW_RIBS
  663.   #--------------------------------------------------------------------------
  664.   # Initialize
  665.   #--------------------------------------------------------------------------
  666.   def initialize(x, y, radius)
  667.     super(x, y, (radius * 2) + 38, (radius * 2) + 38)
  668.     @radius = BAR_SIZE
  669.     @center = radius
  670.     self.opacity = 0
  671.     self.contents.clear
  672.     self.z = RING_Z
  673.     @ring_bg = Sprite.new
  674.     @ring_bg.bitmap = Cache.system(RING_SKIN)
  675.     @ring_bg.x = x + standard_padding
  676.     @ring_bg.y = y + standard_padding
  677.     @ring_bg.z = RING_Z - 1
  678.     #self.contents = Cache.system(RING_SKIN)
  679.   end
  680.   def dispose
  681.     super
  682.     @ring_bg.bitmap.dispose
  683.     @ring_bg.dispose
  684.     @ring_bg = nil
  685.   end
  686.   #--------------------------------------------------------------------------
  687.   # Draw Wedge
  688.   #--------------------------------------------------------------------------
  689.   def draw_wedge(start, finish, color = WEDGE_COLOR)
  690.     strike = 0
  691.     if start > finish
  692.       for d in start..360
  693.         x = @center + @radius * Math.cos(d * Math::PI / 180)
  694.         y = @center + @radius * Math.sin(d * Math::PI / 180)
  695.         self.contents.draw_line(@center, @center, x, y, color, 3)
  696.       end
  697.       strike += (360 - start)
  698.       start = 0
  699.     end
  700.     for d in start..finish
  701.       x = @center + @radius * Math.cos(d * Math::PI / 180)
  702.       y = @center + @radius * Math.sin(d * Math::PI / 180)
  703.       self.contents.draw_line(@center, @center, x, y, color, 3)
  704.     end
  705.     strike += (finish - start)
  706.     start = finish - strike * $game_system.strike_size / 100
  707.     start.round
  708.     color = STRIKE if color == WEDGE_COLOR
  709.     color = STRIKE_ACTIVE if color == STRIKE_COLOR
  710.     return if $game_system.no_strike
  711.     for d in start..finish
  712.       x = @center + @radius * Math.cos(d * Math::PI / 180)
  713.       y = @center + @radius * Math.sin(d * Math::PI / 180)
  714.       self.contents.draw_line(@center, @center, x, y, color, 3)
  715.     end
  716.   end
  717. end
  718.  
  719. #==============================================================================
  720. # Bar_Window (New)
  721. #==============================================================================
  722.  
  723. class Bar_Window < Window_Base
  724.   #--------------------------------------------------------------------------
  725.   # Include
  726.   #--------------------------------------------------------------------------
  727.   include ESTRIOLE::OW_RIBS
  728.   #--------------------------------------------------------------------------
  729.   # Initialize
  730.   #--------------------------------------------------------------------------
  731.   def initialize(x, y, radius, start)
  732.     super(x, y, (radius * 2) + 38, (radius * 2) + 38)
  733.     self.z = RING_Z
  734.     @radius = radius
  735.     @center = radius
  736.     @last_degrees = start
  737.     self.opacity = 0
  738.     self.contents.clear
  739.     draw_bar(start)
  740.   end
  741.   #--------------------------------------------------------------------------
  742.   # Draw Bar
  743.   #--------------------------------------------------------------------------
  744.   def draw_bar(degrees = 0)
  745.     color = BAR_COLOR
  746.     erase = Color.new(0, 0, 0, 0)
  747.     x = @center + @radius * Math.cos((@last_degrees) * Math::PI / 180)
  748.     y = @center + @radius * Math.sin((@last_degrees) * Math::PI / 180)
  749.     self.contents.draw_line(@center, @center, x, y, erase, 3)
  750.     x = @center + @radius * Math.cos(degrees * Math::PI / 180)
  751.     y = @center + @radius * Math.sin(degrees * Math::PI / 180)
  752.     self.contents.draw_line(@center, @center, x, y, color, 3)
  753.     @last_degrees = degrees
  754.   end
  755. end
  756.  
  757. #==============================================================================
  758. # Scene_Base
  759. #==============================================================================
  760.  
  761. class Scene_Base
  762.   #--------------------------------------------------------------------------
  763.   # Include (New)
  764.   #--------------------------------------------------------------------------
  765.   include ESTRIOLE::OW_RIBS
  766.   def do_ring_auto
  767.       x = $game_system.ring_setting[:x]
  768.       y = $game_system.ring_setting[:y]
  769.       wedge = $game_system.ring_setting[:wedge]
  770.       times = $game_system.ring_setting[:times]
  771.       degrees = $game_system.ring_setting[:degrees]
  772.       SceneManager.scene.do_ring(x,y,wedge,degrees,times)
  773.   end
  774.   def evaluate_ring_auto(item = $game_system.current_action)
  775.       reset_ring_effect
  776.       $game_system.ring_miss = true if item.ring_miss && item.ring_miss > $game_system.ring_hit_count
  777.       $game_system.ring_null_evade = true if item.ring_null_evade && item.ring_null_evade <= $game_system.ring_hit_count
  778.       $game_system.ring_null_evade = true if item.ring_crit_null_evade && item.ring_crit_null_evade <= $game_system.crit_count
  779.       $game_system.ring_crit = true if item.ring_crit && item.ring_crit <= $game_system.crit_count
  780.       $game_system.ring_repeats = item.ring_repeats[$game_system.score_count] rescue nil
  781.       chk = item.ring_repeats[[$game_system.good_count,$game_system.crit_count]] rescue nil
  782.       $game_system.ring_repeats = chk if chk
  783.   end
  784.   #--------------------------------------------------------------------------
  785.   # Do Ring (New)
  786.   #--------------------------------------------------------------------------
  787.   def do_ring(x = 0, y = 0, wedge = [10,30], degrees = 0 , times = 3)
  788.     $game_system.ring_active = true
  789.     times -= 1 if times.is_a?(Numeric)
  790.     count = press_count = wedge_count = good_count = bonus_count = 0
  791.     bx = x + ((RING_SIZE / 2) - BAR_SIZE)
  792.     by = y + ((RING_SIZE / 2) - BAR_SIZE)
  793.     @ring_window = Ring_Window.new(x, y, RING_SIZE / 2)
  794.     @bar_window = Bar_Window.new(bx, by, BAR_SIZE, degrees)
  795.     wedge_count = wedge.size / 2
  796.     size = wedge_count - 1
  797.     pressed = []
  798.     for i in 0..size
  799.       @ring_window.draw_wedge(wedge[i * 2], wedge[i * 2 + 1])
  800.       pressed.push(false)
  801.     end
  802.     for i in 1..30
  803.       update_basic
  804.     end
  805.     speed = $game_system.bar_speed
  806.     loop do
  807.       degrees += speed
  808.       degrees -= 360 if degrees >= 360
  809.       count += speed
  810.       break if count > 360
  811.       @bar_window.draw_bar(degrees)
  812.       update_basic
  813.       old_count = press_count
  814.       if Input.trigger?(BUTTON)
  815.         for i in 0..size
  816.           if wedge[i * 2] > wedge[i * 2 + 1]
  817.             w2 = wedge[i * 2 + 1] + (360 - wedge[i * 2])
  818.             w1 = wedge[i * 2 + 1] - w2 * $game_systems.strike_size / 100
  819.             w2 = wedge[i * 2 + 1]
  820.             if w1 < 0
  821.               w1 = 360 + w1
  822.               if (w1..360) === degrees or (0..w2) === degrees
  823.                 color = STRIKE_COLOR
  824.               else
  825.                 color = ACTIVE
  826.               end
  827.             else
  828.               color = (w1..w2) === degrees ? STRIKE_COLOR : ACTIVE
  829.             end
  830.             color = ACTIVE if $game_system.no_strike
  831.             if ((wedge[i * 2]..360) === degrees or
  832.                 (0..wedge[i * 2 + 1]) === degrees) and !pressed[i]
  833.               p_calc = color == STRIKE_COLOR ? bonus_count : good_count
  834.               pitch = 100 + p_calc * 10
  835.               sound = color == STRIKE_COLOR ? STRIKE_SOUND : BUTTON_SOUND
  836.               Audio.se_play(sound, 100, pitch)
  837.               @ring_window.draw_wedge(wedge[i * 2], wedge[i * 2 + 1], color)
  838.               pressed[i] = true
  839.               good_count += 1
  840.               press_count += 1
  841.               bonus_count += 1 if color == STRIKE_COLOR
  842.             end
  843.           else
  844.             if (wedge[i * 2]..wedge[i * 2 + 1]) === degrees and !pressed[i]
  845.               w2 = wedge[i * 2 + 1]
  846.               w1 = w2 - (w2 - wedge[i * 2]) * $game_system.strike_size / 100
  847.               color = (w1..w2) === degrees ? STRIKE_COLOR : ACTIVE
  848.               color = ACTIVE if $game_system.no_strike
  849.               p_calc = color == STRIKE_COLOR ? bonus_count : good_count
  850.               pitch = 100 + p_calc * 10
  851.               sound = color == STRIKE_COLOR ? STRIKE_SOUND : BUTTON_SOUND
  852.               Audio.se_play(sound, 100, pitch)
  853.               @ring_window.draw_wedge(wedge[i * 2], wedge[i * 2 + 1], color)
  854.               pressed[i] = true
  855.               good_count += 1
  856.               press_count += 1
  857.               bonus_count += 1 if color == STRIKE_COLOR
  858.             end
  859.           end
  860.         end
  861.         if old_count == press_count
  862.           Audio.se_play(BUZZER_SOUND, 100, 100)
  863.           press_count += 1
  864.         end
  865.       end
  866.       if count == 360 && times != 0
  867.         count = 0
  868.         times -= 1 if times.is_a?(Numeric)
  869.       end
  870.       break if count == 360 or press_count == wedge_count
  871.     end
  872.     if press_count == wedge_count
  873.       for i in 1..30
  874.         Graphics.update
  875.       end
  876.     end
  877.     $game_variables[SCORE_COUNT_VAR] = $game_system.score_count = good_count + bonus_count
  878.     $game_variables[RING_HIT_COUNT_VAR] = $game_system.ring_hit_count = good_count
  879.     $game_variables[GOOD_COUNT_VAR] = $game_system.good_count = good_count - bonus_count
  880.     $game_variables[CRIT_COUNT_VAR] = $game_system.crit_count = bonus_count
  881.    
  882.     $game_system.no_strike = false
  883.     @bar_window.dispose if @bar_window
  884.     @ring_window.dispose if @ring_window
  885.     @bar_window = nil
  886.     @ring_window = nil
  887.     $game_system.ring_active = false
  888.     return [good_count, bonus_count]
  889.   end
  890. end
  891.  
  892. class Game_Battler < Game_BattlerBase
  893.   include ESTRIOLE::OW_RIBS
  894.  
  895.   def ring(a ,b , formula = 0)
  896.    return formula if !self.is_a?(Game_Actor)
  897.    return formula if self.confusion?
  898.    v = $game_variables
  899.    s = $game_switches
  900.    pt = $game_party
  901.    l = $game_party.leader  
  902.    f = formula
  903.    sk = $game_system.current_action
  904.    id = $game_system.current_action.id
  905.    return formula if sk.ring_result == {}  
  906.    chk = eval(sk.ring_result[$game_system.score_count]) rescue nil
  907.    chk = eval(sk.ring_result[[$game_system.good_count,$game_system.crit_count]]) rescue nil if !chk
  908.    return chk if chk
  909.    return formula
  910.   end
  911.  
  912.   def ring_objects
  913.     return [] if self.is_a?(Game_Enemy)
  914.     actr = [self.actor] rescue []
  915.     cls = [self.class] rescue []
  916.     eqps = equips rescue []
  917.     sts = states rescue []
  918.     objects = actr + cls + eqps + sts
  919.   end
  920.  
  921.   def grab_ring_setting_replace(type = :skill, id = 1)
  922.     note_replace = ""
  923.     ring_objects.reverse.each do |obj|
  924.       if obj && obj.ring_setting_replace[[type]]
  925.       note_replace += "<ring_setting>\r\n"
  926.         obj.ring_setting_replace[[type]].each do |key,value|
  927.         note_replace += ":#{key} => #{value},\r\n"
  928.         end
  929.       note_replace += "</ring_setting>\r\n"
  930.       end
  931.       if obj && obj.ring_setting_replace[[type,id]]
  932.       note_replace += "<ring_setting>\r\n"
  933.         obj.ring_setting_replace[[type,id]].each do |key,value|
  934.         note_replace += ":#{key} => #{value},\r\n"
  935.         end
  936.       note_replace += "</ring_setting>\r\n"
  937.       end
  938.     end
  939.     return note_replace
  940.   end #end def
  941.  
  942.   def grab_ring_setting_mod(type = :skill, id = 1)
  943.     ring_mod = {
  944.     :x=> 0,
  945.     :y=> 0,
  946.     :add_wedge=> [],
  947.     :rem_wedge=> [],
  948.     :bar_speed=> 0,
  949.     :strike=> 0,
  950.     :no_strike => nil,
  951.     }
  952.     ring_objects.reverse.each do |obj|
  953.       if obj && obj.ring_setting_mod[[type]]
  954.         obj.ring_setting_mod[[type]].each do |key,value|
  955.           ring_mod[key.to_sym] += value if key.to_sym != :no_strike
  956.           ring_mod[key.to_sym] = value if key.to_sym == :no_strike
  957.         end
  958.       end
  959.       if obj && obj.ring_setting_mod[[type,id]]
  960.         obj.ring_setting_mod[[type,id]].each do |key,value|
  961.           ring_mod[key.to_sym] += value if key.to_sym != :no_strike
  962.           ring_mod[key.to_sym] = value if key.to_sym == :no_strike
  963.         end
  964.       end      
  965.     end
  966.     return ring_mod
  967.   end
  968.  
  969. end
  970.  
  971.  
  972. class Scene_Battle < Scene_Base
  973.  
  974.   include ESTRIOLE::OW_RIBS
  975.    
  976.   alias est_ring_use_item use_item
  977.   def use_item
  978.     $game_system.current_action = item = @subject.current_action.item.dup
  979.     type = item.is_a?(RPG::Skill) ? :skill : :item
  980.     item.note = @subject.grab_ring_setting_replace(type,item.id) + item.note
  981.    
  982.     if !@subject.is_a?(Game_Enemy) && !@subject.confusion?
  983.       $game_system.ring_setting = {}
  984.       $game_system.ring_setting[:x] = item.ring_setting[:x] == nil ? 0 : item.ring_setting[:x] rescue 0
  985.       $game_system.ring_setting[:y] = item.ring_setting[:y] == nil ? 0 : item.ring_setting[:y] rescue 0
  986.       $game_system.ring_setting[:strike] = $game_system.strike_size = item.ring_setting[:strike] == nil ? STRIKE_SIZE : item.ring_setting[:strike] rescue STRIKE_SIZE
  987.       $game_system.ring_setting[:no_strike] = $game_system.no_strike = item.ring_setting[:no_strike] rescue nil
  988.       $game_system.ring_setting[:wedge] = item.ring_setting[:wedge] == nil ? [10,60] : item.ring_setting[:wedge] rescue [10,20]
  989.       $game_system.ring_setting[:times] = item.ring_setting[:times] == nil ? 3 : item.ring_setting[:times] rescue 3
  990.       $game_system.ring_setting[:degrees] = item.ring_setting[:degrees] == nil ? 0 : item.ring_setting[:degrees] rescue 0
  991.       $game_system.ring_setting[:bar_speed] = $game_system.bar_speed = item.ring_setting[:bar_speed] == nil ? BAR_SPEED : item.ring_setting[:bar_speed] rescue 2
  992.        @subject.grab_ring_setting_mod(type, item.id).each do |key,value|
  993.          case key.to_sym
  994.          when :strike
  995.            $game_system.strike_size = $game_system.ring_setting[:strike] += value
  996.          when :no_strike
  997.            $game_system.no_strike = $game_system.ring_setting[:no_strike] = value if value
  998.          when :add_wedge
  999.            $game_system.ring_setting[:wedge] += value
  1000.          when :rem_wedge
  1001.            $game_system.ring_setting[:wedge] -= value
  1002.          when :bar_speed  
  1003.            $game_system.bar_speed = $game_system.ring_setting[:bar_speed] += value        
  1004.          else
  1005.          $game_system.ring_setting[key.to_sym] += value
  1006.          end
  1007.        end
  1008.        #prevent the ring speed below 0
  1009.       $game_system.ring_setting[:bar_speed] = $game_system.bar_speed = [$game_system.bar_speed,1].max
  1010.     end
  1011.    
  1012.     if item.use_ring && !@subject.is_a?(Game_Enemy) && !@subject.confusion?      
  1013.       SceneManager.scene.do_ring_auto
  1014.       SceneManager.scene.evaluate_ring_auto
  1015.     end
  1016.    
  1017.     est_ring_use_item
  1018.    
  1019.     return if $imported[:ve_animated_battle]
  1020.     reset_ring
  1021.   end
  1022.  
  1023.   if $imported[:ve_animated_battle]
  1024.     alias ring_victor_patch_call_effect call_effect
  1025.     def call_effect
  1026.       ring_victor_patch_call_effect
  1027.       reset_ring
  1028.     end
  1029.   end
  1030.  
  1031. end
  1032.  
  1033. class RPG::UsableItem < RPG::BaseItem
  1034.   def repeats
  1035.     return $game_system.ring_repeats if $game_system.ring_repeats
  1036.     return @repeats
  1037.   end
  1038. end
  1039.  
  1040. class RPG::BaseItem
  1041.   def use_ring
  1042.     return false if !note[/<use_ring>/im]
  1043.     return true if note[/<use_ring>/im]    
  1044.   end
  1045.   def ring_miss
  1046.     return false if !note[/<ring_miss:([^>]*)>/im]
  1047.     a = note[/<ring_miss:([^>]*)>/im].scan(/:(.*)/m).flatten[0].scan(/(?:"(.*?)"|\{(.*?)\}|\[(.*?)\]| ([-\w.\w]+)|([-\w.\w]+),|,([-\w.\w]+))/m).flatten.compact
  1048.     return noteargs = a[0].to_i
  1049.   end
  1050.   def ring_crit
  1051.     return false if !note[/<ring_crit:([^>]*)>/im]
  1052.     a = note[/<ring_crit:([^>]*)>/im].scan(/:(.*)/m).flatten[0].scan(/(?:"(.*?)"|\{(.*?)\}|\[(.*?)\]| ([-\w.\w]+)|([-\w.\w]+),|,([-\w.\w]+))/m).flatten.compact
  1053.     return noteargs = a[0].to_i
  1054.   end
  1055.   def ring_null_evade
  1056.     return false if !note[/<ring_null_evade:([^>]*)>/im]
  1057.     a = note[/<ring_null_evade:([^>]*)>/im].scan(/:(.*)/m).flatten[0].scan(/(?:"(.*?)"|\{(.*?)\}|\[(.*?)\]| ([-\w.\w]+)|([-\w.\w]+),|,([-\w.\w]+))/m).flatten.compact
  1058.     return noteargs = a[0].to_i
  1059.   end
  1060.   def ring_crit_null_evade
  1061.     return false if !note[/<ring_crit_null_evade:([^>]*)>/im]
  1062.     a = note[/<ring_crit_null_evade:([^>]*)>/im].scan(/:(.*)/m).flatten[0].scan(/(?:"(.*?)"|\{(.*?)\}|\[(.*?)\]| ([-\w.\w]+)|([-\w.\w]+),|,([-\w.\w]+))/m).flatten.compact
  1063.     return noteargs = a[0].to_i
  1064.   end
  1065.   def ring_setting
  1066.     return {} if !note[/<ring_setting?>(?:[^<]|<[^\/])*<\/ring_setting?>/i]
  1067.     a = note[/<ring_setting?>(?:[^<]|<[^\/])*<\/ring_setting?>/i].scan(/(?:!<ring_setting?>|(.*)\r)/)
  1068.     a.delete_at(0)    
  1069.     a = a.join("\r\n")
  1070.     return noteargs = eval("{#{a}}") rescue {}
  1071.   end  
  1072.   def ring_setting_replace
  1073.     return {} if !note[/<ring_setting_replace?>(?:[^<]|<[^\/])*<\/ring_setting_replace?>/i]
  1074.     a = note[/<ring_setting_replace?>(?:[^<]|<[^\/])*<\/ring_setting_replace?>/i].scan(/(?:!<ring_setting_replace?>|(.*)\r)/)
  1075.     a.delete_at(0)    
  1076.     a = a.join("\r\n")
  1077.     return noteargs = eval("{#{a}}") rescue {}
  1078.   end  
  1079.   def ring_setting_mod
  1080.     return {} if !note[/<ring_setting_mod?>(?:[^<]|<[^\/])*<\/ring_setting_mod?>/i]
  1081.     a = note[/<ring_setting_mod?>(?:[^<]|<[^\/])*<\/ring_setting_mod?>/i].scan(/(?:!<ring_setting_mod?>|(.*)\r)/)
  1082.     a.delete_at(0)    
  1083.     a = a.join("\r\n")
  1084.     return noteargs = eval("{#{a}}") rescue {}
  1085.   end  
  1086.   def ring_result
  1087.     return {} if !note[/<ring_result?>(?:[^<]|<[^\/])*<\/ring_result?>/i]
  1088.     a = note[/<ring_result?>(?:[^<]|<[^\/])*<\/ring_result?>/i].scan(/(?:!<ring_result?>|(.*)\r)/)
  1089.     a.delete_at(0)    
  1090.     a = a.join("\r\n")
  1091.     return noteargs = eval("{#{a}}") rescue {}
  1092.   end  
  1093.   def ring_repeats
  1094.     return {} if !note[/<ring_repeats?>(?:[^<]|<[^\/])*<\/ring_repeats?>/i]
  1095.     a = note[/<ring_repeats?>(?:[^<]|<[^\/])*<\/ring_repeats?>/i].scan(/(?:!<ring_repeats?>|(.*)\r)/)
  1096.     a.delete_at(0)    
  1097.     a = a.join("\r\n")
  1098.     return noteargs = eval("{#{a}}") rescue {}
  1099.   end  
  1100. end
  1101.  
  1102.  
  1103. class Game_ActionResult
  1104.   def missed
  1105.     return $game_system.ring_miss if $game_system.ring_miss
  1106.     return @missed
  1107.   end
  1108.   def critical
  1109.     return $game_system.ring_crit if $game_system.ring_crit
  1110.     return @critical
  1111.   end
  1112.   def evaded
  1113.     return !$game_system.ring_null_evade if $game_system.ring_null_evade
  1114.     return @evaded
  1115.   end
  1116.   def missed=(val)
  1117.     @missed = val
  1118.     @missed = $game_system.ring_miss if $game_system.ring_miss
  1119.     return @missed
  1120.   end
  1121.   def critical=(val)
  1122.     @critical = val
  1123.     @critical = $game_system.ring_crit if $game_system.ring_crit
  1124.     return @critical
  1125.   end
  1126.   def evaded=(val)
  1127.     @evaded = val
  1128.     @evaded = !$game_system.ring_null_evade if $game_system.ring_null_evade
  1129.     return @evaded
  1130.   end
  1131. end
  1132.  
  1133. class Game_System
  1134.   #--------------------------------------------------------------------------
  1135.   # Include (New)
  1136.   #--------------------------------------------------------------------------
  1137.   include ESTRIOLE::OW_RIBS
  1138.   #--------------------------------------------------------------------------
  1139.   # Public Instance Variables (New)
  1140.   #--------------------------------------------------------------------------
  1141.   attr_accessor :score_count
  1142.   attr_accessor :good_count  
  1143.   attr_accessor :crit_count
  1144.   attr_accessor :ring_hit_count  
  1145.   attr_accessor :current_action
  1146.   attr_accessor :bar_speed
  1147.   attr_accessor :no_strike
  1148.   attr_accessor :strike_size
  1149.   attr_accessor :ring_setting
  1150.   attr_accessor :ring_active
  1151.  
  1152.   attr_accessor :ring_miss
  1153.   attr_accessor :ring_crit
  1154.   attr_accessor :ring_null_evade
  1155.   attr_accessor :ring_repeats
  1156.   #--------------------------------------------------------------------------
  1157.   # Initialize (Mod)
  1158.   #--------------------------------------------------------------------------
  1159.   alias ow_ribs_gs_initialize initialize unless $@
  1160.   def initialize
  1161.     ow_ribs_gs_initialize
  1162.     @score_count = 0
  1163.     @good_count = 0
  1164.     @crit_count = 0
  1165.     @ring_hit_count = 0
  1166.     @bar_speed = BAR_SPEED
  1167.     @no_strike = false
  1168.     @ring_active = false
  1169.     @strike_size = STRIKE_SIZE
  1170.   end
  1171.   def strike_size
  1172.     return STRIKE_SIZE if !@strike_size
  1173.     @strike_size
  1174.   end
  1175. end
  1176.  
  1177. class Game_Interpreter
  1178.   def do_ring(x = 0, y = 0, wedge = [10,30], degrees = 0 , times = 3)
  1179.     SceneManager.scene.do_ring(x, y, wedge, degrees, times)
  1180.   end
  1181. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement