//返回正在使用的xp技能 // public short GetXPMagic() { return xp_magicid; } private void ProcXPVal() { if (play.IsDie() || this.QueryStatus(GameStruct.RoleStatus.STATUS_XPFULL) != null) { mnXpVal = 0; //XP消失时间已到 if (mXpTime.ToNextTime()) { mXpTime.SetInterval(Define.XP_ADD_SECS); this.DeleteStatus(GameStruct.RoleStatus.STATUS_XPFULL); play.ChangeAttribute(GameStruct.UserAttribute.XP, mnXpVal); } return; } //定时恢复xp if (mXpTime.ToNextTime() && this.QueryStatus(GameStruct.RoleStatus.STATUS_XPFULL) == null && this.QueryStatus(GameStruct.RoleStatus.STATUS_XPFULL_ATTACK) == null) { mnXpVal += Define.XP_ADD_VALUE; if (mnXpVal > Define.XP_MAX_USER) { mnXpVal = Define.XP_MAX_USER; } play.ChangeAttribute(GameStruct.UserAttribute.XP, mnXpVal); //XP满- 爆气 if (mnXpVal >= Define.XP_MAX_USER) { this.AddStatus(GameStruct.RoleStatus.STATUS_XPFULL, Define.XP_MAX_FULL_SECS); mnXpVal = 0; mXpTime.SetInterval(Define.XP_DROP_FULL_SECS); } } }
public MonsterObject(uint _id,int nAi_Id,short x,short y,bool isCreateTypeId = true) { mTarget = null; id = _id; type = OBJECTTYPE.MONSTER; attr = new GameStruct.MonterAttribute(); mRebirthTime = 1000; //默认复活时间 if (isCreateTypeId) { typeid = IDManager.CreateTypeId(type); } mInitPoint = new GameStruct.Point(); mInitPoint.x = x; mInitPoint.y = y; m_Ai = CreateAi(nAi_Id); mnDieMagicTick = System.Environment.TickCount; mDieMagicInfo = null; attr.life = attr.life_max = 0; mAliveTime = new GameBase.Core.TimeOut(); mAliveTime.SetInterval(mRebirthTime); this.SetPoint(x, y); // ai = new AI.BaseAI(this); Alive(); }
public MonsterObject(uint _id, int nAi_Id, short x, short y, bool isCreateTypeId = true) { mTarget = null; id = _id; type = OBJECTTYPE.MONSTER; attr = new GameStruct.MonterAttribute(); mRebirthTime = 1000; //默认复活时间 if (isCreateTypeId) { typeid = IDManager.CreateTypeId(type); } mInitPoint = new GameStruct.Point(); mInitPoint.x = x; mInitPoint.y = y; m_Ai = CreateAi(nAi_Id); mnDieMagicTick = System.Environment.TickCount; mDieMagicInfo = null; attr.life = attr.life_max = 0; mAliveTime = new GameBase.Core.TimeOut(); mAliveTime.SetInterval(mRebirthTime); this.SetPoint(x, y); // ai = new AI.BaseAI(this); Alive(); }
public PlayerPK(PlayerObject _play) { play = _play; mDecTime = new GameBase.Core.TimeOut(); mDecTime.SetInterval(Define.PK_DEC_TIME); mnNameType = GetNameType(); }
public ScriptTimerManager() { mListInfo = new List<ScriptTimerInfo>(); mClearTagTick = System.Environment.TickCount; mRunTick = System.Environment.TickCount; mListPlayTimeOut = new List<PlayTimeOut>(); mPlayTimeOut = new GameBase.Core.TimeOut(); mPlayTimeOut.SetInterval(1000); mPlayTimeOut.Update(); }
private int mnNameType; //玩家PK状态 public PlayerPK(PlayerObject _play) { play = _play; mDecTime = new GameBase.Core.TimeOut(); mDecTime.SetInterval(Define.PK_DEC_TIME); mnNameType = GetNameType(); }
public ScriptTimerManager() { mListInfo = new List <ScriptTimerInfo>(); mClearTagTick = System.Environment.TickCount; mRunTick = System.Environment.TickCount; mListPlayTimeOut = new List <PlayTimeOut>(); mPlayTimeOut = new GameBase.Core.TimeOut(); mPlayTimeOut.SetInterval(1000); mPlayTimeOut.Update(); }
public PlayerMagic(PlayerObject _play) { play = _play; mDicMagic = new Dictionary<uint, GameStruct.RoleMagicInfo>(); mNormalAttackSpeed = new GameBase.Core.TimeOut(); mNormalAttackSpeed.SetInterval(GameBase.Config.Define.ROLE_ATTACK_SPEED); mNormalAttackSpeed.Update(); mMoveSpeed = new GameBase.Core.TimeOut(); mMoveSpeed.SetInterval(GameBase.Config.Define.ROLE_MOVE_SPEED); mMoveSpeed.Update(); mMagicAttackSpeed = new List<GameBase.Core.TimeOut>(); }
public PlayerMagic(PlayerObject _play) { play = _play; mDicMagic = new Dictionary <uint, GameStruct.RoleMagicInfo>(); mNormalAttackSpeed = new GameBase.Core.TimeOut(); mNormalAttackSpeed.SetInterval(GameBase.Config.Define.ROLE_ATTACK_SPEED); mNormalAttackSpeed.Update(); mMoveSpeed = new GameBase.Core.TimeOut(); mMoveSpeed.SetInterval(GameBase.Config.Define.ROLE_MOVE_SPEED); mMoveSpeed.Update(); mMagicAttackSpeed = new List <GameBase.Core.TimeOut>(); }
public bool CheckMagicAttackSpeed(ushort magicid, byte magiclv) { GameStruct.MagicTypeInfo type = ConfigManager.Instance().GetMagicTypeInfo(magicid, magiclv); if (type == null) { return(false); } if (type.delay_ms == 0) { return(true); } bool bFind = false; bool bError = false; GameBase.Core.TimeOut time = null; for (int i = 0; i < mMagicAttackSpeed.Count; i++) { time = mMagicAttackSpeed[i]; if ((ushort)time.GetObject() == magicid) { if (time.ToNextTime()) { bFind = true; break; } else { bError = true; } } } //把其他的技能施法速度更新一遍 for (int i = 0; i < mMagicAttackSpeed.Count; i++) { mMagicAttackSpeed[i].Update(); } if (!bFind && bError == false) { time = new GameBase.Core.TimeOut(); time.SetInterval(type.delay_ms); time.SetObject(magicid); time.Update(); mMagicAttackSpeed.Add(time); return(true); } return(bFind); }
public MingGuoShengNv(PlayerObject _play, short x, short y, byte dir, uint _id, int nAi_Id) : base(_id, nAi_Id, x, y, false) { type = OBJECTTYPE.CALLOBJECT; typeid = IDManager.CreateTypeId(OBJECTTYPE.GUARDKNIGHT); SetPoint(x, y); mRebirthTime = 0;//不允许复活 mPlay = _play; SetDir(dir); mnRefreshTick = System.Environment.TickCount; mMagicAttackTime = new GameBase.Core.TimeOut(); mMagicAttackTime.SetInterval(5); }
public MingGuoShengNv(PlayerObject _play, short x, short y, byte dir, uint _id, int nAi_Id) : base(_id, nAi_Id,x,y, false) { type = OBJECTTYPE.CALLOBJECT; typeid = IDManager.CreateTypeId(OBJECTTYPE.GUARDKNIGHT); SetPoint(x, y); mRebirthTime = 0;//不允许复活 mPlay = _play; SetDir(dir); mnRefreshTick = System.Environment.TickCount; mMagicAttackTime = new GameBase.Core.TimeOut(); mMagicAttackTime.SetInterval(5); }
public PlayerTimer(PlayerObject _play) { mi64Effect = 0; mi64EffectEx = 0; play = _play; mXpTime = new GameBase.Core.TimeOut(); mXpTime.SetInterval(Define.XP_ADD_SECS); mXpTime.Update(); mnXpVal = 0; mSPTime = new GameBase.Core.TimeOut(); mSPTime.SetInterval(Define.SP_ADD_SECS); mSPTime.Update(); mListStatus = new List <GameStruct.RoleStatus>(); mObject_CALL = null; }
public PlayerTimer(PlayerObject _play) { mi64Effect = 0; mi64EffectEx = 0; play = _play; mXpTime = new GameBase.Core.TimeOut(); mXpTime.SetInterval(Define.XP_ADD_SECS); mXpTime.Update(); mnXpVal = 0; mSPTime = new GameBase.Core.TimeOut(); mSPTime.SetInterval(Define.SP_ADD_SECS); mSPTime.Update(); mListStatus = new List<GameStruct.RoleStatus>(); mObject_CALL = null; }
public EudemonObject(RoleData_Eudemon info,PlayerObject _play) { type = OBJECTTYPE.EUDEMON; mInfo = info; play = _play; mPlayObject = new Dictionary<uint, PlayerObject>(); typeid = info.GetTypeID(); mMonsterInfo = EudemonObject.GetMonsterInfo(play, info.itemid); mbIsCombo = false; mAttackSpeed = new GameBase.Core.TimeOut(); mAttackSpeed.SetInterval(GameBase.Config.Define.ROLE_ATTACK_SPEED); mAttackSpeed.Update(); mMagicAttackSpeed = new List<GameBase.Core.TimeOut>(); this.SetRiding(false); this.SetState(EUDEMONSTATE.NROMAL); }
//设置移动速度-- 因为玩家有跑步与骑乘 public void SetMoveSpeed(float fSpeed) { mMoveSpeed.SetInterval(fSpeed); mMoveSpeed.Update(); }
public void Run() { AutoAttack(); //法师- 凝聚流星陨火 if (play.GetJob() == JOB.MAGE) { if (play.GetMagicSystem().IsLiuXingYunHuo() && mnLiuXingYunHuoCount < Define.LIUXINGYUNHUO_MAX_COUNT && play.GetTimerSystem().QueryStatus(GameStruct.RoleStatus.STATUS_YUANSUZHANGKONG) != null) { if (mLiuXingYunHuoTime == null) { mLiuXingYunHuoTime = new GameBase.Core.TimeOut(); mLiuXingYunHuoTime.SetInterval(Define.LIUXINGYUNHUO_TIME); mnLiuXingYunHuoCount++; play.ChangeAttribute(UserAttribute.LIUXINGYUNHUO, mnLiuXingYunHuoCount); } if (mLiuXingYunHuoTime.ToNextTime()) { mnLiuXingYunHuoCount++; play.ChangeAttribute(UserAttribute.LIUXINGYUNHUO, mnLiuXingYunHuoCount); } } } }
public bool CheckMagicAttackSpeed(ushort magicid, byte magiclv) { GameStruct.MagicTypeInfo type = ConfigManager.Instance().GetMagicTypeInfo(magicid, magiclv); if (type == null) return false; if (type.delay_ms == 0) return true; bool bFind = false; bool bError = false; GameBase.Core.TimeOut time = null; for (int i = 0; i < mMagicAttackSpeed.Count; i++) { time = mMagicAttackSpeed[i]; if ((ushort)time.GetObject() == magicid) { if (time.ToNextTime()) { bFind = true; break; } else bError = true; } } //把其他的技能施法速度更新一遍 for (int i = 0; i < mMagicAttackSpeed.Count; i++) { mMagicAttackSpeed[i].Update(); } if (!bFind && bError == false) { time = new GameBase.Core.TimeOut(); time.SetInterval(type.delay_ms); time.SetObject(magicid); time.Update(); mMagicAttackSpeed.Add(time); return true; } return bFind; }