Added the unlock trigger for Volcanic Vikings

This commit is contained in:
ceikry
2021-07-10 23:27:48 -05:00
parent 89ab62355d
commit 6207846cc6
2 changed files with 12 additions and 2 deletions
+9
View File
@@ -1146,4 +1146,13 @@ object ContentAPI {
fun addClimbDest(ladderLoc: Location, dest: Location){ fun addClimbDest(ladderLoc: Location, dest: Location){
SpecialLadders.add(ladderLoc,dest) SpecialLadders.add(ladderLoc,dest)
} }
/**
* Sends a news announcement in game chat.
* @param message the message to announce
*/
@JvmStatic
fun sendNews(message: String){
Repository.sendNews(message, 12, "CC6600")
}
} }
@@ -72,12 +72,12 @@ object Repository {
* @param icon The icon. * @param icon The icon.
*/ */
@JvmStatic @JvmStatic
fun sendNews(string: String, icon: Int = 12, color: String = "<col=CC6600>") { fun sendNews(string: String, icon: Int = 12, color: String = "CC6600") {
val players: Array<Any> = playerNames.values.toTypedArray() val players: Array<Any> = playerNames.values.toTypedArray()
val size = players.size val size = players.size
for (i in 0 until size) { for (i in 0 until size) {
val player = players[i] as Player ?: continue val player = players[i] as Player ?: continue
player.sendMessage("<img=" + icon + ">" + color + "News: " + string) player.sendMessage("<img=$icon><col=$color>News: $string")
} }
} }
@@ -87,6 +87,7 @@ object Repository {
* I fucking hate java. * I fucking hate java.
*/ */
@JvmStatic @JvmStatic
@Deprecated("Old and bad",ReplaceWith("ContentAPI.sendNews()"),DeprecationLevel.WARNING)
fun sendNews(string: String){ fun sendNews(string: String){
sendNews(string,12) sendNews(string,12)
} }