1 | #include "dxstdafx.h"
|
---|
2 | #include ".\universalweapon.h"
|
---|
3 | #include "Scene.h"
|
---|
4 | #include "GameScene.h"
|
---|
5 |
|
---|
6 | UniversalWeapon::UniversalWeapon(void) : Weapon()
|
---|
7 | {
|
---|
8 | }
|
---|
9 |
|
---|
10 | UniversalWeapon::~UniversalWeapon(void)
|
---|
11 | {
|
---|
12 | }
|
---|
13 |
|
---|
14 | void UniversalWeapon::setBulletType(int _bulletType)
|
---|
15 | {
|
---|
16 | this->bulletType = _bulletType;
|
---|
17 | }
|
---|
18 |
|
---|
19 | void UniversalWeapon::setReboundForce(float _reboundForce)
|
---|
20 | {
|
---|
21 | this->reboundForce = _reboundForce;
|
---|
22 | }
|
---|
23 |
|
---|
24 | void 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 |
|
---|
35 | void UniversalWeapon::initWeapon()
|
---|
36 | {
|
---|
37 | }
|
---|
38 |
|
---|
39 | void UniversalWeapon::doFire()
|
---|
40 | {
|
---|
41 | }
|
---|
42 |
|
---|
43 | Node* 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 | } |
---|