/TGame/TCommon/Gene/Status/GEStance.cpp

http://awoe.googlecode.com/ · C++ · 85 lines · 60 code · 14 blank · 11 comment · 7 complexity · 64241e5324177ae1662d83a7c04b9ebe MD5 · raw file

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // GEStance.cpp
  3. // 2010?1?20?
  4. // Copyright ?2007, 2010, 8DWorld, Inc. All rights reserved.
  5. //
  6. //
  7. ///////////////////////////////////////////////////////////////////////////////////////////////////
  8. #include "stdafx.h"
  9. #include "GEStance.h"
  10. #include "Entity/EntityIf.h"
  11. #include "Combat/CombatSysIf.h"
  12. #include "Gene/GeneCreateDataIf.h"
  13. GEStance::GEStance()
  14. {
  15. }
  16. GEStance::~GEStance()
  17. {
  18. }
  19. bool
  20. GEStance::onAttach()
  21. {
  22. if (!__super::onAttach())
  23. {
  24. return false;
  25. }
  26. //
  27. // ImmunityElement
  28. int nKey = m_wpSData->getData( ArgIdx_ImmuneElementType, -1);
  29. if (nKey!=-1)
  30. {
  31. m_wpCombat->addImmunity(nKey);
  32. }
  33. for (int idx = ArgIdx_ImmuneGeneCategoryStart; idx<ArgIdx_ImmuneGeneCategoryEnd; idx++)
  34. {
  35. nKey = m_wpSData->getData( idx, -1);
  36. if (nKey!=-1)
  37. {
  38. m_wpCombat->rmvImmunity(nKey);
  39. }
  40. else
  41. {
  42. break;
  43. }
  44. }
  45. return true;
  46. }
  47. bool
  48. GEStance::onDetach()
  49. {
  50. __super::onDetach();
  51. //
  52. // ImmunityElement
  53. int nKey = m_wpSData->getData( ArgIdx_ImmuneElementType, -1);
  54. if (nKey!=-1)
  55. {
  56. m_wpCombat->rmvImmunity(nKey);
  57. }
  58. for (int idx = ArgIdx_ImmuneGeneCategoryStart; idx<ArgIdx_ImmuneGeneCategoryEnd; idx++)
  59. {
  60. nKey = m_wpSData->getData( idx, -1);
  61. if (nKey!=-1)
  62. {
  63. m_wpCombat->rmvImmunity(nKey);
  64. }
  65. else
  66. {
  67. break;
  68. }
  69. }
  70. return true;
  71. }