Skip to content

Commit

Permalink
Starts and ends
Browse files Browse the repository at this point in the history
  • Loading branch information
FireNameFN committed Nov 10, 2024
1 parent 3ed5923 commit 7ff01fa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ public sealed partial class AdminVerbSystem
[ValidatePrototypeId<EntityPrototype>]
private const string DefaultThiefRule = "Thief";

// Corvax-Next-Api
// Corvax-Next-Api-Start
[ValidatePrototypeId<EntityPrototype>]
private const string DefaultApiRule = "Api";
// Corvax-Next-Api-End

[ValidatePrototypeId<StartingGearPrototype>]
private const string PirateGearId = "PirateGear";
Expand Down Expand Up @@ -156,7 +157,7 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
};
args.Verbs.Add(thief);

// Corvax-Next-Api
// Corvax-Next-Api-Start
Verb api = new()
{
Text = Loc.GetString("admin-verb-text-make-api"),
Expand All @@ -170,5 +171,6 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
Message = Loc.GetString("admin-verb-make-api"),
};
args.Verbs.Add(api);
// Corvax-Next-Api-End
}
}
8 changes: 5 additions & 3 deletions Content.Server/GameTicking/Rules/ThiefRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private void OnGetBriefing(Entity<ThiefRoleComponent> role, ref GetBriefingEvent
if (ent is null)
return;

// Corvax-Next-Api
// Corvax-Next-Api-Start
var api = false;

foreach (var id in args.Mind.Comp.MindRoles)
Expand All @@ -43,13 +43,15 @@ private void OnGetBriefing(Entity<ThiefRoleComponent> role, ref GetBriefingEvent
api = true;

args.Append(MakeBriefing(ent.Value, api));
// Corvax-Next-Api-End
}

// Corvax-Next-Api
private string MakeBriefing(EntityUid ent, bool api)
private string MakeBriefing(EntityUid ent, bool api) // Corvax-Next-Api
{
// Corvax-Next-Api-Start
if (api)
return Loc.GetString("api-role-greeting");
// Corvax-Next-Api-End

var isHuman = HasComp<HumanoidAppearanceComponent>(ent);
var briefing = isHuman
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ public sealed partial class StealConditionComponent : Component
[DataField]
public bool CheckAlive = false;

// Corvax-Next-Api
// Corvax-Next-Api-Start
[DataField]
public bool CheckHasAi = false;
// Corvax-Next-Api-End

/// <summary>
/// The minimum number of items you need to steal to fulfill a objective
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/Objectives/Systems/StealConditionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ private int CheckStealTarget(EntityUid entity, StealConditionComponent condition
}
}

// Corvax-Next-Api
// Corvax-Next-Api-Start
if (condition.CheckHasAi)
if (TryComp<StationAiHolderComponent>(entity, out var holder))
if (holder.Slot.Item is null)
return 0;
// Corvax-Next-Api-End

return TryComp<StackComponent>(entity, out var stack) ? stack.Count : 1;
}
Expand Down

0 comments on commit 7ff01fa

Please sign in to comment.