From e4cdde4f98a511f028756606185ba2a1ff74c667 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Mon, 4 Jul 2016 22:44:07 +1000 Subject: [PATCH] Worsen penalties for not meeting weapon requirements --- lf.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lf.c b/lf.c index 8c0c04c..9cf79a4 100644 --- a/lf.c +++ b/lf.c @@ -18859,7 +18859,7 @@ int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *pctmod) { int myval; int neededdiff,bonusdiff; int dopenaltycheck = B_TRUE, dobonuscheck = B_FALSE; - int scaleamt; + int scale_bonus = 0, scale_penalty = 15; enum { NONE=0, PENALTY=1, @@ -18886,9 +18886,9 @@ int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *pctmod) { } if (strlen(f->text)) { - scaleamt = atoi(f->text); + scale_bonus = atoi(f->text); } else { - scaleamt = 0; + scale_bonus = 0; // default } // modify for masterwork @@ -18914,15 +18914,15 @@ int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *pctmod) { if (dobonuscheck) { bonusdiff = myval - valbonus; - // for this one, just meeting it gives you once "scaleamt" worth of bonus + // for this one, just meeting it gives you once "scale_bonus" worth of bonus if (bonusdiff >= 0) bonusdiff += 10; limit(&bonusdiff,-20, 30); } if (dopenaltycheck && (neededdiff < 0)) { // penalty? - // for firearms, armour or scaleamt == 0, you MUST meet the requirement. - if (scaleamt == 0) { + // for firearms, armour or scale_bonus == 0, you MUST meet the requirement. + if (scale_bonus == 0) { neededdiff = -20; } else if (o && isarmour(o)) { neededdiff = -20; @@ -18940,12 +18940,12 @@ int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *pctmod) { } } - if (scaleamt && pctmod) { - // for each 10 points you are over/under the requirement, adjust "scaleamt" percent. + if (scale_bonus && pctmod) { + // for each 10 points you are over/under the requirement, adjust "scale_bonus" percent. if (bonorpen == PENALTY) { - *pctmod = (neededdiff/10) * scaleamt; + *pctmod = (neededdiff/10) * scale_penalty; } else if (bonorpen == BONUS) { - *pctmod = (bonusdiff/10) * scaleamt; + *pctmod = (bonusdiff/10) * scale_bonus; } }