[XP] Conditional Skills

Started by Raziel 0128, June 21, 2011, 09:22:44 pm

Previous topic - Next topic

Raziel 0128

Hi I was wondering if someone can make a script where skills require a certain condition to either activate or gain a bonus effect in the default battle system that you can define by their id individually or as a group.
What I mean by this is say you have a healing skill that heals for a certain amount. But has a bonus effect if a condition is fulfilled.
Some conditional skill type examples:

Purge Poison "If the target has the 'Poison' state then it heals for 50% extra on top of the regular healing amount.
Verge of Death "If the target is under 50% HP heal for 50% on top of the regular amount".

Or skills that do more damage to the enemy if they have a condition (a specific state/ half health/sp).

Burning hatred "Deal X amount of damage. Deal 50% more damage if the target is burning."
Misfortune  "If the target has X state then this skill has a  100% chance to deal a critical hit." 
Impale "Deals piercing damage. If the target has the state "Broken armour" and is hit with that attack they also gain the "Bleeding" state, but the skill cannot inflict bleeding without broken armour."

Ideally my intention is to allow skills to have greater synergies with each other. Rather than regular skills that only heal a set amount or just inflict the condition if the target is not immune. I know there is a similar script that lets a skill only work if the user has a condition but I have yet to find one that depends on the targets condition. This also isn't quite the same as "Bleeding" can only be inflicted if the target has "Broken Armour" just that that particular skill can only inflict bleeding if the target has broken armour but another skill can inflict bleeding regardless.

In summary I am requesting a script that lets you define a skill as either requiring a specified effect to function at all, or to gain a bonus effect to the regular skill damage/whatever if a secondary condition is met. Condition examples being the presence of lack of a state on the target. HP/SP above/below a certain threshold. With bonus effects being "Inflict an additional condition." "Deal/heal X more damage." "the attack has 100% chance to crit if the condition is met."

As far as I know no script lets you do this directly but I could always be wrong. I have used the search function and manually looked through pages.

G_G

June 22, 2011, 06:36:22 am #1 Last Edit: June 22, 2011, 06:56:09 am by game_guy
These are great ideas and would be great additions to Tons. I think I might do a couple. The way you want these skills are setup where they'd be their own unique script. I'll do Verge of Death first, name sounds so cool.

Just to clarify, verge of death would do something like this.
"Actor 2 uses heal on Actor 1"
"heal will heal 100 hp"
"actor 1 has less then 50% of hp"
"heal will now do 150"

That kinda thing?

EDIT: Here's Verge of Death, tell me if the instructions are unclear. I set it up so you could have several different verge of death skills with different values.
#===============================================================================
# Verge of Death
# Version 1.0
# Author game_guy
#-------------------------------------------------------------------------------
# Intro:
# Healing skills increase effect if its target's hp is less then X amount.
#===============================================================================
module GGVoD
  Skills = []
  # To add new Verge of Death skills, add a new line, then use the following
  # format
  # Skills[skill_id] = [hp_percent, multiplier]
  # skill_id - id of the skill
  # hp_percent - percentage requirement for targets health
  # multiplier - how much the damage increase
  Skills[1] = [40, 1.5] # Increase final result by 50% if actor hp less then 40% for skill id 1
  # add new lines here
end
class Game_Battler
  alias gg_verge_of_death_lat skill_effect
  def skill_effect(user, skill)
    if GGVoD::Skills[skill.id] != nil
      old_hp = self.hp
      percent = self.hp / self.maxhp.to_f * 100
      result = gg_verge_of_death_lat(user, skill)
      values = GGVoD::Skills[skill.id]
      if result && self.hp > old_hp && percent <= values[0]
        if self.damage != nil && self.damage.is_a?(Integer)
          self.damage *= values[1]
        end
        self.hp = [(self.hp * values[1]).floor, self.maxhp].min
      end
      return result
    end
    return gg_verge_of_death_lat(user, skill)
  end
end

Raziel 0128

Yes that's exactly what I meant; I tested the script and it works perfectly so far so thank you.
Some of these skill types work well in reverse too where they take away or add a condition at a threshold or heal more/less.

Thanks again for the quick response.

G_G

I'll most likely do all of these. I'll do the Purge Poison now.

Raziel 0128

Just a small bump on this. How easy is it to make these scripts work when Monsters use them? As most skill-scripts tend to only work for actors

Twb6543

Game_Guys script edits the Game_Battler class so it shouldn't need any editing.

Game_Battle is the super class of Game_Actor and Game_Enemy this means that both classes use it for any undefined instances (definitions, arrays, global variables, etc).
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

G_G

The verge of death script should support enemies already. Oh and thanks for bumping this, I forgot about the scripts I was going to do for you. As soon as I get RMXP to work again.