+MUTATOR_HOOKFUNCTION(ka_PlayerPowerups)
+{
+ if(self.ballcarried)
+ {
+ // if the player has the ball, force ballcarrier alpha upon them
+ self.alpha = cvar("g_keepaway_ballcarrier_alpha");
+ self.exteriorweaponentity.alpha = cvar("g_keepaway_ballcarrier_alpha");
+
+ // if we're in minstagib and a ballcarrier has just picked up invisibility,
+ // notify all the other players that the ballcarrier no longer has a waypoint
+ if(g_minstagib)
+ {
+ if(olditems & IT_STRENGTH)
+ {
+ if(time > self.strength_finished)
+ { // this only runs ONCE right after the player loses invisibility
+ bprint(self.netname, "^7 isn't invisible from radar anymore.\n");
+ }
+ }
+ else
+ {
+ if(time < self.strength_finished)
+ { // this only runs ONCE right after the player gains invisibility
+ bprint(self.netname, "^7 has picked up invisibility and can no longer be seen on radar!\n");
+ }
+ }
+ }
+ }
+ else if(g_minstagib)
+ {
+ // if we're in minstagib and a noncarrier has invisibility, assure that we apply the invisibility effects normally
+ if(olditems & IT_STRENGTH)
+ {
+ self.alpha = g_minstagib_invis_alpha;
+ self.exteriorweaponentity.alpha = g_minstagib_invis_alpha;
+ }
+ }
+ else
+ {
+ // if we're a normal player with no powerups that edit alpha make sure the alpha is default.
+ // (normal powerups just use EF_ADDITIVE)
+ self.alpha = default_player_alpha;
+ self.exteriorweaponentity.alpha = default_weapon_alpha;
+ }
+
+ return 0;
+}
+