public bool AttackHand(AttackHandEventArgs eventArgs) { if (!eventArgs.User.TryGetComponent(out DamageableComponent damageableComponent)) { Eject(); return(false); } if (eventArgs.User.TryGetComponent(out HeatResistanceComponent heatResistanceComponent)) { if (CanBurn(heatResistanceComponent.GetHeatResistance())) { Burn(); return(true); } } Eject(); return(true); bool CanBurn(int heatResistance) { return(_lightState == LightState.On && heatResistance < LightBulb.BurningTemperature); } void Burn() { damageableComponent.TakeDamage(DamageType.Heat, 20); } void Eject() { EjectBulb(eventArgs.User); UpdateLight(); } }
public bool AttackHand(AttackHandEventArgs eventArgs) { var hands = eventArgs.User.GetComponent <IHandsComponent>(); hands.PutInHand(this, hands.ActiveIndex, fallback: false); return(true); }
bool IAttackHand.AttackHand(AttackHandEventArgs eventArgs) { if (!eventArgs.User.TryGetComponent(out IActorComponent actor)) { return(false); } _userInterface.Open(actor.playerSession); return(true); }
private void InteractableComponent_OnAttackHand(object sender, AttackHandEventArgs e) { if (ContainingSlot != null) { return; } var hands = e.User.GetComponent <IHandsComponent>(); hands.PutInHand(this, e.HandIndex, fallback: false); }
public bool AttackHand(AttackHandEventArgs eventArgs) { if (_state == DoorState.Open) { Close(); } else if (_state == DoorState.Closed) { Open(); } return(true); }
bool IAttackHand.AttackHand(AttackHandEventArgs eventArgs) { if (!eventArgs.User.TryGetComponent <IActorComponent>(out var actor)) { return(false); } if (Status != GravityGeneratorStatus.Off && Status != GravityGeneratorStatus.On) { return(false); } OpenUserInterface(actor.playerSession); return(true); }
public bool AttackHand(AttackHandEventArgs eventArgs) { if (!eventArgs.User.TryGetComponent(out DamageableComponent damageableComponent)) { Eject(); return(false); } if (eventArgs.User.TryGetComponent(out HeatResistanceComponent heatResistanceComponent)) { if (CanBurn(heatResistanceComponent.GetHeatResistance())) { Burn(); return(true); } } Eject(); return(true); bool CanBurn(int heatResistance) { return(_lightState && heatResistance < LightBulb.BurningTemperature); } void Burn() { damageableComponent.TakeDamage(DamageType.Heat, 20, Owner); var audioSystem = _entitySystemManager.GetEntitySystem <AudioSystem>(); audioSystem.Play("/Audio/effects/lightburn.ogg", Owner); } void Eject() { EjectBulb(eventArgs.User); UpdateLight(); } }
///////// ///////// Server-specific stuff ///////// public bool AttackHand(AttackHandEventArgs eventArgs) { //TODO: remove organs? return(false); }