1
This commit is contained in:
parent
9402eeef84
commit
43582a94e3
@ -297,6 +297,7 @@ void Weapon::ToPB(Creature* c, cs::MFWeapon* pb_obj)
|
|||||||
pb_obj->set_weapon_lv(std::max(1, weapon_lv));
|
pb_obj->set_weapon_lv(std::max(1, weapon_lv));
|
||||||
pb_obj->set_ammo(ammo);
|
pb_obj->set_ammo(ammo);
|
||||||
pb_obj->set_volume(GetClipVolume(c));
|
pb_obj->set_volume(GetClipVolume(c));
|
||||||
|
pb_obj->set_weapon_battle_lv(GetWeaponBattleLv(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buff::FillMFBuff(cs::MFBuff* buff_pb)
|
void Buff::FillMFBuff(cs::MFBuff* buff_pb)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "netdata.h"
|
#include "netdata.h"
|
||||||
#include "pbutils.h"
|
#include "pbutils.h"
|
||||||
#include "human.h"
|
#include "human.h"
|
||||||
|
#include "compose.h"
|
||||||
|
|
||||||
#include "mt/Equip.h"
|
#include "mt/Equip.h"
|
||||||
|
|
||||||
@ -54,3 +55,14 @@ int Weapon::GetReloadTime(Creature* c)
|
|||||||
return meta ? meta->reload_time() :0;
|
return meta ? meta->reload_time() :0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Weapon::GetWeaponBattleLv(Creature* c)
|
||||||
|
{
|
||||||
|
if (c) {
|
||||||
|
if (c->GetCurrWeapon() == this) {
|
||||||
|
return c->GetCompose()->GetNum() + 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -27,6 +27,7 @@ class Weapon
|
|||||||
int GetClipVolume(Creature* c);
|
int GetClipVolume(Creature* c);
|
||||||
int GetFireRate(Creature* c);
|
int GetFireRate(Creature* c);
|
||||||
int GetReloadTime(Creature* c);
|
int GetReloadTime(Creature* c);
|
||||||
|
int GetWeaponBattleLv(Creature* c);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user