shiFt
Member
- Reaction score
- 8
Ive made an immolation spell using T32, but im struggling on dealing the damage per second rather than the T32 PERIOD, How do I do this?
struct Data
{
integer ticks;
private method periodic()
{
this.ticks -= 1;
if (this.ticks <= 0)
{
// Do all your damage stuff and reset ticks
this.ticks = R2I(1. / T32_PERIOD); // or just 32 with 0.03125 period
}
}
static method create() -> thistype
{
thistype this = thistype.allocate();
this.ticks = R2I(1. / T32_PERIOD); // 32 ticks per sec
this.startPeriodic();
}
}
Making damage per 1 second, using T32
How about dealing [ljass]DAMAGE * T32_PERIOD[/ljass] every time the timer expires?
The health of the unit would decrease much smoother too.