public AnimateBehavior(IdleController controller, Dictionary <string, string> definitions, string[] animations) : base(controller) { this.animations = new List <IdleAnimation>(); foreach (string animation in animations) { if (!definitions.TryGetValue(animation, out string definition)) { controller.ai.Monitor.Log($"Cannot get animation definition for `{animation}`, NPC `{controller.ai.npc.Name}`", LogLevel.Error); continue; } try { var(intro, loop, outro, _) = definition.Split('/'); this.animations.Add( new IdleAnimation { intro = Utility.parseStringToIntArray(intro), loop = Utility.parseStringToIntArray(loop), outro = Utility.parseStringToIntArray(outro), } ); } catch (Exception e) { controller.ai.Monitor.Log($"Intro or loop or outro animation for {animation} not defined or broken! Companion: {controller.ai.npc.Name} Error: {e.Message}", LogLevel.Error); } } }
public AnimateBehavior(IdleController controller, Dictionary <string, string> definitions, string[] animations) : base(controller) { this.animations = new List <int[]>(); foreach (string animation in animations) { if (!definitions.TryGetValue(animation, out string definition)) { throw new Exception($"Cannot get animation definition for `{animation}`, NPC `{controller.ai.npc.Name}`"); } var(_, loop, _) = definition.Split('/'); this.animations.Add(Utility.parseStringToIntArray(loop)); } }
public IdleBehavior(IdleController controller) { this.controller = controller; this.monitor = this.controller.ai.Monitor; this.npc = controller.ai.npc; }
public LookAroundBehavior(IdleController controller, int minSeconds, int maxSeconds) : base(controller) { this.minSeconds = minSeconds; this.maxSeconds = maxSeconds; }