CheckStats()
if(src.strength<=0)
if(src.strength==rand(0,1990))
src.strengthstat="Below Average"
if(src.strength==rand(1990,4990))
src.strengthstat="Average"
if(src.strength==rand(4990,11990))
src.strengthstat="Above Average"
if(src.strength==rand(11990,14990))
src.strengthstat= "High"
if(src.strength==rand(14990,15000))
src.strengthstat="Irresistable"
if(src.endurance<=0)
if(src.endurance==rand(0,1990))
src.endstat="Below Average"
if(src.endurance==rand(1990,4990))
src.endstat="Average"
if(src.endurance==rand(4990,11990))
src.endstat="Above Average"
if(src.endurance==rand(11990,14990))
src.endstat="High"
if(src.endurance==rand(14990,15000))
src.endstat="Irresistable"
if(src.resist<=0)
if(src.resist==rand(0,1990))
src.restat="Below Average"
if(src.resist==rand(1990,4990))
src.restat="Average"
if(src.resist==rand(4990,11990))
src.restat="Above Average"
if(src.resist==rand(11990,14990))
src.restat="High"
if(src.resist==rand(14990,999999))
src.restat="Irresistable"
if(src.willpower<=0)
if(src.willpower==rand(0,1990))
src.willpowerstat="Below Average"
if(src.willpower==rand(1990,4990))
src.willpowerstat="Average"
if(src.willpower==rand(4990,11990))
src.willpowerstat="Above Average"
if(src.willpower==rand(11990,14990))
src.willpowerstat="High"
if(src.willpower==rand(14990,9999999))
src.willpowerstat="Irresistable"
if(src.force<=0)
if(src.force==rand(0,1990))
src.forcestat="Below Average"
if(src.force==rand(1990,4990))
src.forcestat="Average"
if(src.force==rand(4990,11990))
src.forcestat="Above Average"
if(src.force==rand(11990,14990))
src.forcestat="High"
if(src.force==rand(14990,99999999))
src.forcestat="Irresistable"
Problem description:
Basically trying to make this code work in a way that it checks if the said stat is within ranges of 0,whatever and it labels their stat as "Average/Weak/High/etc"
I know rand isn't the right proc to use, but I tried ()(), but I see no change, also tried another method in just trying to check if said stat has a number higher than or less than 0.
Can someone help me fix this issue? Accepting all criticism, It's been too long that I've been coding this sloppy and in this old format. xD
It's suppose to all calculate to Below Average via Finish of Char Creation, but instead, on the statpanel they all read Negative(the default) as if nothing happens and each stat already starts off with 1.
Please help :)
mob
Stat()
..()
statpanel("Vitals")
if(statpanel("Vitals"))
stat(src,"[src] - [src.potential]")
stat(src,"[src]'s Age: [src.age]")
stat("")
stat("")
stat("Health: [FullNum(round(health),100)]%")
stat("Ki: [FullNum(round(ki),100)]%")
stat("Intelligence: [src.doclvl]+")
stat("")
stat("Willpower: [src.willpowerstat]")
stat("Strength: [src.strengthstat]")
stat("Endurance: [src.endstat]")
stat("Force: [src.forcestat]")
stat("Resistance: [src.restat]")
stat("")
A <b: A is less than B?
A > B: A is greater than B?
A <= B: less or equal
A >= B: greater or equal
Normally, if you want to check if a number N is between A and B (or equal to either), this would be the condition:
In DM, you're given the "in-to" operator, which lets you shorten the above into a more readable form:
Also, the switch() control lets you check for ranges, like so:
edit: sleep-posting