pre cw with probe and a bunch script to read game behavior
This commit is contained in:
1 parent
5120219ae2
commit
da8a32f60d
310 files changed
+219693
-872
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
pb "gac-hkrpg-go/protocol/proto"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBattleReportAttributesServantDamageByOwner(t *testing.T) {
|
||||
servant := &pb.BattleAvatarServantInfo{AvatarId: 20, EntityId: 200, TotalDamage: 900, TotalHeal: 30,
|
||||
AttackTypeDamage: []*pb.AttackDamageProperty{{AttackType: "BPSkill", Damage: 900}},
|
||||
AttackTypeMaxDamage: []*pb.AttackDamageProperty{{AttackType: "BPSkill", Damage: 300}}}
|
||||
stats := &pb.BattleStatistics{BattleAvatarList: []*pb.AvatarBattleInfo{
|
||||
{Id: 10, TotalDamage: 100}, {Id: 20, TotalDamage: 0}},
|
||||
IAGKLJEKAOL: &pb.OHDHNDMJFAP{GFOAHHHNBJC: []*pb.BattleAvatarServantInfo{servant, servant,
|
||||
{AvatarId: 999, TotalDamage: 999999}}}}
|
||||
report := BattleReportFromStatistics(stats, 1, 2, "LIVE")
|
||||
owner := report.Avatars[1]
|
||||
if report.TeamTotalDamage != 1000 || owner.TotalDamage != 900 || owner.MemospriteDamage != 900 || owner.DamagePercent != 90 ||
|
||||
owner.AttackTypeDamage["BPSkill"] != 900 || owner.AttackTypeMaxDamage["BPSkill"] != 300 || report.TeamTotalHeal != 30 {
|
||||
t.Fatalf("servant owner attribution incorrect: report=%+v owner=%+v", report, owner)
|
||||
}
|
||||
if stats.BattleAvatarList[1].TotalDamage != 0 || servant.TotalDamage != 900 {
|
||||
t.Fatal("conversion modified native source statistics")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBattleReportServantDoesNotDoubleMonsterFallback(t *testing.T) {
|
||||
stats := &pb.BattleStatistics{BattleAvatarList: []*pb.AvatarBattleInfo{{Id: 10}},
|
||||
MonsterList: []*pb.MonsterBattleInfo{{TotalDamageTaken: 1000}},
|
||||
IAGKLJEKAOL: &pb.OHDHNDMJFAP{GFOAHHHNBJC: []*pb.BattleAvatarServantInfo{{AvatarId: 10, TotalDamage: 1000}}}}
|
||||
if report := BattleReportFromStatistics(stats, 1, 2, "WIN"); report.TeamTotalDamage != 1000 || report.Avatars[0].DamagePercent != 100 {
|
||||
t.Fatalf("servant was added to a team-wide fallback twice: %+v", report)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user