sambucusberry.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. class SambucusBerry extends Edible_Base
  2. {
  3. override bool CanBeCooked()
  4. {
  5. return true;
  6. }
  7. override bool CanBeCookedOnStick()
  8. {
  9. return false;
  10. }
  11. override bool IsFruit()
  12. {
  13. return true;
  14. }
  15. override bool CanDecay()
  16. {
  17. return true;
  18. }
  19. bool ConditionAttach ( EntityAI parent )
  20. {
  21. //if Barrel_ColorBase
  22. if ( parent.IsInherited( Barrel_ColorBase ) )
  23. {
  24. Barrel_ColorBase barrel = Barrel_ColorBase.Cast( parent );
  25. if ( barrel.IsOpen() && !barrel.FindAttachmentBySlotName( "Nails" ) && !barrel.FindAttachmentBySlotName( "OakBark" ) && !barrel.FindAttachmentBySlotName( "BirchBark" ) && !barrel.FindAttachmentBySlotName( "Lime" ) && !barrel.FindAttachmentBySlotName( "Disinfectant" ) && !barrel.FindAttachmentBySlotName( "Guts" ) )
  26. {
  27. return true;
  28. }
  29. }
  30. return false;
  31. }
  32. bool ConditionDetach ( EntityAI parent )
  33. {
  34. //if Barrel_ColorBase
  35. if ( parent.IsInherited( Barrel_ColorBase ) )
  36. {
  37. Barrel_ColorBase barrel = Barrel_ColorBase.Cast( parent );
  38. if ( !barrel.IsOpen() )
  39. {
  40. return false;
  41. }
  42. }
  43. return true;
  44. }
  45. override void SetActions()
  46. {
  47. super.SetActions();
  48. AddAction(ActionForceFeed);
  49. AddAction(ActionEat);
  50. }
  51. }