source: GTP/trunk/App/Games/Jungle_Rumble/src/UniversalWeapon.cpp @ 1378

Revision 1378, 2.0 KB checked in by giegl, 18 years ago (diff)

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#include "dxstdafx.h"
2#include ".\universalweapon.h"
3#include "Scene.h"
4#include "GameScene.h"
5
6UniversalWeapon::UniversalWeapon(void) : Weapon()
7{
8}
9
10UniversalWeapon::~UniversalWeapon(void)
11{
12}
13
14void UniversalWeapon::setBulletType(int _bulletType)
15{
16        this->bulletType = _bulletType;
17}
18
19void UniversalWeapon::setReboundForce(float _reboundForce)
20{
21        this->reboundForce = _reboundForce;
22}
23
24void UniversalWeapon::setXFile(std::string filename)
25{
26        this->xFileFilename = filename;
27        this->leftWeapon  = (Object3d*) this->myScene->createNode(this->myScene->NODE_OBJECT3D, *this);
28        this->rightWeapon = (Object3d*) this->myScene->createNode(this->myScene->NODE_OBJECT3D, *this);
29        this->leftWeapon->setPosition(this->leftPos);
30        this->rightWeapon->setPosition(this->rightPos);
31        this->leftWeapon->loadMeshFromFile(filename);
32        this->rightWeapon->loadMeshFromFile(filename);
33}
34
35void UniversalWeapon::initWeapon()
36{
37}
38
39void UniversalWeapon::doFire()
40{
41}
42
43Node* UniversalWeapon::clone()
44{
45        UniversalWeapon *weapon = (UniversalWeapon*) this->myScene->createReferenceNode(GameScene::NODE_UNIVERSALWEAPON, true);
46        weapon->setWeaponType(this->weaponType);
47        weapon->setBulletType(this->bulletType);
48        weapon->setReboundForce(this->reboundForce);
49        weapon->setStateSound(Weapon::STATE_IDLE, this->soundNames[Weapon::STATE_IDLE]);
50        weapon->setStateTime(Weapon::STATE_PRELOAD, this->timeForState[Weapon::STATE_PRELOAD]);
51        weapon->setStateSound(Weapon::STATE_PRELOAD, this->soundNames[Weapon::STATE_PRELOAD]);
52        weapon->setStateTime(Weapon::STATE_FIRE, this->timeForState[Weapon::STATE_FIRE]);
53        weapon->setStateSound(Weapon::STATE_FIRE, this->soundNames[Weapon::STATE_FIRE]);
54        weapon->setStateTime(Weapon::STATE_POSTLOAD, this->timeForState[Weapon::STATE_POSTLOAD]);
55        weapon->setStateSound(Weapon::STATE_POSTLOAD, this->soundNames[Weapon::STATE_POSTLOAD]);
56        weapon->setStateSound(Weapon::STATE_EMPTY, this->soundNames[Weapon::STATE_EMPTY]);
57        weapon->setXFile(this->xFileFilename);
58        weapon->setStandBy(true);
59        return weapon;
60}
Note: See TracBrowser for help on using the repository browser.