- PlayerScore_Add(targ, SP_DEATHS, 1);
-
- .entity weaponentity = weaponentities[0]; // TODO: unhardcode
-
- if(targ != attacker) // not for suicides
- if(g_weaponarena_random)
- {
- // after a frag, exchange the current weapon (or the culprit, if detectable) by a new random weapon
- Weapon culprit = DEATH_WEAPONOF(deathtype);
- if(!culprit) culprit = attacker.(weaponentity).m_weapon;
- else if(!(attacker.weapons & (culprit.m_wepset))) culprit = attacker.(weaponentity).m_weapon;
-
- if(g_weaponarena_random_with_blaster && culprit == WEP_BLASTER) // WEAPONTODO: Shouldn't this be in a mutator?
- {
- // no exchange
- }
- else
- {
- if(!GiveFrags_randomweapons)
- {
- GiveFrags_randomweapons = new(GiveFrags_randomweapons);
- }
-
- if(warmup_stage)
- GiveFrags_randomweapons.weapons = WARMUP_START_WEAPONS;
- else
- GiveFrags_randomweapons.weapons = start_weapons;
-
- // all others (including the culprit): remove
- GiveFrags_randomweapons.weapons &= ~attacker.weapons;
- GiveFrags_randomweapons.weapons &= ~(culprit.m_wepset);
-
- // among the remaining ones, choose one by random
- W_RandomWeapons(GiveFrags_randomweapons, 1);
-
- if(GiveFrags_randomweapons.weapons)
- {
- attacker.weapons |= GiveFrags_randomweapons.weapons;
- attacker.weapons &= ~(culprit.m_wepset);
- }
- }
-
- // after a frag, choose another random weapon set
- if (!(attacker.weapons & WepSet_FromWeapon(attacker.(weaponentity).m_weapon)))
- W_SwitchWeapon_Force(attacker, w_getbestweapon(attacker, weaponentity), weaponentity);
- }