/TGame/TCommon/Gene/Status/GECharm.cpp
http://awoe.googlecode.com/ · C++ · 53 lines · 40 code · 6 blank · 7 comment · 7 complexity · 9cb18974042345b26af0602a1bc99414 MD5 · raw file
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- // GECharm.cpp
- // 2010?1?20?
- // Copyright ?2007, 2010, 8DWorld, Inc. All rights reserved.
- //
- //
- ///////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-
- #include "stdafx.h"
- #include "GECharm.h"
- #include "Entity/EntityIf.h"
- #include "Combat/CombatSysIf.h"
- #include "Gene/GeneCreateDataIf.h"
-
- GECharm::GECharm()
- {
- }
- bool
- GECharm::onAttach()
- {
- if (!__super::onAttach())
- {
- return false;
- }
-
- if (m_wpHost->getType()==Entity::ett_Monster)
- {
- m_wpCombat->setFaction(Combat::FC_Player);
- }
- else if (m_wpHost->getType()==Entity::ett_Player)
- {
- m_wpCombat->setState(Combat::CBS_Forbidden);
- m_wpHost->setMoveState(Move::mst_Freeze);
- }
- return true;
- }
-
- bool
- GECharm::onDetach()
- {
- if (m_wpHost->getType()==Entity::ett_Monster)
- {
- m_wpCombat->setFaction(Combat::FC_Player);
- }
- else if (m_wpHost->getType()==Entity::ett_Player)
- {
- m_wpCombat->setState(Combat::CBS_Ready);
- m_wpHost->setMoveState(Move::mst_Idle);
- }
- return __super::onDetach();
- }