示例#1
0
int ZMannedObject::DamageDriverHealth(int damage_amount) {

	if (!driver_info.size()) {
		return 0;
	}

	driver_info_s &the_driver = *driver_info.begin();

	if (the_driver.health <= 0) {
		return 0;
	}

	the_driver.health -= damage_amount;

	if (the_driver.health <= 0) {
		//we killed the driver

		//clear drivers
		ClearDrivers();

		//go to NULL_TEAM
		SetOwner(NULL_TEAM);
	}

	return 1;
}
示例#2
0
void ZCannon::SetInitialDrivers()
{
	if(owner != NULL_TEAM)
	{
		driver_type = GRUNT;
		//AddDriver(GRUNT_MAX_HEALTH);
		AddDriver(zsettings->GetUnitSettings(ROBOT_OBJECT, GRUNT).health * MAX_UNIT_HEALTH);
	}
	else
	{
		driver_type = GRUNT;
		ClearDrivers();
	}
}
示例#3
0
void ZMannedObject::SetInitialDrivers() {

	driver_type = GRUNT;

	ClearDrivers();

	if (owner != NULL_TEAM) {
		//AddDriver(GRUNT_MAX_HEALTH);
		AddDriver(zsettings->GetUnitSettings(ROBOT_OBJECT, GRUNT).health * MAX_UNIT_HEALTH, 0);

		// New add driver:
		//	NewAddDriver(RGrunt(ztime, zsettings));
	}
}