-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Charms #4614
Charms #4614
Conversation
data/lib/core/player.lua
Outdated
@@ -737,3 +742,37 @@ function Player.disableLoginMusic(self) | |||
msg:delete() | |||
return true | |||
end | |||
|
|||
function Player.isCharmUnlocked(self, charmId) | |||
if self:getStorageValue(PlayerStorageKeys.charmsUnlocked + charmId) == 1 then |
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.
Storages now return nil if empty, doing a direct check with a number 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.
that is why this PR is on draft, i porting it from my personal project to TFS
|
||
if kills < bestiaryInfo.mastery and newKills >= bestiaryInfo.mastery then | ||
self:addCharmPoints(bestiaryInfo.charmPoints) | ||
end |
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.
Can this be added to unlockCharm
(and removeCharm
) instead?
function Player.isCharmUnlocked(self, charmId) | ||
if (self:getStorageValue(PlayerStorageKeys.charmsUnlocked + charmId) or 0) == charmStatus.UNLOCKED then | ||
return charmStatus.UNLOCKED | ||
end | ||
return charmStatus.LOCKED | ||
end |
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.
Would
function Player.isCharmUnlocked(self, charmId) | |
if (self:getStorageValue(PlayerStorageKeys.charmsUnlocked + charmId) or 0) == charmStatus.UNLOCKED then | |
return charmStatus.UNLOCKED | |
end | |
return charmStatus.LOCKED | |
end | |
function Player.isCharmUnlocked(self, charmId) | |
return self:getStorageValue(PlayerStorageKeys.charmsUnlocked + charmId) or charmStatus.LOCKED | |
end |
work?
Pull Request Prelude
Changes Proposed
Introduction of the charm system(offensive perks + dodge)
![image](https://private-user-images.githubusercontent.com/17506599/292673852-3e3f6472-da65-425e-bab5-545597983406.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5Nzc4OTQsIm5iZiI6MTczOTk3NzU5NCwicGF0aCI6Ii8xNzUwNjU5OS8yOTI2NzM4NTItM2UzZjY0NzItZGE2NS00MjVlLWJhYjUtNTQ1NTk3OTgzNDA2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDE1MDYzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYxYjYxZGE1OGQxNjkxNzUyMzliY2FmOTk0ZTE0MzU4ODM5YjVlMDQzZDU5YzhkODBhYWM3NmI5NTJkODJmMWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.I8mZhpyWZ8mTJ_kyUyHYD_mSkvi5pW39dP_NiyCGv2M)
#3871 issue