I have a random integer added to a variable that should, well, be random every time it is ran. But, for some reason, it shows the same random number every time I try the script.
The script is at
http://24.106.93.59/game1.asp
This is what I have for the random part:
Sub Fight
intPlayAttack = intPlaySTR - Cint(intMonstDEF/2)
intMonstAttack = intMonstSTR - Cint(intPlayDEF/2)
intPlayAttackD = (intPlayAttack + int(rnd*3))
intMonstAttackD = (intMonstAttack + int(rnd*3))
intPlayChanceAttack = Cint(intPlayDEX/intMonstDEF * 100)
intMonstChanceAttack = Cint(intMonstDEX/intPlayDEF * 100)
intPlayCAR = int(rnd*100)
intMonstCAR = int(rnd*100)
If intPlayChanceAttack > intPlayCAR Then
intPlayAttack = intPlayAttackD
Else
intPlayAttack = intPlayAttack
End If
If intMonstChanceAttack > intMonstCAR Then
intMonstAttack = intMonstAttackD
Else
intMonstAttack = intMonstAttack
End If
If intPlayAttack < 0 Then
intPlayAttack = 0
End If
If intMonstAttack < 0 Then
intMonstAttack = 0
End If
intMonstHPAF = intMonstHPAF - intPlayAttack
intPlayHPAF = intPlayHPAF - intMonstAttack
Response.Write "You have attacked for: <b>" & intPlayAttackD & "</b><br>"
Response.Write "You have been attacked for: <b>" & intMonstAttackD & "</b><br>"
Response.Write "You have: <b>" & intPlayHPAF & "</b> health remaining. <br><br>"
If intPlayHPAF <= 0 Then
Call Death
End If
If intMonstHPAF <= 0 Then
Call Victory
End If
If intPlayHPAF > 0 and intMonstHPAF > 0 Then
Call Fight
End If
End Sub
I just started leaning ASP, and thought making a game would be a good little project just to see what I can do. If you can help me, it would be great. Also, if you need the entire code here, I'll post that.