public override void SetBlock(SuperBlock block) { IMyTerminalBlock tblock = block.TBlock; this.block = block; if (tblock.ResourceSink != null || tblock is IMyPowerProducer || tblock is IMyFunctionalBlock) { resourceId = MyDefinitionId.FromContent(block.TBlock.SlimBlock.GetObjectBuilder()); sink = tblock.ResourceSink; powerProducer = tblock as IMyPowerProducer; functionalBlock = tblock as IMyFunctionalBlock; if (sink != null || powerProducer != null) { SubtypeId |= TBlockSubtypes.Powered; } if (functionalBlock != null) { SubtypeId |= TBlockSubtypes.Functional; } block.SubtypeId |= SubtypeId; block.subtypeAccessors.Add(this); } }
public override void Reset() { base.Reset(); resourceId = default(MyDefinitionId); sink = null; powerProducer = null; functionalBlock = null; }
override protected Vector3 ApplyThrustModifiers(ref MyDefinitionId fuelType, ref Vector3 thrust, ref Vector3 thrustOverride, MyResourceSinkComponentBase resourceSink) { thrust += thrustOverride; if (MySession.Static.IsAdminModeEnabled == false || MySession.Static.LocalCharacter != Character) { thrust *= resourceSink.SuppliedRatioByType(fuelType); } thrust *= MyFakes.THRUST_FORCE_RATIO; return(thrust); }
protected override Vector3 ApplyThrustModifiers(ref MyDefinitionId fuelType, ref Vector3 thrust, ref Vector3 thrustOverride, MyResourceSinkComponentBase resourceSink) { thrust += thrustOverride; if (Character.ControllerInfo.Controller == null || MySession.Static.IsAdminModeEnabled(Character.ControllerInfo.Controller.Player.Id.SteamId) == false || (MySession.Static.LocalCharacter != Character && Sync.IsServer == false)) { thrust *= resourceSink.SuppliedRatioByType(fuelType); } thrust *= MyFakes.THRUST_FORCE_RATIO; return(thrust); }