// BEAST! - Fast, Strong, Agile!

/* CVARS - copy and paste to shconfig.cfg

//Beast
beast_level 0
beast_gravity 0.40			//Gravity
beast_health 175			//Starting Health
beast_armor 200			//Starting Armor
beast_speed 375			//Running Speed

*/

#include <amxmod>
#include <superheromod>

// VARIABLES
new gHeroName[]="Beast"
//----------------------------------------------------------------------------------------------
public plugin_init()
{
	// Plugin Info
	register_plugin("SUPERHERO Beast","1.0","Vectren")

	// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
	register_cvar("beast_level", "0")
	register_cvar("beast_gravity", "0.40")
	register_cvar("beast_armor", "200")
	register_cvar("beast_health", "175")
	register_cvar("beast_speed", "375")

	// FIRE THE EVENT TO CREATE THIS SUPERHERO!
	shCreateHero(gHeroName, "Speed/HP/AP/Gravity", "Faster than Flash, More Health, More Armor and Lower Gravity.", false, "beast_level" )

	// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
	register_srvcmd("beast_init", "beast_init")
	shRegHeroInit(gHeroName, "beast_init")

	// Let Server know about Beasts Variable
	// It is possible that another hero has more hps, less gravity, or more armor
	// so rather than just setting these - let the superhero module decide each round
	shSetMaxHealth(gHeroName, "beast_health" )
	shSetMinGravity(gHeroName, "beast_gravity" )
	shSetMaxArmor(gHeroName, "beast_armor" )
	shSetMaxSpeed(gHeroName, "beast_speed", "[0]" )
}
//----------------------------------------------------------------------------------------------
public beast_init()
{
	// First Argument is an id
	new temp[6]
	read_argv(1,temp,5)
	new id = str_to_num(temp)

	// 2nd Argument is 0 or 1 depending on whether the id has Beast
	read_argv(2,temp,5)
	new hasPowers = str_to_num(temp)

	// Got to take away powers from a user that dropped Beast
	if ( !hasPowers && is_user_connected(id) ) {
		shRemHealthPower(id)
		shRemGravityPower(id)
		shRemArmorPower(id)
		shRemSpeedPower(id)
	}
}
//----------------------------------------------------------------------------------------------