2009-05-09 13:11:51 +00:00
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE funcs SYSTEM "../../../clonk.dtd">
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs >
<func >
<title > SetMass</title>
<category > Objekte</category> <subcat > Status</subcat>
<version > 4.9.1.0 GWE</version>
<syntax >
2009-08-12 20:44:09 +00:00
<rtype > void</rtype>
2009-05-09 13:11:51 +00:00
<params >
2010-03-15 22:55:14 +00:00
<param > <type > int</type> <name > mass</name> <desc > Neue Eigenmasse</desc> </param>
2009-05-09 13:11:51 +00:00
</params>
</syntax>
2009-08-12 20:44:09 +00:00
<desc > <EFBFBD> ndert die Eigenmasse des aufrufenden Objekts. Die Eigenmasse entspricht dem in der <emlink href= "definition/DefCore.html" > DefCore.txt</emlink> angegebenen Wert unter [DefCore], Mass. Die tats<74> chliche Objektmasse ergibt sich durch Hinzurechnen der Masse aller enthaltenen Objekte.</desc>
2009-05-09 13:11:51 +00:00
<examples >
<example >
2010-03-15 22:55:14 +00:00
<code > private func GetOwnMass(clonk)
2009-05-09 13:11:51 +00:00
{
2010-03-15 22:55:14 +00:00
var mass=clonk-><funclink > GetMass</funclink> (), i, obj;
<funclink > while</funclink> (obj = clonk-><funclink > Contents</funclink> (i++)) mass -= obj-><funclink > GetMass</funclink> ();
<funclink > return</funclink> (mass);
2009-05-09 13:11:51 +00:00
}
protected func Activate(pByClonk)
{
[Essen]
2009-08-12 20:44:09 +00:00
pByClonk->SetMass(GetOwnMass(pByClonk) + 100);
pByClonk-><funclink > Sound</funclink> ("ClonkMunch");
2009-05-09 13:11:51 +00:00
<funclink > return</funclink> (<funclink > RemoveObject</funclink> ());
}</code>
<text > Script f<> r einen Keks: Beim Essen nimmt die Masse des Clonks zu.</text>
</example>
</examples>
<related >
<funclink > GetMass</funclink>
</related>
</func>
<author > Sven2</author> <date > Juni 2003</date>
</funcs>