[
  {
    "type": "effect_on_condition",
    "id": "EOC_DREAMSMITHS_SCORE_TIMER",
    "//": "Increase the dreamsmith recipe score for `deduction` amount.  Respond for passive score gain.  Also gives lvl 1 recipes every day.",
    "recurrence": [ "20 hours", "28 hours" ],
    "condition": { "u_has_trait": "DREAMSMITH" },
    "effect": [
      { "math": [ "DREAMSMITH_RECIPE_SCORE", "+=", "u_skill('deduction')" ] },
      {
        "u_roll_remainder": [
          "dreamdross_bo",
          "dreamdross_knife",
          "dreamdross_club",
          "dreamsmith_research",
          "dreamdross_lump",
          "forged_dreamstuff_ingot"
        ],
        "type": "recipe",
        "true_eocs": {
          "id": "EOC_MESSAGE_SCORE_TIMER",
          "effect": [
            {
              "u_message": "Something sparked in your head, and you realize an interesting property of dreamdross.  Maybe you can forge something new?",
              "type": "info"
            }
          ]
        }
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DREAMSMITHS_SCORE_TRAIN",
    "//": "Increase the dreamsmith recipe score and recipe superscore for each `training` spell cast.  Each cast increase the gain score for 1",
    "condition": { "u_has_trait": "DREAMSMITH" },
    "effect": [
      { "math": [ "DREAMSMITH_RECIPE_SCORE", "+=", "DREAMSMITH_RECIPE_SCORE_TRAINS" ] },
      { "math": [ "DREAMSMITH_RECIPE_SCORE_TRAINS", "++" ] },
      { "math": [ "DREAMSMITH_RECIPE_SCORE_SUPER", "+=", "DREAMSMITH_RECIPE_SCORE_TRAINS_SUPER" ] },
      { "math": [ "DREAMSMITH_RECIPE_SCORE_TRAINS_SUPER", "++" ] },
      { "run_eocs": "EOC_DREAMSMITHS_RECIPES_ENCH" },
      { "run_eocs": "EOC_DREAMSMITHS_RECIPES_SUPER" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DREAMSMITHS_RECIPES_ENCH",
    "//": "If your DREAMSMITH_RECIPE_SCORE bigger than DREAMSMITH_RECIPE_SCORE_TARGET, you take a spell, DREAMSMITH_RECIPE_SCORE is zeroed, and DREAMSMITH_RECIPE_SCORE_TARGET is increased for 25. Const 25 is respond for gap between each recipe gain. Now it's 1 casts for first gain, 6 for second, 5 for third and further.",
    "condition": {
      "and": [ { "u_has_trait": "DREAMSMITH" }, { "math": [ "DREAMSMITH_RECIPE_SCORE", ">=", "DREAMSMITH_RECIPE_SCORE_TARGET" ] } ]
    },
    "effect": [
      {
        "u_roll_remainder": [
          "dreamforged_ballistic_plate",
          "dreamforged_ballistic_plate_small",
          "dreamforged_q_staff_ench",
          "dreamforged_longsword_ench",
          "dreamforged_warhammer_ench",
          "dreamforged_spear_ench",
          "dreamforged_halberd_ench",
          "dreamforged_glaive_ench",
          "dreamforged_naginata_ench",
          "dreamforged_mace_ench",
          "dreamforged_morningstar_ench",
          "dreamforged_estoc_ench",
          "dreamforged_arming_sword_ench",
          "dreamforged_broadsword_ench",
          "dreamforged_battleaxe_ench",
          "dreamforged_katana_ench",
          "dreamforged_knife_combat_ench",
          "dreamforged_kris_ench",
          "dreamforged_kukri_ench",
          "dreamforged_nodachi_ench",
          "dreamforged_rapier_ench",
          "dreamforged_tanto_ench",
          "dreamforged_wakizashi_ench",
          "dreamforged_zweihander_ench",
          "dreamforged_khopesh_ench",
          "dreamforged_lucerne_ench",
          "dreamforged_knuckle_ench",
          "dreamforged_fullhelmet_ench",
          "dreamforged_helmet_ench",
          "dreamforged_plate_armor_ench",
          "dreamforged_armguard_plate_ench",
          "dreamforged_boots_ench",
          "dreamforged_longbow",
          "arrow_dreamforged",
          "dreamforged_crossbow",
          "bolt_dreamforged",
          "dreamforged_hacksaw",
          "dreamforged_hammer",
          "dreamforged_halligan",
          "dreamforged_pliers_locking",
          "dreamforged_pickaxe",
          "dreamforged_picklocks",
          "dreamforged_scalpel",
          "dreamforged_e_tool",
          "dreamforged_ax"
        ],
        "type": "recipe",
        "true_eocs": {
          "id": "EOC_DREAMSMITH_MESSAGE_POSITIVE",
          "effect": [
            {
              "u_message": "A brilliant idea about the properties of dreamdross  hits your head, and you think you know how to utilize it now.",
              "type": "good"
            }
          ]
        }
      },
      { "math": [ "DREAMSMITH_RECIPE_SCORE", "=", "0" ] },
      { "math": [ "DREAMSMITH_RECIPE_SCORE_TARGET", "+=", "25" ] }
    ],
    "false_effect": [ { "u_message": "You tried to test a new idea, but it failed.  Try again.", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DREAMSMITHS_RECIPES_SUPER",
    "//": "If your DREAMSMITH_RECIPE_SCORE_SUPER bigger than DREAMSMITH_RECIPE_SCORE_TARGET, you take a spell, DREAMSMITH_RECIPE_SCORE_SUPER is zeroed, and DREAMSMITH_RECIPE_SCORE_TARGET is increased for 200.  const 1000 here is respond for delay, after which player would be able to obtain super recipes, and const 200 is for gap between them. Right now it would be 45th cast of training spell for first recipe, 22 for second, 18 for third, 17 for fouth.",
    "condition": {
      "and": [
        { "u_has_trait": "DREAMSMITH" },
        { "math": [ "DREAMSMITH_RECIPE_SCORE_SUPER", ">=", "DREAMSMITH_RECIPE_SCORE_SUPER_TARGET + 1000" ] }
      ]
    },
    "effect": [
      {
        "u_roll_remainder": [
          "dreamforged_knuckle_berserk",
          "dreamforged_helmet_berserker",
          "dreamforged_armguard_plate_berserk",
          "dreamforged_boots_berserk",
          "dreamforged_fullhelmet_arcane",
          "dreamforged_glaive_healing",
          "dreamforged_tsurugi_speed",
          "dreamforged_q_staff_exp",
          "dreamforged_armguard_plate_gunslinger"
        ],
        "type": "recipe",
        "true_eocs": {
          "id": "EOC_DREAMSMITH_SUPER_MESSAGE_POSITIVE",
          "effect": [
            {
              "u_message": "You found a pretty smart way to utilize dreamdross' abilities, and you can't wait to use it.",
              "type": "good"
            }
          ]
        }
      },
      { "math": [ "DREAMSMITH_RECIPE_SCORE_SUPER", "=", "0" ] },
      { "math": [ "DREAMSMITH_RECIPE_SCORE_SUPER_TARGET", "+=", "200" ] }
    ]
  }
]
