[Change] Tweaked faction hits from combat a bit.

This commit is contained in:
Allanis 2013-08-07 14:30:03 +01:00
parent 30aaa7852d
commit 790bd9b472

View File

@ -312,9 +312,9 @@ static void weapon_update(Weapon* w, const double dt, WeaponLayer layer) {
static void weapon_hit(Weapon* w, Pilot* p, WeaponLayer layer) { static void weapon_hit(Weapon* w, Pilot* p, WeaponLayer layer) {
/* Someone should let the ai know it's been attacked. */ /* Someone should let the ai know it's been attacked. */
if(!pilot_isPlayer(p)) { if(!pilot_isPlayer(p)) {
if((player_target == p->id) || (RNG(0,2) == 0)) { if((player_target == p->id) || (RNG(0,2) == 0)) { /* 33% chance. */
if((w->parent == PLAYER_ID) && if((w->parent == PLAYER_ID) &&
(!pilot_isFlag(p, PILOT_HOSTILE) || (RNG(0, 2) == 0))) { (!pilot_isFlag(p, PILOT_HOSTILE) || (RNG(0, 1) == 0))) { /* 50% chance. */
faction_modPlayer(p->faction, -1); /* Slowly lower faction. */ faction_modPlayer(p->faction, -1); /* Slowly lower faction. */
pilot_setFlag(p, PILOT_HOSTILE); pilot_setFlag(p, PILOT_HOSTILE);
} }