Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
After Battle Changes 1.1
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


With this script, the actors will recover all the hp and sp when they level up; and the exp will be splited.
(If two actors can get exp, and normal received is 20, each one will receive 10)

:anim_new1: is fixed!

Code:
#=============================================================
# • After Battle Changes
#------------------------------------------------------------------------------
# Slipknot
# 1.1
# 15/02/06
#------------------------------------------------------------------------------
=begin
  Version 1.1
   - Fixed experience split.
   - In the result window, now appear the total experience.
=end
#=============================================================

module Battle_End_Options
  #--------------------------------------------------------------------------
  # • Split experience received?
  #--------------------------------------------------------------------------
  Split_Exp = true
  #--------------------------------------------------------------------------
  # • Full recover when actor increase level?
  #--------------------------------------------------------------------------
  Level_Up_Recover = true
  #--------------------------------------------------------------------------
  # • Phase 5 wait time
  #--------------------------------------------------------------------------
  End_Frames = 70
  #--------------------------------------------------------------------------
end

#------------------------------------------------------------------------------
# Begin Scene_Battle Edit
#------------------------------------------------------------------------------
class Scene_Battle
  #--------------------------------------------------------------------------
  include Battle_End_Options
  #--------------------------------------------------------------------------
  def start_phase5
    @phase = 5
    $game_system.me_play($game_system.battle_end_me)
    $game_system.bgm_play($game_temp.map_bgm)
    exp = gold = old_exp = 0
    treasures = []
    for enemy in $game_troop.enemies
      unless enemy.hidden
        exp += enemy.exp
        gold += enemy.gold
        if rand(100) < enemy.treasure_prob
          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
        end
      end
    end
    treasures = treasures[0..5]
    psize = $game_party.actors.size-1
    old_exp = exp
    if Split_Exp
      can_get = 0
      0.upto(psize) do |x|
        actor = $game_party.actors[x]
        next if actor.cant_get_exp?
        can_get += 1
      end
      exp = (old_exp / can_get).ceil if can_get > 0
    end
    for i in 0..psize
      actor = $game_party.actors[i]
      unless actor.cant_get_exp?
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
          if Level_Up_Recover
            actor.hp = actor.maxhp
            actor.sp = actor.maxsp
          end
        end
      end
    end
    $game_party.gain_gold(gold)
    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
    @result_window = Window_BattleResult.new(old_exp, gold, treasures)
    @phase5_wait_count = End_Frames
  end
end
#------------------------------------------------------------------------------
# End Scene_Battle Edit
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# Begin Game_Actor Edit
#------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  def final_level?
    return @level >= $data_actors[@actor_id].final_level
  end
  #--------------------------------------------------------------------------
  def cant_get_exp?
    return true if final_level?
    super
  end
end
#------------------------------------------------------------------------------
# End Game_Actor Edit
#------------------------------------------------------------------------------
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Battle Trophies GoldenShadow 0 2,518 09-07-2006, 01:00 PM
Last Post: GoldenShadow
  Obtain Experience as You Battle Tsunokiette 0 2,078 06-28-2006, 01:00 PM
Last Post: Tsunokiette
  Change Cursor with differend commands in Battle Divinity 0 2,209 06-22-2006, 01:00 PM
Last Post: Divinity
  Battle Memory mudgolem 0 2,021 06-21-2006, 01:00 PM
Last Post: mudgolem
  Before Battle Switch Sheol 0 2,268 04-20-2006, 01:00 PM
Last Post: Sheol
  New Battle System V1.5 (Added Side View) Guedez 0 2,421 01-12-2006, 01:00 PM
Last Post: Guedez
  Little Battle Edit Darkness Seraph 0 1,772 12-26-2005, 01:00 PM
Last Post: Darkness Seraph
  Battle Event List & Pre-Battle Troop Setup SephirothSpawn 0 2,459 12-25-2005, 01:00 PM
Last Post: SephirothSpawn
  Random Battle Music Boss & Final Boss setup Eccid 0 2,022 11-03-2005, 01:00 PM
Last Post: Eccid
  Event check before battle end Jimmie 0 1,835 09-03-2005, 01:00 PM
Last Post: Jimmie



Users browsing this thread: