This might be a slightly long post. Please nobody quote this in its entirety!
First of all, I'd like to submit the map "
Overdrive-re."
And now, a bunch of source modifications I've made:
Not-In-The-Way Thirdperson (With lots of help from Sireus): After Line 48 in game.cpp:
- {l Code}: {l Select All Code}
FVAR(IDF_PERSIST, thirdpersonheight, FVAR_MIN, 1.5, FVAR_MAX); //Greaser
FVAR(IDF_PERSIST, thirdpersonshoulder, FVAR_MIN, 3.5, FVAR_MAX); //Greaser
After Line 2209 in game.cpp: (2208 on SVN)
- {l Code}: {l Select All Code}
vec offset = vec(thirdpersonshoulder, 0, thirdpersonheight);
offset.rotate_around_z(player1->yaw * RAD);
camera1->o.add(offset);
//^Sireus
findorientation(camera1->o, (self ? player1 : focus)->yaw, (self ? player1 : focus)->pitch, worldpos);
//^taken from above (Greaser)
Next, included from the Killer Mode mod: (I decided that having my server to play it on should be enough, so I decided not to submit it because I don't want to bother testers to see if my mode should be included)
Defensive Bots (only attack people who attack them and 'forgive' them when they die; turned on/off by server var "aidefensive")
After line 69 in "ai.cpp":
- {l Code}: {l Select All Code}
if ((GAME(aidefensive) == 1 ) && (d->knownenemies.find(e) < 0)) return false; //added by GP: if "aidefensive" is set to 1 and "e" is not a known enemy, it's not ok to kill e.
After Line 609 in "ai.cpp": (Line 604 for SVN)
- {l Code}: {l Select All Code}
//add the attacker to the list of known enemies
d->knownenemies.add(e);
After Line 1771 in "ai.cpp": (1762 for SVN)
- {l Code}: {l Select All Code}
void aipacify(int botnumber) //added by Greaser. "Botnumber" is optional. ("botnumber 0" means pacify everyone)
{
loopv(game::players) if (game::players[i] && game::players[i]->ai)
if ((game::players[i]->clientnum == botnumber) || (botnumber == 0))
{
game::players[i]->knownenemies.shrink(0); //delete all known enemies
}
}
ICOMMAND(0, aipacify,"i", (int *botnumber), aipacify(*botnumber)); //make into a console-executable command
void addenemyall(gameent *accused) //add to everyone's list of known enemies
{
loopv(game::players) if (game::players[i])
{
if (game::players[i]->knownenemies.find(accused) < 0 && game::players[i]->knownenemies.find(game::player1) < 0) // if enemy isn't there, and the player who accused isn't an enemy
{
game::players[i]->knownenemies.add(accused);
}
}
}
void cleardeadgrudges(gameent *d) //removes dead players from known enemies
{
loopv(d->knownenemies) if (d->knownenemies[i])
{
if ((d->knownenemies[i]->state != CS_ALIVE) && (d->dominating.find(d->knownenemies[1]) < 0)) d->knownenemies.remove(i); //remove dead players, but don't remove dominators
}
}
void aiincriminate(string accusedname, int accusednumber) //accuse a player
{
int accusedpresent = 0; //to make sure accused player exists
loopv(game::players) if (game::players[i]) //go through players
{
gameent *candidate = game::players[i];
const char *cstringname;
cstringname = accusedname;
if(strcmp(cstringname, candidate->name) == 0) //if names match
{
// if the numbers match, or the number is 0:
if(game::players[i]->clientnum == accusednumber || accusednumber == 0)
{
accusedpresent = 1;
addenemyall(game::players[i]);
}
}
}
// if nothing found, try case insensitive
if (accusedpresent == 0)
{
loopv(game::players) if (game::players[i])
{
const char *cstringname;
cstringname = accusedname;
if(strcasecmp(cstringname, game::players[i]->name) == 0)
{
if(game::players[i]->clientnum == accusednumber || accusednumber == 0)
{
accusedpresent = 1;
addenemyall(game::players[i]);
}
}
}
}
if (accusedpresent == 0) //still nothing found:
{
conoutft(CON_SELF, "No matches found.");
}
}
ICOMMAND(0, aiattack,"si", (string accusedname, int *accusednumber), aiincriminate (accusedname, *accusednumber)); //make into a console-executable command
After Line 795 in "game.h": (800 for SVN)
- {l Code}: {l Select All Code}
vector<gameent *> knownenemies; //for A.I. (added by Greaser)
In the first line (or anywhere, really) in "vars.h":
- {l Code}: {l Select All Code}
GVAR(0, aidefensive, 0, 0, 1); //AI Defensive mode (Greaser)
Radar Modes:After Line 1461 in "hud.cpp": (1464 for SVN)
- {l Code}: {l Select All Code}
if (GAME(radarmode) == 2) //Greaser's idea
{
if (d->actiontime[0] > d->actiontime[1])
{
if (d->actiontime[0] > d->actiontime[2])
{
fade = 1 - ((lastmillis - d->actiontime[0]) * 0.001); //fade over time after a player shoots (primary)
}
else
{
fade = 1 - ((lastmillis - d->actiontime[2]) * 0.001); //fade over time after a player reloads
}
}
else
{
if (d->actiontime[1] > d->actiontime[2])
{
fade = 1 - ((lastmillis - d->actiontime[1]) * 0.001); //fade over time after a player shoots (2ndary)
}
else
{
fade = 1 - ((lastmillis - d->actiontime[2]) * 0.001); //fade over time after a player reloads
}
}
}
else if (GAME(radarmode) == 3) //Riidom's idea (inverted)
{
fade *= (0.02 / clamp(vec(d->vel).add(d->falling).magnitude()/movespeed, 0.f, 1.f));
fade *= (1 / clamp(vec(d->vel).add(d->falling).magnitude(), 0.f, 1.f));
}
else if (GAME(radarmode) != 1) //1 = always shown
{
fade *= clamp(vec(d->vel).add(d->falling).magnitude()/movespeed, 0.f, 1.f); //normal
fade *= clamp(vec(d->vel).add(d->falling).magnitude(), 0.f, 1.f);
}
if (GAME(radarhealthfade) != 0)
{
fade *= (6.7 / (GAME(radarhealthfade) * (GAME(spawnhealth) - d->health))); // fade damaged players (Fallen's idea, works w/ other 3)
}
Anywhere in "vars.h":
- {l Code}: {l Select All Code}
GVAR(0, radarmode, 0, 0, 3); //when do players show up on radar? 0 = normal, 1 = always, 2 = Riidom's inversion, 3 = shooting, 4 = Fallen's health-based idea
GFVAR(0, radarhealthfade, 0, 0, FVAR_MAX); //how much damaged players fade on radar
I hope you like these!
LICENCE FOR ALL OF THIS:
CC-BY ATTRIBUTION LICENCE 
(You have to attribute the 3rdperson mod to Sireus as well.)
By the way, is there a better place to post the source modifications I make to see if they should be included?
Anyway, here are the files.