Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- XAS Add-on Compilation
- Version: 1.0.10
- By: theJragyn
- Note: I didn't write XAS, but I did put together all these modifications myself.
- I don't need credit because hopefully these will be implemented by the creator
- at some point or another, but refrain from saying you wrote these if possible.
- The way this compilation is setup, if there is configuration to be done, you
- will have to scroll down through the script to each section, or CTRL+F search
- for the wordage in the brackets [].
- Also, if you wanted to (for whatever reason) disable/enable any of these scripts
- while in-game, you can via easy script calls:
- $game_system.NAME_OF_ADDON = true(enable)/false(disable)
- ie:
- $game_system.agi_move_var = false
- is a script call that will disable the Agility Move Variance script entirely,
- returning all player movement to default. Using the same script call but with
- the value "true" will turn it right back on.
- Current List:
- --Agility Move Variance [agi_move_var]
- --Death Self-Switch [death_selfsw]
- --EXP Factor && Gold Variance [expgp_variance]
- --Slip HP/MP Damage [hpmp_slipdmg]
- --Heal on Level-Up [heal_on_levelup]
- --No Leader Changing [no_leader_chg]
- --Clear Equipped Skills [clear_skill]
- --Alternative touch_attack Formula [alt_touchatk]
- --Parry FX [parry_fx]
- --Timely Active Regen [timely_regen]
- --Record Keeping [the_records]
- --Confusion State [state_confu]
- --Throw Equip Requirements [throw_reqs]
- #-------------------------------------------------------------------------------
- v1.0.10 Adds:
- --Throw Equip Requirements [throw_reqs]
- Expands allowing armor requirements to throw specific... stuff.
- --------------------------------------------------------------------------------
- v1.0.9 Adds:
- --KGC Battle Difficulty Compatibility
- Modifies some of the existing methods to accomodate KGC's Battle Difficulty.
- Keep in mind this is a separate script, not included in here.
- --------------------------------------------------------------------------------
- v1.0.8 Adds:
- --Record Keeping [the_records]
- Adds in a record keeping system and houses them into $game_variable[x]s.
- --Confusion State [state_confu]
- Re-adds the function of Confusion into XAS ABS.
- --------------------------------------------------------------------------------
- v1.0.7 Fixes:
- --Writes in method to read notes from an enemy.
- --Dynamically sizes the damage bitmap according to the number of items.
- --------------------------------------------------------------------------------
- v1.0.6 Adds:
- --Timely Active Regen [timely_regen]
- Re-adds the function of HRG/MRG/TRG into XAS ABS.
- --------------------------------------------------------------------------------
- v1.0.5 Fixes:
- --Parry Effects [alt_touchatk][parry_fx]
- Fixed an issue where heal skills caused issues with parry.
- Added a new note-tag to give skills the ability to be un-parry-able.
- --------------------------------------------------------------------------------
- v1.0.4 Adds:
- --Item Drops [alt_touchatk]
- Updated the battle formula to be compatible with ["YEA-ExtraDrops"].
- (still requires alt_touchatk since the dmg rewrite adds this in too)
- --------------------------------------------------------------------------------
- v1.0.3 Fixes:
- --Parry Effects [alt_touchatk][parry_fx]
- Updated Parry Effects to allow enemies to parry too, and also skills can be
- parried from either player/enemy. Based off of attacker.tgr, self.grd.
- --------------------------------------------------------------------------------
- v1.0.2 Adds:
- --No Popup Movement [popup_nomove]
- Disables the movement of popups (except crits, they still zoom in/out).
- --------------------------------------------------------------------------------
- v1.0.1 Adds:
- --Alternative touch_attack Formula; Parry FX [alt_touchatk][parry_fx]
- Also fixes the issue with multiple drops at once. (requires [alt_touchatk]).
- --------------------------------------------------------------------------------
- v1.0.0 List:
- --Agility Move Variance [agi_move_var]
- Adjusts move/dash speed based on the leader's agility rating.
- --Death Self-Switch [death_selfsw]
- Flips a self-switch on death. This is event independant.
- --EXP Factor && Gold Variance [expgp_variance]
- Enables EXP multipliers for killing high/low level enemies.
- Also enables the addition of variance in Gold for defeated foes.
- --Slip HP/MP Damage [hpmp_slipdmg]
- Continues functionality with HP slip damage, but adds capability of MP & TP.
- --Heal on Level-Up [heal_on_levelup]
- Heals the current player full HP/MP on level up.
- --No Leader Changing [no_leader_chg]
- Disables the ability to change the active player.
- --Clear Equipped Skills [clear_skill]
- Removes all equipped skills when changing equipment.
- --Alternative touch_attack Formula; Parry FX [alt_touchatk][parry_fx]
- Completely re-writes the formula for the "touch_attack" method.
- Adds in the capability to "Parry" enemy attacks (requires [alt_touchatk]).
- Also fixes the issue with multiple drops at once. (requires [alt_touchatk]).
- --------------------------------------------------------------------------------
- I have recognized that pickups do not reflect MP heal/damage, though it does
- actually heal MP. I'll fix it, eventually.
- =end
- class Game_System
- alias j_xas_addons initialize
- def initialize
- j_xas_addons
- #=================================================#
- # You can use the below @blahblah = true/false #
- # to set the starting functions to be ON or OFF. #
- @agi_move_var = true #
- @death_selfsw = true #
- @expgp_variance = true #
- @hpmptp_slipdmg = true #
- @heal_on_levelup= true #
- @no_leader_chg = true #
- @clear_skill = true #
- @alt_touchatk = true #
- @parry_fx = true #
- @popup_nomove = true #
- @timely_regen = true #
- @the_records = true #
- @state_confu = true #
- @throw_reqs = true #
- #=================================================#
- end
- attr_accessor :agi_move_var
- attr_accessor :death_selfsw
- attr_accessor :expgp_variance
- attr_accessor :hpmptp_slipdmg
- attr_accessor :heal_on_levelup
- attr_accessor :no_leader_chg
- attr_accessor :clear_skill
- attr_accessor :alt_touchatk
- attr_accessor :parry_fx
- attr_accessor :popup_nomove
- attr_accessor :timely_regen
- attr_accessor :the_records
- attr_accessor :state_confu
- attr_accessor :throw_reqs
- end#Game_System
- # Defines what .note does when read off of an enemy
- class Game_Enemy
- def note
- enemy ? enemy.note : ""
- end
- end#Game_Enemy
- =begin
- #-------------------------------------------------------------------------------
- Agility Move Variance [agi_move_var]
- Adjusts move/dash speed based on the leader's agility rating.
- Over-write [Game_Character::update_battler_move_speed]
- Changes move_speed to base off of leader-agility
- Move Speed from agility is a feature that allows for the player to move around
- based on how high their agility is. Since XAS utilizes an ABS battle system,
- having agility otherwise is pretty much pointless unless a damage formula uses
- it in some way. So why not use it? Here are a few things you should know about
- this: "Normal" speed, is roughly equivelant to 45-50 AGI. Anymore than 60 will
- put the player at pretty damn fast speeds around the screen, and less than 40
- will result in some seriously slow movement (maybe thats what you want though?)
- The variables below are where the basic move speed, and dash speed are managed.
- =end
- #-------------------------------------------------------------------------------
- class Game_Character < Game_CharacterBase
- attr_accessor :base_move_speed
- attr_accessor :dash_move_speed
- attr_accessor :move_speed
- @base_speed = 0
- @dash_speed = 0
- alias j_agi_move_var update_battler_move_speed
- def update_battler_move_speed
- if $game_system.agi_move_var
- @dash_move_speed = @dash_active ? DASH_MOVE_SPEED : 0
- if battler.is_a?(Game_Actor)
- sp1 = @base_speed = 1.5 + ($game_party.members[0].agi * 0.05).to_f
- sp2 = @dash_speed = 0.1 + ($game_party.members[0].agi * 0.025).to_f
- else
- sp1 = @base_move_speed
- sp2 = @dash_move_speed
- end
- sp3 = self.battler.state_move_speed
- if @dash_active
- @move_speed = (sp1 + sp2 + sp3)
- else
- @move_speed = (sp1 + sp3)
- end
- else# if you don't use this function, it still works like normal.
- j_agi_move_var
- end
- end#def
- end#Game_Character
- =begin
- #-------------------------------------------------------------------------------
- Death Self-Switch [death_selfsw]
- Flips a self-switch on death. This is event independant.
- The function of this is more for eventing purposes. If you haven't noticed,
- you CAN make it so that everytime you kill an enemy, it flips a switch, which
- is usable for bosses n such where you will only ever fight the enemy once, but
- I found that I needed to be able to sometimes have things happen specifically
- when you defeat certain enemies, IE: kill a specific enemy on a map and it flips
- a switch and triggers an event somewhere else on that map to do something, etc.
- Since enemies do stuff with the self-switch "D" by nature, I chose "C".
- If you wanted, "A" or "B" are other options.
- =end
- #=================================================#
- module XAS_J #
- # You can change this to either "A", "B", or "C". #
- # "D" is reserved for the "Sensor" switch. #
- DEATH_SELF_SWITCH = "C" #
- end #
- #=================================================#
- class Game_Character < Game_CharacterBase
- include XAS_J
- alias j_deathswitch execute_enemy_defeated_process
- def execute_enemy_defeated_process
- j_deathswitch
- if $game_system.death_selfsw
- key = [$game_map.map_id, self.id, XAS_J::DEATH_SELF_SWITCH]
- $game_self_switches[key] = true
- end
- $game_variables[XAS_J::CT_KILLS] += 1 if $game_system.the_records
- end
- end#Game_Character
- =begin
- #-------------------------------------------------------------------------------
- EXP Factor && Gold Variance [expgp_variance]
- Enables EXP multipliers for killing high/low level enemies.
- Also enables the addition of variance in Gold for defeated foes.
- Gold Variance just applies a +/- of user-defined variance for gold acquired
- after defeating an enemy. If the words aren't present in the notes, it simply
- doesn't do anything.
- EXP Factor adds the function of "levels" into enemies. If you defeat an enemy
- that is higher level than you, then you will be rewarded BONUS percentage of the
- normally earned EXP on defeat. If you defeat an enemy that is lower level than
- you, then you will only earn a fraction of the enemies' normal EXP. This
- requires a note in the enemies' notebox, or the enemy will return the normal
- amount of EXP no matter what the player's level is. You can scroll down a bit
- and modify the rates per level difference. Just look for the "lvl" case.
- Also, the EXP Factor adds in the EXR rate, which is an EX-Param that whose use
- was omitted in the XAS ABS.
- Since these both alter the same method, and can be ignored by just not putting a
- note in the enemy's notebox, they are enabled/disabled with the same command.
- =end
- #=================================================#
- module XAS_J #
- # This is just for modifying wordage for gold #
- # variance and level access. #
- GOLD_WORDS = /<GG: (\d+)>/ #
- # Default: <Gold: x> where x is the amount of #
- # variance you want to have from the base G. #
- LEVEL_WORDS = /<Level: (\d+)>/ #
- # Default: <Level: x> where x is the level of #
- # monster that you are fighting. #
- end #
- #=================================================#
- class Game_Character < Game_CharacterBase
- include XAS_J
- # This rewrites the exp/gold gain method if using these functions.
- alias j_xas_exp_gold_var execute_gain_exp_gold
- def execute_gain_exp_gold(enemy)
- if $game_system.expgp_variance
- exp = self.battler.exp
- gold = self.battler.gold
- @exp_fx = XAS_J.exp_factor(enemy)
- case XAS_BA::EXP_TYPE
- when 0
- # only the leader gets the XP
- actor = $game_party.members[0]
- actor.gain_exp(exp * @exp_fx)
- when 1
- # the entire party gets full XP
- for i in 0...$game_party.members.size
- actor = $game_party.members[i]
- actor.gain_exp(exp * @exp_fx)
- end
- when 2
- # the XP is divided between all the members
- exp = exp / $game_party.members.size
- for i in 0...$game_party.members.size
- actor = $game_party.members[i]
- actor.gain_exp(exp * @exp_fx)
- end
- when 3
- # the XP is cut in half for inactive characters
- $game_party.members[0].gain_exp(exp * @exp_fx)
- exp /= 2
- for i in 1...$game_party.members.size
- actor = $game_party.members[i]
- actor.gain_exp(exp * @exp_fx)
- end
- end
- if enemy.note =~ XAS_J::GOLD_WORDS
- variance = $1.to_i
- $gold_var = rand(variance+1) + rand(variance+1) - variance
- else
- $gold_var = 0
- end
- $game_party.gain_gold(gold + $gold_var)
- else
- j_xas_exp_gold_var(enemy)
- end
- end
- end#Game_Character
- #-------------------------------------------------------------------------------
- module XAS_J
- # The actual method to apply the magnifier to the EXP
- def self.exp_factor(enemy)
- return 1.0 unless enemy.note =~ XAS_J::LEVEL_WORDS
- actor = $game_party.members[0]
- rate = actor.exr.to_f
- rank = $1.to_i
- lvl = rank - actor.level
- sexp = 1.0
- case lvl
- # The instance where enemies are 16+ levels higher than you.
- when 16..100000; sexp = 10.0
- when 15; sexp = 5.0
- when 14; sexp = 4.25
- when 13; sexp = 3.5
- when 12; sexp = 3.0
- when 11; sexp = 2.5
- when 10; sexp = 2.25
- when 9; sexp = 2.0
- when 8; sexp = 1.75
- when 7; sexp = 1.55
- when 6; sexp = 1.4
- when 5; sexp = 1.3
- when 4; sexp = 1.25
- when 3; sexp = 1.15
- when 2; sexp = 1.1
- when 1; sexp = 1.05
- # The instance where enemies are the same level as you.
- when 0; sexp = 1.0
- when -1; sexp = 0.95
- when -2; sexp = 0.9
- when -3; sexp = 0.8
- when -4; sexp = 0.7
- when -5; sexp = 0.6
- when -6; sexp = 0.5
- when -7; sexp = 0.4
- when -8; sexp = 0.3
- when -9; sexp = 0.2
- when -10;sexp = 0.1
- when -11;sexp = 0.05
- # The instance where enemies are 12+ levels lower than you.
- when -100000..-12; sexp = 0.01
- end#case
- return (sexp * rate).to_f
- end#def
- end#module XAS_J
- #-------------------------------------------------------------------------------
- class Sprite_Character < Sprite_Base
- include XAS_J
- alias j_xas_expgp_pop update_exp_gold_pop
- def update_exp_gold_pop
- if $game_system.expgp_variance
- return unless XAS_DAMAGE_POP::DAMAGE_EXP_GOLD_POP
- enemy = $data_enemies[@character.battler.enemy_id]
- exp_pop = (enemy.exp * XAS_J.exp_factor(enemy)).to_i
- gold_pop = @character.battler.gold + $gold_var
- case @character.collapse_duration
- when 110
- @character.make_treasure(enemy)
- when 80
- if exp_pop != 0
- @character.battler.damage = XAS_WORD::EXP + " " + exp_pop.to_s
- @character.battler.damage_pop = true
- @character.battler.damage_type = "Exp"
- end
- when 40
- if gold_pop != 0
- word = $data_system.currency_unit
- @character.battler.damage = word + " " + gold_pop.to_s
- @character.battler.damage_pop = true
- @character.battler.damage_type = "Gold"
- end#if
- end#case
- else
- j_xas_expgp_pop
- end#Game_System
- end
- end#Sprite_Character
- =begin
- #-------------------------------------------------------------------------------
- Slip HP/MP Damage [hpmp_slipdmg]
- Continues functionality with HP slip damage, but adds capability of MP & TP.
- The XAS system by default had HP slip damage, but now it MP and TP slip
- capabilities. All you need to do is add in a notebox the necessary wordage and
- it will work just like usual. Of course, if you put negative numbers, it will
- work as expected.
- Keep in mind, by default, TP max is fixed at 100, thus, it does not use the
- percentage factor, it will be a fixed integer.
- =end
- #=================================#
- module XAS_J #
- # The wordage for notes in #
- # the state-note-boxes #
- SLIP_HP = /<Slip HP = (\S+)>/ #
- #default: <Slip HP = x> #
- SLIP_MP = /<Slip MP = (\S+)>/ #
- #default: <Slip MP = x> #
- SLIP_TP = /<Slip TP = (\S+)>/ #
- #default: <Slip TP = x> #
- #
- #where x is the percent of said #
- #stat you want reduced. #
- end #
- #=================================#
- class Game_Character < Game_CharacterBase
- alias j_xas_statefx execute_states_effects
- def execute_states_effects(state)
- if $game_system.hpmptp_slipdmg
- if state.note =~ XAS_J::SLIP_HP
- do_sliphp_damage($1.to_i)
- end
- if state.note =~ XAS_J::SLIP_MP
- do_slipmp_damage($1.to_i)
- end
- if state.note =~ XAS_J::SLIP_TP
- do_sliptp_damage($1.to_i)
- end
- else
- j_xas_statefx(state)
- end#Game_System
- end
- def do_sliphp_damage(damage)
- damage = 1 if damage == nil
- damage_slip = self.battler.mhp * damage / 100
- damage_slip = 1 if damage_slip < 1
- self.battler.hp -= damage_slip
- self.battler.damage = damage_slip
- self.battler.damage_pop = true
- end
- def do_slipmp_damage(damage)
- damage = 1 if damage == nil
- damage_slip = self.battler.mmp * damage / 100
- damage_slip = 1 if damage_slip < 1
- self.battler.mp -= damage_slip
- self.battler.damage_type = "Mp"
- self.battler.damage = damage_slip
- self.battler.damage_pop = true
- end
- def do_sliptp_damage(damage)
- damage = 1 if damage == nil
- damage_slip = damage
- damage_slip = 1 if damage_slip < 1
- self.battler.tp -= damage_slip
- self.battler.damage_type = "Tp"
- self.battler.damage = damage_slip
- self.battler.damage_pop = true
- end
- end#Game_Character
- =begin
- #-------------------------------------------------------------------------------
- Heal on Level-Up [heal_on_levelup]
- Heals the current player full HP/MP on level up.
- Pretty self-explanatory.
- =end
- #=======================================#
- module XAS_J #
- # Here, you can edit the animation ID #
- # for when you level up. #
- HEAL_ANI_ID = 37 #
- end #
- #=======================================#
- class Game_Player < Game_Character
- alias j_xas_healonlvlup check_actor_level
- def check_actor_level
- if $game_system.heal_on_levelup
- return if $game_party.in_battle
- return if self.battler == nil
- return if self.battler.old_level == self.battler.level
- self.battler.hp = self.battler.mhp
- self.battler.mp = self.battler.mmp
- self.animation_id = XAS_J::HEAL_ANI_ID
- reset_old_level(false)
- if self.battler.level > 1
- Audio.se_play("Audio/SE/" + XAS_SOUND::LEVEL_UP , 100, 100)
- if XAS_WORD::ENABLE_WORD
- $game_player.battler.damage = XAS_WORD::LEVEL_UP
- $game_player.battler.damage_pop = true
- end
- end
- $game_player.need_refresh = true
- else
- j_xas_healonlvlup
- end#Game_System
- end
- end#Game_player
- =begin
- #-------------------------------------------------------------------------------
- No Leader Changing [no_leader_chg]
- Disables the ability to change the active player.
- This allows you to turn ON a switch to prevent the player from switching who
- the leader is on the field.
- =end
- #=======================================#
- module XAS_J #
- # Choose the Switch ID that you #
- # want to ENABLE to prevent switching. #
- ANTI_CHANGE_SW = 12 #
- end #
- #=======================================#
- class Game_Player < Game_Character
- include XAS_J
- alias j_xas_nochange can_use_change_leader_command?
- def can_use_change_leader_command?
- if $game_system.no_leader_chg
- return false if $game_switches[XAS_J::ANTI_CHANGE_SW] == true
- end
- j_xas_nochange
- end
- end#Game_Player
- =begin
- #-------------------------------------------------------------------------------
- Clear Equipped Skills [clear_skill]
- Removes all equipped skills when changing equipment.
- There is no configuration necessary.
- This little snippet kicks off skills that the player no longer knows if they are
- still equipped.
- This is kind of a situational script, so you may not ever need/use it.
- =end
- class Game_Actor < Game_Battler
- alias clearforgotten forget_skill
- def forget_skill(s_id)
- clearforgotten(s_id)
- if $game_system.clear_skill
- if @skill_id == s_id
- @skill_id = 0
- end
- end
- end
- end#Game_Actor
- =begin
- #-------------------------------------------------------------------------------
- Alternative touch_attack Formula; Parry FX [alt_touchatk][parry_fx]
- Completely re-writes the formula for the "touch_attack" method.
- Also fixes the issue with multiple drops at once.
- With this, the entire attack formula for how monsters use their "basic" attack.
- The same "a.atk * 4 - b.def * 2" concept is still there, but it incorporates a
- lot of other things that weren't a factor in the original formula. With this,
- enemies now have a chance of critical strike from attacking, you can also make
- it so that enemies' attacks are physical or magical (instead of just physical).
- In addition, something that was missing before, this formula applies the other
- ex-params, PDR/MDR, against the damage formula. This also impacts the MRF stat,
- which is "Magic Reflect"-chance, which had no meaning, but now it does! Just
- naturally, if a skill is reflectable, based on the MRF chance, you will just...
- reflect the skill. No state/tags/actions necessary.
- Also, a new concept of "Parrying" is possible, which is essentially a chance for
- the attack to completely be negated, skipping evasion/crit, regardless of being
- physical/magical. Pretty much, this is a "Miss", but with a different animation.
- Since at this time, the TGR and GRD stats have no purpose in an ABS...
- (TGR normally determines which target amidst a party of members will be hit when
- random targetting is applied, and GRD is an amplification of the damage reduced
- when using the "defend" command in a turn-based battle, neither of which are
- useful since "guarding" nullifies damage, and there is only ever one player on
- the map at once)
- If you want a skill to NOT be parry-able, use this note-tag:
- <No Parry>
- And the skill will bypass all normal parry possibilities, and go like normal.
- ...the formula for parrying is similer to the evasion formula, but for the
- enemies' TGR rating vs the player's GRD rating. This means that if you want to
- use the parry function, you will need to start giving equipment GRD and give
- enemies TGR.
- In addition to these features, it has been noted that enemies will only drop one
- item, even if 3 are able to drop at 1/1 rate. This will fix that by dropping all
- items in a pile, and collecting them will list them all at once. This is also
- written to be compatible with Yanfly's Extra Drops script.
- =end
- #=======================================================#
- module XAS_J #
- # PARRY_WORDS is what pops up when a successful parry #
- # occurs. Phys/Magi_atk will change the damage formula #
- # between physical/magical formulai. If no formula is #
- # selected, it will default to a 1/2 & 1/2 mix between #
- # physical and magical instead. PHYS/MAGI_ATK must be #
- # put in the enemy's notebox in the database. #
- NO_PARRY = /<No Parry>/ #
- PARRY_WORDS = "PARRY" #
- PARRY_ANI = 127 #
- PHYS_ATK = /<p_atk>/ #
- MAGI_ATK = /<m_atk>/ #
- SPEED_ATK = /<a_atk>/ #
- HEAL_FONT_COLOR = Color.new(192, 255, 192) #
- MAGI_FONT_COLOR = Color.new(255, 192, 255) #
- PARRY_FONT_COLOR = Color.new(170, 170, 170) #
- end #
- #=======================================================#
- module XRXS_BattlerAttachment
- alias j_xas_touchatk execute_attack_damage
- def execute_attack_damage(attacker)
- if $game_system.alt_touchatk
- actor = $game_party.members[0]
- enemy = $data_enemies[attacker.battler.enemy_id]
- damage = 0
- self.battler.damage_type = 0
- self.battler.result.missed = false
- # Will the attack be parried?
- if $game_system.parry_fx
- if ((rand(enemy.tgr * 100)) < (actor.grd * 100 - 100) && face_direction?(attacker))
- self.battler.damage_type = "Parry"
- self.battler.result.missed = true
- $game_variables[XAS_J::CT_PARRYS] += 1 if $game_system.the_records
- return
- end
- end#Game_System
- if rand(enemy.hit.to_f * 100) < (actor.eva * 100)
- self.battler.result.missed = true
- return
- end
- fx = XAS_J.exp_factor(attacker.battler)
- patk = attacker.battler.atk * fx
- matk = attacker.battler.mat * fx
- aatk = attacker.battler.agi * fx
- pdef = actor.def; mdef = actor.mdf; adef = actor.agi
- # Is the attack is a physical attack?
- if enemy.note =~ XAS_J::PHYS_ATK
- damage = ((patk * 3) - pdef)
- damage *= actor.pdr.to_f
- # Is the attack is a magical attack?
- elsif enemy.note =~ XAS_J::MAGI_ATK
- damage = ((patk * 1 + matk * 2) - ((mdef + pdef) / 2))
- damage *= actor.mdr.to_f
- elsif enemy.note =~ XAS_J::SPEED_ATK
- damage = ((patk * 1 + aatk * 2) - ((pdef + adef) / 2))
- damage *= ((actor.pdr.to_f / 2) + (actor.mdr.to_f / 2))
- # Is the attack undefined?
- else
- damage = (((patk + matk) * 1.5) - (pdef + mdef))
- damage *= ((actor.pdr.to_f + actor.mdr.to_f) / 2)
- end
- crimult = 1.0
- if $imported["BattleDifficulty"] == true
- crimult = KGC::BattleDifficulty.get[:cri] / 100
- end
- if rand((enemy.cri.to_f * crimult) * 100) > rand(actor.cev * 10000 - 100)
- damage *= 3
- self.battler.damage_type = "Critical"
- end
- damage = damage.to_i
- damage = 0 if damage < 0
- $game_variables[XAS_J::CT_DMGTAKEN] += damage if $game_system.the_records
- self.battler.result.hp_damage = damage
- self.battler.hp -= damage.abs
- else
- j_xas_touchatk(attacker)
- end
- end
- # Re-writes the battle function to add in the chance to parry an attack.
- alias j_xas_parryaddon execute_battler_skill_effect
- def execute_battler_skill_effect(attacker, skill, user)
- self.battler.result.clear
- self.battler.result.evaded = false
- if $game_system.parry_fx
- if skill.note =~ XAS_J::NO_PARRY
- self.battler.item_apply(attacker, skill)
- else
- actor = $game_party.members[0]
- tgrmult = 1.0
- grdmult = 1.0
- if $imported["BattleDifficulty"] == true
- tgrmult = KGC::BattleDifficulty.get[:tgr] / 100
- grdmult = KGC::BattleDifficulty.get[:grd] / 100
- end
- if attacker.is_a?(Game_Actor)
- self.battler.item_apply(attacker, skill) if self.battler.is_a?(Game_Actor)
- hit = actor.tgr * 100
- if self.battler.is_a?(Game_Actor)
- parry = 0
- else
- parry = $data_enemies[self.battler.enemy_id].grd * 100 * (grdmult)
- end
- else attacker.is_a?(Game_Enemy)
- self.battler.item_apply(attacker, skill) if self.is_a?(Game_Enemy)
- hit = $data_enemies[attacker.enemy_id].tgr * 100 * (tgrmult)
- parry = actor.grd * 100
- end
- if rand(hit) < parry && face_direction?(actor)
- self.battler.damage_type = "Parry"; self.battler.result.missed = true
- return
- else
- self.battler.item_apply(attacker, skill)
- end
- end
- else
- j_xas_parryaddon(attacker, skill, user)
- end#parry_fx
- end
- # Adds in recognition for direction of the player since the Game_Actor
- # class does not have a default function.
- alias j_xas_parryfix? face_direction?
- def face_direction?(attacker)
- if $game_system.parry_fx
- if attacker.is_a?(Game_Event)
- target = $game_player.direction
- case target
- when 2; return true if attacker.direction == 8
- when 4; return true if attacker.direction == 6
- when 6; return true if attacker.direction == 4
- when 8; return true if attacker.direction == 2
- end
- elsif attacker.is_a?(Game_Actor)
- target = self.direction
- case target
- when 2; return true if $game_player.direction == 8
- when 4; return true if $game_player.direction == 6
- when 6; return true if $game_player.direction == 4
- when 8; return true if $game_player.direction == 2
- end
- end
- return false
- else
- j_xas_parryfix?(attacker)
- end
- end
- alias j_xas_parryaddon target_missed?
- def target_missed?(attacker)
- if $game_system.parry_fx
- if self.battler.result.missed
- if self.battler.damage_type == "Parry"
- self.battler.damage = XAS_J::PARRY_WORDS
- self.battler.damage_pop = true
- self.animation_id = XAS_J::PARRY_ANI
- if attacker.is_a?(Game_Event)
- # When the enemy is parried, they are flung back a couple spaces if possible.
- attacker.jump(0,0)
- attacker.move_backward
- attacker.move_backward
- else
- # When the player is parried, they are flung back a couple spaces if possible.
- $game_variables[XAS_J::CT_PARRYS] += 1 if $game_system.the_records
- $game_player.jump(0,0)
- $game_player.move_backward
- $game_player.move_backward
- end
- return true
- else
- self.battler.damage = XAS_WORD::MISSED
- self.battler.damage_pop = true
- return true
- end
- end
- if self.battler.result.evaded
- self.battler.damage = XAS_WORD::EVADED
- self.battler.damage_pop = true
- return true
- end
- return false
- else
- j_xas_parryaddon(attacker)
- end
- end
- alias j_xas_reflectfx reflect_state?
- def reflect_state?(bullet, skill)
- if $game_system.alt_touchatk
- if bullet.action.reflectable
- if self.battler.state_reflect
- if skill.note =~ /<Auto Target>/
- bullet.moveto(bullet.action.user.x, bullet.action.user.y)
- else
- bullet.turn_back
- end
- bullet.action.user = self
- bullet.action.hit_events = []
- bullet.turn_back
- bullet.jump(0,0)
- bullet.turn_back
- self.battler.damage = XAS_WORD::REFLECT
- self.battler.damage_pop = true
- self.animation_id = XAS_ANIMATION::REFLECT_ANIMATION_ID
- self.battler.invunerable_duration = 20
- return true
- elsif (rand(100) < (self.battler.mrf * 100).to_f)
- if skill.note =~ /<Auto Target>/
- bullet.moveto(bullet.action.user.x,bullet.action.user.y)
- else
- bullet.turn_back
- end
- bullet.action.user = self
- bullet.action.hit_events = []
- bullet.turn_back
- bullet.jump(0,0)
- bullet.turn_back
- self.battler.damage = XAS_WORD::REFLECT
- self.battler.damage_pop = true
- self.animation_id = XAS_ANIMATION::REFLECT_ANIMATION_ID
- self.battler.invunerable_duration = 20
- return true
- end
- end
- return false
- else
- j_xas_reflectfx(bullet, skill)
- end
- end
- end#XRXS_BattlerAttachment
- class Sprite_Base < Sprite
- include XAS_DAMAGE_POP
- include XAS_BA_ItemDrop
- #-------------------------------------------------------------------------------
- # Removes "picture" capability for drawing, uses standard draw_text instead.
- # Also accomodates new damage types like MP/healing/Parry.
- # This is also altered to fix the issue with dropping only 1 item on the map.
- #-------------------------------------------------------------------------------
- alias j_xas_alt_damage damage
- def damage(value, type = "")
- if $game_system.alt_touchatk
- dispose_damage
- @damage_ox = 0
- @damage_type = type
- damage_string = value.to_s
- bitmap = Bitmap.new(160, 148)
- bitmap.font.name = DAMAGE_FONT_NAME
- bitmap.font.size = DAMAGE_FONT_SIZE
- bitmap.font.bold = DAMAGE_FONT_BOLD
- bitmap.font.italic = DAMAGE_FONT_ITALIC
- bitmap.font.color = Color.new(0,0,0)
- case @damage_type
- when "Exp"; string_color = DAMAGE_EXP_FONT_COLOR
- when "Gold"; string_color = DAMAGE_GOLD_FONT_COLOR
- when "Item"; string_color = DAMAGE_ITEM_FONT_COLOR
- when "Parry"; string_color = XAS_J::PARRY_FONT_COLOR
- else
- string_color = DAMAGE_DEFAULT_FONT_COLOR
- end
- if @damage_type != "Item" && value.to_i < 0
- bitmap.font.size = DAMAGE_FONT_SIZE + 8
- string_color = XAS_J::HEAL_FONT_COLOR
- value = value.abs
- end
- damage_string = value.to_s
- if @damage_type == "Mp"
- damage_string = damage_string + " MP"
- string_color = XAS_J::MAGI_FONT_COLOR
- end
- bitmap.font.color = string_color
- a = 0
- if @damage_type == "Item"
- for n in $names #items, not healing stuff
- bitmap.draw_text(0, 12 + a, 160, 36, n.to_s, 1)
- bitmap.draw_text(1, 13 + a, 160, 36, n.to_s, 1)
- a += 24
- end
- unless $hitems.empty? #hp healing stuff, not items
- bitmap.font.size = DAMAGE_FONT_SIZE + 8
- string_color = XAS_J::HEAL_FONT_COLOR
- bitmap.font.color = string_color
- for i in $hitems
- bitmap.draw_text(0, 12 + a, 160, 36, i.to_s + " HP", 1)
- bitmap.draw_text(1, 13 + a, 160, 36, i.to_s + " HP", 1)
- a += 24
- end
- end
- unless $mitems.empty? #mp healing stuff, not items
- bitmap.font.size = DAMAGE_FONT_SIZE + 8
- string_color = XAS_J::MAGI_FONT_COLOR
- bitmap.font.color = string_color
- for i in $mitems
- bitmap.draw_text(0, 12 + a, 160, 36, i.to_s, 1)
- bitmap.draw_text(1, 13 + a, 160, 36, i.to_s, 1)
- a += 24
- end
- end
- else
- bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
- bitmap.draw_text(1, 13, 160, 36, damage_string, 1)
- end
- @_damage_sprite = ::Sprite.new(self.viewport)
- @_damage_sprite.bitmap = bitmap
- @_damage_sprite.ox = 80
- @_damage_sprite.oy = 20
- @_damage_sprite.x = self.x + @damage_ox
- @_damage_sprite.y = self.y - self.oy / 2
- @_damage_sprite.z = 3000
- @_damage_duration = 60
- else
- j_xas_alt_damage(value, type = "")
- end
- end
- end#Sprite_Base
- #-------------------------------------------------------------------------------
- # Fixes the issue with multiple drops not dropping.
- # Also accomodates Yanfly's multiple drops.
- # This is also altered to fix the issue with dropping only 1 item on the map.
- #-------------------------------------------------------------------------------
- module XAS_BA_ItemDrop
- alias j_xas_fixdrops make_treasure
- def make_treasure(target)
- if $game_system.alt_touchatk
- drops = []
- # if yanfly drops are included, will push those drops into the droplist too.
- if $imported["YEA-ExtraDrops"] == true
- for drop in target.extra_drops
- next if rand > drop.drop_rate
- drops << drop
- end
- end
- # Runs through the standard drop process, too.
- for drop in target.drop_items
- next if rand(drop.denominator) != 0
- next if drop.kind == 0
- drops << drop
- end
- # Actually drops all the items and turns them into collectable events.
- return unless $game_player.map_passable?(self.x, self.y, 0)
- for di in drops
- command = RPG::MoveCommand.new
- command.code = 14
- command.parameters = [0,0]
- route = RPG::MoveRoute.new
- route.repeat = false
- route.list = [command, RPG::MoveCommand.new]
- page = RPG::Event::Page.new
- page.move_type = 3
- page.move_route = route
- page.move_frequency = 6
- page.priority_type = 1
- page.trigger = 2
- page.through = true
- # This will move the drops around, but they could land in non-passable areas.
- #~ ix = self.x
- #~ iy = self.y
- #~ ix += rand(2) - 1
- #~ iy += rand(2) - 1
- event = RPG::Event.new(self.x, self.y)
- event.pages = [page]
- token = Token_Event.new($game_map.map_id, event)
- if di.kind == 1
- token.icon_name = $data_items[di.data_id].icon_index
- elsif di.kind == 2
- token.icon_name = $data_weapons[di.data_id].icon_index
- elsif di.kind == 3
- token.icon_name = $data_armors[di.data_id].icon_index
- end
- token.treasure = [di.kind, di.data_id]
- token.treasure_time = 120 + XAS_BA::TREASURE_ERASE_TIME * 60
- token.jump_high(0,0,20)
- token.force_update = true
- token.move_speed = 6
- $game_map.add_token(token)
- end
- else
- j_xas_fixdrops(enemy)
- end
- end
- end#moduleXASBAItemDrop
- class Game_Player < Game_Character
- alias j_xas_collectdrops check_treasure_here
- def check_treasure_here
- if $game_system.alt_touchatk
- name = ""
- $names = []
- $hitems = []
- $mitems = []
- for event in $game_map.events_xy(@x, @y)
- if event.treasure != nil
- name_pop = true
- case event.treasure[0]
- when 1
- item = $data_items[event.treasure[1]]
- if can_execute_field_item_effect?(item)
- if item.id == 2
- $mitems << self.battler.damage.abs.to_s + " MP"
- elsif item.id == 9
- $mitems << self.battler.damage.abs.to_s + " MP"
- else
- $hitems << self.battler.damage.abs.to_s
- end
- else
- $game_party.gain_item(item, 1)
- $names << item.name
- end
- $game_map.need_refresh = true
- when 2
- item = $data_weapons[event.treasure[1]]
- $game_party.gain_item(item, 1, false)
- $names << item.name
- when 3
- item = $data_armors[event.treasure[1]]
- $game_party.gain_item(item, 1, false)
- $names << item.name
- end
- Audio.se_play("Audio/SE/" + XAS_SOUND::ITEM_DROP , 100, 100)
- event.erase
- if item != nil
- if item.note =~ /<Drop Animation = (\d+)>/
- self.animation_id = $1.to_i
- end
- end
- end#if event.treasure
- end#for event
- if XAS_DAMAGE_POP::DAMAGE_ITEM_POP and name_pop
- self.battler.damage = item.name
- self.battler.damage_pop = true
- self.battler.damage_type = "Item"
- end
- else
- j_xas_collectdrops
- end
- end#def
- end#Game_Player
- =begin
- #-------------------------------------------------------------------------------
- No Popup Movement [popup_nomove]
- Disables the movement of popups (except crits, they still zoom in/out).
- No configuration necessary.
- Just turn it ON or OFF.
- If it is ON, then damage pops will not do more than appear beneath the target,
- and then fade away after 60 frames(about 1~2 seconds)
- =end
- class Sprite_Damage < Sprite
- alias j_xas_popup update_normal_popup
- def update_normal_popup
- if $game_system.popup_nomove
- self.opacity -= 25 if @duration <= 10
- else
- j_xas_popup
- end
- end
- end#Sprite_Damage
- =begin
- #-------------------------------------------------------------------------------
- Timely Active Regen [timely_regen]
- Re-adds the function of HRG/MRG/TRG into XAS ABS.
- This can work as a direct add-on, as it does refunctionalize the HRG/MRG/TRG,
- but it also adds in customizable timing for how often the regen ticks based on
- notes of the enemy, and the notes of the actor/equip/state.
- COUNT_TIME is the base time between ticks with no modifications in frames.
- 60 frames is roughly 1 second or so.
- REDUCTION is a notetag you can put in either enemy's or equipment's noteboxes
- to reduce the COUNT_TIME for that specific Enemy/Actor.
- MIN_COUNT is the smallest number of frames to pass between regeneration ticks.
- I highly recommend that you do NOT put this less than 30. (gets excessive)
- NOTE:: Incase you didn't know this already, you can actually put negative
- values in the HRG/MRG/TRG field in a state or equipment, and it will function
- as a poison, or serve to reduce the effects of regeneration. If you opt to use
- poison in THIS fashion, keep in mind that "Reduce = #" will also reduce the
- time between damage ticks in that way too.
- =end
- #=====================================#
- module XAS_J #
- COUNT_TIME = 300 #
- REDUCTION = /<Reduce = (\d+)>/ #
- # default: <Reduce = x> where x is #
- # the number to reduce COUNT_TIME by#
- MIN_COUNT = 60 #
- end #
- #=====================================#
- class Game_Character < Game_CharacterBase
- include XRXS_BattlerAttachment
- # creates all battler's count and count_reduction
- alias j_xas_regen_count init_public_members
- def init_public_members
- j_xas_regen_count
- if $game_system.timely_regen
- @count = 0
- @count_reduce = 0
- end
- end
- # adds in new method to update HRG/MRG/TRG as long as the battler lives
- alias j_xas_regen_add update_battler
- def update_battler
- if $game_system.timely_regen
- update_hrg_mrg_trg unless self.battler.hp == 0
- end
- j_xas_regen_add
- end
- # the new method that counts up to the required @count to cause regen
- # the regen runs through checking notes on enemies and actor's
- def update_hrg_mrg_trg
- if $game_system.timely_regen
- @count += 1
- x = self.battler
- if self.battler.is_a?(Game_Enemy)
- if self.battler.note =~ XAS_J::REDUCTION
- @count_reduce = $1.to_i
- end
- end
- if self.battler.is_a?(Game_Actor)
- minus = 0
- if self.battler.note =~ XAS_J::REDUCTION
- minus += $1.to_i
- end
- for i in self.battler.equips.compact
- if i.note =~ XAS_J::REDUCTION
- minus += $1.to_i
- end
- end
- for i in self.battler.states
- if i.note =~ XAS_J::REDUCTION
- minus += $1.to_i
- end
- end
- @count_reduce = minus
- end
- if @count >= [(XAS_J::COUNT_TIME - @count_reduce), XAS_J::MIN_COUNT].max
- @count = 0
- if x.hrg != 0
- regen = (x.mhp * x.hrg).to_i
- x.hp += regen
- if $game_system.the_records
- $game_variables[XAS_J::CT_HEALSTTL] += regen
- $game_variables[XAS_J::CT_HEALSMAX] = regen if regen > $game_variables[XAS_J::CT_HEALSMAX]
- end
- x.damage = -(regen)
- x.damage_pop = true
- end
- if x.mrg != 0
- regen = (x.mmp * x.mrg).to_i
- x.mp += regen
- x.damage_type = "Mp"
- x.damage = (-regen)
- x.damage_pop = true
- end
- if x.trg != 0
- regen = (100 * x.trg).to_i
- x.tp += regen
- x.damage = -(regen)
- x.damage_pop = true
- end
- $game_map.need_refresh = true
- end#count
- end#Game_System
- end#update
- end#Game_Character
- =begin
- #-------------------------------------------------------------------------------
- Record Keeping [the_records]
- Adds in a record keeping system and houses them into $game_variable[x]s.
- This tracks a lot of different little variables that most people don't think to
- much about, but hey, if you do, you can even assign them to variables for...
- well... whatever kind of reasons or eventing you need to.
- _RECORDS is a blank variable that can be used for whatever really. I use it for
- tracking completion percent, but you can use it for whatever. (it was a
- place-holder variable until I thought of something better, but I never did)
- _DMGTAKEN is how much damage the player has taken, cumulatively.
- _DMGTTL is how much damage you've dealt out via skills/attacks, cumulatively.
- _DMGMAX is the highest damage pop that you have afflicted on an enemy. It will
- constantly be replaced and updated with your highest single-hit blow.
- _CRITS is the number of critical blows landed by the you.
- _HEALSTTL is the cumulative amount of HP you've recovered.
- _HEALSMAX is the highest amount of HP you've recovered in one pop.
- _PARRYS is the total number of times you have parried an attack. (this will only
- reflect 0 if you aren't using @parry_fx)
- _EVADES is the total number of times you've evaded an attack.
- _KILLS is the total number of monsters that have been defeated via normal means.
- (normal means is defeating reducing HP to 0, or state-instant-death; obscure
- means would be like creating a monster that is deleted like you delete events)
- If you can think of more things you want tracked, let me know, I'll see if I
- can't get them added. :)
- =end
- #=====================================#
- module XAS_J #
- CT_RECORDS = 31 #
- CT_DMGTAKEN = 32 #
- CT_DMGTTL = 33 #
- CT_DMGMAX = 34 #
- CT_CRITS = 35 #
- CT_HEALSTTL = 36 #
- CT_HEALSMAX = 37 #
- CT_PARRYS = 38 #
- CT_EVADES = 39 #
- CT_KILLS = 40 #
- end #
- #=====================================#
- class Game_Battler < Game_BattlerBase
- def make_damage_value(user, item)
- value = item.damage.eval(user, self, $game_variables)
- value *= item_element_rate(user, item)
- value *= pdr if item.physical?
- value *= mdr if item.magical?
- value *= rec if item.damage.recover?
- value = apply_critical(value) if @result.critical
- value = apply_variance(value, item.damage.variance)
- value = apply_guard(value)
- @result.make_damage(value.to_i, item)
- if $game_system.the_records
- if user.is_a?(Game_Actor)
- $game_variables[XAS_J::CT_CRITS] += 1 if @result.critical
- if value > 0
- $game_variables[XAS_J::CT_DMGTTL] += value.to_i
- $game_variables[XAS_J::CT_DMGMAX] = value.to_i if value > $game_variables[XAS_J::CT_DMGMAX]
- end
- if value < 0
- $game_variables[XAS_J::CT_HEALSTTL] += value.abs.to_i
- $game_variables[XAS_J::CT_HEALSMAX] = value.abs.to_i if value.abs > $game_variables[XAS_J::CT_HEALSMAX]
- end
- end
- if user.is_a?(Game_Enemy)
- $game_variables[XAS_J::CT_EVADES] += 1 if @result.evaded
- $game_variables[XAS_J::CT_DMGTAKEN] += value.to_i if value > 0
- end
- end
- end#def
- alias j_bd_item_cri item_cri
- def item_cri(user, item)
- crimult = 1.0
- if $imported["BattleDifficulty"] == true
- crimult = KGC::BattleDifficulty.get[:cri] / 100 if user.is_a?(Game_Enemy)
- end
- j_bd_item_cri(user, item) * crimult
- end
- end#Game_Battler
- =begin
- #-------------------------------------------------------------------------------
- Confusion State [state_confu]
- Re-adds the function of Confusion into XAS ABS.
- This scriptlet adds in random movement when afflicted with a state, to mimic
- being confused. It's kinda primitive, but it works. The battler (either enemy or
- player) will just randomly walk around, as though you set their move-route to
- "move random", and will continue to do so until the state wears off.
- Keep in mind, this shares functionality with "stop", which means ABSOLUTELY
- NOTHING can be done while confused.
- CONFUSE is the note that you stick in the notebox of states.
- CONFU_CNT is how many frames between movement steps. You really shouldn't need
- to change this, but its recommended not to drop it to less than 30.
- NOTE!! For some reason, this does not quite work fully yet. In order for the
- state to be re-applied, the player has to be healed for any amount or a state
- of any sort be cured, otherwise you'll be immune to the state indefinitely.
- As a work around, I set it up to fire off a skill at the end of the removal that
- removes the state so it works, but I don't really feel fully comfortable with
- just leaving it like this.
- CONFU_SKL is the skill ID that will be autocast when the state is removed that
- fully removes the skill and enables the state to be re-added again. Thiss skill
- will ideally be a skill that has no animation, cost, or casting time.
- =end
- #=====================================#
- module XAS_J #
- CONFUSE = /<Confuse>/ #
- CONFU_CNT = 30 #
- CONFU_SKL = 27 #
- end #
- #=====================================#
- class Game_Character < Game_CharacterBase
- #alters writes in the function of confusion into the state_update method.
- alias j_xas_confuse_note update_state_abs_effects
- def update_state_abs_effects(state)
- j_xas_confuse_note(state)
- if $game_system.state_confu
- if state.note =~ XAS_J::CONFUSE
- self.battler.state_stop = true
- @move_speed = 3.5
- execute_state_confuse(state)
- end
- end
- end
- #a new method to actually accomplish the "confusion".
- def execute_state_confuse(state)
- if self.battler.state_duration[state.id] % XAS_J::CONFU_CNT == 0
- move_random
- end
- end
- #adds in the temporary fix that I've come up with regarding confusion.
- def update_remove_state(state)
- self.battler.state_duration[state.id] -= 1
- if self.battler.state_duration[state.id] <= 0
- self.battler.remove_state(state.id)
- self.shoot(XAS_J::CONFU_SKL) if state.note =~ XAS_J::CONFUSE
- end
- end
- end#Game_Character
- =begin
- #-------------------------------------------------------------------------------
- Throw Equip Requirements [throw_reqs]
- Expands allowing armor requirements to throw specific... stuff.
- This modification requires the existing MOG - XAS PICKUP AND THROW (v1.0+) to
- function at all.
- It expands the original functionality beyond just being able to pickup and
- throw, but now to even require specific armors to be equipped to pick up the
- various boulders.
- With a simple note-tag extra you can now add a requirement of a specific armor
- to pickup and throw specific things, ie: snow mitts to throw snowballs, or
- maybe power gloves to throw boulders.
- Use this note-tag now to add a requirement:
- <Throw#:ID> or <Throw#:ID,ID,ID,etc>
- where # is the number of spaces to be thrown (as with before)
- and ID is the armor required.
- Example:
- <Throw3>
- Throws the object 3 spaces infront of you, no equipment requirement. (default)
- <Throw2:10>
- Allows you to pickup/throw the object 2 spaces if you are wearing ARMOR_ID 10.
- <Throw8:4,5,6>
- Allows you to pickup/throw the object 8 spaces if you are wearing any of the
- three ARMOR_ID's: 4 or 5 or 6.
- =end
- class Game_Event < Game_Character
- alias j_xas_throwreq initialize
- def initialize(map_id, event)
- j_xas_throwreq(map_id, event)
- if $game_system.throw_reqs
- if event.name =~ /<Throw(\d+):*(\d+(?:\s*,\s*\d+)*)>/i
- @throw = $1.to_i
- $2.scan(/\d+/).each { |num| @throw_equip << (num.to_i) if num.to_i > 0 }
- end
- end
- end
- end#Game_Event
- class Game_Temp
- attr_accessor :t_equips
- alias j_xas_tequips initialize
- def initialize
- @t_equips = false
- j_xas_tequips
- end
- end#Game_Temp
- class Game_Character < Game_CharacterBase
- attr_accessor :throw_equip
- alias j_xas_equipthrow initialize
- def initialize
- @throw_equip = [] if $game_system.throw_reqs
- j_xas_equipthrow
- end
- end#Game_Character
- class Game_Player < Game_Character
- # adds in the new method for checking equipment before lifting an object.
- alias j_xas_checkequips can_check_pickup_event?
- def can_check_pickup_event?
- if $game_system.throw_reqs
- check_equips
- return false unless $game_temp.t_equips
- end
- j_xas_checkequips
- end
- def check_equips
- f_x = $game_map.x_with_direction(@x, @direction)
- f_y = $game_map.y_with_direction(@y, @direction)
- for event in $game_map.events_xy(f_x, f_y)
- te = event.throw_equip
- if te.empty?
- # if there are no throwing requirements?
- return $game_temp.t_equips = true
- else
- # check to see if the leader is wearing the required armor.
- for i in $game_party.members[0].armors
- if te.include?(i.id)
- $game_temp.t_equips = true
- return
- else
- $game_temp.t_equips = false
- end
- end#armors
- end#if
- end#event
- end
- end#Game_Player
- class Game_Interpreter
- include XAS_J
- end
- #=End=Compilation=#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement