Michdd Posted November 26, 2008 Share Posted November 26, 2008 I'm making a simple browser based game which is an add-on to my website for a game that I made in C++. On this you can get pets, and they have different stats, you can level them up, etc.. I have that all working fine. Now, I defined the base stats for these monsters in 3 ways. HP/Attack/Defense. Then in the Database for each monster if they have extra stats added on they're there. Then I add the database value, with the base stats for each monster. Now I'm trying to add a battle script. So I need something that will factor in Defense, HP, and Attack, with a little random factor for any of elements. And also, something so that higher level's stats are boosted a little. Like. Defense = Defense + (level / 100) or something. Then I need it to choose a winner somehow. I currently have all the variables in the end after getting them from the database and such stored in this: For one monster, that's basically the stats added from base + bonus: $Shp = $Shp + $hp2; $Sattack = $Sattack + $attack2; $Sdef = $Sdef + $def2; Second monster: $Ohp = $Ohp + $hp1; $Oattack = $Oattack + $attack1; $Odef = $Odef + $def1; And the level is stored as $Slevel for the first one, and $Olevel for the other one. Link to comment https://forums.phpfreaks.com/topic/134325-logic-help/ Share on other sites More sharing options...
Madatan Posted November 26, 2008 Share Posted November 26, 2008 Not really sure what your question is, maybe you could clarify? Do you want suggestions on a battle script or how to choose winners or what? Link to comment https://forums.phpfreaks.com/topic/134325-logic-help/#findComment-699450 Share on other sites More sharing options...
Michdd Posted November 26, 2008 Author Share Posted November 26, 2008 I want a basic example of a way how it could be done, the way i said. Link to comment https://forums.phpfreaks.com/topic/134325-logic-help/#findComment-699493 Share on other sites More sharing options...
ShiloVir Posted November 26, 2008 Share Posted November 26, 2008 sorry, I dont understand. Why dont you use the same logic that you used in your C++ game. If I can see the logic you wrote in the C++ I would happily translate it into PHP. Link to comment https://forums.phpfreaks.com/topic/134325-logic-help/#findComment-699496 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.