1
This commit is contained in:
parent
4dbd4c8f94
commit
e0d7c4d2dd
@ -8,6 +8,7 @@
|
||||
#include "room.h"
|
||||
#include "player.h"
|
||||
#include "human.h"
|
||||
#include "weapon.h"
|
||||
|
||||
#include "mt/Param.h"
|
||||
|
||||
@ -156,3 +157,12 @@ void PBUtils::KillMgr_BoradcastRollMsgCb(Human* dead_hum,
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
void PBUtils::Weapon_ToPB(Weapon* self, Creature* c, cs::MFWeapon* pb_obj)
|
||||
{
|
||||
pb_obj->set_weapon_uniid(a8::XValue(self->weapon_uniid).GetString());
|
||||
pb_obj->set_weapon_id(self->weapon_id);
|
||||
pb_obj->set_weapon_lv(1);
|
||||
pb_obj->set_ammo(self->ammo);
|
||||
pb_obj->set_volume(self->GetClipVolume(c));
|
||||
}
|
||||
|
@ -5,10 +5,13 @@ namespace cs
|
||||
class MFActivePlayerData;
|
||||
class MFPlayerFull;
|
||||
class MFAttrAddition;
|
||||
class MFWeapon;
|
||||
}
|
||||
|
||||
class Ability;
|
||||
class Human;
|
||||
class Weapon;
|
||||
class Creature;
|
||||
struct KillInfo;
|
||||
struct RollMsgHintInfo;
|
||||
class PBUtils
|
||||
@ -29,6 +32,8 @@ class PBUtils
|
||||
int killer_team_id,
|
||||
std::shared_ptr<cs::SMRollMsg> pb_msg);
|
||||
|
||||
static void Weapon_ToPB(Weapon* self, Creature* c, cs::MFWeapon* pb_obj);
|
||||
|
||||
private:
|
||||
static void _Ability_FillMFAttrAdditionList
|
||||
(Ability* self,
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include "weapon.h"
|
||||
#include "cs_proto.pb.h"
|
||||
#include "creature.h"
|
||||
#include "battledatacontext.h"
|
||||
#include "pbutils.h"
|
||||
|
||||
#include "mt/Equip.h"
|
||||
|
||||
@ -19,11 +19,7 @@ void Weapon::Clear()
|
||||
|
||||
void Weapon::ToPB(Creature* c, cs::MFWeapon* pb_obj)
|
||||
{
|
||||
pb_obj->set_weapon_uniid(a8::XValue(weapon_uniid).GetString());
|
||||
pb_obj->set_weapon_id(weapon_id);
|
||||
pb_obj->set_weapon_lv(1);
|
||||
pb_obj->set_ammo(ammo);
|
||||
pb_obj->set_volume(GetClipVolume(c));
|
||||
PBUtils::Weapon_ToPB(this, c, pb_obj);
|
||||
}
|
||||
|
||||
void Weapon::Recalc()
|
||||
|
@ -24,4 +24,6 @@ class Weapon
|
||||
int GetClipVolume(Creature* c);
|
||||
int GetFireRate(Creature* c);
|
||||
int GetReloadTime(Creature* c);
|
||||
|
||||
friend class PBUtils;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user