Advertisement
TroyZ

FFL - TP Simple Configurator

Dec 13th, 2013
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.18 KB | None | 0 0
  1. # ==============================================================================
  2. # ▼▼▼▼▼▼                   FFL - TP Simple Configurator                   ▼▼▼▼▼▼
  3. # ==============================================================================
  4. # Script by : Agung Prasetyo(TroyZ)
  5. # Contact me by : - Email agung.endisnear.xyz@gmail.com
  6. #                 - Forum RPGMakerID, username TroyZ
  7. #                 - Handphone 085756289121
  8. # Engine : VXAce
  9. # Level : Easy
  10. # Version : 1.0
  11. #
  12. # WARNING !!!
  13. # Script ini dibuat khusus untuk FightForLife Series dan semua game yang
  14. # dikehendaki oleh saya. Tidak ada versi english untuk script ini. Pemakaian
  15. # diluar dari kehendak saya, harap tetap mengikuti aturan lisensi yang sudah
  16. # tertera di script ini.
  17. # ------------------------------------------------------------------------------
  18. # Change Logs :
  19. # 14 December 2013 : Version 1.0 released
  20. # ------------------------------------------------------------------------------
  21. # How this work :
  22. # Bosan dengan TP yang jumlahnya 100 terus? Script ini bisa merubah Max TP untuk
  23. # setiap aktor menjadi jumlah berapapun yang kamu inginkan. Kamu juga bisa
  24. # mengontrol total TP yang dimiliki aktor sepanjang permainan.
  25. # ------------------------------------------------------------------------------
  26. # How to use :
  27. # Pasang diantara material dan main. Pake notetag ini di aktor :
  28. #
  29. # <max tp: x>
  30. #
  31. # x diisi dengan angka. Misalnya :
  32. #
  33. # <max tp: 200>
  34. #
  35. # Berarti, Max TP untuk aktor ini adalah 200. Ada juga fungsi script call lain
  36. # yang bisa digunakan untuk mengatur jumlah TP yang dimiliki aktor :
  37. # - add_tp(actor_id, value)
  38. # - min_tp(actor_id, value)
  39. # - mul_tp(actor_id, value)
  40. # - div_tp(actor_id, value)
  41. #
  42. # Kalo add_tp buat tambahin TP sejumlah value ke actor_id yang bersangkutan.
  43. # Kalo min_tp buat kurangin TP sejumlah value ke actor_id yang bersangkutan.
  44. # Kalo mul_tp buat mengalikan TP sejumlah value ke actor_id yang bersangkutan.
  45. # Kalo div_tp buat membagi TP sejumlah value ke actor_id yang bersangkutan.
  46. #
  47. # actor_id diisi dengan id aktor yang bersangkutan, kalo value diisi angkanya.
  48. # ------------------------------------------------------------------------------
  49. # Compatibility issues :
  50. # Sejauh ini belum ada, masih aman-aman aja kok. Kalo ketemu bug, langsung lapor
  51. # aja, lewat contact di setiap script header ada kok.
  52. # ------------------------------------------------------------------------------
  53. # Who to credit :
  54. # - Allah swt. : Demi kesempatan yang sudah Dia berikan.
  55. # - Nabi Muhammad saw. : Nabi dari umat Islam dan pemimpin umat yang PERFECT.
  56. #                        Saya bangga jadi umatmu. :)
  57. # - Agung Prasetyo(TroyZ) : Ya saya, yang buat script kan saya. :P
  58. # ------------------------------------------------------------------------------
  59. # License :
  60. # - Free Game : HARUS credit nama-nama diatas
  61. # - Commercial Game : Sama dengan lisensi Free Game + gamenya yang full version
  62. #                     dibagikan kepada saya secara gratis.
  63. # ------------------------------------------------------------------------------
  64. $imported = {} if $imported.nil?
  65. $imported[:FFL_TPSimpleConfigurator] = true
  66. puts "Imported : FFL - TP Simple Configurator"
  67. # ------------------------------------------------------------------------------
  68. # Konfigurasi mulai dari sini
  69. # ------------------------------------------------------------------------------
  70. module FFL
  71.   module TP_SIMPLE_CONFIGURATOR
  72.     MAX_TP_DEFAULT = 100 # angka maksimum untuk TP secara default
  73.   end
  74. end
  75. # ------------------------------------------------------------------------------
  76. # Akhir dari konfigurasi
  77. # ------------------------------------------------------------------------------
  78.  
  79. # ------------------------------------------------------------------------------
  80. # Tidak boleh lewat
  81. # ------------------------------------------------------------------------------
  82. module DataManager
  83.   class << self
  84.     alias ffl_load_tp_simple_configurator_dbase_x    load_database
  85.   end
  86.  
  87.   def self.load_database
  88.     ffl_load_tp_simple_configurator_dbase_x
  89.     ffl_load_notetags_tp_simple_configurator_x
  90.   end
  91.  
  92.   def self.ffl_load_notetags_tp_simple_configurator_x
  93.     [$data_actors].each do |object|
  94.       object.each do |obj|
  95.         next unless obj
  96.         obj.ffl_load_notetags_tp_simple_configurator_x
  97.       end
  98.     end
  99.   end
  100. end
  101.  
  102. class RPG::Actor < RPG::BaseItem
  103.  
  104.   include FFL::TP_SIMPLE_CONFIGURATOR
  105.  
  106.   attr_accessor :max_tp  
  107.  
  108.   def ffl_load_notetags_tp_simple_configurator_x
  109.     @max_tp = MAX_TP_DEFAULT
  110.     self.note.split(/[\r\n]+/).each { |baris|
  111.       case baris
  112.       when /<(?:max tp):[ ]*(\d+)>/i
  113.         @max_tp = $1.to_i
  114.       end
  115.     }
  116.   end  
  117. end
  118.  
  119. class Game_BattlerBase
  120.   include FFL::TP_SIMPLE_CONFIGURATOR
  121.  
  122.   def max_tp
  123.     return actor.max_tp if actor?
  124.     return MAX_TP_DEFAULT
  125.   end
  126. end
  127.  
  128. class Game_Interpreter
  129.   def add_tp(actor_id, value)
  130.     $game_actors[actor_id].tp += value
  131.   end
  132.  
  133.   def min_tp(actor_id, value)
  134.     $game_actors[actor_id].tp -= value
  135.   end
  136.  
  137.   def mul_tp(actor_id, value)
  138.     $game_actors[actor_id].tp *= value
  139.   end
  140.  
  141.   def div_tp(actor_id, value)
  142.     $game_actors[actor_id].tp /= value
  143.   end
  144. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement