-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some Imps only aggro by sight during the night
- Loading branch information
Showing
3 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require('scripts/globals/mixins') | ||
----------------------------------- | ||
xi = xi or {} | ||
xi.mix = xi.mix or {} | ||
xi.mix.imp_aggro = xi.mix.imp_aggro or {} | ||
|
||
g_mixins = g_mixins or {} | ||
g_mixins.families = g_mixins.families or {} | ||
|
||
local function updateAggro(mob, hour) | ||
mob:setLocalVar('hour', hour) | ||
|
||
if hour >= 18 or hour < 6 then | ||
mob:setMobMod(xi.mobMod.DETECTION, bit.bor(xi.detects.SIGHT, xi.detects.HEARING)) | ||
elseif hour < 18 and hour >= 6 then | ||
mob:setMobMod(xi.mobMod.DETECTION, xi.detects.HEARING) | ||
end | ||
end | ||
|
||
g_mixins.families.imp_aggro = function(mob) | ||
mob:addListener('SPAWN', 'IMP_AGGRO_SPAWN', function(imp) | ||
updateAggro(imp, VanadielHour()) | ||
end) | ||
|
||
mob:addListener('ROAM_TICK', 'IMP_AGGRO_ROAM_TICK', function(imp) | ||
local hour = VanadielHour() | ||
if hour ~= imp:getLocalVar('hour') then | ||
updateAggro(imp, hour) | ||
end | ||
end) | ||
end | ||
|
||
return g_mixins.families.imp_aggro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3d77d43
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.
Do you have a source for this testing?
3d77d43
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.
Yes, I try to include capture links with all of my PRs including this one: #6227
3d77d43
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.
@ShiyoKozuki we have repeatedly asked you to open issues or discussions instead of commenting on closed PRs/commits.
Please stop. Seriously.
3d77d43
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.
Thanks, I didnt' know you could click the link at top to get to the PR. I'm not a master of github.
@Xaver-DaRed
In the future I recommend you don't be a dick to people for 0 reason, especially for a project that relies on people helping for free.
3d77d43
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.
First, I wasn't a "dick", I asked you to please follow a set of instructions which you have been told several times in the past.
Second, there IS a reason. As I said, you have been told, repeatedly how to operate and continue to ignore said instructions.
And lastly, @ShiyoKozuki abstain yourself from making recommendations until you are able to follow a very simple request.
Locking the thread. Have a nice day.