Hello programming and curious forumers!
I'm trying to write a small program for a boardgame that blends RPG elements. The game is King Arthur & the Knights of the Round Table by Wotan games. I found it for 10 bucks at my local shop. Apparently it was quite popular back in the early/mid 80's, but it was noted for having such an abysmal combat system.
Well I was doing some research and found that there is one revised ruleset for the combat system. It seems straightforward, and although I can do the algorithm in my head, I'm trying to practice my Python programming as much as possible.
No better time than to try writing a program for my new game! (BTW, if anyone ever finds a copy for cheap, I'd totally pick it up! I haven't played it yet, but it's a game where you make/choose your own knight, distribute some stats, and you quest around Britain for honor, estates, and gold to buy new equipment!)
I made a thread before about Python programming, so I know some of you guys are out there, since I had a decent turn out on that thread. I'll go ahead and post the revised rules, and than just layout the algorithm.
THE POINT OF THIS THREAD (for anyone wanting to get straight to the point), is to assist me with my practice of python programming, and making programs that have practicality, and are not simply tutorial exercises, ANNND to spread enthusiasm for coding.
BTW, I have learned both 2.x AND 3.x. Since I know most Python programmers and hobbyists program with 2.x, I'll go ahead and write my code as such.
---------------------------------------------------------------------------------------------
So the revised combat system for the game is as follows;
"You assign an attack score to each fighter which equals (Own Attack - Enemy Defense) / 10. Then, roll a d10 and add that number to the roll, look up the result on this table:
1 or below: Parried, no damage.
2: Parried, no damage.
3: Light hit, half con loss (-armor)
4. Light hit, half con loss (-armor)
5: Hit, con loss (-armor)
6: Hit, con loss (-armor)
7: Hit, con loss (-armor)
8: Heavy hit, con loss (unmodified by armor)
9: Heavy hit, con loss (unmodified by armor)
10+: Critical hit, con = 3, if lower than 5: Con =0"
So the basic flow variables of the program would be;
ownAttack = raw_input("Enter your own attack!")
enemyDefense = raw_input("Enter the enemy's defense!")
enemyAttack = raw_input("Enter your enemy's attack!")
ownDefense = raw_input("Enter your own defense!")
equals = ownAttack - enemyDefense
From here, I would have to call a random integer between 1 and 10, and then --->
result = equals % random.randint(1, 10) (If I remember correctly, I definitely used that wrong)
And then from here, I am not sure how I would match result with one of the 10 combat results for that turn.
Subsequently, I'd also have to determine what the enemy rolls on me, solve it, and then recall the functions IF no one died/fainted.
DISCLAIMER: Although I'd love to explain a little more about this cool and exciting combat system, I'll save that for afterwards
Now, I know I didn't format a skeleton. Let me try that now (critique wherever necessary forumers!) I'll go ahead and post this first part!
------------------------------------------
BTW, I've already talked to one mod about this. I'm really digging programming. I'm becoming an advocate slowly for code literacy, even if it's just for enthusiasm and cognitive exercising. I'm having a blast, and I LOVE IT. I'm not pushing it on anyone, but if anyone is interested in anything about coding, please feel free to talk to me (EVEN openly on this thread).