Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "bolt.h"
  3. #include "ParticlesObject.h"
  4. #include "../xrphysics/PhysicsShell.h"
  5. #include "xr_level_controller.h"
  6.  
  7. CBolt::CBolt(void)
  8. {
  9. m_thrower_id =u16(-1);
  10. }
  11.  
  12. CBolt::~CBolt(void)
  13. {
  14. }
  15.  
  16. void CBolt::OnH_A_Chield()
  17. {
  18. inherited::OnH_A_Chield();
  19. CObject* o= H_Parent()->H_Parent();
  20. if(o)SetInitiator(o->ID());
  21.  
  22. }
  23.  
  24. void CBolt::Throw()
  25. {
  26. CMissile *l_pBolt = smart_cast<CMissile*>(m_fake_missile);
  27. if(!l_pBolt) return;
  28. l_pBolt->set_destroy_time (u32(m_dwDestroyTimeMax/phTimefactor));
  29. inherited::Throw ();
  30. spawn_fake_missile ();
  31. }
  32.  
  33. bool CBolt::Useful() const
  34. {
  35. return false;
  36. }
  37.  
  38. bool CBolt::Action(u16 cmd, u32 flags)
  39. {
  40. if(inherited::Action(cmd, flags)) return true;
  41. /*
  42. switch(cmd)
  43. {
  44. case kDROP:
  45. {
  46. if(flags&CMD_START)
  47. {
  48. m_throw = false;
  49. if(State() == MS_IDLE) State(MS_THREATEN);
  50. }
  51. else if(State() == MS_READY || State() == MS_THREATEN)
  52. {
  53. m_throw = true;
  54. if(State() == MS_READY) State(MS_THROW);
  55. }
  56. }
  57. return true;
  58. }
  59. */
  60. return false;
  61. }
  62.  
  63. void CBolt::activate_physic_shell ()
  64. {
  65. inherited::activate_physic_shell ();
  66. m_pPhysicsShell->SetAirResistance (.0001f);
  67. }
  68.  
  69. void CBolt::SetInitiator (u16 id)
  70. {
  71. m_thrower_id=id;
  72. }
  73. u16 CBolt::Initiator ()
  74. {
  75. return m_thrower_id;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement