Downloads containing ProportionateDom.mut

Downloads
Name Author Game Mode Rating
JJ2+ Only: Two DOM mutators Violet CLM Mutator N/A Download file

File preview

#pragma name "Proportionate DOM /maxscore"
#pragma description "Sets the maximum score for each level in Domination games to a number based directly on the number of control points in that level, so that all rounds last roughly the same length."

const uint MinimumMinutes = 3;

void onLevelBegin() {
	if (!jjIsServer || jjGameCustom != GAME::DOM)
		return;
	uint controlPointCount = 0;
	
	for (int x = jjLayerWidth[4]; --x >= 0;)
	for (int y = jjLayerHeight[4]; --y >= 0;) {
		const auto difficulty = jjParameterGet(x,y, -4, 2);
		if (difficulty == 1 || difficulty == 2 || jjEventGet(x,y) == OBJECT::CTFBASE)
			controlPointCount += 1;
	}
	
	if (controlPointCount != 0) {
		const uint secondsPerScoreIncrement = ((controlPointCount + 3) / 4) * 5;
		jjChat("/maxscore " + (MinimumMinutes * 60 * controlPointCount / secondsPerScoreIncrement));
	}
}