9#define count_shells(num) \
17#define count_bullets(num) \
19 _("ZER^%d bullets"), \
21 _("TWO^%d bullets"), \
22 _("THR^%d bullets"), \
25#define count_rockets(num) \
27 _("ZER^%d rockets"), \
29 _("TWO^%d rockets"), \
30 _("THR^%d rockets"), \
33#define count_cells(num) \
42#define count_votes(num) \
50#define count_matches(num) \
52 _("ZER^%d matches"), \
54 _("TWO^%d matches"), \
55 _("THR^%d matches"), \
58#define count_points_decs(time, decs) sprintf(CTX(_("DEC^%s points")), ftos_decimals(time, decs))
59#define count_points(num) \
67#define count_results(num) \
69 _("ZER^%d results"), \
71 _("TWO^%d results"), \
72 _("THR^%d results"), \
76#define count_years_decs(time, decs) sprintf(CTX(_("DEC^%s years")), ftos_decimals(time, decs))
77#define count_years(time) \
85#define count_weeks_decs(time, decs) sprintf(CTX(_("DEC^%s weeks")), ftos_decimals(time, decs))
86#define count_weeks(time) \
94#define count_days_decs(time, decs) sprintf(CTX(_("DEC^%s days")), ftos_decimals(time, decs))
95#define count_days(time) \
103#define count_hours_decs(time, decs) sprintf(CTX(_("DEC^%s hours")), ftos_decimals(time, decs))
104#define count_hours(time) \
112#define count_minutes_decs(time, decs) sprintf(CTX(_("DEC^%s minutes")), ftos_decimals(time, decs))
113#define count_minutes(time) \
115 _("ZER^%d minutes"), \
116 _("ONE^%d minute"), \
117 _("TWO^%d minutes"), \
118 _("THR^%d minutes"), \
121#define count_seconds_decs(time, decs) sprintf(CTX(_("DEC^%s seconds")), ftos_decimals(time, decs))
122#define count_seconds(time) \
124 _("ZER^%d seconds"), \
125 _("ONE^%d second"), \
126 _("TWO^%d seconds"), \
127 _("THR^%d seconds"), \
138 int last2digits = num % 100;
141 if (last2digits < 4 || last2digits > 20)
142 switch (last2digits % 10)
144 case 1:
return sprintf(_(
"%dst"), num);
145 case 2:
return sprintf(_(
"%dnd"), num);
146 case 3:
return sprintf(_(
"%drd"), num);
149 return sprintf(_(
"%dth"), num);
153string count_fill(
float num,
string zero,
string one,
string two,
string three,
string multi)
169 case 0:
return sprintf(
CTX(zero), num);
172 return sprintf(
CTX(one), num);
174 return sprintf(
CTX(multi), num);
175 case 2:
return sprintf(
CTX(two), num);
176 case 3:
return sprintf(
CTX(three), num);
177 default:
return sprintf(
CTX(multi), num);
185 int tmp_hours = 0, tmp_minutes = 0, tmp_seconds;
186 int tmp_years = 0, tmp_weeks = 0, tmp_days = 0;
188 tmp_seconds =
floor(seconds);
192 tmp_minutes =
floor(tmp_seconds / 60);
196 tmp_seconds -= tmp_minutes * 60;
197 tmp_hours =
floor(tmp_minutes / 60);
201 tmp_minutes -= tmp_hours * 60;
202 tmp_days =
floor(tmp_hours / 24);
206 tmp_hours -= tmp_days * 24;
207 tmp_weeks =
floor(tmp_days / 7);
211 tmp_days -= tmp_weeks * 7;
212 tmp_years =
floor(tmp_weeks / 52);
221 case 1:
return sprintf(
"%02d:%02d:%02d", tmp_hours, tmp_minutes, tmp_seconds);
225 #define APPEND_TIME(unit) \
227 output = strcat(output, ((output != "") ? ", " : ""), count_##unit(tmp_##unit))
244 tmp_days += (tmp_weeks * 7);
246 tmp_days += (tmp_years * 365);
250 ((output !=
"") ?
strcat(
", ", output) :
"")
#define APPEND_TIME(unit)
#define count_hours(time)
ERASEABLE string count_fill(float num, string zero, string one, string two, string three, string multi)
ERASEABLE string count_ordinal(int num)
#define count_seconds(time)
ERASEABLE string process_time(float outputtype, int seconds)
ERASEABLE string CTX(string s)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))