/* * Wizard routine for creating objects * * Note that wizards cannot create objects on top of other objects. * * Hack -- this routine always makes a "dungeon object", and applies * magic to it, and attempts to decline cursed items. XXX XXX XXX */ static void wiz_create_item(int num) { int k_idx; int i; /* Save screen */ screen_save(); /* Get object base type */ k_idx = wiz_create_itemtype(); /* Load screen */ screen_load(); /* Return if failed */ if (!k_idx) return; for (i = 0; i < num; i++) { wiz_create_item_aux(k_idx); } /* All done */ msg_print("Allocated."); }
/*! * @brief 任意のベースアイテム生成のメインルーチン / * Wizard routine for creating objects -RAK- * @return なし * @details * Heavily modified to allow magification and artifactification -Bernd- * * Note that wizards cannot create objects on top of other objects. * * Hack -- this routine always makes a "dungeon object", and applies * magic to it, and attempts to decline cursed items. */ static void wiz_create_item(void) { object_type forge; object_type *q_ptr; int k_idx; /* Save the screen */ screen_save(); /* Get object base type */ k_idx = wiz_create_itemtype(); /* Restore the screen */ screen_load(); /* Return if failed */ if (!k_idx) return; if (k_info[k_idx].gen_flags & TRG_INSTA_ART) { int i; /* Artifactify */ for (i = 1; i < max_a_idx; i++) { /* Ignore incorrect tval */ if (a_info[i].tval != k_info[k_idx].tval) continue; /* Ignore incorrect sval */ if (a_info[i].sval != k_info[k_idx].sval) continue; /* Create this artifact */ (void)create_named_art(i, p_ptr->y, p_ptr->x); /* All done */ msg_print("Allocated(INSTA_ART)."); return; } } /* Get local object */ q_ptr = &forge; /* Create the item */ object_prep(q_ptr, k_idx); /* Apply magic */ apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART); /* Drop the object from heaven */ (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x); /* All done */ msg_print("Allocated."); }
/* * Wizard routine for creating objects * * Note that wizards cannot create objects on top of other objects. * * Hack -- this routine always makes a "dungeon object", and applies * magic to it, and attempts to decline cursed items. XXX XXX XXX */ static void wiz_create_item(void) { int py = p_ptr->py; int px = p_ptr->px; object_type *i_ptr; object_type object_type_body; int k_idx; /* Save screen */ screen_save(); /* Get object base type */ k_idx = wiz_create_itemtype(); /* Load screen */ screen_load(); /* Return if failed */ if (!k_idx) return; /* Get local object */ i_ptr = &object_type_body; /* Create the item */ object_prep(i_ptr, k_idx); /* Apply magic (no messages, no artifacts) */ apply_magic(i_ptr, p_ptr->depth, FALSE, FALSE, FALSE); /* Drop the object from heaven */ drop_near(i_ptr, -1, py, px); /* All done */ msg_print("Allocated."); }
/* * Wizard routine for creating objects -RAK- * Heavily modified to allow magification and artifactification -Bernd- * * Note that wizards cannot create objects on top of other objects. * * Hack -- this routine always makes a "dungeon object", and applies * magic to it, and attempts to decline cursed items. */ static void wiz_create_item(void) { int py = p_ptr->py; int px = p_ptr->px; /* int i;*/ object_type forge; object_type *q_ptr; object_kind *k_ptr; int k_idx; /* Save the screen */ screen_save(); /* Get object base type */ k_idx = wiz_create_itemtype(); /* Restore the screen */ screen_load(); /* Return if failed */ if (!k_idx) return; /* Get local object */ q_ptr = &forge; /* Create the item */ object_prep(q_ptr, k_idx); k_ptr = &k_info[k_idx]; /* if (k_ptr->flags3 & TR3_INSTA_ART) {*/ /* Find the "special" artifact this object belongs to */ /* for (i = 1; i < max_a_idx; i++) { artifact_type *a_ptr = &a_info[i];*/ /* Skip "empty" artifacts */ /* if (!a_ptr->name) continue; if ((a_ptr->tval == k_ptr->tval) && (a_ptr->sval == k_ptr->sval)) {*/ /* found it */ /* create_named_art(i, py, px);*/ /* All done */ /* msg_print("Allocated."); return; } } } else {*/ /* Apply magic */ apply_magic(q_ptr, p_ptr->depth, 0, 0, FALSE); /* }*/ /* Drop the object from heaven */ (void)drop_near(q_ptr, -1, py, px); /* All done */ msg_print("Allocated."); }