… | |
… | |
503 | |
503 | |
504 | float scale = 1.f + symptom->value / 100.f; |
504 | float scale = 1.f + symptom->value / 100.f; |
505 | |
505 | |
506 | /* now rescale all the debilities */ |
506 | /* now rescale all the debilities */ |
507 | for (int i = 0; i < NUM_STATS; ++i) |
507 | for (int i = 0; i < NUM_STATS; ++i) |
508 | symptom->stats.stat (i) = clamp (scale * disease->stats.stat (i), -MAX_STAT, MAX_STAT); |
508 | symptom->stats.stat (i) = clamp (int (scale * disease->stats.stat (i)), -128, 127); |
509 | |
509 | |
510 | symptom->stats.dam = clamp (scale * disease->stats.dam , -1024, 1024); |
510 | symptom->stats.dam = clamp (scale * disease->stats.dam , -1024, 1024); |
511 | symptom->stats.food = clamp (scale * disease->last_eat , -1024, 1024); |
511 | symptom->stats.food = clamp (scale * disease->last_eat , -1024, 1024); |
512 | symptom->stats.maxsp = clamp (scale * disease->stats.maxsp, -1024, 1024); |
512 | symptom->stats.maxsp = clamp (scale * disease->stats.maxsp, -1024, 1024); |
513 | symptom->last_sp = clamp (scale * disease->last_sp , -1024, 1024); |
513 | symptom->last_sp = clamp (scale * disease->last_sp , -1024, 1024); |