Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power gain in pvp #65

Merged
merged 3 commits into from
Mar 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions resources/languages/en/gameplay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ must-start-claim-at-border: "<b>You must start claiming land at the border of th
no-perm-to-claim-for: "<b>You don't have permission to claim land for <h>:0<b>."
painbuild-warning: "<b>It is painful to build in the territory of :0<b>."

no-powergain-due-to-world: "<i>You didn't gain any power due to the world you are in."
no-powerloss-due-to-faction: "<i>You didn't lose any power since the territory you died in works that way."
no-powerloss-due-to-world: "<i>You didn't lose any power due to the world you died in."
power-level-inform-on-death: "<i>Your power is now <h>:0 / :1"
Expand Down
8 changes: 7 additions & 1 deletion src/factions/engine/CombatEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down