#include "scripts/bp_common.txt"
#include "scripts/common.txt"

class BPGrenadesPickup : ScriptObject
{
    kActor @self;
	float turnSpeed = Math::Deg2Rad(1);
	//------------------------------------------------------------------------------------------------------------------------
    BPGrenadesPickup(kActor @actor) {
        @self = actor;
    }
	//------------------------------------------------------------------------------------------------------------------------
    void OnTick(void) {
		self.Yaw() += turnSpeed;
		if (InRadius(self.Origin(), 75.0f)) {
			Game.PlaySound("sounds/shaders/generic_5_grenade_pickup.ksnd");
			Game.PrintLine("$str_129", 0);
			if (Player.HasWeapon(TW_WEAPON_GRENADE)) {
				Player.GiveWeapon(TW_WEAPON_GRENADE, 2);
			}
			self.Remove();
		}
    }
	//------------------------------------------------------------------------------------------------------------------------
    void OnSpawn(void) {
    }
	//------------------------------------------------------------------------------------------------------------------------
}
