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

Make stealing from enemy teamchest(s) possible while they are open #1071

Closed
wants to merge 11 commits into from

Conversation

farooqkz
Copy link
Contributor

Issue: #1058

I'm working on it. Currently the algorithm is as such:

  • Keep a list of players who have opened the teamchest in openers(in mods/ctf/ctf_modes/ctf_modes_classic/init.lua)
  • Remove the player on death or leave
  • Check every 2 seconds using minetest.after(), if more than 5 seconds has been elasped, remove the player from openers
  • if length of openers is zero, the chest is closed

Meanwhile I'm working on it, you can check if the sound clip I've used for stealing alarm is good.

@farooqkz farooqkz marked this pull request as ready for review December 19, 2022 04:34
@farooqkz
Copy link
Contributor Author

It's ready. Please someone tell me how to make luacheck happy :)

@LoneWolfHT
Copy link
Member

Global functions must go in their mod's namespace table

@farooqkz
Copy link
Contributor Author

Global functions must go in their mod's namespace table

May you give an example how?

@LoneWolfHT
Copy link
Member

LoneWolfHT commented Dec 24, 2022

The ctf_teams namespace table is ctf_teams, global functions in that mod's code are put in that table (ctf_teams.get_team(), etc)

@LoneWolfHT
Copy link
Member

LoneWolfHT commented Jan 14, 2023

You commited changes to the map submodule again.

Try

cd capturetheflag/mods/ctf/ctf_map/maps/
git remote update
git checkout origin/master
cd ../../../..
git status

and showing the output of that last git status (You will need to edit the cd command's path for it to work)

@farooqkz
Copy link
Contributor Author

You commited changes to the map submodule again.

Try

cd capturetheflag/mods/ctf/ctf_map/maps/
git remote update
git checkout origin/master
cd ../../../..
git status

and showing the output of that last git status (You will need to edit the cd command's path for it to work)

I will do it when I have the stealing feature done.

@MrRar
Copy link
Contributor

MrRar commented Jan 24, 2023

I think it should be easier than that to steal from the enemy chest. I think if you can get all the way into the enemy base you should be able to take whatever you want from the team chest even if no one is currently in it.

@farooqkz
Copy link
Contributor Author

farooqkz commented Jan 24, 2023

I think it should be easier than that to steal from the enemy chest. I think if you can get all the way into the enemy base you should be able to take whatever you want from the team chest even if no one is currently in it.

I disagree. As a player I know that getting to enemy teamchest is not that hard.

Edit: On most maps, getting to enemy base is easy as a pie if you don't want to get to there fast.

@farooqkz farooqkz changed the title Make stealing from enemy teamchest(s) possible while they are open WIP: Make stealing from enemy teamchest(s) possible while they are open Mar 9, 2023
@farooqkz farooqkz changed the title WIP: Make stealing from enemy teamchest(s) possible while they are open Make stealing from enemy teamchest(s) possible while they are open Mar 9, 2023
@farooqkz farooqkz marked this pull request as draft March 9, 2023 18:03
@farooqkz
Copy link
Contributor Author

To make it even more challenging I propose this:

  • An enemy must hit the teamchest to steal something from it
  • Upon hitting, the game chooses a slot randomly and adds its item to the hitter inventory. The chosen slot might be possibly empty
  • The teamchest screams anyway even if it's closed or no item was stolen(or in other words, an empty slot was randomly chosen).

Opinions?

@tigercoding56
Copy link

I think it should be easier than that to steal from the enemy chest. I think if you can get all the way into the enemy base you should be able to take whatever you want from the team chest even if no one is currently in it.

yes

@tigercoding56
Copy link

To make it even more challenging I propose this:

* An enemy must hit the teamchest to steal something from it

* Upon hitting, the game chooses a slot randomly and adds its item to the hitter inventory. The chosen slot might be possibly empty

* The teamchest screams anyway even if it's closed or no item was stolen(or in other words, an empty slot was randomly chosen).

Opinions?

no if a player has made it into the enemies base they should be able to quickly take their loot (else they will just take the flag and leave)

@farooqkz
Copy link
Contributor Author

I still disagree. Getting to enemy base unnoticed is usually very easy if you spend enough time.

@farooqkz
Copy link
Contributor Author

Closing in favor of #1321

@farooqkz farooqkz closed this Jun 29, 2024
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.

4 participants