_SIGNAL_PLEASE_TAKE_THIS(L) NAME _signal_please_take_this - offer monster chance to refuse an object SYNOPSIS int _signal_please_take_this(object given_object); LOCATION Can be placed in any living object or container RETURN VALUE 1 means the monster or container refuses to take the object. 0 means the 'give' or 'put' proceeds normally (the default). DESCRIPTION When a player attempts to give a monster an item, this function is called in the monster. If 1 is returned, then the give will not occur. It is up to the monster to print out any useful messages (such as 'The orc refuses to take the foo.'). The same applies to 'put' and containers. EXAMPLE In a Coca-cola machine whose change slot is broken. int _signal_please_take_this(object o) { if( o->id("money") ) { write("The change slot is taped over. You must use dollar bills.\n"); return 1; } if( !o->id("dollar bill") ) { write("There's no way you can put "+o->short()+" into the\n"+ "coke machine! Only a dollar bill will fit.\n"); return 1; } if( o->query_value() > 1 ) { write("The machine spits your money back out. It only will\n"+ "accept ONE dollar bills.\n"); return 1; } return 0; /* Then it's a good old 1-dollar bill. Accept it */ } SEE ALSO _signal_gotten(L), _signal_given(L)
Help topics available:
_signal | _signal_dropped | _signal_given | _signal_take_from_inv | _signal_gotten |
_signal_environment_died | _signal_lost_connection | _signal_please_take_this |
You are guest number 68 since November 2019.
This file was last modified: June 2000.