Skip to content

Commit

Permalink
Update Convict.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
impostor4291 authored Jan 24, 2025
1 parent d39876b commit 7d2be95
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Roles/Impostor/Convict.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ public override void SetKillCooldown(byte id)
public override void AfterMeetingTasks()
{
var convict = _Player;
if (convict.GetPlayerTaskState().IsTaskFinished && convict.IsAlive())
var taskstate = convict.GetPlayerTaskState();

int completed = taskstate.CompletedTasksCount;//total number of Convict's tasks
int required = convict.Is(CustomRoles.LastImpostor) ? taskstate.AllTasksCount / 2 : taskstate.AllTasksCount;//required number of tasks for Convict to become Refugee

if (convict.IsAlive() && completed >= required)
{
convict.RpcChangeRoleBasis(CustomRoles.Refugee);
convict.RpcSetCustomRole(CustomRoles.Refugee);
Expand Down

0 comments on commit 7d2be95

Please sign in to comment.