[Change] Tweaked faction hits to be more useful.

This commit is contained in:
Allanis 2013-08-10 12:32:06 +01:00
parent 03972e305a
commit cd1565a6d5
2 changed files with 4 additions and 3 deletions

View File

@ -80,6 +80,7 @@ static void faction_sanitizePlayer(Faction* faction) {
void faction_modPlayer(int f, int mod) {
int i;
Faction* faction, *ally, *enemy;
DEBUG("MOD: %d ALLY/ENEMY MOD: %d", mod, mod/2);
if(faction_isFaction(f)) {
faction = &faction_stack[f];
@ -92,7 +93,7 @@ void faction_modPlayer(int f, int mod) {
for(i = 0; i < faction->nallies; i++) {
ally = &faction_stack[faction->allies[i]];
ally->player += RNG(0, mod/2);
ally->player += RNG(0, (mod*3)/4);
faction_sanitizePlayer(ally);
}
@ -100,7 +101,7 @@ void faction_modPlayer(int f, int mod) {
for(i = 0; i < faction->nenemies; i++) {
enemy = &faction_stack[faction->enemies[i]];
enemy->player -= MIN(1, RNG(0, mod/2));
enemy->player -= MIN(1, RNG(0, (mod*3)/4));
faction_sanitizePlayer(enemy);
}

View File

@ -301,7 +301,7 @@ void pilot_hit(Pilot* p, const Solid* w, const unsigned int shooter,
pilot_dead(p);
/* Adjust the combat rating based on pilot mass and ditto faction. */
if(shooter == PLAYER_ID) {
mod = MIN(1, (int)sqrt(p->ship->mass/25.));
mod = (int)MAX(1, ceil(pow(p->ship->mass, 1./3.))-1.);
player_crating += MAX(1, mod);
faction_modPlayer(p->faction, -mod);
}