[MUD-Dev] Re: Equipment Fit
Chris Gray
cg at ami-cg.GraySage.Edmonton.AB.CA
Sun Sep 6 10:28:04 CEST 1998
[Hans-Henrik Staerfeldt:]
> B) The fit is -30 for 30 days, until BOS->fit is 0, and
> thus BOS->owner is set to 'Ackbar'. That assumes
> that the "BOS->fit += 1" in reality meant "BOS->fit -= 1" :-)
> .. decrasing the fit from 30 to 0 over a month.
>
>In any event, you'd need some _more parameters_ to implement this
>nice idea the way it was originally described. That was what i was
>commenting. BOS->fit and BOS->owner isn't enough.
Allow me to jump in with some pseudocode:
initialization:
BOS->fit = 0; BOS->owner = NULL;
while wearing:
if (BOS->owner == NULL) {
BOS->owner = currentWearer;
}
if (BOS->owner == currentWearer) {
BOS->fit += 1;
} else {
BOS->fit -= 1;
if (BOS->fit == 0) {
BOS->owner = NULL;
}
}
to get the "fit" value:
if (BOS->owner == currentWearer) {
return BOS->fit;
} else {
return - BOS->fit;
}
When Ackbar starts wearing the boots, he is not set as the owner of them.
"fit"-ness values can be negative, indicating a very poor fit. This
is what I deduced that Holly was suggesting.
--
Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
More information about the mud-dev-archive
mailing list