capturetheflag icon indicating copy to clipboard operation
capturetheflag copied to clipboard

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

Open farooqkz opened this issue 2 years ago • 12 comments

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 avatar Dec 18 '22 18:12 farooqkz

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

farooqkz avatar Dec 19 '22 04:12 farooqkz

Global functions must go in their mod's namespace table

LoneWolfHT avatar Dec 21 '22 21:12 LoneWolfHT

Global functions must go in their mod's namespace table

May you give an example how?

farooqkz avatar Dec 23 '22 09:12 farooqkz

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 avatar Dec 24 '22 01:12 LoneWolfHT

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)

LoneWolfHT avatar Jan 14 '23 17:01 LoneWolfHT

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.

farooqkz avatar Jan 15 '23 08:01 farooqkz

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.

MrRar avatar Jan 24 '23 15:01 MrRar

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 avatar Jan 24 '23 16:01 farooqkz

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?

farooqkz avatar Mar 17 '23 06:03 farooqkz

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 avatar Mar 25 '23 06:03 tigercoding56

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)

tigercoding56 avatar Mar 25 '23 06:03 tigercoding56

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

farooqkz avatar Mar 25 '23 14:03 farooqkz

Closing in favor of https://github.com/MT-CTF/capturetheflag/pull/1321

farooqkz avatar Jun 29 '24 19:06 farooqkz