Ticket #1686: update-attack-prefix.patch

File update-attack-prefix.patch, 1.4 KB (added by Doménique, 12 years ago)

Adjust UnitAI to use attack_name animation and ActorViewer animation list

  • binaries/data/tools/atlas/lists.xml

     
    3535    <item>idle            </item>
    3636    <item>walk            </item>
    3737    <item>run             </item>
    38     <item>melee           </item>
     38    <item>attack_melee    </item>
     39    <item>attack_ranged   </item>
     40    <item>attack_charge   </item>
     41    <item>attack_slaughter</item>
    3942    <item>death           </item>
    4043    <item>build           </item>
    4144    <item>heal            </item>
  • binaries/data/mods/public/simulation/components/UnitAI.js

     
    905905                        prepare = Math.max(prepare, repeatLeft);
    906906                    }
    907907
    908                     this.SelectAnimation("melee", false, 1.0, "attack");
     908                    // add prefix + no Capital First Letter for this.attackType
     909                    var attackName = "attack_" + this.attackType.toLowerCase();
     910                    this.SelectAnimation(attackName, false, 1.0, "attack");
    909911                    this.SetAnimationSync(prepare, this.attackTimers.repeat);
    910912                    this.StartTimer(prepare, this.attackTimers.repeat);
    911913                    // TODO: we should probably only bother syncing projectile attacks, not melee