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

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