Beispiel #1
0
        private int _FindBestDeathAnimationSNO()
        {
            // check if power has special death animation, and roll chance to use it
            TagKeyInt specialDeathTag = _GetTagForSpecialDeath(this.Context.EvalTag(PowerKeys.SpecialDeathType));

            if (specialDeathTag != null)
            {
                float specialDeathChance = this.Context.EvalTag(PowerKeys.SpecialDeathChance);
                if (PowerContext.Rand.NextDouble() < specialDeathChance)
                {
                    int specialSNO = _GetSNOFromTag(specialDeathTag);
                    if (specialSNO != -1)
                    {
                        return(specialSNO);
                    }
                }
                // decided not to use special death or actor doesn't have it, just fall back to normal death anis
            }

            int sno = _GetSNOFromTag(this.DeathDamageType.DeathAnimationTag);

            if (sno != -1)
            {
                return(sno);
            }

            // load default ani if all else fails
            return(_GetSNOFromTag(AnimationSetKeys.DeathDefault));
        }
Beispiel #2
0
 private int _GetSNOFromTag(TagKeyInt tag)
 {
     if (this.Target.AnimationSet != null && this.Target.AnimationSet.TagMapAnimDefault.ContainsKey(tag))
     {
         return(this.Target.AnimationSet.TagMapAnimDefault[tag]);
     }
     else
     {
         return(-1);
     }
 }
Beispiel #3
0
        public int EvalTag(TagKeyInt key)
        {
            TagMap tagmap = _FindTagMapWithKey(key);

            if (tagmap != null)
            {
                return(tagmap[key]);
            }
            else
            {
                return(-1);
            }
        }
Beispiel #4
0
 private int _GetSNOFromTag(TagKeyInt tag)
 {
     if (this.Target.AnimationSet.Animations.ContainsKey(tag.ID))
         return this.Target.AnimationSet.Animations[tag.ID];
     else
         return -1;
 }
Beispiel #5
0
 private int _GetSNOFromTag(TagKeyInt tag)
 {
     if (this.Target.AnimationSet != null && this.Target.AnimationSet.TagMapAnimDefault.ContainsKey(tag))
         return this.Target.AnimationSet.TagMapAnimDefault[tag];
     else
         return -1;
 }