• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • For issues you find with the Mobile 1.4 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

tModLoader Class Lock

Graumen

Terrarian
icon.png


Direct Download
Open Source on GitHub


Class Lock lets you restrict yourself to any Combination of Damage Types.
When playing with a non class-locked Character, you are presented with a List of available Damage Types.
After choosing your desired Damage Types, doubleclick the Confirm Button.
You will only be able to hit Enemies with Weapons of these Damage Types with that Character permanently.
Class Lock does not support custom Damage Types natively, however, it does have Cross Mod Support.
For Information on how to add a custom Damage Type/Subclass etc. to Class Lock, see below.

ui.png


To add a Class to Class Lock, you could call Class Lock like this :
C#:
        public override void PostSetupContent()
        {
            Mod cl = ModLoader.GetMod("Class_Lock");

            if (cl != null) cl.Call((Predicate<Projectile>)(_ => _.arrow), "Custom Class", null, null, null, null, null);
        }
This adds a Class that only allows you to hit Enemies with Arrows.

ui2.png


The first Argument needs to be of the Type "Predicate<Projectile>".
Arguments 3 - 7 need to be null unless you want to be :

Adding Conditions to existing Classes

These are the existing Classes :
C#:
                new Class(_ => !(_.magic || _.melee || _.ranged || _.thrown), "Summon"),
                new Class(_ => _.magic, "Magic"),
                new Class(_ => _.melee, "Melee"),
                new Class(_ => _.ranged, "Ranged"),
                new Class(_ => _.thrown, "Throwing")
If any of their Conditions conflict with your Damage Type, you can use a "Predicate<Projectile>" as Arguments 3 - 7 to add it to the Class and prevent the Class from including your Damage Type.
The Index of the Argument corresponds to the Order of the Classes in the Code above, so 3 for Summon and so on. E.g. :
C#:
        public override void PostSetupContent()
        {
            Mod cl = ModLoader.GetMod("Class_Lock");

            if (cl != null) cl.Call((Predicate<Projectile>)(_ => _.arrow), "Custom Class", null, null, null, (Predicate<Projectile>)(_ => _.arrow), null);
        }
This Call, in addition to adding a class, makes it so the "Ranged" Class only lets you hit Enemies with Arrows.

My other Mods

Grab Bag Opener
True Tooltips
Widgets
 
Last edited:

NiZeKiHo

Terrarian
Will there be any benefit in the future to locking into one class, or is this just meant to me a way to limit yourself and make it a bit more difficult?
 

Graumen

Terrarian
Will there be any benefit in the future to locking into one class, or is this just meant to me a way to limit yourself and make it a bit more difficult?
It's meant to prevent you from accidentaly doing the wrong Type of Damage, for those who care about the Purity of their Playthrough. But There is also Potential for Subclasses like only being able to hit with Arrows etc..
 
Top Bottom