* start of space ninja midround antag * suit has powercell, can be upgraded only (not replaced with equal or worse battery) * add doorjacking to ninja gloves, power cell, doorjack objective (broken), tweaks * 💀 * add basic suit power display that uses stamina rsi * add draining apc/sub/smes - no wires yet * add research downloading * ninja starts implanted, move some stuff to yaml * add Automated field to OnUseTimerTrigger * implement spider charge and objective * fix client crash when taking suit off, some refactor * add survive condition and tweak locale * add comms console icon for objective * add calling in a threat - currently revenant and dragon * combine all glove abilities * locale * spark sounds when draining, refactoring * toggle is actually toggle now * prevent crash if disabling stealth with outline * add antag ctrl for ninja, hopefully show greentext * fix greentext and some other things * disabling gloves if taken off or suit taken off * basic energy katana, change ninja loadout * recallable katana, refactoring * start of dash - not done yet * katana dashing ability * merge upstream + compiling, make AutomatedTimer its own component * docs and stuff * partial refactor of glove abilities, still need to move handling * make dooremaggedevent by ref * move bunch of stuff to shared - broken * clean ninja antag verb * doc * mark rule config fields as required * fix client crash * wip systems refactor * big refactor of systems * fuck * make TryDoElectrocution callable from shared * finish refactoring? * no guns * start with internals on * clean up glove abilities, add range check * create soap, in place of ninja throwing stars * add emp suit ability * able to eat chefs stolen food in space * stuff, tell client when un/cloaked but there is bug with gloves * fix prediction breaking gloves on client * ninja soap despawns after a minute * ninja spawns outside the station now, with gps + station coords to navigate * add cooldown to stun ability * cant use glove abilities in combat mode * require empty hand to use glove abilities * use ghost role spawner * Update Content.Server/Ninja/Systems/NinjaSuitSystem.cs Co-authored-by: keronshb <54602815+keronshb@users.noreply.github.com> * some review changes * show powercell charge on examine * new is needed * address some reviews * ninja starts with jetpack, i hope * partial feedback * uhh * pro * remove pirate from threats list * use doafter refactor * pro i gave skeleton jetpack * some stuff * use auto gen state * mr handy * use EntityQueryEnumerator * cleanup * spider charge target anti-troll * mmmmmm --------- Co-authored-by: deltanedas <deltanedas@laptop> Co-authored-by: deltanedas <user@zenith> Co-authored-by: deltanedas <@deltanedas:kde.org> Co-authored-by: keronshb <54602815+keronshb@users.noreply.github.com>
65 lines
1.9 KiB
C#
65 lines
1.9 KiB
C#
using Content.Server.Objectives.Interfaces;
|
|
using Content.Shared.Ninja.Components;
|
|
using Robust.Shared.Random;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Content.Server.Objectives.Conditions;
|
|
|
|
[DataDefinition]
|
|
public sealed class DownloadCondition : IObjectiveCondition
|
|
{
|
|
private Mind.Mind? _mind;
|
|
private int _target;
|
|
|
|
public IObjectiveCondition GetAssigned(Mind.Mind mind)
|
|
{
|
|
// TODO: clamp to number of research nodes in tree so easily maintainable
|
|
return new DownloadCondition {
|
|
_mind = mind,
|
|
_target = IoCManager.Resolve<IRobustRandom>().Next(5, 10)
|
|
};
|
|
}
|
|
|
|
public string Title => Loc.GetString("objective-condition-download-title", ("count", _target));
|
|
|
|
public string Description => Loc.GetString("objective-condition-download-description");
|
|
|
|
public SpriteSpecifier Icon => new SpriteSpecifier.Rsi(new ResourcePath("Structures/Machines/server.rsi"), "server");
|
|
|
|
public float Progress
|
|
{
|
|
get
|
|
{
|
|
// prevent divide-by-zero
|
|
if (_target == 0)
|
|
return 1f;
|
|
|
|
var entMan = IoCManager.Resolve<IEntityManager>();
|
|
if (_mind?.OwnedEntity == null
|
|
|| !entMan.TryGetComponent<NinjaComponent>(_mind.OwnedEntity, out var ninja))
|
|
return 0f;
|
|
|
|
return (float) ninja.DownloadedNodes.Count / (float) _target;
|
|
}
|
|
}
|
|
|
|
public float Difficulty => 2.5f;
|
|
|
|
public bool Equals(IObjectiveCondition? other)
|
|
{
|
|
return other is DownloadCondition 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 DownloadCondition cond && cond.Equals(this);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return HashCode.Combine(_mind?.GetHashCode() ?? 0, _target);
|
|
}
|
|
}
|