… | |
… | |
1027 | * God checks item the player is using. |
1027 | * God checks item the player is using. |
1028 | * Return either -1 (bad), 0 (neutral) or |
1028 | * Return either -1 (bad), 0 (neutral) or |
1029 | * 1 (item is ok). If you are using the item of an enemy |
1029 | * 1 (item is ok). If you are using the item of an enemy |
1030 | * god, it can be bad...-b.t. |
1030 | * god, it can be bad...-b.t. |
1031 | */ |
1031 | */ |
1032 | |
|
|
1033 | int |
1032 | int |
1034 | god_examines_item (object *god, object *item) |
1033 | god_examines_item (object *god, object *item) |
1035 | { |
1034 | { |
1036 | char buf[MAX_BUF]; |
1035 | char buf[MAX_BUF]; |
1037 | |
1036 | |
… | |
… | |
1040 | |
1039 | |
1041 | if (!item->title) |
1040 | if (!item->title) |
1042 | return 1; /* unclaimed item are ok */ |
1041 | return 1; /* unclaimed item are ok */ |
1043 | |
1042 | |
1044 | sprintf (buf, "of %s", &god->name); |
1043 | sprintf (buf, "of %s", &god->name); |
1045 | if (!strcmp (item->title, buf)) |
1044 | if (!strcmp (&item->title, buf)) |
1046 | return 1; /* belongs to that God */ |
1045 | return 1; /* belongs to that God */ |
1047 | |
1046 | |
1048 | if (god->title) |
1047 | if (god->title) |
1049 | { /* check if we have any enemy blessed item */ |
1048 | { /* check if we have any enemy blessed item */ |
1050 | sprintf (buf, "of %s", &god->title); |
1049 | sprintf (buf, "of %s", &god->title); |
1051 | if (!strcmp (item->title, buf)) |
1050 | if (!strcmp (&item->title, buf)) |
1052 | { |
1051 | { |
1053 | if (item->env) |
1052 | if (item->env) |
1054 | { |
1053 | { |
1055 | char buf[MAX_BUF]; |
1054 | char buf[MAX_BUF]; |
1056 | |
1055 | |
1057 | sprintf (buf, "Heretic! You are using %s!", query_name (item)); |
1056 | sprintf (buf, "Heretic! You are using %s!", query_name (item)); |
1058 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, item->env, buf); |
1057 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, item->env, buf); |
1059 | } |
1058 | } |
|
|
1059 | |
1060 | return -1; |
1060 | return -1; |
1061 | } |
1061 | } |
1062 | } |
1062 | } |
1063 | |
1063 | |
1064 | return 0; /* item is sacred to a non-enemy god/or is otherwise magical */ |
1064 | return 0; /* item is sacred to a non-enemy god/or is otherwise magical */ |
… | |
… | |
1066 | |
1066 | |
1067 | /** |
1067 | /** |
1068 | * Returns priest's god's id. |
1068 | * Returns priest's god's id. |
1069 | * Straight calls lookup_god_by_name |
1069 | * Straight calls lookup_god_by_name |
1070 | */ |
1070 | */ |
1071 | |
|
|
1072 | int |
1071 | int |
1073 | get_god (object *priest) |
1072 | get_god (object *priest) |
1074 | { |
1073 | { |
1075 | return lookup_god_by_name (determine_god (priest)); |
1074 | return lookup_god_by_name (determine_god (priest)); |
1076 | } |
1075 | } |