Error:
{"type":"error", "des","invalid user"}
Success:
{"type":"success", ...}
登陆
/dc/login
request: {name, password}
reponse: {type, 'name':用户名, '_id', 'nickname':昵称, 'side': 阵营(0,1)(int), 'cards': [{
'power_add', 力量(int)
'in_team', 是否在战斗队伍(Boolean)
'intelligence_base', 智力基础(int)
'intelligence_add', 智力增加(int)
'type': 英雄类型,(int)
'power_base':基础力量(int)
'star': 星(int)
'leader_base':领导力,(int)
'agility_base': 基础敏捷,(int)
'agility_add': 敏捷增加(int)
'attack_max': 攻击最大, (int)
'attack_min': 攻击最低(int)
'formation_i': 位置i,(int)
'formation_j': 位置j,(int)
'burst_base': 暴击率, (int)
'desc': 描述,
'name': 卡片名称,
'card_id':(int)
'face': 图标,(int)
'range': 攻击范围, (int)
'skill_1': 技能1,(int)
'skill_2': 技能2, (int)
'skill_core': 核心技能,(int)
'_id': ,
'skill_leader': 领导技能}]}
注册
/dc/regist
request: {name, password}
response: {type,'_id':用户id}
昵称
/dc/info
request: { _id, nickname, side(int)}
response: 同login
加入队伍
/dc/join_team
request: {"_id":用户id, team: [{_id: 卡片id}]}
response: {type}
布阵
/dc/formation
request: {"_id":用户id, team: [{_id: 卡片id, formation_i: i行, formation_j: 列]}
response: {type}
战斗
/dc/pve
request: {"_id": 用户id}
response:
{ type:success,
battle : { [ {_id, hp, i, j} ,... ]}
round : [
play :[{_id,
action : [ move | fight | wait]
[move: ]
[fight: beated_id, beated_hp]
[wait: ]
}, ...], [...], [..] ],
winner: 0 or 1
}