예제 #1
0
        public VehicleTurret(VehiclePawn vehicle, VehicleTurret reference)
        {
            this.vehicle = vehicle;

            uniqueID  = Find.UniqueIDsManager.GetNextThingID();
            turretDef = reference.turretDef;

            turretRenderOffset   = reference.turretRenderOffset;
            turretRenderLocation = reference.turretRenderLocation;
            defaultAngleRotated  = reference.defaultAngleRotated;

            aimPieOffset    = reference.aimPieOffset;
            angleRestricted = reference.angleRestricted;

            drawLayer = reference.drawLayer;

            gizmoLabel = reference.gizmoLabel;

            key       = reference.key;
            parentKey = reference.parentKey;
            groupKey  = reference.groupKey;

            targetPersists  = reference.targetPersists;
            autoTargeting   = reference.autoTargeting;
            manualTargeting = reference.manualTargeting;

            currentFireMode    = 0;
            currentFireIcon    = OverheatIcons.FirstOrDefault();
            ticksSinceLastShot = 0;

            childCannons = new List <VehicleTurret>();
            if (!string.IsNullOrEmpty(parentKey))
            {
                foreach (VehicleTurret cannon in vehicle.CompCannons.Cannons.Where(c => c.key == parentKey))
                {
                    attachedTo = cannon;
                    cannon.childCannons.Add(this);
                }
            }

            ResolveCannonGraphics(vehicle);
            rTracker = new Turret_RecoilTracker(this);

            restrictedTheta = (int)Math.Abs(angleRestricted.x - (angleRestricted.y + 360)).ClampAngle();

            ResetCannonAngle();
        }
예제 #2
0
 public VehicleTurret()
 {
     rTracker = new Turret_RecoilTracker(this);
 }