Esempio n. 1
0
 private void OnGetState(EntityUid uid, FixturesComponent component, ref ComponentGetState args)
 {
     args.State = new FixtureManagerComponentState
     {
         Fixtures = component.Fixtures.Values.ToList(),
     };
 }
 private void OnFootGetState(EntityUid uid, FootstepModifierComponent component, ref ComponentGetState args)
 {
     args.State = new FootstepModifierComponentState()
     {
         Sound = component.Sound,
     };
 }
 private void OnRiderGetState(EntityUid uid, RiderComponent component, ref ComponentGetState args)
 {
     args.State = new RiderComponentState()
     {
         Entity = component.Vehicle,
     };
 }
 private void OnParallaxGetState(EntityUid uid, ParallaxComponent component, ref ComponentGetState args)
 {
     args.State = new ParallaxComponentState
     {
         Parallax = component.Parallax
     };
 }
 private void OnRelayGetState(EntityUid uid, RelayInputMoverComponent component, ref ComponentGetState args)
 {
     args.State = new RelayInputMoverComponentState()
     {
         Entity = component.RelayEntity,
     };
 }
Esempio n. 6
0
 private void OnGetState(EntityUid uid, RadarConsoleComponent component, ref ComponentGetState args)
 {
     args.State = new RadarConsoleComponentState()
     {
         Range = component.MaxRange
     };
 }
Esempio n. 7
0
 private void OnGetState(EntityUid uid, FlyBySoundComponent component, ref ComponentGetState args)
 {
     args.State = new FlyBySoundComponentState()
     {
         Sound = component.Sound,
         Range = component.Range,
     };
 }
Esempio n. 8
0
 private void GetCompState(EntityUid uid, AmbientSoundComponent component, ref ComponentGetState args)
 {
     args.State = new AmbientSoundComponentState
     {
         Enabled = component.Enabled,
         Range   = component.Range,
         Volume  = component.Volume,
     };
 }
    private void OnInjectorGetState(EntityUid uid, InjectorComponent component, ref ComponentGetState args)
    {
        _solutions.TryGetSolution(uid, InjectorComponent.SolutionName, out var solution);

        var currentVolume = solution?.CurrentVolume ?? FixedPoint2.Zero;
        var maxVolume     = solution?.MaxVolume ?? FixedPoint2.Zero;

        args.State = new SharedInjectorComponent.InjectorComponentState(currentVolume, maxVolume, component.ToggleState);
    }
Esempio n. 10
0
        private void GetCompState(EntityUid uid, JointComponent component, ref ComponentGetState args)
        {
            var states = new Dictionary<string, JointState>(component.Joints.Count);

            foreach (var (_, joint) in component.Joints)
            {
                states.Add(joint.ID, joint.GetState());
            }

            args.State = new JointComponent.JointComponentState(states);
        }
Esempio n. 11
0
    private static void OnTagGetState(EntityUid uid, TagComponent component, ref ComponentGetState args)
    {
        var tags = new string[component.Tags.Count];
        var i    = 0;

        foreach (var tag in component.Tags)
        {
            tags[i] = tag;
            i++;
        }

        args.State = new TagComponentState(tags);
    }
Esempio n. 12
0
 private void OnGetState(EntityUid uid, GunComponent component, ref ComponentGetState args)
 {
     args.State = new GunComponentState
     {
         FireRate               = component.FireRate,
         CurrentAngle           = component.CurrentAngle,
         MinAngle               = component.MinAngle,
         MaxAngle               = component.MaxAngle,
         NextFire               = component.NextFire,
         ShotCounter            = component.ShotCounter,
         SelectiveFire          = component.SelectedMode,
         AvailableSelectiveFire = component.AvailableModes,
     };
 }
Esempio n. 13
0
    private void OnPumpGetState(EntityUid uid, PumpBarrelComponent component, ref ComponentGetState args)
    {
        (int, int)? count = (component.ShotsLeft, component.Capacity);
        var chamberedExists = component.ChamberContainer.ContainedEntity != null;
        // (Is one chambered?, is the bullet spend)
        var chamber = (chamberedExists, false);

        if (chamberedExists && TryComp <AmmoComponent?>(component.ChamberContainer.ContainedEntity !.Value, out var ammo))
        {
            chamber.Item2 = ammo.Spent;
        }

        args.State = new PumpBarrelComponentState(
            chamber,
            component.FireRateSelector,
            count,
            component.SoundGunshot.GetSound());
    }
Esempio n. 14
0
 private void OnGetState(EntityUid uid, StatusEffectsComponent component, ref ComponentGetState args)
 {
     args.State = new StatusEffectsComponentState(component.ActiveEffects, component.AllowedEffects);
 }
 private void OnStackGetState(EntityUid uid, SharedStackComponent component, ref ComponentGetState args)
 {
     args.State = new StackComponentState(component.Count, component.MaxCount);
 }
 private void OnKnockGetState(EntityUid uid, KnockedDownComponent component, ref ComponentGetState args)
 {
     args.State = new KnockedDownComponentState(component.HelpInterval, component.HelpTimer);
 }
 private void OnSlowGetState(EntityUid uid, SlowedDownComponent component, ref ComponentGetState args)
 {
     args.State = new SlowedDownComponentState(component.SprintSpeedModifier, component.WalkSpeedModifier);
 }
Esempio n. 18
0
 private void OnMultipleToolGetState(EntityUid uid, MultipleToolComponent multiple, ref ComponentGetState args)
 {
     args.State = new MultipleToolComponentState(multiple.CurrentQualityName);
 }
 private void OnRevolverGetState(EntityUid uid, RevolverAmmoProviderComponent component, ref ComponentGetState args)
 {
     args.State = new RevolverAmmoProviderComponentState
     {
         CurrentIndex = component.CurrentIndex,
         AmmoSlots    = component.AmmoSlots,
         Chambers     = component.Chambers,
     };
 }
 private void OnAppearanceGetState(EntityUid uid, HumanoidAppearanceComponent component, ref ComponentGetState args)
 {
     args.State = new HumanoidAppearanceComponentState(component.Appearance, component.Sex, component.Gender);
 }
 private void DamageableGetState(EntityUid uid, DamageableComponent component, ref ComponentGetState args)
 {
     args.State = new DamageableComponentState(component.Damage.DamageDict, component.DamageModifierSetId);
 }
Esempio n. 22
0
    private void OnRevolverGetState(EntityUid uid, RevolverBarrelComponent component, ref ComponentGetState args)
    {
        var slotsSpent = new bool?[component.Capacity];

        for (var i = 0; i < component.Capacity; i++)
        {
            slotsSpent[i] = null;
            var ammoEntity = component.AmmoSlots[i];
            if (ammoEntity != default && TryComp(ammoEntity, out AmmoComponent? ammo))
            {
                slotsSpent[i] = ammo.Spent;
            }
        }

        //TODO: make yaml var to not sent currentSlot/UI? (for russian roulette)
        args.State = new RevolverBarrelComponentState(
            component.CurrentSlot,
            component.FireRateSelector,
            slotsSpent,
            component.SoundGunshot.GetSound());
    }
 private void GetState(EntityUid uid, ActionsComponent component, ref ComponentGetState args)
 {
     args.State = new ActionsComponentState(component.Actions.ToList());
 }
Esempio n. 24
0
 private void OnGetState(EntityUid uid, StandingStateComponent component, ref ComponentGetState args)
 {
     args.State = new StandingComponentState(component.Standing);
 }
Esempio n. 25
0
 private void OnGetState(EntityUid uid, RgbLightControllerComponent component, ref ComponentGetState args)
 {
     args.State = new RgbLightControllerState(component.CycleRate, component.Layers);
 }
Esempio n. 26
0
 private void OnGetState(EntityUid uid, SharedAirlockComponent airlock, ref ComponentGetState args)
 {
     // Need to network airlock safety state to avoid mis-predicts when a door auto-closes as the client walks through the door.
     args.State = new AirlockComponentState(airlock.Safety);
 }
Esempio n. 27
0
 private void GetComponentState(EntityUid uid, HandsComponent hands, ref ComponentGetState args)
 {
     args.State = new HandsComponentState(hands);
 }
 private void OnGetState(EntityUid uid, ThrownItemComponent component, ref ComponentGetState args)
 {
     args.State = new ThrownItemComponentState(component.Thrower?.Uid);
 }
 private void OnGetState(EntityUid uid, JitteringComponent component, ref ComponentGetState args)
 {
     args.State = new JitteringComponentState(component.Amplitude, component.Frequency);
 }
Esempio n. 30
0
 private void GetItemSlotsState(EntityUid uid, ItemSlotsComponent component, ref ComponentGetState args)
 {
     args.State = new ItemSlotsComponentState(component.Slots);
 }