forked from Mirrors/openclonk
more cleanup
parent
10e6174b1f
commit
7155e38ecb
|
@ -1,37 +0,0 @@
|
|||
<?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>PlaceInMaterial</title>
|
||||
<category>Objekte</category><subcat>Erzeugung</subcat>
|
||||
<version>4.9.1.0 GWE</version>
|
||||
<syntax>
|
||||
<rtype>object</rtype>
|
||||
<params>
|
||||
<param><type>id</type><name>idDef</name><desc>Objekttyp</desc></param>
|
||||
<param><type>int</type><name>iMaterial</name><desc>Material</desc></param>
|
||||
<param><type>int</type><name>iRetries</name><desc>Anzahl Wiederholungen</desc><optional /></param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Erzeugt ein Objekt des gewünschten Typs irgendwo in der Landscape im gewünschten Material und liefert es zurück.</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<code>PlaceInMaterial(FLNT, <funclink>Material</funclink>("Earth"));</code>
|
||||
<text>Versucht einen Feuerstein in Erde zu erzeugen</text>
|
||||
</example>
|
||||
<example>
|
||||
<code>var obj = PlaceInMaterial(FLAG, <funclink>Material</funclink>("Gold"));
|
||||
<funclink>if</funclink> (obj) <funclink>SetOwner</funclink>(0, obj);
|
||||
<funclink>if</funclink> (!obj) <funclink>Log</funclink>("Konnte keine Flagge in Gold erzeugen!");
|
||||
</code>
|
||||
<text>Versucht eine Flagge in Gold zu erzeugen und sie in den Besitz von Spieler 0 zu übergeben. Gelingt es nicht die Flagge zu erzeugen, wird eine Fehlermeldung geloggt</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
<funclink>PlaceObjects</funclink>
|
||||
<funclink>CreateObject</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>flgr</author><date>Januar 2002</date>
|
||||
</funcs>
|
|
@ -47,7 +47,6 @@ Es wird sichergestellt, dass keine Endlosschleife entsteht.
|
|||
</examples>
|
||||
<related>
|
||||
<funclink>CreateObject</funclink>
|
||||
<funclink>PlaceInMaterial</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Tyron</author><date>August 2004</date>
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
<?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>Value</title>
|
||||
<category>Objekte</category><subcat>Status</subcat>
|
||||
<version>4.6.5.0 CP</version><deprecated />
|
||||
<syntax>
|
||||
<rtype>int</rtype>
|
||||
<params>
|
||||
<param><type>id</type><name>idDef</name><desc>ID der Definition, dessen Wert ermittelt werden soll.</desc></param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Gibt einen Definitionswert zurück.</desc>
|
||||
<remark>Der Aufruf von Value() verursacht keine CalcDefValue-Aufrufe, sondern gibt direkt den DefCore-Wert (eventuell überladen in der Scenario.txt) zurück. Statt dieser Funktion sollte <funclink>GetValue</funclink> mit entsprechenden Parametern verwendet werden.</remark>
|
||||
<related>
|
||||
<funclink>GetValue</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Sven2</author><date>Juni 2003</date>
|
||||
</funcs>
|
|
@ -1384,13 +1384,6 @@ static long FnGetRank(C4AulContext *cthr, C4Object *pObj)
|
|||
return pObj->Info->Rank;
|
||||
}
|
||||
|
||||
static long FnValue(C4AulContext *cthr, C4ID id)
|
||||
{
|
||||
C4Def *pDef = C4Id2Def(id);
|
||||
if (pDef) return pDef->Value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long FnGetActTime(C4AulContext *cthr, C4Object *pObj)
|
||||
{
|
||||
if (!pObj) pObj=cthr->Obj; if (!pObj) return FALSE;
|
||||
|
@ -2080,6 +2073,12 @@ C4FindObject *CreateCriterionsFromPars(C4Value *pPars, C4FindObject **pFOs, C4So
|
|||
return pFO;
|
||||
}
|
||||
|
||||
static bool FnMakeCrewMember(C4AulContext *cthr, C4Object *pObj, long iPlayer)
|
||||
{
|
||||
if (!ValidPlr(iPlayer)) return false;
|
||||
return !!::Players.Get(iPlayer)->MakeCrewMember(pObj);
|
||||
}
|
||||
|
||||
static C4Value FnObjectCount(C4AulContext *cthr, C4Value *pPars)
|
||||
{
|
||||
// Create FindObject-structure
|
||||
|
|
|
@ -8,24 +8,6 @@ global func AbsX(int x) { return x - GetX(); }
|
|||
// Liefert das Offset zur gewünschten Landscape-Y-Position zurück
|
||||
global func AbsY(int y) { return y - GetY(); }
|
||||
|
||||
// Erzeugt ein Objekt mit der angegeben ID in iMaterial. iRetries ist die Anzahl der Versuche.
|
||||
global func PlaceInMaterial(id def, int material, int _retries) { // C4ID id, int iMaterial, [int iRetries]
|
||||
// Gültiger Materialindex? (-1 ist Sky)
|
||||
if (!Inside(material, 0, 127)) return 0;
|
||||
|
||||
// Standardwert von 50000
|
||||
var retries = _retries;
|
||||
if (!retries) retries = 50000;
|
||||
|
||||
for (var retry_num = 0; retry_num < retries; retry_num++) {
|
||||
var x = Random(LandscapeWidth());
|
||||
var y = Random(LandscapeHeight());
|
||||
if (GetMaterial(x, y) == material)
|
||||
return CreateObject(def, x, y, -1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Unterstützt negative Werte und kann Zufallszahlen zwischen 2 Werten liefern
|
||||
|
||||
global func RandomX(int iStart, int iEnd) {
|
||||
|
@ -282,4 +264,4 @@ global func GetPlayerByName(string strPlrName)
|
|||
|
||||
// Es gibt keinen Spieler, der so heißt!
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,16 +29,6 @@ global func RemoveAll(id idDef, int dwOCF)
|
|||
return Cnt;
|
||||
}
|
||||
|
||||
global func CastlePanic()
|
||||
{
|
||||
return ResortObjects("CastlePanicResort", 1);
|
||||
}
|
||||
|
||||
global func CastlePanicResort(object pObj1, object pObj2)
|
||||
{
|
||||
return GetDefBottom(pObj1)-GetDefBottom(pObj2);
|
||||
}
|
||||
|
||||
global func SetBit(int iOldVal, int iBitNr, bool iBit)
|
||||
{
|
||||
if(GetBit(iOldVal, iBitNr) != (iBit != 0))
|
||||
|
|
Loading…
Reference in New Issue