diff --git a/resources/languages/en/gameplay.yml b/resources/languages/en/gameplay.yml index fb27847..c75d9e5 100755 --- a/resources/languages/en/gameplay.yml +++ b/resources/languages/en/gameplay.yml @@ -101,6 +101,7 @@ must-start-claim-at-border: "You must start claiming land at the border of th no-perm-to-claim-for: "You don't have permission to claim land for :0." painbuild-warning: "It is painful to build in the territory of :0." +no-powergain-due-to-world: "You didn't gain any power due to the world you are in." no-powerloss-due-to-faction: "You didn't lose any power since the territory you died in works that way." no-powerloss-due-to-world: "You didn't lose any power due to the world you died in." power-level-inform-on-death: "Your power is now :0 / :1" diff --git a/src/factions/engine/CombatEngine.php b/src/factions/engine/CombatEngine.php index 0b11ce3..b0a6682 100755 --- a/src/factions/engine/CombatEngine.php +++ b/src/factions/engine/CombatEngine.php @@ -70,7 +70,13 @@ public function onPlayerDeath(PlayerDeathEvent $event) { $fattacker->sendMessage(Localizer::translatable('ally-kill-no-bonus')); return; } - + + // Is powergain enabled in this world? + if (!in_array($fattacker->getLevel()->getFolderName(), Gameplay::get("world-power-gain-enabled", []), true)) { + $fattacker->sendMessage(Localizer::translatable("no-powergain-due-to-world")); + return; + } + // Calculate power gain $bonus = Gameplay::get('power-per-kill', 10); $fattacker->addPower($bonus);