Synapse overrides the behavior of SCP-914: Every SynapseItem is assigned a ISynapse914Processor that is by default just a Wrapper around the default Processor, so that by default all items will be updated like they do in vanilla.
The 914Processor is responsible for upgrading the item and can be used like this to upgrade Items (SCP-914 also just calls this method now)
This method as you can see needs the item, the setting it is upgraded on and the position where the item should spawn when it is not inside a Player Inventory right now.
You can create an own 914 Processor by creating a new Type that inherits from ISynapse914Processor add the Attribute Automatic and Scp914Processor to it
usingNeuron.Core.Meta;usingScp914;usingSynapse3.SynapseModule.Item;usingSynapse3.SynapseModule.Map.Scp914;usingUnityEngine;namespaceDocsExample;[Automatic][Scp914Processor( ReplaceHandlers =newuint[] { 35 } //35 is the Coin so this will only affect Coins )]publicclassMy914Processor:ISynapse914Processor{publicvoidCreateUpgradedItem(SynapseItem item,Scp914KnobSetting setting,Vector3 position =newVector3()) { }}
Now let us add some upgrade logic to it but keep in mind that a SynapseItem can be in different states of existence
usingNeuron.Core.Meta;usingScp914;usingSynapse3.SynapseModule.Item;usingSynapse3.SynapseModule.Map.Scp914;usingUnityEngine;namespaceDocsExample;[Automatic][Scp914Processor( ReplaceHandlers =newuint[] { 35 } //35 is the Coin so this will only affect Coins )]publicclassMy914Processor:ISynapse914Processor{publicvoidCreateUpgradedItem(SynapseItem item,Scp914KnobSetting setting,Vector3 position =newVector3()) { //Dependent on which setting is used get another Item that it should become //The logic for this can be of course more advanced with chances but we keep it simple herevar type = setting switch {Scp914KnobSetting.Coarse=>ItemType.KeycardJanitor,Scp914KnobSetting.Rough=>ItemType.KeycardScientist,Scp914KnobSetting.OneToOne=>ItemType.KeycardResearchCoordinator,Scp914KnobSetting.Fine=>ItemType.KeycardNTFCommander,Scp914KnobSetting.VeryFine=>ItemType.KeycardO5, _ =>ItemType.None };var state =item.State;var owner =item.ItemOwner; //The Item is not automatically destroyed you have to do it yourselfitem.Destroy();if (type ==ItemType.None) return; //Dependent on which state the Item was it will now be dropped or given in the inventory //You can of course also always drop it on the Map or always give it to a playerswitch (state) {caseItemState.Map: _ =newSynapseItem(type, position);break;caseItemState.Inventory: _ =newSynapseItem(type, owner);break; } }}
Add a 914Processor manually
You can of course also add a 914Processor manually.
Synapse stores them all in a dictionary that decide which Item ID will become which Processor that you can easily change.
In this Example, your code would look like this if you don't use the Automatic and Scp914Processor Attribute