Add messages
This commit is contained in:
@@ -16,12 +16,30 @@ data class MessageConfig(
|
||||
val commandMessages: Map<String, String> = getCommandMessages(),
|
||||
|
||||
@ConfigField(name = "death", description = "Death messages")
|
||||
val deathMessages: Map<String, List<String>> = getDeathMessages()
|
||||
val deathMessages: Map<String, List<String>> = getDeathMessages(),
|
||||
|
||||
@ConfigField(name = "kits", description = "Kit messages")
|
||||
val kitMessages: Map<String, KitConfig> = getKitMessages(),
|
||||
|
||||
@ConfigField(name = "kits-default", description = "Default kit messages")
|
||||
val defaultKitMessages: Map<String, String> = getDefaultKitMessages()
|
||||
) {
|
||||
|
||||
data class KitConfig(
|
||||
val name: String = "",
|
||||
val description: List<String>,
|
||||
val items: List<KitItemConfig>,
|
||||
val messages: Map<String, String>
|
||||
)
|
||||
|
||||
data class KitItemConfig(
|
||||
val itemName: String,
|
||||
val playStyleNames: Map<String, String>
|
||||
)
|
||||
|
||||
fun getAllMessages(): Map<String, String>
|
||||
{
|
||||
return defaultMessages + commandMessages
|
||||
return defaultMessages + commandMessages + defaultKitMessages + kitMessages.flatMap { it.value.messages.entries }.associate { it.key to it.value }
|
||||
}
|
||||
|
||||
fun getListMessages(): Map<String, List<String>>
|
||||
@@ -29,6 +47,14 @@ data class MessageConfig(
|
||||
return deathMessages
|
||||
}
|
||||
|
||||
fun getKitItemNames(
|
||||
kit: String,
|
||||
itemKey: String
|
||||
): Map<String, String>?
|
||||
{
|
||||
return kitMessages[ kit ]?.items?.find { it.itemName == itemKey }?.playStyleNames
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun getDefaultMessages(): Map<String, String> = mapOf(
|
||||
@@ -36,7 +62,8 @@ private fun getDefaultMessages(): Map<String, String> = mapOf(
|
||||
"default.no_permission" to "%prefix% <red>You don't have permission to do that!</red>",
|
||||
"default.player_not_found" to "%prefix% <red>This player could not be found!</red>",
|
||||
"default.command_cooldown" to "%prefix% <red>Please wait {time} seconds before using this command again!</red>",
|
||||
"default.reload" to "%prefix% <green>Successfully reloaded the plugin.</green>"
|
||||
"default.reload" to "%prefix% <green>Successfully reloaded the plugin.</green>",
|
||||
"default.only_players" to "%prefix% <red>Only players can execute this command.</red>"
|
||||
)
|
||||
|
||||
private fun getCommandMessages(): Map<String, String> = mapOf(
|
||||
@@ -53,4 +80,115 @@ private fun getDeathMessages(): Map<String, List<String>> = mapOf(
|
||||
"world" to listOf(
|
||||
"<black>☠</black> <red>{player} has died!</red>"
|
||||
)
|
||||
)
|
||||
|
||||
private fun getDefaultKitMessages(): Map<String, String> = mapOf(
|
||||
"kits.missingHits" to ""
|
||||
)
|
||||
|
||||
private fun getKitMessages(): Map<String, MessageConfig.KitConfig> = mapOf(
|
||||
"anchor" to MessageConfig.KitConfig(
|
||||
name = "<dark_gray>Anchor</dark_gray>",
|
||||
description = listOf(
|
||||
"Create an anchor where",
|
||||
"you are lookin and gain no",
|
||||
"knockback in your radius."
|
||||
),
|
||||
items = listOf(MessageConfig.KitItemConfig(
|
||||
itemName = "anvil",
|
||||
playStyleNames = mapOf(
|
||||
"offensive" to "<gray>Anchor (right-click)</gray>",
|
||||
"defensive" to "<gray>Anchor (right-click)</gray>"
|
||||
)
|
||||
)),
|
||||
messages = mapOf(
|
||||
"tooFarAway" to "%prefix% <red>You can only place your anchor in a {radius} block radius!</red>",
|
||||
"alreadyActivated" to "%prefix% <red>You have already placed an anchor!</red>",
|
||||
"broken" to "%prefix% "
|
||||
)
|
||||
),
|
||||
"armorer" to MessageConfig.KitConfig(
|
||||
name = "<gray>Armorer</gray>",
|
||||
description = listOf(
|
||||
"Gain a stronger armor the",
|
||||
"more kills you gain. Every 2",
|
||||
"kills your armor gets better.",
|
||||
"All the way up to iron."
|
||||
),
|
||||
items = emptyList(),
|
||||
messages = mapOf(
|
||||
"upgrade.normal" to "%prefix% <green>Your armor has been upgraded to {armorType}.</green>",
|
||||
"upgrade.enchanted" to "%prefix% <purple>Your armor has been enchanted.</purple>"
|
||||
)
|
||||
),
|
||||
"blackpanther" to MessageConfig.KitConfig(
|
||||
name = "<gradient:purple:blue>Black Panther</gradient>",
|
||||
description = listOf(
|
||||
"Use your abilities to either",
|
||||
"do more damage and push enemies",
|
||||
"away or jump on enemies and",
|
||||
"give them instant damage."
|
||||
),
|
||||
items = listOf(
|
||||
MessageConfig.KitItemConfig(
|
||||
itemName = "blackDye",
|
||||
playStyleNames = mapOf(
|
||||
"offensive" to "<dark_gray>Push</dark_gray> <gray>(right-click)</gray>",
|
||||
"defensive" to "<purple>Wakanda Forever!</purple> <gray>(right-click)</gray>"
|
||||
)
|
||||
),
|
||||
MessageConfig.KitItemConfig(
|
||||
itemName = "blazePowder",
|
||||
playStyleNames = mapOf(
|
||||
"offensive" to "<yellow>Extra Damage</yellow> <gray>(right-click)</gray>",
|
||||
"defensive" to "<yellow>Extra Damage</yellow> <gray>(right-click)</gray>"
|
||||
)
|
||||
)
|
||||
),
|
||||
messages = mapOf(
|
||||
"wakandaForever.hit" to "%prefix% <purple>You have hit {hit} players with WAKANDA FOREVER!</purple>",
|
||||
"extraDamage.activated" to "%prefix% <green>Your extra damage is now activated.</green>",
|
||||
"extraDamage.deactivated" to "%prefix% <red>Your extra damage is now deactivated.</red>"
|
||||
)
|
||||
),
|
||||
"blitzcrank" to MessageConfig.KitConfig(
|
||||
name = "<gradient:orange:yellow>Blitzcrank</gradient>",
|
||||
description = listOf(
|
||||
"Use your abilities to",
|
||||
"slow down enemies and",
|
||||
"either stun or hook them."
|
||||
),
|
||||
items = listOf(
|
||||
MessageConfig.KitItemConfig(
|
||||
itemName = "hots",
|
||||
playStyleNames = mapOf(
|
||||
"defensive" to "<blue>Slow</blue> <gray>(right-click)</gray>",
|
||||
"offensive" to "<blue>Slow</blue> <gray>(right-click)</gray>"
|
||||
)
|
||||
),
|
||||
MessageConfig.KitItemConfig(
|
||||
itemName = "fishingrod",
|
||||
playStyleNames = mapOf(
|
||||
"defensive" to "<gold>Hook</gold> <gray>(right-click)</gray>",
|
||||
"offensive" to "<gold>Hook</gold> <gray>(right-click)</gray>"
|
||||
)
|
||||
),
|
||||
MessageConfig.KitItemConfig(
|
||||
itemName = "pufferfish",
|
||||
playStyleNames = mapOf(
|
||||
"defensive" to "<yellow>Stun</yellow> <gray>(right-click)</gray>",
|
||||
"offensive" to "<yellow>Stun</yellow> <gray>(right-click)</gray>"
|
||||
)
|
||||
)
|
||||
),
|
||||
messages = mapOf(
|
||||
"ultimate.target" to "%prefix% <yellow>You have been slowed by {player}!</yellow>",
|
||||
"ultimate.player" to "%prefix% <blue>You have slowed {nearby} players.</blue>",
|
||||
"no_player_in_sight" to "%prefix% <red>There is no player in your radius and/or sight to hook!</red>",
|
||||
"hook.player" to "%prefix% <gold>You have hooked {player}!</gold>",
|
||||
"hook.target" to "%prefix% <gold>You have been hooked to a Blitzcrank!</gold>",
|
||||
"stun.target" to "%prefix% <light_blue>You have been stunned!</light_blue>",
|
||||
"stun.player" to "%prefix% <light_blue>You have stunned {nearby} nearby players.</light_blue>"
|
||||
)
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user