/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
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- // GEStance.cpp
- // 2010?1?20?
- // Copyright ?2007, 2010, 8DWorld, Inc. All rights reserved.
- //
- //
- ///////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-
- #include "stdafx.h"
- #include "GEStance.h"
- #include "Entity/EntityIf.h"
- #include "Combat/CombatSysIf.h"
- #include "Gene/GeneCreateDataIf.h"
-
- GEStance::GEStance()
- {
- }
-
- GEStance::~GEStance()
- {
-
- }
-
- bool
- GEStance::onAttach()
- {
- if (!__super::onAttach())
- {
- return false;
- }
-
- //
- // ImmunityElement
- int nKey = m_wpSData->getData( ArgIdx_ImmuneElementType, -1);
- if (nKey!=-1)
- {
- m_wpCombat->addImmunity(nKey);
- }
-
- for (int idx = ArgIdx_ImmuneGeneCategoryStart; idx<ArgIdx_ImmuneGeneCategoryEnd; idx++)
- {
- nKey = m_wpSData->getData( idx, -1);
- if (nKey!=-1)
- {
- m_wpCombat->rmvImmunity(nKey);
- }
- else
- {
- break;
- }
- }
-
- return true;
- }
-
- bool
- GEStance::onDetach()
- {
- __super::onDetach();
-
- //
- // ImmunityElement
- int nKey = m_wpSData->getData( ArgIdx_ImmuneElementType, -1);
- if (nKey!=-1)
- {
- m_wpCombat->rmvImmunity(nKey);
- }
-
- for (int idx = ArgIdx_ImmuneGeneCategoryStart; idx<ArgIdx_ImmuneGeneCategoryEnd; idx++)
- {
- nKey = m_wpSData->getData( idx, -1);
- if (nKey!=-1)
- {
- m_wpCombat->rmvImmunity(nKey);
- }
- else
- {
- break;
- }
- }
-
- return true;
- }