… | |
… | |
389 | if (rndm (0, 2)) |
389 | if (rndm (0, 2)) |
390 | { /* slag created */ |
390 | { /* slag created */ |
391 | object *tmp = cauldron->inv; |
391 | object *tmp = cauldron->inv; |
392 | int weight = 0; |
392 | int weight = 0; |
393 | |
393 | |
394 | tmp = get_archetype ("rock"); |
394 | tmp = get_archetype (shstr_rock); |
395 | tmp->weight = weight; |
395 | tmp->weight = weight; |
396 | tmp->value = 0; |
396 | tmp->value = 0; |
397 | tmp->materialname = "stone"; |
397 | tmp->materialname = shstr_stone; |
398 | tmp->name = "slag"; |
398 | tmp->name = shstr_slag; |
399 | tmp->name_pl = "slags"; |
399 | tmp->name_pl = shstr_slags; |
400 | item = insert_ob_in_ob (tmp, cauldron); |
400 | item = insert_ob_in_ob (tmp, cauldron); |
401 | CLEAR_FLAG (tmp, FLAG_CAN_ROLL); |
401 | CLEAR_FLAG (tmp, FLAG_CAN_ROLL); |
402 | SET_FLAG (tmp, FLAG_NO_DROP); |
402 | SET_FLAG (tmp, FLAG_NO_DROP); |
403 | tmp->move_block = 0; |
403 | tmp->move_block = 0; |
404 | } |
404 | } |
… | |
… | |
466 | |
466 | |
467 | remove_contents (cauldron->inv, NULL); |
467 | remove_contents (cauldron->inv, NULL); |
468 | switch (rndm (0, 2)) |
468 | switch (rndm (0, 2)) |
469 | { |
469 | { |
470 | case 0: |
470 | case 0: |
471 | tmp = get_archetype ("bomb"); |
471 | tmp = get_archetype (shstr_bomb); |
472 | tmp->stats.dam = random_roll (1, level, op, PREFER_LOW); |
472 | tmp->stats.dam = random_roll (1, level, op, PREFER_LOW); |
473 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW); |
473 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW); |
474 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s creates a bomb!", &cauldron->name); |
474 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s creates a bomb!", &cauldron->name); |
475 | break; |
475 | break; |
476 | |
476 | |
477 | default: |
477 | default: |
478 | tmp = get_archetype ("fireball"); |
478 | tmp = get_archetype (shstr_fireball); |
479 | tmp->stats.dam = random_roll (1, level, op, PREFER_LOW) / 5 + 1; |
479 | tmp->stats.dam = random_roll (1, level, op, PREFER_LOW) / 5 + 1; |
480 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW) / 10 + 2; |
480 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW) / 10 + 2; |
481 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
481 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
482 | break; |
482 | break; |
483 | } |
483 | } |
… | |
… | |
883 | uint64 value_ingredients; |
883 | uint64 value_ingredients; |
884 | uint64 value_item; |
884 | uint64 value_item; |
885 | object *tmp; |
885 | object *tmp; |
886 | int attempt_shadow_alchemy; |
886 | int attempt_shadow_alchemy; |
887 | |
887 | |
888 | ave_chance = fl->total_chance / (float) fl->number; |
888 | ave_chance = fl->total_chance / (float)fl->number; |
889 | |
889 | |
890 | ability += (int) (skill->level * ((4.0 + cauldron->magic) / 4.0)); |
890 | ability += (int) (skill->level * ((4.0 + cauldron->magic) / 4.0)); |
891 | |
891 | |
892 | /* determine value of ingredients */ |
892 | /* determine value of ingredients */ |
893 | value_ingredients = 0; |
893 | value_ingredients = 0; |
894 | for (tmp = cauldron->inv; tmp != NULL; tmp = tmp->below) |
894 | for (tmp = cauldron->inv; tmp; tmp = tmp->below) |
895 | value_ingredients += query_cost (tmp, NULL, F_TRUE); |
895 | value_ingredients += query_cost (tmp, NULL, F_TRUE); |
896 | |
896 | |
897 | attempt_shadow_alchemy = !is_defined_recipe (rp, cauldron, caster); |
897 | attempt_shadow_alchemy = !is_defined_recipe (rp, cauldron, caster); |
898 | |
898 | |
899 | /* create the object **FIRST**, then decide whether to keep it. */ |
899 | /* create the object **FIRST**, then decide whether to keep it. */ |