コード例 #1
0
 public bool InteractUsing(InteractUsingEventArgs eventArgs)
 {
     if (!eventArgs.Using.TryGetComponent(out PowerStorageComponent component))
     {
         return(false);
     }
     if (capacitorComponent.Full)
     {
         Owner.PopupMessage(eventArgs.User, "Capacitor at max charge");
         return(false);
     }
     capacitorComponent.FillFrom(component);
     return(true);
 }
コード例 #2
0
 public bool AttackBy(AttackByEventArgs eventArgs)
 {
     if (!eventArgs.AttackWith.TryGetComponent(out PowerStorageComponent component))
     {
         return(false);
     }
     if (capacitorComponent.Full)
     {
         Owner.PopupMessage(eventArgs.User, "Capacitor at max charge");
         return(false);
     }
     capacitorComponent.FillFrom(component);
     return(true);
 }
コード例 #3
0
 public bool Attackby(IEntity user, IEntity attackwith)
 {
     if (!attackwith.TryGetComponent(out PowerStorageComponent component))
     {
         return(false);
     }
     if (capacitorComponent.Full)
     {
         Owner.PopupMessage(user, "Capacitor at max charge");
         return(false);
     }
     capacitorComponent.FillFrom(component);
     return(true);
 }