Esempio n. 1
0
void LevelMainCharacter::setCharacterCore(CharacterCore* core)
{
	m_core = core;
	m_attributes = core->getTotalAttributes();
	setPosition(core->getData().currentLevelPosition);
	loadWeapon();
}
bool MSWeaponArmory::loadItemsDB(char* xmlData, int xmlSize)
{
	pugi::xml_document xmlFile;
	pugi::xml_parse_result parseResult = xmlFile.load_buffer_inplace(xmlData, xmlSize);
	if(!parseResult)
		r3dError("Failed to parse XML, error: %s", parseResult.description());

	pugi::xml_node xmlDB = xmlFile.child("DB");
	{
		pugi::xml_node xmlArmory = xmlDB.child("WeaponsArmory");
		pugi::xml_node xmlWeapon = xmlArmory.child("Weapon");
		while(!xmlWeapon.empty())
		{
			loadWeapon(xmlWeapon);
			xmlWeapon = xmlWeapon.next_sibling();
		}
	}
	{
		pugi::xml_node xmlArmory = xmlDB.child("GearArmory");
		pugi::xml_node xmlGear = xmlArmory.child("Gear");
		while(!xmlGear.empty())
		{
			loadGear(xmlGear);
			xmlGear = xmlGear.next_sibling();
		}
	}
	{
		pugi::xml_node xmlItems = xmlDB.child("ItemsDB");
		pugi::xml_node xmlItem = xmlItems.child("Item");
		while(!xmlItem.empty())
		{
			loadItem(xmlItem);
			xmlItem = xmlItem.next_sibling();
		}
	}

	return true;
}
Esempio n. 3
0
void WeaponManager::reset() {
    destroy();

    all_game_weapons_.clear();
    all_game_weapons_.push_back(loadWeapon(Weapon::Persuadatron));
    all_game_weapons_.push_back(loadWeapon(Weapon::Pistol));
    all_game_weapons_.push_back(loadWeapon(Weapon::Shotgun));
    all_game_weapons_.push_back(loadWeapon(Weapon::Uzi));
    all_game_weapons_.push_back(loadWeapon(Weapon::Scanner));
    all_game_weapons_.push_back(loadWeapon(Weapon::MediKit));
    all_game_weapons_.push_back(loadWeapon(Weapon::Minigun));
    all_game_weapons_.push_back(loadWeapon(Weapon::Flamer));
    all_game_weapons_.push_back(loadWeapon(Weapon::LongRange));
    all_game_weapons_.push_back(loadWeapon(Weapon::EnergyShield));
    all_game_weapons_.push_back(loadWeapon(Weapon::Laser));
    all_game_weapons_.push_back(loadWeapon(Weapon::GaussGun));
    all_game_weapons_.push_back(loadWeapon(Weapon::AccessCard));
    all_game_weapons_.push_back(loadWeapon(Weapon::TimeBomb));

    // Enables default weapons
    enableWeapon(Weapon::Persuadatron);
    enableWeapon(Weapon::Pistol);
    enableWeapon(Weapon::Shotgun);
    enableWeapon(Weapon::Scanner);
    enableWeapon(Weapon::MediKit);
}