Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Alignment
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy / Normal
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Alignment]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # o4/o4/2o14 - Finished,
- # o3/o4/2o14 - Started
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script allows for actors to have their own individual 'alignment'.
- # Alignment can be changed by defeating enemies that have been notetagged to
- # give alignment points on death. There are also various script calls to use.
- #
- # Alignment can change various things about each actor. Including their stats,
- # image, face and skills.
- # The stats that can be changed are params, xparams, sparams, atk lvl, def lvl,
- # atk element, def element, parent stats, max tp. This all depends on what
- # scripts of mine you are using.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- # ☆ Script Calls
- #-------------------------------------------------------------------------------
- # $game_actors[ACTOR_ID].alignment_setup(ID)
- # ^- Changes ACTOR_ID's alignment 'Setup' id to 'ID'
- #
- # $game_actors[ACTOR_ID].act_good(VAL)
- # $game_actors[ACTOR_ID].act_evil(VAL)
- # ^- Changes ACTOR_ID's alignment value by VAL
- #
- # $game_actors[ACTOR_ID].mod_alignment_rate(MOD_TYPE,VAL)
- # ^- Changes ACTOR_ID's alignment rate.
- # MOD_TYPE:
- # :set - sets the rate to VAL
- # :add - adds VAL onto current rate
- # :sub - subtracts VAL from current rate
- # :div - Divides current rate by VAL
- # :mul - multiplies current rate by VAL
- # :mod - current rate modulo(%) VAL
- #
- # $game_actors[ACTOR_ID].alignment
- # Returns the actors alignment object. Dont use unless you know how to.
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- # N/A
- #
- #===============================================================================
- module Alignment ; Setup=[] # << KEEP
- #===============================================================================
- #-----------------------------------------------------------------------------
- # If Mod_Charface is true, when an actor is fully good/evil thei character
- # image and face image will change.
- # The new char/face images must have the same name as the actors normal
- # char/face images. eg. if your charset and faceset are both called
- # 'Actor1', the script will check for 'Actor1_Evil' or 'Actor1_Good'
- # NOTE: If you do not have the images, this can cause errors.
- #-----------------------------------------------------------------------------
- Mod_Charface = false
- #-----------------------------------------------------------------------------
- # = [icon id, hue]
- #-----------------------------------------------------------------------------
- Good_Icon = [61,0]
- Evil_Icon = [62,0]
- Neut_Icon = [63,0]
- #-----------------------------------------------------------------------------
- # = ['text', text color]
- #-----------------------------------------------------------------------------
- Good_Text = ['Good',Text_Color::Sky_Blue]
- Evil_Text = ['Evil',Text_Color::Deep_Red]
- Neut_Text = ['Neutral',Text_Color::White]
- #-----------------------------------------------------------------------------
- # Show ? = [ ? , x, y]
- #-----------------------------------------------------------------------------
- Show_Icon = [true, 0, 0]
- Show_Text = [true, 26, 0]
- #-----------------------------------------------------------------------------
- # Enemy Notetags :
- # <align good: val>
- # <align evil: val>
- #-----------------------------------------------------------------------------
- Good_Pts_Note = /<align good:(.*)>/i
- Evil_Pts_Note = /<align evil:(.*)>/i
- #-----------------------------------------------------------------------------
- # Max value for both good/evil alignment.
- # If 100, there wil be a 200 value difference between good and evil.
- #-----------------------------------------------------------------------------
- Max_Value = 100
- #-----------------------------------------------------------------------------
- # Default Setup[ id ]
- #-----------------------------------------------------------------------------
- Default_Setup = 0
- #-----------------------------------------------------------------------------
- # Setup Help Info
- #-----------------------------------------------------------------------------
- # [:param , id, value],
- # [:x_param , id, value],
- # [:s_param , id, value],
- # [:atk_ele , id, value],
- # [:def_ele , id, value],
- # [:spds_stat , id, value]
- # [:atk_lvl , value],
- # [:def_lvl , value],
- # [:max_tp , value],
- # [:skill , id, alignment_req],
- #-----------------------------------------------------------------------------
- # Setup[ 0 ]
- #-----------------------------------------------------------------------------
- Setup[0]={
- :good => [
- [:def_lvl , 50],
- [:atk_ele , 9, 0.5],
- [:def_ele , 9, 0.5],
- [:atk_ele ,10,-0.5],
- [:def_ele ,10,-0.5],
- [:skill ,48, 50],
- [:max_tp , 100],
- ],
- :evil => [
- [:atk_lvl , 50],
- [:atk_ele ,10, 0.5],
- [:def_ele ,10, 0.5],
- [:atk_ele , 9,-0.5],
- [:def_ele , 9,-0.5],
- [:skill ,49, 50],
- [:max_tp , 100],
- ],
- }
- #-----------------------------------------------------------------------------
- # Setup[ 1 ]
- #-----------------------------------------------------------------------------
- Setup[1]={
- :good => [
- [:param , 0, 1000],
- [:param , 2, 100],
- [:param , 4, 100],
- ],
- :evil => [
- [:param , 1, 1000],
- [:param , 3, 100],
- [:param , 5, 100],
- ],
- }
- #-----------------------------------------------------------------------------
- # << Add more Setup[ id ]'s here.
- # Follow the same format as above.
- #-----------------------------------------------------------------------------
- #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- module Vocanicon
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- AGT = Alignment::Good_Text[0]
- AGC = Alignment::Good_Text[1]
- AGI = Alignment::Good_Icon[0]
- AGH = Alignment::Good_Icon[1]
- AET = Alignment::Evil_Text[0]
- AEC = Alignment::Evil_Text[1]
- AEI = Alignment::Evil_Icon[0]
- AEH = Alignment::Evil_Icon[1]
- ANT = Alignment::Neut_Text[0]
- ANC = Alignment::Neut_Text[1]
- ANI = Alignment::Neut_Icon[0]
- ANH = Alignment::Neut_Icon[1]
- #-----------------------------------------------------------------------------
- # [Nam,Col,icn,hue]
- #-----------------------------------------------------------------------------
- Align_Good = [AGT,AGC,AGI,AGH]
- Align_Evil = [AET,AEC,AEI,AEH]
- Align_Neut = [ANT,ANC,ANI,ANH]
- end
- #===============================================================================
- module DataManager
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- class << self
- alias :lbd_alignment :load_database
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.load_database
- lbd_alignment
- loa_alignment
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def self.loa_alignment
- for o in $data_enemies
- next if o == nil
- o.load_alignment
- end
- end
- end # DataManager
- #===============================================================================
- class RPG::Enemy < RPG::BaseItem
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_accessor :good_align_pts
- attr_accessor :evil_align_pts
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def load_alignment
- @good_align_pts=0
- @evil_align_pts=0
- self.note.split(/[\r\n]+/).each do |line|
- case line
- when Alignment::Good_Pts_Note then @good_align_pts = $1.to_i
- when Alignment::Evil_Pts_Note then @evil_align_pts = $1.to_i
- end
- end
- end
- end
- #===============================================================================
- class Battler_Alignment
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- include Alignment
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_accessor :setup
- attr_accessor :good_param
- attr_accessor :good_xparam
- attr_accessor :good_sparam
- attr_accessor :good_atk_ele
- attr_accessor :good_def_ele
- attr_accessor :good_atl_dfl
- attr_accessor :good_spds_stats
- attr_accessor :good_max_tp
- attr_accessor :good_skills
- attr_accessor :evil_param
- attr_accessor :evil_xparam
- attr_accessor :evil_sparam
- attr_accessor :evil_atk_ele
- attr_accessor :evil_def_ele
- attr_accessor :evil_atl_dfl
- attr_accessor :evil_spds_stats
- attr_accessor :evil_max_tp
- attr_accessor :evil_skills
- attr_accessor :total_param
- attr_accessor :total_xparam
- attr_accessor :total_sparam
- attr_accessor :total_atk_ele
- attr_accessor :total_def_ele
- attr_accessor :total_atl_dfl
- attr_accessor :total_spds_stats
- attr_accessor :total_max_tp
- attr_accessor :total_skills
- attr_accessor :default_character_name
- attr_accessor :default_character_index
- attr_accessor :default_face_name
- attr_accessor :default_face_index
- attr_accessor :rate
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize(id=Alignment::Default_Setup)
- reset(id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def reset(id)
- initialize_v(id)
- initialize_good
- initialize_evil
- initialize_total
- initialize_char_face
- setup_good
- setup_evil
- setup_total
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize_v(id)
- @setup = Setup[id]
- @rate = 1.0
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize_good
- @good_value = 0
- @good_param = [0] * 8
- @good_xparam = [0] * 10
- @good_sparam = [0] * 10
- @good_atk_ele = [0] * $data_system.elements.size
- @good_def_ele = [0] * $data_system.elements.size
- @good_atl_dfl = [0] * 2
- @good_spds_stats = [0] * 8
- @good_spds_stats = [0] * SPDS::Commands.size if $D13x[:ISPDS]
- @good_max_tp = 0
- @good_skills = []
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize_evil
- @evil_value = 0
- @evil_param = [0] * 8
- @evil_xparam = [0] * 10
- @evil_sparam = [0] * 10
- @evil_atk_ele = [0] * $data_system.elements.size
- @evil_def_ele = [0] * $data_system.elements.size
- @evil_atl_dfl = [0] * 2
- @evil_spds_stats = [0] * 8
- @evil_spds_stats = [0] * SPDS::Commands.size if $D13x[:ISPDS]
- @evil_max_tp = 0
- @evil_skills = []
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize_total
- @total_param = [0] * 8
- @total_xparam = [0] * 10
- @total_sparam = [0] * 10
- @total_atk_ele = [0] * $data_system.elements.size
- @total_def_ele = [0] * $data_system.elements.size
- @total_atl_dfl = [0] * 2
- @total_spds_stats = [0] * 8
- @total_spds_stats = [0] * SPDS::Commands.size if $D13x[:ISPDS]
- @total_max_tp = 0
- @total_skills = []
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize_char_face
- @default_character_name = ''
- @default_character_index = 0
- @default_face_name = ''
- @default_face_index = 0
- @good_character_name = ''
- @good_character_index = 0
- @good_face_name = ''
- @good_face_index = 0
- @evil_character_name = ''
- @evil_character_index = 0
- @evil_face_name = ''
- @evil_face_index = 0
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_good
- @setup[:good].each do |i|
- case i[0]
- when :param then @good_param [i[1]] = i[2] if $D13x[:Stats_Control]
- when :x_param then @good_xparam [i[1]] = i[2] if $D13x[:Stats_Control]
- when :s_param then @good_sparam [i[1]] = i[2] if $D13x[:Stats_Control]
- when :atk_ele then @good_atk_ele[i[1]] = i[2] if $D13x[:Elems_Control]
- when :def_ele then @good_def_ele[i[1]] = i[2] if $D13x[:Elems_Control]
- when :atk_lvl then @good_atl_dfl[0] = i[1] if $D13x[:Atk_Def_Lvs]
- when :def_lvl then @good_atl_dfl[1] = i[1] if $D13x[:Atk_Def_Lvs]
- when :spds_stat then @good_spds_stats[i[1]] = i[2] if $D13x[:ISPDS]
- when :max_tp then @good_max_tp = i[1] if $D13x[:TP_Control]
- when :skill then @good_skills << [i[1],i[2]]
- end
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_evil
- @setup[:evil].each do |i|
- case i[0]
- when :param then @evil_param [i[1]] = i[2] if $D13x[:Stats_Control]
- when :x_param then @evil_xparam [i[1]] = i[2] if $D13x[:Stats_Control]
- when :s_param then @evil_sparam [i[1]] = i[2] if $D13x[:Stats_Control]
- when :atk_ele then @evil_atk_ele[i[1]] = i[2] if $D13x[:Elems_Control]
- when :def_ele then @evil_def_ele[i[1]] = i[2] if $D13x[:Elems_Control]
- when :atk_lvl then @evil_atl_dfl[0] = i[1] if $D13x[:Atk_Def_Lvs]
- when :def_lvl then @evil_atl_dfl[1] = i[1] if $D13x[:Atk_Def_Lvs]
- when :spds_stat then @evil_spds_stats[i[1]] = i[2] if $D13x[:ISPDS]
- when :max_tp then @evil_max_tp = i[1] if $D13x[:TP_Control]
- when :skill then @evil_skills << [i[1],i[2]]
- end
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total
- setup_total_param
- setup_total_xparam
- setup_total_sparam
- setup_total_atk_ele
- setup_total_def_ele
- setup_total_atl_dfl
- setup_total_spds_stats
- setup_total_max_tp
- setup_total_skills
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total_param
- m = max_value
- g = good_value
- e = evil_value
- 8.times do |i|
- par = g > 0 ? ((@good_param[i]/m)*g) : ((@evil_param[i]/m)*e)
- @total_param[i] = par.to_i
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total_xparam
- m = max_value
- g = good_value
- e = evil_value
- 10.times do |i|
- par = g > 0 ? ((@good_xparam[i]/m)*g) : ((@evil_xparam[i]/m)*e)
- @total_xparam[i] = par.to_f
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total_sparam
- m = max_value
- g = good_value
- e = evil_value
- 10.times do |i|
- par = g > 0 ? ((@good_sparam[i]/m)*g) : ((@evil_sparam[i]/m)*e)
- @total_sparam[i] = par.to_f
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total_atk_ele
- m = max_value
- g = good_value
- e = evil_value
- @total_atk_ele.size.times do |i|
- par = g > 0 ? ((@good_atk_ele[i]/m)*g) : ((@evil_atk_ele[i]/m)*e)
- @total_atk_ele[i] = par.to_f
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total_def_ele
- m = max_value
- g = good_value
- e = evil_value
- @total_def_ele.size.times do |i|
- p @good_def_ele[i]/m*g
- par = g > 0 ? ((@good_def_ele[i]/m)*g) : ((@evil_def_ele[i]/m)*e)
- @total_def_ele[i] = par.to_f
- end
- p @total_def_ele
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total_atl_dfl
- m = max_value
- g = good_value
- e = evil_value
- 2.times do |i|
- par = g > 0 ? ((@good_atl_dfl[i]/m)*g) : ((@evil_atl_dfl[i]/m)*e)
- @total_atl_dfl[i] = par.to_i
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total_spds_stats
- m = max_value
- g = good_value
- e = evil_value
- @total_spds_stats.size.times do |i|
- par = g > 0 ? ((@good_spds_stats[i]/m)*g) : ((@evil_spds_stats[i]/m)*e)
- @total_spds_stats[i] = par.to_i
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total_max_tp
- m = max_value
- g = good_value
- e = evil_value
- par = g > 0 ? ((@good_max_tp/m)*g) : ((@evil_max_tp/m)*e)
- @total_max_tp = par.to_i
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_total_skills
- m = max_value
- g = good_value
- e = evil_value
- clone_good(m,g)
- clone_evil(m,e)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def clone_good(m,g)
- @good_skills.each do |s|
- @total_skills << s[0] if g >= s[1]
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def clone_evil(m,e)
- @evil_skills.each do |s|
- @total_skills << s[0] if e >= s[1]
- end
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def refresh
- initialize_total
- setup_total
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def max_value
- Alignment::Max_Value
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def good_value
- return 0 if @evil_value >= max_value
- return @good_value
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def evil_value
- return 0 if @good_value >= max_value
- return @evil_value
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def is_good?
- return false if @evil_value > 0
- return true if @good_value > 0
- return false
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def is_evil?
- return false if @good_value > 0
- return true if @evil_value > 0
- return false
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def is_max_good?
- return true if is_good? && (good_value >= max_value)
- return false
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def is_max_evil?
- return true if is_evil? && (evil_value >= max_value)
- return false
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def is_neutral?
- return true if @good_value == 0 && @evil_value == 0
- return false
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def act_good(str=1,ref=true)
- @good_value += str if @evil_value == 0
- @good_value = max_value if @good_value > max_value
- @evil_value -= str
- @evil_value = 0 if @evil_value < 0
- refresh if ref
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def act_evil(str=1,ref=true)
- @evil_value += str if @good_value == 0
- @evil_value = max_value if @evil_value > max_value
- @good_value -= str
- @good_value = 0 if @good_value < 0
- refresh if ref
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_char_face(came='',cind=0,fame='',find=0)
- return unless can_default_charname?
- @default_character_name = came
- @default_character_index = cind
- @default_face_name = fame
- @default_face_index = find
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def current_char_face
- return set_good_charface if good_value == max_value
- return set_evil_charface if evil_value == max_value
- return set_neutral_charface
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def set_good_charface
- return set_neutral_charface unless Mod_Charface
- a = @default_character_name+'_Good'
- b = @default_character_index
- c = @default_face_name+'_Good'
- d = @default_face_index
- return [a,b,c,d]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def set_evil_charface
- return set_neutral_charface unless Mod_Charface
- a = @default_character_name+'_Evil'
- b = @default_character_index
- c = @default_face_name+'_Evil'
- d = @default_face_index
- return [a,b,c,d]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def set_neutral_charface
- a = @default_character_name
- b = @default_character_index
- c = @default_face_name
- d = @default_face_index
- return [a,b,c,d]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def can_default_charname?
- return true if @default_character_name = ''
- return false
- end
- end
- #===============================================================================
- module Game_Battler_Alignment
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- attr_reader :alignment
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def setup_alignment
- @alignment = Battler_Alignment.new
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_setup(id)
- return unless Alignment::Setup[id]
- @alignment.reset(id)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def act_good(str=1)
- @alignment.act_good(str*alignment_pts_rate)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def act_evil(str=1)
- @alignment.act_evil(str*alignment_pts_rate)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_pts_rate
- @alignment.rate
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def refresh_alignement
- @alignment.refresh
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_param(id)
- @alignment.total_param[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_xparam(id)
- @alignment.total_xparam[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_sparam(id)
- @alignment.total_sparam[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_def_ele(id)
- @alignment.total_def_ele[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_atk_ele(id)
- @alignment.total_atk_ele[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_atl_dfl(id)
- @alignment.total_atl_dfl[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_spds_stats(id)
- @alignment.total_spds_stats[id]
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_max_tp
- @alignment.total_max_tp
- end
- end
- #===============================================================================
- module Game_Actor_Alignment
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- include Game_Battler_Alignment
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def set_alignment_graphic
- came = @character_name
- cind = @character_index
- fame = @face_name
- find = @face_index
- @alignment.setup_char_face(came,cind,fame,find)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def refresh_alignment_graphic
- return unless Alignment::Mod_Charface
- data = @alignment.current_char_face
- came = data[0]
- cind = data[1]
- fame = data[2]
- find = data[3]
- set_graphic(came,cind,fame,find)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def alignment_skills
- @alignment.total_skills.sort.collect{|id| $data_skills[id]}
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def mod_alignment_rate(mod,val)
- case mod
- when :set then @alignment.rate = val
- when :add then @alignment.rate = @alignment.rate+val
- when :sub then @alignment.rate = @alignment.rate-val
- when :div then @alignment.rate = @alignment.rate/val
- when :mul then @alignment.rate = @alignment.rate*val
- when :mod then @alignment.rate = @alignment.rate%val
- end
- end
- end
- #===============================================================================
- class Game_Actor < Game_Battler
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- include Game_Actor_Alignment
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :alignment_init :initialize
- alias :parp_alignment :param_plus
- alias :xpar_alignment :xparam_plus if $D13x[:Stats_Control]
- alias :spar_alignment :sparam_plus if $D13x[:Stats_Control]
- alias :atke_alignment :atk_ele_plus if $D13x[:Elems_Control]
- alias :defe_alignment :def_ele_plus if $D13x[:Elems_Control]
- alias :atdf_alignment :atl_dfl_plus if $D13x[:Atk_Def_Lvs]
- alias :spds_alignment :spds_plus if $D13x[:ISPDS]
- alias :max_tp_plusali :max_tp_plus if $D13x[:TP_Control]
- alias :alignment_skills_alias :skills
- alias :align_refresh :refresh
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def initialize(*args,&block)
- setup_alignment
- alignment_init(*args,&block)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def refresh
- align_refresh
- refresh_alignment_graphic
- end
- #-----------------------------------------------------------------------------
- # Get Added Value of Parameter
- #-----------------------------------------------------------------------------
- def param_plus(param_id)
- parp_alignment(param_id) + alignment_param(param_id)
- end
- if $D13x[:Stats_Control]
- #---------------------------------------------------------------------------
- # Get Added Value of x-Parameter
- #---------------------------------------------------------------------------
- def xparam_plus(xparam_id)
- xpar_alignment(xparam_id) + alignment_xparam(xparam_id)
- end
- #---------------------------------------------------------------------------
- # Get Added Value of s-Parameter
- #---------------------------------------------------------------------------
- def sparam_plus(sparam_id)
- spar_alignment(sparam_id) + alignment_sparam(sparam_id)
- end
- end # if $D13x[:Stats_Control]
- if $D13x[:Elems_Control]
- #---------------------------------------------------------------------------
- # Get Added Value of def-Element
- #---------------------------------------------------------------------------
- def def_ele_plus(element_id)
- defe_alignment(element_id) + alignment_def_ele(element_id)
- end
- #---------------------------------------------------------------------------
- # Get Added Value of atk-Element
- #---------------------------------------------------------------------------
- def atk_ele_plus(element_id)
- atke_alignment(element_id) + alignment_atk_ele(element_id)
- end
- end # if $D13x[:Elems_Control]
- if $D13x[:Atk_Def_Lvs]
- #---------------------------------------------------------------------------
- # Atk Lv | Def Lv ++
- #---------------------------------------------------------------------------
- def atl_dfl_plus(id)
- atdf_alignment(id) + alignment_atl_dfl(id)
- end
- end # if $D13x[:Atk_Def_Lvs]
- if $D13x[:ISPDS]
- #---------------------------------------------------------------------------
- # Get SPDS Stats Plus
- #---------------------------------------------------------------------------
- def spds_plus(id)
- spds_alignment(id) + alignment_spds_stats(id)
- end
- end # if $D13x[:ISPDS]
- if $D13x[:TP_Control]
- #---------------------------------------------------------------------------
- # Atk Lv | Def Lv ++
- #---------------------------------------------------------------------------
- def max_tp_plus
- max_tp_plusali + alignment_max_tp
- end
- end # if $D13x[:TP_Control]
- #-----------------------------------------------------------------------------
- # Get Skill Object Array
- #-----------------------------------------------------------------------------
- def skills
- alignment_skills_alias + alignment_skills
- end
- end
- #==============================================================================
- class Game_Enemy < Game_Battler
- #==============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def good_align_on_die
- return enemy.good_align_pts
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def evil_align_on_die
- return enemy.evil_align_pts
- end
- end
- #===============================================================================
- class Game_Troop < Game_Unit
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def good_align_total
- dead_members.inject(0) {|r, enemy| r += enemy.good_align_on_die }
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def evil_align_total
- dead_members.inject(0) {|r, enemy| r += enemy.evil_align_on_die }
- end
- end
- #===============================================================================
- class Window_Base < Window
- #===============================================================================
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- alias :draw_alignment_at_face :draw_actor_face
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def draw_actor_face(actor, x, y, enabled = true)
- draw_alignment_at_face(actor,x,y,enabled)
- draw_align_at_face(actor,x,y,enabled)
- end
- #-----------------------------------------------------------------------------
- #
- #-----------------------------------------------------------------------------
- def draw_align_at_face(actor,x,y,enabled)
- return unless actor
- data = Vocanicon::Align_Neut
- data = Vocanicon::Align_Good if actor.alignment.is_max_good?
- data = Vocanicon::Align_Evil if actor.alignment.is_max_evil?
- text = data[0]
- colo = data[1]
- icon = data[2]
- ihue = data[3]
- if Alignment::Show_Icon[0]
- nx = x+Alignment::Show_Icon[1]
- ny = y+Alignment::Show_Icon[2]
- draw_de_icon(icon,nx,ny,ihue,enabled)
- end
- if Alignment::Show_Text[0]
- nx = x+Alignment::Show_Text[1]
- ny = y+Alignment::Show_Text[2]
- change_color(colo)
- draw_text(nx,ny,96,line_height,text)
- end
- change_color(Text_Color::White)
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement