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.
Shield Spell
RPG Maker VXAce SupportBasically 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.
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.
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.
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.
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.
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.
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.
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.
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.
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
Original thread: https://forums.rpgmakerweb.com/threads/shield-spell.17089/