… | |
… | |
100 | return 0; |
100 | return 0; |
101 | |
101 | |
102 | /* Check for MONEY type is a special hack - it prevents 'nothing needs |
102 | /* Check for MONEY type is a special hack - it prevents 'nothing needs |
103 | * identifying' from being printed out more than it needs to be. |
103 | * identifying' from being printed out more than it needs to be. |
104 | */ |
104 | */ |
105 | if (!check_altar_sacrifice (altar, money) || money->type != MONEY) |
105 | if (!check_altar_sacrifice (altar, money, pl) || money->type != MONEY) |
106 | return 0; |
106 | return 0; |
107 | |
107 | |
108 | /* if the player has a marked item, identify that if it needs to be |
108 | /* if the player has a marked item, identify that if it needs to be |
109 | * identified. If it doesn't, then go through the player inventory. |
109 | * identified. If it doesn't, then go through the player inventory. |
110 | */ |
110 | */ |
111 | if (object *marked = find_marked_object (pl)) |
111 | if (object *marked = find_marked_object (pl)) |
112 | if (!QUERY_FLAG (marked, FLAG_IDENTIFIED) && need_identify (marked)) |
112 | if (!QUERY_FLAG (marked, FLAG_IDENTIFIED) && need_identify (marked)) |
113 | { |
113 | { |
114 | if (operate_altar (altar, &money)) |
114 | if (operate_altar (altar, &money, pl)) |
115 | { |
115 | { |
116 | identify (marked); |
116 | identify (marked); |
117 | |
117 | |
118 | buf.printf ("You have %s.\r", long_desc (marked, pl)); |
118 | buf.printf ("You have %s.\r", long_desc (marked, pl)); |
119 | if (marked->msg) |
119 | if (marked->msg) |
… | |
… | |
125 | |
125 | |
126 | for (object *id = pl->inv; id; id = id->below) |
126 | for (object *id = pl->inv; id; id = id->below) |
127 | { |
127 | { |
128 | if (!QUERY_FLAG (id, FLAG_IDENTIFIED) && !id->invisible && need_identify (id)) |
128 | if (!QUERY_FLAG (id, FLAG_IDENTIFIED) && !id->invisible && need_identify (id)) |
129 | { |
129 | { |
130 | if (operate_altar (altar, &money)) |
130 | if (operate_altar (altar, &money, pl)) |
131 | { |
131 | { |
132 | identify (id); |
132 | identify (id); |
133 | |
133 | |
134 | buf.printf ("You have %s.\r", long_desc (id, pl)); |
134 | buf.printf ("You have %s.\r", long_desc (id, pl)); |
135 | if (id->msg) |
135 | if (id->msg) |
… | |
… | |
1060 | { |
1060 | { |
1061 | /* Only players can make sacrifices on spell casting altars. */ |
1061 | /* Only players can make sacrifices on spell casting altars. */ |
1062 | if (altar->inv && (!originator || originator->type != PLAYER)) |
1062 | if (altar->inv && (!originator || originator->type != PLAYER)) |
1063 | return 0; |
1063 | return 0; |
1064 | |
1064 | |
1065 | if (operate_altar (altar, &sacrifice)) |
1065 | if (operate_altar (altar, &sacrifice, originator)) |
1066 | { |
1066 | { |
1067 | /* Simple check. Unfortunately, it means you can't cast magic bullet |
1067 | /* Simple check. Unfortunately, it means you can't cast magic bullet |
1068 | * with an altar. We call it a Potion - altars are stationary - it |
1068 | * with an altar. We call it a Potion - altars are stationary - it |
1069 | * is up to map designers to use them properly. |
1069 | * is up to map designers to use them properly. |
1070 | */ |
1070 | */ |
… | |
… | |
1465 | break; |
1465 | break; |
1466 | |
1466 | |
1467 | case TRIGGER_BUTTON: |
1467 | case TRIGGER_BUTTON: |
1468 | case TRIGGER_PEDESTAL: |
1468 | case TRIGGER_PEDESTAL: |
1469 | case TRIGGER_ALTAR: |
1469 | case TRIGGER_ALTAR: |
1470 | check_trigger (trap, victim); |
1470 | check_trigger (trap, victim, originator); |
1471 | break; |
1471 | break; |
1472 | |
1472 | |
1473 | case DEEP_SWAMP: |
1473 | case DEEP_SWAMP: |
1474 | walk_on_deep_swamp (trap, victim); |
1474 | walk_on_deep_swamp (trap, victim); |
1475 | break; |
1475 | break; |
… | |
… | |
2595 | update_object (op, UP_OBJ_FACE); |
2595 | update_object (op, UP_OBJ_FACE); |
2596 | push_button (op, who); |
2596 | push_button (op, who); |
2597 | return 1; |
2597 | return 1; |
2598 | |
2598 | |
2599 | case TRIGGER: |
2599 | case TRIGGER: |
2600 | if (check_trigger (op, who)) |
2600 | if (check_trigger (op, who, who)) |
2601 | { |
2601 | { |
2602 | who->statusmsg ("You turn the handle."); |
2602 | who->statusmsg ("You turn the handle."); |
2603 | who->play_sound (sound_find ("turn_handle")); |
2603 | who->play_sound (sound_find ("turn_handle")); |
2604 | } |
2604 | } |
2605 | else |
2605 | else |
… | |
… | |
3786 | } |
3786 | } |
3787 | |
3787 | |
3788 | for (mapspace *ms = spaces + size (); ms-- > spaces; ) |
3788 | for (mapspace *ms = spaces + size (); ms-- > spaces; ) |
3789 | for (object *tmp = ms->bot; tmp; tmp = tmp->above) |
3789 | for (object *tmp = ms->bot; tmp; tmp = tmp->above) |
3790 | if (tmp->above && (tmp->type == TRIGGER_BUTTON || tmp->type == TRIGGER_PEDESTAL)) |
3790 | if (tmp->above && (tmp->type == TRIGGER_BUTTON || tmp->type == TRIGGER_PEDESTAL)) |
3791 | check_trigger (tmp, tmp->above); |
3791 | check_trigger (tmp, tmp->above, tmp->above); |
3792 | } |
3792 | } |
3793 | |
3793 | |
3794 | /** |
3794 | /** |
3795 | * Handles player eating food that temporarily changes status (resistances, stats). |
3795 | * Handles player eating food that temporarily changes status (resistances, stats). |
3796 | * This used to call cast_change_attr(), but |
3796 | * This used to call cast_change_attr(), but |