I'm making a mafia web-based game and I'm stuck on the attack page. I've made an algorithm which almost works. This means: it works if both the attacking and the defending player have thugs,bodyguards and hitmen. If one of these variables are 0, then the function I use to get how many men the attacker and defender have lost, returns me some irrelevant values. I will attach the existing script, so you can't say I asked for something when I've got nothing.
Also if you want the real working complete script, go to http://mafia-fights.co.cc/ and log in with user administrator and password admin and attack the player named GothBoy, and see for yourself what numbers are shown.
This question is more directed at the people who actually coded such a game, as they know the principles used, but others are welcomed to state their opinion.
This post has been edited by edu2004eu: 28 October 2010 - 02:55 PM