Skip to content

Commit

Permalink
Merge pull request #1695 from petchema/fix-casting-female-spellsword-…
Browse files Browse the repository at this point in the history
…size

fix spell casting female spellsword size
  • Loading branch information
Interkarma committed Feb 8, 2020
2 parents 1fa151d + 928eea4 commit b653181
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Assets/Scripts/Internal/DaggerfallMobileUnit.cs
Expand Up @@ -398,14 +398,22 @@ private void OrientEnemy(int orientation)
summary.AnimStateRecord = record;
Vector2 size = summary.RecordSizes[record];

// Post-fix female spellsword scale while casting spells
// The scale read from Daggerfall's files is too small
if ((MobileTypes)summary.Enemy.ID == MobileTypes.Spellsword &&
summary.Enemy.Gender == MobileGender.Female &&
record >= 20 && record <= 24)
{
size *= 1.35f;
}

// Ensure walking enemies keep their feet aligned between states
if (summary.Enemy.Behaviour != MobileBehaviour.Flying &&
summary.Enemy.Behaviour != MobileBehaviour.Aquatic &&
summary.EnemyState != MobileStates.Idle)
{
Vector2 idleSize = summary.RecordSizes[0];
Vector2 stateSize = summary.RecordSizes[record];
transform.localPosition = new Vector3(0f, (stateSize.y - idleSize.y) * 0.5f, 0f);
transform.localPosition = new Vector3(0f, (size.y - idleSize.y) * 0.5f, 0f);
}
else
{
Expand Down

0 comments on commit b653181

Please sign in to comment.