private void OnJetpackUserGetState(EntityUid uid, JetpackUserComponent component, ref ComponentGetState args) { args.State = new JetpackUserComponentState() { Jetpack = component.Jetpack, }; }
private void OnJetpackUserHandleState(EntityUid uid, JetpackUserComponent component, ref ComponentHandleState args) { if (args.Current is not JetpackUserComponentState state) { return; } component.Jetpack = state.Jetpack; }
private void OnJetpackUserEntParentChanged(EntityUid uid, JetpackUserComponent component, ref EntParentChangedMessage args) { if (TryComp <JetpackComponent>(component.Jetpack, out var jetpack) && !CanEnableOnGrid(args.Transform.GridUid)) { SetEnabled(jetpack, false, uid); if (_timing.IsFirstTimePredicted && _network.IsClient) { _popups.PopupEntity(Loc.GetString("jetpack-to-grid"), uid, Filter.Entities(uid)); } } }
private void OnJetpackUserMovement(EntityUid uid, JetpackUserComponent component, ref MobMovementProfileEvent args) { // Only overwrite jetpack movement if they're offgrid. if (args.Override || !args.Weightless) { return; } args.Override = true; args.Acceleration = component.Acceleration; args.WeightlessModifier = component.WeightlessModifier; args.Friction = component.Friction; }
private void OnJetpackUserCanWeightless(EntityUid uid, JetpackUserComponent component, ref CanWeightlessMoveEvent args) { args.CanMove = true; }