This commit is contained in:
aozhiwei 2023-07-04 15:43:45 +08:00
parent 90ae2edddd
commit 55c5b101ac
4 changed files with 44 additions and 19 deletions

View File

@ -426,7 +426,7 @@ void Car::DecHP(float dec_hp, int killer_id, const std::string killer_name, int
GetUniId(), GetUniId(),
real_dmg_out, real_dmg_out,
0, 0,
0, killer->GetUniId(),
true); true);
} else if (killer->IsHero() && } else if (killer->IsHero() &&
killer->AsHero()->master.Get() && killer->AsHero()->master.Get() &&
@ -438,7 +438,7 @@ void Car::DecHP(float dec_hp, int killer_id, const std::string killer_name, int
GetUniId(), GetUniId(),
real_dmg_out, real_dmg_out,
0, 0,
0, killer->AsHero()->master.Get()->GetUniId(),
true); true);
} }
} }

View File

@ -295,7 +295,7 @@ void Hero::DecHP(float dec_hp, int killer_id, const std::string killer_name, int
GetUniId(), GetUniId(),
real_dmg_out, real_dmg_out,
0, 0,
0, killer->GetUniId(),
true); true);
} else if (killer->IsHero() && } else if (killer->IsHero() &&
killer->AsHero()->master.Get() && killer->AsHero()->master.Get() &&
@ -307,7 +307,7 @@ void Hero::DecHP(float dec_hp, int killer_id, const std::string killer_name, int
GetUniId(), GetUniId(),
real_dmg_out, real_dmg_out,
0, 0,
0, killer->AsHero()->master.Get()->GetUniId(),
true); true);
} }
} }

View File

@ -363,7 +363,7 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in
} }
Creature* killer = room->GetCreatureByUniId(real_killer_id); Creature* killer = room->GetCreatureByUniId(real_killer_id);
if (killer && real_dmg_out > 0.999) { if (killer && real_dmg_out > 0.999) {
if (killer->IsPlayer()) { if (killer->IsHuman()) {
room->frame_event.AddPropChgEx room->frame_event.AddPropChgEx
( (
killer->GetWeakPtrRef(), killer->GetWeakPtrRef(),
@ -371,20 +371,44 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in
GetUniId(), GetUniId(),
real_dmg_out, real_dmg_out,
0, 0,
0, killer->GetUniId(),
true);
} else if (killer->IsHero() &&
killer->AsHero()->master.Get() &&
killer->AsHero()->master.Get()->IsPlayer()) {
room->frame_event.AddPropChgEx
(
killer->AsHero()->master.Get()->GetWeakPtrRef(),
kPropDmgShow,
GetUniId(),
real_dmg_out,
0,
0,
true); true);
if (IsPlayer()) {
room->frame_event.AddPropChgEx
(
GetWeakPtrRef(),
kPropDmgShow,
GetUniId(),
real_dmg_out,
0,
killer->GetUniId(),
true);
}
} else if (killer->IsHero()) {
if (killer->AsHero()->master.Get() &&
killer->AsHero()->master.Get()->IsPlayer()) {
room->frame_event.AddPropChgEx
(
killer->AsHero()->master.Get()->GetWeakPtrRef(),
kPropDmgShow,
GetUniId(),
real_dmg_out,
0,
killer->AsHero()->master.Get()->GetUniId(),
true);
}
if (IsPlayer()) {
room->frame_event.AddPropChgEx
(
GetWeakPtrRef(),
kPropDmgShow,
GetUniId(),
real_dmg_out,
0,
killer->AsHero()->master.Get() ?
killer->AsHero()->master.Get()->GetUniId() : killer->GetUniId(),
true);
}
} }
} }
GetTrigger()->HpChg(); GetTrigger()->HpChg();

View File

@ -230,9 +230,10 @@ message MFVec3
property_type: 50 () property_type: 50 ()
value: value:
property_type: 51 property_type: 51
property_subtype: uniid property_subtype: uniid
value: value:
value2: 0: 1 value2: 0: 1
value3: uniid
*/ */
message MFPropertyChg message MFPropertyChg
{ {