NAME
	simple_monster.c - a simple monster object

INHERITS
	/std/basic_monster.c
	/std/msg.c

DESCRIPTION
	This file implements some basic functions needed for many monsters
	such as chats, attacks and walking around.

SETUP FUNCTIONS
	add_chat
	remove_chat
	set_chat_chance
	start_walking
	stop_walking
	add_attack

REMOTE FUNCTIONS
	remote_handle_move_monster
	remote_handle_moved
	remote_prevent_enter
	remote_peace_beat
	remote_fight_beat

QUERY FUNCTIONS
	query_busy: returns number of hearts beats this monster is busy.

SPECIAL PROPERTIES
	walk_all_over
	walk_when_fighting
	speed_chat
=============================================================================
NAME
	add_chat - add chat strings

SYNTAX
	void add_chat(string chat);
	or
	void add_chat(string *chats);

DESCRIPTION
	This function addes one or more 'chats' to the monster. Chats are
	strings that the monster will echo when there are players present
	and it is not under attack. You can either give it one chat string
	at a time, or send it an array of chats.

NOTE
	Chats are queued, and in each heart beat, only one line of text is
	displayed. To get the whole queue emptied at once, use the property
	speed_chat. Also note that the chats are automatically broken down
	into chunks of 74 characters each.

=============================================================================
NAME
	remove_chat - remove chats

SYNTAX
	void remove_chat(string chat);
	or
	void remove_chat(string *chat);

DESCRIPTION
	This function does exactly what add_chat does, only backwards.

=============================================================================
NAME
	set_chat_chance - set the chance to be obnoxious

SYNTAX
	void set_chat_chance(int chance);

DESCRIPTION
	This sets the chance (in percent) for the monster to echo one of
	the chat strings every heart beat. ie. A chance of 1 will in average
	do a chat every 200 seconds, a chance of 2 will do one every 100
	seconds, etc etc.

=============================================================================
NAME
	start_walking - make monster walk around

SYNTAX
	void start_walking(int speed);

DESCRIPTION
	This function starts the monster walking. It will in average walk
	every  seconds.

	By default, the monster will only walk in its creator's area.
	If the property walk_all_over is set, the monster will walk around
	in all areas, unless the property no_walkers is set in that room.
	If the property walk_when_fighting is set, the monster will walk
	even while fighting.

=============================================================================
NAME
	add_attack - add an attack to the monster

SYNTAX
	void add_attack(string message,
	                int chance,
	                int damage,
	                int busy,
	                int sp);

DESCRIPTION
	This function adds an attack to the monster, the args are as follows:

	message
		This will be sent to msg(). \b1PRON will be the name of
		the monster, \b2PRON the name of the attacker.
	chance
		This is the chance that the spell will be executed.

	damage (optional)
		This spell will make random(damage) damage to the opponent.

	busy (optional)
		If this is given, the monster will not cast any more spells
		for this long. If this is zero, the monster may cast another
		spell during the same heart_beat.

	sp (optional)
		If this is given, this attack will use that many of the
		monsters spell points. This might be a good way to make
		monsters more equal to players.

	All arguments are sent to eval() with the opponent as second argument.
	
=============================================================================
NAME
	remove_attack - remove an attack to the monster

SYNTAX
	void remove_attack(string message,
	           	   int chance,
	                   int damage,
	                   int busy,
	                   int sp);

DESCRIPTION
	This function removes an attack prevoiusly added with add_attack.
	The arguments to this function must match those given to add_attack
	exactly for the attack to be removed.

=============================================================================
NAME
	remote_handle_move_monster - handle monster moving

SYNTAX
	string *remote_handle_move_monster(object monster);

DESCRIPTION
	This function is called when the monster wants to move to find out
	what directions it has to choose from. It should return an array of
	commands that the monster can choose from.

=============================================================================
NAME
	remote_handle_moved - handle new locations

SYNTAX
	void remote_handle_moved(object monster);

DESCRIPTION
	This function is called when the monster has walked into a new room
	it could be used to greet people in the room or similar things.

=============================================================================
NAME
	remote_prevent_enter - prevent entering some locations

SYNTAX
	int remote_prevent_enter(object monster, string filename);

DESCRIPTION
	This function is called to see if the monster may enter the room
	with the file with the given filename. If it is not allowed to
	this function should return 1, otherwise 0.

=============================================================================
NAME
	remote_peace_beat - function called when we're not fighting

SYNTAX
	void remote_peace_beat(object monster);

DESCRIPTION
	This function is called every 2 seconds when there are players in
	the room and the monster isn't fighting.

=============================================================================
NAME
	remote_fight_beat - function called when we are fighting

SYNTAX
	void remote_fight_beat(object monster);

DESCRIPTION
	This function is called every 2 seconds when we are fighting someone,
	it can be used to make really really special attacks.

=============================================================================

Help topics available:
basic_monster.doc friend.doc monster.doc simple_monster.doc state_monster.doc

[START|BACK ]




[ NannyMuds main page | FAQ | Contact us ]

You are guest number 80 since November 2019.
This file was last modified: June 2000.