mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-20 21:40:27 -07:00
Merge branch 'iron' into 'master'
ironman drop fix: get drop if npcs delt damage. See merge request 2009scape/2009scape!270
This commit is contained in:
commit
b17908b275
2 changed files with 13 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class used for handling combat impacts.
|
* Class used for handling combat impacts.
|
||||||
|
|
@ -262,6 +263,15 @@ public final class ImpactHandler {
|
||||||
return impactLog;
|
return impactLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the impact log filtered for Player objects
|
||||||
|
* @return The impact log of each Player and their damage
|
||||||
|
*/
|
||||||
|
public Map<Player, Integer> getPlayerImpactLog() {
|
||||||
|
return impactLog.entrySet().stream().filter(entry -> entry.getKey() instanceof Player).collect(
|
||||||
|
Collectors.toMap(m -> m.getKey().asPlayer(), m -> m.getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the entity needs a hit update.
|
* Checks if the entity needs a hit update.
|
||||||
* @return {@code True} if so.
|
* @return {@code True} if so.
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ import rs09.game.system.config.ShopParser;
|
||||||
import rs09.game.world.GameWorld;
|
import rs09.game.world.GameWorld;
|
||||||
import rs09.game.world.repository.Repository;
|
import rs09.game.world.repository.Repository;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static rs09.game.node.entity.player.info.stats.StatAttributeKeysKt.STATS_BASE;
|
import static rs09.game.node.entity.player.info.stats.StatAttributeKeysKt.STATS_BASE;
|
||||||
import static rs09.game.node.entity.player.info.stats.StatAttributeKeysKt.STATS_ENEMIES_KILLED;
|
import static rs09.game.node.entity.player.info.stats.StatAttributeKeysKt.STATS_ENEMIES_KILLED;
|
||||||
|
|
||||||
|
|
@ -543,7 +545,7 @@ public class NPC extends Entity {
|
||||||
if (getAttribute("disable:drop", false)) {
|
if (getAttribute("disable:drop", false)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (killer instanceof Player && p != null && p.getIronmanManager().isIronman() && getImpactHandler().getImpactLog().size() > 1) {
|
if (killer instanceof Player && p != null && p.getIronmanManager().isIronman() && getImpactHandler().getPlayerImpactLog().size() > 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (definition == null || definition.getDropTables() == null) {
|
if (definition == null || definition.getDropTables() == null) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue