Skip to content

Commit

Permalink
refactor: rewrite of Squads module
Browse files Browse the repository at this point in the history
  • Loading branch information
Eredrim committed Jun 26, 2024
1 parent b92bd41 commit 545e2b3
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 67 deletions.
63 changes: 40 additions & 23 deletions doc/mods/squads.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,60 @@
# Squads

## Description
## About

This mod allow players to make squads. Instead of respawning anywhere / at the team spawn, you spawn at a random squad member.
This mod makes possible to create squads of players. Instead of respawning anywhere / at the team spawn, a squad player
will respawn to a random mate position.

Squads are an addition to teams or even a replacement (in case of a FFA arena).
Squads are an addition to teams or may a way to group players in FFA arenas.

## Installation

Installation of this module can be done in a normal way. You'll find installation process in [modules page](../modules.md#installing-modules) of the doc.

## Usage
## Setup

Place signs, similar to the Class Signs:
This mod works signs to join and leave squads. So, you have to create them.
If you want players can switch between squads during a game (c.f. config settings), you should place squads signs in
the battlefield, in the spawn areas. Otherwise, you should place them directly in the lounges.

```
[Squad name]
[ignored]
free
free
```
1. Create a squad using the `/pa [arena] !sq add [squadName] [playerLimit]` command.

You can add another (one) sign below for display of more player names

## Config settings ( in your arena config file )
2. Then create the join sign using the following template:
```
[Squad name]
[what you want / ignored]
empty
empty
```
For instance, for a squad named "icebreakers", you can create a sign like this:
```
Icebreakers
<=================>
```
- modules.squads.ingameSquadSwitch \- allow switching squads ingame
You can add another one or multiple blank signs **below** to display of more player names.
## Commands
- `/pa [arena] !sq` \- show the arena squads
- `/pa [arena] !sq add [name] [limit]` \- add squad with player limit (set to 0 to remove limit)
- `/pa [arena] !sq remove [name]` \- remove squad [name]
- `/pa [arena] !sq set [name] [limit]` \- set player limit for squad
3. Do the same thing for all squads
<br>
## Warnings
> **🚩 Tips:**
> - All the squads can be created in a first time with the command and then all signs can be placed.
> Order doesn't matter.
> - The squad name is case-insensitive and supports sign colors
\-
## Config settings
## Dependencies
- **modules.squads.ingameSquadSwitch**: allow switching squads ingame (default: false)
\-
## Commands
- `/pa [arena] !sq` \- show the arena squads
- `/pa [arena] !sq add [squadName] [playerLimit]` \- add squad with player limit (set to 0 to remove limit)
- `/pa [arena] !sq remove [squadName]` \- remove squad [name]
- `/pa [arena] !sq set [squadName] [playerLimit]` \- set player limit for squad
83 changes: 41 additions & 42 deletions doc/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,47 @@ more information.

Hook into many different aspects of the game!

| Mod | Description | Type | Status |
|----------------------------------------------------|---------------------------------------------------------------------------------------------------------|----------|--------|
| [AfterMatch](mods/aftermatch.md) | could also be called "Sudden Death" | | ✔️️ |
| [Announcements](mods/announcements.md) | announce events happening | | ✔️️ |
| [ArenaMaps](mods/arenamaps.md) | a live refreshed map to never lose yourself ever again! | | ✔️️ |
| [BanKick](mods/bankick.md) | ban or kick a player of an arena | | ✔️️ |
| [BattlefieldJoin](mods/battlefieldjoin.md) | join directly your battlefield without using the lounge | JOIN | ✔️️ |
| [BetterClasses](mods/betterclasses.md) | add potion effects and more to specific classes | | ✔️️ |
| [BetterGears](mods/bettergears.md) | automatically colorize classes armors to suit team color | | ✔️️ |
| [BetterFight](mods/betterfight.md) | pack of fun features : one-shot items, kill sounds and explosions on death | | ✔️️ |
| [BetterKillstreaks](mods/betterkillstreaks.md) | reward kill streaks with items or potion effects | | ✔️️ |
| [BlockDissolve](mods/blockdissolve.md) | dissolve blocks under fighting players | | ✔️️ |
| [BlockRestore](mods/blockrestore.md) | restore the battlefield | | ✔️️ |
| [ChestFiller](mods/chestfiller.md) | fill battlefield containers with random and customizable content! | | ✔️️ |
| [Duel](mods/duel.md) | duel someone! | | ⚠️️ |
| [EventActions](mods/eventactions.md) | trigger actions at different moments of the arena lifecycle | | ✔️️ |
| [FlySpectate](mods/flyspectate.md) | have players spectating a fight in fly mode | SPECTATE | ✔️️ |
| [ItemSpawners](mods/itemspawners.md) | spawn (random) items on different points | | ✔️️ |
| [LateLounge](mods/latelounge.md) | keep playing until enough players joined the arena | | ✔️️ |
| [PlayerFinder](mods/playerfinder.md) | allow players to find others with a compass | | ✔️️ |
| [Points](mods/points.md) | allow to restrict certain classes to require players to fight for better classes | | ⚠️ |
| [PowerUps](mods/powerups.md) | spawn items giving special powers | | ☑️️ |
| [Projectiles](mods/projectiles.md) | add knockback to throwable items (snowballs, eggs, etc) | | ✔️️ |
| [QuickLounge](mods/quicklounge.md) | join a lounge which starts the game automatically | JOIN | ✔️️ |
| [RealSpectate](mods/realspectate.md) | spectate the game, CounterStrike style! | SPECTATE | ✔️️ |
| [RespawnRelay](mods/respawnrelay.md) | add a relay for respawning players | | ✔️️ |
| [Skins](mods/skins.md) | add custom skins to teams/classes | ||
| [SpawnCollections](mods/spawncollections.md) | save different spawn configurations of the battlefield and switch between them | | ✔️️ |
| [Spectate](mods/spectate.md) | use the new 1.8 SPECTATOR mode to allow flying and POV spectating | SPECTATE | ✔️️ |
| StandardLounge | Default lounge module | JOIN | ✔️️ |
| StandardSpectate | Default spectate module (survival mode) | SPECTATE | ✔️️ |
| [Squads](mods/squads.md) | add squads to the game, basically only showing players belonging together apart from teams and classes. | | ☑️️ |
| [StartFreeze](mods/startfreeze.md) | freeze players at start | | ✔️️ |
| [TeamSizeRestrict](mods/teamsizerestrict.md) | a small mod to restrict the size of specific teams | | ✔️️ |
| [TempPerms](mods/tempperms.md) | add temporary perms | | ✔️️ |
| [Titles](mods/titles.md) | send messages to players as the "title" command would do | | ✔️️ |
| [Turrets](mods/turrets.md) | add turrets where players fire projectiles | | ⚠️ |
| [Vault](mods/vault.md) | add economy, money rewards and bet features | | ✔️️ |
| [Walls](mods/walls.md) | define wall regions to simulate "The Walls" | | ⚠️ |
| [WarmupJoin](mods/warmupjoin.md) | ??? | JOIN | ⚠️ |
| [WorldEdit](mods/worldedit.md) | backup/restore regions | | ✔️️ |
| [WorldGuard](mods/worldguard.md) | import region definitions from WorldGuard | | ⚠️ |
| Mod | Description | Type | Status |
|------------------------------------------------|----------------------------------------------------------------------------------|----------|--------|
| [AfterMatch](mods/aftermatch.md) | could also be called "Sudden Death" | | ✔️️ |
| [Announcements](mods/announcements.md) | announce events happening | | ✔️️ |
| [ArenaMaps](mods/arenamaps.md) | a live refreshed map to never lose yourself ever again! | | ✔️️ |
| [BanKick](mods/bankick.md) | ban or kick a player of an arena | | ✔️️ |
| [BattlefieldJoin](mods/battlefieldjoin.md) | join directly your battlefield without using the lounge | JOIN | ✔️️ |
| [BetterClasses](mods/betterclasses.md) | add potion effects and more to specific classes | | ✔️️ |
| [BetterGears](mods/bettergears.md) | automatically colorize classes armors to suit team color | | ✔️️ |
| [BetterFight](mods/betterfight.md) | pack of fun features : one-shot items, kill sounds and explosions on death | | ✔️️ |
| [BetterKillstreaks](mods/betterkillstreaks.md) | reward kill streaks with items or potion effects | | ✔️️ |
| [BlockDissolve](mods/blockdissolve.md) | dissolve blocks under fighting players | | ✔️️ |
| [BlockRestore](mods/blockrestore.md) | restore the battlefield | | ✔️️ |
| [ChestFiller](mods/chestfiller.md) | fill battlefield containers with random and customizable content! | | ✔️️ |
| [Duel](mods/duel.md) | duel someone! | | ⚠️️ |
| [EventActions](mods/eventactions.md) | trigger actions at different moments of the arena lifecycle | | ✔️️ |
| [FlySpectate](mods/flyspectate.md) | have players spectating a fight in fly mode | SPECTATE | ✔️️ |
| [ItemSpawners](mods/itemspawners.md) | spawn (random) items on different points | | ✔️️ |
| [LateLounge](mods/latelounge.md) | keep playing until enough players joined the arena | | ✔️️ |
| [PlayerFinder](mods/playerfinder.md) | allow players to find others with a compass | | ✔️️ |
| [Points](mods/points.md) | allow to restrict certain classes to require players to fight for better classes | | ⚠️ |
| [PowerUps](mods/powerups.md) | spawn items giving special powers | | ☑️️ |
| [Projectiles](mods/projectiles.md) | add knockback to throwable items (snowballs, eggs, etc) | | ✔️️ |
| [QuickLounge](mods/quicklounge.md) | join a lounge which starts the game automatically | JOIN | ✔️️ |
| [RealSpectate](mods/realspectate.md) | spectate the game, CounterStrike style! | SPECTATE | ✔️️ |
| [RespawnRelay](mods/respawnrelay.md) | add a relay for respawning players | | ✔️️ |
| [Skins](mods/skins.md) | add custom skins to teams/classes | ||
| [SpawnCollections](mods/spawncollections.md) | save different spawn configurations of the battlefield and switch between them | | ✔️️ |
| [Spectate](mods/spectate.md) | use the new 1.8 SPECTATOR mode to allow flying and POV spectating | SPECTATE | ✔️️ |
| StandardLounge | Default lounge module | JOIN | ✔️️ |
| StandardSpectate | Default spectate module (survival mode) | SPECTATE | ✔️️ |
| [Squads](mods/squads.md) | add squads to the game, create group of players respawning together | | ✔️️ |
| [StartFreeze](mods/startfreeze.md) | freeze players at start | | ✔️️ |
| [TeamSizeRestrict](mods/teamsizerestrict.md) | a small mod to restrict the size of specific teams | | ✔️️ |
| [TempPerms](mods/tempperms.md) | add temporary perms | | ✔️️ |
| [Titles](mods/titles.md) | send messages to players as the "title" command would do | | ✔️️ |
| [Turrets](mods/turrets.md) | add turrets where players fire projectiles | | ⚠️ |
| [Vault](mods/vault.md) | add economy, money rewards and bet features | | ✔️️ |
| [Walls](mods/walls.md) | define wall regions to simulate "The Walls" | | ⚠️ |
| [WarmupJoin](mods/warmupjoin.md) | ??? | JOIN | ⚠️ |
| [WorldEdit](mods/worldedit.md) | backup/restore regions | | ✔️️ |

**Key :** ✔️️ Adapted and fully tested for 2.0 | ☑️ Fully works with previous PVPArena version, but not tested with 2.0 | ⚠️ Legacy modules, not tested for a while | ❌ Temporarily unavailable

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/slipcor/pvparena/core/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,7 @@ public enum CFG {

MODULES_SKINS_VANILLA("modules.skins.vanilla", false, "Skins"),

MODULES_SQUADS_AUTOSQUAD("modules.squads.autoSquad", "none", "Squads"),
MODULES_SQUADS_INGAMESWITCH("modules.squads.ingameSquadSwitch", true, "Squads"),
MODULES_SQUADS_INGAMESWITCH("modules.squads.ingameSquadSwitch", false, "Squads"),

MODULES_STARTFREEZE_TIMER("modules.startfreeze.freezetimer", 5, "StartFreeze"),

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/slipcor/pvparena/core/Language.java
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,8 @@ public enum MSG {
MODULE_SQUADS_SET("nulang.mod.squads.set", "Squad %1% has been set"),
MODULE_SQUADS_REMOVED("nulang.mod.squads.removed", "Squad %1% has been removed"),
MODULE_SQUADS_NOTEXIST("nulang.mod.squads.notexist", "Squad %1% doesn't exist!"),
MODULE_SQUADS_JOIN("nulang.mod.squads.join", "You have joined the squad &b%1%&r!"),
MODULE_SQUADS_LEAVE("nulang.mod.squads.leave", "You left the squad &b%1%&r!"),
MODULE_SQUADS_ERROR("nulang.mod.squads.error", "Error while editing squads, syntax is not correct!"),
MODULE_SQUADS_FULL("nulang.mod.squads.full", "This squad is full!"),
MODULE_SQUADS_HELP("nulang.mod.squads.help", "/pa !sq | show the arena squads\n/pa !sq add [name] [limit] | add squad with player limit (set to 0 for no limit)\n/pa !sq set [name] [limit] | set player limit for squad\n/pa !sq remove [name] | remove squad [name]"),
Expand Down

0 comments on commit 545e2b3

Please sign in to comment.