the idea is that the opponent will deflect a % of the attack.
i thought i had a pretty good algorithm while i was testing it in excel, but somehow everything got messed up and now it doesnt work in my php script or in my excel spreadsheet :(
just so you know, all the figures are just plucked out of thin air, there is no real significance to any number. just made it up as i went along :D
and its also worth noting that when a user signs up (at the moment) they are given stats of 100 HP and 1 for everything else. each attack takes away from the HP until someone dies.
so my question is, can anyone help me sort out/create a new attack algorithm. im open to all suggestions really.
Question
mikeaag
hey all,
not sure if this is the right place so sorry if its not :D
basically, im in the middle of making a text based game using php. easiest way to explain it is its gunna be like Mob Wars on facebook.
so im trying to work out how the attacking will work, and im getting very confused :D
here is what i have so far.
function deflection($op) { $opd = (((($op['str']/100)*10)/($op['def']*(1-($op['lck']/100)))*10))*3; return $opd; } function calc_attack($user, $opd) { $max_attack = ($user['atk']*$user['str'])*(($user['lck']/(rand(5,50)/10))+1); $justified_attack = $max_attack * (1-(rand(1,$opd))); return round($justified_attack); }the idea is that the opponent will deflect a % of the attack.
i thought i had a pretty good algorithm while i was testing it in excel, but somehow everything got messed up and now it doesnt work in my php script or in my excel spreadsheet :(
just so you know, all the figures are just plucked out of thin air, there is no real significance to any number. just made it up as i went along :D
and its also worth noting that when a user signs up (at the moment) they are given stats of 100 HP and 1 for everything else. each attack takes away from the HP until someone dies.
so my question is, can anyone help me sort out/create a new attack algorithm. im open to all suggestions really.
thanks in advance
Link to comment
Share on other sites
2 answers to this question
Recommended Posts