Ok so i'm making a text based Rpg game, but the one stubling block on is the combat system.
At the moment i have a general idea of what i want to happen.
Points
Triangle attack system
e.g Magic > Block > Attack > Magic
Turn based system between player and mob
Option to leave combat on your go.
Option to use different spells if possible.
Now the way have thought about doing it is to use if possible is
Code:
Write (Pick an attack option block, magic, attack
Read (choice)
choice = uppercase choice
Randomrange mob(3,10) Used to random to different mobs e.g skeleton and zombie
for mob[x] get mob stats from defined mob health [need help here]
Case choice of
Magic:Magic
block:Block with the magic block and attack being a function of somekind?
Attack:attack
Mob attack = randomrange (1,3) 1:block 2:Attack 3:magic
If mobattack= block and playerattack = magic then
Player = hit mob
If mobattack = block and playerattack = attack then
mob = hit player
If Mobattack = block and playerattack = block then
draw
If mob attack = attack and player attack = magic then
mob = hit player
If mobattack = attack and player attack = block then
player = hit mob
If mobattack = attack and player attack = attack then
Mob = hit player
player = hit mob
If mobattack = magic and playerattack = magic then
mob = hit player
player = hit mob
if mobattack = magic and playerattack = block then
mob = hit player
if mobattack = magic and playerattack = attack then
player = hit mob
In this i want the mob's hp to be decided from a procedure or function where i can have each mob defined.
I was just wondering if you guys think this system would work or not as pesudocode and how well you think it would work.
Bookmarks