Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # TheoAllen - Additional (Fixed) Parameters
- # Version : 1.0
- # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
- # (This script documentation is written in informal indonesian language)
- # =============================================================================
- ($imported ||= {})[:Theo_FixedParam] = true
- # =============================================================================
- # Change Logs:
- # -----------------------------------------------------------------------------
- # 2013.12.02 - Started and Finished script
- # =============================================================================
- =begin
- Perkenalan :
- Dalam feature default RMVXA kamu hanya bisa mengubah-ubah parameter dalam
- persen. Dengan artian kamu ngga bisa bikin state yang nambah parameter
- dengan nilai yang konstan / fixed. Seperti attack akan ditambah dengan
- nilai konstant seperti +10 atau semacamnya.
- Cara penggunaan :
- Pasang script ini di bawah material namun diatas main
- Gunakan notetag seperti di bawah ini pada notebox state
- Untuk pertambahan (ganti n dengan angka *udontsay)
- <mhp: +n>
- <mmp: +n>
- <atk: +n>
- <def: +n>
- <mat: +n>
- <mdf: +n>
- <agi: +n>
- <luk: +n>
- Untuk pengurangan, ganti + dengan -
- Misalnya
- <mdf: +100>
- <atk: -100>
- Terms of use :
- Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih
- keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau
- dipake buat komersil, jangan lupa, gw dibagi gratisannya.
- =end
- # =============================================================================
- # No config ~
- # =============================================================================
- class RPG::State < RPG::BaseItem
- attr_accessor :fixed_params
- def load_fixed_params
- @fixed_params = Array.new(8) {0}
- note.split(/[\r\n]+/).each do |line|
- case line
- when /<mhp\s*:\s*(\+|-)(\d+)>/i
- if $1.to_s == "+"
- @fixed_params[0] = $2.to_i
- else
- @fixed_params[0] = $2.to_i * -1
- end
- when /<mmp\s*:\s*(\+|-)(\d+)>/i
- if $1.to_s == "+"
- @fixed_params[1] = $2.to_i
- else
- @fixed_params[1] = $2.to_i * -1
- end
- when /<atk\s*:\s*(\+|-)(\d+)>/i
- if $1.to_s == "+"
- @fixed_params[2] = $2.to_i
- else
- @fixed_params[2] = $2.to_i * -1
- end
- when /<def\s*:\s*(\+|-)(\d+)>/i
- if $1.to_s == "+"
- @fixed_params[3] = $2.to_i
- else
- @fixed_params[3] = $2.to_i * -1
- end
- when /<mat\s*:\s*(\+|-)(\d+)>/i
- if $1.to_s == "+"
- @fixed_params[4] = $2.to_i
- else
- @fixed_params[4] = $2.to_i * -1
- end
- when /<mdf\s*:\s*(\+|-)(\d+)>/i
- if $1.to_s == "+"
- @fixed_params[5] = $2.to_i
- else
- @fixed_params[5] = $2.to_i * -1
- end
- when /<agi\s*:\s*(\+|-)(\d+)>/i
- if $1.to_s == "+"
- @fixed_params[6] = $2.to_i
- else
- @fixed_params[6] = $2.to_i * -1
- end
- when /<luk\s*:\s*(\+|-)(\d+)>/i
- if $1.to_s == "+"
- @fixed_params[7] = $2.to_i
- else
- @fixed_params[7] = $2.to_i * -1
- end
- end # case
- end # each
- end # load_fixed_params
- end
- class << DataManager
- alias theo_fixedparam_load_db load_database
- def load_database
- theo_fixedparam_load_db
- $data_states.compact.each do |state|
- state.load_fixed_params
- end
- end
- end
- class Game_Battler < Game_BattlerBase
- alias theo_fixedparam_param param
- def param(param_id)
- result = theo_fixedparam_param(param_id)
- result += calc_fixed_param(param_id)
- [[result, param_max(param_id)].min, param_min(param_id)].max.to_i
- end
- def calc_fixed_param(param_id)
- result = states.inject(0) do |r,state|
- r + state.fixed_params[param_id]
- end
- if $imported[:Theo_PassiveSkill] && actor?
- result += passive_skills.inject(0) do |r,state|
- r + state.fixed_params[param_id]
- end
- end
- return result
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment