Creatures now have combat animations too

Issue #136 closed
Peter Tigges created an issue

Creatures dont use standard anims from the combat_data database they have special cases as shown in the link

https://hastebin.com/avitimubeg.cs

Comments (9)

  1. Peter Tigges reporter
    string getCreatureAnimationName(string playbackName)
    {
        obj_id self = getSelf();
        string animName = "";
    
        int niche = ai_lib.aiGetNiche(self);
    
        //if (niche == NICHE_DROID || niche == NICHE_VEHICLE)
        if (niche == NICHE_VEHICLE)
        {
            animName ="droid_attack";
        }
        else
        {
            if(playbackName.endsWith("ranged"))
            {
                animName = "creature_attack_ranged";
            }
            else if(playbackName.endsWith("melee"))
            {
               // Default Melee attacks have a chance to trigger one of the following attacks:
               // creature_attack_heavy
               // creature_attack_light
               // creature_attack_special_1_heavy
               // creature_attack_special_1_light
    
                if(rand(1,2) == 1)
                    animName = "creature_attack";
                else
                    animName = "creature_attack_special_1";
                if(rand(1,2) == 1)
                    animName += "_light";
                else
                    animName += "_heavy";
    
                return animName;
            }
            else
                animName = "creature_attack_special_"+rand(1,2);
        }
    
        animName += "_medium";
    
        return animName;
    }
    
  2. Log in to comment