KElementRate XP
#1
KElementRate XP

by Kyonides


Introduction

This script replaces the Database's Element Ranks with a Brand New One!
That means that your hero will now have a blank list of ranks.
It could be great for further improving a Ghim hero's customization process.

The comments embedded in my script Editor clearly explain what are the available script calls you can use starting today! Grinning

The Script

Code:
# * KElementRate XP
#   Scripter : Kyonides Arkanthes
#   v0.3.0 - 022-11-13

# This script replaces the Database's Element Ranks with a Brand New One!
# That means that your hero will now have a blank list of ranks.
# It could be great for further improving a hero's customization process.

# * Enable Custom Element Ranks From the Very Beginning * #
# CUSTOM_RATES_ACTORS = [Add, As, Many, Actor, IDs, As, Deemed, Necessary]

# * Enable / Disable Custom Element Ranks In Game * #
# $game_actors[ActorID].element_ranks_enabled = true
# $game_actors[ActorID].element_ranks_enabled = false

# * Alter a Hero's Element Rank * #
# - Default Table of Resistance: [0,200,150,100,50,0,-100]
# $game_actors[ActorID].element_ranks[ElementID] = Position aka Index

module KElem
  module Rate
    CUSTOM_RATES_INDEX = 3 # Default Percent: 100
    CUSTOM_RATES_ACTORS = [1]
    ARMOR_REDUCE_FACTOR = 2
    STATE_REDUCE_FACTOR = 2
  end
end

class RPG::Armor
  def guard_element?(e_id) guard_element_set.include?(e_id) end
end

class RPG::State
  def guard_element?(e_id) guard_element_set.include?(e_id) end
end

class Game_Actor
  include KElem::Rate
  ELEMENT_PERCENTS = [0,200,150,100,50,0,-100]
  attr_reader :element_ranks_enabled
  alias :kyon_elem_rate_gm_actor_setup :setup
  def setup(actor_id)
    kyon_elem_rate_gm_actor_setup(actor_id)
    self.element_ranks_enabled = CUSTOM_RATES_ACTORS.include?(actor_id)
  end

  def db_element_ranks
    $data_classes[@class_id].element_ranks
  end

  def element_ranks
    @element_ranks_enabled ? @element_ranks : db_element_ranks
  end

  def element_ranks_enabled=(bool)
    return bool if bool == @element_ranks_enabled
    if bool
      ranks = db_element_ranks
      @element_ranks = Array.new(ranks.xsize, CUSTOM_RATES_INDEX)
    end
    @element_ranks_enabled = bool
  end

  def element_rate(e_id)
    pos = self.element_ranks[e_id]
    result = ELEMENT_PERCENTS[pos]
    for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
      next if i == 0
      result /= ARMOR_REDUCE_FACTOR if $data_armors[i].guard_element?(e_id)
    end
    for i in @states
      result /= STATE_REDUCE_FACTOR if $data_states[i].guard_element?(e_id)
    end
    result
  end
end


Terms & Conditions

Free for use in any kind of game.
Just mention me in your game credits! Grinning
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }


Messages In This Thread
KElementRate XP - by kyonides - 11-13-2022, 09:19 AM



Users browsing this thread: 1 Guest(s)