31
Forum Games / Re: Legend of Platinum Mushrooms
« on: September 30, 2002, 06:40:04 PM »
As of now, my JavaScript is NOT working. Also, I need to learn how to make the program remember your stats...and that means cookies. More books for me. Joy.
The following stats I am programming right now for use in the RPG:
Health: Obviously, when it's at 0, you die.
Flower Points: These are shared by the entire party. Used for the magic spells.
Star Points: Do NOT confuse these with Paper Mario's Star Points. These are used for the Special Attacks of each character, such as for Mario, Power Jump.
Strength: Determines how strong physical power is.
Defense: Determines how much you can prevent physical damage.
Wisdom: Determines "magic attack".
Holiness: Determines "magic defense".
Speed: The character with the fastest speed goes first.
Evasion: The higher this number, the higher your chances of evading enemy attacks.
Strike: The higher this number, the higher your chances of PowerHits (critical strikes).
Here is how the attacks are programmed.
For Physical:
damage = attack_power + strength - enemy_defense. Damage minimum is 1.
For Magic:
damage = magic_spell + wisdom / enemy_holiness. Damage minimum is 3.
And here's how I am making the chances of evasion and strike:
Basically, I tell the program to give me a random number from 0 to 1 (e.g. 0.532, 0.291, etc). Then that number is multiplied by 100. If this result is ABOVE your Evasion value, then the enemy attack hits. If the result is BELOW or EQUAL TO your Evasion value, then the attack misses. Same goes for Strike. Here's how it goes in JavaScript:
var eva_chance = Math.rand() * 100;
if (eva_chance > eva)
{
hp = hp-damage;
document.write('You were hit for ' + damage + ' damage');
}
if (eva_chance <= eva)
document.write('The attack missed')
LieutenantEagle
--------
Gandalf: The Eagles have come! The Eagles have come!
LieutenantEagle: I know. They''re in front of you.
The following stats I am programming right now for use in the RPG:
Health: Obviously, when it's at 0, you die.
Flower Points: These are shared by the entire party. Used for the magic spells.
Star Points: Do NOT confuse these with Paper Mario's Star Points. These are used for the Special Attacks of each character, such as for Mario, Power Jump.
Strength: Determines how strong physical power is.
Defense: Determines how much you can prevent physical damage.
Wisdom: Determines "magic attack".
Holiness: Determines "magic defense".
Speed: The character with the fastest speed goes first.
Evasion: The higher this number, the higher your chances of evading enemy attacks.
Strike: The higher this number, the higher your chances of PowerHits (critical strikes).
Here is how the attacks are programmed.
For Physical:
damage = attack_power + strength - enemy_defense. Damage minimum is 1.
For Magic:
damage = magic_spell + wisdom / enemy_holiness. Damage minimum is 3.
And here's how I am making the chances of evasion and strike:
Basically, I tell the program to give me a random number from 0 to 1 (e.g. 0.532, 0.291, etc). Then that number is multiplied by 100. If this result is ABOVE your Evasion value, then the enemy attack hits. If the result is BELOW or EQUAL TO your Evasion value, then the attack misses. Same goes for Strike. Here's how it goes in JavaScript:
var eva_chance = Math.rand() * 100;
if (eva_chance > eva)
{
hp = hp-damage;
document.write('You were hit for ' + damage + ' damage');
}
if (eva_chance <= eva)
document.write('The attack missed')
LieutenantEagle
--------
Gandalf: The Eagles have come! The Eagles have come!
LieutenantEagle: I know. They''re in front of you.