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

Add player contributed bounties #1112

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

Conversation

farooqkz
Copy link
Contributor

@farooqkz farooqkz commented Mar 10, 2023

This PR aims to add player contributed bounties(with10% fee). Task list:

  • Add a command to put bounty on someone
  • Give score to the killer
  • Update /list_bounty

@farooqkz
Copy link
Contributor Author

@LoneWolfHT How to get and set player rankings?

@farooqkz farooqkz marked this pull request as draft March 10, 2023 12:20
@LoneWolfHT
Copy link
Member

https://github.com/MT-CTF/capturetheflag/blob/master/mods/ctf/ctf_modebase/features.lua#L145 and bounties.lua may help you figure it out. It's been a while so I'd have to go do some experimenting to know for sure

@farooqkz
Copy link
Contributor Author

@LoneWolfHT Not done yet but code review is welcome

@farooqkz farooqkz marked this pull request as ready for review March 17, 2023 06:10
@farooqkz
Copy link
Contributor Author

@LoneWolfHT It's ready.

@tigercoding56
Copy link

what abount bunties for a specific kill type? for example a bounty of 100 score if you kill binshady with a torch (maybe even across matches?)

@farooqkz
Copy link
Contributor Author

what abount bunties for a specific kill type? for example a bounty of 100 score if you kill binshady with a torch (maybe even across matches?)

Such kills are easily achievable by non-noob players and specially experienced players. You simply make them 1HP with your sword and do the last hit with a flower or ladder or stick or whatever.

@farooqkz
Copy link
Contributor Author

@LoneWolfHT When will be the test session for this?

@LoneWolfHT
Copy link
Member

Probably in a week or so unless my current work is much easier than expected

@farooqkz
Copy link
Contributor Author

Probably in a week or so unless my current work is much easier than expected

I might be able to launch a test server myself.

@LoneWolfHT
Copy link
Member

LoneWolfHT commented Apr 22, 2023

  • Bounties don't get removed when awarded
  • There shouldn't be a tax on placing a bounty, it just causes confusion
  • If you place two bounties in a row you get listed twice in the rewards
    image
  • Score is taken from your universal score, it should only come from your match score

@farooqkz
Copy link
Contributor Author

  • Score is taken from your universal score, it should only come from your match score

Why?

@LoneWolfHT
Copy link
Member

LoneWolfHT commented Apr 23, 2023

  • Score is taken from your universal score, it should only come from your match score

Why?

It can be easily abused for things like rank farming, and mis-typing can be devastating to your rank

@farooqkz
Copy link
Contributor Author

Then maybe put a limit but still use the universal ranking score?

@LoneWolfHT
Copy link
Member

Then maybe put a limit but still use the universal ranking score?

With donations I opted to use the match score instead, I'd prefer if that convention was followed

@farooqkz
Copy link
Contributor Author

Then maybe put a limit but still use the universal ranking score?

With donations I opted to use the match score instead, I'd prefer if that convention was followed

okay will do but I'm busy with other stuff for now.

@farooqkz
Copy link
Contributor Author

@LoneWolfHT PR is ready

mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
Comment on lines +74 to +79
local current_mode = ctf_modebase:get_current_mode()
for _, bounties in pairs(ctf_modebase.contributed_bounties) do
for bounty_donator, bounty_amount in pairs(bounties["contributors"]) do
current_mode.recent_rankings.add(bounty_donator, {score=bounty_amount}, true)
end
end
Copy link
Member

Choose a reason for hiding this comment

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

Are you returning the score to them before it's added to their main rankings? This is something I'll check in the final review

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think so xD

mods/ctf/ctf_rankings/default.lua Outdated Show resolved Hide resolved
@LoneWolfHT
Copy link
Member

Some things are still not resolved, and you committed a submodule change before pushing your changes again

@farooqkz
Copy link
Contributor Author

farooqkz commented Jul 2, 2023

I did the remaining suggestions as well. Please let me know which one is still left.
Regarding the maps, I just checkout'ed on master of https://github.com/MT-CTF/maps

Copy link
Member

@LoneWolfHT LoneWolfHT left a comment

Choose a reason for hiding this comment

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

You haven't resolved all of the conversations yet. It's hard for me to find new problems when I'm noticing old ones

mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_modebase/bounties.lua Outdated Show resolved Hide resolved
@LoneWolfHT
Copy link
Member

I did the remaining suggestions as well. Please let me know which one is still left.

Missed the last part of this.
It's a lot of work for me to go and check for you. Did I give too many review comments at once, making it hard to keep track of them?

You don't waste my time by taking a while to fix things, and the PR isn't urgent, so don't feel rushed.

@farooqkz
Copy link
Contributor Author

farooqkz commented Jul 4, 2023

I did the remaining suggestions as well. Please let me know which one is still left.

Missed the last part of this. It's a lot of work for me to go and check for you. Did I give too many review comments at once, making it hard to keep track of them?

Yeah I'd say so and GH's UI is not very good for such these stuff IMO.

You don't waste my time by taking a while to fix things, and the PR isn't urgent, so don't feel rushed.

Ah I feel rushed because I want to have the fun in game :) But I guess I should slow down if I am to do it right and well.

@farooqkz farooqkz requested a review from LoneWolfHT July 4, 2023 07:40
Co-authored-by: LoneWolfHT <lonewolf04361@gmail.com>
@farooqkz farooqkz mentioned this pull request May 20, 2024
1 task
@LoneWolfHT
Copy link
Member

If you rebase this I think it's ready for a testing session

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

Successfully merging this pull request may close these issues.

3 participants