Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2007, 5:15:00 PM (19 years ago)
Author:
patrick
Message:

now npcs should be able to shoot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ai/src/world_entities/npcs/npc_test.cc

    r10263 r10268  
    3131#include "playable.h"
    3232
     33#include "weapons/test_gun.h"
     34#include "weapons/turret.h"
     35#include "weapons/cannon.h"
     36
     37
    3338#include "class_id_DEPRECATED.h"
    3439
     
    4550    this->loadParams(root);
    4651
     52  Weapon* wpRight = new TestGun(0);
     53  wpRight->setName("testGun Right");
     54  Weapon* wpLeft = new TestGun(1);
     55  wpLeft->setName("testGun Left");
     56  //Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_CANNON));
    4757
     58  //cannon->setName("BFG");
     59
     60  this->addWeapon(wpLeft, 1, 0);
     61  this->addWeapon(wpRight,1 ,1);
     62  //this->addWeapon(cannon, 0, 6);
     63
     64  this->getWeaponManager().changeWeaponConfig(1);
    4865  // create the weapons and their manager
     66
     67  this->setHealthMax(100);
     68  this->setHealth(80);
     69
     70  this->getWeaponManager().setSlotCount(7);
     71
     72  this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0));
     73  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     74
     75  this->getWeaponManager().setSlotPosition(1, Vector(-2.6, .1, 3.0));
     76  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     77
     78  this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
     79  this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
     80
     81  this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
     82  this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
     83
     84  this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
     85  this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
     86
     87  this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
     88  this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
     89  //
     90  this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
     91  this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     92  //
     93  //   this->getWeaponManager().setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
     94  //   this->getWeaponManager().setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
     95  //
     96  //   this->getWeaponManager().setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
     97  //   this->getWeaponManager().setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
     98
     99  this->getWeaponManager().getFixedTarget()->setParent(this);
     100  this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0);
    49101
    50102}
Note: See TracChangeset for help on using the changeset viewer.