OBJECT
INVISARMOUR
SYNOPSIS
#include <magic.h>
inherit INVISARMOUR;
LAST UPDATE
Softbyte, 23-Jul-96
DESCRIPTION
The INVISARMOUR is a standard object which provides easy to
use inisibility objects. These objects support the automatic
draw of spellpoints when invisible or the autodestruction after
some time of usage as required by the magic rules.
The item will be activated when wearing it and deactivated when
unwearing it.
As it inherits /std/armour it can be configured just as any
armour, i.e. as rings, cloaks, caps, ...
Per default the INVISOBJECT configures periodic spellpoint
cost as well as a very fast warning and removing. You should
not foget to adjust this to your own needs.
All strings given in the messages are processed with process_string
allowing the use of @@function@@ in the messages.
FUNCTIONS
int SetOwner(object ob)
object QueryOwner()
Sets and queries the player wearing the ring
varargs string OwnerName(int flag)
Returns the name of the player wearing the ring. If
flag is 1 the name is capitalized. This function is
useful as a @@OwnerName@@ in the SetXXXMsg() functions.
int QuerySPCost()
int SetSPCost(int i)
Sets and queries the spellpoints which are subtracted
each call_out after the time set with SetSPTime. If the
time is 0, the SP are subtracted just once.
int QuerySPTime()
int SetSPTime(int i)
Sets and queries the time after which the spellpoints set
with SetSPCost are subtracted. 0 means just once.
int QueryWarnTime()
int SetWarnTime(int i)
Sets and queries the time after which a warning message
is written to the player. This is used to give a warning
before finally dissolving the item. 0 means never.
int QueryRemoveTime()
int SetRemoveTime(int i)
Sets and queries the time after which the item will
be removed. 0 means never.
int SetVisibleMsg(string *str)
string *QueryVisibleMsg()
Sets and Queries the text written to the player and
its environment when becoming visible again. The format
is ({"text to player\n","text to environment\n"}). No
message is given via "" or thoroughly ({"",""})
int SetInvisibleMsg(string *str)
string *QueryInvisibleMsg()
Sets and Queries the text written to the player and
its environment when becoming invisible. The format
is ({"text to player\n","text to environment\n"}). No
message is given via "".
int SetSPMsg(string *str)
string *QuerySPMsg()
Sets and Queries the text written to the player and
its environment when spellpoints are subtracted. The format
is ({"text to player\n","text to environment\n"}). No
message is given via "".
int SetWarnMsg(string *str)
string *QueryWarnMsg()
Sets and Queries the text written to the player and
its environment when the warnmessage is called. The format
is ({"text to player\n","text to environment\n"}). No
message is given via "".
int SetRemoveMsg(string *str)
string *QueryRemoveMsg()
Sets and Queries the text written to the player and
its environment when the item is removed. The format
is ({"text to player\n","text to environment\n"}). No
message is given via "".
EXAMPLE
void create() {
::create();
AddId("ring");
AddId("invisibility");
AddAdjective("invisibility");
SetShort("Ring of Invisibility");
SetLong ("Wear the ring to activate its powers.\n");
SetValue (10000);
SetWeight (500);
SetAC(0);
SetArmourType(AT_RING);
SetSPCost(30);
SetSPTime(60);
SetSPMsg(({"You loose some mental energy.\n",""}));
SetRemoveTime(60);
SetWarnTime(30);
SetWarnMsg( ({"You begin to become partly visible.\n",""}) );
SetRemoveMsg( ({"Your @@QueryShort@@ dissolves.\n",""}) );
SetVisibleMsg( ({"You turn visible again.\n",
"@@OwnerName|1@@ appears from nowhere.\n"}) );
SetInvisibleMsg( ({"You turn invisible.\n",
"@@OwnerName|1@@ vanishes.\n"}) );
}
INHERITANCE TREE
INVISARMOUR
|
`-std/armour
SEE ALSO
magic