Lesson 2 - Stat Dependency
- Attribute-Based Spells
The name of the game is "Statistics." The weight thing would of course be defense, though. This will also show you how to make spells that have your own damage algorythms.
First you must form the basic spell. Let's attempt the Drop spell I mentioned before. First you must lift yourself in the air, and drop. You will feel the weight pulling you as you fall.
Form the spell, as usual, with a Switched event. The switch will be "Drop_Spell." We'll code that like this.
Battle Event "Drop"
Event Condition:
Switch."Drop_Spell" = ON ShowBattleAnimation "Drop"
But how can you tell how much you can hurt the enemy? Well, that requires some figuring. Basically, though, there are pretty basic formulae.
Algorythm time. Afterward, access the caster's defense attribute. We'll have to form an Algorythm.
(((2 * Defense) + (Mind - 5)) * 10) / (Enemy.Defense + Enemy.MDefense).
Will work fine. Add this to the above event:
vDamage = Hero.Mage.Defense Power
vDamage = vDamage * 2
vMind = Hero.Mage.Mind Force
vMind = vMind - 5
vDamage = vDamage + vMind
vDamage = vDamage * 10
vEnemy = Enemy.Enemy1.Defense
vEnemy = vEnemy - Enemy.Enemy1.MindForce
vDamage = vDamage / vEnemy ChangeEnemyHP.HP_Strict.Variable 00002: vDamage
Overall, the spell is very complex, but
understandable.
The totalized event:
Battle Event "Drop"
Event Condition: Switch."Drop_Spell" = ON
vEnemyNumber = Random Number up to
ShowBattleAnimation "Drop"
vDamage = Hero.Mage.Defense Power
vDamage = vDamage * 2
vMind = Hero.Mage.Mind Force
vMind = vMind - 5
vDamage = vDamage + vMind
vDamage = vDamage * 10
vEnemy = Enemy.Enemy1.Defense
vEnemy = vEnemy - Enemy.Enemy1.MindForce
vDamage = vDamage / vEnemy
ChangeEnemyHP.HP_Strict.Variable 00002:
vDamage
Switch."Drop Switch" = OFF
![]() |
Lesson 2 - Stat Dependency |
| Attribute-Based Spells | |
| Shadowtext | |
| Jan 01, 2013 | |
| Page Views: 573 | |
| Written for: Rm2k | |
| Related: Lesson 3 - Spell Components |
Public Rating
- 8.2
- 5 Total Votes
Comments
You must be signed in to enter a comment for this game.
