private void OnCigarInteractUsingEvent(EntityUid uid, CigarComponent component, InteractUsingEvent args) { if (args.Handled) { return; } if (!EntityManager.TryGetComponent(uid, out SmokableComponent? smokable)) { return; } if (smokable.State != SmokableState.Unlit) { return; } var isHotEvent = new IsHotEvent(); RaiseLocalEvent(args.Used, isHotEvent, false); if (!isHotEvent.IsHot) { return; } SetSmokableState(uid, SmokableState.Lit, smokable); args.Handled = true; }
private bool CheckHot(EntityUid usedUid) { var hotEvent = new IsHotEvent(); RaiseLocalEvent(usedUid, hotEvent, false); return(hotEvent.IsHot); }
private void OnInteractUsingEvent(EntityUid uid, FlammableComponent flammable, InteractUsingEvent args) { if (args.Handled) { return; } var isHotEvent = new IsHotEvent(); RaiseLocalEvent(args.Used.Uid, isHotEvent, false); if (!isHotEvent.IsHot) { return; } Ignite(uid, flammable); args.Handled = true; }
public void OnCigarAfterInteract(EntityUid uid, CigarComponent component, AfterInteractEvent args) { var targetEntity = args.Target; if (targetEntity == null || !EntityManager.TryGetComponent(uid, out SmokableComponent? smokable) || smokable.State == SmokableState.Lit) { return; } var isHotEvent = new IsHotEvent(); RaiseLocalEvent(targetEntity.Value, isHotEvent); if (!isHotEvent.IsHot) { return; } SetSmokableState(uid, SmokableState.Lit, smokable); args.Handled = true; }
private void OnIsHotEvent(EntityUid uid, FlammableComponent flammable, IsHotEvent args) { args.IsHot = flammable.OnFire; }