Refuse enemies joining an open talk circle.
RankInvitees already skipped enemies when a circle formed; a later Chat in the same node still joined without checking opinions. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -52,6 +52,44 @@ public class TalkCircleTests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Enemy_StartsNeighborCircle_InsteadOfJoiningFriends()
|
||||
{
|
||||
var (school, pupils) = FivePupilsOnBreak();
|
||||
using (school)
|
||||
{
|
||||
var first = pupils[0];
|
||||
var second = pupils[1];
|
||||
var enemy = pupils[2];
|
||||
var ally = pupils[3];
|
||||
OpinionStore.Set(first, second.Id, 55);
|
||||
OpinionStore.Set(second, first.Id, 55);
|
||||
OpinionStore.Set(enemy, first.Id, -55);
|
||||
OpinionStore.Set(first, enemy.Id, -55);
|
||||
OpinionStore.Set(enemy, second.Id, -55);
|
||||
OpinionStore.Set(second, enemy.Id, -55);
|
||||
OpinionStore.Set(enemy, ally.Id, 55);
|
||||
OpinionStore.Set(ally, enemy.Id, 55);
|
||||
|
||||
PlaceAt(school, first.Id, "corridor-1");
|
||||
PlaceAt(school, second.Id, "corridor-1");
|
||||
Assert.True(school.TryStartAction(first.Id, TalkActions.Chat));
|
||||
var friends = school.TalkCircleOf(first.Id);
|
||||
Assert.NotNull(friends);
|
||||
Assert.DoesNotContain(enemy.Id, friends.MemberIds);
|
||||
|
||||
PlaceAt(school, enemy.Id, "corridor-1");
|
||||
PlaceAt(school, ally.Id, "corridor-1");
|
||||
Assert.True(school.TryStartAction(enemy.Id, TalkActions.Chat));
|
||||
var neighbor = school.TalkCircleOf(enemy.Id);
|
||||
Assert.NotNull(neighbor);
|
||||
Assert.NotEqual(friends.MemberIds, neighbor.MemberIds);
|
||||
Assert.Contains(ally.Id, neighbor.MemberIds);
|
||||
Assert.DoesNotContain(first.Id, neighbor.MemberIds);
|
||||
Assert.Equal(friends.MemberIds, school.TalkCircleOf(first.Id)?.MemberIds);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FifthPerson_DoesNotJoinFullCircle()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user