actionforceabite.c 701 B

1234567891011121314151617181920212223242526272829303132
  1. class ActionForceABiteCB : ActionSingleUseBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CASingleUseQuantityEdible(UAQuantityConsumed.EAT_NORMAL);
  6. }
  7. };
  8. class ActionForceABite: ActionForceConsumeSingle
  9. {
  10. void ActionForceABite()
  11. {
  12. m_CallbackClass = ActionForceABiteCB;
  13. m_Text = "#feed_a_bite";
  14. }
  15. override void CreateConditionComponents()
  16. {
  17. m_ConditionItem = new CCINonRuined;
  18. m_ConditionTarget = new CCTMan(UAMaxDistances.DEFAULT);
  19. }
  20. override void OnEndServer( ActionData action_data )
  21. {
  22. super.OnEndServer(action_data);
  23. if ( action_data.m_MainItem.GetQuantity() <= 0 )
  24. {
  25. action_data.m_MainItem.SetQuantity(0);
  26. }
  27. }
  28. };