Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # XAS Different Difficulties
- #===============================================================================
- # Created by Mr_Wiggles
- # Version: 1.5
- # Date: 4/09/2012
- #===============================================================================
- #
- # Instructions:
- #
- # Place bellow XAS System, and if your using "XRXS - Damage Pop" be sure to
- # place this bellow that as well.
- #
- #===============================================================================
- # You can use conditional braches for the Difficulties by useing:
- #
- # $game_system.difficulty_name == "NAME"
- #
- # in your conditional branch. The NAME is are the same as you specify in the
- # configuration below.
- #
- # I.E. you want somthing to only show up on easy mode, you'd use a
- # Conditional Branch in an event useing the script command that would
- # say:
- # $game_system.difficulty_name == "Easy"
- #
- #
- # You can use the same method as above to check if a difficulty is
- # locked by using:
- #
- # diff_locked?(name)
- #
- #
- # To unlock a difficulty, use an event command script call that says:
- #
- # unlock_diff(name)
- #
- #===============================================================================
- #===============================================================================
- # Use the following template to create difficulties in your game
- # Note that all the "rates" are in %. Values over 100 will increase, values
- # under 100 will decrease the given attribute. Of course you can add/remove
- # any difficulties you want, be sure to separate them with commas.
- #===============================================================================
- # DIFFICULTIES = [
- # [ (1) , (2) , (3) , (4) , (5) ],
- # [ (1) , (2) , (3) , (4) , (5) ],
- # [ (1) , (2) , (3) , (4) , (5) ]
- # ]
- #
- # 1) "NAME" - This is what you want to call your diffuculty level
- #
- # 2) EXP_RATE - This modifies the amount of experance the player gains
- #
- # 3) GOLD_RATE - This modifies the amount of gold gained from Enemies
- #
- # 4) ACTOR_DAMAGE_RATE - This modifies the amount of damage the actor deals
- #
- # 5) ENEMY_DAMAGE_RATE - This Modifies the amount of damage the enemies deal
- #
- #-------------------------------------------------------------------------------
- DIFFICULTIES = [
- ["Easy" , 125, 125, 120, 50],
- ["Normal" , 100, 100, 100, 100],
- ["Hard" , 75, 75, 80, 150],
- ["God Like", 20, 20, 50, 210],
- ["Give Up" , 5, 5, 10, 300]
- ]
- LOCKED = ["God Like", "Give Up"] # Names of the difficulties locked at start
- # if you already playtested you will need to
- # delete the Title.rxdata data file in your
- # Game folder inorder to change the values.
- SCREEN_SHAKE = false # Screen shakes on Crittical hits
- USEING_DAMAGE_POP = true # Are you using XRXS - Damage Pop
- WINDOW_OPACITY = 0
- WINDOW_X = 220 # X location of Difficulty window (center = 220)
- WINDOW_Y = 200 # Y location of Difficulty window (center = 200)
- CUSTOM = true # use this only if you have a custom game menu. Will prevent
- # the origional menu from popping back up.
- #===============================================================================
- # * END Congfig *
- #===============================================================================
- #==============================================================================
- # Game_System
- #==============================================================================
- class Game_System
- attr_reader :difficulty_name, :exp_rate, :gold_rate, :actor_rate, :enemy_rate
- def init_difficulty(name)
- diffs = []
- for dif in DIFFICULTIES
- n = dif[0]
- diffs.push(n) unless difficulty_locked?(name)
- end
- index = diffs.index(name)
- @difficulty_name, @exp_rate, @gold_rate, @actor_rate, @enemy_rate =
- DIFFICULTIES[index]
- end
- def difficulty_locked?(name)
- if @diffs_locked.nil?
- if !FileTest.exist?("Title.rxdata")
- @diffs_locked = LOCKED
- file = File.open("Title.rxdata", "wb")
- Marshal.dump(@diffs_locked, file)
- file.close
- else
- file = File.open("Title.rxdata", "r")
- @diffs_locked = Marshal.load(file)
- file.close
- end
- end
- return @diffs_locked.include?(name)
- end
- def unlock_difficulty(name)
- @diffs_locked.delete(name)
- file = File.open("Title.rxdata", "wb")
- Marshal.dump(@diffs_locked, file)
- file.close
- end
- end
- #===============================================================================
- # Interperter
- #===============================================================================
- class Interpreter
- def diff_locked?(name)
- $game_system.difficulty_locked?(name)
- end
- def unlock_diff(name)
- $game_system.unlock_difficulty(name)
- end
- end
- #===============================================================================
- # Game_Battler
- #===============================================================================
- class Game_Battler
- #-------------------------------------------------------------------------------
- # Normal Attack
- #-------------------------------------------------------------------------------
- def attack_effect(attacker)
- self.critical = false
- hit_result = (rand(100) < attacker.hit)
- if hit_result == true
- # Check if Invinvible State
- if self.states.include?(XAS::INVINCIBLE_ID)
- $game_system.se_play(XAS_ABS_SETUP::SHIELD_SE)
- self.damage = $data_states[XASINVINCIBLE_ID].name
- return
- end # end Invinvible Check
- # Check if Sleep State
- if self.states.include?(XAS::SLEEP_ID)
- self.xas_states_sleep_time = 0
- self.xas_states_sleep = false
- self.xas_states_sleep_ani = 0
- self.remove_state(XAS::SLEEP_ID)
- end # end Sleep State Check
- # Attack Calculations
- atk = [attacker.atk - self.pdef / 2, 0].max
- self.damage = atk * (20 + attacker.str) / 20
- self.damage *= elements_correct(attacker.element_set)
- self.damage /= 100
- # if Guarding
- if self.damage > 0
- if self.guarding?
- self.damage /= 2
- end
- end # end Guard Check
- if self.damage.abs > 0
- amp = [self.damage.abs * 15 / 100, 1].max
- self.damage += rand(amp+1) + rand(amp+1) - amp
- end
- eva = 8 * self.agi / attacker.dex + self.eva
- hit = self.damage < 0 ? 100 : 100 - eva
- hit = self.cant_evade? ? 100 : hit
- hit_result = (rand(100) < hit)
- end # end if hit_result == true
- if hit_result == true
- # If attack is critical
- if (rand(100) < 4 * attacker.dex / self.agi) or
- attacker.states.include?(XAS::BERSERK_ID)
- critical_damage = self.damage * XAS_SKILL::CRITICAL_DAMAGE_PERC / 100
- self.damage += critical_damage
- self.critical = true
- # make screen shake
- if SCREEN_SHAKE
- $game_screen.start_shake(5,10,20)
- end # end Screen Shake
- end # end Critical Attack Equasion
- if XAS_ABS_SETUP::DEFENSE_SYSTEM_ACTIVE == true
- actor = $game_party.actors[0]
- armor_id = actor.armor1_id
- armor_tool_id = XAS_SKILL::SHIELD_ID_TOOL[armor_id]
- #------------------------------------------------------------
- if self.is_a?(Game_Actor) and
- $game_temp.shield_active == true and
- $game_system.move_meter > XAS::DASH_ACTIVE_PERC and
- self.damage > 0 and not
- XAS_BA_ENEMY::IGNORE_HERO_SHIELD.include?(attacker.id) and
- (armor_tool_id != nil or armor_tool_id == 0) and
- $game_temp.defense_per > 0 and
- $game_switches[XASCT_DISABLE_SWITCH] == false # if end line
- #-----------------------------------------------------------
- # ^ that is a BIG if....
- #-----------------------------------------------------------
- defence_p = self.damage * $game_temp.defense_per / 100
- self.damage -= defence_p
- if XAS_ABS_SETUP::DEFENSE_COST_TYPE == 1
- damage_ct = 10 + rand(10)
- $game_system.move_meter -= damage_ct
- end # end XAS_ABS_SETUP::DEFENSE_COST_TYPE == 1
- end # end the "BIG" if
- end # end XAS_ABS_SETUP::DEFENSE_SYSTEM_ACTIVE == true
- remove_states_shock
- # if the attacker is an Enemy
- if attacker.is_a?(Game_Enemy)
- attack_hp_per = XAS_BA_ENEMY::ATTACK_HP_PERC[attacker.id]
- attack_maxhp_per = XAS_BA_ENEMY::ATTACK_MAXHP_PERC[attacker.id]
- attack_sp_per = XAS_BA_ENEMY::ATTACK_SP_PERC[attacker.id]
- attack_maxsp_per = XAS_BA_ENEMY::ATTACK_MAXSP_PERC[attacker.id]
- attack_add_states = XAS_BA_ENEMY::ATTACK_ADD_STATES[attacker.id]
- # if Special attack markers
- if attack_hp_per != nil
- self.damage = self.hp * attack_hp_per / 100
- elsif attack_maxhp_per != nil
- self.damage = self.maxhp * attack_maxhp_per / 100
- elsif attack_sp_per != nil
- self.damage = self.sp * attack_sp_per / 100
- elsif attack_maxsp_per != nil
- self.damage = self.maxhp * attack_maxsp_per / 100
- end # end Special attack markers
- # if attack causes a state
- if attack_add_states != nil
- self.add_state(attack_add_states)
- end # end States add
- end # end if attacker is an Enemy
- if attack_sp_per != nil or attack_maxsp_per != nil
- if XAS_ABS_SETUP::DEFENSE_SYSTEM_ACTIVE == true
- actor = $game_party.actors[0]
- armor_id = actor.armor1_id
- armor_tool_id = XAS_SKILL::SHIELD_ID_TOOL[armor_id]
- #------------------------------------------------------------
- if self.is_a?(Game_Actor) and $game_temp.shield_active == true and
- $game_system.move_meter > XAS::DASH_ACTIVE_PERC and
- self.damage > 0 and not
- XAS_BA_ENEMY::IGNORE_HERO_SHIELD.include?(attacker.id) and
- (armor_tool_id != nil or armor_tool_id == 0)
- #-----------------------------------------------------------
- # ^ that is a BIG if....
- #-----------------------------------------------------------
- self.damage = self.damage * $game_temp.defense_per / 100
- end # end "BIG" if
- end # end XAS_ABS_SETUP::DEFENSE_SYSTEM_ACTIVE == true
- # If damage is greater then Skill points?
- if self.damage > self.sp
- self.sp -= self.sp
- self.damage = $data_system.words.sp + " " + self.sp.to_s
- else
- self.sp -= self.damage
- self.damage = $data_system.words.sp + " " + self.damage.to_s
- end # end if Damage Higher then Skill Points
- else # for (if attack_sp_per != nil or attack_maxsp_per != nil)
- if self.states.include?(XAS::LIFE_ID) and
- self.hp <= self.damage
- self.damage = 0
- self.hp = 1
- self.xas_states_life_on = true
- return
- end
- #--------------------------------------------------------------
- # Damage Modifier
- #--------------------------------------------------------------
- # if Attacker is an Enemy
- if attacker.is_a?(Game_Enemy)
- self.damage = self.damage * $game_system.enemy_rate / 100
- # if Attacker is the Player
- # else
- # self.damage = self.damage * $game_system.actor_rate / 100
- end
- #--------------------------------------------------------------
- self.hp -= self.damage
- end
- @state_changed = false
- states_plus(attacker.plus_state_set)
- states_minus(attacker.minus_state_set)
- else
- self.damage = "Miss"
- self.critical = false
- end
- return true
- end
- #-------------------------------------------------------------------------------
- # Skill Attack For Player
- #-------------------------------------------------------------------------------
- def skill_effect(user, skill)
- @actor = $game_party.actors[0]
- self.critical = false
- if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
- ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
- return false
- end
- effective = false
- effective |= skill.common_event_id > 0
- hit = skill.hit
- if skill.atk_f > 0
- hit *= user.hit / 100
- end
- hit_result = (rand(100) < hit)
- effective |= hit < 100
- if hit_result == true
- ignore_reflect = Database_Bullet::IGNORE_REFLECT[skill.id]
- if self.states.include?(XAS::INVINCIBLE_ID)
- $game_system.se_play(XAS_ABS_SETUP::SHIELD_SE)
- self.damage = $data_states[XASINVINCIBLE_ID].name
- return
- elsif self.states.include?(XAS::REFLECT_ID) and not
- ((self.is_a?(Game_Actor) and user.is_a?(Game_Actor)) or
- (self.is_a?(Game_Enemy) and user.is_a?(Game_Enemy))) and not
- (XAS_SKILL::WEP_ID_TOOL.include?(skill.id) or
- XAS::ITEM_COST.include?(skill.id) or
- ignore_reflect == true)
- self.damage = ""
- return
- elsif XAS_SKILL::ONE_HP_DAMAGE.include?(skill.id)
- self.damage = XAS_SKILL::ONE_HP_TEXT
- self.hp = 1
- if self.is_a?(Game_Enemy) and $mog_rgss_xas_enemy_hp != nil
- $xas_enemy_name = $data_enemies[self.id].name
- $game_temp.xas_info_ref = 40 * MOG::ENEMY_INFO_FADE_TIME
- #--------------------------------------------------------------
- # Damage Modifier
- #--------------------------------------------------------------
- # if Attacker is the Player
- unless self.is_a?(Game_Enemy)
- self.damage = self.damage * $game_system.actor_rate / 100
- end
- #--------------------------------------------------------------
- $xas_enemy_hp = self.hp
- $xas_enemy_maxhp = self.maxhp
- $xas_info_ref = true
- end
- return
- end
- power = skill.power + user.atk * skill.atk_f / 100
- if power > 0
- power -= self.pdef * skill.pdef_f / 200
- power -= self.mdef * skill.mdef_f / 200
- power = [power, 0].max
- end
- rate = 20
- rate += (user.str * skill.str_f / 100)
- rate += (user.dex * skill.dex_f / 100)
- rate += (user.agi * skill.agi_f / 100)
- rate += (user.int * skill.int_f / 100)
- self.damage = power * rate / 20
- self.damage *= elements_correct(skill.element_set)
- self.damage /= 100
- critical_damage = self.damage * XAS_SKILL::CRITICAL_DAMAGE_PERC / 100
- if self.damage > 0
- if self.states.include?(XAS::SLEEP_ID)
- self.xas_states_sleep_time = 0
- self.xas_states_sleep = false
- self.xas_states_sleep_ani = 0
- self.remove_state(XAS::SLEEP_ID)
- end
- unless user.states.include?(XAS::BERSERK_ID)
- if XAS_SKILL::SKILL_CRITICAL_ON == true
- if rand(100) < 4 * user.dex / self.agi
- self.damage += critical_damage
- self.critical = true
- end
- else
- if XAS_SKILL::WEP_ID_TOOL.include?(skill.id) and
- user.is_a?(Game_Actor)
- if rand(100) < 4 * user.dex / self.agi
- self.damage += critical_damage
- self.critical = true
- end
- end
- end
- end
- if self.guarding?
- self.damage /= 2
- end
- end
- if skill.variance > 0 and self.damage.abs > 0
- amp = [self.damage.abs * skill.variance / 100, 1].max
- self.damage += rand(amp+1) + rand(amp+1) - amp
- end
- eva = 8 * self.agi / user.dex + self.eva
- hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
- hit = self.cant_evade? ? 100 : hit
- hit_result = (rand(100) < hit)
- effective |= hit < 100
- enemy = self
- if self.is_a?(Game_Enemy) and self.steal == false and not
- XAS_BA_ENEMY::ITEM_ENEMY.include?(self.id) and
- XAS_SKILL::STEAL_EFFECT.include?(skill.id)
- treasures = []
- if rand(100) < enemy.treasure_prob
- if enemy.treasure_prob > 0
- if enemy.item_id > 0
- treasures.push($data_items[enemy.item_id])
- end
- if enemy.weapon_id > 0
- treasures.push($data_weapons[enemy.weapon_id])
- end
- if enemy.armor_id > 0
- treasures.push($data_armors[enemy.armor_id])
- end
- for item in treasures
- case item
- when RPG::Item
- $game_party.gain_item(item.id, 1)
- when RPG::Weapon
- $game_party.gain_weapon(item.id, 1)
- when RPG::Armor
- $game_party.gain_armor(item.id, 1)
- end
- end
- if item != nil
- self.damage = XAS_SKILL::STEAL_TEXT + item.name.to_s
- $game_system.se_play(XAS_SKILL::STEAL_SE)
- else
- self.damage = XAS_SKILL::STEAL_NOITEM_TEXT
- end
- self.damage_pop = true
- self.steal = true
- end
- return
- else
- self.damage = XAS_SKILL::STEAL_MISS_TEXT
- self.damage_pop = true
- return
- end
- elsif self.is_a?(Game_Enemy) and self.steal == true and not
- XAS_BA_ENEMY::ITEM_ENEMY.include?(self.id) and
- XAS_SKILL::STEAL_EFFECT.include?(skill.id)
- self.damage = XAS_SKILL::STEAL_NOITEM_TEXT
- self.damage_pop = true
- self.steal = true
- return
- end
- end
- if hit_result == true
- if XAS_ABS_SETUP::DEFENSE_SYSTEM_ACTIVE == true and
- $game_switches[XASCT_DISABLE_SWITCH] == false
- actor = $game_party.actors[0]
- armor_id = actor.armor1_id
- armor_tool_id = XAS_SKILL::SHIELD_ID_TOOL[armor_id]
- ignore_playershield = Database_Bullet::IGNORE_PLAYERSHIELD[skill.id]
- if self.is_a?(Game_Actor) and $game_temp.shield_active == true and
- $game_system.move_meter > XAS::DASH_ACTIVE_PERC and
- self.damage > 0 and ignore_playershield == false and
- (armor_tool_id != nil or armor_tool_id == 0) and
- $game_temp.defense_per > 0
- defence_p = self.damage * $game_temp.defense_per / 100
- self.damage -= defence_p
- if XAS_ABS_SETUP::DEFENSE_COST_TYPE == 1
- $game_system.move_meter -= skill.sp_cost
- end
- end
- end
- if user.states.include?(XAS::BERSERK_ID) and
- user.is_a?(Game_Actor) and
- XAS_SKILL::WEP_ID_TOOL.include?(skill.id)
- self.critical = true
- self.damage += critical_damage
- end
- if skill.power != 0 and skill.atk_f > 0
- remove_states_shock
- effective = true
- end
- actor = $game_party.actors[0]
- per_damage_maxhp = XAS_SKILL::PER_DAMAGE_HPMAX[skill.id]
- per_damage_hp = XAS_SKILL::PER_DAMAGE_HP[skill.id]
- per_damage_maxsp = XAS_SKILL::PER_DAMAGE_SPMAX[skill.id]
- per_damage_sp = XAS_SKILL::PER_DAMAGE_SP[skill.id]
- fix_damage = XAS_SKILL::FIX_DAMAGE[skill.id]
- level_damage = XAS_SKILL::LEVEL_DAMAGE[skill.id]
- level_damage_plus = XAS_SKILL::LEVEL_DAMAGE_PLUS[skill.id]
- per_damage_hp_self = XAS_SKILL::PER_DAMAGE_HP_SELF[skill.id]
- per_damage_maxhp_self = XAS_SKILL::PER_DAMAGE_MAXHP_SELF[skill.id]
- per_damage_sp_self = XAS_SKILL::PER_DAMAGE_SP_SELF[skill.id]
- per_damage_maxsp_self = XAS_SKILL::PER_DAMAGE_MAXSP_SELF[skill.id]
- per_gold_damage = XAS_SKILL::GOLD_DAM_PERC[skill.id]
- if per_damage_maxhp != nil
- self.damage = self.maxhp * per_damage_maxhp / 100
- elsif per_damage_hp != nil
- self.damage = self.hp * per_damage_hp / 100
- elsif per_damage_maxhp_self != nil
- self.damage = user.maxhp * per_damage_maxhp_self / 100
- elsif per_damage_hp_self != nil
- self.damage = user.hp * per_damage_hp_self / 100
- elsif per_damage_maxsp_self != nil
- self.damage = user.maxsp * per_damage_maxsp_self / 100
- elsif per_damage_sp_self != nil
- self.damage = user.sp * per_damage_sp_self / 100
- elsif fix_damage != nil
- self.damage = fix_damage
- elsif level_damage != nil and user.is_a?(Game_Actor)
- self.damage = actor.level * level_damage
- elsif level_damage_plus != nil and user.is_a?(Game_Actor)
- self.damage += (1 + self.damage * level_damage_plus / 100) * actor.level
- elsif per_gold_damage != nil and user.is_a?(Game_Actor)
- if per_gold_damage < $game_party.gold
- self.damage = per_gold_damage
- $game_party.lose_gold(per_gold_damage)
- else
- self.damage = $game_party.gold
- $game_party.lose_gold($game_party.gold)
- end
- elsif per_damage_maxsp != nil
- self.damage = self.maxsp * per_damage_maxsp / 100
- elsif per_damage_sp != nil
- self.damage = self.sp * per_damage_sp / 100
- end
- if self.damage > XAS_ABS_SETUP::DAMAGE_LIMIT
- self.damage = XAS_ABS_SETUP::DAMAGE_LIMIT
- elsif self.damage < -XAS_ABS_SETUP::DAMAGE_LIMIT
- self.damage = -XAS_ABS_SETUP::DAMAGE_LIMIT
- end
- if self.critical == true
- unless XAS_BA_ENEMY::ITEM_ENEMY.include?(self.id)
- if SCREEN_SHAKE
- $game_screen.start_shake(5,10,20)
- end
- end
- end
- last_hp = self.hp
- drain_sp_effect = XAS_SKILL::DRAIN_SP_PERC[skill.id]
- if self.states.include?(XAS::LIFE_ID) and
- self.hp <= self.damage
- self.damage = 0
- self.hp = 1
- self.xas_states_life_on = true
- return
- end
- unless drain_sp_effect != nil
- if per_damage_maxsp != nil or per_damage_sp != nil
- if XAS_ABS_SETUP::DEFENSE_SYSTEM_ACTIVE == true
- actor = $game_party.actors[0]
- armor_id = actor.armor1_id
- armor_tool_id = XAS_SKILL::SHIELD_ID_TOOL[armor_id]
- ignore_playershield = Database_Bullet::IGNORE_PLAYERSHIELD[skill.id]
- if self.is_a?(Game_Actor) and $game_temp.shield_active == true and
- $game_system.move_meter > XAS::DASH_ACTIVE_PERC and
- self.damage > 0 and ignore_playershield == false and
- (armor_tool_id != nil or armor_tool_id == 0)
- self.damage = self.damage * $game_temp.defense_per / 100
- end
- end
- old_sp = self.sp
- if self.damage > self.sp
- real_damage = $data_system.words.sp + " " + self.sp.to_s
- self.sp -= self.sp
- self.damage = real_damage
- else
- real_damage = $data_system.words.sp + " " + self.damage.to_s
- self.sp -= self.damage
- self.damage = real_damage
- end
- else
- #--------------------------------------------------------------
- # Damage Modifier
- #--------------------------------------------------------------
- # if Attacker is an Enemy
- if self.is_a?(Game_Enemy)
- # self.damage = self.damage * $game_system.enemy_rate / 100
- # if Attacker is the Player
- #else
- self.damage = self.damage * $game_system.actor_rate / 100
- end
- #--------------------------------------------------------------
- self.hp -= self.damage
- end
- end
- effective |= self.hp != last_hp
- @state_changed = false
- unless XAS_BA_ENEMY::ITEM_ENEMY.include?(self.id)
- effective |= states_plus(skill.plus_state_set)
- effective |= states_minus(skill.minus_state_set)
- end
- if skill.power == 0
- self.damage = ""
- end
- else
- if self.is_a?(Game_Enemy) and self.steal == false and not
- XAS_BA_ENEMY::ITEM_ENEMY.include?(self.id) and
- XAS_SKILL::STEAL_EFFECT.include?(skill.id)
- self.damage = XAS_SKILL::STEAL_MISS_TEXT
- self.damage_pop = true
- elsif self.is_a?(Game_Enemy) and self.steal == true and not
- XAS_BA_ENEMY::ITEM_ENEMY.include?(self.id) and
- XAS_SKILL::STEAL_EFFECT.include?(skill.id)
- self.damage = XAS_SKILL::STEAL_NOITEM_TEXT
- self.damage_pop = true
- else
- self.damage = "Miss"
- end
- end
- unless $game_temp.in_battle
- self.damage = nil
- end
- return effective
- end
- end
- #==============================================================================
- # Gold & Exp
- #==============================================================================
- class Game_Event < Game_Character
- def enemy_defeat_process(enemy)
- last_level = $game_player.battler.level
- #--------------------------------------------------------------
- # Difficulty Modifier
- #--------------------------------------------------------------
- $game_party.gain_exp(enemy.exp * $game_system.exp_rate / 100)
- #--------------------------------------------------------------
- $game_party.gain_gold(enemy.gold * $game_system.gold_rate / 100)
- #--------------------------------------------------------------
- if $mog_rgss_ap_parameter != nil
- $game_party.gain_ap(enemy.ap)
- end
- if last_level < $game_player.battler.level
- $game_system.se_play(XAS_BA::LEVEL_UP_SE)
- $game_player.battler.damage = XAS_BA::LEVEL_UP_TEXT
- $game_player.battler.damage_pop = true
- $game_player.need_refresh = true
- if XAS_BA::LEVELUP_RECOVER == true
- actor = $game_party.actors[0]
- actor.hp = actor.maxhp
- actor.sp = actor.maxsp
- end
- end
- id = XAS_BA::DEFEAT_NUMBER_ID
- $game_variables[id] += 1 if id != 0
- switch_id = XAS_BA_ENEMY::DEFEAT_SWITCH_IDS[self.enemy_id]
- jumpa(0,0,20) if XAS_BA_ENEMY::COLLAPSE_JUMP == true
- if switch_id != nil
- $game_switches[switch_id] = true
- $game_map.refresh
- end
- end
- end
- #==============================================================================
- # Add selection to Scene_Title's command_new_game
- #==============================================================================
- class Scene_Title
- alias main_difficulties_later main
- def main
- main_difficulties_later
- @difficulty_window.dispose if @difficulty_window != nil
- end
- alias command_new_game_difficulties_later command_new_game
- def command_new_game
- $game_system.se_play($data_system.decision_se)
- @difficulties = []
- for diff in DIFFICULTIES
- name = diff[0]
- @difficulties.push(diff[0]) unless $game_system.difficulty_locked?(name)
- end
- @difficulty_window = Window_Command.new(@command_window.width, @difficulties)
- @difficulty_window.x = WINDOW_X
- @difficulty_window.y = WINDOW_Y -
- (@difficulty_window.height - @command_window.height) / 2
- @difficulty_window.back_opacity = WINDOW_OPACITY
- @command_window.active = @command_window.visible = false
- @difficulty_window.z = 99999
- end
- alias :upd_dif_window :update
- def update
- if @difficulty_window.nil?
- upd_dif_window; return
- end
- @difficulty_window.update
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- @command_window.active, @command_window.visible = true, !CUSTOM
- @difficulty_window.active, @difficulty_window.visible = false, false
- @difficulty_window.dispose; @difficulty_window = nil
- elsif Input.trigger?(Input::C)
- command_new_game_difficulties_later
- $game_system.init_difficulty(@difficulties[@difficulty_window.index])
- @difficulty_window.active, @difficulty_window.visible = false, false
- @difficulty_window.dispose; @difficulty_window = nil
- $scene = Scene_Map.new
- end
- end
- end
- #==============================================================================
- # Update new Gold & Exp results - for XRXS damage pop script
- #==============================================================================
- if USEING_DAMAGE_POP
- module XRXS_ResultPop
- def update
- super
- unless @xrxs_resultpop_done
- if @battler == nil or not @battler.is_a?(Game_Enemy)
- @xrxs_resultpop_done = true
- return
- end
- if @_collapse_duration > 0 and @battler.gain_exp_act == true
- if @_collapse_duration == EXP
- if @battler.exp != 0
- #--------------------------------------------------------------
- # Difficulty Modifier
- exp_earn = @battler.exp
- exp_earn = exp_earn * $game_system.exp_rate / 100
- result = "EXP " + exp_earn.to_s
- #--------------------------------------------------------------
- damage(result, false,false,false)
- end
- elsif @_collapse_duration == GOLD and @battler.gain_exp_act == true
- if @battler.gold != 0
- #--------------------------------------------------------------
- # Difficulty Modifier
- gold_earn = @battler.gold
- gold_earn = gold_earn * $game_system.gold_rate / 100
- result = gold_earn.to_s + " " + $data_system.words.gold
- #--------------------------------------------------------------
- damage(result, false,false,false)
- end
- @xrxs_resultpop_done = true if $mog_rgss_ap_parameter == nil
- elsif $mog_rgss_ap_parameter != nil and @_collapse_duration == (GOLD / 2) and @battler.gain_exp_act == true
- if @battler.ap != 0
- result = @battler.ap.to_s + " " + MOG::AP_NAME
- damage(result, false,false,false)
- end
- @xrxs_resultpop_done = true
- end
- end
- end
- end
- end
- end # if USEING_DAMAGE_POP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement