Hello everyone
Im having a little problem here, on the blitzbasic programming language you can set options to an object using the power of 2
example
2 = hero has double HP
4 = hero has double DEX
8 = hero has double STR
and you can make combos, like
10=8+2 -> hero has double STR and HP
I tryed to make a function for this with PHP for my webbased game, but this is as far as I got
$option=(int)$res['options']; //take from database
$option-=8;
if ($option>=0) $option_2str=true; else $option=(int)$res['options'];
$option-=4;
if ($option>=0) $option_2dex=true; else $option=(int)$res['options'];
$option-=2;
if ($option==0) $option_2hp=true;
Please help, I've been stuck with this whole day