Example #1
0
        public override void RulesetLoaded(Ruleset rules, ActorInfo ai)
        {
            if (PortOffsets.Length == 0)
            {
                throw new YamlException("PortOffsets must have at least one entry.");
            }

            if (PortYaws.Length != PortOffsets.Length)
            {
                throw new YamlException("PortYaws must define an angle for each port.");
            }

            if (PortCones.Length != PortOffsets.Length)
            {
                throw new YamlException("PortCones must define an angle for each port.");
            }

            Ports = new FirePort[PortOffsets.Length];

            for (var i = 0; i < PortOffsets.Length; i++)
            {
                Ports[i] = new FirePort
                {
                    Offset = PortOffsets[i],
                    Yaw    = PortYaws[i],
                    Cone   = PortCones[i],
                };
            }

            base.RulesetLoaded(rules, ai);
        }
Example #2
0
        WVec PortOffset(Actor self, FirePort p)
        {
            var bodyOrientation = coords.Value.QuantizeOrientation(self, self.Orientation);

            return(coords.Value.LocalToWorld(p.Offset.Rotate(bodyOrientation)));
        }