public sealed override void CreateSegmentEntity(ModCreateSegmentEntityParameters parameters, ModCreateSegmentEntityResults results) { var material = new Block.Material(parameters.Cube, parameters.Value); parameters.ObjectType = SpawnableObjectEnum.Num; results.Entity = this.BlockRegistrations[material](parameters); }
//Constructor - called on machine creation - should use the parameters as called below to retain compatibility if mod stuff changes //You can add in your own parameters if you need them though public MyModMachine(ModCreateSegmentEntityParameters parameters) : base(parameters) { //Handle initializing the machine here this.mbNeedsLowFrequencyUpdate = true; //Only gets LowFrequencyUpdate called if true this.mbNeedsUnityUpdate = true; //Only gets UnityUpdate called if true }
/// pass vanilla object to wrap, construct it from the same parameters public OverloadedMachine(ModCreateSegmentEntityParameters parameters, V vanilla) : base(parameters) { this.Vanilla = vanilla; this.mbNeedsLowFrequencyUpdate = true; this.mbNeedsUnityUpdate = true; }
public SolarPanelMachine( ModCreateSegmentEntityParameters parameters, Position size, G graphics, float dayRate, float nightRate) : base(parameters, graphics) { this.Surveyor = new BlockSurveyor(this); var center = new Position(parameters); var shift = size / 2; this.Box = new GridBox(new Box(center - shift, center + shift)); this.Clearances = this.Box.Side(Direction.Up()).Select(b => new Clearance(b)).ToList(); var difficultyFactor = 1.0f; if (DifficultySettings.mbEasyPower) { difficultyFactor = 2.5f; } if (DifficultySettings.mbRushMode) { difficultyFactor = 3.5f; } this.DayRate = dayRate * difficultyFactor; this.NightRate = nightRate * difficultyFactor; var down = Direction.Up().Negate(); var probes = this.Box.Side(down) .Select((pos) => new PciSurveyor.Probe(pos, down)); this.PciSurveyor = new PciSurveyor(probes, this); }
public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters) { ModCreateSegmentEntityResults lmodcreatesetmentresults = new ModCreateSegmentEntityResults(); bool flag = parameters.Cube == this.mQuarryType; if (parameters.Cube == Mk5QuarryType || (parameters.Cube == PlacementType && parameters.Value == Mk5QuarryPlacementValue)) { parameters.ObjectType = SpawnableObjectEnum.Quarry; lmodcreatesetmentresults.Entity = new Mk5Quarry(parameters, mMk5Config, XMLModVersion); return(lmodcreatesetmentresults); } if (flag) { string cubekey = global::TerrainData.GetCubeKey(parameters.Cube, parameters.Value); if (cubekey == "FlexibleGames.Mk4Quarry") { lmodcreatesetmentresults.Entity = new Mk4Quarry(parameters.Segment, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, parameters.Value, parameters.LoadFromDisk, mMk4Config); } else { lmodcreatesetmentresults.Entity = new AdvancedQuarrys(parameters.Segment, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, parameters.Value, parameters.LoadFromDisk, mConfig); } } return(lmodcreatesetmentresults); }
public PowWow(ModCreateSegmentEntityParameters parameters) : base(eSegmentEntity.Mod, SpawnableObjectEnum.ExperimentalAssembler, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, parameters.Value, parameters.Position, parameters.Segment) { currentPower = 0; totalTransfered = 0; radius = 3; transferCap = 10000; maxPower = 10000; for (int i = 0; i < ROLLING_AVG_LENGTH; ++i) { transfers[i] = 0; } // Trigger the searching of PCIs lastSearch = 0; lastTransfer1 = 0; lastTransfer2 = 0; powerSource = null; linkedToGo = false; mbNeedsLowFrequencyUpdate = true; mbNeedsUnityUpdate = true; this.cubeColor = Color.white; VicisMod.log(getPrefix(), "Created"); }
public SolarMk2(ModCreateSegmentEntityParameters parameters) : base( parameters, new Position(3, 1, 3), new Solar_MK2( parameters.Segment, parameters.X, parameters.Y, parameters.Z, parameters.Cube, parameters.Flags, 1, false), 162f, 0f) { var size = new Position(3, 1, 3); var center = new Position(parameters); var shift = size / 2; var box = new Box(center - shift, center + shift); this.Connector = new Connector <SolarMk2>( this, EnhancedPowerFlow.SolarMk2, new GridBox(box).Blocks() ); }
public PowWowMk2(ModCreateSegmentEntityParameters param) : base(param) { transferCap = 40 * transferFrequency; radius = 4; maxPower = 500; cubeColor = Color.blue; }
public DisplayPanelMachine(ModCreateSegmentEntityParameters mcsep) : base(mcsep) { hover = new HoverBehavior(this); StartAnimationCoroutine(AnimateFading()); StartAnimationCoroutine(AnimateTextUpdate()); }
internal static UndergroundSmelter CreateSmelter(ModCreateSegmentEntityParameters param) { _smelter = new UndergroundSmelter(param.Segment, param.X, param.Y, param.Z, param.Cube, param.Flags, param.Value) { mbTooDeep = false, mrSmeltTime = 99.9f }; if (DifficultySettings.mbCasualResource) { _smelter.mrSmeltTime = 10f; } if (DifficultySettings.mbRushMode) { _smelter.mrSmeltTime = 3f; } if (_smelter.mValue == 1) { _smelter.mrSmeltTime /= 2f; _smelter.mrPowerRate *= 2f; _smelter.mnOrePerBar *= 4; } return(_smelter); }
public PowWowMk4(ModCreateSegmentEntityParameters param) : base(param) { radius = 7; maxTransfer = float.MaxValue; cubeColor = Color.red; scanFrequency = 20f; }
public MassCrateModuleVanilla(ModCreateSegmentEntityParameters parameters) : base(parameters) { cubeColor = Color.white; maxBins = 25; maxBinSize = 25; maxItems = 25; }
public TourCartStation(ModCreateSegmentEntityParameters parameters) : base(parameters) { this.mbNeedsUnityUpdate = true; this.mbNeedsLowFrequencyUpdate = true; this.mForwards = SegmentCustomRenderer.GetRotationQuaternion(parameters.Flags) * Vector3.forward; this.mForwards.Normalize(); }
public PowWowMk3(ModCreateSegmentEntityParameters param) : base(param) { transferCap = 320 * transferFrequency; radius = 5; maxPower = 1000; cubeColor = Color.magenta; scanFrequency = 10f; }
public CompactSolarMk3(ModCreateSegmentEntityParameters param) : base(param) { // This machine represents the work of 512 Solar Panels. The base LFU will have // done the work of 1, however, so we only need to do the work of 511 this.multiplier = 512 - 1; this.mrMaxPower *= 512; this.panelColor = new Color(0.1f, 0.1f, 0.1f); }
public CompactSolarMk2(ModCreateSegmentEntityParameters param) : base(param) { // This machine represents the work of 64 Solar Panels. The base LFU will have // done the work of 1, however, so we only need to do the work of 63 multiplier = 64 - 1; mrMaxPower *= 64; panelColor = new Color(0.3f, 0.3f, 0.3f); }
public MassCrateModule10000(ModCreateSegmentEntityParameters parameters) : base(parameters) { cubeColor = new Color(211 / 256f, 54 / 256f, 231 / 256f); maxBins = 1; maxBinSize = 10000; maxItems = 10000; }
public MassCrateModuleLinker(ModCreateSegmentEntityParameters parameters) : base(parameters) { cubeColor = Color.black; maxBins = 0; maxBinSize = 0; maxItems = 0; }
public ConveyorLikeMachine(ModCreateSegmentEntityParameters parameters) : base(parameters) { outputLocation = new RelativeLocation(this, Vector3.forward); inputLocation = new RelativeLocation(this, Vector3.back); SetAnimationState(AnimateStill()); }
public FreightCartFactory(ModCreateSegmentEntityParameters parameters) : base(parameters) { this.mbNeedsLowFrequencyUpdate = true; this.mbNeedsUnityUpdate = false; this.mForwards = SegmentCustomRenderer.GetRotationQuaternion(parameters.Flags) * Vector3.forward; this.mForwards.Normalize(); this.maAttachedHoppers = new StorageMachineInterface[6]; }
public MassGiverVanilla(ModCreateSegmentEntityParameters parameters) : base(parameters) { maxItems = 1; droneSpeed = 1; batch = 1; drone = new DroneComputer(droneSpeed); droneColor = Color.white; }
//======================================================= // Constructors //======================================================= protected ModMachineEntity(ModCreateSegmentEntityParameters parameters) : base(parameters) { mbNeedsLowFrequencyUpdate = true; mbNeedsUnityUpdate = true; LOGGER_PREFIX = "[" + this.GetType().FullName + this.ToNormalizedCoordinates() + "]"; StartLowFrequencyCoroutine(UpdateRotationOnce()); }
public MassGiverMk2(ModCreateSegmentEntityParameters parameters) : base(parameters) { maxItems = 5; droneSpeed = 3; batch = 5; drone = new DroneComputer(droneSpeed); droneColor = new Color(48 / 256f, 135 / 256f, 223 / 256f); droneSize = new Vector3(1.1f, 1.1f, 1.1f); }
public static UndergroundInduction CreateInduction(ModCreateSegmentEntityParameters param) { var induction = new UndergroundInduction(param.Segment, param.X, param.Y, param.Z, param.Cube, param.Flags, param.Value); #if DEBUG Debug.LogError($"Creating Underground Induction"); #endif return(induction); }
public MassTakerMk1(ModCreateSegmentEntityParameters parameters) : base(parameters) { maxItems = 5; droneSpeed = 1; batch = 5; drone = new DroneComputer(droneSpeed); droneColor = new Color(77 / 256f, 214 / 256f, 31 / 256f); droneSize = new Vector3(1.2f, 1.2f, 1.2f); }
public MassTakerMk3(ModCreateSegmentEntityParameters parameters) : base(parameters) { maxItems = 30; droneSpeed = 2; batch = 30; drone = new DroneComputer(droneSpeed); droneColor = new Color(235 / 256f, 248 / 256f, 42 / 256f); droneSize = new Vector3(1.4f, 1.4f, 1.4f); }
public override void CreateSegmentEntity(ModCreateSegmentEntityParameters param, ModCreateSegmentEntityResults results) { if (param.Type == eSegmentEntity.OreSmelter) { results.Entity = UndergroundSmelter.CreateSmelter(param); } if (param.Type == eSegmentEntity.ForcedInduction) { results.Entity = UndergroundInduction.CreateInduction(param); } }
public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters) { ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults(); if (parameters.Cube == AccessPortType) { parameters.ObjectType = SpawnableObjectEnum.RefineryController; result.Entity = new MSAccessPort(parameters); } return(result); }
public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters) { ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults(); if (parameters.Cube == alCubeType) { parameters.ObjectType = SpawnableObjectEnum.MatterMover; result.Entity = new ALS_MachineEntity(parameters); } return(result); }
public override ModCreateSegmentEntityResults CreateSegmentEntity(ModCreateSegmentEntityParameters parameters) { ModCreateSegmentEntityResults result = new ModCreateSegmentEntityResults(); //Assumes that all value entries are handled by the same machine! if (parameters.Cube == MyModMachineType) { result.Entity = new PowerDissipatorMachine(parameters); } return(result); }