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 classes #389

Merged
merged 15 commits into from
Mar 14, 2020
Merged

Add classes #389

merged 15 commits into from
Mar 14, 2020

Conversation

rubenwardy
Copy link
Member

@rubenwardy rubenwardy commented Mar 21, 2019

image

Please note that you need to apply an engine patch in order to have accurate health bar points.

Copy link
Contributor

@ClobberXD ClobberXD left a comment

Choose a reason for hiding this comment

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

Couple of comments. I understand that this is still WIP, but I couldn't resist. :)

I also think it's better to rename the knight and archer classes to more generic names (at least the archer). Maybe assault and support? We don't even have bows in the game, and referring to players wielding sniper rifles as archers is a little misleading. ;)

mods/ctf/ctf_classes/init.lua Outdated Show resolved Hide resolved
@ClobberXD
Copy link
Contributor

I'm very happy to see an effort being made in this direction. Great work. 👍

@ClobberXD
Copy link
Contributor

  • I see lotsa colour hardcoding. :/

    I suggest having neutral textures, and applying texture modifiers based on team colour.

  • The classes API could be improved by allowing ctf_classes.register to take a table as param, which lists all properties of that class. e.g.

    ctf_classes.register("new_class", {
      description = "New class",
      properties = {
      	speed = 1,
      	max_hp = 20,
      	-- More properties that can be thought of later
      }
    }
  • Currently, right-clicking the flags opens up a news panel, which is only really useful for long-term kingdom vs kingdom games. I suggest adding the ability for players to open the classes formspec by right-clicking on the flag.

@ClobberXD
Copy link
Contributor

Unrelated commits: 8c399ee and 1a13fcb. These are already a part of master. So... remove these from this PR?

@rubenwardy
Copy link
Member Author

I see lotsa colour hardcoding. :/

I suggest having neutral textures, and applying texture modifiers based on team colour.

This is inflexible and also more complicated. Hardcoding can be good at reducing complexity. However it's a good idea to reduce the number of places which have hardcoded things, which is why, for example, we use ctf_color.get_color rather than just have if statements everywhere

The classes API could be improved by allowing ctf_classes.register to take a table as param, which lists all properties of that class. e.g.

This already happens, see init.lua

Currently, right-clicking the flags opens up a news panel, which is only really useful for long-term kingdom vs kingdom games. I suggest adding the ability for players to open the classes formspec by right-clicking on the flag.

This already happens

@rubenwardy rubenwardy force-pushed the classes branch 2 times, most recently from 93c264c to 6817310 Compare March 22, 2019 22:49
@ClobberXD
Copy link
Contributor

ClobberXD commented Mar 23, 2019

Currently, right-clicking the flags opens up a news panel, which is only really useful for long-term kingdom vs kingdom games. I suggest adding the ability for players to open the classes formspec by right-clicking on the flag.

This already happens

I missed that change. Nice! 👍

The classes API could be improved by allowing ctf_classes.register to take a table as param, which lists all properties of that class. e.g.

This already happens, see init.lua

I think you misunderstood. See https://github.com/MT-CTF/capturetheflag/pull/389/files#diff-162a1d6f9c661726680d0f44a5e8d794R15-R16. speed and max_hp are defined outside the table as special properties, and the table itself contains only a list of descriptions (be it pros or cons). I meant something like the following:

ctf_classes.register("knight", {
	description = "Knight",
	pros = { "+50% Health Points" },
	cons = { "-10% speed" },
	properties = {
		max_hp = 30,
		speed = 0.90
	},
	color = "#ccc",
})

This approach can allow more properties to be added later, because all fields in properties table are parsed instead of two hard-coded fields speed and max_hp. This requires more coding though and can be implemented later if required - I think this is fine as it is at the moment.

@JostP
Copy link
Member

JostP commented May 18, 2019

Maybe it would be good if guns had longer range for archers. Shotgun has range only 50 currently.

@ClobberXD
Copy link
Contributor

ClobberXD commented Jun 22, 2019

Maybe it would be good if guns had longer range for archers. Shotgun has range only 50 currently.

A range of 50 is already too much. A shotgun is only effective at close-range, and at 50m the pellets would've dispersed so much that there would be no substantial damage to the target anyway.

If you take other guns into consideration, well there's only so far we can see without in MT without zoom. Unless you have an 8K display fitted with an electron microscope, a very high range won't make much sense. ;)

@rubenwardy
Copy link
Member Author

This is now ready for review, and I've tested all the features locally

@JostP
Copy link
Member

JostP commented Aug 29, 2019

Do medic have free bandages?

@rubenwardy
Copy link
Member Author

grenades are infinite

turns out creative was enabled 😮

mods/other/random_messages/init.lua Outdated Show resolved Hide resolved
mods/pvp/shooter/grapple.lua Outdated Show resolved Hide resolved
mods/ctf/ctf_classes/regen.lua Show resolved Hide resolved
mods/ctf/ctf_classes/gui.lua Outdated Show resolved Hide resolved
@rubenwardy
Copy link
Member Author

rubenwardy commented Mar 14, 2020

Bugs

general

  • spawned with steel sword as sharp shooter (I can't reproduce this)
  • can't change class on captured top of flag
  • broken GUI for change class

grapples

  • Shooting just a grapple gives many more uses than shooting with a gun
  • empty grapple and hooks aren't removed on death. Same for putting in a chest etc
  • grappling hooks don't work on slabs
  • grappling hooks can fly off and disappear
  • can throw hooks when holding the flag
  • can grapple into a one node tall space
  • grapple hooks can be used by more than just shooters

Future

Things to fix in future PRs

  • infinite ammo for rifle
  • more damage for guns with shooter
  • change medic to support, ammo regen
  • add crafting of rockets
  • -20% when rocket launcher is equiped
  • prevent other classes from using rocket launcher

@rubenwardy rubenwardy merged commit 85bf7b9 into master Mar 14, 2020
@rubenwardy rubenwardy deleted the classes branch March 14, 2020 20:00
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.

7 participants