54b Subj : help needed To : Dennis Collins From : Leonard Erickson Date : Tue Oct 10 2000 05:34 pm -=> Quoting Dennis Collins to All <=- DC> hi DC> I am working on a game currently and have come to a section that is DC> causing me a small amount of grief...... DC> the routine has to return a boolean based on a percentage ie TRUE = DC> hit, FALSE = miss, and there are different percentages for the DC> different types of weapons used. DC> example: DC> weapon 1 has 1% chance of hitting target DC> weapon 2 has 13% chance of hitting target DC> etc DC> weapon 10 DC> as these percentages are configurable at the time of the game setup DC> they could be anything from 1% to 99% DC> hoping someone can shed some light on an easy way to achieve this. I'm not entirely clear what you want to routine to *do*. Yes, I understand that you want it to return true or false. What I'm *not* clear on is how it is supposed to *do* that. Making a wild guess, I'll assume that you want to call HIT, and have it return true or false for the weapon being used. type WeaponStat : record ... ToHit : real; ... end; const sword : weapon = [.....]; function Hit(weap:weapon):boolean; begin Hit := rnd > weap.ToHit; end; --- FMailX 1.59b/beta * Origin: Shadowshack (1:105/51) . 0