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

[REQUEST] Framework for tracking round number of a skill for an entity #351

Open
Darxo opened this issue May 3, 2024 · 1 comment
Open
Labels
feature request A feature requested by the community

Comments

@Darxo
Copy link

Darxo commented May 3, 2024

Is your feature request related to a problem? Please describe.
Some skills can only be used once per turn or round on the same entity. Turn and Round is so closely related that they can often just conbined to once per round.
If we want to track whether we already used a skill on an entity we can do either of two things:

  • add a dummy skill on the target which is removed at the end of the round, which we then check for
  • add a flag in the tactical manager that consists of a combination of the targeted entity id and the skill id, which we then check for. This flag will then have the round written into it, when the entity was targeted by the skill.

As the variant with flags is potentially much cleaner and performant I suggest implementing native support for it in msu.

Describe the solution you'd like
Implement an framework into skill.nut consisting of the following two functions

// Write the current round number in a tactical manager flag that consists of the id of an entity and the id of this skill
function markEntityWithRound( _entity )
{
	::Tactical.Entities.getFlags().set(_targetEntity.getID() + this.getID() + "MarkedWithRoundNumber", ::Time.getRound());
}

// Return the round number imprinted into a tactical manager flag for that entity; Returns 0 if no flag exists yet for it
function getRoundOfMarkedEntity( _entity )
{
	if (::Tactical.Entities.getFlags().has(_targetEntity.getID() + this.getID() + "MarkedWithRoundNumber"))
	{
		return ::Tactical.Entities.getFlags().get(_targetEntity.getID() + this.getID() + "MarkedWithRoundNumber");
	}
	
	return 0;
}
@Darxo Darxo added the feature request A feature requested by the community label May 3, 2024
@LordMidas
Copy link
Member

I think this is an extremely niche use case and does not need a framework in MSU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature requested by the community
Projects
None yet
Development

No branches or pull requests

2 participants