PDA

Click to See Complete Forum and Search --> : Battle Script for PHP RPG Game...


flame_211
Oct 17th, 2002, 09:47 PM
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 :'(

Sastraxi
Oct 17th, 2002, 10:11 PM
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: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.

flame_211
Oct 18th, 2002, 08:51 PM
thanks, ill try it out

BTW: http://alltom.com/flame (its my game if you wanna check it out :P)

CornedBee
Oct 22nd, 2002, 12:34 PM
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

CornedBee
Oct 22nd, 2002, 12:35 PM
It's actually not even a valid HTML file: it has no html tags, nothing :eek: