apace100 / apoli

MIT License
40 stars 46 forks source link

Add "teammates" bi-entity condition #244

Open shap-po opened 4 months ago

shap-po commented 4 months ago

This PR adds a condition that checks if two entities are on the same team. The condition has a boolean "allow_empty" field (false by default), allowing flexibility in considering entities without teams as teammates.

Usage example:

{
    "type": "apoli:action_on_hit",
    "bientity_action": {
      "type": "apoli:if_else",
      "condition": {
        "type": "apoli:teammates",
        "allow_empty": true
      },
      "if_action": {
        "type": "apoli:actor_action",
        "action": {
          "type": "apoli:execute_command",
          "command": "say True"
        }
      },
      "else_action": {
        "type": "apoli:actor_action",
        "action": {
          "type": "apoli:execute_command",
          "command": "say False"
        }
      }
    }
  }