pet.h
1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#pragma once
#include <common.h>
#include <common_msg.pb.h>
class user_t;
class pet_mgr_t
{
public:
pet_mgr_t();
user_t* user;
std::map<PET_ID, share_msg::pet_t> pet_map;
void add( share_msg::pet_t& pet );
void update( share_msg::pet_t& pet );
share_msg::pet_t* find(PET_ID pet_id);
};
struct pet_lv_data_t {
uint32_t ack;
uint32_t def;
uint32_t ai;
pet_lv_data_t(){
this->ack = 0;
this->def = 0;
this->ai = 0;
}
};
struct pet_cfg_t{
PET_ID id;
uint32_t star;
uint32_t attr;
uint32_t hide_turntable;
SKILL_ID skill_id;
std::map<uint32_t, pet_lv_data_t> pet_lv_data_map;
pet_cfg_t();
};
struct pet_cfg_mgr_t
{
bool load_cfg();
void init();
bool check_cfg();
std::map<PET_ID, pet_cfg_t> pet_cfg_map;//key:id
std::map<uint32_t, std::map<uint32_t, uint32_t>> exp_level_val_map;
std::map<uint32_t, uint32_t> exp_max_map;
std::map<PET_STAR, PET_CNT> star_pet_cnt_map;
std::map<uint32_t, uint32_t> duanwei_exp_level_map;
std::map<uint32_t, uint32_t> chenghao_exp_level_map;
std::map<uint32_t, std::vector<share_msg::item_t>> duanwei_lv_reward_map;
std::map<uint32_t, std::vector<share_msg::item_t>> chenghao_lv_reward_map;
uint32_t btl_cnt;
std::vector<uint32_t> cd_vec;
pet_cfg_t* find(PET_ID id);
std::map<uint32_t, uint32_t>* find_exp(uint32_t star);
uint32_t find_exp_max( PET_ID id );
PET_CNT find_pet_cnt(PET_STAR star);
uint32_t gen_level(PET_ID id, uint32_t exp_val);
uint32_t max_level();
uint32_t get_duanwei_level(uint32_t exp);
uint32_t get_chenghao_level(uint32_t pet_cnt);
std::map<uint32_t, std::vector<share_msg::item_t>> no_reward_map;
};
extern pet_cfg_mgr_t* g_pet_cfg_mgr;
extern uint32_t g_pet_max_level;