
using System;
using PlanetExpress.items.enemys;

namespace PlanetExpress.items.weapon {

	public class CustomWeapon {
		
		protected CustomGameObject Person;		
		public float ShootInterval = 1000f;
		float ShootTimeLeft = 1000f;
		public CustomWeapon(CustomGameObject person) {
			Person = person;
		}
		
		public virtual void Action(double time) {
			if (ShootTimeLeft < ShootInterval) ShootTimeLeft += 10000f * (float)time;
		}
				
		public bool Shoot(float x, float y, float angle) {
			if (ShootTimeLeft >= ShootInterval) {
				ShootTimeLeft = 0f;
				doShoot(x, y, angle);
				return true;
			}
			return false;
		}
		
		protected virtual void doShoot(float x, float y, float angle) {
			
		}
		
	}
}
