greaserpirate {l Wrote}:
In other games, you are a human... but in Red Eclipse you're a god.
FVAR(IDF_PERSIST, thirdpersonheight, FVAR_MIN, 1.5, FVAR_MAX); //Greaser
FVAR(IDF_PERSIST, thirdpersonshoulder, FVAR_MIN, 3.5, FVAR_MAX); //Greaser
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)
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.
//add the attacker to the list of known enemies
d->knownenemies.add(e);
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
vector<gameent *> knownenemies; //for A.I. (added by Greaser)
GVAR(0, aidefensive, 0, 0, 1); //AI Defensive mode (Greaser)
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)
}
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
Users browsing this forum: No registered users and 1 guest