Advertisement
Dekita

Untitled

Apr 19th, 2014
937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.11 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - FF Style Status Effects
  5. # -- Author : Dekita
  6. # -- Version : 1.1
  7. # -- Level : Easy / Normal
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:FFSSE]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 15/o4/2o14 - Small Bugfixx,
  21. # 14/o4/2o14 - Started, Finished,
  22. #
  23. #===============================================================================
  24. # ☆ Introduction
  25. #-------------------------------------------------------------------------------
  26. # This script allows you to recreate some of the states from the final fantasy
  27. # series.
  28. #
  29. # Obviously, most status effects can already be made; however, there are a few
  30. # that cannot, such as; autolife, disease, reverse.
  31. # This script allows the creation of the aforementioned status effects.
  32. #
  33. #===============================================================================
  34. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  35. #===============================================================================
  36. # 1. You MUST give credit to "Dekita" !!
  37. # 2. You are NOT allowed to repost this script.(or modified versions)
  38. # 3. You are NOT allowed to convert this script.
  39. # 4. You are NOT allowed to use this script for Commercial games.
  40. # 5. ENJOY!
  41. #
  42. # "FINE PRINT"
  43. # By using this script you hereby agree to the above terms and conditions,
  44. # if any violation of the above terms occurs "legal action" may be taken.
  45. # Not understanding the above terms and conditions does NOT mean that
  46. # they do not apply to you.
  47. # If you wish to discuss the terms and conditions in further detail you can
  48. # contact me at http://dekitarpg.wordpress.com/
  49. #
  50. #===============================================================================
  51. # ☆ Instructions
  52. #-------------------------------------------------------------------------------
  53. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  54. #
  55. #===============================================================================
  56. # ☆ Notetags ( default )
  57. #-------------------------------------------------------------------------------
  58. # <autolife>
  59. # This notetag will automatically revive the afflicted battler when they die.
  60. # All states are removed and HP is refilled 100%
  61. #
  62. # <hp disease>
  63. # <mp disease>
  64. # <tp disease>
  65. # These notetags enable 'disease' for the afflicted battler.
  66. # Disease will reduce the stats 'max value' to the current value.
  67. # eg. if actor has 100 hp and becomes hp diseased, they then lose 50 hp, their
  68. # new max hp will be 50, until the status effect wears off.
  69. #
  70. # <reverse>
  71. # This notetag causes the damage dealt/taken to be reversed whilse under the
  72. # influence of the affliction.
  73. #
  74. #===============================================================================
  75. # ☆ HELP
  76. #-------------------------------------------------------------------------------
  77. # N/A
  78. #===============================================================================
  79. module FFSSE
  80. #===============================================================================
  81. #-----------------------------------------------------------------------------
  82. #
  83. #-----------------------------------------------------------------------------
  84. Notes={
  85. :auto_life => /<autolife>/i,
  86. :hp_disease => /<hp disease>/i,
  87. :mp_disease => /<mp disease>/i,
  88. :tp_disease => /<tp disease>/i,
  89. :reverse => /<reverse>/i,
  90. } #####################
  91. # CUSTOMISATION END #
  92. end #####################
  93. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  94. # #
  95. # http://dekitarpg.wordpress.com/ #
  96. # #
  97. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  98. #===============================================================================#
  99. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  100. # YES?\.\. #
  101. # OMG, REALLY? \| #
  102. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  103. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  104. #===============================================================================#
  105. module DataManager
  106. #===============================================================================
  107. #-----------------------------------------------------------------------------
  108. #
  109. #-----------------------------------------------------------------------------
  110. class << self
  111. alias :load_database_FFSSE :load_database
  112. end
  113. #-----------------------------------------------------------------------------
  114. #
  115. #-----------------------------------------------------------------------------
  116. def self.load_database
  117. load_database_FFSSE
  118. load_notetags_FFSSE
  119. end
  120. #-----------------------------------------------------------------------------
  121. #
  122. #-----------------------------------------------------------------------------
  123. def self.load_notetags_FFSSE
  124. for obj in $data_states
  125. next if obj.nil?
  126. obj.load_FFSSE
  127. end
  128. end
  129. end
  130. #===============================================================================
  131. module FFSSE_DATA
  132. #===============================================================================
  133. #-----------------------------------------------------------------------------
  134. #
  135. #-----------------------------------------------------------------------------
  136. attr_accessor :ffsse
  137. #-----------------------------------------------------------------------------
  138. #
  139. #-----------------------------------------------------------------------------
  140. def init_FFSSE_variables
  141. @ffsse = FFSSE_States.new
  142. end
  143. #-----------------------------------------------------------------------------
  144. #
  145. #-----------------------------------------------------------------------------
  146. def load_FFSSE_notetags
  147. self.note.split(/[\r\n]+/).each do |line|
  148. case line
  149. when FFSSE::Notes[:auto_life] then @ffsse.autolife = true
  150. when FFSSE::Notes[:hp_disease] then @ffsse.hp_disease = true
  151. when FFSSE::Notes[:mp_disease] then @ffsse.mp_disease = true
  152. when FFSSE::Notes[:tp_disease] then @ffsse.tp_disease = true
  153. when FFSSE::Notes[:reverse] then @ffsse.reverse = true
  154. end
  155. end
  156. end
  157. end
  158. #===============================================================================
  159. class RPG::State < RPG::BaseItem
  160. #===============================================================================
  161. #-----------------------------------------------------------------------------
  162. #
  163. #-----------------------------------------------------------------------------
  164. include FFSSE_DATA
  165. #-----------------------------------------------------------------------------
  166. #
  167. #-----------------------------------------------------------------------------
  168. def load_FFSSE
  169. init_FFSSE_variables
  170. load_FFSSE_notetags
  171. end
  172. end
  173. #===============================================================================
  174. class FFSSE_States
  175. #===============================================================================
  176. #-----------------------------------------------------------------------------
  177. #
  178. #-----------------------------------------------------------------------------
  179. attr_accessor :autolife
  180. attr_accessor :hp_disease
  181. attr_accessor :mp_disease
  182. attr_accessor :tp_disease
  183. attr_accessor :reverse
  184. #-----------------------------------------------------------------------------
  185. #
  186. #-----------------------------------------------------------------------------
  187. def initialize
  188. @autolife = false
  189. @hp_disease = false
  190. @mp_disease = false
  191. @tp_disease = false
  192. @reverse = false
  193. end
  194. end
  195. #===============================================================================
  196. class Game_Battler < Game_BattlerBase
  197. #===============================================================================
  198. #-----------------------------------------------------------------------------
  199. #
  200. #-----------------------------------------------------------------------------
  201. alias :ffsse_add_state :add_state
  202. alias :ffsse_remove_state :remove_state
  203. alias :ffsse_param :param
  204. alias :ffsse_max_tp :max_tp
  205. alias :ffsse_refresh :refresh
  206. alias :ffsse_execute_damage :execute_damage
  207. #-----------------------------------------------------------------------------
  208. #
  209. #-----------------------------------------------------------------------------
  210. def add_state(state_id)
  211. add_disease_state(state_id)
  212. ffsse_add_state(state_id)
  213. end
  214. #-----------------------------------------------------------------------------
  215. #
  216. #-----------------------------------------------------------------------------
  217. def remove_state(state_id)
  218. remove_disease_state(state_id)
  219. ffsse_remove_state(state_id)
  220. end
  221. #-----------------------------------------------------------------------------
  222. #
  223. #-----------------------------------------------------------------------------
  224. def setup_disease
  225. reset_hp_disease
  226. reset_mp_disease
  227. reset_tp_disease
  228. end
  229. #-----------------------------------------------------------------------------
  230. #
  231. #-----------------------------------------------------------------------------
  232. def perform_autolife
  233. return false unless states.any? {|i| i.ffsse.autolife }
  234. @hp = mhp
  235. clear_states
  236. clear_buffs
  237. return true
  238. end
  239. #-----------------------------------------------------------------------------
  240. #
  241. #-----------------------------------------------------------------------------
  242. def add_disease_state(id)
  243. return unless state_addable?(id) && !state?(id)
  244. @disease_hp[0] = true if $data_states[id].ffsse.hp_disease
  245. @disease_mp[0] = true if $data_states[id].ffsse.mp_disease
  246. @disease_tp[0] = true if $data_states[id].ffsse.tp_disease
  247. end
  248. #-----------------------------------------------------------------------------
  249. #
  250. #-----------------------------------------------------------------------------
  251. def remove_disease_state(id)
  252. return unless state?(id)
  253. @disease_hp[0] = false if $data_states[id].ffsse.hp_disease
  254. @disease_mp[0] = false if $data_states[id].ffsse.mp_disease
  255. @disease_tp[0] = false if $data_states[id].ffsse.tp_disease
  256. end
  257. #-----------------------------------------------------------------------------
  258. #
  259. #-----------------------------------------------------------------------------
  260. def param(param_id)
  261. if @disease_hp && @disease_mp
  262. case param_id
  263. when 0 then return @disease_hp[2] if @disease_hp[0]
  264. when 1 then return @disease_mp[2] if @disease_mp[0]
  265. end
  266. end
  267. return ffsse_param(param_id)
  268. end
  269. #-----------------------------------------------------------------------------
  270. #
  271. #-----------------------------------------------------------------------------
  272. def max_tp
  273. if @disease_tp
  274. return @disease_tp[2] if @disease_tp[0]
  275. end
  276. return ffsse_max_tp
  277. end
  278. #-----------------------------------------------------------------------------
  279. #
  280. #-----------------------------------------------------------------------------
  281. def refresh
  282. ffsse_refresh
  283. refresh_disease
  284. end
  285. #-----------------------------------------------------------------------------
  286. #
  287. #-----------------------------------------------------------------------------
  288. def refresh_disease
  289. return setup_disease unless @disease_hp
  290. @disease_hp[2] = @hp if @disease_hp[0]
  291. @disease_mp[2] = @mp if @disease_mp[0]
  292. @disease_tp[2] = @tp if @disease_tp[0]
  293. end
  294. #-----------------------------------------------------------------------------
  295. #
  296. #-----------------------------------------------------------------------------
  297. def reset_hp_disease
  298. @disease_hp = [false,mhp,mhp]
  299. end
  300. #-----------------------------------------------------------------------------
  301. #
  302. #-----------------------------------------------------------------------------
  303. def reset_mp_disease
  304. @disease_mp = [false,mmp,mmp]
  305. end
  306. #-----------------------------------------------------------------------------
  307. #
  308. #-----------------------------------------------------------------------------
  309. def reset_tp_disease
  310. @disease_tp = [false,max_tp,max_tp]
  311. end
  312. #-----------------------------------------------------------------------------
  313. #
  314. #-----------------------------------------------------------------------------
  315. def execute_damage(user)
  316. damage_reverse(user)
  317. ffsse_execute_damage(user)
  318. end
  319. #-----------------------------------------------------------------------------
  320. #
  321. #-----------------------------------------------------------------------------
  322. def damage_reverse(user)
  323. return unless states.any? {|i| i.ffsse.reverse }
  324. if @result.hp_damage > 0
  325. @result.hp_damage = -@result.hp_damage
  326. else
  327. amnt = 999999
  328. diff = amnt-@result.hp_damage
  329. @result.hp_damage = (amnt-diff).to_i
  330. end
  331. end
  332. end
  333. #===============================================================================
  334. class Game_Actor < Game_Battler
  335. #===============================================================================
  336. #-----------------------------------------------------------------------------
  337. #
  338. #-----------------------------------------------------------------------------
  339. alias :ffsse_setup :setup
  340. alias :ffsse_die :die
  341. #-----------------------------------------------------------------------------
  342. #
  343. #-----------------------------------------------------------------------------
  344. def setup(*args,&block)
  345. ffsse_setup(*args,&block)
  346. setup_disease
  347. end
  348. #-----------------------------------------------------------------------------
  349. #
  350. #-----------------------------------------------------------------------------
  351. def die
  352. return if perform_autolife
  353. ffsse_die
  354. end
  355. end
  356. #===============================================================================
  357. class Game_Enemy < Game_Battler
  358. #===============================================================================
  359. #-----------------------------------------------------------------------------
  360. #
  361. #-----------------------------------------------------------------------------
  362. alias :ffsse_setup :initialize
  363. alias :ffsse_die :die
  364. #-----------------------------------------------------------------------------
  365. #
  366. #-----------------------------------------------------------------------------
  367. def initialize(*args,&block)
  368. ffsse_setup(*args,&block)
  369. setup_disease
  370. end
  371. #-----------------------------------------------------------------------------
  372. #
  373. #-----------------------------------------------------------------------------
  374. def die
  375. return if perform_autolife
  376. ffsse_die
  377. end
  378. end
  379. #==============================================================================#
  380. # http://dekitarpg.wordpress.com/ #
  381. #==============================================================================#
  382. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement