1
This commit is contained in:
parent
2e5c79e1e8
commit
9e82d0dbcd
@ -12,6 +12,7 @@
|
|||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
#include "explosion.h"
|
#include "explosion.h"
|
||||||
|
#include "roommgr.h"
|
||||||
|
|
||||||
#include "attrhelper.h"
|
#include "attrhelper.h"
|
||||||
|
|
||||||
@ -329,6 +330,11 @@ void BattleDataContext::ParseResult(a8::XObject& obj)
|
|||||||
payload = obj.Get("payload").GetString();
|
payload = obj.Get("payload").GetString();
|
||||||
errcode = obj.Get("errcode");
|
errcode = obj.Get("errcode");
|
||||||
errmsg = obj.Get("errmsg").GetString();
|
errmsg = obj.Get("errmsg").GetString();
|
||||||
|
if (errcode == 0) {
|
||||||
|
revive_coin_ = obj.Get("revive_coin");
|
||||||
|
int match_mode = obj.Get("match_mode");
|
||||||
|
RoomMgr::Instance()->SetMatchMode(match_mode ? 1 : 0);
|
||||||
|
}
|
||||||
if (obj.HasKey("hero_dto") && obj.At("hero_dto")->IsObject()) {
|
if (obj.HasKey("hero_dto") && obj.At("hero_dto")->IsObject()) {
|
||||||
hero_dto = obj.At("hero_dto");
|
hero_dto = obj.At("hero_dto");
|
||||||
hero_ability_->hero_uniid_ = hero_dto->Get("hero_uniid", "");
|
hero_ability_->hero_uniid_ = hero_dto->Get("hero_uniid", "");
|
||||||
@ -755,3 +761,13 @@ float BattleDataContext::GetExtRecoverHp()
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BattleDataContext::SetReviveCoin(int num)
|
||||||
|
{
|
||||||
|
revive_coin_ = num;
|
||||||
|
}
|
||||||
|
|
||||||
|
int BattleDataContext::GetReviveCoin()
|
||||||
|
{
|
||||||
|
return revive_coin_;
|
||||||
|
}
|
||||||
|
@ -71,6 +71,9 @@ struct BattleDataContext
|
|||||||
float GetHeroTotalAtk();
|
float GetHeroTotalAtk();
|
||||||
float GetExtRecoverHp();
|
float GetExtRecoverHp();
|
||||||
|
|
||||||
|
void SetReviveCoin(int num);
|
||||||
|
int GetReviveCoin();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Clear();
|
void Clear();
|
||||||
float GetTotalAtk(IBullet* bullet);
|
float GetTotalAtk(IBullet* bullet);
|
||||||
@ -85,6 +88,7 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
CreatureWeakPtr owner_;
|
CreatureWeakPtr owner_;
|
||||||
|
int revive_coin_ = 0;
|
||||||
|
|
||||||
std::shared_ptr<HeroAbility> hero_ability_;
|
std::shared_ptr<HeroAbility> hero_ability_;
|
||||||
std::shared_ptr<WeaponAbility> weapon1_ability_;
|
std::shared_ptr<WeaponAbility> weapon1_ability_;
|
||||||
|
@ -300,6 +300,7 @@ enum PropertyType_e
|
|||||||
|
|
||||||
kPropBeHook = 34,
|
kPropBeHook = 34,
|
||||||
kPropSkillMinor = 35,
|
kPropSkillMinor = 35,
|
||||||
|
kPropReviveCion = 36,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MapObjectType_e
|
enum MapObjectType_e
|
||||||
|
@ -96,6 +96,14 @@ void Player::Initialize()
|
|||||||
#endif
|
#endif
|
||||||
MarkSyncActivePlayer(__FILE__, __LINE__, __func__);
|
MarkSyncActivePlayer(__FILE__, __LINE__, __func__);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
room->frame_event.AddPropChg
|
||||||
|
(GetWeakPtrRef(),
|
||||||
|
kPropReviveCion,
|
||||||
|
0,
|
||||||
|
GetBattleContext()->GetReviveCoin(),
|
||||||
|
true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Update(int delta_time)
|
void Player::Update(int delta_time)
|
||||||
|
@ -849,3 +849,8 @@ void RoomMgr::SendGetBattleData(int mode,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RoomMgr::SetMatchMode(int mode)
|
||||||
|
{
|
||||||
|
match_mode_ = mode;
|
||||||
|
}
|
||||||
|
@ -80,6 +80,8 @@ class RoomMgr : public a8::Singleton<RoomMgr>
|
|||||||
std::vector<std::shared_ptr<cs::CMJoin>>& join_msgs,
|
std::vector<std::shared_ptr<cs::CMJoin>>& join_msgs,
|
||||||
std::function<
|
std::function<
|
||||||
void(std::vector<std::shared_ptr<BattleDataContext>>&)> cb);
|
void(std::vector<std::shared_ptr<BattleDataContext>>&)> cb);
|
||||||
|
int GetMatchMode() { return match_mode_; };
|
||||||
|
void SetMatchMode(int mode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InstallReportStateTimer();
|
void InstallReportStateTimer();
|
||||||
@ -110,6 +112,7 @@ class RoomMgr : public a8::Singleton<RoomMgr>
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int current_room_idx_ = 0;
|
int current_room_idx_ = 0;
|
||||||
|
int match_mode_ = 0;
|
||||||
|
|
||||||
std::map<long long, Room*> inactive_room_hash_;
|
std::map<long long, Room*> inactive_room_hash_;
|
||||||
std::map<long long, Room*> room_hash_;
|
std::map<long long, Room*> room_hash_;
|
||||||
|
@ -166,6 +166,9 @@ message MFVec2
|
|||||||
valule: 副状态cd时间(剩余时间)
|
valule: 副状态cd时间(剩余时间)
|
||||||
value2: 副状态cd时间(总时间)
|
value2: 副状态cd时间(总时间)
|
||||||
value3: 技能id
|
value3: 技能id
|
||||||
|
property_type: 36 复活币数量
|
||||||
|
property_subtype:
|
||||||
|
valule: 数量
|
||||||
*/
|
*/
|
||||||
message MFPropertyChg
|
message MFPropertyChg
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user