
Level 6

Group: Member
Posts: 84
Type: None
RM Skill: Undisclosed

|
Almagest Battle Modifications Version: 1.3Author: AndrelvisRelease Date: 07/26/09This script adds a zodiac compatibility modifier that is applied to attacks and skills, enhancing or reducing their effect; it also affects curative skills. The higher the compatibility between the signs of the attacker/skill user and that of the target, the higher the effect. The compatibility between signs is easily customizable. EDIT: Updated to include an option for having a new skill, Numerology (functions somewhat like the one from Final Fantasy XII). It is deactivated in default. It does damage as per this equation: Damage 2 ^ N, where N is the number of times it has been used before without missing. The Hit Chance also decreases over time; more details in the customization section below. Hope you enjoy! 1.1: Fixed a bug in the attack damage formula that made the zodiac modifier be multiplied by four. 1.2: Fixed a bug in the attack and skill damage formulae that could cause problems if either user or target didn't have a zodiac sign. Fixed the zodiac compatibility for those with non-specified sign. 1.3: Added the Numerology skill option.
CODE #### CUSTOMIZATION #### #if this is set to true, actors and enemies with unspecified zodiac sign will #be assigned a random sign instead of no sign at all RANDOM_ZODIAC = false #if this is set to true, actors with unspecified gender will be assigned a #random gender instead of no gender at all ACTOR_RANDOM_GENDER = false #if this is set to true, enemies with unspecified gender will be assigned a #random gender instead of no gender at all ENEMY_RANDOM_GENDER = false #if this is set to true, the actor's zodiac sign will show up at his status #screen SHOW_ZODIAC_STATUS = true #if this is set to true, the actor's gender will show up at his status #screen SHOW_GENDER_STATUS = false
ACTOR_ZODIAC_TABLE = { # <--- Do not remove # set from 1 to 12, each number representing a zodiac sign, from Aries to Pisces # ActorID Sign 2 => [ 3], #Sign is Gemini 3 => [ 1], #Sign is Aries 4 => [ 8], #Sign is Scorpio } # Do not remove this.
ACTOR_GENDER_TABLE = { # <--- Do not remove # set gender as 5 for male and 10 for female # ActorID Gender 1 => [ 5], 2 => [ 10], } # Do not remove this.
ENEMY_ZODIAC_TABLE = { # <--- Do not remove # EnemyID Sign 1 => [ 2], #Sign is Taurus 13 => [ 11], #Sign is Aquarius } # Do not remove this.
ENEMY_GENDER_TABLE = { # <--- Do not remove # set gender as 5 for male and 10 for female # EnemyID Gender 1 => [ 10], 13 => [ 5], } # Do not remove this.
ZODIAC_COMPATIBILITY_TABLE = { # <--- Do not remove # Sign ARI TAU GEM CNC LEO VIR LIB SCO SGT CPR AQA PSC 0 => [ 0, 0, 0, -1, 1, 0, 2, 0, 1, -1, 0, 0], #Non-specified, do not remove 1 => [ 0, 0, 0, -1, 1, 0, 2, 0, 1, -1, 0, 0], #Aries 2 => [ 0, 0, 0, 0, -1, 1, 0, 0, 0, 1, -1, 0], #Taurus 3 => [ 0, 0, 0, 0, 0, -1, 1, 0, 2, 0, 1, -1], #Gemini 4 => [ -1, 0, 0, 0, 0, 0, -1, 1, 0, 2, 0, 1], #Cancer 5 => [ 1, -1, 0, 0, 0, 0, 0, -1, 1, 0, 2, 0], #Leo 6 => [ 0, 1, -1, 0, 0, 0, 0, 0, -1, 1, 0, 2], #Virgo 7 => [ 2, 0, 1, -1, 0, 0, 0, 0, 0, -1, 1, 0], #Libra 8 => [ 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, -1, 1], #Scorpio 9 => [ 1, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, -1], #Sagittarius 10 => [ -1, 1, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0], #Capricorn 11 => [ 0, -1, 1, 0, 2, 0, 1, -1, 0, 0, 0, 0], #Aquarius 12 => [ 0, 0, -1, 1, 0, 2, 0, 1, -1, 0, 0, 0], #Pisces } # Do not remove this.
# What the compatibility numbers do: # 0 means the attack formula works as usual # 1 means 125% damage # -1 means 75% damage # 2 means 150% damage if opposite sexes and 50% if same sex
#if this is set to true, one skill will be assigned to function like the "Numerology" #from Final Fantasy XII; the exact functionality is explained below NUMEROLOGY = false
#this is the skill id for the numerology skill. Ignore if NUMEROLOGY = false NUMEROLOGY_SKILL = 90
#For each time the Numerology skill has been used, it's damage will #increase exponentially. #Damage = 2 ^ N, where n is the number of times Numerology has #been used before without missing (once it misses the counter will be set to 0. #So, the damage will go in this order: 1, 2, 4, 8, 16, 32, 64, 128 and so on, until #it reaches 65,536. At 65,536 damage, it will always miss.
#The hit chance also decreases with each Numerology that doesn't miss, as per #this equation: #Hit Chance for Nth time = 85 - (N/2) ^ 2, where N is again the number of times #Numerology has been used before without missing.
#### CUSTOMIZATION ENDS HERE #### CODE #============================================================================== # ** Almagest Battle Modifications for VX 1.3, by Andrelvis #==============================================================================
#This script adds a zodiac compatibility modifier to the effect of attacks and #skills (including curative ones). The higher the compatibility between the #signs of the attacker/skill user and that of the target, the higher the effect.
module ALMAGEST
#### CUSTOMIZATION #### #if this is set to true, actors and enemies with unspecified zodiac sign will #be assigned a random sign instead of no sign at all RANDOM_ZODIAC = false #if this is set to true, actors with unspecified gender will be assigned a #random gender instead of no gender at all ACTOR_RANDOM_GENDER = false #if this is set to true, enemies with unspecified gender will be assigned a #random gender instead of no gender at all ENEMY_RANDOM_GENDER = false #if this is set to true, the actor's zodiac sign will show up at his status #screen SHOW_ZODIAC_STATUS = true #if this is set to true, the actor's gender will show up at his status #screen SHOW_GENDER_STATUS = false
ACTOR_ZODIAC_TABLE = { # <--- Do not remove # set from 1 to 12, each number representing a zodiac sign, from Aries to Pisces # ActorID Sign 2 => [ 3], #Sign is Gemini 3 => [ 1], #Sign is Aries 4 => [ 8], #Sign is Scorpio } # Do not remove this.
ACTOR_GENDER_TABLE = { # <--- Do not remove # set gender as 5 for male and 10 for female # ActorID Gender 1 => [ 5], 2 => [ 10], } # Do not remove this.
ENEMY_ZODIAC_TABLE = { # <--- Do not remove # EnemyID Sign 1 => [ 2], #Sign is Taurus 13 => [ 11], #Sign is Aquarius } # Do not remove this.
ENEMY_GENDER_TABLE = { # <--- Do not remove # set gender as 5 for male and 10 for female # EnemyID Gender 1 => [ 10], 13 => [ 5], } # Do not remove this.
ZODIAC_COMPATIBILITY_TABLE = { # <--- Do not remove # Sign NO ARI TAU GEM CNC LEO VIR LIB SCO SGT CPR AQA PSC 0 => [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], #Non-specified, do not remove 1 => [ 0, 0, 0, 0, -1, 1, 0, 2, 0, 1, -1, 0, 0], #Aries 2 => [ 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 1, -1, 0], #Taurus 3 => [ 0, 0, 0, 0, 0, 0, -1, 1, 0, 2, 0, 1, -1], #Gemini 4 => [ 0, -1, 0, 0, 0, 0, 0, -1, 1, 0, 2, 0, 1], #Cancer 5 => [ 0, 1, -1, 0, 0, 0, 0, 0, -1, 1, 0, 2, 0], #Leo 6 => [ 0, 0, 1, -1, 0, 0, 0, 0, 0, -1, 1, 0, 2], #Virgo 7 => [ 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, -1, 1, 0], #Libra 8 => [ 0, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, -1, 1], #Scorpio 9 => [ 0, 1, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, -1], #Sagittarius 10 => [ 0, -1, 1, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0], #Capricorn 11 => [ 0, 0, -1, 1, 0, 2, 0, 1, -1, 0, 0, 0, 0], #Aquarius 12 => [ 0, 0, 0, -1, 1, 0, 2, 0, 1, -1, 0, 0, 0], #Pisces } # Do not remove this.
# What the compatibility numbers do: # 0 means the attack formula works as usual # 1 means 125% damage # -1 means 75% damage # 2 means 150% damage if opposite sexes and 50% if same sex
#if this is set to true, one skill will be assigned to function like the "Numerology" #from Final Fantasy XII; the exact functionality is explained below NUMEROLOGY = false
#this is the skill id for the numerology skill. Ignore if NUMEROLOGY = false NUMEROLOGY_SKILL = 90
#For each time the Numerology skill has been used, it's damage will #increase exponentially. #Damage = 2 ^ N, where n is the number of times Numerology has #been used before without missing (once it misses the counter will be set to 0. #So, the damage will go in this order: 1, 2, 4, 8, 16, 32, 64, 128 and so on, until #it reaches 65,536. At 65,536 damage, it will always miss.
#The hit chance also decreases with each Numerology that doesn't miss, as per #this equation: #Hit Chance for Nth time = 85 - (N/2) ^ 2, where N is again the number of times #Numerology has been used before without missing.
#### CUSTOMIZATION ENDS HERE ####
end #closes module
class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Get Zodiacal Sign #-------------------------------------------------------------------------- def zodiac if ALMAGEST::ACTOR_ZODIAC_TABLE.include?(actor.id) actor_zodiac = ALMAGEST::ACTOR_ZODIAC_TABLE[actor.id][0] else if ALMAGEST::RANDOM_ZODIAC if $data_actors[actor.id].zodiac == nil actor_zodiac = 1 + rand(12 - 1 + 1) end else actor_zodiac = 0 end end return actor_zodiac end #-------------------------------------------------------------------------- # * Get Gender #-------------------------------------------------------------------------- def gender if ALMAGEST::ACTOR_GENDER_TABLE.include?(actor.id) actor_gender = ALMAGEST::ACTOR_GENDER_TABLE[actor.id][0] else if ALMAGEST::ACTOR_RANDOM_GENDER if $data_actors[actor.id].gender == nil actor_gender = (1 + rand(2 - 1 + 1)) * 5 end else actor_gender = 0 end end return actor_gender end
end #end class
class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # * Get Zodiacal Sign #-------------------------------------------------------------------------- def zodiac if ALMAGEST::ENEMY_ZODIAC_TABLE.include?(enemy.id) enemy_zodiac = ALMAGEST::ENEMY_ZODIAC_TABLE[enemy.id][0] else if ALMAGEST::RANDOM_ZODIAC if $data_enemies[enemy.id].zodiac == nil enemy_zodiac = 1 + rand(12 - 1 + 1) end else enemy_zodiac = 0 end end return enemy_zodiac end #-------------------------------------------------------------------------- # * Get Gender #-------------------------------------------------------------------------- def gender if ALMAGEST::ENEMY_GENDER_TABLE.include?(enemy.id) enemy_gender = ALMAGEST::ENEMY_GENDER_TABLE[enemy.id][0] else if ALMAGEST::ENEMY_RANDOM_GENDER if $data_enemies[enemy.id].gender == nil enemy_gender = (1 + rand(2 - 1 + 1)) * 5 end else enemy_gender = 0 end end return enemy_gender end
end #end class
class Game_Battler #-------------------------------------------------------------------------- # * Calculation of Damage From Normal Attack # attacker : Attacker # The results are substituted for @hp_damage #-------------------------------------------------------------------------- def make_attack_damage_value(attacker) compatibility = ALMAGEST::ZODIAC_COMPATIBILITY_TABLE[attacker.zodiac][self.zodiac] opposite_sex = attacker.gender + self.gender if compatibility == -1 compatibility_modifier = -attacker.atk / 4 end if compatibility == 1 compatibility_modifier = attacker.atk / 4 end if compatibility == 2 if opposite_sex == 15 compatibility_modifier = attacker.atk / 2 else compatibility_modifier = -attacker.atk / 2 end end if compatibility == 0 compatibility_modifier = 0 end damage = (attacker.atk + compatibility_modifier) * 4 - self.def * 2 # base calculation damage = 0 if damage < 0 # if negative, make 0 damage *= elements_max_rate(attacker.element_set) # elemental adjustment damage /= 100 if damage == 0 # if damage is 0, damage = rand(2) # half of the time, 1 dmg elsif damage > 0 # a positive number? @critical = (rand(100) < attacker.cri) # critical hit? @critical = false if prevent_critical # criticals prevented? damage *= 3 if @critical # critical adjustment end damage = apply_variance(damage, 20) # variance damage = apply_guard(damage) # guard adjustment @hp_damage = damage # damage HP end #-------------------------------------------------------------------------- # * Calculation of Damage Caused by Skills or Items # user : User of skill or item # obj : Skill or item (for normal attacks, this is nil) # The results are substituted for @hp_damage or @mp_damage. #-------------------------------------------------------------------------- def make_obj_damage_value(user, obj) compatibility = ALMAGEST::ZODIAC_COMPATIBILITY_TABLE[user.zodiac][self.zodiac] opposite_sex = user.gender + self.gender if compatibility == -1 compatibility_modifier = -user.atk / 4 end if compatibility == 1 compatibility_modifier = user.atk / 4 end if compatibility == 2 if opposite_sex == 15 compatibility_modifier = user.atk / 2 else compatibility_modifier = -user.atk / 2 end end if compatibility == 0 compatibility_modifier = 0 end mod_user_atk = user.atk + compatibility_modifier mod_user_spi = user.spi + compatibility_modifier damage = obj.base_damage # get base damage if damage > 0 # a positive number? damage += mod_user_atk * 4 * obj.atk_f / 100 # Attack F of the user damage += mod_user_spi * 2 * obj.spi_f / 100 # Spirit F of the user unless obj.ignore_defense # Except for ignore defense damage -= self.def * 2 * obj.atk_f / 100 # Attack F of the target damage -= self.spi * 1 * obj.spi_f / 100 # Spirit F of the target end damage = 0 if damage < 0 # If negative, make 0 elsif damage < 0 # a negative number? damage -= mod_user_atk * 4 * obj.atk_f / 100 # Attack F of the user damage -= mod_user_spi * 2 * obj.spi_f / 100 # Spirit F of the user end damage *= elements_max_rate(obj.element_set) # elemental adjustment damage /= 100 damage = apply_variance(damage, obj.variance) # variance damage = apply_guard(damage) # guard adjustment if ALMAGEST::NUMEROLOGY #Final Fantasy XII Numerology Formula if obj == $data_skills[ALMAGEST::NUMEROLOGY_SKILL] #Numerology damage = 2 ** @Numerology @Numerology += 1 end end if obj.damage_to_mp @mp_damage = damage # damage MP else @hp_damage = damage # damage HP end end
if ALMAGEST::NUMEROLOGY #-------------------------------------------------------------------------- # * Calculation of Final Hit Ratio # user : Attacker, or user of skill or item # obj : Skill or item (for normal attacks, this is nil) #-------------------------------------------------------------------------- def calc_hit(user, obj = nil) if obj == nil # for a normal attack hit = user.hit # get hit ratio physical = true elsif obj.is_a?(RPG::Skill) # for a skill if obj != $data_skills[ALMAGEST::NUMEROLOGY_SKILL] #Numerology hit = obj.hit # get success rate physical = obj.physical_attack else physical = false if @Numerology == nil @Numerology = 0 hit = 85 elsif @Numerology == 16 hit = 0 else hit = 85 - (@Numerology / 2 ** 2) end end else # for an item hit = 100 # the hit ratio is made 100% physical = obj.physical_attack end if physical # for a physical attack hit /= 4 if user.reduce_hit_ratio? # when the user is blinded end return hit end
#-------------------------------------------------------------------------- # * Apply Skill Effects # user : Skill user # skill : skill #-------------------------------------------------------------------------- def skill_effect(user, skill) clear_action_results unless skill_effective?(user, skill) @skipped = true return end if rand(100) >= calc_hit(user, skill) # determine hit ratio if skill == $data_skills[ALMAGEST::NUMEROLOGY_SKILL] #Numerology @Numerology = 0 end @missed = true return end if skill != $data_skills[ALMAGEST::NUMEROLOGY_SKILL] #Numerology if rand(100) < calc_eva(user, skill) # determine evasion rate @evaded = true return end end make_obj_damage_value(user, skill) # calculate damage make_obj_absorb_effect(user, skill) # calculate absorption effect execute_damage(user) # damage reflection if skill.physical_attack and @hp_damage == 0 # physical no damage? return end apply_state_changes(skill) # state change end
end #closes Numerology "if"
end #closes class
if ALMAGEST::SHOW_ZODIAC_STATUS #========================================================================== ==== # ** Window_MenuStatus #========================================================================== ==== class Window_Status < Window_Base #-------------------------------------------------------------------------- # * Draw Zodiac Sign # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_zodiac(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, "Zodiac Sign") self.contents.font.color = normal_color if actor.zodiac == 1 self.contents.draw_text(x + 134, y, 108, WLH, "Aries") end if actor.zodiac == 2 self.contents.draw_text(x + 134, y, 108, WLH, "Taurus") end if actor.zodiac == 3 self.contents.draw_text(x + 134, y, 108, WLH, "Gemini") end if actor.zodiac == 4 self.contents.draw_text(x + 134, y, 108, WLH, "Cancer") end if actor.zodiac == 5 self.contents.draw_text(x + 134, y, 108, WLH, "Leo") end if actor.zodiac == 6 self.contents.draw_text(x + 134, y, 108, WLH, "Virgo") end if actor.zodiac == 7 self.contents.draw_text(x + 134, y, 108, WLH, "Libra") end if actor.zodiac == 8 self.contents.draw_text(x + 134, y, 108, WLH, "Scorpio") end if actor.zodiac == 9 self.contents.draw_text(x + 134, y, 108, WLH, "Sagittarius") end if actor.zodiac == 10 self.contents.draw_text(x + 134, y, 108, WLH, "Capricorn") end if actor.zodiac == 11 self.contents.draw_text(x + 134, y, 108, WLH, "Aquarius") end if actor.zodiac == 12 self.contents.draw_text(x + 134, y, 108, WLH, "Pisces") end if actor.zodiac == 0 self.contents.draw_text(x + 134, y, 108, WLH, "Unknown") end end
def draw_actor_gender(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, "Gender") self.contents.font.color = normal_color if actor.gender == 5 self.contents.draw_text(x + 134, y, 108, WLH, "Male") end if actor.gender == 10 self.contents.draw_text(x + 134, y, 108, WLH, "Female") end if actor.gender == 0 self.contents.draw_text(x + 134, y, 108, WLH, "Unknown") end end
def draw_parameters(x, y) if ALMAGEST::SHOW_GENDER_STATUS draw_actor_zodiac(@actor, x, y + WLH * 0) draw_actor_gender(@actor, x, y + WLH * 1) draw_actor_parameter(@actor, x, y + WLH * 3, 0) draw_actor_parameter(@actor, x, y + WLH * 4, 1) draw_actor_parameter(@actor, x, y + WLH * 5, 2) draw_actor_parameter(@actor, x, y + WLH * 6, 3)
else draw_actor_zodiac(@actor, x, y + WLH * 0) draw_actor_parameter(@actor, x, y + WLH * 2, 0) draw_actor_parameter(@actor, x, y + WLH * 3, 1) draw_actor_parameter(@actor, x, y + WLH * 4, 2) draw_actor_parameter(@actor, x, y + WLH * 5, 3) end end end end DEMOAlmagest Demo.rarInstallationPlug and play. CreditsThanks to aerostar and Maltzsan for their excellent guides on the mechanics of (respectively) Final Fantasy Tactics and Final Fantasy XII.
This post has been edited by Andrelvis: Jul 26 2009, 05:38 AM
|