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 ability to change monsters view distance in monsters.dat #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BenStone272
Copy link

No description provided.

@BenStone272
Copy link
Author

Just realized this only affects how close they can see you once you are within (player.visiblityMod * 15) + 3 but if you want it to be a true distance value you can see them at just replace that at line 259 with view distance and it seems to work

Copy link
Contributor

@PythooonUser PythooonUser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Some small changes would improve your PR even more!

@@ -289,19 +289,22 @@
public float spawnMomentumTransfer = 1.0f;

private transient Entity attackTarget = null;
/** Sound played while monster is idle. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the annotation here is wrong?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And an additional space between these properties would increase readability.

@@ -289,19 +289,22 @@
public float spawnMomentumTransfer = 1.0f;

private transient Entity attackTarget = null;
/** Sound played while monster is idle. */
@EditorProperty
private Float viewDistance = 17.0f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about you use the type float instead of the object Float?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it would be great if you could add this to the JSON schema jsonschema\current\dungeoneer\entities\Monster.schema.json.


mass = 2f;
viewDistance = 17.0f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to initialize this property also in the second constructor?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the default value is 17.0f I don't think it's necessary to set it in the constructor?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. That should not be necessary, indeed.

@PythooonUser
Copy link
Contributor

A quick general note: It helps reviewers to include a description of your PR. Stating in concise words what you add/change/fix. I know it is in the title, but still ;)

Also, it is sometimes useful, especially for bigger PRs, to first create an issue describing what you want to change, so we can chat about it, etc. Then you can easily link your PR to the issue. You probably talked about it in Discord, I did not follow that conversation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants