Worsen penalties for not meeting weapon requirements
This commit is contained in:
parent
2b82e1de44
commit
e4cdde4f98
20
lf.c
20
lf.c
|
@ -18859,7 +18859,7 @@ int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *pctmod) {
|
||||||
int myval;
|
int myval;
|
||||||
int neededdiff,bonusdiff;
|
int neededdiff,bonusdiff;
|
||||||
int dopenaltycheck = B_TRUE, dobonuscheck = B_FALSE;
|
int dopenaltycheck = B_TRUE, dobonuscheck = B_FALSE;
|
||||||
int scaleamt;
|
int scale_bonus = 0, scale_penalty = 15;
|
||||||
enum {
|
enum {
|
||||||
NONE=0,
|
NONE=0,
|
||||||
PENALTY=1,
|
PENALTY=1,
|
||||||
|
@ -18886,9 +18886,9 @@ int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *pctmod) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(f->text)) {
|
if (strlen(f->text)) {
|
||||||
scaleamt = atoi(f->text);
|
scale_bonus = atoi(f->text);
|
||||||
} else {
|
} else {
|
||||||
scaleamt = 0;
|
scale_bonus = 0; // default
|
||||||
}
|
}
|
||||||
|
|
||||||
// modify for masterwork
|
// modify for masterwork
|
||||||
|
@ -18914,15 +18914,15 @@ int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *pctmod) {
|
||||||
|
|
||||||
if (dobonuscheck) {
|
if (dobonuscheck) {
|
||||||
bonusdiff = myval - valbonus;
|
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;
|
if (bonusdiff >= 0) bonusdiff += 10;
|
||||||
limit(&bonusdiff,-20, 30);
|
limit(&bonusdiff,-20, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dopenaltycheck && (neededdiff < 0)) {
|
if (dopenaltycheck && (neededdiff < 0)) {
|
||||||
// penalty?
|
// penalty?
|
||||||
// for firearms, armour or scaleamt == 0, you MUST meet the requirement.
|
// for firearms, armour or scale_bonus == 0, you MUST meet the requirement.
|
||||||
if (scaleamt == 0) {
|
if (scale_bonus == 0) {
|
||||||
neededdiff = -20;
|
neededdiff = -20;
|
||||||
} else if (o && isarmour(o)) {
|
} else if (o && isarmour(o)) {
|
||||||
neededdiff = -20;
|
neededdiff = -20;
|
||||||
|
@ -18940,12 +18940,12 @@ int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *pctmod) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scaleamt && pctmod) {
|
if (scale_bonus && pctmod) {
|
||||||
// for each 10 points you are over/under the requirement, adjust "scaleamt" percent.
|
// for each 10 points you are over/under the requirement, adjust "scale_bonus" percent.
|
||||||
if (bonorpen == PENALTY) {
|
if (bonorpen == PENALTY) {
|
||||||
*pctmod = (neededdiff/10) * scaleamt;
|
*pctmod = (neededdiff/10) * scale_penalty;
|
||||||
} else if (bonorpen == BONUS) {
|
} else if (bonorpen == BONUS) {
|
||||||
*pctmod = (bonusdiff/10) * scaleamt;
|
*pctmod = (bonusdiff/10) * scale_bonus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue