-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathaffection.csx
More file actions
27 lines (22 loc) · 1.11 KB
/
Copy pathaffection.csx
File metadata and controls
27 lines (22 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using Arrowgene.Ddon.GameServer.Handler;
using System.Collections.Generic;
public class ChatCommand : IChatCommand
{
public override AccountStateType AccountState => AccountStateType.User;
public override string CommandName => "affection";
public override string HelpText => "usage: `/affection` - Check pawn affection.";
public override void Execute(DdonGameServer server, string[] command, GameClient client, ChatMessage message, List<ChatResponse> responses)
{
List<string> strings = [];
foreach (var pawn in client.Character.Pawns)
{
int level = (int)pawn.PartnerPawnData.CalculateLikability();
strings.Add($"{pawn.Name}{(client.Character.PartnerPawnId == pawn.PawnId ? " *" : " ")}");
strings.Add($" Affection: {level} / {PartnerPawnData.MaxLevel}");
strings.Add($" Progress: {pawn.PartnerPawnData.CalculateLikabilityXP()} / {PartnerPawnData.LikabilityCurve.ElementAtOrDefault(level+1)}");
strings.Add($" ");
}
client.Send(new S2CConnectionInformationNtc(strings));
}
}
return new ChatCommand();