B
Brrrzzz
Guest
Hello everyone!
Im working on a game with items, that have random generated stats.
I want these stats to be shown whenever the player hovers the mouse above the item. They also should be drawn on the right place.
I currently working with
//stat 1
if (stat_1 = 0 && !armor = 0){stat_1 = armor}
if (stat_1 = 0 && !dmg = 0){stat_1 = dmg}
if (stat_1 = 0 && !magic = 0){stat_1 = magic}
if (stat_1 = 0 && !hp = 0){stat_1 = hp}
if (stat_1 = 0 && !mp = 0){stat_1 = mp}
if (stat_1 = 0 && !mp_regain = 0){stat_1 = mp_regain}
if (stat_1 = 0 && !endurance = 0){stat_1 = endurance}
if (stat_1 = 0 && !endurance_reg = 0){stat_1 = endurance-reg}
if (stat_1 = 0 && !runspd = 0){stat_1 = runspd}
if (stat_1 = 0 && !balance = 0){stat_1 = balance}
if (stat_1 = 0 && !shield_block = 0){stat_1 = shield_block}
if (stat_1 = 0 && !shield_reg = 0){stat_1 = shield_reg}
//stat 2
if (stat_2 = 0 && !stat_1 = armor && !armor = 0){stat_2 = armor}
if (stat_2 = 0 && !stat_1 = dmg && !dmg = 0){stat_2 = dmg}
if (stat_2 = 0 && !stat_1 = magic && !magic = 0){stat_2 = magic}
if (stat_2 = 0 && !stat_1 = hp && !hp = 0){stat_2 = hp}
if (stat_2 = 0 && !stat_1 = mp && !mp = 0){stat_2 = mp}
if (stat_2 = 0 && !stat_1 = mp_regain && !mp_regain = 0){stat_2 = mp_regain}
if (stat_2 = 0 && !stat_1 = endurance && !endurance = 0){stat_2 = endurance}
if (stat_2 = 0 && !stat_1 = endurance_reg && !endurance_reg = 0){stat_2 = endurance-reg}
if (stat_2 = 0 && !stat_1 = runspd && !runspd = 0){stat_2 = runspd}
if (stat_2 = 0 && !stat_1 = balance && !balance = 0){stat_2 = balance}
if (stat_2 = 0 && !stat_1 = shield_block && !shield_block = 0){stat_2 = shield_block}
if (stat_2 = 0 && !stat_1 = shield_reg && !shield_reg = 0){stat_2 = shield_reg}
and so on...stat_1/stat_2/stat_3 etc. are the stats, that are then drawn on the screen.
But that obviously doesnt work for more stats, cause that would get incredibly long.
Is there a better/cleverer way to look through the stats and mark them as "taken" so stat_2/stat_3 etc. would not take them as stat, when stat_1 already took it?
Thank you for your time.
Im working on a game with items, that have random generated stats.
I want these stats to be shown whenever the player hovers the mouse above the item. They also should be drawn on the right place.
I currently working with
//stat 1
if (stat_1 = 0 && !armor = 0){stat_1 = armor}
if (stat_1 = 0 && !dmg = 0){stat_1 = dmg}
if (stat_1 = 0 && !magic = 0){stat_1 = magic}
if (stat_1 = 0 && !hp = 0){stat_1 = hp}
if (stat_1 = 0 && !mp = 0){stat_1 = mp}
if (stat_1 = 0 && !mp_regain = 0){stat_1 = mp_regain}
if (stat_1 = 0 && !endurance = 0){stat_1 = endurance}
if (stat_1 = 0 && !endurance_reg = 0){stat_1 = endurance-reg}
if (stat_1 = 0 && !runspd = 0){stat_1 = runspd}
if (stat_1 = 0 && !balance = 0){stat_1 = balance}
if (stat_1 = 0 && !shield_block = 0){stat_1 = shield_block}
if (stat_1 = 0 && !shield_reg = 0){stat_1 = shield_reg}
//stat 2
if (stat_2 = 0 && !stat_1 = armor && !armor = 0){stat_2 = armor}
if (stat_2 = 0 && !stat_1 = dmg && !dmg = 0){stat_2 = dmg}
if (stat_2 = 0 && !stat_1 = magic && !magic = 0){stat_2 = magic}
if (stat_2 = 0 && !stat_1 = hp && !hp = 0){stat_2 = hp}
if (stat_2 = 0 && !stat_1 = mp && !mp = 0){stat_2 = mp}
if (stat_2 = 0 && !stat_1 = mp_regain && !mp_regain = 0){stat_2 = mp_regain}
if (stat_2 = 0 && !stat_1 = endurance && !endurance = 0){stat_2 = endurance}
if (stat_2 = 0 && !stat_1 = endurance_reg && !endurance_reg = 0){stat_2 = endurance-reg}
if (stat_2 = 0 && !stat_1 = runspd && !runspd = 0){stat_2 = runspd}
if (stat_2 = 0 && !stat_1 = balance && !balance = 0){stat_2 = balance}
if (stat_2 = 0 && !stat_1 = shield_block && !shield_block = 0){stat_2 = shield_block}
if (stat_2 = 0 && !stat_1 = shield_reg && !shield_reg = 0){stat_2 = shield_reg}
and so on...stat_1/stat_2/stat_3 etc. are the stats, that are then drawn on the screen.
But that obviously doesnt work for more stats, cause that would get incredibly long.
Is there a better/cleverer way to look through the stats and mark them as "taken" so stat_2/stat_3 etc. would not take them as stat, when stat_1 already took it?
Thank you for your time.