Fake mindshield componentry and Implanter (#34079)
* Fake Mindshield (With some bad sprites) - Add FakeMindshield System and Component - Add FakeMindsheildImplantSystem and Component - modify ShowMindShieldIconsSystem to check for FakeMindshields - add all supporting yaml for the Implants, action and uplink - add loc file stuff - add unfinished sprites * Cleanup, add to thief toolbox, remove metagame - Move Implant sameness check to AFTER the implant DoAfter to prevent instant identification of Deception Implants - cleanup the systems and components - add the fake mindshield to the Thief toolbox * part 1 of fixing the folder problem * Make the fakemindshield sprite folder lowercase * CR - Move ImplantCheck into shared, cleanup - Moved ImplantCheck and eventsubscription into Shared - Remove Client/Server extensions of FakeMindshieldImplantSystem and FakeMindShieldSystem and make shared Sealed - make OnToggleMindshield Private, use the event! * CR - Cleanup extra lines, fix some Prototype - cleaned up extra liens in ImplanterSystem and SharedFakeMindshieldSystem from when i was developing - Uplink catalog no longer lists the implant in 2 spots, only implants now, also uses the On state action icon - added a comment about why it's reraising the action event rather than directly interacting with the FakeMindshield Component * Fake Mindshield CR: - Added a comment about IsEnabled - moved OnFakeMindShieldToggle to Entity<> from Uid, Comp - fixed some formatting in uplink_catalog * CR - Add a bit more comment
This commit is contained in:
@@ -52,7 +52,14 @@ public abstract class SharedImplanterSystem : EntitySystem
|
||||
|
||||
args.PushMarkup(Loc.GetString("implanter-contained-implant-text", ("desc", component.ImplantData.Item2)));
|
||||
}
|
||||
public bool CheckSameImplant(EntityUid target, EntityUid implant)
|
||||
{
|
||||
if (!TryComp<ImplantedComponent>(target, out var implanted))
|
||||
return false;
|
||||
|
||||
var implantPrototype = Prototype(implant);
|
||||
return implanted.ImplantContainer.ContainedEntities.Any(entity => Prototype(entity) == implantPrototype);
|
||||
}
|
||||
//Instantly implant something and add all necessary components and containers.
|
||||
//Set to draw mode if not implant only
|
||||
public void Implant(EntityUid user, EntityUid target, EntityUid implanter, ImplanterComponent component)
|
||||
@@ -60,6 +67,16 @@ public abstract class SharedImplanterSystem : EntitySystem
|
||||
if (!CanImplant(user, target, implanter, component, out var implant, out var implantComp))
|
||||
return;
|
||||
|
||||
// Check if we are trying to implant a implant which is already implanted
|
||||
// Check AFTER the doafter to prevent "is it a fake?" metagaming against deceptive implants
|
||||
if (!component.AllowMultipleImplants && CheckSameImplant(target, implant.Value))
|
||||
{
|
||||
var name = Identity.Name(target, EntityManager, user);
|
||||
var msg = Loc.GetString("implanter-component-implant-already", ("implant", implant), ("target", name));
|
||||
_popup.PopupEntity(msg, target, user);
|
||||
return;
|
||||
}
|
||||
|
||||
//If the target doesn't have the implanted component, add it.
|
||||
var implantedComp = EnsureComp<ImplantedComponent>(target);
|
||||
var implantContainer = implantedComp.ImplantContainer;
|
||||
|
||||
Reference in New Issue
Block a user