const char *CombatTimingTable::getWeaponReloadClientAnimation(std::string const & weaponType)
{
	const char * result = 0;

	DataTable * combatTimingTable = DataTableManager::getTable(cs_combatTimingTableName, true);
	if (combatTimingTable)
	{
		int rowNum = combatTimingTable->searchColumnString(0, weaponType);
		result = combatTimingTable->getStringValue("WeaponReloadClientAnimation", rowNum);
	}

	return result;
}
bool CombatTimingTable::isContinuous(std::string const & weaponType)
{
	bool result = false;

	DataTable * combatTimingTable = DataTableManager::getTable(cs_combatTimingTableName, true);
	if (combatTimingTable)
	{
		int rowNum = combatTimingTable->searchColumnString(0, weaponType);
		result = combatTimingTable->getIntValue("Continuous", rowNum) ? true : false;
	}

	return result;
}
float CombatTimingTable::getWeaponReloadTimeSeconds(std::string const & weaponType)
{
	float result = 0;

	DataTable * combatTimingTable = DataTableManager::getTable(cs_combatTimingTableName, true);
	if (combatTimingTable)
	{
		int rowNum = combatTimingTable->searchColumnString(0, weaponType);
		result = combatTimingTable->getFloatValue("WeaponReloadTimeSeconds", rowNum);
	}

	return result;
}
int CombatTimingTable::getMaximumShotsTillWeaponReload(std::string const & weaponType)
{
	int result = 0;

	DataTable * combatTimingTable = DataTableManager::getTable(cs_combatTimingTableName, true);
	if (combatTimingTable)
	{
		int rowNum = combatTimingTable->searchColumnString(0, weaponType);
		result = combatTimingTable->getIntValue("MaximumShotsTillWeaponReload", rowNum);
	}

	return result;
}
Пример #5
0
void BuildingObject::changeTeleportDestination(Vector & position, float & yaw) const
{
	if (!isAuthoritative())
	{
		WARNING(true, ("BuildingObject::changeTeleportDestination called on "
			"non-authoritative building %s", getNetworkId().getValueString().c_str()));
		return;
	}

	// call a script trigger that will give us the index of the cloning facility
	// tube to respawn in, if any
	int index = -1;
	ScriptParams params;
	params.addParam(index);
	IGNORE_RETURN(const_cast<GameScriptObject *>(getScriptObject())->trigAllScripts(
		Scripting::TRIG_GET_RESPAWN_LOC, params));
	index = params.getIntParam(0);
	if (index >= 0)
	{
		DataTable * respawnTable = DataTableManager::getTable(CLONE_RESPAWN_TABLE, 
			true);
		if (respawnTable != NULL)
		{
			int row = respawnTable->searchColumnString(0, getTemplateName());
			if (row >= 0)
			{
				char buffer[32];
				sprintf(buffer, "TUBE%d_X", index+1);
				int column = respawnTable->findColumnNumber(buffer);
				if (column >= 0)
				{
					position.x = respawnTable->getFloatValue(column, row);
					position.z = respawnTable->getFloatValue(column+1, row);
					yaw = convertDegreesToRadians(respawnTable->getFloatValue(column+2, row));
				}
			}
		}
	}
}