Beispiel #1
0
        public void ScheduleReplacement(CompAutoReplaceable replaceableComp)
        {
            var building  = replaceableComp.parent;
            var blueprint = GenConstruct.PlaceBlueprintForBuild(building.def, replaceableComp.ParentPosition, map, replaceableComp.ParentRotation, Faction.OfPlayer, null);
            var entry     = new ReplacementEntry {
                position     = replaceableComp.ParentPosition,
                unforbidTick = Find.TickManager.TicksGame + RemoteExplosivesController.Instance.BlueprintForbidDuration * GenTicks.TicksPerRealSecond
            };
            var explosive = building as Building_RemoteExplosive;

            if (explosive != null)
            {
                entry.armed   = explosive.IsArmed;
                entry.channel = explosive.CurrentChannel;
            }
            pendingSettings.Add(entry);
            if (RemoteExplosivesController.Instance.BlueprintForbidDuration > 0)
            {
                blueprint.SetForbidden(true, false);
                pendingForbiddenBlueprints.Add(entry);
            }
        }
        public override void SpawnSetup(Map map, bool respawningAfterLoad)
        {
            base.SpawnSetup(map, respawningAfterLoad);

            Resources.Graphics.FlareOverlayStrong.drawSize = Resources.Graphics.FlareOverlayNormal.drawSize = def.graphicData.drawSize;

            RemoteExplosivesUtility.UpdateSwitchDesignation(this);
            explosiveComp = GetComp <CompCustomExplosive>();
            replaceComp   = GetComp <CompAutoReplaceable>();
            if (replaceComp != null)
            {
                replaceComp.DisableGizmoAutoDisplay();
            }

            if (justCreated)
            {
                if (CustomProps.startsArmed)
                {
                    Arm();
                }
                justCreated = false;
            }
        }