/TGame/TCommon/Gene/Status/GEDOT.h
http://awoe.googlecode.com/ · C Header · 87 lines · 40 code · 18 blank · 29 comment · 0 complexity · 1c5c208784a8f9dbdcadfc012c4c43de MD5 · raw file
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- // GEDOT.h
- // 2010?1?20?
- // Copyright ?2007, 2010, 8DWorld, Inc. All rights reserved.
- //
- //
- ///////////////////////////////////////////////////////////////////////////////////////////////////
-
- #ifndef GEDOT_H
- #define GEDOT_H
-
- #include "GEStatus.h"
- #include "Combat/CombatSysIf.h"
-
-
- /**
- * GEDOT provide ability to maintain a durable state.
- * when attached it call a state responser : state enter,
- * when detached it call a state responser : state exit,
- *
- */
- class TCOM_API GEDOT : public GEStatus
- {
- public:
- enum
- {
- ArgIdx_IntervalTime = GEStatus::ArgIdx_StateID + 1,
- ArgIdx_FullBaseDamage,
- };
-
- GEDOT();
-
- //
- // Fire when the gene is attached on a unit. just like unit enter the state.
- //
- virtual bool onAttach();
-
-
- //
- // Periodically update gene logic, normally a gene will be detach when run out of its time to live.
- //
- virtual bool onUpdate(int nElapse);
-
- protected:
-
- //
- // Update Full Damage of current DOT base on static data and other modifiers
- //
- virtual bool CalculateDamage(int& nD);
-
- int m_nDamageRemain;
- int m_nDamagePerTime; // damage per time
- int m_nTimeInterval;
- int m_nTimeNextDamage;
- };
-
- class TCOM_API GEDOT_Element : public GEDOT
- {
- public:
- enum
- {
- ArgIdx_DamageRatio_OnElement = ArgIdx_FullBaseDamage + 1
- };
-
- GEDOT_Element(short nElemID = Combat::CBP_Fire);
-
- //
- // Fire just after the gene is created, just override this function to have
- // you specific gene initialize logic.
- //
- virtual bool onInit(IGeneCreateData& createData);
-
- //
- // Fire when the gene is attached on a unit. just like unit enter the state.
- //
- virtual bool onAttach();
- protected:
- virtual bool CalculateDamage(int& nD);
-
- int m_nTheCaster; // the one who cast DOT on me
- short m_nTheElementValue;
- short m_nDamageRatioOnElement;
- short m_nWhichElement;
- };
-
-
- #endif // GEDOT_H