Tackle(mob/M in oview(1))
set category = "Attacks"
set name = "Tackle"
src.atkpwr=50
src.isspatk=1
if(!src.tacklepp){src<<"No PP left for this move!"; return}
else {src.tacklepp-=1}
view() << "<font color=red><i>[src] used Tackle!<br>[src.dmg] damage! "
src.DmgCalc(M)
src <<"<font color=white>[src.tacklepp] PP left!"
M.hp-=src.dmg
DmgCalc(mob/M)
if(src.type1==src.type2==src.atktype)
src.STAB=1.5
else
src.STAB=1
src.WRcheck(M)
if(src.isspatk)//send var to this proc
ATKStat=spatk
else
ATKStat=atk
var/A=2 * src.lvl / 5 + 2
var/B=A * src.ATKStat * src.atkpwr / M.def
var/C=B / 50
var/D=C + 2
var/E=rand(85,100)
var/F=D * src.STAB * src.WR * E / 100
var/H=round(F,1)
src.dmg=H
if(prob(6.25))
src.dmg *= 2
view()<<"<u>Critical Hit!"
Problem description:Im making a pokemon game (clearly) and i have a few attacks for testing with damage calculation but if its a Critical Hit, the damage applies in the next attack, not the one that says it was a Critical Hit.
Heres a screenshot