:viktor_start_machine_craft
  Viktor "Alright. It'll take me two days to craft this. Don't forget to come pick it up then."
  switch viktorIsUpgradingTool ON
  js Variables.viktorDaysToComplete = 2;
  + Variables.viktorToolUpgradeEvent = Variables.viktorToolBeingUpgraded.replace('-', '_') + '_craft_complete';

:machine_craft_complete
  # Before calling this event, set the machine itemId on Variables.upgradedToolId
  Viktor "Hey <name>, your new machine is ready! Here you go."
  
  wait 10
  if !Managers.Items.tryPickItemId(Variables.upgradedToolId) 
    Viktor "Oh, you can't carry it with you right now? No problem, I'll send it to your farm then. Check your mailbox when you get there."
    js Managers.Items.mailboxContainer.gainItemId(Variables.upgradedToolId);
  end

  wait 5
  switch viktorIsUpgradingTool OFF

:trigger_cheese_maker_craft
  js Variables.viktorToolBeingUpgraded = 'cheese-maker';
  include viktor_start_machine_craft

:cheese_maker_craft_complete
  js Variables.upgradedToolId = 'cheese-maker';
  include machine_craft_complete

:trigger_mayo_maker_craft
  js Variables.viktorToolBeingUpgraded = 'mayo-maker';
  include viktor_start_machine_craft

:mayo_maker_craft_complete
  js Variables.upgradedToolId = 'mayo-maker';
  include machine_craft_complete

:trigger_hay_maker_craft
  js Variables.viktorToolBeingUpgraded = 'hay-maker';
  include viktor_start_machine_craft

:hay_maker_craft_complete
  js Variables.upgradedToolId = 'hay-maker';
  include machine_craft_complete

:trigger_feed_maker_craft
  js Variables.viktorToolBeingUpgraded = 'feed-maker';
  include viktor_start_machine_craft

:feed_maker_craft_complete
  js Variables.upgradedToolId = 'feed-maker';
  include machine_craft_complete

:trigger_seed_maker_craft
  js Variables.viktorToolBeingUpgraded = 'seed-maker';
  include viktor_start_machine_craft

:seed_maker_craft_complete
  js Variables.upgradedToolId = 'seed-maker';
  include machine_craft_complete

:trigger_yarn_maker_craft
  variable viktorToolBeingUpgraded yarn-maker
  include viktor_start_machine_craft

:yarn_maker_craft_complete
  variable upgradedToolId yarn-maker
  include machine_craft_complete

