No Prayer allowed in arena

This commit is contained in:
Tooze 2026-04-11 23:20:15 -04:00
parent fd75baa679
commit 2507ed00e7
2 changed files with 14 additions and 0 deletions

View file

@ -61,6 +61,7 @@ class BarbassaultSession( val activity: BarbassaultActivity ? = null) :LogoutLi
for (player in team.allPlayers()) {
zone.enter(player)
val pRole = player.baSession?.team?.getRoleForPlayer(player)
equipBARoleIcon(player, pRole!!)
player.properties.teleportLocation = team.spawnLocationFor(player) //base.transform(36, 24, 0)
@ -148,6 +149,8 @@ class BarbassaultSession( val activity: BarbassaultActivity ? = null) :LogoutLi
state = BarbassaultState.FORFEIT
}
fun isBarbAssaultGame() = state == BarbassaultState.IN_ARENA
fun endGame(endReason: String){
eventBus.clear()
scoreManager.resetAll()
@ -282,6 +285,7 @@ class BarbassaultSession( val activity: BarbassaultActivity ? = null) :LogoutLi
val waveNum = player.getAttribute("barbass:wave", 1)
val wornIconId = getItemFromEquipment(player, EquipmentSlot.CAPE)?.id
val interfaceId = getIconInterfaceId(wornIconId ?: -1)
player.fullRestore()
//waveLobbies[waveNum].randomWalkableLoc
//todo consolidate logic.
interfaceId?.let {

View file

@ -1,6 +1,7 @@
package core.game.node.entity.player.link.prayer;
import content.data.Quests;
import content.minigame.barbassault.arena.BarbassaultSession;
import core.game.node.entity.player.link.diary.DiaryType;
import core.game.node.entity.skill.SkillBonus;
import core.game.node.entity.skill.Skills;
@ -222,6 +223,15 @@ public enum PrayerType {
* @return <code>True</code> if it is permitted.
*/
public boolean permitted(final Player player) {
BarbassaultSession session = player.getAttribute("ba-session");
if (session != null) {
if (session.isBarbAssaultGame()) {
//todo find correct message here
sendMessage(player, "The barbarians do not allow the use of prayer in the arena.");
toggle(player,false);
return false;
}
}
if (!hasLevelStat(player, Skills.PRAYER, level) || !hasLevelStat(player, Skills.DEFENCE, defenceReq)) {
sendDialogue(player, "You need a <col=08088A>" + (!hasLevelStat(player, Skills.PRAYER, level) ? "Prayer level of " + level + (!hasLevelStat(player, Skills.DEFENCE, defenceReq) ? " and a " : "") : "") + (!hasLevelStat(player, Skills.DEFENCE, defenceReq) ? "Defence level of " + defenceReq : "") + " to use " + StringUtils.formatDisplayName(name().toLowerCase().replace("_", " ")) + ".");
return false;