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

Charms #4614

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Charms #4614

wants to merge 3 commits into from

Conversation

ArturKnopik
Copy link
Contributor

@ArturKnopik ArturKnopik commented Dec 24, 2023

Pull Request Prelude

  • I have followed [proper The Forgotten Server code styling][code].
  • I have read and understood the [contribution guidelines][cont] before making this PR.
  • I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.

Changes Proposed

Introduction of the charm system(offensive perks + dodge)
image

#3871 issue

@@ -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
Copy link
Contributor

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

Copy link
Contributor Author

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

@ArturKnopik ArturKnopik marked this pull request as ready for review December 27, 2023 09:47
@EPuncker EPuncker added the feature New feature or functionality label Dec 27, 2023

if kills < bestiaryInfo.mastery and newKills >= bestiaryInfo.mastery then
self:addCharmPoints(bestiaryInfo.charmPoints)
end
Copy link
Member

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?

@krecikondexin krecikondexin mentioned this pull request Apr 9, 2024
3 tasks
Comment on lines +751 to +756
function Player.isCharmUnlocked(self, charmId)
if (self:getStorageValue(PlayerStorageKeys.charmsUnlocked + charmId) or 0) == charmStatus.UNLOCKED then
return charmStatus.UNLOCKED
end
return charmStatus.LOCKED
end
Copy link
Member

@ranisalt ranisalt Apr 11, 2024

Choose a reason for hiding this comment

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

Would

Suggested change
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?

@EvilHero90 EvilHero90 added this to the 1.8 milestone May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants