Created
July 25, 2013 21:58
-
-
Save AleksLitynski/6084163 to your computer and use it in GitHub Desktop.
ability system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class ability | |
{ | |
string name; | |
string description; | |
ability(n, d) | |
{ | |
name = n; description = d; | |
} | |
absrtact void doAbility(*caster, *target); | |
} | |
class fireySplash : ability | |
{ | |
override void doAbility(*caster, *target) | |
{ | |
target.hp -= caster.mp / 10; | |
} | |
} | |
class fireBall : ability | |
{ | |
override void doAbility(*caster, *target) | |
{ | |
target.hp -= 3 * caster.magicShiz / target.magicResist; | |
fireySplash(caster, target.characterToTheLeft); | |
fireySplash(caster, target.characterToTheRight); | |
} | |
} | |
static void main() | |
{ | |
while 1 { | |
player[0].chooseAnAbility | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment