private void OnGuardianAttackAttempt(EntityUid uid, GuardianComponent component, AttackAttemptEvent args) { if (args.Cancelled || args.Target != component.Host) { return; } _popupSystem.PopupCursor(Loc.GetString("guardian-attack-host"), Filter.Entities(uid)); args.Cancel(); }
public bool CanAttack(IEntity entity) { var ev = new AttackAttemptEvent(entity); RaiseLocalEvent(entity.Uid, ev); foreach (var blocker in ev.Entity.GetAllComponents <IActionBlocker>()) { if (!blocker.CanAttack()) { ev.Cancel(); break; } } return(!ev.Cancelled); }
private void OnAttackAttempt(EntityUid uid, StunnedComponent stunned, AttackAttemptEvent args) { args.Cancel(); }
private void OnAttackAttempt(EntityUid uid, PAIComponent component, AttackAttemptEvent args) { args.Cancel(); }