Merge Damage and Source types.
This commit is contained in:
@@ -9,7 +9,10 @@
|
||||
|
||||
package engine.mobileAI.utilities;
|
||||
|
||||
import engine.Enum.*;
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.CombatManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
@@ -22,7 +25,6 @@ import org.pmw.tinylog.Logger;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import static engine.math.FastMath.sqr;
|
||||
import static java.lang.Math.pow;
|
||||
|
||||
public class CombatUtilities {
|
||||
|
||||
@@ -214,10 +216,10 @@ public class CombatUtilities {
|
||||
else
|
||||
speed = agent.getSpeedHandTwo();
|
||||
|
||||
DamageType dt = DamageType.Crush;
|
||||
SourceType dt = SourceType.Crushing;
|
||||
|
||||
if (agent.isSiege())
|
||||
dt = DamageType.Siege;
|
||||
dt = SourceType.Siege;
|
||||
if (wb != null) {
|
||||
anim = CombatManager.getSwingAnimation(wb, null, mainHand);
|
||||
dt = wb.getDamageType();
|
||||
@@ -311,7 +313,7 @@ public class CombatUtilities {
|
||||
|
||||
int damage = 0;
|
||||
|
||||
DamageType dt = getDamageType(agent);
|
||||
SourceType dt = getDamageType(agent);
|
||||
damage = ThreadLocalRandom.current().nextInt((int)getMinDmg(agent), (int)getMaxDmg(agent) + 1);
|
||||
if (AbstractWorldObject.IsAbstractCharacter(target)) {
|
||||
if (((AbstractCharacter) target).isSit()) {
|
||||
@@ -327,8 +329,8 @@ public class CombatUtilities {
|
||||
return damage;
|
||||
}
|
||||
|
||||
public static DamageType getDamageType(Mob agent) {
|
||||
DamageType dt = DamageType.Crush;
|
||||
public static SourceType getDamageType(Mob agent) {
|
||||
SourceType dt = SourceType.Crushing;
|
||||
if (agent.getEquip().get(1) != null) {
|
||||
return agent.getEquip().get(1).getItemBase().getDamageType();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user