Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added field for items to not change player direction on shoot #3385

Merged
merged 4 commits into from
Sep 12, 2023

Conversation

Destructor-Ben
Copy link
Contributor

@Destructor-Ben Destructor-Ben commented Apr 5, 2023

#3384

What is the new feature?

Added a field to items that can allow items to prevent shooting a projectile make the player face the projectile
item.ChangePlayerDirectionOnShoot

Why should this be part of tModLoader?

Currently IL editing is required to prevent a shot projectile from making the player turn towards it, since the vanilla implementation that excludes the Beam Sword and Grand Design from this behaviour is hardcoded.

Are there alternative designs?

Using a set in ItemID.Sets

Sample usage for the new feature

In ModItem.SetDefaults

public override void SetDefaults()
{
    item.ChangePlayerDirectionOnShoot = false;
}

ExampleMod updates

I will do one if requested

@Chicken-Bones
Copy link
Member

Yes, an example is required. Please carefully consider naming and documentation. Can you explain how this is related to and differs from useTurn?

Ideally the default value of the member would be false, if there is no way to have a sensible name, then make sure you put an = true after the property declaration, and that you specify the default in the docs.

ChangePlayerDirectionOnShoot = false additions to SetDefaults for vanilla items should have a // Added by TML appended to the end, just so it's clear to a reader.

@Chicken-Bones Chicken-Bones merged commit db5530f into tModLoader:1.4.4 Sep 12, 2023
@Destructor-Ben Destructor-Ben deleted the Item-Shoot-Turn branch September 12, 2023 07:37
Chicken-Bones pushed a commit that referenced this pull request Sep 12, 2023
* Added field for items to not change player direction on shoot

* Added "Added by tML" comments to setdefaults

* Updated Documentation

* Added EM usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benefit - Low Complexity - Low Feature - Hook Request for new modding functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants