Skip to content

Add the possible to add custom suggestion to each parameter #108

Description

@Simferoce

It would be appreciate if we could have the capacity to add suggestion for the "Character" and "BuffName" parameters.

[ConsoleMethod("buff", "Apply a buff to the given character")]
public static void ApplyBuff(string character, string buffName)
{
    if (GameFlowManager.Instance.CurrentState is Battle battle)
    {
        if (character == "player")
        {
            BattleCharacter battleCharacter = battle.BattleCharacters.FirstOrDefault(x => x.Agent is BattlePlayerAgent);
            if (battleCharacter == null)
            {
                Debug.LogWarning($"The is no battle character owned by the player during the execution of the command \"buff\".");
            }

            List<BattleBuffDefinition> battleBuffDefinitions = AssetProviderManager.Instance.Get<BattleBuffDefinition>();
            BattleBuffDefinition battleBuffDefinition = battleBuffDefinitions.FirstOrDefault(x => x.name == buffName);
            if (battleBuffDefinition == null)
            {
                Debug.LogWarning($"Could not find the buff with the name \"{buffName}\" during the execution of the command \"buff\".");
            }

            battleCharacter.BattleBuffApplier.Apply(battleBuffDefinition, battleCharacter);
        }
        else
        {
            Debug.LogWarning($"Could not resolve \"{character}\" as a valid parameter for the command \"buff\".");
        }
    }
    else
    {
        Debug.LogWarning("The command \"buff\" can only be used in a \"Battle\".");
    }
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions