#include "dxstdafx.h" #include ".\universalweapon.h" #include "Scene.h" #include "GameScene.h" UniversalWeapon::UniversalWeapon(void) : Weapon() { } UniversalWeapon::~UniversalWeapon(void) { } void UniversalWeapon::setBulletType(int _bulletType) { this->bulletType = _bulletType; } void UniversalWeapon::setReboundForce(float _reboundForce) { this->reboundForce = _reboundForce; } void UniversalWeapon::setXFile(std::string filename) { this->xFileFilename = filename; this->leftWeapon = (Object3d*) this->myScene->createNode(this->myScene->NODE_OBJECT3D, *this); this->rightWeapon = (Object3d*) this->myScene->createNode(this->myScene->NODE_OBJECT3D, *this); this->leftWeapon->setPosition(this->leftPos); this->rightWeapon->setPosition(this->rightPos); this->leftWeapon->loadMeshFromFile(filename); this->rightWeapon->loadMeshFromFile(filename); } void UniversalWeapon::initWeapon() { } void UniversalWeapon::doFire() { } Node* UniversalWeapon::clone() { UniversalWeapon *weapon = (UniversalWeapon*) this->myScene->createReferenceNode(GameScene::NODE_UNIVERSALWEAPON, true); weapon->setWeaponType(this->weaponType); weapon->setBulletType(this->bulletType); weapon->setReboundForce(this->reboundForce); weapon->setStateSound(Weapon::STATE_IDLE, this->soundNames[Weapon::STATE_IDLE]); weapon->setStateTime(Weapon::STATE_PRELOAD, this->timeForState[Weapon::STATE_PRELOAD]); weapon->setStateSound(Weapon::STATE_PRELOAD, this->soundNames[Weapon::STATE_PRELOAD]); weapon->setStateTime(Weapon::STATE_FIRE, this->timeForState[Weapon::STATE_FIRE]); weapon->setStateSound(Weapon::STATE_FIRE, this->soundNames[Weapon::STATE_FIRE]); weapon->setStateTime(Weapon::STATE_POSTLOAD, this->timeForState[Weapon::STATE_POSTLOAD]); weapon->setStateSound(Weapon::STATE_POSTLOAD, this->soundNames[Weapon::STATE_POSTLOAD]); weapon->setStateSound(Weapon::STATE_EMPTY, this->soundNames[Weapon::STATE_EMPTY]); weapon->setXFile(this->xFileFilename); weapon->setStandBy(true); return weapon; }