1
This commit is contained in:
parent
e372d674a4
commit
ea3af8ab67
@ -2686,10 +2686,26 @@ void Creature::CheckBulletHitHoldShield(IBullet* bullet, bool& eat)
|
|||||||
|
|
||||||
void Creature::AddEnergyShield(int value)
|
void Creature::AddEnergyShield(int value)
|
||||||
{
|
{
|
||||||
|
energy_shield = value;
|
||||||
|
max_energy_shield = value;
|
||||||
|
room->frame_event.AddPropChg
|
||||||
|
(
|
||||||
|
GetWeakPtrRef(),
|
||||||
|
kPropEnergyShield,
|
||||||
|
energy_shield,
|
||||||
|
max_energy_shield,
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::ClearEnergyShield()
|
void Creature::ClearEnergyShield()
|
||||||
{
|
{
|
||||||
|
energy_shield = 0;
|
||||||
|
max_energy_shield = 0;
|
||||||
|
room->frame_event.AddPropChg
|
||||||
|
(
|
||||||
|
GetWeakPtrRef(),
|
||||||
|
kPropEnergyShield,
|
||||||
|
energy_shield,
|
||||||
|
max_energy_shield,
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,8 @@ class Creature : public MoveableEntity
|
|||||||
int power_idx = -1;
|
int power_idx = -1;
|
||||||
std::function<void(Buff*)> on_add_buff;
|
std::function<void(Buff*)> on_add_buff;
|
||||||
int over_delay_time = 0;
|
int over_delay_time = 0;
|
||||||
|
int energy_shield = 0;
|
||||||
|
int max_energy_shield = 0;
|
||||||
|
|
||||||
Weapon second_weapon;
|
Weapon second_weapon;
|
||||||
Position context_pos;
|
Position context_pos;
|
||||||
|
@ -694,7 +694,13 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string& killer_name, i
|
|||||||
float old_hp = GetHP();
|
float old_hp = GetHP();
|
||||||
if (energy_shield > 0.001f) {
|
if (energy_shield > 0.001f) {
|
||||||
energy_shield = std::max(0.0f, energy_shield - dec_hp);
|
energy_shield = std::max(0.0f, energy_shield - dec_hp);
|
||||||
SyncAroundPlayers(__FILE__, __LINE__, __func__);
|
room->frame_event.AddPropChg
|
||||||
|
(
|
||||||
|
GetWeakPtrRef(),
|
||||||
|
kPropEnergyShield,
|
||||||
|
energy_shield,
|
||||||
|
max_energy_shield,
|
||||||
|
true);
|
||||||
} else {
|
} else {
|
||||||
float old_health = GetHP();
|
float old_health = GetHP();
|
||||||
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
||||||
|
@ -221,8 +221,6 @@ class Human : public Creature
|
|||||||
int backpack = 0;
|
int backpack = 0;
|
||||||
int helmet = 0;
|
int helmet = 0;
|
||||||
int chest = 0;
|
int chest = 0;
|
||||||
int energy_shield = 0;
|
|
||||||
int max_energy_shield = 0;
|
|
||||||
int vip = 0;
|
int vip = 0;
|
||||||
long long join_frameno = 0;
|
long long join_frameno = 0;
|
||||||
long long enable_frameno = 0;
|
long long enable_frameno = 0;
|
||||||
|
@ -181,8 +181,8 @@ message MFVec3
|
|||||||
valule: 目标对象
|
valule: 目标对象
|
||||||
value3: 回传值,当目标对象是自己的时候才需要传(value3==0 || value3==null不用传)
|
value3: 回传值,当目标对象是自己的时候才需要传(value3==0 || value3==null不用传)
|
||||||
property_type: 40 能量护盾
|
property_type: 40 能量护盾
|
||||||
valule: 当前护盾值
|
property_subtype: 当前护盾值
|
||||||
value2: max护盾值
|
value: max护盾值
|
||||||
*/
|
*/
|
||||||
message MFPropertyChg
|
message MFPropertyChg
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user