📄 effectdecaymotorcycle.cpp
字号:
//----------------------------------------------------------------------//// Filename : EffectDecayMotorcycle.cpp// Written by : Reiot////----------------------------------------------------------------------// include files#include "Assert.h"#include "EffectDecayMotorcycle.h"#include "Gpackets/GCDeleteObject.h"#include "Tile.h"#include "Zone.h"#include "Item.h"#include "ZoneUtil.h"//----------------------------------------------------------------------// constructor//----------------------------------------------------------------------EffectDecayMotorcycle::EffectDecayMotorcycle (Zone* pZone , ZoneCoord_t x , ZoneCoord_t y , Item* pItem , Turn_t delay, bool bDeleteFromDB) throw (Error): Effect(pZone,x,y,pItem,delay) { __BEGIN_TRY Assert(getZone() != NULL); Assert(getTarget() != NULL); //m_ObjectID = pItem->getObjectID(); m_ObjectID = pItem->getObjectID(); m_bDeleteFromDB = bDeleteFromDB; // 辑滚 傈侩 Effect捞促. by sigi. 2002.11.14 m_bBroadcastingEffect = false; __END_CATCH}//----------------------------------------------------------------------// destructor//----------------------------------------------------------------------EffectDecayMotorcycle::~EffectDecayMotorcycle () throw (Error){ __BEGIN_TRY unaffect(m_pZone , m_X , m_Y , m_pTarget); __END_CATCH} //----------------------------------------------------------------------// affect to target// 捞 捞棋飘绰 鸥老俊 辆加登瘤 臼栏骨肺, affect()绰 龋免登瘤 臼绰促.// 恐衬窍搁, target篮 积己磊俊辑 瘤沥登哥, 酒公繁 老档 窍瘤 臼扁 锭巩捞促.//----------------------------------------------------------------------void EffectDecayMotorcycle::affect (Zone* pZone , ZoneCoord_t x , ZoneCoord_t y , Object* pTarget) throw (Error){ __BEGIN_TRY// throw UnsupportedError(); __END_CATCH}//----------------------------------------------------------------------// remove effect from target//----------------------------------------------------------------------void EffectDecayMotorcycle::unaffect (Zone* pZone , ZoneCoord_t x , ZoneCoord_t y , Object* pTarget, Slayer* pSlayer) throw (Error){ __BEGIN_TRY // 棵官弗 谅钎捞绢具 茄促. Assert(isValidZoneCoord(pZone, x, y)); // TempItem 函荐甫 棱绰促. Item* pTempItem = NULL; // 咯扁辑绰 瘤沥 酒捞袍捞 绝阑 荐 乐栏哥, 肚 促弗 酒捞袍捞 初咯 乐阑 荐档 乐促. // 捞 版快绰 坷府瘤澄 酒捞袍苞 瘤陛 泅犁 官蹿俊 乐绰 酒捞袍阑 厚背窍咯 昏力秦具 茄促. // 绝阑 版快绰 公矫窍搁 等促. Tile & tile = pZone->getTile(x, y); if (tile.hasItem()) { pTempItem = tile.getItem(); if (pTempItem != NULL) { // ObjectID啊 鞍促绰 富篮 鞍篮 酒捞袍捞鄂 富捞促. //if (pTempItem->getObjectID() == m_ObjectID) { if (pTempItem->getObjectID() == m_ObjectID) { pZone->deleteItem(pTempItem , x, y); // 酒捞袍捞 荤扼脸促绰 菩哦阑 朝赴促. GCDeleteObject gcDeleteObject; gcDeleteObject.setObjectID(m_ObjectID); pZone->broadcastPacket(x, y , &gcDeleteObject); if (m_bDeleteFromDB) { pTempItem->destroy(); } SAFE_DELETE(pTempItem); } } } // heartbeat矫 EffectDecayMotorcycle捞 贸府等促. 弊 捞饶 促澜 heartbeat矫俊 // 荤侩磊俊霸 坷配官捞甫 龋免秦 林绢具 茄促. // 荤侩磊绰 坷配官捞狼 坷宏璃飘客 //EffectCallMotorcycle* pEffectCallMotorcycle = new EffectCallMotorcycle(pMotorcycleObject, pSlayer); //pTarget = NULL; __END_CATCH}//----------------------------------------------------------------------// unaffect()//----------------------------------------------------------------------void EffectDecayMotorcycle::unaffect () throw (Error){ __BEGIN_TRY __END_CATCH}//----------------------------------------------------------------------// unaffect()//----------------------------------------------------------------------void EffectDecayMotorcycle::unaffect (Creature* pCreature) throw (Error){ __BEGIN_TRY __END_CATCH}//----------------------------------------------------------------------// get debug string//----------------------------------------------------------------------string EffectDecayMotorcycle::toString () const throw (){ StringStream msg; msg << "EffectDecayMotorcycle(" << "ZoneID:" << (int)m_pZone->getZoneID() << ",X:" << (int)getX() << ",Y:" << (int)getY(); if (m_pTarget) msg << ",Target:" << m_pTarget->toString(); else msg << ",Target:NULL"; msg << ",Deadline:" << (int)m_Deadline.tv_sec << "." << (int)m_Deadline.tv_usec; msg << ")"; return msg.toString();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -