|
-
Oct 17th, 2002, 09:47 PM
#1
Thread Starter
Hyperactive Member
Battle Script for PHP RPG Game...
Ok, i need an alorithm for determining how much damage a player will do, and how many times to attack in a row, also maybe have it caluclate exp, etc, any help with something like this would be greatly appreciated, and deffinately rewarded, you would probably given a role as an admin in my game if you did this. BTW my game is at http://alltom.com/flame i got most things running, but I am haveing difficulty figuring out how the hell to make a battle script >_< all i can do is make it determine exactly what amount they will do(not acurately tho) and then each player attacks the other player exactly once... Remeber:
Site : http://www.alltom.com/flame even if you dont wanna make/help with the battle codeing, you can still come and talk, im getting lonely in there :'(
-
Oct 17th, 2002, 10:11 PM
#2
Good Ol' Platypus
Create a function that makes a ratio between the defeated and the defeater. So, say the defeated's max HP was 40 and the player's is 20, and his attack is 1 - 5 while the player's was 1 - 3. Now let's look at this:
Code:
Pseudocode:
ratHP = defeated.maxhp / player.maxhp
ratLBW = defeated.weaponlowerbound / player.weaponlowerbound
ratHBW = defeated.weaponhigherbound / player.weaponhigherbound
exp = 100 * (ratHP * ratLBW * ratHBW)
It may make for interesting play, ex. if the player is david in a david-goliath 'situation', he would get a TON more experience (Say 100 hp vs. 20, =5x100). Which would be a lot.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Oct 18th, 2002, 08:51 PM
#3
Thread Starter
Hyperactive Member
thanks, ill try it out
BTW: http://alltom.com/flame (its my game if you wanna check it out :P)
-
Oct 22nd, 2002, 12:34 PM
#4
Your game doesn't work for me. It displays nothing.
Logging in does nothing, clicking help does nothing...
I tried both Mozilla 1.2 and (ugh) IE 6
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 22nd, 2002, 12:35 PM
#5
It's actually not even a valid HTML file: it has no html tags, nothing
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|