12-21-2012, 11:55 PM
My Dynamic Leveling Scriptlet
Let's say you want an actor to get some experience from a couple of poor, abused ghosts.
actor.exp = DynamicLeveling.dynamic_level_exp(enemy, actor_level)
The catch here would be the need to find a way to assign them a specific level either by using an array, a hash or something else.
Oh, oh, I found some other weird stuff found in the default scripts.
Note that this comes from Game_Party class an even so it calls itself with an external flag, i.e. $game_party.actors.size and $game_party.all_dead?, I don't really know why they thought it would ever make any sense to achieve such a terrible and useless feat.
Code:
module DynamicLeveling
EXP_PERCENT = 0.1
def self.dynamic_level_exp(enemy, actor_level)
lvl_bonus_penalty = enemy.level - actor_level
exp = (enemy.exp * EXP_PERCENT).round
total_exp = [1, enemy.exp + (lvl_bonus_penalty * exp)].max
end
end
class Game_Enemy
attr_accessor :level
end
Let's say you want an actor to get some experience from a couple of poor, abused ghosts.
actor.exp = DynamicLeveling.dynamic_level_exp(enemy, actor_level)
The catch here would be the need to find a way to assign them a specific level either by using an array, a hash or something else.
Oh, oh, I found some other weird stuff found in the default scripts.
Code:
def all_dead?
# If number of party members is 0
if $game_party.actors.size == 0
return false
end
# If an actor is in the party with 0 or more HP
for actor in @actors
if actor.hp > 0
return false
end
end
# All members dead
return true
end
#--------------------------------------------------------------------------
# * Slip Damage Check (for map)
#--------------------------------------------------------------------------
def check_map_slip_damage
for actor in @actors
if actor.hp > 0 and actor.slip_damage?
actor.hp -= [actor.maxhp / 100, 1].max
if actor.hp == 0
$game_system.se_play($data_system.actor_collapse_se)
end
$game_screen.start_flash(Color.new(255,0,0,128), 4)
$game_temp.gameover = $game_party.all_dead?
end
end
end
Note that this comes from Game_Party class an even so it calls itself with an external flag, i.e. $game_party.actors.size and $game_party.all_dead?, I don't really know why they thought it would ever make any sense to achieve such a terrible and useless feat.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE