[Revert] Reverts Ninja (#15516)
* Revert "[Antag] add space ninja as midround antag (#14069)" This reverts commitc1cda0dbf8. * Revert "[Fix] move ninja objectives into NinjaRole (#15490)" This reverts commit251f429fb3.
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
using Content.Server.Ninja.Systems;
|
||||
using Content.Server.Objectives.Interfaces;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Objectives.Conditions;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed class DoorjackCondition : IObjectiveCondition
|
||||
{
|
||||
private Mind.Mind? _mind;
|
||||
private int _target;
|
||||
|
||||
public IObjectiveCondition GetAssigned(Mind.Mind mind)
|
||||
{
|
||||
// TODO: clamp to number of doors on station incase its somehow a shittle or something
|
||||
return new DoorjackCondition {
|
||||
_mind = mind,
|
||||
_target = IoCManager.Resolve<IRobustRandom>().Next(15, 40)
|
||||
};
|
||||
}
|
||||
|
||||
public string Title => Loc.GetString("objective-condition-doorjack-title", ("count", _target));
|
||||
|
||||
public string Description => Loc.GetString("objective-condition-doorjack-description", ("count", _target));
|
||||
|
||||
public SpriteSpecifier Icon => new SpriteSpecifier.Rsi(new ResourcePath("Objects/Tools/emag.rsi"), "icon");
|
||||
|
||||
public float Progress
|
||||
{
|
||||
get
|
||||
{
|
||||
// prevent divide-by-zero
|
||||
if (_target == 0)
|
||||
return 1f;
|
||||
|
||||
if (!NinjaSystem.GetNinjaRole(_mind, out var role))
|
||||
return 0f;
|
||||
|
||||
return (float) role.DoorsJacked / (float) _target;
|
||||
}
|
||||
}
|
||||
|
||||
public float Difficulty => 1.5f;
|
||||
|
||||
public bool Equals(IObjectiveCondition? other)
|
||||
{
|
||||
return other is DoorjackCondition cond && Equals(_mind, cond._mind) && _target == cond._target;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj is DoorjackCondition cond && cond.Equals(this);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(_mind?.GetHashCode() ?? 0, _target);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user