private static HashedString CustomIdleAnim(IdleStates.Instance smi, ref HashedString pre_anim)
    {
        CellOffset offset = new CellOffset(0, -1);
        bool       facing = smi.GetComponent <Facing>().GetFacing();

        switch (smi.GetComponent <Navigator>().CurrentNavType)
        {
        case NavType.Floor:
            offset = ((!facing) ? new CellOffset(-1, -1) : new CellOffset(1, -1));
            break;

        case NavType.Ceiling:
            offset = ((!facing) ? new CellOffset(-1, 1) : new CellOffset(1, 1));
            break;
        }
        HashedString result = "idle_loop";
        int          num    = Grid.OffsetCell(Grid.PosToCell(smi), offset);

        if (Grid.IsValidCell(num) && !Grid.Solid[num])
        {
            pre_anim = "idle_loop_hang_pre";
            result   = "idle_loop_hang";
        }
        return(result);
    }
        private static HashedString CustomIdleAnim_Drecko(IdleStates.Instance smi, ref HashedString pre_anim)
        {
            CellOffset offset         = new CellOffset(0, -1);
            bool       facing         = smi.GetComponent <Facing>().GetFacing();
            NavType    currentNavType = smi.GetComponent <Navigator>().CurrentNavType;

            if (currentNavType != NavType.Floor)
            {
                if (currentNavType == NavType.Ceiling)
                {
                    offset = (facing ? new CellOffset(1, 1) : new CellOffset(-1, 1));
                }
            }
            else
            {
                offset = (facing ? new CellOffset(1, -1) : new CellOffset(-1, -1));
            }
            HashedString result = "idle_loop";
            int          num    = Grid.OffsetCell(Grid.PosToCell(smi), offset);

            if (Grid.IsValidCell(num) && !Grid.Solid[num])
            {
                pre_anim = "idle_loop_hang_pre";
                result   = "idle_loop_hang";
            }
            return(result);
        }
 private static HashedString CustomIdleAnim_Mole(IdleStates.Instance smi, ref HashedString pre_anim)
 {
     if (smi.gameObject.GetComponent <Navigator>().CurrentNavType == NavType.Solid)
     {
         int num = UnityEngine.Random.Range(0, _solidIdleAnims.Length);
         return(_solidIdleAnims[num]);
     }
     if (smi.gameObject.GetDef <BabyMonitor.Def>() != null && UnityEngine.Random.Range(0, 100) >= 90)
     {
         return("drill_fail");
     }
     return("idle_loop");
 }
Пример #4
0
 private static HashedString CustomIdleAnim(IdleStates.Instance smi, ref HashedString pre_anim)
 {
     pre_anim = "hover_swim";
     return("swim_idle_loop");
 }
 private static HashedString CustomIdleAnim_Moo_Puft(IdleStates.Instance smi, ref HashedString pre_anim)
 {
     CreatureCalorieMonitor.Instance smi2 = smi.GetSMI <CreatureCalorieMonitor.Instance>();
     return((smi2 != null && smi2.stomach.IsReadyToPoop()) ? "idle_loop_full" : "idle_loop");
 }
Пример #6
0
 private static HashedString CustomIdleAnim(IdleStates.Instance smi, ref HashedString pre_anim)
 {
     CreatureCalorieMonitor.Instance sMI = smi.GetSMI <CreatureCalorieMonitor.Instance>();
     return((sMI == null || !sMI.stomach.IsReadyToPoop()) ? "idle_loop" : "idle_loop_full");
 }