Clone of PhatAC @ https://github.com/floaterxk/PhatAC

Lifestone.cpp 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include "StdAfx.h"
  2. #include "PhysicsObj.h"
  3. #include "Lifestone.h"
  4. CBaseLifestone::CBaseLifestone()
  5. {
  6. m_wTypeID = 0x1FD;
  7. m_wIcon = 0x1355;
  8. m_ItemType = TYPE_LIFESTONE;
  9. m_strName = "Life Stone";
  10. m_WeenieBitfield |= BF_LIFESTONE;
  11. m_dwModel = 0x020002EE;
  12. m_dwSoundSet = 0x20000014;
  13. m_dwAnimationSet = 0x09000026;
  14. m_fScale = 1.0f;
  15. m_PhysicsState = PhysicsState::GRAVITY_PS | PhysicsState::IGNORE_COLLISIONS_PS;
  16. m_Usability = USEABLE_REMOTE;
  17. m_UseDistance = LIFESTONE_MAX_BIND_DISTANCE;
  18. m_RadarVis = ShowAlways_RadarEnum;
  19. m_BlipColor = 1;
  20. }
  21. CBaseLifestone::~CBaseLifestone()
  22. {
  23. }
  24. void CBaseLifestone::Precache()
  25. {
  26. // Load entity settings (location, and dynamic properties.)
  27. }
  28. void CBaseLifestone::Use(CPhysicsObj *pOther)
  29. {
  30. // should check approach distance in a parent toggle class
  31. if (Animation_IsActive())
  32. return;
  33. if (pOther->IsPlayer())
  34. {
  35. if ((Vector(pOther->m_Origin) - Vector(m_Origin)).Length() < m_UseDistance)
  36. {
  37. pOther->Animation_PlaySimpleAnimation(87, 1.0f, 5.0f, ANIM_BINDLIFESTONE, m_dwGUID);
  38. }
  39. }
  40. }