heartbeat.cpp
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:4k
- #include "stdafx.h"
- #include "XmudOS.h"
- #include "ActiveObject.h"
- #include "Condition.h"
- #include "Player.h"
- #include "npcnpc.h"
- extern rmfullglobals myglobs;
- void CActiveObject::DoHeartBeat()
- {
- if(bPlayer) {
- ((CPlayerInfo *)this)->nRound += 1;
- }
- if(nStatus == AOS_dead) return;
- if( nBusy > 0 ) {
- nBusy--;
- if(nBusy <= 0) DoAction();
- }
- nTick--;
- if( nTick > 0 ) return;
- nTick = HEALINGGAP;
- if(bPlayer) {
- ((CPlayerInfo *)this)->Healing();
- }
- }
- void CActiveObject::DoAction()
- {
- CString sResult;
- POSITION pos;
- int nLevel;
- sResult.Empty();
- if(nStatus == AOS_dazuo){
- nStatus = AOS_none;
- EnterCriticalSection(&myglobs.csPlayerData);
- pos = GetConditionPos("DaZuo");
- if (pos != NULL) {
- nEff_force += listcondition.GetAt(pos)->nPower/5;
- if(nEff_force > nMax_force*2) {
- nLevel = GetSkillLevel("BaseForce");
- if(nMax_force >= nLevel * 10) {
- nEff_force = nMax_force*2;
- sResult.Format("%s