1. 物品金币回收有问题
2. 正常的BOSS血量百分比显示:Infinity% 3. 增加伤害的道具 只读取一组 有多组的话不读取
This commit is contained in:
parent
04692d4e40
commit
5da42e874c
|
|
@ -5686,10 +5686,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
|
||||||
if (type == MapleInventoryType.EQUIP) {
|
if (type == MapleInventoryType.EQUIP) {
|
||||||
return this.inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid);
|
return this.inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid);
|
||||||
}
|
}
|
||||||
final IItem findById = this.inventory[type.ordinal()].findById(itemid);
|
int byIdNum = this.inventory[type.ordinal()].findByIdNum(itemid);
|
||||||
short quantity = findById.getQuantity();
|
|
||||||
|
|
||||||
return quantity;
|
|
||||||
|
return byIdNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,16 @@ public class MapleInventory implements Iterable<IItem>, Serializable {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int findByIdNum(final int itemId) {
|
||||||
|
int re = 0;
|
||||||
|
for (final IItem item : this.inventory.values()) {
|
||||||
|
if (item.getItemId() == itemId) {
|
||||||
|
re+=item.getQuantity();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return re;
|
||||||
|
}
|
||||||
|
|
||||||
public IItem findByUniqueId(final int itemId) {
|
public IItem findByUniqueId(final int itemId) {
|
||||||
for (final IItem item : this.inventory.values()) {
|
for (final IItem item : this.inventory.values()) {
|
||||||
if (item.getUniqueId() == itemId) {
|
if (item.getUniqueId() == itemId) {
|
||||||
|
|
|
||||||
|
|
@ -441,7 +441,7 @@ public class DamageParse {
|
||||||
|
|
||||||
long mobMaxHp = monster.getMaxHP();
|
long mobMaxHp = monster.getMaxHP();
|
||||||
if (mobMaxHp == 0){
|
if (mobMaxHp == 0){
|
||||||
monster.getMobMaxHp();
|
mobMaxHp = monster.getMobMaxHp();
|
||||||
}
|
}
|
||||||
|
|
||||||
double percentage = ((double) hp / mobMaxHp) * 100; // 显式转换为浮点数并计算百分比:ml-citation{ref="1,3" data="citationList"}
|
double percentage = ((double) hp / mobMaxHp) * 100; // 显式转换为浮点数并计算百分比:ml-citation{ref="1,3" data="citationList"}
|
||||||
|
|
@ -1003,9 +1003,20 @@ public class DamageParse {
|
||||||
|
|
||||||
monster.damage(player, newtotDamageToOneMonster, true, attack.skill);
|
monster.damage(player, newtotDamageToOneMonster, true, attack.skill);
|
||||||
if (monster.getHp() > 0) {
|
if (monster.getHp() > 0) {
|
||||||
player.dropMessage(-1, "当前怪物血量为: " + monster.getHp());
|
long hp = monster.getHp();
|
||||||
}
|
|
||||||
|
|
||||||
|
long mobMaxHp = monster.getMaxHP();
|
||||||
|
if (mobMaxHp == 0) {
|
||||||
|
mobMaxHp = monster.getMobMaxHp();
|
||||||
|
}
|
||||||
|
|
||||||
|
double percentage = ((double) hp / mobMaxHp) * 100; // 显式转换为浮点数并计算百分比:ml-citation{ref="1,3" data="citationList"}
|
||||||
|
String result = String.format("%.2f%%", percentage);
|
||||||
|
|
||||||
|
|
||||||
|
double l = (double) hp / mobMaxHp;
|
||||||
|
player.dropMessage(-1, "当前怪物血量为:" + hp + " " + result);
|
||||||
|
}
|
||||||
|
|
||||||
if (monster.isBuffed(MonsterStatus.MAGIC_DAMAGE_REFLECT)) {
|
if (monster.isBuffed(MonsterStatus.MAGIC_DAMAGE_REFLECT)) {
|
||||||
player.addHP(-(7000 + Randomizer.nextInt(8000)));
|
player.addHP(-(7000 + Randomizer.nextInt(8000)));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue