private void OnComponentInit(EntityUid uid, EggLayerComponent component, ComponentInit args) { if (!_prototype.TryIndex <InstantActionPrototype>(component.EggLayAction, out var action)) { return; } _actions.AddAction(uid, new InstantAction(action), uid); component.CurrentEggLayCooldown = _random.NextFloat(component.EggLayCooldownMin, component.EggLayCooldownMax); }
private void OnEggLayAction(EntityUid uid, EggLayerComponent component, EggLayInstantActionEvent args) { args.Handled = TryLayEgg(uid, component); }