X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=misc.c;h=16ad02ac6045df58f30596da5c7e12616e6dbf8f;hb=f715091db6a55e49ab1c21c891011c9ae535a93c;hp=501b86b001a83556c8ca6609a34311e8457ee8b9;hpb=5de9c7132d616bcf1ef348a243ac2eb057b63424;p=open-adventure.git diff --git a/misc.c b/misc.c index 501b86b..16ad02a 100644 --- a/misc.c +++ b/misc.c @@ -68,6 +68,26 @@ void newspeak(char* msg) copy[i + 1] = 's'; sprintf(parameters[param_index], "%d", PARMS[param_index]); } + + // Plain string specifier. + if (msg[i + 1] == 's') + { + packed_to_token(PARMS[param_index], parameters[param_index]); + } + + // Plural replacement specifier. + if (msg[i + 1] == 'S') + { + copy[i + 1] = 's'; + if (PARMS[param_index - 1] > 1) + { + sprintf(parameters[param_index], "%s", "s"); + } + else + { + sprintf(parameters[param_index], "%s", ""); + } + } } }