• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[vJASS] Spell making Idea

Status
Not open for further replies.
I thought of a spell named, Glass Shield or just shield where the caster creates a shield around him/her that shield absorbs damage then dissipates when the caster took total amount of X damage.

So I thought of creating a mana shield then do one of the following:


  1. Make the mana shield absorb damage 1 mana per 1 damage then calculate the amount of mana drained then subtract this number from a variable which represents the amount of damage the shield can absorb and in case the unit mana reached 0 then we use the life (but I guess that may interfere with other things)



  2. Use a damage detection system to subtract the amount of damage taken from the amount of the damage the shield can sustain.

So if anyone has better idea for making this spell with another efficient way, just share your thoughts.
 
There are systems like Damage Engine (Bribe) that allows manipulating Damage.

You can create X buff and special effect in the unit and store the damage received in a hashtable or an array. When the damage reaches the limit you want, remove the buff, remove the special effect, and dissipate the stored damage.
 
Status
Not open for further replies.
Back
Top