Angle of attack rework.

Contributed by kamikadzz.
This commit is contained in:
MobiusDevelopment
2022-10-19 21:14:04 +00:00
parent d8f7b7be7a
commit fc4ae26cc6
108 changed files with 459 additions and 84 deletions

View File

@@ -423,7 +423,7 @@ public class CreatureStat
public int getPhysicalAttackAngle()
{
return 240; // 360 - 120
return 0;
}
/**

View File

@@ -36,4 +36,10 @@ public class NpcStat extends CreatureStat
{
return (Npc) super.getActiveChar();
}
@Override
public int getPhysicalAttackAngle()
{
return getActiveChar().getTemplate().getBaseAttackAngle();
}
}

View File

@@ -104,6 +104,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
private int _maxSkillChance;
private double _hitTimeFactor;
private double _hitTimeFactorSkill;
private int _baseAttackAngle;
private Map<Integer, Skill> _skills;
private Map<AISkillScope, List<Skill>> _aiSkillLists;
private Set<Integer> _clans;
@@ -194,6 +195,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_maxSkillChance = set.getInt("maxSkillChance", 15);
_hitTimeFactor = set.getInt("hitTime", 100) / 100d;
_hitTimeFactorSkill = set.getInt("hitTimeSkill", 100) / 100d;
_baseAttackAngle = set.getInt("width", 120);
_collisionRadiusGrown = set.getFloat("collisionRadiusGrown", 0);
_collisionHeightGrown = set.getFloat("collisionHeightGrown", 0);
_mpRewardValue = set.getInt("mpRewardValue", 0);
@@ -518,6 +520,11 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
return _hitTimeFactorSkill;
}
public int getBaseAttackAngle()
{
return _baseAttackAngle;
}
@Override
public Map<Integer, Skill> getSkills()
{

View File

@@ -86,12 +86,12 @@ public class Weapon extends ItemTemplate
if ((damageRange.length > 1) && Util.isDigit(damageRange[2]) && Util.isDigit(damageRange[3]))
{
_baseAttackRadius = Integer.parseInt(damageRange[2]);
_baseAttackAngle = 360 - Integer.parseInt(damageRange[3]);
_baseAttackAngle = Integer.parseInt(damageRange[3]);
}
else
{
_baseAttackRadius = 40;
_baseAttackAngle = 240; // 360 - 120
_baseAttackAngle = 0;
}
final String[] reducedSoulshots = set.getString("reduced_soulshot", "").split(",");