Demo entry 5862227

test

   

Submitted by anonymous on Jul 27, 2016 at 07:46
Language: C++. Code size: 4.4 kB.

#ifndef _AchievementManager_H_
#define _AchievementManager_H_
	
#include "Player.h"

enum TASKTYPE
{
	Task0 = 0,//市政中心升级
	Task1 = 1,//金币仓库升级
	Task2 = 2,//水晶仓库升级
	Task3 = 3,//战斗力
	Task4 = 4,//大富豪
	Task5 = 5,//水晶宝藏
	Task6 = 6,//副本之谜
	Task7 = 7,//副本达人
	Task8 = 8,//战绩剽悍
	Task9 = 9,//失败代言人
	Task10 = 10,//超能英雄
	Task11 = 11,//神兵天降
	Task12 = 12,//拥有兵种类型
	Task13 = 13,//破坏王
	Task14 = 14,//攻城者
	Task15 = 15,//PK达人
	Task16 = 16,//竞技场
	Task17 = 17,//大魔法师
	Task18 = 18,//英雄眷顾
	Task19 = 19,//战争荣耀
	Task20 = 20,//累计上线

	//以下为每日成就
	Task21 = 21,//登陸獎勵
	Task22 = 22,//參加10次競技場
	Task23 = 23,//成功搶奪30*战斗力金幣
	Task24 = 24,//成功搶奪30*战斗力水晶
	Task25 = 25,//充值送英雄
	Task26 = 26,//充值送英荣誉
	Task27 = 27,//充值送英雄碎片
	Task28 = 28,//QQ好友赞
	Task29 = 29,//进入沙盘
	Task30 = 30,//提升沙盘等级
	Task31 = 31,//完成3次沙盘战斗
	Task32 = 32,//通過精英副本關卡數10
	Task33 = 33,//通過精英關卡3星數量達到10

	Task34 = 34,//三星(请保持游戏在线1分钟)
	Task35 = 35,//三星(成功参加5个副本关卡)
	Task36 = 36,//三星(PVP3次)
	Task37 = 37,//充值送天赋符石
	Task38 = 38,//通過噩梦副本關卡數10
	Task39 = 39,//通過噩梦關卡3星數量達到10
	Task40 = 40,//英雄转生 1阶
	Task41 = 41,//圣器开启
	Task42 = 42,//英雄转生 2阶

	Task50 = 50,//邀请离线超过两天的好友

	//以下为主线任务
	Task100 = 100,
	Task101 = 101,
	Task102 = 102,
	Task103 = 103,
	Task104 = 104,
	Task105 = 105,
	Task106 = 106,
	Task107 = 107,
	Task108 = 108,
	Task109 = 109,
	Task110 = 110,
	Task111 = 111,
	Task112 = 112,
	Task113 = 113,
	Task114 = 114,
	Task115 = 115,
	Task116 = 116,
	Task117 = 117,
	Task118 = 118,
	Task119 = 119,
	Task120 = 120,
	Task121 = 121,
	Task122 = 122,
	Task123 = 123,
	Task124 = 124,
	Task125 = 125,
	Task126 = 126,
	Task127 = 127,
	Task128 = 128,
	Task129 = 129,
	Task130 = 130,
	Task131 = 131,
	Task132 = 132,
	Task133 = 133,
	Task134 = 134,
	Task135 = 135,
	Task136 = 136,
	Task137 = 137,
	Task138 = 138,
	Task139 = 139,
	Task140 = 140,
	Task141 = 141,
	Task142 = 142,
	Task143 = 143,
	Task144 = 144,
	Task145 = 145,
	Task146 = 146,
	Task147 = 147,
	Task148 = 148,
	Task149 = 149,
	Task150 = 150,
	Task151 = 151,
	Task152 = 152,
	Task153 = 153,
	Task154 = 154,
	Task155 = 155,
	Task156 = 156,
	Task157 = 157,
	Task158 = 158,
	Task159 = 159,
	Task160 = 160,
	Task161 = 161,
	Task162 = 162,
	Task163 = 163,
	Task164 = 164,
	Task165 = 165,
	Task166 = 166,
	Task167 = 167,
	Task168 = 168,
	Task169 = 169,
	Task170 = 170,
	Task171 = 171,
	Task172 = 172,
	Task173 = 173,
	Task174 = 174,
	Task175 = 175,
	Task176 = 176,
	Task177 = 177,
	Task178 = 178,
	Task179 = 179,
};

struct TaskLevelInfo
{
	int Crystal;
	int Money;
	int HeroChipNum;//英雄碎片
	int RewardCash;//点卷
	int RewardHonor;//荣誉
	int BuildLevel;
	int BuildID;
	int MaxNum;//需要完成的数量
	int HeroId;
	int SoldierID;
	int SoldierLevelId;
	int MagicId;
	int MagicLevelId;
	int Blue;//蓝宝石
	int Red;//红宝石
	int PropsId;//赠送的道具
	int PropsNum;//赠送的道具数量
};


struct ExtendTaskInfo
{
	int MaxLevel;
	int TaskId;
	int NextTaskId;//主线任务才有下一级
	TaskLevelInfo MainTask;//主线任务信息
	vector <TaskLevelInfo> LevelInfo;
	ExtendTaskInfo()
	{
		MaxLevel = 0;
		NextTaskId = -1;
	}
};

class AchievementManager
{
public:
	void Init();
	void Release();
	static AchievementManager* Instance();
	int InitMainTask(int TaskId, Player * pPlayer);
	void RereshDailyAchievement(Player *pPlayer);
	void InitPlayerAchievement(Player * pPlayer);
	void RespAchievementInfo(Player * pPlayer);
	void RefreshPlayerAchievement(Player * pPlayer, int TaskId);
	eResultHandle RequestGainAchievementAward(MSG_REQUEST_GAINACHIEVEMENTAWARD* pMsg, Player* pPlayer);
	void CheckAchievementTask(int TaskId, Player * pPlayer, int Param = 0);
	void SendAchievementUpdateInfo(unsigned char TaskId, Player * pPlayer);
	void RefreshPlayerMainTask(Player * pPlayer, int TaskId = -1);
	void CompleteMainTask(int TaskId, Player * pPlayer);
	void SamsungOnlineTask(Player * pPlayer);
private:
	map <int,ExtendTaskInfo> m_TaskInfo;//<TaskId,ExtendTaskInfo>
	ExtendTaskInfo * GetTaskInfo(int TaskId);
	TaskLevelInfo* GetTaskLevel(int TaskId, int LevelId);
	void LoadAchievementInfo();
	void LoadMainTaskInfo();
	void LoadSamsungTask();
	bool InitAchievementTask(int TaskId, Player * pPlayer);
	void RereshDailyAchievementSub(Player *pPlayer, int TaskId);
	int GetMainTaskId(Player * pPlayer);
	static AchievementManager* m_This;
	AchievementManager();
	~AchievementManager();
};

#endif

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).