So what you are basically doing is calling srand(NULL) every time before you calculate damage. This resets the list of random numbers, and because it's the same seed, you will always get the first number (in this case 2). You only need to seed once, at the start of your program.
I would replace time_t with time, and move the srand call to your init code where it will only run once.
that worked thanks is this something to worry about
1>c:\documents and settings\computer\desktop\game\untitled_text_game\untitled_text_game\attack.h(38) : warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
It's just a warning but is there a way to get it to go away? Besides using time_t? That's the reason I had the srand as time_t
This happens because srand() expects an integer, and time() gives it a time_t variable. You can try typecasting the time_t as an unsigned integer. This would look something like srand((unsigned int)time(NULL))
This stuff isn't my strong point so it may or may not work but it's worth a try.