-
Notifications
You must be signed in to change notification settings - Fork 81
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
base: master
Are you sure you want to change the base?
Conversation
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 |
There was a problem hiding this 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. */ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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 :) |
No description provided.