/*
	  _______            __         __  ___ 
	 / ___/ /  ___  ___ / /____ ___/ / |_  |
	/ (_ / _ \/ _ \(_-</ __/ -_) _  / / __/ 
	\___/_//_/\___/___/\__/\__/\_,_/ /____/
	_________________________________________	
	 Now partially powered by ZScript
*/
#include "ZScript/RLib/RLib.txt"

class G2ACSEXT
{
	static int Echo()
	{
		return 1;
	}
}

class G2_WeaponModifier : Inventory {
	override void Tick() {
		if(owner) {
			Weapon wpn = owner.player.readyWeapon;
			if(wpn && wpn is 'G2_Weapon') {
				wpn.bobStyle = Bob_InverseSmooth;
				wpn.bobSpeed = 1.9;
				wpn.bobRangeX = 0.85;
				wpn.bobRangeY = 0.5;
			}
			/*let pl = PlayerPawn(owner);
			if(pl) {
				pl.BobWeapon();
			}*/
		}
		super.Tick();
	}
}

enum G2ExFlColors {
	FLC_WHITE = 0,
	FLC_RED,
	FLC_GREEN,
	FLC_BLUE,
}

class G2EX_SpotlightColors {
	static Vector3 GetColor(int clr) {
		switch(clr) {
			case FLC_WHITE:
				return (0.9, 0.95, 1.0);
			case FLC_RED:
				return (1, 0.15, 0.125);
			case FLC_GREEN:
				return (0.15, 1, 0.125);
			case FLC_BLUE:
				return (0.125, 0.5, 1.0);
		}
		return (1, 1, 1);
	}

	static void SetColor(int clr, DynamicLight light) {
		let c = GetColor(clr) * 255;
		light.args[0] = int(c.x);
		light.args[1] = int(c.y);
		light.args[2] = int(c.z);
	}
}

class G2_Spotlight : DynamicLight
{
	default
	{
		DynamicLight.Type "Point";
		+DYNAMICLIGHT.SPOT
		+CLIENTSIDEONLY;
		G2_Spotlight.FlashlightColor FLC_WHITE;
	}

	Property flashlightColor: FlashlightColor;

	int flashlightColor;

	void SuperBeginPlay() {
		super.PostBeginPlay();
	}

	override void PostBeginPlay()
	{
		args[3] = 310;
		G2EX_SpotlightColors.SetColor(flashlightColor, self);
		
		SpotInnerAngle = 10;
		SpotOuterAngle = 30;
		SuperBeginPlay();
	}
}

class G2_Spotlight2 : G2_Spotlight
{
	override void PostBeginPlay()
	{
		args[3] = 370;
		G2EX_SpotlightColors.SetColor(flashlightColor, self);
		
		SpotInnerAngle = 5;
		SpotOuterAngle = 18;
		SuperBeginPlay();
	}
}

class G2_Spotlight3 : G2_Spotlight
{
	default
	{
		+DYNAMICLIGHT.SUBTRACTIVE
	}

	override void PostBeginPlay()
	{
		args[0] = 200;
		args[1] = 150;
		args[2] = 140;
		args[3] = 200;
		
		SpotInnerAngle = 2;
		SpotOuterAngle = 15;
		SuperBeginPlay();
	}
}

class G2_SpotlightG : G2_Spotlight
{
	default
	{
		G2_Spotlight.FlashlightColor FLC_GREEN;
	}
}
class G2_SpotlightG2 : G2_Spotlight2
{
	default
	{
		G2_Spotlight.FlashlightColor FLC_GREEN;
	}
}
class G2_SpotlightR : G2_Spotlight
{
	default
	{
		G2_Spotlight.FlashlightColor FLC_RED;
	}
}
class G2_SpotlightR2 : G2_Spotlight2
{
	default
	{
		G2_Spotlight.FlashlightColor FLC_RED;
	}
}
class G2_SpotlightB : G2_Spotlight
{
	default
	{
		G2_Spotlight.FlashlightColor FLC_BLUE;
	}
}
class G2_SpotlightB2 : G2_Spotlight2
{
	default
	{
		G2_Spotlight.FlashlightColor FLC_BLUE;
	}
}