This commit is contained in:
aozhiwei 2019-07-06 17:03:39 +08:00
parent bf6033f55b
commit 42080ff330
5 changed files with 177 additions and 144 deletions

View File

@ -161,6 +161,15 @@ enum EntitySubType_e
EST_Android = 2,
};
enum BuffTriggerType_e
{
BTT_UseSkill = 1, //技能释放时触发
BTT_Kill = 2, //击杀敌方后触发
BTT_SkillHit = 3, //技能命中触发
BTT_OtherBuff = 4,//其他buff触发
BTT_UseItem = 6 //使用道具触发
};
const char* const PROJ_NAME_FMT = "game%d_gameserver";
const char* const PROJ_ROOT_FMT = "/data/logs/%s";

View File

@ -641,6 +641,7 @@ bool Human::HasNoDownedTeammate()
void Human::DoSkill()
{
if (skill_meta && GetSkillLeftTime() <= 0) {
TriggerBuff(BTT_UseSkill);
}
}
@ -1307,6 +1308,11 @@ int Human::GetSkillCd()
return skill_meta ? skill_meta->i->skill_cd() * 1000 : 0;
}
void Human::TriggerBuff(BuffTriggerType_e trigger_type)
{
}
void Human::_UpdateMove(int speed)
{
for (int i = 0; i < speed; ++i) {

View File

@ -192,6 +192,7 @@ class Human : public Entity
int SkinLv();
int GetSkillLeftTime();
int GetSkillCd();
void TriggerBuff(BuffTriggerType_e trigger_type);
protected:
void _UpdateMove(int speed);

View File

@ -2,256 +2,273 @@ package metatable;
message MFPair
{
optional int32 key = 1; //key
optional int32 value = 2; //val
required int32 key = 1; //key
required int32 value = 2; //val
}
message Parameter
{
optional string param_name = 1;
optional string param_value = 2;
required string param_name = 1;
required string param_value = 2;
}
message Attr
{
optional int32 attr_id = 1;
optional string attr_cname = 2;
optional string attr_ename = 3;
required int32 attr_id = 1;
required string attr_cname = 2;
required string attr_ename = 3;
}
message Map
{
optional int32 map_id = 1; //id
optional string template_list = 2; //
optional string map_name = 3; //
required int32 map_id = 1; //id
required string template_list = 2; //
required string map_name = 3; //
}
message MapThing
{
optional int32 thing_id = 1; //id
optional int32 type = 2; //
optional int32 height = 3; //
optional int32 width = 4; //
optional int32 hp = 5; //
optional float damage = 6; //
optional float damage_dia = 7; //
optional int32 drop = 8; //
optional int32 attack_type = 9; // 0: 1 2穿
required int32 thing_id = 1; //id
required int32 type = 2; //
required int32 height = 3; //
required int32 width = 4; //
required int32 hp = 5; //
required float damage = 6; //
required float damage_dia = 7; //
required int32 drop = 8; //
required int32 attack_type = 9; // 0: 1 2穿
}
message SafeArea
{
optional int32 id = 1; //id
optional int32 level = 2; //
optional int32 rad = 3; //
optional int32 wait_time = 4; //
optional int32 shrink_speed = 5; //
optional int32 hurt = 6; ///
required int32 id = 1; //id
required int32 level = 2; //
required int32 rad = 3; //
required int32 wait_time = 4; //
required int32 shrink_speed = 5; //
required int32 hurt = 6; ///
}
message Item
{
optional int32 id = 1; //id
required int32 id = 1; //id
}
message Equip
{
optional int32 id = 1; //id
optional int32 equip_type = 2; //
optional int32 equip_subtype = 3; //
// optional int32 equip_lv = 4; //
//optional int32 fire_mode = 5; //
//optional int32 use_bullet = 6; //使
optional int32 clip_volume = 7; //
optional int32 reload_time = 8; //
optional int32 fire_rate = 9; //
optional int32 atk = 10; //
//optional int32 def = 11; //
optional int32 explosion_range = 12; //
optional int32 bullet_speed = 13; //
optional int32 range = 14; //
//optional int32 use_time = 15; //使
optional int32 heal = 16; //
optional int32 time = 17; //
//optional string volume = 19; //
optional int32 bullet_rad = 20; //
//optional int32 group_num = 21; //
//optional int32 is_luck = 22; //
optional string bullet_born_offset = 30; //
optional float bullet_angle = 34; //
optional string name = 35; //
required int32 id = 1; //id
required int32 equip_type = 2; //
required int32 equip_subtype = 3; //
// required int32 equip_lv = 4; //
//required int32 fire_mode = 5; //
//required int32 use_bullet = 6; //使
required int32 clip_volume = 7; //
required int32 reload_time = 8; //
required int32 fire_rate = 9; //
required int32 atk = 10; //
//required int32 def = 11; //
required int32 explosion_range = 12; //
required int32 bullet_speed = 13; //
required int32 range = 14; //
//required int32 use_time = 15; //使
required int32 heal = 16; //
required int32 time = 17; //
//required string volume = 19; //
required int32 bullet_rad = 20; //
//required int32 group_num = 21; //
//required int32 is_luck = 22; //
required string bullet_born_offset = 30; //
required float bullet_angle = 34; //
required string name = 35; //
//optional string inventory_slot = 31; //
//optional int32 _inventory_slot = 32; //
//required string inventory_slot = 31; //
//required int32 _inventory_slot = 32; //
}
message EquipUpgrade
{
optional int32 id = 1;
optional string attr_type = 4;
optional int32 max_lv = 5;
required int32 id = 1;
required string attr_type = 4;
required int32 max_lv = 5;
}
message Player
{
optional int32 id = 1; //id
optional float radius = 2; //
optional int32 health = 3; //
optional int32 move_speed = 4; //
optional int32 jump_speed = 5; //
optional int32 move_speed3 = 6;
optional int32 shot_speed = 7;
optional int32 move_speed4 = 10; //4
optional float def = 11; //
optional string volume = 12; //
required int32 id = 1; //id
required float radius = 2; //
required int32 health = 3; //
required int32 move_speed = 4; //
required int32 jump_speed = 5; //
required int32 move_speed3 = 6;
required int32 shot_speed = 7;
required int32 move_speed4 = 10; //4
required float def = 11; //
required string volume = 12; //
}
message Robot
{
optional int32 id = 1;
optional string name = 2;
optional int32 skin = 3;
optional int32 weapon_id = 4;
optional int32 weapon_lv = 5;
required int32 id = 1;
required string name = 2;
required int32 skin = 3;
required int32 weapon_id = 4;
required int32 weapon_lv = 5;
}
message Skill
{
optional int32 skill_id = 1;
optional int32 skill_type = 2;
optional int32 skill_effect_id = 3;
optional string value = 4;
optional string value_up = 6;
optional int32 skill_cd = 7;
optional int32 skill_target = 8;
optional string buff_list = 9;
required int32 skill_id = 1;
required int32 skill_type = 2;
required int32 skill_effect_id = 3;
required string value = 4;
required string value_up = 6;
required int32 skill_cd = 7;
required int32 skill_target = 8;
required string buff_list = 9;
required float skill_distance = 10;
optional int32 phase1_time_offset = 20;
optional string phase1_func = 21;
optional string phase1_param1 = 22;
optional string phase1_param2 = 23;
optional int32 phase2_time_offset = 30;
optional string phase2_func = 31;
optional string phase2_param1 = 32;
optional string phase2_param2 = 33;
optional int32 phase3_time_offset = 40;
optional string phase3_func = 41;
optional string phase3_param1 = 42;
optional string phase3_param2 = 43;
}
message Buff
{
optional int32 buff_id = 1;
optional int32 buff_target = 2;
optional int32 buff_effect = 3;
optional int32 trigger_type = 4;
optional int32 trigger_chance = 5;
optional string buff_param1 = 6;
optional string buff_param2 = 7;
optional string buff_param3 = 8;
optional int32 duration_time = 9;
required int32 buff_id = 1;
required int32 buff_target = 2;
required int32 buff_effect = 3;
required int32 trigger_type = 4;
required int32 trigger_chance = 5;
required string buff_param1 = 6;
required string buff_param2 = 7;
required string buff_param3 = 8;
required int32 duration_time = 9;
}
message Drop
{
optional int32 drop_id = 1;
optional string item_id = 2;
optional string num = 3;
optional string weight = 4;
optional int32 type = 5;
required int32 drop_id = 1;
required string item_id = 2;
required string num = 3;
required string weight = 4;
required int32 type = 5;
}
message AirDrop
{
optional int32 id = 1;
optional int32 time = 2;
optional int32 appear_time = 3;
optional int32 drop_id = 4;
required int32 id = 1;
required int32 time = 2;
required int32 appear_time = 3;
required int32 drop_id = 4;
}
message AirLine
{
optional int32 id = 1;
optional string start_point = 2;
optional string end_point = 3;
optional float plane_speed = 4;
optional int32 weight = 5;
required int32 id = 1;
required string start_point = 2;
required string end_point = 3;
required float plane_speed = 4;
required int32 weight = 5;
}
message Dress
{
optional int32 id = 1;
optional int32 level = 2;
optional int32 skill_id = 3;
optional string attr_type = 4;
optional int32 max_lv = 5;
required int32 id = 1;
required int32 level = 2;
required int32 skill_id = 3;
required string attr_type = 4;
required int32 max_lv = 5;
}
message RankReward
{
optional int32 rank = 1;
optional float parameter = 2;
required int32 rank = 1;
required float parameter = 2;
}
message KillReward
{
optional int32 kill_num = 1;
optional float parameter = 2;
required int32 kill_num = 1;
required float parameter = 2;
}
message Tank
{
optional int32 id = 1;
optional int32 bullet_id = 2;
optional int32 max_lv = 3;
required int32 id = 1;
required int32 bullet_id = 2;
required int32 max_lv = 3;
}
//end
message DoorObjJson
{
optional float height = 1;
optional float width = 2;
optional float x = 3;
optional float y = 4;
optional int32 type = 5;
optional int32 id = 6;
required float height = 1;
required float width = 2;
required float x = 3;
required float y = 4;
required int32 type = 5;
required int32 id = 6;
}
message DropObjJson
{
optional float x = 1;
optional float y = 2;
optional int32 id = 3;
required float x = 1;
required float y = 2;
required int32 id = 3;
}
message StaticObjJson
{
optional float x = 1;
optional float y = 2;
optional float height = 3;
optional float width = 4;
required float x = 1;
required float y = 2;
required float height = 3;
required float width = 4;
}
message LootObjJson
{
optional float x = 1;
optional float y = 2;
optional int32 weight = 3;
optional string things = 4;
required float x = 1;
required float y = 2;
required int32 weight = 3;
required string things = 4;
repeated MFPair _things = 5;
optional int32 _rand_space = 6;
required int32 _rand_space = 6;
}
message BuildingJson
{
// optional int32 id = 1;
optional float tileheight = 2;
optional float tilewidth = 3;
// required int32 id = 1;
required float tileheight = 2;
required float tilewidth = 3;
repeated DoorObjJson doorObj = 4;
repeated DropObjJson dropObj = 5;
repeated StaticObjJson staticObj = 6;
repeated LootObjJson lootObj = 7;
optional int32 mapId = 20;
required int32 mapId = 20;
}
message MapTplThingJson
{
optional string layer_name = 1;
optional string name = 2;
optional string things = 3;
optional int32 weight = 4;
optional float x = 5;
optional float y = 6;
optional int32 is_born_point = 7;
optional string born_angle = 8;
required string layer_name = 1;
required string name = 2;
required string things = 3;
required int32 weight = 4;
required float x = 5;
required float y = 6;
required int32 is_born_point = 7;
required string born_angle = 8;
}

@ -1 +1 @@
Subproject commit df9f299b3f5a7305946113ffea3fec7c7023a92d
Subproject commit 645ee0102ffeeff96f5845d400a8f4a2e6d98894