feat: Add new effects for player interactions and NPC management
- Introduced DismountPlayerEffect to handle player dismounting from NPCs. - Added MountPlayerEffect for mounting players onto NPCs with configurable parameters. - Implemented PlaceBlocksEffect to allow block placement in specified regions. - Created RespawnPlayerEffect with improved destination resolution for player respawns. - Added SetPlayerLoadoutEffect to manage player loadouts dynamically. - Introduced SetPlayerStatusEffect to manage player statuses with additional activation logic. - Created SpawnNpcEffect for spawning and managing NPCs with respawn capabilities. - Updated language files to include tooltips and descriptions for new effects.
This commit is contained in:
+49
-16
@@ -18,7 +18,7 @@ Minigame definitions live in `src/main/resources/Server/Minigames/<Id>.json`. JS
|
||||
| Field | Type | Required | Default | Description |
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `WorldId` | String | No | `""` | Optional world identifier. |
|
||||
| `RequiredGameMode` | String | No | `"adventure"` | Game mode expected for players. |
|
||||
| `RequiredGameMode` | Enum | No | `Adventure` | Game mode applied to each player when they become active. |
|
||||
|
||||
## Players
|
||||
|
||||
@@ -26,6 +26,7 @@ Minigame definitions live in `src/main/resources/Server/Minigames/<Id>.json`. JS
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `MinPlayers` | Integer | No | `1` | Minimum player count. |
|
||||
| `MaxPlayers` | Integer | No | `16` | Maximum player count. |
|
||||
| `DefaultPlayerLives` | Integer | No | `0` | Initial lives assigned to each player when a queued runtime starts. |
|
||||
| `AllowJoinMidgame` | Boolean | No | `false` | Whether players can join after the game starts. |
|
||||
| `AllowSpectators` | Boolean | No | `true` | Whether spectators are allowed. |
|
||||
|
||||
@@ -34,8 +35,8 @@ Minigame definitions live in `src/main/resources/Server/Minigames/<Id>.json`. JS
|
||||
| Field | Type | Required | Default | Description |
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `TeamMode` | Enum | No | `SOLO` | `SOLO`, `TEAMS`, or `FREE_FOR_ALL`. |
|
||||
| `TeamCount` | Integer | No | `0` | Number of teams when team mode is enabled. `0` means automatic. |
|
||||
| `PlayersPerTeam` | Integer | No | `0` | Maximum players per team. `0` means no explicit limit. |
|
||||
| `TeamCount` | Integer | No | `0` | Explicit number of teams when using `BalanceTeams`. `0` defers to `PlayersPerTeam`. |
|
||||
| `PlayersPerTeam` | Integer | No | `0` | When `TeamCount` is `0`, `BalanceTeams` divides total players by this to determine team count. `0` means no automatic splitting. |
|
||||
|
||||
## Timing
|
||||
|
||||
@@ -44,14 +45,14 @@ Minigame definitions live in `src/main/resources/Server/Minigames/<Id>.json`. JS
|
||||
| `RoundLengthSeconds` | Integer | No | `300` | Active round duration. |
|
||||
| `TotalRounds` | Integer | No | `1` | Number of rounds to run. Values less than or equal to `0` allow open-ended round progression. |
|
||||
| `CountdownSeconds` | Integer | No | `10` | Pre-game countdown duration. |
|
||||
| `OvertimeEnabled` | Boolean | No | `false` | Enables overtime handling. |
|
||||
| `SuddenDeathEnabled` | Boolean | No | `false` | Enables sudden-death handling. |
|
||||
| `OvertimeEnabled` | Boolean | No | `false` | When the final round ends, sets the phase to `OVERTIME` and dispatches `on_overtime_start` before `on_game_rounds_complete`. |
|
||||
| `SuddenDeathEnabled` | Boolean | No | `false` | When the final round ends (after overtime if also enabled), sets the phase to `SUDDEN_DEATH` and dispatches `on_sudden_death_start`. |
|
||||
|
||||
## Win Condition
|
||||
|
||||
| Field | Type | Required | Default | Description |
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `WinCondition` | Enum | No | `HIGHEST_SCORE` | How the winner is determined. |
|
||||
| `WinCondition` | Enum | No | `HIGHEST_SCORE` | How the winner is determined. Affects end-score display order and reward distribution. |
|
||||
| `MapSelectionMode` | Enum | No | `VOTE` | How a waiting session chooses a discovered map: `VOTE` or `RANDOM`. |
|
||||
| `FriendlyFireKillScoreMode` | Enum | No | `NO_POINTS` | How same-team player kills affect kill scoring: `OFF`, `LOSES_POINTS`, or `NO_POINTS`. |
|
||||
|
||||
@@ -59,7 +60,8 @@ Supported values:
|
||||
|
||||
| Value | Description |
|
||||
|-------|-------------|
|
||||
| `HIGHEST_SCORE` | Highest score at the end wins. |
|
||||
| `HIGHEST_SCORE` | Highest score at the end wins. Players ranked descending. |
|
||||
| `LOWEST_SCORE` | Lowest score at the end wins. Players ranked ascending. |
|
||||
| `FIRST_TO_SCORE` | First player or team to a target score wins. |
|
||||
| `LAST_ALIVE` | Last active player or team wins. |
|
||||
| `OBJECTIVE_COMPLETE` | Objective completion determines the winner. |
|
||||
@@ -70,23 +72,24 @@ Supported values:
|
||||
| Field | Type | Required | Default | Description |
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `AllowPvp` | Boolean | No | `false` | Whether players can damage each other. |
|
||||
| `AllowBlockBreaking` | Boolean | No | `false` | Whether blocks can be broken. |
|
||||
| `AllowBlockPlacing` | Boolean | No | `false` | Whether blocks can be placed. |
|
||||
| `AllowBlockBreaking` | Boolean | No | `false` | Whether blocks can be broken. Readable via definition; enforcement relies on `RequiredGameMode` (`Adventure` blocks both break and place by default). |
|
||||
| `AllowBlockPlacing` | Boolean | No | `false` | Whether blocks can be placed. Same enforcement note as above. |
|
||||
|
||||
## Inventory
|
||||
## Lifecycle
|
||||
|
||||
| Field | Type | Required | Default | Description |
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `SavePlayerInventory` | Boolean | No | `true` | Save player inventory on join. |
|
||||
| `RestorePlayerInventory` | Boolean | No | `true` | Restore player inventory when the game ends. |
|
||||
| `ResetOnEnd` | Boolean | No | `true` | Reset runtime state when the game ends. |
|
||||
| `ResetOnEnd` | Boolean | No | `true` | After clearing runtime state at game end, dispatches `on_arena_reset` so trigger volumes can reset world state. |
|
||||
| `SavePlayerInventory` | Boolean | No | `true` | Saves each player's inventory the first time they become `ACTIVE`. Restored on game end if `RestorePlayerInventory` is true. |
|
||||
| `RestorePlayerInventory` | Boolean | No | `true` | Restores each player's saved inventory when the game ends. |
|
||||
|
||||
## Items
|
||||
|
||||
| Field | Type | Required | Default | Description |
|
||||
|-------|------|----------|---------|-------------|
|
||||
| `StartItems` | `ItemStackConfig[]` | No | `[]` | Items given to players at game start. |
|
||||
| `Rewards` | `RewardConfig[]` | No | `[]` | Rewards distributed at game end. |
|
||||
| `StartItems` | `ItemStackConfig[]` | No | `[]` | Items given to each player when they become `ACTIVE`, if they have no assigned loadout. |
|
||||
| `StartLoadouts` | `LoadoutConfig[]` | No | `[]` | Named item loadouts. A player's assigned loadout (set via `SetPlayerLoadout`) takes priority over `StartItems`. |
|
||||
| `Rewards` | `RewardConfig[]` | No | `[]` | Rewards distributed at game end, before `on_game_end` fires. |
|
||||
|
||||
## ItemStackConfig
|
||||
|
||||
@@ -102,6 +105,28 @@ Supported values:
|
||||
| `ItemId` | String | Yes | Hytale item ID. |
|
||||
| `Amount` | Integer | Yes | Stack amount. |
|
||||
|
||||
## LoadoutConfig
|
||||
|
||||
```json
|
||||
{
|
||||
"Id": "archer",
|
||||
"DisplayName": "Archer",
|
||||
"Items": [
|
||||
{ "ItemId": "hunting_bow", "Amount": 1 },
|
||||
{ "ItemId": "arrow", "Amount": 32 }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| `Id` | String | Yes | Loadout ID referenced by `SetPlayerLoadout`. |
|
||||
| `DisplayName` | String | No | Player-facing name for UI display. |
|
||||
| `Items` | `ItemStackConfig[]` | No | Items given when this loadout is applied. |
|
||||
| `PlayerCustomizable` | Boolean | No | Reserved for a future loadout-selection UI. When `true`, item giving is skipped at activation. Defaults to `false`. |
|
||||
|
||||
Loadouts are selected by a `SetPlayerLoadout` effect before the player becomes `ACTIVE`. If no loadout is assigned, `StartItems` is used as a fallback.
|
||||
|
||||
## RewardConfig
|
||||
|
||||
```json
|
||||
@@ -115,9 +140,17 @@ Supported values:
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| `Target` | String | Yes | `winner`, `participant`, `team_winner`, or a team ID. |
|
||||
| `Target` | String | Yes | Who receives the reward. See target values below. |
|
||||
| `Items` | `ItemStackConfig[]` | Yes | Items to grant. |
|
||||
|
||||
Reward target values:
|
||||
|
||||
| Value | Recipients |
|
||||
|-------|------------|
|
||||
| `all` | Every player in the runtime. |
|
||||
| `winner` | The player ranked first (rank determined by `WinCondition`). |
|
||||
| `top_N` | Top N players, e.g. `top_3`. |
|
||||
|
||||
## Minimal Example
|
||||
|
||||
```json
|
||||
|
||||
Reference in New Issue
Block a user