vindaca510

V's Conditional Check's v1.2

Sep 8th, 2013
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 35.09 KB | None | 0 0
  1. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  2. #                                                                              #
  3. #                           V's Conditional Check's                            #
  4. #                                 Version  1.2                                 #
  5. #                                                                              #
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  7. #                                Written By:  V                                #
  8. #                       Last Edited:  September 19, 2013                       #
  9. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  10. #                                                                              #
  11. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  12.  
  13.  
  14. #==============================================================================#
  15. #------------------------------------------------------------------------------#
  16. # ** Disclaimer                                                                #
  17. #------------------------------------------------------------------------------#
  18. #                                                                              #
  19. # This script was intended for Non-commercial use only, if you wish to use     #
  20. # this script in a commercial game please PM me at which ever site you found   #
  21. # this script. Either way please give me credit in your game script as the     #
  22. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  23. #                                                                              #
  24. #------------------------------------------------------------------------------#
  25. # ** How To Use                                                                #
  26. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  27. #                                                                              #
  28. # * This script is plug-and-play. Use any one of these checks in a conditional #
  29. # branch                                                                       #
  30. #                                                                              #
  31. # * Checks are as follows:                                                     #
  32. #                                                                              #
  33. #  ==========================================================================  #
  34. #    The following can be used with                                            #
  35. #  $game_actors[i] || $game_party.members[i] || $game_party.battle_members[i]  #
  36. #  ==========================================================================  #
  37. #                                                                              #
  38. #     For checking if weapons and armors are equiped.                          #
  39. #     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                          #
  40. #     .has_armor_equiped?                                                      #
  41. #     .has_weapon_equiped?                                                     #
  42. #                                                                              #
  43. #                                                                              #
  44. #     For checking weapon and armor types.                                     #
  45. #     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                     #
  46. #     .has_armor_type(armor_type_id)                                           #
  47. #     .has_weapon_type(weapon_type_id)                                         #
  48. #                                                                              #
  49. #                                                                              #
  50. #     For checking Hp.                                                         #
  51. #     ~~~~~~~~~~~~~~~~                                                         #
  52. #     .hp_is?(amount)                                                          #
  53. #     .hp_is_less_then?(amount)                                                #
  54. #     .hp_is_more_then?(amount)                                                #
  55. #                                                                              #
  56. #                                                                              #
  57. #     For checking Mp.                                                         #
  58. #     ~~~~~~~~~~~~~~~~                                                         #
  59. #     .mp_is?(amount)                                                          #
  60. #     .mp_is_less_then?(amount)                                                #
  61. #     .mp_is_more_then?(amount)                                                #
  62. #                                                                              #
  63. #                                                                              #
  64. #     For checking Tp.                                                         #
  65. #     ~~~~~~~~~~~~~~~~                                                         #
  66. #     .tp_is?(amount)                                                          #
  67. #     .tp_is_less_then?(amount)                                                #
  68. #     .tp_is_more_then?(amount)                                                #
  69. #                                                                              #
  70. #                                                                              #
  71. #     For checking Hp by Percentage. (1% == 0.01)                              #
  72. #     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                           #
  73. #     .hp_percentage_is?(amount)                                               #
  74. #     .hp_percentage_is_less_then?(amount)                                     #
  75. #     .hp_percentage_is_more_then?(amount)                                     #
  76. #                                                                              #
  77. #                                                                              #
  78. #     For checking Mp by Percentage. (1% == 0.01)                              #
  79. #     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                           #
  80. #     .mp_percentage_is?(amount)                                               #
  81. #     .mp_percentage_is_less_then?(amount)                                     #
  82. #     .mp_percentage_is_more_then?(amount)                                     #
  83. #                                                                              #
  84. #                                                                              #
  85. #     For checking Tp by Percentage. (1% == 0.01)                              #
  86. #     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                           #
  87. #     .tp_percentage_is?(amount)                                               #
  88. #     .tp_percentage_is_less_then?(amount)                                     #
  89. #     .tp_percentage_is_more_then?(amount)                                     #
  90. #                                                                              #
  91. #                                                                              #
  92. #     For checking params                                                      #
  93. #     ~~~~~~~~~~~~~~~~~~~                                                      #
  94. #     .param_is?(param_id, amount)                                             #
  95. #     .param_is_less_then?(param_id, amount)                                   #
  96. #     .param_is_more_then?(param_id, amount)                                   #
  97. #                                                                              #
  98. #                                                                              #
  99. #     For checking sparams                                                     #
  100. #     ~~~~~~~~~~~~~~~~~~~~                                                     #
  101. #     .sparam_is?(sparam_id, amount)                                           #
  102. #     .sparam_is_less_then?(sparam_id, amount)                                 #
  103. #     .sparam_is_more_then?(sparam_id, amount)                                 #
  104. #                                                                              #
  105. #                                                                              #
  106. #     For checking xparams                                                     #
  107. #     ~~~~~~~~~~~~~~~~~~~~                                                     #
  108. #     .xparam_is?(xparam_id, amount)                                           #
  109. #     .xparam_is_less_then?(xparam_id, amount)                                 #
  110. #     .xparam_is_more_then?(xparam_id, amount)                                 #
  111. #                                                                              #
  112. #                                                                              #
  113. #  ==========================================================================  #
  114. #    The following can be used with $game_party                                #
  115. #  ==========================================================================  #
  116. #                                                                              #
  117. #     For checking item quantities.                                            #
  118. #     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                            #
  119. #     .less_then_amount_items?(item_id, amount)        item[x] < amount        #
  120. #     .more_then_amount_items?(item_id, amount)        item[x] > amount        #
  121. #     .fixed_amount_items?(item_id, amount)            item[x] == amount       #
  122. #                                                                              #
  123. #                                                                              #
  124. #      For checking gold spent in stores.                                      #
  125. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                       #
  126. #     .amount_spent_is?(amount)                        amount_spent == amount  #
  127. #     .amount_spent_less_then?(amount)                 amount_spent < amount   #
  128. #     .amount_spent_more_then?(amount)                 amount_spent > amount   #
  129. #                                                                              #
  130. #                                                                              #
  131. #      Checks if any party member is of class x.                               #
  132. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                               #
  133. #     .has_class?(class_id)                                                    #
  134. #                                                                              #
  135. #                                                                              #
  136. #      Checks the total level of the party members.                            #
  137. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                            #
  138. #     .total_plevel_is?(amount)                                                #
  139. #     .total_plevel_less_then?(amount)                                         #
  140. #     .total_plevel_more_then?(amount)                                         #
  141. #                                                                              #
  142. #                                                                              #
  143. #      Checks the average level of the party members.                          #
  144. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                          #
  145. #     .average_plevel_is?(amount)                                              #
  146. #     .average_plevel_less_then?(amount)                                       #
  147. #     .average_plevel_more_then?(amount)                                       #
  148. #                                                                              #
  149. #                                                                              #
  150. #      Checks the total level of the battle members.                           #
  151. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                           #
  152. #     .total_level_is?(amount)                                                 #
  153. #     .total_level_less_then?(amount)                                          #
  154. #     .total_level_more_then?(amount)                                          #
  155. #                                                                              #
  156. #                                                                              #
  157. #      Checks the average level of the battle members.                         #
  158. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                         #
  159. #     .average_level_is?(amount)                                               #
  160. #     .average_level_less_then?(amount)                                        #
  161. #     .average_level_more_then?(amount)                                        #
  162. #                                                                              #
  163. #                                                                              #
  164. #      Checks the number of steps taken.                                       #
  165. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                       #
  166. #     .steps_are?(amount)                                                      #
  167. #     .steps_are_less_then?(amount)                                            #
  168. #     .steps_are_more_then?(amount)                                            #
  169. #                                                                              #
  170. #                                                                              #
  171. #      Checks the number of battle victories.                                  #
  172. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                  #
  173. #     .battle_wins_are?(amount)                                                #
  174. #     .battle_wins_less_then?(amount)                                          #
  175. #     .battle_wins_more_then?(amount)                                          #
  176. #                                                                              #
  177. #                                                                              #
  178. #      Checks the number of battle losses.                                     #
  179. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                     #
  180. #     .battle_losses_are?(amount)                                              #
  181. #     .battle_losses_less_then?(amount)                                        #
  182. #     .battle_losses_more_then?(amount)                                        #
  183. #                                                                              #
  184. #                                                                              #
  185. #      Checks the number of battle escapes.                                    #
  186. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                    #
  187. #     .escape_count_is?(amount)                                                #
  188. #     .escape_count_less_then?(amount)                                         #
  189. #     .escape_count_more_then?(amount)                                         #
  190. #                                                                              #
  191. #                                                                              #
  192. #      Checks the if the leader is $game_actors x.                             #
  193. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                             #
  194. #     .leader_is?(actor_id)                                                    #
  195. #                                                                              #
  196. #                                                                              #
  197. #      Checks the total gold found durring game.                               #
  198. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                               #
  199. #     .total_gold_is?(amount)                                                  #
  200. #     .total_gold_is_less_then?(amount)                                        #
  201. #     .total_gold_is_more_then?(amount)                                        #
  202. #                                                                              #
  203. #                                                                              #
  204. #  ==========================================================================  #
  205. #    The following can be used with $game_system                               #
  206. #  ==========================================================================  #
  207. #                                                                              #
  208. #      For checking game time in seconds.                                      #
  209. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                      #
  210. #     .game_time_less_then?(amount_in_seconds)         time < amount           #
  211. #     .game_time_more_then?(amount_in_seconds)         time > amount           #
  212. #     .game_time_is?(amount_in_seconds)                time == amount          #
  213. #                                                                              #
  214. #                                                                              #
  215. #      For checking battle count.                                              #
  216. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~                                              #
  217. #     .battle_count_is?(amount)                                                #
  218. #     .battle_count_is_less_then?(amount)                                      #
  219. #     .battle_count_is_more_then?(amount)                                      #
  220. #                                                                              #
  221. #                                                                              #
  222. #      For checking save count.                                                #
  223. #      ~~~~~~~~~~~~~~~~~~~~~~~~                                                #
  224. #     .save_count_is?(amount)                                                  #
  225. #     .save_count_is_less_then?(amount)                                        #
  226. #     .save_count_is_more_then?(amount)                                        #
  227. #                                                                              #
  228. #                                                                              #
  229. #      For setting variables to PC time.                                       #
  230. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                       #
  231. #    ----------------------------------------------------------------------    #
  232. #    Note: Set these just before your check, if needed, but remember that      #
  233. #    each check is a new time stamp. Meanning if you are working in minutes    #
  234. #    there is a greater chance it will change while you are checking.          #
  235. #    ----------------------------------------------------------------------    #
  236. #     .pc_year                                         Actual Year             #
  237. #     .pc_month                                        Actual Month            #
  238. #     .pc_day                                          Actual Day              #
  239. #     .pc_wday                                         Actual Day              #
  240. #     .pc_hour                                         Actual Hour             #
  241. #     .pc_min                                          Actual Minute           #
  242. #                                                                              #
  243. #                                                                              #
  244. #      For checking PC time.                                                   #
  245. #      ~~~~~~~~~~~~~~~~~~~~~                                                   #
  246. #     .pc_year_is?(year)                               Year                    #
  247. #     .pc_month_is?(month)                             Numeric Month           #
  248. #     .pc_day_is?(day_of_the_month)                    Numeric Day             #
  249. #     .pc_wday_is?(day_of_the_week)                    Numeric Day(Sunday => 0)#
  250. #     .pc_hour_is?(hour)                               Hour                    #
  251. #     .pc_hour_is_less_then?(hour)                                             #
  252. #     .pc_hour_is_more_then?(hour)                                             #
  253. #     .pc_min_is?(min)                                 Minute                  #
  254. #     .pc_min_is_less_then?(min)                                               #
  255. #     .pc_min_is_more_then?(min)                                               #
  256. #                                                                              #
  257. #                                                                              #
  258. #  ==========================================================================  #
  259. #    The following can be used with                                            #
  260. #  $game_actors[i] || $game_party.members[i] || $game_party.battle_members[i]  #
  261. #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  #
  262. #   **  They are ment to be used in common events activated by spells/skills   #
  263. #  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  #
  264. #  ==========================================================================  #
  265. #                                                                              #
  266. #      For checking the id of the selected enemy.                              #
  267. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                              #
  268. #     .selected_enemy_id_is?(enemy_id)                                         #
  269. #                                                                              #
  270. #      Returns the id of the seleceted enemy.                                  #
  271. #      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                  #
  272. #     .selected_enemy_id                                                       #
  273. #                                                                              #
  274. #------------------------------------------------------------------------------#
  275. # ** Description                                                               #
  276. #------------------------------------------------------------------------------#
  277. #                                                                              #
  278. #  v0.1                                                                        #
  279. # ~=~=~=~                                                                      #
  280. #                                                                              #
  281. # Right now this script adds extra checks to be use in conditional barnches,   #
  282. # add a variable to keep track of gold spent in shops.                         #
  283. #                                                                              #
  284. #  v0.2                                                                        #
  285. # ~=~=~=~                                                                      #
  286. #                                                                              #
  287. # Added more checks.                                                           #
  288. #                                                                              #
  289. #  v0.3                                                                        #
  290. # ~=~=~=~                                                                      #
  291. #                                                                              #
  292. # Fixed a few bugs.                                                            #
  293. #                                                                              #
  294. #  v0.4                                                                        #
  295. # ~=~=~=~                                                                      #
  296. #                                                                              #
  297. # I added more checks for battle count, hp, hp%, and the same for mp and tp.   #
  298. #                                                                              #
  299. #  v0.5                                                                        #
  300. # ~=~=~=~                                                                      #
  301. #                                                                              #
  302. # I added more checks for save count, params, xparams, sparams, total gold     #
  303. # found durring the game.                                                      #
  304. #                                                                              #
  305. #  v1.0                                                                        #
  306. # ~=~=~=~                                                                      #
  307. #                                                                              #
  308. # I just added several checks for pc year, month, days, hours, and minutes.    #
  309. #                                                                              #
  310. #  v1.1                                                                        #
  311. # ~=~=~=~                                                                      #
  312. #                                                                              #
  313. # I fixed the average battle members level and pc_time checks. I also added    #
  314. # checks for the entire party.                                                 #
  315. #                                                                              #
  316. #  v1.2                                                                        #
  317. # ~=~=~=~                                                                      #
  318. #                                                                              #
  319. # I added checks for spells/skills to check the selected enemy id they are     #
  320. # being used on.                                                               #
  321. #                                                                              #
  322. #------------------------------------------------------------------------------#
  323. #==============================================================================#
  324.  
  325.  
  326. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  327. #                                                                              #
  328. #        DO NOT EDIT PASSED THIS POINT UNLESS YOU KNOW WHAT YOUR DOING.        #
  329. #                                                                              #
  330. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361. module BattleManager
  362.   class<<self; alias pv465654321 process_victory; end
  363.   def self.process_victory
  364.     pv465654321()
  365.     $game_party.bv += 1
  366.   end
  367.   class<<self; alias pd65163132154 process_defeat; end
  368.   def self.process_defeat
  369.     pd65163132154()
  370.     $game_party.bl += 1
  371.   end
  372.   class<<self; alias pe654113201321 process_escape; end
  373.   def self.process_escape
  374.     pe654113201321()
  375.     $game_party.excp += 1
  376.   end
  377. end  
  378. class Game_System
  379.   def save_count_is?(amount)
  380.     @save_count == amount
  381.   end
  382.   def save_count_is_less_then?(amount)
  383.     @save_count <= amount
  384.   end
  385.   def save_count_is_more_then?(amount)
  386.     @save_count >= amount
  387.   end
  388.   def battle_count_is?(amount)
  389.     @battle_count == amount
  390.   end
  391.   def battle_count_is_less_then?(amount)
  392.     @battle_count <= amount
  393.   end
  394.   def battle_count_is_more_then?(amount)
  395.     @battle_count >= amount
  396.   end
  397.   def pc_year
  398.     t = Time.now
  399.     t.year
  400.   end
  401.   def pc_month
  402.     t = Time.now
  403.     t.mon
  404.   end
  405.   def pc_day
  406.     t = Time.now
  407.     t.day
  408.   end
  409.   def pc_wday
  410.     t = Time.now
  411.     t.wday
  412.   end
  413.   def pc_hour
  414.     t = Time.now
  415.     t.hour
  416.   end
  417.   def pc_min
  418.     t = Time.now
  419.     t.min
  420.   end
  421.   def pc_year_is?(year)
  422.     t = Time.now
  423.     t.year == year
  424.   end
  425.   def pc_mon_is?(month)
  426.     t = Time.now
  427.     t.mon == month
  428.   end
  429.   def pc_day_is?(day_of_the_month)
  430.     t = Time.now
  431.     t.day == day_of_the_month
  432.   end
  433.   def pc_wday_is?(day_of_the_week)
  434.     t = Time.now
  435.     t.wday == day_of_the_week
  436.   end
  437.   def pc_hour_is?(hour)
  438.     t = Time.now
  439.     t.hour == hour
  440.   end
  441.   def pc_hour_is_less_then?(hour)
  442.     t = Time.now
  443.     t.hour <= hour
  444.   end
  445.   def pc_hour_is_more_then?(hour)
  446.     t = Time.now
  447.     t.hour >= hour
  448.   end
  449.   def pc_min_is?(min)
  450.     t = Time.now
  451.     t.min == min
  452.   end
  453.   def pc_min_is_less_then?(min)
  454.     t = Time.now
  455.     t.min <= min
  456.   end
  457.   def pc_min_is_more_then?(min)
  458.     t = Time.now
  459.     t.min >= min
  460.   end
  461.   def game_time_is?(amount_in_seconds)
  462.     Graphics.frame_count / Graphics.frame_rate  == amount_in_seconds
  463.   end
  464.   def game_time_less_then?(amount_in_seconds)
  465.     Graphics.frame_count / Graphics.frame_rate  <= amount_in_seconds
  466.   end
  467.   def game_time_more_then?(amount_in_seconds)
  468.     Graphics.frame_count / Graphics.frame_rate  >= amount_in_seconds
  469.   end
  470. end
  471. class Game_BattlerBase
  472.   def hp_is?(amount)
  473.     @hp == amount
  474.   end
  475.   def hp_is_less_then?(amount)
  476.     @hp <= amount
  477.   end
  478.   def hp_is_more_then?(amount)
  479.     @hp >= amount
  480.   end
  481.   def mp_is?(amount)
  482.     @mp == amount
  483.   end
  484.   def mp_is_less_then?(amount)
  485.     @mp <= amount
  486.   end
  487.   def mp_is_more_then?(amount)
  488.     @mp >= amount
  489.   end
  490.   def tp_is?(amount)
  491.     @tp == amount
  492.   end
  493.   def tp_is_less_then?(amount)
  494.     @tp <= amount
  495.   end
  496.   def tp_is_more_then?(amount)
  497.     @tp >= amount
  498.   end
  499.   def hp_percentage_is?(amount)
  500.     @hp / mhp == amount
  501.   end
  502.   def hp_percentage_is_less_then?(amount)
  503.     @hp / mhp <= amount
  504.   end
  505.   def hp_percentage_is_more_then?(amount)
  506.     @hp / mhp >= amount
  507.   end
  508.   def mp_percentage_is?(amount)
  509.     @mp / mmp == amount
  510.   end
  511.   def mp_percentage_is_less_then?(amount)
  512.     @mp / mmp <= amount
  513.   end
  514.   def mp_percentage_is_more_then?(amount)
  515.     @mp / mmp >= amount
  516.   end
  517.   def tp_percentage_is?(amount)
  518.     @tp / 100 == amount
  519.   end
  520.   def tp_percentage_is_less_then?(amount)
  521.     @tp / 100 <= amount
  522.   end
  523.   def tp_percentage_is_more_then?(amount)
  524.     @tp / 100 >= amount
  525.   end
  526. end
  527. class Game_Actor < Game_Battler
  528.   attr_accessor :selected_enemy_id                  
  529.   alias :su04214014027524524 :setup
  530.   def setup(actor_id)
  531.     su04214014027524524(actor_id)
  532.     @selected_enemy_id = 0
  533.   end
  534.   def selected_enemy_id_is?(enemy_id)
  535.     enemy_id == @selected_enemy_id
  536.   end
  537.   def selected_enemy_id
  538.     return @selected_enemy_id
  539.   end
  540.   def selected_enemy(enemy_id)
  541.     @selected_enemy_id = enemy_id
  542.   end
  543.   def param_is?(param_id, amount)
  544.     param(param_id) == amount
  545.   end
  546.   def param_is_less_then?(param_id, amount)
  547.     param(param_id) <= amount
  548.   end
  549.   def param_is_more_then?(param_id, amount)
  550.     param(param_id) >= amount
  551.   end
  552.   def sparam_is?(sparam_id, amount)
  553.     sparam(sparam_id) == amount
  554.   end
  555.   def sparam_is_less_then?(sparam_id, amount)
  556.     sparam(sparam_id) <= amount
  557.   end
  558.   def sparam_is_more_then?(sparam_id, amount)
  559.     sparam(sparam_id) >= amount
  560.   end
  561.   def xparam_is?(xparam_id, amount)
  562.     xparam(xparam_id) == amount
  563.   end
  564.   def xparam_is_less_then?(xparam_id, amount)
  565.     xparam(xparam_id) <= amount
  566.   end
  567.   def xparam_is_more_then?(xparam_id, amount)
  568.     xparam(xparam_id) >= amount
  569.   end
  570.   def has_weapon_equiped?
  571.     !weapons.compact.empty?
  572.   end
  573.   def has_armor_equiped?
  574.     !armors.compact.empty?
  575.   end
  576.   def has_armor_type?(type_id)
  577.     armors.compact.any? {|i| i.atype_id == type_id }
  578.   end
  579.   def has_weapon_type?(type_id)
  580.     weapons.compact.any? {|i| i.wtype_id == type_id }
  581.   end
  582. end
  583. class Game_Party < Game_Unit
  584.   attr_accessor   :tgf
  585.   attr_accessor   :gs
  586.   attr_accessor   :bv
  587.   attr_accessor   :bl
  588.   attr_accessor   :excp
  589.   alias :i72522752 :initialize
  590.   def initialize
  591.     i72522752()
  592.     @tgf = 0
  593.     @gs = 0
  594.     @bv = 0
  595.     @bl = 0
  596.     @excp = 0
  597.   end
  598.   alias :gg7050504 :gain_gold
  599.   def gain_gold(amount)
  600.     gg7050504(amount)
  601.     @tgf = (@tgf + amount)
  602.   end
  603.   def total_gold_is_more_then?(amount)
  604.     @tgf >= amount
  605.     p @tgf
  606.   end
  607.   def escape_count_is?(amount)
  608.     @esc == amount
  609.   end
  610.   def escape_count_less_then?(amount)
  611.     @esc <= amount
  612.   end
  613.   def escape_count_more_then?(amount)
  614.     @esc >= amount
  615.   end
  616.   def battle_wins_are?(amount)
  617.     @bv == amount
  618.   end
  619.   def battle_wins_less_then?(amount)
  620.     @bv <= amount
  621.   end
  622.   def battle_wins_more_then?(amount)
  623.     @bv >= amount
  624.   end
  625.   def battle_losses_are?(amount)
  626.     @bl == amount
  627.   end
  628.   def battle_losses_less_then?(amount)
  629.     @bl <= amount
  630.   end
  631.   def battle_losses_more_then?(amount)
  632.     @bl >= amount
  633.   end
  634.   def leader_is?(actor_id)
  635.     battle_members[0].id == $game_actors[id].id
  636.   end
  637.   def steps_are?(amount)
  638.     @steps  == amount
  639.   end
  640.   def steps_are_less_then?(amount)
  641.     @steps  <= amount
  642.   end
  643.   def steps_are_more_then?(amount)
  644.     @steps  >= amount
  645.   end
  646.   def less_then_amount_items?(item_id, amount)
  647.     @items[items[item_id].id] <= amount unless @items[item_id] == nil
  648.   end
  649.   def more_then_amount_items?(item_id, amount)
  650.     @items[items[item_id].id] >= amount unless @items[item_id] == nil
  651.   end
  652.   def fixed_amount_items?(item_id, amount)
  653.     @items[items[item_id].id] == amount unless @items[item_id] == nil
  654.   end
  655.   def amount_spent_is?(amount)
  656.     @gs == amount
  657.   end
  658.   def amount_spent_less_then?(amount)
  659.     @gs <= amount
  660.   end
  661.   def amount_spent_more_then?(amount)
  662.     @gs >= amount
  663.   end
  664.   def has_class?(class_id)
  665.     members.compact.any? { |i| i.class_id == class_id }
  666.   end
  667.   def total_plevel_is?(total)
  668.     c = 0
  669.     members.each { |i| c += i.level }
  670.     c == total
  671.   end
  672.   def total_plevel_less_then?(total)
  673.     c = 0
  674.     members.each { |i| c += i.level }
  675.     c <= total
  676.   end
  677.   def total_plevel_more_then?(total)
  678.     c = 0
  679.     members.each { |i| c += i.level }
  680.     c >= total
  681.   end
  682.   def average_plevel_is?(amount)
  683.     c = []
  684.     members.each { |i| c.push i.level }
  685.     (c.inject{ |sum, el| sum + el }.to_f / c.size)  == amount
  686.   end
  687.   def average_plevel_less_then?(amount)
  688.     c = []
  689.     members.each { |i| c.push i.level }
  690.     (c.inject{ |sum, el| sum + el }.to_f / c.size) <= amount
  691.   end
  692.   def average_plevel_more_then?(amount)
  693.     c = []
  694.     members.each { |i| c.push i.level }
  695.     (c.inject{ |sum, el| sum + el }.to_f / c.size)  >= amount
  696.   end
  697.   def total_level_is?(total)
  698.     c = 0
  699.     battle_members.each { |i| c += i.level }
  700.     c == total
  701.   end
  702.   def total_level_less_then?(total)
  703.     c = 0
  704.     battle_members.each { |i| c += i.level }
  705.     c <= total
  706.   end
  707.   def total_level_more_then?(total)
  708.     c = 0
  709.     battle_members.each { |i| c += i.level }
  710.     c >= total
  711.   end
  712.   def average_level_is?(amount)
  713.     c = []
  714.     battle_members.each { |i| c.push i.level }
  715.     (c.inject{ |sum, el| sum + el }.to_f / c.size)  == amount
  716.   end
  717.   def average_level_less_then?(amount)
  718.     c = []
  719.     battle_members.each { |i| c.push i.level }
  720.     (c.inject{ |sum, el| sum + el }.to_f / c.size) <= amount
  721.   end
  722.   def average_level_more_then?(amount)
  723.     c = []
  724.     battle_members.each { |i| c.push i.level }
  725.     (c.inject{ |sum, el| sum + el }.to_f / c.size)  >= amount
  726.   end
  727. end
  728. class Scene_Shop < Scene_MenuBase
  729.   alias :db70520504 :do_buy
  730.   def do_buy(number)
  731.     db70520504(number)
  732.     $game_party.gs += (number * buying_price)
  733.   end
  734. end
  735. class Scene_Battle < Scene_Base
  736.   alias :oeo505204504 :on_enemy_ok
  737.   def on_enemy_ok
  738.     BattleManager.actor.selected_enemy(@enemy_window.enemy.enemy_id)
  739.     oeo505204504()
  740.   end
  741.   alias :oec050404040 :on_enemy_cancel
  742.   def on_enemy_cancel
  743.     BattleManager.actor.selected_enemy(0)
  744.     oec050404040()
  745.   end
  746. end
Add Comment
Please, Sign In to add comment