Shield Spell

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
I have been having trouble finding how I can make a simple shield spell. One that creates a state that will block x damage or dissipate after x turns.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,673
First Language
German
Primarily Uses
RMMV
Basically you make the shield state with the choosen conditions on when to dissipate, and then make a skill to apply that state to the user or an ally.

If that's what you wanted to know, then you should start with some tutorials, because that is pretty basic in Ace. The link in my signature will help you finding those tutorials.

If that is not what you want, because the basic functions do not exactly what you want - then you need to give more details on your shield idea, and perhaps post screenshots of your current state and what it does wrong.
 

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
I don't see anywhere I can apply a shield state in the states tab.

The concept is very simple I want to block 200 damage of any kind over the next 3 turns. 

So if 100 damage is done turn 1, 50 is done on turn 2 and 75 on turn 3 then it will only actually deal 25 damage.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
You are not applying a shield state in the states tab, you are creating one.  That is where you specify what it does and how long it lasts.  Then link your skill to the new state.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,673
First Language
German
Primarily Uses
RMMV
You have to think a bit different when creating states - you won't be able to build a shield state exactly like the one you want unless you use scripts to add more features.


But you can create shield states there...


Damage done by default formula is a.atk * 4 - b.def * 2.


The defense of the target reduces the damage from the physical attack, so your shield spell can rise the defense of the actor to reduce physical damage.


You can also specify wether it should be removed after a number of turns, or if each hit should have a chance of removing it - sorry, you can't remove it by specific damage numbers unless you're using scripts to add that function.


Just look through the options available on the states tab and decide what that state should do and how it will be removed.
 

CWells

Storyteller/Artist
Veteran
Joined
Apr 22, 2013
Messages
731
Reaction score
40
First Language
English
Primarily Uses
Check your SP parameters for this. There are two options there:

PDR which is Physical Damage Rate. And MDR, Magic Damage Rate.

Unfortunately with this you are depending on percent values of damage blocked. Anything under 100% is resistance and anything over 100% is a weakness.
 

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
anyway I can modify this to do what I want by swapping a variable assigned with a value in for actor mp?

Code:
# Manashield# This will make a manashield state which allow actor takes damage to mana# instead of health points.# Usage: use this notetag inside a state <manashield: X, Y%># X is damage absorb per mana point.# Y is damage percentage which can be absorbed.# Free for all using purposes.# Credit: Archeia Nessiah for the allowance.module REGEXP  module MANASHIELD    MANASHIELD = /<manashield:[ ]*(\d+),[ ]*(\d+)[%“]?>/i  end # MANASHIELDend # REGEXP#==============================================================================# ¡ DataManager#==============================================================================module DataManager      #--------------------------------------------------------------------------  # alias method: load_database  #--------------------------------------------------------------------------  class <<self; alias load_database_manashield load_database; end  def self.load_database    load_database_manashield    initialize_manashield  end    #--------------------------------------------------------------------------  # new method: initialize_manashield  #--------------------------------------------------------------------------  def self.initialize_manashield    groups = [$data_states]    groups.each { |group|      group.each { |obj|        next if obj.nil?        obj.initialize_manashield      }    }  end  end # DataManager#==============================================================================# ¡ RPG::BaseItem#==============================================================================class RPG::BaseItem    #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------  attr_accessor :manashield  #--------------------------------------------------------------------------  # new method: initialize_manashield  #--------------------------------------------------------------------------  def initialize_manashield    #---    self.note.split(/[\r\n]+/).each { |line|      case line      when REGEXP::MANASHIELD::MANASHIELD        @manashield = [$1.to_i, [$2.to_i, 100].min]      end    }  end  end # RPG::BaseItem#==============================================================================# ¡ Game_ActionResult#==============================================================================class Game_ActionResult    #--------------------------------------------------------------------------  # alias method: make_damage  #--------------------------------------------------------------------------  alias manashield_make_damage make_damage  def make_damage(value, item)    manashield_make_damage(value, item)    #---    if @battler.manashield && @battler.mp > 0      dpm = @battler.manashield[0]      percent = @battler.manashield[1]      shield = (@hp_damage * percent.to_f) / 100.0      shield = shield / dpm.to_f      shield = [shield, @battler.mp.to_f].min      @hp_damage -= (shield * dpm.to_f).to_i      @mp_damage += shield.to_i    end  end  end # Game_ActionResult#==============================================================================# ¡ Game_Battler#==============================================================================class Game_Battler < Game_BattlerBase    #--------------------------------------------------------------------------  # new method: manashield  #--------------------------------------------------------------------------  def manashield    mns = nil    states.each { |state|      next unless state.manashield      mns = state.manashield      break    }    return mns ? mns : false  end  end # Game_Battler
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top