procedure SetPlayRankName(Player: TPlayObject);
function GetOfficialRank(ATalent: Integer): String;
function SameOfficialRank(ALeft, ARight: Integer): Boolean;
function GetMemberName(AMemberLevel: Integer): String;
function GetNationRank(Player: TPlayObject; Prefix: Boolean): String;
function GetReLevelName(AReLevel: Integer): String;
implementation
function GetMemberName(AMemberLevel: Integer): String;
begin
case AMemberLevel of
1: Result := '[初级会员]';
2: Result := '[铜牌会员]';
3: Result := '[银牌会员]';
4: Result := '[金牌会员]';
5: Result := '[钻石会员]';
6: Result := '[至尊会员]';
else Result := '';
end;
end;
function GetReLevelName(AReLevel: Integer): String;
begin
case AReLevel of
1: Result := '';
else
Result := '';
end;
end;
function GetOfficialRank(ATalent: Integer): String;
begin
case ATalent of
0..80: Result := '';
81..400: Result := '书生';
401..800: Result := '秀才';
801..2000: Result := '举人';
2001..4000: Result := '解元';
4001..7000: Result := '贡士';
7001..10000: Result := '会元';
10001..14000: Result := '同进士出身';
14001..18000: Result := '进士出身';
18001..22000: Result := '探花';
22001..32000: Result := '榜眼';
32001..45000: Result := '状元';
45001..60000: Result := '编修';
60001..100000: Result := '府丞';
100001..150000: Result := '翰林学士';
150001..250000: Result := '御史中丞';
250001..400000: Result := '詹士';
400001..700000: Result := '侍郎';
700001..1000000:Result := '大学士';
else Result := '文曲星';
end;
end;
function SameOfficialRank(ALeft, ARight: Integer): Boolean;
begin
Result := GetOfficialRank(ALeft) = GetOfficialRank(ARight);
end;
function GetNationRank(Player: TPlayObject; Prefix: Boolean): String;
begin
Result := '';
if Player.Nation in [NATION_DAHAN, NATION_XICHU] then
begin
if Prefix then
begin
case Player.Nation of
NATION_DAHAN: Result := '{S=[汉];C=250}';
NATION_XICHU: Result := '{S=[楚];C=249}';
end;
end;
case Player.N[_P_NATIONRANK] of
0..99: Result := Result + '平民';
100..499: Result := Result + '伍长';
500..999: Result := Result + '拾长';
1000..2999: Result := Result + '屯长';
3000..4999: Result := Result + '军侯';
5000..7999: Result := Result + '司马';
8000..11999: Result := Result + '校尉';
12000..17999: Result := Result + '护军';
18000..24999: Result := Result + '将军';
else Result := Result + '大将军';
end;
end;
end;
procedure SetPlayRankName(Player: TPlayObject);
var
S: String;
begin
S := S + '\' + GetMemberName(Player.MemberLevel);
S := S + '\' + GetReLevelName(Player.ReNewLevel);
S := S + '\' + GetNationRank(Player, True);
Player.RankLevelName := '%s\' + S;
Player.UpdateName;
end;