Merged diverged Controls branches

rope
Bernhard Bonigl 2012-04-17 18:36:14 +02:00
commit 293b3f80e8
92 changed files with 909 additions and 463 deletions

View File

@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenClonk documentation\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-03-09 19:12+0100\n"
"POT-Creation-Date: 2012-04-15 21:09+0200\n"
"PO-Revision-Date: 2011-09-07 15:52+0200\n"
"Last-Translator: Günther Brammer <gbrammer@gmx.de>\n"
"Language-Team: German <>\n"
@ -366,8 +366,8 @@ msgstr "Operator"
#: sdk/scenario/scenario.xml:186(col)
#: sdk/scenario/scenario.xml:341(col)
#: sdk/scenario/scenario.xml:361(col)
#: sdk/scenario/scenario.xml:406(col)
#: sdk/scenario/scenario.xml:421(col)
#: sdk/scenario/scenario.xml:396(col)
#: sdk/scenario/scenario.xml:411(col)
#: sdk/scenario/Teams.xml:15(col)
#: sdk/scenario/Teams.xml:74(col)
#: sdk/scenario/MapCreatorS2.xml:34(col)
@ -1041,8 +1041,8 @@ msgstr "Bei dem ersten Operator (Und) steht beim Ergebnis nur dann eine 1, wenn
#: sdk/script/fn/CreateMenu.xml:93(col)
#: sdk/script/fn/Anim_Linear.xml:40(col)
#: sdk/script/fn/AddCommand.xml:76(col)
#: sdk/script/Effects.xml:512(col)
#: sdk/script/Effects.xml:564(col)
#: sdk/script/Effects.xml:514(col)
#: sdk/script/Effects.xml:570(col)
#: sdk/scenario/Teams.xml:34(col)
#: sdk/scenario/Teams.xml:52(col)
#: sdk/scenario/Teams.xml:58(col)
@ -1080,8 +1080,8 @@ msgstr "0"
#: sdk/script/fn/Anim_Linear.xml:41(col)
#: sdk/script/fn/AddCommand.xml:97(col)
#: sdk/script/Effects.xml:199(col)
#: sdk/script/Effects.xml:516(col)
#: sdk/script/Effects.xml:569(col)
#: sdk/script/Effects.xml:519(col)
#: sdk/script/Effects.xml:575(col)
#: sdk/scenario/Teams.xml:22(col)
#: sdk/material/ocm.xml:299(col)
#: sdk/definition/cnat.xml:19(col)
@ -1555,6 +1555,7 @@ msgstr "Entfernt alle Objekte."
#: sdk/script/fn/CloseMenu.xml:8(category)
#: sdk/script/fn/ClearMenuItems.xml:8(category)
#: sdk/script/fn/CheckVisibility.xml:8(category)
#: sdk/script/fn/CheckConstructionSite.xml:8(category)
#: sdk/script/fn/ChangeDef.xml:8(category)
#: sdk/script/fn/CastObjects.xml:8(category)
#: sdk/script/fn/CanConcatPictureWith.xml:8(category)
@ -2740,8 +2741,8 @@ msgstr "Index des Vertex."
#: sdk/scenario/scenario.xml:184(col)
#: sdk/scenario/scenario.xml:339(col)
#: sdk/scenario/scenario.xml:359(col)
#: sdk/scenario/scenario.xml:404(col)
#: sdk/scenario/scenario.xml:419(col)
#: sdk/scenario/scenario.xml:394(col)
#: sdk/scenario/scenario.xml:409(col)
#: sdk/scenario/Teams.xml:13(col)
#: sdk/scenario/Teams.xml:72(col)
#: sdk/playercontrols.xml:21(col)
@ -2768,8 +2769,8 @@ msgstr "Wert"
#: sdk/script/fn/GetPhysical.xml:28(col)
#: sdk/script/fn/Format.xml:31(col)
#: sdk/script/Effects.xml:451(col)
#: sdk/script/Effects.xml:509(col)
#: sdk/script/Effects.xml:560(col)
#: sdk/script/Effects.xml:510(col)
#: sdk/script/Effects.xml:566(col)
msgid "Meaning"
msgstr "Bedeutung"
@ -3473,8 +3474,8 @@ msgstr "PHYS_Temporary"
#: sdk/script/fn/CreateMenu.xml:103(col)
#: sdk/script/fn/Anim_Linear.xml:42(col)
#: sdk/script/fn/AddCommand.xml:90(col)
#: sdk/script/Effects.xml:520(col)
#: sdk/script/Effects.xml:574(col)
#: sdk/script/Effects.xml:524(col)
#: sdk/script/Effects.xml:580(col)
#: sdk/material/ocm.xml:304(col)
#: sdk/definition/cnat.xml:25(col)
#: sdk/definition/cnat.xml:30(col)
@ -3497,8 +3498,8 @@ msgstr "PHYS_StackTemporary"
#: sdk/script/fn/CreateMenu.xml:52(col)
#: sdk/script/fn/CreateMenu.xml:108(col)
#: sdk/script/fn/AddCommand.xml:83(col)
#: sdk/script/Effects.xml:524(col)
#: sdk/script/Effects.xml:579(col)
#: sdk/script/Effects.xml:529(col)
#: sdk/script/Effects.xml:585(col)
#: sdk/definition/cnat.xml:36(col)
msgid "3"
msgstr "3"
@ -3609,7 +3610,7 @@ msgstr "GFX_BLIT_ClrSfc_OwnClr"
#: sdk/script/fn/SetGraphics.xml:65(col)
#: sdk/script/fn/SetGamma.xml:60(col)
#: sdk/script/fn/CreateMenu.xml:57(col)
#: sdk/script/Effects.xml:528(col)
#: sdk/script/Effects.xml:534(col)
#: sdk/definition/cnat.xml:31(col)
#: sdk/definition/cnat.xml:42(col)
msgid "4"
@ -4206,9 +4207,8 @@ msgid "<code>true</code> if you want to add a clonk to the crew and <code>false<
msgstr "<code>true</code> wenn der Clonk der Crew hinzugefügt und <code>false</code> wenn er aus dieser entfernt werden soll."
#: sdk/script/fn/SetCrewStatus.xml:26(desc)
#, fuzzy
msgid "Adds or removes an object (usually a clonk) to or from the crew of a player. The object must have the CrewMember property set in the DefCore. This does not add the object to the permanent crew of the player, use <placeholder-1/> for that."
msgstr "Fügt das aufrufende Objekt (z.B. einen Clonk) der Crew eines Spielers hinzu oder entfernt dieses aus der Crew. Das Objekt muss die CrewMember-Eigenschaft in der DefCore gesetzt haben."
msgstr "Fügt das aufrufende Objekt (z.B. einen Clonk) der Crew eines Spielers hinzu oder entfernt dieses aus der Crew. Das Objekt muss die CrewMember-Eigenschaft in der DefCore gesetzt haben. Das Objekt wird dabei nicht zur permanenten Crew des Spielers hinzugefügt, dazu dient <placeholder-1/>."
#: sdk/script/fn/SetCrewStatus.xml:32(text)
#: sdk/script/fn/MakeCrewMember.xml:27(text)
@ -5334,6 +5334,7 @@ msgstr "Platziert Vegetation im angegebenen Zielrechteck. Bei lokalen Aufrufen g
#: sdk/script/fn/CreateContents.xml:9(subcat)
#: sdk/script/fn/CreateConstruction.xml:9(subcat)
#: sdk/script/fn/ComposeContents.xml:9(subcat)
#: sdk/script/fn/CheckConstructionSite.xml:9(subcat)
#: sdk/script/fn/CastObjects.xml:9(subcat)
#: sdk/script/fn/Buy.xml:9(subcat)
#: sdk/definition/script.xml:10(h)
@ -7572,7 +7573,6 @@ msgstr "s"
#: sdk/scenario/scenario.xml:210(col)
#: sdk/scenario/scenario.xml:280(col)
#: sdk/scenario/scenario.xml:285(col)
#: sdk/scenario/scenario.xml:390(col)
#: sdk/scenario/Teams.xml:62(col)
#: sdk/scenario/Teams.xml:103(col)
#: sdk/playercontrols.xml:32(col)
@ -8272,27 +8272,24 @@ msgid "Definition of the dynamic map. The enclosing map { ... } tag must be pres
msgstr "Definition der dynamischen Karte. Das umschließende map { ...} - Tag muss vorhanden sein."
#: sdk/script/fn/DrawMap.xml:40(desc)
#, fuzzy
msgid "Draws a dynamic map within the specified rectangle over the old landscape. This is done using the same evaluation as with Landscape.txt components."
msgstr "Zeichnet eine dynamische Zufallskarte innerhalb eines Bereichs. Dazu wird derselbe Generator benutzt, der auch die Karten der Landscape.txt zeichnet."
msgstr "Zeichnet eine dynamische Zufallskarte über einen Bereich der alten Landschaft. Dazu wird derselbe Generator benutzt, der auch die Karten der Landscape.txt zeichnet."
#: sdk/script/fn/DrawMap.xml:41(remark)
msgid "As maximum string length in C4Script is limited by internal buffers you should use <placeholder-1/> for very complex maps."
msgstr "Da die Maximallänge von Strings in C4Script durch interne Puffer begrenzt ist, wird empfohlen, für aufwändigere Karten <placeholder-1/> zu benutzen."
#: sdk/script/fn/DrawMap.xml:45(text)
#, fuzzy
msgid "Fills the top half of the map with earth."
msgstr "Leert die obere Hälfte der Karte aus."
msgstr "Füllt die obere hälfte der Karte mit Erde."
#: sdk/script/fn/DrawDefMap.xml:36(desc)
msgid "Name of the map to be used from Landscape.txt."
msgstr "Name der zu benutzenden Karte aus der Landscape.txt"
#: sdk/script/fn/DrawDefMap.xml:40(desc)
#, fuzzy
msgid "Draws a dynamic map within the specified rectangle over the old landscape using a given map specification from Landscape.txt."
msgstr "Zeichnet eine dynamische Zufallskarte innerhalb eines Bereichs. Dazu wird die angegebene Karte in der Landscape.txt gesucht."
msgstr "Zeichnet eine dynamische Zufallskarte über einen Bereich der alten Landschaft. Dazu wird die angegebene Karte in der Landscape.txt gesucht."
#: sdk/script/fn/DrawDefMap.xml:41(remark)
msgid "The Landscape.txt component is usually removed from memory after scenario initialization. To keep it in memory for later use by this command you should specify the option KeepMapCreator=1 in Scenario.txt section [Landscape]."
@ -8507,6 +8504,7 @@ msgstr "Gibt an, wie weit der ausgewählte Clonk noch vom Punkt 1000/200 entfern
#: sdk/script/fn/DigFree.xml:16(desc)
#: sdk/script/fn/CreateObject.xml:22(desc)
#: sdk/script/fn/CreateConstruction.xml:22(desc)
#: sdk/script/fn/CheckConstructionSite.xml:22(desc)
#: sdk/script/fn/CastPXS.xml:31(desc)
#: sdk/script/fn/BlastObjects.xml:16(desc)
msgid "X coordinate"
@ -8516,6 +8514,7 @@ msgstr "X-Koordinate"
#: sdk/script/fn/DigFree.xml:21(desc)
#: sdk/script/fn/CreateObject.xml:27(desc)
#: sdk/script/fn/CreateConstruction.xml:27(desc)
#: sdk/script/fn/CheckConstructionSite.xml:27(desc)
#: sdk/script/fn/CastPXS.xml:36(desc)
#: sdk/script/fn/BlastObjects.xml:21(desc)
msgid "Y coordinate"
@ -8529,23 +8528,28 @@ msgstr "Breite"
msgid "Height"
msgstr "Höhe"
#: sdk/script/fn/DigFreeRect.xml:35(desc)
msgid "Makes a rectangular hole in semi-solid materials."
msgstr "Gräbt ein rechteckiges Loch in halbfesten Materialien."
#: sdk/script/fn/DigFreeRect.xml:36(desc)
#: sdk/script/fn/DigFree.xml:31(desc)
msgid "Prevent objects from being dug out"
msgstr ""
#: sdk/script/fn/DigFreeRect.xml:36(remark)
#: sdk/script/fn/DigFreeRect.xml:40(desc)
msgid "Makes a rectangular hole in semi-solid materials. The return value is the amount of pixels that were dug free. If no_dig2objects is true, the dug out material does neither create objects according to the Dig2Objects in the <emlink href=\"material/ocm.html\">*.ocm</emlink> nor will the amount be stored in the internal buffer."
msgstr ""
#: sdk/script/fn/DigFreeRect.xml:41(remark)
msgid "Drills an elevator shaft."
msgstr "CreateShaft im Fahrstuhl gräbt einen Fahrstuhlschacht."
#: sdk/script/fn/DigFreeRect.xml:40(text)
#: sdk/script/fn/DigFreeRect.xml:45(text)
msgid "Makes a square hole in the middle of the landscape."
msgstr "Gräbt ein kleines quadratisches Loch mitten in die Landschaft."
#: sdk/script/fn/DigFree.xml:30(desc)
msgid "Makes a circular hole in semi-solid materials."
msgstr "Gräbt ein kreisrundes Loch in halbfesten Materialien."
#: sdk/script/fn/DigFree.xml:35(desc)
msgid "Makes a circular hole in semi-solid materials. The return value is the amount of pixels that were dug free. If no_dig2objects is true, the dug out material does neither create objects according to the Dig2Objects in the <emlink href=\"material/ocm.html\">*.ocm</emlink> nor will the amount be stored in the internal buffer."
msgstr ""
#: sdk/script/fn/DigFree.xml:34(text)
#: sdk/script/fn/DigFree.xml:39(text)
msgid "Makes a small hole in the middle of the landscape."
msgstr "Gräbt ein kleines Loch mitten in der Landschaft."
@ -9156,6 +9160,14 @@ msgstr "Vierter Zusatzparameter, der an Fx*Effect-Callbacks übergeben wird"
msgid "Makes Fx*Effect (and in cases Fx*Add) callbacks to the specified list of effects, without actually creating any effect. The return value is -1 if another effect has rejected the call. If an effect accepts the call, the return value is the effect number of that effect."
msgstr "Führt Fx*Effect (und ggf. auch Fx*Add)-Callbacks in der entsprechenden Effektliste aus, ohne einen Effekt selber zu erstellen. Rückgabewert ist -1, wenn ein anderer Effekt den Effekt abgelehnt hat, und die Effektnummer des aufnehmenden Effektes, wenn der Effekt aufgenommen wurde."
#: sdk/script/fn/CheckConstructionSite.xml:17(desc)
msgid "Type of object to be checked."
msgstr "Typ des zu prüfenden Objekts"
#: sdk/script/fn/CheckConstructionSite.xml:31(desc)
msgid "Checks whether the given location is suitable for the construction of object_id. The same check is used before creation in <placeholder-1/> if check_side is true. In local calls the specified position will be an offset to the position of the calling object."
msgstr ""
#: sdk/script/fn/ChangeDef.xml:17(desc)
msgid "id of the new definition."
msgstr "ID der neuen Definition für das Objekt"
@ -9458,19 +9470,16 @@ msgid "Moves the calling object into the background and adds horizontal parallax
msgstr "Versetzt das aufrufende Objekt in den Hintergrund, und gibt ihm horizontale Parallaxität."
#: sdk/script/fn/C4D_Object.xml:12(desc)
#, fuzzy
msgid "Object category: Item that can hit alive objects."
msgstr "Objektkategorie: Spielregeln"
msgstr "Objektkategorie: Objekt, welches Lebewesen Bewegungsschaden zufügt"
#: sdk/script/fn/C4D_Object.xml:16(text)
#, fuzzy
msgid "Returns the id of the first loaded definition with C4D_Object. Similar scripting is used in the research lab to list researchable objects."
msgstr "Liefert die id des ersten geladenen Objekts zurück. Ein ähnlicher Code wird vom Forschungslabor benutzt, um die erforschbaren Objekte aufzulisten."
msgstr "Liefert die id des ersten geladenen Objekts mit Kategorie C4D_Object zurück. Ein ähnlicher Code wird vom Forschungslabor benutzt, um die erforschbaren Objekte aufzulisten."
#: sdk/script/fn/C4D_Living.xml:12(desc)
#, fuzzy
msgid "Objects with this category are alive when created."
msgstr "Objektkategorie: Spielregeln"
msgstr "Objektkategorie: Lebewesen"
#: sdk/script/fn/C4D_Living.xml:16(text)
msgid "Returns the first type of living beings which can be built by player 1 - usually none."
@ -10142,8 +10151,8 @@ msgstr "Beispiel"
#: sdk/scenario/scenario.xml:320(col)
#: sdk/scenario/scenario.xml:325(col)
#: sdk/scenario/scenario.xml:330(col)
#: sdk/scenario/scenario.xml:395(col)
#: sdk/scenario/scenario.xml:425(col)
#: sdk/scenario/scenario.xml:385(col)
#: sdk/scenario/scenario.xml:415(col)
#: sdk/scenario/Teams.xml:20(col)
#: sdk/scenario/Teams.xml:26(col)
#: sdk/scenario/Teams.xml:32(col)
@ -10377,9 +10386,8 @@ msgid "When used as a function parameter type, the type check is skipped."
msgstr "Wenn als Parametertyp für eine Funktion benutzt wird die Typüberprüfung nicht vorgenommen."
#: sdk/script/Typechecks.xml:68(emlink)
#, fuzzy
msgid "Object Definition"
msgstr "Objektdefinitionen"
msgstr "Objektdefinition"
#: sdk/script/Typechecks.xml:69(col)
msgid "Represents a DefCore.txt and the associated Script.c. A special kind of proplist."
@ -11162,12 +11170,12 @@ msgstr "Eigenschaften-Referenz"
#: sdk/script/Effects.xml:332(text)
msgid "Effects have a number of standard properties:"
msgstr ""
msgstr "Effekte haben folgende Standard-eigenschaften"
#: sdk/script/Effects.xml:334(caption)
#, fuzzy
msgid "Effect Properties"
msgstr "Objekteigenschaften"
msgstr "Effek Properties"
#: sdk/script/Effects.xml:336(col)
#: sdk/scenario/scenario.xml:15(col)
@ -11176,8 +11184,8 @@ msgstr "Objekteigenschaften"
#: sdk/scenario/scenario.xml:185(col)
#: sdk/scenario/scenario.xml:340(col)
#: sdk/scenario/scenario.xml:360(col)
#: sdk/scenario/scenario.xml:405(col)
#: sdk/scenario/scenario.xml:420(col)
#: sdk/scenario/scenario.xml:395(col)
#: sdk/scenario/scenario.xml:410(col)
#: sdk/scenario/Teams.xml:14(col)
#: sdk/scenario/Teams.xml:73(col)
#: sdk/playercontrols.xml:22(col)
@ -11205,7 +11213,7 @@ msgstr "string"
#: sdk/script/Effects.xml:343(col)
#, fuzzy
msgid "Can be changed."
msgstr "0-3: Farbwert, der geändert werden soll"
msgstr "Kann geändert werden"
#: sdk/script/Effects.xml:346(col)
#: sdk/script/Effects.xml:351(col)
@ -11413,287 +11421,308 @@ msgid "reason contains the cause of the removal and can be one of the following
msgstr "reason gibt den Grund für das Entfernen des Effektes an, und kann einer der folgenden Werte sein:"
#: sdk/script/Effects.xml:508(col)
#: sdk/script/Effects.xml:564(col)
msgid "Script constant"
msgstr "Scriptkonstante"
#: sdk/script/Effects.xml:509(col)
msgid "reason"
msgstr "reason"
#: sdk/script/Effects.xml:513(col)
msgid "FX_Call_Normal"
msgstr "FX_Call_Normal"
#: sdk/script/Effects.xml:515(col)
msgid "Normal removal"
msgstr "Effekt wird regulär entfernt"
#: sdk/script/Effects.xml:517(col)
#: sdk/script/Effects.xml:518(col)
msgid "FX_Call_Temp"
msgstr "FX_Call_Temp"
#: sdk/script/Effects.xml:520(col)
msgid "Temporary removal (temporary is 1)."
msgstr "Effekt wird nur temporär entfernt. temporary ist in dem Fall 1."
#: sdk/script/Effects.xml:521(col)
#: sdk/script/Effects.xml:523(col)
msgid "FX_Call_TempAddForRemoval"
msgstr "FX_Call_TempAddForRemoval"
#: sdk/script/Effects.xml:525(col)
msgid "Not used"
msgstr "nicht verwendet"
#: sdk/script/Effects.xml:525(col)
#: sdk/script/Effects.xml:528(col)
msgid "FX_Call_RemoveClear"
msgstr "FX_Call_RemoveClear"
#: sdk/script/Effects.xml:530(col)
msgid "The target object has been deleted"
msgstr "Effekt wird entfernt, weil das Objekt gelöscht wird"
#: sdk/script/Effects.xml:529(col)
#: sdk/script/Effects.xml:533(col)
msgid "FX_Call_RemoveDeath"
msgstr "FX_Call_RemoveDeath"
#: sdk/script/Effects.xml:535(col)
msgid "The target object has died"
msgstr "Effekt wird entfernt, weil das Objekt stirbt"
#: sdk/script/Effects.xml:533(text)
#: sdk/script/Effects.xml:539(text)
msgid "The effect can prevent removal by returning -1. This will not help, however, in temporary removals or if the target object has been deleted."
msgstr "Wenn der Effekt nicht gelöscht werden soll, kann in der Funktion -1 zurückgegeben werden, um das Löschen zu verhindern. Bei temporären Aufrufen oder wenn das Zielobjekt gelöscht wird, bringt dies natürlich nichts."
#: sdk/script/Effects.xml:534(h)
#: sdk/script/Effects.xml:540(h)
msgid "Fx*Timer"
msgstr "Fx*Timer"
#: sdk/script/Effects.xml:536(text)
#: sdk/script/Effects.xml:542(text)
msgid "Periodic timer call, if a timer interval has been specified at effect creation. target and <code>effect</code> as usual."
msgstr "Periodischer Timer-Aufruf, wenn bei der Effekterzeugung ein Timer-Intervall angegeben wurde. target und <code>effect</code> spezifizieren auch hier Zielobjekt und Effekt."
#: sdk/script/Effects.xml:537(text)
#: sdk/script/Effects.xml:543(text)
msgid "time specifies how long the effect has now been active. This might alternatively be determined using effect.Time."
msgstr "time gibt die die Zeit an, die der Effekt schon läuft. Diese lässt sich auch über effect.Time herausfinden."
#: sdk/script/Effects.xml:538(text)
#: sdk/script/Effects.xml:544(text)
msgid "If this function is not implemented or returns -1, the effect will be deleted after this call."
msgstr "Ein Rückgabewert von -1 bedeutet, dass der Effekt nach dem Aufruf gelöscht wird. Dasselbe passiert, wenn die Funktion nicht implementiert wird."
#: sdk/script/Effects.xml:539(h)
#: sdk/script/Effects.xml:545(h)
msgid "Fx*Effect"
msgstr "Fx*Effect"
#: sdk/script/Effects.xml:541(text)
#: sdk/script/Effects.xml:547(text)
msgid "A call to all effects of higher priority if a new effect is to be added to the same target object. new_name is the name of the new effect; <code>effect</code> is the effect being called."
msgstr "Aufruf an alle Effekte mit höherer Priorität, wenn ein neuer Effekt zu demselben Objekt (target) hinzugefügt werden soll. new_name gibt den Namen des neuen Effektes an; <code>effect</code> ist der Effekt bei dem angefragt wird."
#: sdk/script/Effects.xml:542(text)
#: sdk/script/Effects.xml:548(text)
msgid "Warning: the new effect is not yet properly initialized and should not be manipulated in any way. Especially the priority field might not yet have been set."
msgstr "Achtung: Der neue Effekt ist noch nicht fertig initialisiert, und sollte daher nicht manipuliert werden. Insbesondere das Priority-Feld ist möglicherweise noch nicht initialisiert."
#: sdk/script/Effects.xml:543(text)
#: sdk/script/Effects.xml:549(text)
msgid "This function can return -1 to reject the new effect. As the new effect might also be rejected by other effects, this callback should not try to add effects or similar (see gravitation spell). Generally you should not try to manipulate any effects during this callback."
msgstr "Die Funktion sollte -1 zurückgeben, wenn sie den neuen Effekt ablehnt. Da der Effekt auch noch von einem anderen Effekt abgelehnt werden kann, sollte dieser Callback nicht dazu verwendet werden, um beispielsweise Effekte zusammenzufassen (siehe Beispiel zum Gravitationszauber). Überhaupt sollte es möglichst vermieden werden, in diesem Aufruf die Effektliste zu manipulieren."
#: sdk/script/Effects.xml:544(text)
#: sdk/script/Effects.xml:550(text)
msgid "Return -2 or -3 to accept the new effect. As long as the new effect is not rejected by any other effect, the Fx*Add call is then made to the accepting effect, the new effect is not actually created, and the calling AddEffect function returns the effect index of the accepting effect. The return value -3 will also temporarily remove all higher prioriy effects just before the Fx*Add callback and re-add them later."
msgstr "Ein Rückgabewert von -2 oder -3 sollte angegeben werden, wenn der Effekt übernommen wird. Sofern der Effekt dann von keinem anderen Effekt abgelehnt wurde (über Rückgabewert -1), wird ein Fx*Add-Aufruf an den übernehmenden Effekt gesendet, der neue Effekt selber entfernt, und die aufrufende AddEffect-Funktion erhält als Rückgabewert die Nummer des übernehmenden Effektes. Rückgabewert -3 bedeutet dabei im Gegensatz zu -2, dass vor dem Fx*Add-Aufruf alle Effekte mit höherer Priorität temporär entfernt, und nach dem Aufruf dieselben wieder temporär hinzugefügt werden."
#: sdk/script/Effects.xml:545(text)
#: sdk/script/Effects.xml:551(text)
msgid "var1 bis var4 are the parameters passed to <placeholder-1/>()"
msgstr "var1 bis var4 sind die Parameter, die an die <placeholder-1/>()-Funktion übergeben wurden."
#: sdk/script/Effects.xml:546(h)
#: sdk/script/Effects.xml:552(h)
msgid "Fx*Add"
msgstr "Fx*Add"
#: sdk/script/Effects.xml:548(text)
#: sdk/script/Effects.xml:554(text)
msgid "Callback to the accepting effect if that has returned -2 or -3 to a prior Fx*Effect call. <code>effect</code> identifies the accepting effect to which the consequences of the new effect will be added; target is the target object (0 for global effects)."
msgstr "Aufruf an einen übernehmenden Effekt, wenn dieser zuvor auf einen Fx*Effect-Callback hin -2 oder -3 zurückgegeben hat. <code>effect</code> gibt den Effektes an, zu dem hinzugefügt wird; target das Zielobjekt (0 bei globalen Effekten)."
#: sdk/script/Effects.xml:549(text)
#: sdk/script/Effects.xml:555(text)
msgid "new_timer is the timer interval of the new effect; var1 to var4 are the parameters from AddEffect. Notice: in temporary calls, these parameters are not available - here they will be 0."
msgstr "new_timer ist das Timer-Intervall des neu erzeugten Effektes; var1 bis var4 die an AddEffect übergebenen Zusatzparameter. ACHTUNG: Diese Zusatzparameter werden natürlich nicht bei temporären Aufrufen übergeben, sondern sind dann 0."
#: sdk/script/Effects.xml:550(text)
#: sdk/script/Effects.xml:556(text)
msgid "If -1 is returned, the accepting effect is deleted also. Logically, the calling AddEffect function will then return -2."
msgstr "Wird -1 zurückgegeben, wird auch der übernehmende Effekt entfernt. Logischerweise gibt die erzeugende AddEffect-Funktion dann -2 zurück."
#: sdk/script/Effects.xml:551(h)
#: sdk/script/Effects.xml:557(h)
msgid "Fx*Damage"
msgstr "Fx*Damage"
#: sdk/script/Effects.xml:553(text)
#: sdk/script/Effects.xml:559(text)
msgid "Every effect receives this callback whenever the energy or damage value of the target object is to change. If the function is defined, it should then return whether to allow the change."
msgstr "Jeder Effekt erhält diesen Callback, wann immer sich der Energie- oder Schadenswert des Zielobjektes ändert. Falls die Funktion definiert wird, sollte der Rückgabewert dabei die erlaubte Änderung angeben."
#: sdk/script/Effects.xml:554(text)
#: sdk/script/Effects.xml:560(text)
msgid "This callback is made upon life energy changes in living beings and damage value changes in non-livings - but not vice versa. cause contains the value change and reason:"
msgstr "Der Callback wird bei Energiewertänderungen bei Lebewesen, sowie bei Schadenswertänderungen bei nicht-Lebewesen durchgeführt - nicht aber umgekehrt. cause gibt den geänderten Wert und den Grund an:"
#: sdk/script/Effects.xml:558(col)
msgid "Script constant"
msgstr "Scriptkonstante"
#: sdk/script/Effects.xml:559(col)
#: sdk/script/Effects.xml:565(col)
msgid "cause"
msgstr "cause"
#: sdk/script/Effects.xml:563(col)
#: sdk/script/Effects.xml:569(col)
msgid "FX_Call_DmgScript"
msgstr "FX_Call_DmgScript"
#: sdk/script/Effects.xml:565(col)
#: sdk/script/Effects.xml:571(col)
msgid "Damage by script call <placeholder-1/>()"
msgstr "Schaden durch Scriptaufruf <placeholder-1/>()"
#: sdk/script/Effects.xml:568(col)
#: sdk/script/Effects.xml:574(col)
msgid "FX_Call_DmgBlast"
msgstr "FX_Call_DmgBlast"
#: sdk/script/Effects.xml:570(col)
#: sdk/script/Effects.xml:576(col)
msgid "Damage by explosion"
msgstr "Schaden durch Explosion"
#: sdk/script/Effects.xml:573(col)
#: sdk/script/Effects.xml:579(col)
msgid "FX_Call_DmgFire"
msgstr "FX_Call_DmgFire"
#: sdk/script/Effects.xml:575(col)
#: sdk/script/Effects.xml:581(col)
msgid "Damage by fire"
msgstr "Schaden durch Feuer"
#: sdk/script/Effects.xml:578(col)
#: sdk/script/Effects.xml:584(col)
msgid "FX_Call_DmgChop"
msgstr "FX_Call_DmgChop"
#: sdk/script/Effects.xml:580(col)
#: sdk/script/Effects.xml:586(col)
msgid "Damage by chopping (only trees)"
msgstr "Schaden durch Fällen (nur Bäume)"
#: sdk/script/Effects.xml:583(col)
#: sdk/script/Effects.xml:589(col)
msgid "FX_Call_EngScript"
msgstr "FX_Call_EngScript"
#: sdk/script/Effects.xml:584(col)
#: sdk/script/Effects.xml:590(col)
#: sdk/definition/cnat.xml:49(col)
msgid "32"
msgstr "32"
#: sdk/script/Effects.xml:585(col)
#: sdk/script/Effects.xml:591(col)
msgid "Energy value change by script call <placeholder-1/>()"
msgstr "Energieänderung durch Scriptaufruf <placeholder-1/>()"
#: sdk/script/Effects.xml:588(col)
#: sdk/script/Effects.xml:594(col)
msgid "FX_Call_EngBlast"
msgstr "FX_Call_EngBlast"
#: sdk/script/Effects.xml:589(col)
#: sdk/script/Effects.xml:595(col)
msgid "33"
msgstr "33"
#: sdk/script/Effects.xml:590(col)
#: sdk/script/Effects.xml:596(col)
msgid "Energy loss by explosion"
msgstr "Energieverlust durch Explosion"
#: sdk/script/Effects.xml:593(col)
#: sdk/script/Effects.xml:599(col)
msgid "FX_Call_EngObjHit"
msgstr "FX_Call_EngObjHit"
#: sdk/script/Effects.xml:594(col)
#: sdk/script/Effects.xml:600(col)
msgid "34"
msgstr "34"
#: sdk/script/Effects.xml:595(col)
#: sdk/script/Effects.xml:601(col)
msgid "Energy loss by object hit"
msgstr "Energieverlust durch Objekttreffer"
#: sdk/script/Effects.xml:598(col)
#: sdk/script/Effects.xml:604(col)
msgid "FX_Call_EngFire"
msgstr "FX_Call_EngFire"
#: sdk/script/Effects.xml:599(col)
#: sdk/script/Effects.xml:605(col)
msgid "35"
msgstr "35"
#: sdk/script/Effects.xml:600(col)
#: sdk/script/Effects.xml:606(col)
msgid "Energy loss by fire"
msgstr "Energieverlust durch Feuer"
#: sdk/script/Effects.xml:603(col)
#: sdk/script/Effects.xml:609(col)
msgid "FX_Call_EngBaseRefresh"
msgstr "FX_Call_EngBaseRefresh"
#: sdk/script/Effects.xml:604(col)
#: sdk/script/Effects.xml:610(col)
msgid "36"
msgstr "36"
#: sdk/script/Effects.xml:605(col)
#: sdk/script/Effects.xml:611(col)
msgid "Energy recharge at the home base"
msgstr "Energieaufnahme in der Basis - auch Abgabe und Kauf der Basis, wenn die Basis ein Lebewesen ist"
#: sdk/script/Effects.xml:608(col)
#: sdk/script/Effects.xml:614(col)
msgid "FX_Call_EngAsphyxiation"
msgstr "FX_Call_EngAsphyxiation"
#: sdk/script/Effects.xml:609(col)
#: sdk/script/Effects.xml:615(col)
msgid "37"
msgstr "37"
#: sdk/script/Effects.xml:610(col)
#: sdk/script/Effects.xml:616(col)
msgid "Energy loss by suffocation"
msgstr "Energieverlust durch Ersticken"
#: sdk/script/Effects.xml:613(col)
#: sdk/script/Effects.xml:619(col)
msgid "FX_Call_EngCorrosion"
msgstr "FX_Call_EngCorrosion"
#: sdk/script/Effects.xml:614(col)
#: sdk/script/Effects.xml:620(col)
msgid "38"
msgstr "38"
#: sdk/script/Effects.xml:615(col)
#: sdk/script/Effects.xml:621(col)
msgid "Energy loss through acid"
msgstr "Energieverlust durch Säure"
#: sdk/script/Effects.xml:618(col)
#: sdk/script/Effects.xml:624(col)
msgid "FX_Call_EngStruct"
msgstr "FX_Call_EngStruct"
#: sdk/script/Effects.xml:619(col)
#: sdk/script/Effects.xml:625(col)
msgid "39"
msgstr "39"
#: sdk/script/Effects.xml:620(col)
#: sdk/script/Effects.xml:626(col)
msgid "Energy loss of buildings (only \"living\" buildings)"
msgstr "Energieverlust von Gebäuden (Nur lebende Gebäude)"
#: sdk/script/Effects.xml:623(col)
#: sdk/script/Effects.xml:629(col)
msgid "FX_Call_EngGetPunched"
msgstr "FX_Call_EngGetPunched"
#: sdk/script/Effects.xml:624(col)
#: sdk/script/Effects.xml:630(col)
msgid "40"
msgstr "40"
#: sdk/script/Effects.xml:625(col)
#: sdk/script/Effects.xml:631(col)
msgid "Energy loss through clonk-to-clonk battle"
msgstr "Energieverlust im Clonk-zu-Clonk-Kampf"
#: sdk/script/Effects.xml:629(text)
#: sdk/script/Effects.xml:635(text)
msgid "Generally, the expression \"cause &amp; 32\" can be used to determine whether the energy or damage values were changed."
msgstr "Allgemein kann der Ausdruck \"cause &amp; 32\" verwendet werden, um festzustellen, ob Energie oder Schadenswert verändert wurden."
#: sdk/script/Effects.xml:630(text)
#: sdk/script/Effects.xml:636(text)
msgid "Using this callback, damage to an object can be prevented, lessened, or increased. You could deduct magic energy instead, transfer damage to other objects, or something similar."
msgstr "Über diesen Callback kann zum Beispiel Schaden an einem Objekt verhindert, abgeschwächt oder verstärkt werden; man kann Lebensschaden zunächst nur von der Zauberenergie abziehen, gleichmäßig auf verbundene Clonks verteilen und so weiter."
#: sdk/script/Effects.xml:632(h)
#: sdk/script/Effects.xml:638(h)
msgid "Function Reference"
msgstr "Funktions-Referenz"
#: sdk/script/Effects.xml:633(text)
#: sdk/script/Effects.xml:639(text)
msgid "There are the following functions for manipulation of effects:"
msgstr "Es gibt folgende Funktionen sind zum Manipulieren und Abfragen von Effekten:"
#: sdk/script/Effects.xml:636(li)
#: sdk/script/Effects.xml:642(li)
msgid "<placeholder-1/>() - for effect creation"
msgstr "<placeholder-1/>() - zum Erzeugen von Effekten"
#: sdk/script/Effects.xml:637(li)
#: sdk/script/Effects.xml:643(li)
msgid "<placeholder-1/>() - for effect removal"
msgstr "<placeholder-1/>() - zum Entfernen von Effekten"
#: sdk/script/Effects.xml:638(li)
#: sdk/script/Effects.xml:644(li)
msgid "<placeholder-1/>() - to search for effects"
msgstr "<placeholder-1/>() - zum Suchen nach Effekten"
#: sdk/script/Effects.xml:639(li)
#: sdk/script/Effects.xml:645(li)
msgid "<placeholder-1/>() - for effect counting"
msgstr "<placeholder-1/>() - um Effekte zu zählen"
#: sdk/script/Effects.xml:640(li)
#: sdk/script/Effects.xml:646(li)
msgid "<placeholder-1/>() - for user defined calls in effects"
msgstr "<placeholder-1/>() - für Benutzeraufrufe in Effekten"
#: sdk/script/Effects.xml:641(li)
#: sdk/script/Effects.xml:647(li)
msgid "<placeholder-1/>() - to cause effects callbacks without actually creating an effect"
msgstr "<placeholder-1/>() - um Effekt-Callbacks auszuführen, ohne den Effekt selber zu erstellen"
@ -11818,7 +11847,7 @@ msgid "Called after the hostility of two players has been changed. See <placehol
msgstr "Wird aufgerufen wenn die Verfeindung zweier Spieler geändert wird. Siehe <placeholder-1/>."
#: sdk/scenario/script.xml:54(col)
#: sdk/definition/script.xml:315(col)
#: sdk/definition/script.xml:320(col)
msgid "int player, int new_team"
msgstr "int player, int new_team"
@ -11827,7 +11856,7 @@ msgid "When the team of a player is about to be changed, this function is called
msgstr "Wenn das Team eines Spielers geändert werden soll, wird diese Funktion zuerst aufgerufen. Wenn sie true zurückgibt, wird das Team des Spielers nicht geändert. Siehe <placeholder-1/>"
#: sdk/scenario/script.xml:59(col)
#: sdk/definition/script.xml:320(col)
#: sdk/definition/script.xml:325(col)
msgid "int player, int new_team, int old_team"
msgstr "int player, int new_team, int old_team"
@ -11840,8 +11869,8 @@ msgid "Called if a round is ended through the game by player elimination, fulfil
msgstr "Wird eine Runde durch Spielziele wie Spielereliminierung, Materialabbau, usw. (wie in der <emlink href=\"scenario/scenario.html#SektionGame\">Scenario.txt</emlink> definiert) oder durch den Scriptbefehl <placeholder-1/> beendet (also nicht bei abgebrochenen Runden), wird diese Funktion aufgerufen."
#: sdk/scenario/script.xml:71(col)
#: sdk/definition/script.xml:290(col)
#: sdk/definition/script.xml:310(col)
#: sdk/definition/script.xml:295(col)
#: sdk/definition/script.xml:315(col)
msgid "int player"
msgstr "int player"
@ -11914,7 +11943,6 @@ msgstr "Version"
#: sdk/scenario/scenario.xml:370(col)
#: sdk/scenario/scenario.xml:375(col)
#: sdk/scenario/scenario.xml:380(col)
#: sdk/scenario/scenario.xml:385(col)
#: sdk/material/ocm.xml:215(col)
#: sdk/folder/foldermap.xml:20(col)
#: sdk/folder/foldermap.xml:60(col)
@ -12041,8 +12069,8 @@ msgstr "Rules"
#: sdk/scenario/scenario.xml:200(col)
#: sdk/scenario/scenario.xml:345(col)
#: sdk/scenario/scenario.xml:350(col)
#: sdk/scenario/scenario.xml:410(col)
#: sdk/scenario/scenario.xml:435(col)
#: sdk/scenario/scenario.xml:400(col)
#: sdk/scenario/scenario.xml:425(col)
#: sdk/definition/defcore.xml:85(col)
msgid "ID list"
msgstr "ID-Liste"
@ -12315,74 +12343,58 @@ msgid "0-100 with tolerance. Speed of season change."
msgstr "0-100 und Abweichung. Geschwindigkeit des Jahreszeitenwechsels."
#: sdk/scenario/scenario.xml:379(col)
msgid "Rain"
msgstr "Rain"
#: sdk/scenario/scenario.xml:381(col)
msgid "0-100 with tolerance. Precipitation amount."
msgstr "0-100 und Abweichung. Regenwahrscheinlichkeit."
#: sdk/scenario/scenario.xml:384(col)
msgid "Wind"
msgstr "Wind"
#: sdk/scenario/scenario.xml:386(col)
#: sdk/scenario/scenario.xml:381(col)
msgid "-100-100 with tolerance. Wind direction and strength."
msgstr "-100-100 und Abweichung. Windrichtung und -stärke."
#: sdk/scenario/scenario.xml:389(col)
msgid "Precipitation"
msgstr "Precipitation"
#: sdk/scenario/scenario.xml:391(col)
msgid "Simple material definition precipitation."
msgstr "Einfache Materialdefinition Niederschlag."
#: sdk/scenario/scenario.xml:394(col)
#: sdk/scenario/scenario.xml:384(col)
msgid "NoGamma"
msgstr "NoGamma"
#: sdk/scenario/scenario.xml:396(col)
#: sdk/scenario/scenario.xml:386(col)
msgid "0 or 1. If 1, the current season won't cause a small global color change."
msgstr "0 oder 1. Bei 1 wirken sich die Jahreszeiten nicht auf die Bildschirmfärbung aus."
#: sdk/scenario/scenario.xml:402(caption)
#: sdk/scenario/scenario.xml:392(caption)
msgid "Section [Environment]"
msgstr "Sektion [Environment]"
#: sdk/scenario/scenario.xml:411(col)
#: sdk/scenario/scenario.xml:401(col)
msgid "Environment control objects that are placed at game start."
msgstr "Umweltsteuerungsobjekte, die am Anfang der Runde platziert werden."
#: sdk/scenario/scenario.xml:417(caption)
#: sdk/scenario/scenario.xml:407(caption)
msgid "Section [Definitions]"
msgstr "Sektion [Definitions]"
#: sdk/scenario/scenario.xml:424(col)
#: sdk/scenario/scenario.xml:414(col)
msgid "LocalOnly"
msgstr "LocalOnly"
#: sdk/scenario/scenario.xml:426(col)
#: sdk/scenario/scenario.xml:416(col)
msgid "If LocalOnly is 1, only definitions local to the scenario file will be load."
msgstr "Wenn LocalOnly den Wert 1 hat, werden alle angegebenen Objektdefinitions-pakete ignoriert und nur lokale Objektdefinitionen geladen."
#: sdk/scenario/scenario.xml:429(col)
#: sdk/scenario/scenario.xml:419(col)
msgid "Definition1 to 9"
msgstr "Definition1 (bis 9)"
#: sdk/scenario/scenario.xml:430(col)
#: sdk/scenario/scenario.xml:420(col)
msgid "String(s)"
msgstr "Zeichenfolge(n)"
#: sdk/scenario/scenario.xml:431(col)
#: sdk/scenario/scenario.xml:421(col)
msgid "With Definition<em>x</em> entries you can specify which object definition packs (ocd) are to be loaded with this scenario. The specified files must be available in the Clonk directory. If files are specified here, manual pack selection in the menu system is disabled."
msgstr "Über Definition<em>x</em>-Einträge kann vorgegeben werden, welche Objektdefinitionspakete (ocd) das Szenario benutzen soll. Die Pakete müssen im Clonk-Verzeichnis vorhanden sein. Sind Pakete im Szenario angegeben, wird die vom Menüsystem bestimmte Auswahl ignoriert."
#: sdk/scenario/scenario.xml:434(col)
#: sdk/scenario/scenario.xml:424(col)
msgid "SkipDefs"
msgstr "SkipDefs"
#: sdk/scenario/scenario.xml:436(col)
#: sdk/scenario/scenario.xml:426(col)
msgid "List of object definitions (C4IDs) which are not to be loaded with this scenario. This can be used to prevent researching certain object types in the game."
msgstr "Liste der Definitionen, die im Spiel nicht geladen werden sollen. So lässt sich beispielsweise die Erforschung bestimmter Objekte verhindern."
@ -14987,7 +14999,7 @@ msgstr "Wenn das Objekt fertiggestellt wird (<emlink href=\"script/fn/GetCon.htm
#: sdk/definition/script.xml:115(col)
#: sdk/definition/script.xml:125(col)
#: sdk/definition/script.xml:130(col)
#: sdk/definition/script.xml:275(col)
#: sdk/definition/script.xml:280(col)
msgid "object by_object"
msgstr "object by_object"
@ -15053,8 +15065,8 @@ msgstr "Wenn das Lebewesen nach dem Auftauchen mehr als die Hälfte seiner Atemk
#: sdk/definition/script.xml:100(col)
#: sdk/definition/script.xml:105(col)
#: sdk/definition/script.xml:295(col)
#: sdk/definition/script.xml:300(col)
#: sdk/definition/script.xml:305(col)
msgid "int by_player"
msgstr "int by_player"
@ -15135,8 +15147,8 @@ msgid "When a new inventory object is selected. See <a href=\"#Control-Funktione
msgstr "Wenn ein neues Inhaltsobjekt angewählt wird. Siehe <a href=\"#Control-Funktionen\">Control-Funktionen</a>."
#: sdk/definition/script.xml:170(col)
#: sdk/definition/script.xml:260(col)
#: sdk/definition/script.xml:270(col)
#: sdk/definition/script.xml:265(col)
#: sdk/definition/script.xml:275(col)
msgid "object container"
msgstr "object container"
@ -15254,7 +15266,7 @@ msgid "When the object has collected another object (obj) (by ingame collection
msgstr "Wenn das Objekt ein anderes Objekt (obj) aufgenommen hat (nur durch einsammeln oder anfassen und ablegen)."
#: sdk/definition/script.xml:255(col)
#: sdk/definition/script.xml:265(col)
#: sdk/definition/script.xml:270(col)
msgid "object obj"
msgstr "object obj"
@ -15262,67 +15274,75 @@ msgstr "object obj"
msgid "When the object has collected another object (obj) (in all cases, even in script controlled collection or entering)."
msgstr "Wenn das Objekt ein anderes Objekt (obj) aufgenommen hat (immer, auch durch Scriptbefehl Enter)"
#: sdk/definition/script.xml:260(col)
msgid "object destroyed"
msgstr "object destroyed"
#: sdk/definition/script.xml:261(col)
msgid "When an object contained in the object has been destroyed/removed. The object still exists when the callback is called, but will be destroyed afterwards."
msgstr "Wenn ein Inhaltsobjekt dieses Objekts zerstört wird. Zum Aufrufzeitpunkt existiert das Objekt noch und wird erst danach zerstört."
#: sdk/definition/script.xml:266(col)
msgid "When this object has left another object (container)."
msgstr "Wenn das Objekt ein anderes Objekt (container) verlassen hat."
#: sdk/definition/script.xml:266(col)
#: sdk/definition/script.xml:271(col)
msgid "When another object (obj) has left the contents of this object (also see script command Exit)."
msgstr "Wenn ein Objekt (obj) dieses Objekt verlassen hat (auch durch Scriptbefehl Exit)."
#: sdk/definition/script.xml:271(col)
#: sdk/definition/script.xml:276(col)
msgid "When the object has entered another object (container)."
msgstr "Wenn das Objekt ein anderes Objekt (container) betreten hat."
#: sdk/definition/script.xml:276(col)
#: sdk/definition/script.xml:281(col)
msgid "When another object is trying to enter this object through the entrance."
msgstr "Wenn ein anderes Objekt versucht, das Objekt durch Entrance zu betreten."
#: sdk/definition/script.xml:280(col)
#: sdk/definition/script.xml:285(col)
msgid "id def, object obj"
msgstr "id def, object obj"
#: sdk/definition/script.xml:281(col)
#: sdk/definition/script.xml:286(col)
msgid "Called before Collection. If RejectCollect returns <code>true</code>, the collection of the other object is prevented."
msgstr "Wird vor Collection aufgerufen. Wenn RejectCollect <code>true</code> zurückgibt, kann damit die Aufnahme des anderen Objekts verhindert werden."
#: sdk/definition/script.xml:285(col)
#: sdk/definition/script.xml:290(col)
msgid "object into_object"
msgstr "object into_object"
#: sdk/definition/script.xml:286(col)
#: sdk/definition/script.xml:291(col)
msgid "Called before Entrance. If RejectEntrance returns <code>true</code>, then entrance of the other object is prevented."
msgstr "Wird vor Entrance aufgerufen. Wenn RejectEntrance <code>true</code> zurückgibt, kann damit das Hineinversetzen in das andere Objekt verhindert werden."
#: sdk/definition/script.xml:291(col)
#: sdk/definition/script.xml:296(col)
msgid "Called in game goals, rules, or environment objects after the joining of a new player and before the corresponding call in the scenario script."
msgstr "Aufruf in Spielziel, -regel und Umweltobjekten nach der Platzierung eines beitretenden Spielers, und vor dem entsprechenden Aufruf im Szenarioscript."
#: sdk/definition/script.xml:296(col)
#: sdk/definition/script.xml:301(col)
msgid "When the object is sold. Should return <code>nil</code> or the id of the object type which is actually added to the player's homebase material."
msgstr "Wenn das Objekt verkauft wird. Rückgabewert <code>nil</code> oder die ID des Objekts, welches dem Heimatbasismaterial hinzugefügt wird."
#: sdk/definition/script.xml:301(col)
#: sdk/definition/script.xml:306(col)
msgid "When the object is sold."
msgstr "Wenn das Objekt verkauft wird."
#: sdk/definition/script.xml:305(col)
#: sdk/definition/script.xml:310(col)
msgid "int by_player, object buy_object"
msgstr "int by_player, object buy_object"
#: sdk/definition/script.xml:306(col)
#: sdk/definition/script.xml:311(col)
msgid "When the object is bought."
msgstr "Wenn das Objekt gekauft wird."
#: sdk/definition/script.xml:311(col)
#: sdk/definition/script.xml:316(col)
msgid "When the objet is added to the crew of a player."
msgstr "Wenn das Objekt der Crew eines Spielers hinzugefügt wird."
#: sdk/definition/script.xml:316(col)
#: sdk/definition/script.xml:321(col)
msgid "Callback in game goal, rule, and environment objects and in the scenario script. If RejectTeamSwitch returns <code>true</code>, the team switch of a player can be prevented (see <placeholder-1/>)."
msgstr "Aufruf in Spielziel, -regel und Umweltobjekten und dem Szenarioscript. Wenn RejectTeamSwitch <code>true</code> zurückgibt, kann der Teamwechsel eines Spielers (durch <placeholder-1/>) verhindert werden."
#: sdk/definition/script.xml:321(col)
#: sdk/definition/script.xml:326(col)
msgid "Callback in game goal, rule, and environment objects and in the scenario script. Called when a player has successfully switch from old_team to new_team (see <placeholder-1/>)."
msgstr "Aufruf in Spielziel, -regel und Umweltobjekten und dem Szenarioscript. Wenn ein Spieler erfolgreich von old_team zu new_team transferiert wurde (durch <placeholder-1/>)."
@ -15401,7 +15421,7 @@ msgstr "Laufen"
#: sdk/definition/procedures.xml:92(col)
#, fuzzy
msgid "According to current <emlink href=\"script/fn/SetComDir.html\">ComDir</emlink>."
msgstr "Baut das <emlink href=\"script/fn/SetAction.html\">Zielobjekt</emlink>."
msgstr "Verhalten nach <emlink href=\"script/fn/SetComDir.html\">ComDir</emlink>."
#: sdk/definition/procedures.xml:27(col)
#: sdk/definition/procedures.xml:39(col)
@ -16934,6 +16954,24 @@ msgstr "c4group.exe (Windows) c4group (Linux) c4group (Mac)"
msgid "This command line program is used for processing group files. A list of command line options is available by starting the program without parameters via command line (<i>not</i> by double clicking)."
msgstr "Dieses Kommandozeilen-Programm dient zum Bearbeiten von Gruppendateien. Es kann nicht per Doppelklick, sondern nur per Kommandozeile (Eingabeaufforderung) gestartet werden. Auskunft über alle verfügbaren Kommandozeilenparameter erhält man, indem man das Programm ohne weitere Parameter über die Kommandozeile startet."
#~ msgid "Makes a rectangular hole in semi-solid materials."
#~ msgstr "Gräbt ein rechteckiges Loch in halbfesten Materialien."
#~ msgid "Makes a circular hole in semi-solid materials."
#~ msgstr "Gräbt ein kreisrundes Loch in halbfesten Materialien."
#~ msgid "Rain"
#~ msgstr "Rain"
#~ msgid "0-100 with tolerance. Precipitation amount."
#~ msgstr "0-100 und Abweichung. Regenwahrscheinlichkeit."
#~ msgid "Precipitation"
#~ msgstr "Precipitation"
#~ msgid "Simple material definition precipitation."
#~ msgstr "Einfache Materialdefinition Niederschlag."
#~ msgid "New value for the script counter. The next scenario script function called will be ScriptXXX."
#~ msgstr "Neue Position des Skriptzählers. Der nächste ScriptXXX-Aufruf wird bei diesem Zählerwert getätigt."

View File

@ -140,11 +140,6 @@
<col>Integer</col>
<col>Flame distance to the object's bottom line.</col>
</row>
<row>
<literal_col>Placement</literal_col>
<col>Integer</col>
<col>Placement: 0 land surface, 1 in liquid, 2 in mid-air, 3 underground, 4 land surface and underground.</col>
</row>
<row>
<literal_col>Exclusive</literal_col>
<col>Integer</col>

View File

@ -129,6 +129,11 @@ Stand = {
<col><code>Plane</code></col>
<col>int</col>
<col>The Object's minor Z-Position. Negative values are behind the landscape, positive values before it. Use 1-399 for stuff behind Clonks, 401-999 for stuff before Clonks, and 1000+ for GUI objects.</col>
</row>
<row>
<literal_col>Placement</literal_col>
<col>Integer</col>
<col>Placement: 0 land surface, 1 in liquid, 2 in mid-air, 3 underground, 4 land surface and underground.</col>
</row>
</table>
</text>

View File

@ -505,26 +505,32 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
<text>
<table>
<rowh>
<col>Script constant</col>
<col>reason</col>
<col>Meaning</col>
</rowh>
<row>
<col>FX_Call_Normal</col>
<col>0</col>
<col>Normal removal</col>
</row>
<row>
<col>FX_Call_Temp</col>
<col>1</col>
<col>Temporary removal (temporary is 1).</col>
</row>
<row>
<col>FX_Call_TempAddForRemoval</col>
<col>2</col>
<col>Not used</col>
</row>
<row>
<col>FX_Call_RemoveClear</col>
<col>3</col>
<col>The target object has been deleted</col>
</row>
<row>
<col>FX_Call_RemoveDeath</col>
<col>4</col>
<col>The target object has died</col>
</row>

View File

@ -53,10 +53,15 @@
<col>GFX_BLIT_ClrSfc_Mod2</col>
<col>8</col>
<col>The overlay (owner color) is drawn using additive modulation. This flag might have to be set independently of bit 2.</col>
</row>
<row>
<col>GFX_BLIT_Wireframe</col>
<col>16</col>
<col>Draws the mesh as a wireframe. Only works with meshes!</col>
</row>
<row>
<col>5-7</col>
<col>16, 32, 64</col>
<col>32, 64</col>
<col>reserved</col>
</row>
<row>

View File

@ -208,6 +208,13 @@
<col>postfix</col>
<col>any, any/any</col>
</row>
<row>
<col>3l</col>
<col>??</col>
<col>Returns the left-hand operand if the operand is not <code>nil</code>, or the right-hand operand otherwise.</col>
<col>postfix</col>
<col>any, any/any</col>
</row>
<row>
<col>2r</col>
<col>*=</col>
@ -292,13 +299,17 @@ while(<strong>++somevar</strong> &lt; 10)
<text>Yet there is an important difference between the two versions: when using the postfix version, the <strong>previous</strong> value of the variable is returned. The first example will result in a count from 1 to <strong>10</strong>, since at beginning of the last loop repetition is value of <code>somevar</code> is 9. It is then increased by one (<code>somevar</code> is now 10) but the previous value of 9 is returned and compared to 10. Thus the loop will be repeated one more time and then the value of 10 is printed.</text>
<text>In the second example, on the other hand, the loop runs from 1 to <strong>9</strong>. When <code>somevar</code> is 9 and is increased, the new value of 10 is returned immediately. The result is not less than 10 and the loop ends.</text>
</part>
<h id="andor">The Operators &amp;&amp; and ||</h>
<h id="shortcircuiting">The Short-Circuiting Operators &amp;&amp;, || and ??</h>
<part>
<text>These two operators are special. If the result can be determined by the first parameter alone, the second parameter is not computed at all. For example, this script does not explode an object, because the overall result would be <code>false</code>, regardless of the result of Explode:</text>
<text>These operators are special. If the result can be determined by the first parameter alone, the second parameter is not computed at all. For example, this script does not explode an object, because the overall result would be <code>false</code>, regardless of the result of Explode:</text>
<code>0 &amp;&amp; Explode(20);</code>
<text>Further, the result is the value of the first or second parameter, depending on whether one or both were evaluated. For example, one can create a knight if possible or else a Clonk:</text>
<code>CreateObject(Knight,0,0,GetOwner()) || CreateObject(Clonk,0,0,GetOwner())</code>
</part>
<h id="nilcoalesce">The operator <code>??</code></h>
<part>
<text>The <code>??</code> operator is called the nil-coalescing operator. It can be used to specify a default value for an expression or function call that may evaluate to <code>nil</code>.</text>
</part>
<h id="prio">Priority and Associating</h>
<part>
<text>This subject shows how operator priority is evaluated in detail.</text>

View File

@ -9,6 +9,5 @@ Vertices=1
VertexY=1
Mass=1
Rotate=1
Placement=0
StretchGrowth=1
Oversize=1

View File

@ -7,7 +7,7 @@ MaxPlayer=50
NoInitialize=true
[Game]
Rules=Rule_EnergyNeed=1;Rule_TeamAccount=1
Rules=Rule_TeamAccount=1
[Player1]
Wealth=0

View File

@ -9,7 +9,7 @@ Difficulty=10
Definition1=Objects.ocd
[Game]
Rules=Rule_EnergyNeed=1;Rule_TeamAccount=1;
Rules=Rule_TeamAccount=1;
[Player1]
Wealth=10

View File

@ -9,7 +9,7 @@ Difficulty=20
Definition1=Objects.ocd
[Game]
Rules=Rule_EnergyNeed=1;Rule_TeamAccount=1;
Rules=Rule_TeamAccount=1;
[Player1]
Wealth=40

View File

@ -7,7 +7,7 @@ MaxPlayer=50
NoInitialize=true
[Game]
Rules=Rule_TeamAccount=1
Rules=Rule_TeamAccount=1;Rule_NoPowerNeed=1
[Player1]
Crew=Clonk=1

View File

@ -7,6 +7,11 @@
static g_is_initialized;
func Initialize()
{
if(!ObjectCount(Find_ID(Rule_NoPowerNeed))) CreateObject(Rule_NoPowerNeed, 0, 0, NO_OWNER);
}
func DoInit(int first_player)
{
// Set time of day to morning and create some clouds and celestials.

View File

@ -1,16 +1,3 @@
[Object]
id=Rule_EnergyNeed
Properties=7;false;"Prototype"=DRule_EnergyNeed
Timer=34
Category=65
Plane=100
Size=100000
Mass=1
X=F3276800
Y=F3276800
Picture=0,0,0,0
OCF=12845121
[Object]
id=Rule_TeamAccount
Properties=8;false;"Prototype"=DRule_TeamAccount

View File

@ -7,7 +7,7 @@ MaxPlayer=30
NoInitialize=true
[Game]
Rules=Rule_EnergyNeed=1;Rule_TeamAccount=1;Rule_BuyAtFlagpole=1
Rules=Rule_TeamAccount=1;Rule_BuyAtFlagpole=1
ValueOverloads=Nugget=10;GoldBar=50;
[Player1]

View File

@ -14,7 +14,6 @@ VertexX=0,0,-3,3
VertexY=-2,2,0,0
VertexCNAT=4,8,1,2
VertexFriction=100,100,100,100,100,100
Placement=2
ContactIncinerate=0
Float=1
BorderBound=7

View File

@ -156,6 +156,7 @@ Flutter = {
local Name = "Butterfly";
local MaxEnergy = 40000;
local MaxBreath = 125;
local Placement = 2;
func Definition(def) {
SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(20,1,0,0),Trans_Rotate(70,0,1,0)), def);

View File

@ -74,7 +74,7 @@ public func GetShortDescription(int plr)
var wealth = GetWealth(plr);
var goal = GetWealthGoal();
var clr = RGB(255, 0, 0);
if (wealth > goal)
if (wealth >= goal)
clr = RGB(0, 255, 0);
var msg = Format("<c %x>%d</c>{{%i}}", clr, goal, GUI_Wealth);
return msg;

View File

@ -15,5 +15,4 @@ Components=Moss=1
ContactIncinerate=1
BlastIncinerate=1
Rotate=1
Float=1
Placement=3
Float=1

View File

@ -118,4 +118,5 @@ public func GetFuelAmount() { return 100; }
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";
local UsageHelp = "$UsageHelp$";
local UsageHelp = "$UsageHelp$";
local Placement = 3;

View File

@ -51,7 +51,11 @@ public func ControlUseStart(object clonk, int iX, int iY)
if (!clonk->IsWalking() && !clonk->IsJumping())
return true;
tree = FindObject(Find_AtPoint(0,0), Find_Func("IsTree"), Sort_Distance(), Find_NoContainer());
if(Distance(0,0,iX,iY) < 35)
tree = FindObject(Find_AtPoint(iX,iY), Find_Func("IsTree"), Sort_Distance(), Find_NoContainer());
if(!tree)
tree = FindObject(Find_AtPoint(0,0), Find_Func("IsTree"), Sort_Distance(), Find_NoContainer());
// Chopping
if(tree && clonk->IsWalking())
@ -126,6 +130,12 @@ public func ControlUseStart(object clonk, int iX, int iY)
if(!GetEffect("AxeStrikeStop", clonk, 0))
AddEffect("AxeStrikeStop", clonk, 2, 50, this);
}
if(clonk->GetHandPosByItemPos(clonk->GetItemPos(this)) == 1)
{
arm = "L";
carry_bone = "pos_hand1";
animation = Format("SwordSlash%d.%s", rand, arm);
}
if(clonk->IsJumping())
{
rand = 1;
@ -133,12 +143,6 @@ public func ControlUseStart(object clonk, int iX, int iY)
animation = Format("SwordJump%d.%s",rand,arm);
}
if(clonk->GetHandPosByItemPos(clonk->GetItemPos(this)) == 1)
{
arm = "L";
carry_bone = "pos_hand1";
}
PlayWeaponAnimation(clonk, animation, 10, Anim_Linear(0, 0, clonk->GetAnimationLength(animation), length, ANIM_Remove), Anim_Const(1000));
clonk->UpdateAttach();

View File

@ -7,18 +7,6 @@
#include Barrel
local szLiquid;
local iVolume;
local debug;
protected func Initialize()
{
iVolume = 0;
debug = 0;
}
private func Hit()
{
Sound("DullMetalHit?");
@ -34,39 +22,31 @@ private func Hit()
private func FillWithLiquid()
{
var mat = GetMaterial();
if (mat == Material("Water"))
// Accept water, acid, lava and oil.
if (mat == Material("Water") || mat == Material("Acid") || mat == Material("Lava") || mat == Material("DuroLava") || mat == Material("Oil"))
{
FillBarrel(MaterialName(mat));
SetMeshMaterial("MB_Water");
return 1;
}
if (mat == Material("Acid"))
{
FillBarrel(MaterialName(mat));
SetMeshMaterial("MB_Acid");
return 1;
}
if (mat == Material("Lava") || mat == Material("DuroLava"))
{
FillBarrel(MaterialName(mat));
SetMeshMaterial("MB_Lava");
return 1;
}
if (mat == Material("Oil"))
{
FillBarrel(MaterialName(mat));
SetMeshMaterial("MB_Oil");
return 1;
UpdateBarrel();
}
return;
}
private func OriginalTex()
private func UpdateBarrel()
{
SetMeshMaterial("MetalBarrel");
if (iVolume == 0)
SetMeshMaterial("MetalBarrel");
else
{
if (szLiquid == "Water")
SetMeshMaterial("MB_Water");
if (szLiquid == "Acid")
SetMeshMaterial("MB_Acid");
if (szLiquid == "Lava" || szLiquid == "DuroLava")
SetMeshMaterial("MB_Lava");
if (szLiquid == "Water")
SetMeshMaterial("MB_Oil");
}
return;
}
public func IsBarrelForMaterial(string sznMaterial)

View File

@ -10,8 +10,6 @@
local szLiquid;
local iVolume;
local debug;
public func GetCarryTransform(clonk)
{
if(GetCarrySpecial(clonk))
@ -27,7 +25,6 @@ public func GetCarryPhase()
protected func Initialize()
{
iVolume = 0;
debug = 0;
}
private func Hit()
@ -63,20 +60,18 @@ private func Check()
SetProperty("Value", 10);
//if(szLiquid == Oil) SetProperty("Value", 10 + (iVolume / 15)); //No oil in current build
//Debug/Testing Purposes
if (debug == 1)
Message("Volume:|%d|Liquid:|%s", iVolume, szLiquid);
//Message("Volume:|%d|Liquid:|%s", iVolume, szLiquid);
}
//over-ridden with metal barrel
private func FillWithLiquid()
{
var mat = GetMaterial();
// Accepts only water.
if (mat == Material("Water"))
{
FillBarrel(MaterialName(mat));
SetMeshMaterial("Barrel_Water");
UpdateBarrel();
}
}
@ -103,13 +98,16 @@ private func EmptyBarrel(int iAngle, int iStrength)
iStrength = 30;
CastPXS(szLiquid, iVolume, iStrength, 0, 0, iAngle, 30);
iVolume = 0;
OriginalTex();
UpdateBarrel();
}
//over-ridden with metal barrel
private func OriginalTex()
private func UpdateBarrel()
{
SetMeshMaterial("Barrel");
if (iVolume == 0)
SetMeshMaterial("Barrel");
else
SetMeshMaterial("Barrel_Water");
return;
}
public func ControlUse(object clonk, int iX, int iY)
@ -128,13 +126,6 @@ public func ControlUse(object clonk, int iX, int iY)
public func IsToolProduct() { return true; }
public func Definition(proplist def)
{
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(0, 1000, 0), Trans_Rotate(-40, 1, 0, 0), Trans_Rotate(20, 0, 0, 1)), def);
}
public func BarrelMaxFillLevel()
{
return 300;
@ -191,6 +182,7 @@ public func GetLiquid(string sznMaterial, int inMaxAmount, object pnTarget)
inMaxAmount = 0;
inMaxAmount = Min(inMaxAmount, iVolume);
iVolume -= inMaxAmount;
UpdateBarrel();
return [szLiquid, inMaxAmount];
}
@ -205,15 +197,21 @@ public func PutLiquid(string sznMaterial, int inMaxAmount, object pnSource)
{
//Wrong material?
if (sznMaterial != szLiquid)
if (iVolume>0)
if (iVolume > 0)
return 0;
else if (IsBarrelForMaterial(sznMaterial))
szLiquid=sznMaterial;
inMaxAmount = BoundBy(BarrelMaxFillLevel() - iVolume, 0, inMaxAmount);
iVolume += inMaxAmount;
UpdateBarrel();
return inMaxAmount;
}
public func Definition(proplist def)
{
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(0, 1000, 0), Trans_Rotate(-40, 1, 0, 0), Trans_Rotate(20, 0, 0, 1)), def);
}
local Collectible = false;
local Touchable = 2;
local Name = "$Name$";

View File

@ -0,0 +1,9 @@
[DefCore]
id=ConstructionPreviewer_IconFlip
Version=4,10,0,0
Category=C4D_StaticBack | C4D_IgnoreFoW
Width=24
Height=13
Offset=-12,-6
TimerCall=KeepPosition
Timer=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,23 @@
/**
ConstructionPreviewer_IconFlip
@author Clonkonaut
*/
local previewer;
func Construction(object mom)
{
SetProperty("Visibility", VIS_Owner);
previewer = mom;
SetPosition(previewer->GetX(), previewer->GetY() - (previewer.dimension_y / 2) - 8);
this->Message("@$Space$");
}
func KeepPosition()
{
if (!previewer) return RemoveObject();
SetPosition(previewer->GetX(), previewer->GetY() - (previewer.dimension_y / 2) - 8);
}

View File

@ -5,7 +5,9 @@
@author Clonkonaut
*/
local dimension_x, dimension_y, clonk, structure;
local dimension_x, dimension_y, clonk, structure, direction;
local GFX_StructureOverlay = 1;
local GFX_FlipIconOverlay = 2;
func Initialize()
{
@ -14,11 +16,14 @@ func Initialize()
func Set(id to_construct, object constructing_clonk)
{
SetGraphics(nil, to_construct, GFX_Overlay, GFXOV_MODE_Base);
SetGraphics(nil, to_construct, GFX_StructureOverlay, GFXOV_MODE_Base);
dimension_x = to_construct->GetDefWidth();
dimension_y = to_construct->GetDefHeight();
if (!to_construct->~NoConstructionFlip())
CreateObject(ConstructionPreviewer_IconFlip, 0,0, GetOwner());
clonk = constructing_clonk;
structure = to_construct;
direction = DIR_Left;
AdjustPreview();
}
@ -42,7 +47,7 @@ func AdjustPreview(bool look_up, bool no_call)
if (fail && !no_call)
return AdjustPreview(!look_up, true);
if (fail)
return SetClrModulation(RGBa(255,50,50, 100), GFX_Overlay);
return SetClrModulation(RGBa(255,50,50, 100), GFX_StructureOverlay);
SetPosition(GetX(), GetY() + y);
if (!CheckConstructionSite(structure, 0, half_y))
@ -62,9 +67,9 @@ func AdjustPreview(bool look_up, bool no_call)
if(!fail)
SetClrModulation(RGBa(50,255,50, 100), GFX_Overlay);
SetClrModulation(RGBa(50,255,50, 100), GFX_StructureOverlay);
else
SetClrModulation(RGBa(255,50,50, 100), GFX_Overlay);
SetClrModulation(RGBa(255,50,50, 100), GFX_StructureOverlay);
}
// Positions the preview according to the mouse cursor, calls AdjustPreview afterwards
@ -75,4 +80,20 @@ func Reposition(int x, int y)
y = BoundBy(y, -dimension_y/2, dimension_y/2);
SetPosition(clonk->GetX() + x, clonk->GetY() + y);
AdjustPreview();
}
// Flips the preview horizontally
func Flip()
{
// Flip not allowed?
if (structure->~NoConstructionFlip()) return;
if (direction == DIR_Left)
{
direction = DIR_Right;
SetObjDrawTransform(-1000,0,0, 0,1000,0, GFX_StructureOverlay);
} else {
direction = DIR_Left;
SetObjDrawTransform(1000,0,0, 0,1000,0, GFX_StructureOverlay);
}
}

View File

@ -6,21 +6,22 @@
*/
local definition;
local direction;
local full_material; // true when all needed material is in the site
public func IsContainer() { return true; }
public func IsContainer() { return !full_material; }
// disallow taking stuff out
public func RefuseTransfer(object toMove) { return true; }
// we have 2 interaction modes
public func IsInteractable(object obj) { return definition != nil; }
public func IsInteractable(object obj) { return definition != nil && !full_material; }
public func GetInteractionCount() { return 2; }
public func GetInteractionMetaInfo(object obj, int num)
{
if(num == 0)
return {IconName=nil, IconID=Hammer, Description="Transfer Material"};
return {IconName=nil, IconID=Hammer, Description="$TxtTransfer$"};
if(num == 1)
return {IconName=nil, IconID=Icon_Cancel, Description="Abort Construction"};
return {IconName=nil, IconID=Icon_Cancel, Description="$TxtAbort$"};
}
public func Construction()
@ -32,19 +33,25 @@ public func Construction()
return true;
}
public func Set(id def)
public func Set(id def, int dir)
{
definition = def;
direction = dir;
var xw = (1-dir*2)*1000;
var w,h;
w = def->GetDefWidth();
h = def->GetDefHeight();
SetGraphics(nil, def, 1, GFXOV_MODE_Base, nil, 1);
SetObjDrawTransform(1000,0,0,0,1000, -h*500,1);
SetGraphics(nil, def, 1, GFXOV_MODE_Base);
SetClrModulation(RGBa(255,255,255,80), 1);
SetObjDrawTransform(xw,0,0,0,1000, -h*500,1);
SetGraphics(nil, def, 2, GFXOV_MODE_Base, nil, GFX_BLIT_Wireframe);
SetObjDrawTransform(xw,0,0,0,1000, -h*500,2);
SetShape(-w/2, -h, w, h);
SetName(Format("Construction Site: %s",def->GetName()));
SetName(Format("TxtConstruction",def->GetName()));
this.visibility = VIS_Owner | VIS_Allies;
@ -104,12 +111,14 @@ private func ShowMissingComponents()
}
var stuff = GetMissingComponents();
var msg = "Construction Needs:";
//var msg = "Construction Needs:";
var msg = "@";
for(var s in stuff)
if(s.count > 0)
msg = Format("%s|%dx{{%i}}", msg, s.count, s.id);
msg = Format("%s %dx{{%i}}", msg, s.count, s.id);
Message("@%s",msg);
//Message("@%s",msg);
CustomMessage(msg, this, 0, 0, 23);
}
private func GetMissingComponents()
@ -156,11 +165,13 @@ private func StartConstructing()
var site;
if(!(site = CreateConstruction(definition, 0, 0, GetOwner(), 1, 1, 1)))
{
Log("Can't build here anymore");
Interact();
Interact(nil, 1);
return;
}
if(direction)
site->SetDir(direction);
// Autoconstruct 2.0!
Schedule(site, "DoCon(2)",1,50);
Schedule(this,"RemoveObject()",1);

View File

@ -0,0 +1,3 @@
TxtTransfer=Baumaterial transferieren
TxtAbort=Konstruktion abbrechen
TxtConstruction=Baustelle: %s

View File

@ -0,0 +1,3 @@
TxtTransfer=Transfer Material
TxtAbort=Abort Construction
TxtConstruction=Construction Site: %s

View File

@ -168,11 +168,18 @@ func FxControlConstructionPreviewControl(object clonk, effect, int ctrl, int x,
{
// CON_Use is accept
if (ctrl == CON_Use)
CreateConstructionSite(clonk, effect.structure, AbsX(effect.preview->GetX()), AbsY(effect.preview->GetY() + effect.preview.dimension_y/2));
CreateConstructionSite(clonk, effect.structure, AbsX(effect.preview->GetX()), AbsY(effect.preview->GetY() + effect.preview.dimension_y/2), effect.preview.direction);
// movement is allowed
else if(ctrl == CON_Left || ctrl == CON_Right || ctrl == CON_Up || ctrl == CON_Down || ctrl == CON_Jump)
else if (ctrl == CON_Left || ctrl == CON_Right || ctrl == CON_Up || ctrl == CON_Down || ctrl == CON_Jump)
return false;
// Flipping
else if (ctrl == CON_Interact || ctrl == CON_PushEnter || ctrl == CON_Ungrab || ctrl == CON_Grab || ctrl == CON_Enter || ctrl == CON_Exit)
{
if (release)
effect.preview->Flip();
return true;
}
// everything else declines
RemoveEffect("ControlConstructionPreview", clonk, effect);
return true;
@ -192,7 +199,7 @@ func FxControlConstructionPreviewStop(object clonk, effect, int reason, bool tem
/* Construction */
func CreateConstructionSite(object clonk, id structure_id, int x, int y)
func CreateConstructionSite(object clonk, id structure_id, int x, int y, int dir)
{
// Only when the clonk is standing and outdoors
if (clonk->GetAction() != "Walk")
@ -222,10 +229,12 @@ func CreateConstructionSite(object clonk, id structure_id, int x, int y)
// Set owner for CreateConstruction
SetOwner(clonk->GetOwner());
// Save direction so the structure can ask for it
this.constructionDirection = dir;
// Create construction site
var site;
site = CreateObject(ConstructionSite, x, y, Contained()->GetOwner());
site->Set(structure_id);
site->Set(structure_id, dir);
//if(!(site = CreateConstruction(structure_id, x, y, Contained()->GetOwner(), 1, 1, 1)))
//return false;
@ -268,4 +277,9 @@ func CreateConstructionSite(object clonk, id structure_id, int x, int y)
// Message
clonk->Message("$TxtConstructions$", structure_id->GetName());
return true;
}
// Returns the desired direction for a construction
func GetConstructionDirection()
{
return this.constructionDirection;
}

View File

@ -104,6 +104,9 @@ func RestartGrowth(int old_value)
*/
public func ChopDown()
{
// stop growing!
ClearScheduleCall(this, "RestartGrowth");
StopGrowth();
this.Touchable = 1;
SetCategory(GetCategory()&~C4D_StaticBack);
if (Stuck())

View File

@ -10,6 +10,7 @@
globals:
MakePowerConsumer(int amount)
Note: power consumers include the library Library_PowerConsumer and should use UnmakePowerConsumer to turn off as power consumers
MakePowerProducer(int amount)
IsPowerAvailable(int amount)
@ -374,6 +375,7 @@ func GetPowerHelperForObject(object who)
return helper;
}
// returns the amount of unavailable power that is currently being request
global func GetPendingPowerAmount()
{
if(!this) return 0;
@ -381,6 +383,8 @@ global func GetPendingPowerAmount()
return (Library_Power->GetPowerHelperForObject(this))->GetPendingPowerAmount();
}
// returns the current power balance of the area an object is in.
// this is roughly equivalent to produced_power - consumed_power
global func GetCurrentPowerBalance()
{
if(!this) return 0;
@ -388,13 +392,15 @@ global func GetCurrentPowerBalance()
return (Library_Power->GetPowerHelperForObject(this))->GetPowerBalance();
}
global func MakePowerProducer(int amount)
// turns the object into a power producer that produces /amount/ power until the function is called again with amount = 0
global func MakePowerProducer(int amount /* the amount of power to produce constantly, 0 to turn off */)
{
if(!this) return false;
Library_Power->Init();
return (Library_Power->GetPowerHelperForObject(this))->AddPowerProducer(this, amount);
}
// returns true if the current power balance is bigger or equal amount
global func IsPowerAvailable(int amount)
{
if(!this) return false;
@ -402,7 +408,8 @@ global func IsPowerAvailable(int amount)
return (Library_Power->GetPowerHelperForObject(this))->IsPowerAvailable(this, amount);
}
global func MakePowerConsumer(int amount)
// turns the object into a power consumer
global func MakePowerConsumer(int amount /* the amount of power to request, 0 to turn off */)
{
if(!this) return false;
Library_Power->Init();

View File

@ -2,10 +2,30 @@
Power consumer
Cares about showing the "No Power"-symbol
and provides CurrentlyHasPower()
The rest is handled by Library_Power
also handles requesting 0 power and the NoPowerNeed-rule correctly
The main part of the power system is handled by Library_Power
Usage:
a power consumer should always include this library.
production (or anything else) should /only/ be started or continued in the callback OnEnoughPower.
in the callback OnNotEnoughPower the user should pause the production.
when everything is ready to produce the user should call MakePowerConsumer(amount) where amount is the amount of power to request (works with 0).
when the production is done or the building wants to cease consuming power, it should call UnmakePowerConsumer() - note that the callback OnNotEnoughPower is not called this way.
other:
the callback GetActualPowerConsumer can return another object that acts as the power consumer when checking for the affiliation to a flag. For example the elevator case could be the power consumer but use the elevator building as the actual power consumer.
CurrentlyHasPower() returns true when the object has requested power and is not in the sleeping queue.
*/
local PowerConsumer_has_power = 0;
local PowerConsumer_has_power = false;
// states for being able to handle 0-power requests
static const PowerConsumer_LPR_None = 0;
static const PowerConsumer_LPR_Zero = 1;
static const PowerConsumer_LPR_NonZero = 2;
local PowerConsumer_last_power_request = 0;
public func IsPowerConsumer() { return true; }
@ -59,8 +79,64 @@ public func OnEnoughPower()
this->RemoveStatusSymbol(Library_PowerConsumer);
}
// wrapper for MakePowerConsumer to handle requesting 0 power and the NoPowerNeed rule correctly
func MakePowerConsumer(int amount, bool just_pass_to_global /* whether to skip special treatment for 0 power request */)
{
if(just_pass_to_global == true)
{
return inherited(amount, just_pass_to_global, ...);
}
var no_power_need = !!ObjectCount(Find_ID(Rule_NoPowerNeed));
// special handling for amount == 0
if((amount == 0) || no_power_need)
{
if(PowerConsumer_last_power_request == PowerConsumer_LPR_None) // initially requesting 0 power?
{
PowerConsumer_last_power_request = PowerConsumer_LPR_Zero;
// always enable
this->~OnEnoughPower();
return true;
}
else if(PowerConsumer_last_power_request == PowerConsumer_LPR_Zero)// requesting 0 power as a second request
{
// should still have power at this point
return true;
}
else // requesting 0 power after having requested nonzero power
{
PowerConsumer_last_power_request = PowerConsumer_LPR_Zero;
inherited(0); // removes as official power consumer
// re-enable power supply
this->~OnEnoughPower();
return true;
}
}
else PowerConsumer_last_power_request = PowerConsumer_LPR_NonZero; // requesting power != 0
return inherited(amount, just_pass_to_global, ...);
}
// turns the object off as a power consumer
func UnmakePowerConsumer()
{
// we don't have no power anymore
PowerConsumer_has_power = false;
// we were not officially registered as power consumer anyway
if(PowerConsumer_last_power_request == PowerConsumer_LPR_Zero)
{
PowerConsumer_last_power_request = PowerConsumer_LPR_None;
return true;
}
PowerConsumer_last_power_request = PowerConsumer_LPR_None;
return MakePowerConsumer(0, true);
}
func Destruction()
{
MakePowerProducer(0);
UnmakePowerConsumer();
return _inherited(...);
}

View File

@ -529,7 +529,7 @@ protected func FxProcessProductionStop(object target, proplist effect, int reaso
if(temp) return;
// no need to consume power anymore
MakePowerConsumer(0);
UnmakePowerConsumer();
if (reason != 0)
return 1;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,2 +0,0 @@
Name=Strombedarf
Description=Stromverbraucher müssen durch Stromkabel mit Stromerzeugern verbunden sein.

View File

@ -1,2 +0,0 @@
Name=Power need
Description=Power consumers need to be connected to a power source using power lines.

View File

@ -1,5 +1,5 @@
[DefCore]
id=Rule_EnergyNeed
id=Rule_NoPowerNeed
Version=5,2,0,1
Category=C4D_StaticBack|C4D_Rule
Picture=0,0,64,64

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -0,0 +1,2 @@
Name=Kein Strombedarf
Description=Stromverbraucher benötigen keinen Strom mehr.

View File

@ -0,0 +1,2 @@
Name=No power need
Description=Power consumers do not need power anymore.

View File

@ -54,6 +54,8 @@ private func Close()
Sound("ChestClose");
}
public func NoConstructionFlip() { return true; }
protected func Definition(def)
{
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(0,-3000,-5000), Trans_Rotate(-30,1,0,0), Trans_Rotate(30,0,1,0), Trans_Translate(1000,1,0)),def);

View File

@ -18,3 +18,4 @@ Exclusive=1
BlastIncinerate=1
ContactIncinerate=1
Construction=1
IncompleteActivity=1

View File

@ -15,21 +15,26 @@ local Description = "$Description$";
local leftcharge, rightcharge, lastcharge;
local anim;
func Construction()
func Construction(object creator)
{
power_seconds = 0;
lastcharge = 0;
anim = PlayAnimation("Charge", 1, Anim_Const(GetAnimationLength("Charge")), Anim_Const(1000));
return _inherited(...);
SetAction("Default");
if (!creator) return;
var dir = creator->~GetConstructionDirection();
if (dir)
SetDir(dir);
return _inherited(creator, ...);
}
func Initialize()
{
leftcharge = CreateObject(Compensator_ChargeShower, -7, 10, NO_OWNER);
leftcharge = CreateObject(Compensator_ChargeShower, 7 * GetCalcDir(), 10, NO_OWNER);
leftcharge->Init(this);
rightcharge = CreateObject(Compensator_ChargeShower, 6, 10, NO_OWNER);
rightcharge = CreateObject(Compensator_ChargeShower, -6 * GetCalcDir(), 10, NO_OWNER);
rightcharge->Init(this);
return _inherited(...);
}
@ -44,8 +49,6 @@ func OnNotEnoughPower()
return _inherited(...);
}
func UnmakePowerConsumer(){MakePowerConsumer(0);}
// devour energy
func OnEnoughPower()
{
@ -77,7 +80,7 @@ func FxConsumePowerTimer(target, effect, time)
// fully charged?
if(power_seconds >= Compensator_max_seconds)
{
MakePowerConsumer(0);
UnmakePowerConsumer();
return -1;
}
return 1;
@ -180,9 +183,23 @@ func Incineration()
var x = -7 + 14 * i;
var b = CreateObject(Compensator_BurningBattery, x, 6, NO_OWNER);
b->SetController(GetController()); // killtracing
b->SetSpeed(-30 + 60 * i + RandomX(-10, 10), RandomX(-50, -30));
}
Explode(30);
}
local ActMap = {
Default = {
Prototype = Action,
Name = "Default",
Procedure = DFA_NONE,
Directions = 2,
FlipDir = 1,
Length = 1,
Delay = 0,
FacetBase = 1,
NextAction = "Default",
},
};

View File

@ -15,4 +15,5 @@ Components=Wood=3;Metal=1
Exclusive=1
BlastIncinerate=100
Construction=1
ContainBlast=1
ContainBlast=1
IncompleteActivity=1

View File

@ -16,26 +16,32 @@ func CreateShaft(int length)
/* Initialization */
func Construction()
func Construction(object creator)
{
SetProperty("MeshTransformation", Trans_Rotate(-44,0,1,0));
SetAction("Default");
if (!creator) return;
var dir = creator->~GetConstructionDirection();
if (dir)
SetDir(dir);
}
func Initialize()
{
CreateCase();
CreateRope();
return _inherited();
}
func CreateCase()
{
case = CreateObject(ElevatorCase, 19, 33, GetOwner());
case = CreateObject(ElevatorCase, -19 * GetCalcDir(), 33, GetOwner());
case->Connect(this);
}
func CreateRope()
{
rope = CreateObject(ElevatorRope, 19, -11, GetOwner());
rope = CreateObject(ElevatorRope, -19 * GetCalcDir(), -11, GetOwner());
rope->SetAction("Be", case);
}
@ -65,6 +71,20 @@ func StopEngine()
Sound("ElevatorStop");
}
local ActMap = {
Default = {
Prototype = Action,
Name = "Default",
Procedure = DFA_NONE,
Directions = 2,
FlipDir = 1,
Length = 1,
Delay = 0,
FacetBase = 1,
NextAction = "Default",
},
};
func Definition(def) {
SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(-20,1,0), Trans_Rotate(-20, 0, 1, 0)));
}

View File

@ -19,6 +19,7 @@ protected func Construction()
return _inherited(...);
}
public func NoConstructionFlip() { return true; }
/*-- Interaction --*/

View File

@ -2,6 +2,8 @@
id=Foundry
Version=5,2,0,1
Category=C4D_Structure
Timer=1
TimerCall=CollectionZone
Width=50
Height=52
Offset=-25,-26
@ -12,8 +14,8 @@ VertexFriction=50,50,50,100,100,100
Value=200
Mass=4500
Components=Rock=4;Wood=2;
Collection=16,3,13,13
Exclusive=1
BlastIncinerate=100
Construction=1
ContainBlast=1
IncompleteActivity=1

View File

@ -11,11 +11,16 @@
// does not need power
func PowerNeed() { return 0; }
public func Construction()
public func Construction(object creator)
{
//SetProperty("MeshTransformation",Trans_Rotate(RandomX(-40,20),0,1,0));
return _inherited(...);
SetAction("Default");
if (!creator) return;
var dir = creator->~GetConstructionDirection();
if (dir)
SetDir(dir);
return _inherited(creator, ...);
}
/*-- Production --*/
@ -54,7 +59,16 @@ public func OnProductionFinish(id product)
return;
}
protected func Collection()
// Timer, check for objects to collect in the designated collection zone
func CollectionZone()
{
if (GetCon() < 100) return;
for (var object in FindObjects(Find_InRect(16 - 45 * GetDir(),3,13,13), Find_OCF(OCF_Collectible), Find_NoContainer(), Find_Layer(GetObjectLayer())))
Collect(object);
}
func Collection()
{
Sound("Clonk");
return;
@ -64,11 +78,11 @@ public func FxSmeltingTimer(object target, proplist effect, int time)
{
//Message(Format("Smelting %d",timer));
// Fire in the furnace.
CreateParticle("Fire",10,20,RandomX(-1,1),RandomX(-1,1),RandomX(25,50),RGB(255,255,255), this);
CreateParticle("Fire",-10*GetCalcDir(),20,RandomX(-1,1),RandomX(-1,1),RandomX(25,50),RGB(255,255,255), this);
// Smoke from the pipes.
CreateParticle("ExploSmoke", 9, -31, RandomX(-2,1), -7 + RandomX(-2,2), RandomX(60,125), RGBa(255,255,255,50));
CreateParticle("ExploSmoke", 16, -27, RandomX(-1,2), -7 + RandomX(-2,2), RandomX(30,90), RGBa(255,255,255,50));
CreateParticle("ExploSmoke", -9*GetCalcDir(), -31, RandomX(-2,1), -7 + RandomX(-2,2), RandomX(60,125), RGBa(255,255,255,50));
CreateParticle("ExploSmoke", -16*GetCalcDir(), -27, RandomX(-1,2), -7 + RandomX(-2,2), RandomX(30,90), RGBa(255,255,255,50));
// Furnace sound after some time.
if (time == 100)
@ -84,7 +98,7 @@ public func FxSmeltingTimer(object target, proplist effect, int time)
// Fire from the pouring exit.
if (Inside(time, 244, 290))
CreateParticle("Fire",-17,19,-1 + RandomX(-1,1), 2+ RandomX(-1,1),RandomX(5,15),RGB(255,255,255));
CreateParticle("Fire",17*GetCalcDir(),19,-1 + RandomX(-1,1), 2+ RandomX(-1,1),RandomX(5,15),RGB(255,255,255));
if (time == 290)
{
@ -98,13 +112,27 @@ public func FxSmeltingTimer(object target, proplist effect, int time)
public func OnProductEjection(object product)
{
product->SetPosition(GetX() - 18, GetY() + 16);
product->SetPosition(GetX() + 18 * GetCalcDir(), GetY() + 16);
product->SetSpeed(0, -17);
product->SetR(30 - Random(59));
Sound("Pop");
return;
}
local ActMap = {
Default = {
Prototype = Action,
Name = "Default",
Procedure = DFA_NONE,
Directions = 2,
FlipDir = 1,
Length = 1,
Delay = 0,
FacetBase = 1,
NextAction = "Default",
},
};
func Definition(def) {
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(2000,0,7000),Trans_Rotate(-20,1,0,0),Trans_Rotate(30,0,1,0)), def);
}

View File

@ -3,3 +3,5 @@
local Name = "$Name$";
local Touchable = 1;
public func NoConstructionFlip() { return true; }

View File

@ -16,3 +16,4 @@ Picture=280,0,28,32
Exclusive=1
BlastIncinerate=50
Construction=1
IncompleteActivity=1

View File

@ -12,9 +12,18 @@
// This object is a liquid pump, thus pipes can be connected.
public func IsLiquidPump() { return true; }
protected func Initialize()
public func Construction(object creator)
{
SetAction("Wait");
if (!creator) return;
var dir = creator->~GetConstructionDirection();
if (dir)
SetDir(dir);
return _inherited(creator, ...);
}
protected func Initialize()
{
MakePowerConsumer(100);
turned_on = true;
return;
@ -87,6 +96,8 @@ protected func OnPumpStart()
protected func OnWaitStart()
{
if (GetCon() < 100) return;
if (ReadyToPump())
SetAction("Pump");
return;
@ -164,6 +175,8 @@ local ActMap = {
Procedure = DFA_NONE,
Length = 20,
Delay = 3,
Directions = 2,
FlipDir = 1,
X = 0,
Y = 0,
Wdt = 28,
@ -178,6 +191,8 @@ local ActMap = {
Procedure = DFA_NONE,
Length = 1,
Delay = 50,
Directions = 2,
FlipDir = 1,
X = 0,
Y = 0,
Wdt = 28,

View File

@ -2,8 +2,8 @@
id=Sawmill
Version=5,2,0,1
Category=C4D_Structure
TimerCall=FindTrees
Timer=35
Timer=1
TimerCall=CollectionZone
Width=50
Height=31
Offset=-25,-15
@ -14,9 +14,8 @@ VertexFriction=50,50,100,50,100,100
Value=50
Mass=1500
Components=Rock=4;Wood=2;
Collection=0,0,13,13
#Entrance=-30,-15,30,30
Exclusive=1
BlastIncinerate=100
Construction=1
ContainBlast=1
ContainBlast=1
IncompleteActivity=1

View File

@ -8,11 +8,15 @@
#include Library_Ownable
#include Library_Producer
public func Construction()
public func Construction(object creator)
{
SetProperty("MeshTransformation",Trans_Rotate(-20,0,1,0));
return _inherited(...);
SetAction("Default");
if (!creator) return;
var dir = creator->~GetConstructionDirection();
if (dir)
SetDir(dir);
return _inherited(creator, ...);
}
public func Initialize()
@ -31,7 +35,7 @@ public func IsContainer() { return false; }
protected func FindTrees()
{
var tree = FindObject(Find_AtPoint(), Find_Func("IsTree"), Find_Not(Find_Func("IsStanding")), Find_Func("GetComponent", Wood));
if (!tree || GetCon() < 100) return;
if (!tree) return;
Saw(tree);
}
@ -103,6 +107,17 @@ public func OnProductionFinish(id product)
}
}
// Timer, check for objects to collect in the designated collection zone
func CollectionZone()
{
if (GetCon() < 100) return;
if (!(FrameCounter() % 35)) FindTrees();
for (var object in FindObjects(Find_InRect(- 13 * GetDir(),0,13,13), Find_OCF(OCF_Collectible), Find_NoContainer(), Find_Layer(GetObjectLayer())))
Collect(object);
}
protected func Collection()
{
Sound("Clonk");
@ -111,16 +126,16 @@ protected func Collection()
public func FxSawingTimer(object target, proplist effect, int time)
{
if (time >= this.SpinStep * 3 && time % 5)
CreateParticle("Axe_WoodChip", 6 - Random(3), RandomX(1,4), 5 + Random(11), -RandomX(2,4), 15+Random(10), RGB(255,255,255), this);
CreateParticle("Axe_WoodChip", - 6 * GetCalcDir() - Random(3), RandomX(1,4), -(5 + Random(11)) * GetCalcDir(), -RandomX(2,4), 15+Random(10), RGB(255,255,255), this);
if (!(time % 20))
Smoke(-10,10,10);
Smoke(10 * GetCalcDir(),10,10);
}
public func OnProductEjection(object product)
{
product->SetPosition(GetX() + 25, GetY() - 8);
product->SetSpeed(7, 5);
product->SetPosition(GetX() - 25 * GetCalcDir(), GetY() - 8);
product->SetSpeed(-7 * GetCalcDir(), 5);
product->SetR(30 - Random(59));
Sound("Pop");
}
@ -171,6 +186,20 @@ private func SpinOff(int call, int animation_no)
ScheduleCall(this, "SpinOff", this.SpinStep * 2, nil, call+1);
}
local ActMap = {
Default = {
Prototype = Action,
Name = "Default",
Procedure = DFA_NONE,
Directions = 2,
FlipDir = 1,
Length = 1,
Delay = 0,
FacetBase = 1,
NextAction = "Default",
},
};
func Definition(def) {
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(2000,0,7000),Trans_Rotate(-20,1,0,0),Trans_Rotate(30,0,1,0)), def);
}

View File

@ -2,7 +2,8 @@
id=SteamEngine
Version=5,2,0,1
Category=C4D_Structure
TimerCall=ContentsCheck
Timer=1
TimerCall=CollectionZone
Width=66
Height=48
Offset=-33,-24
@ -18,3 +19,4 @@ Exclusive=1
BlastIncinerate=130
Construction=1
ContainBlast=1
IncompleteActivity=1

View File

@ -8,18 +8,35 @@ static const SteamEngine_produced_power = 300;
local iFuelAmount;
local power_seconds;
func Construction()
func Construction(object creator)
{
iFuelAmount = 0;
power_seconds = 0;
return _inherited(...);
SetAction("Default");
if (!creator) return;
var dir = creator->~GetConstructionDirection();
if (dir)
SetDir(dir);
return _inherited(creator, ...);
}
public func IsContainer() { return true; }
// Timer, check for objects to collect in the designated collection zone
func CollectionZone()
{
if (GetCon() < 100) return;
if (!(FrameCounter() % 35)) ContentsCheck();
for (var object in FindObjects(Find_InRect(- 31 + 52 * GetDir(),9,10,10), Find_OCF(OCF_Collectible), Find_NoContainer(), Find_Layer(GetObjectLayer())))
Collect(object);
}
protected func RejectEntrance(object obj)
{
if (obj->~IsFuel())
if (obj->~IsFuel())
return false;
return true;
}
@ -41,7 +58,7 @@ func ContentsCheck()
}
// Still active?
if(!ActIdle()) return true;
if(GetAction() == "Work") return true;
// or still warm water in the tank?!
if(GetEffect("CreatesPower", this))
return true;
@ -79,7 +96,7 @@ func ConsumeFuel()
// All used up?
if(!iFuelAmount || ((GetPendingPowerAmount() == 0) && (GetCurrentPowerBalance() >= SteamEngine_produced_power)))
{
SetAction("Idle");
SetAction("Default");
ContentsCheck();
}
}
@ -111,23 +128,35 @@ func FxCreatesPowerStop(target, effect, reason, temp)
func FxSmokingTimer()
{
Smoke(20, -15, 10);
Smoke(-20 * GetCalcDir(), -15, 10);
return 1;
}
local ActMap = {
Work = {
Prototype = Action,
Name = "Work",
Procedure = DFA_NONE,
Directions = 2,
FlipDir = 1,
Length = 20,
Delay = 2,
NextAction = "Work",
Animation = "Work",
EndCall = "ConsumeFuel",
},
Default = {
Prototype = Action,
Name = "Default",
Procedure = DFA_NONE,
Directions = 2,
FlipDir = 1,
Length = 1,
Delay = 0,
FacetBase=1,
NextAction = "Default",
},
Work = {
Prototype = Action,
Name = "Work",
Procedure = DFA_NONE,
Directions = 2,
FlipDir = 1,
Length = 20,
Delay = 2,
FacetBase = 1,
NextAction = "Work",
Animation = "Work",
EndCall = "ConsumeFuel",
},
};
func Definition(def) {

View File

@ -17,3 +17,4 @@ Exclusive=1
BlastIncinerate=100
Construction=1
ContainBlast=1
IncompleteActivity=1

View File

@ -6,15 +6,22 @@
local hold_production;
public func Construction(object creator)
{
SetAction("Default");
if (!creator) return;
var dir = creator->~GetConstructionDirection();
if (dir)
SetDir(dir);
return _inherited(creator, ...);
}
public func Initialize()
{
// SetProperty("MeshTransformation", Trans_Rotate(RandomX(-30,30),0,1,0));
hold_production = false;
return _inherited(...);
}
/*-- Production --*/
public func IsProduct(id product_id)
@ -66,30 +73,30 @@ protected func FxWorkingTimer()
private func Smoking()
{
if (Random(6)) Smoke(+16,-14,16);
if (Random(8)) Smoke(10,-14,15+Random(3));
if (Random(6)) Smoke(16 * GetCalcDir(),-14,16);
if (Random(8)) Smoke(10 * GetCalcDir(),-14,15+Random(3));
return 1;
}
public func SetSign(id def)
{
if (!def)
return SetGraphics("", nil, 1, 4);
SetGraphics("", def, 1, 4);
SetObjDrawTransform(200, 0, 19500, 0, 200, 2500, 1);
return SetGraphics("", nil, GFX_Overlay, 4);
SetGraphics("", def, GFX_Overlay, 4);
SetObjDrawTransform(200, 0, -19500 * GetCalcDir(), 0, 200, 2500, GFX_Overlay);
}
local ActMap = {
Build = {
Default = {
Prototype = Action,
Name = "Build",
Name = "Default",
Procedure = DFA_NONE,
Length = 40,
Delay = 1,
Directions = 2,
FlipDir = 1,
Length = 1,
Delay = 0,
FacetBase=1,
NextAction = "Build",
//Animation = "Turn",
PhaseCall="Smoking",
NextAction = "Default",
},
};
func Definition(def) {

View File

@ -2,8 +2,8 @@
id=Windmill
Version=5,2,0,1
Category=C4D_Structure
TimerCall=Wind2Turn
Timer=35
Timer=1
TimerCall=CollectionZone
Width=50
Height=96
Offset=-25,-48
@ -19,3 +19,4 @@ Exclusive=1
BlastIncinerate=100
Construction=1
ContainBlast=1
IncompleteActivity=1

View File

@ -13,24 +13,26 @@
local wind_anim;
local last_wind;
protected func Construction()
protected func Construction(object creator)
{
SetProperty("MeshTransformation", Trans_Rotate(-30,0,1,0));
return _inherited(...);
SetAction("Default");
if (!creator) return;
var dir = creator->~GetConstructionDirection();
if (dir)
SetDir(dir);
return _inherited(creator, ...);
}
protected func Initialize()
{
// Set initial position
wind_anim = PlayAnimation("Spin", 5, Anim_Const(0), Anim_Const(1000));
Wind2Turn();
return _inherited(...);
}
func Wind2Turn()
{
if(GetCon() < 100) return;
{
// Fade linearly in time until next timer call
var start = 0;
var end = GetAnimationLength("Spin");
@ -108,6 +110,17 @@ public func OnProductionFinish(id product)
return;
}
// Timer, check for objects to collect in the designated collection zone
func CollectionZone()
{
if (GetCon() < 100) return;
if (!(FrameCounter() % 35)) Wind2Turn();
for (var object in FindObjects(Find_InRect(-18 + 21 * GetDir(),35,15,15), Find_OCF(OCF_Collectible), Find_NoContainer(), Find_Layer(GetObjectLayer())))
Collect(object);
}
protected func Collection()
{
Sound("Clonk");
@ -116,13 +129,13 @@ protected func Collection()
public func FxCrushingTimer(object target, proplist effect, int time)
{
CreateParticle("Axe_WoodChip", -12, 40, 5 - Random(11), RandomX(6,13) * -1, 20, RGB(255,255,255), this);
CreateParticle("Axe_WoodChip", 12 * GetCalcDir(), 40, -(5 - Random(11)) * GetCalcDir(), RandomX(6,13) * -1, 20, RGB(255,255,255), this);
return 1;
}
public func OnProductEjection(object product)
{
product->SetPosition(GetX() + 25, GetY() + 40);
product->SetPosition(GetX() - 25 * GetCalcDir(), GetY() + 40);
product->SetSpeed(0, -17);
product->SetR(30 - Random(59));
Sound("Pop");
@ -138,6 +151,20 @@ protected func RejectCollect(id item, object collect)
func IsInteractable() { return true; }
local ActMap = {
Default = {
Prototype = Action,
Name = "Default",
Procedure = DFA_NONE,
Directions = 2,
FlipDir = 1,
Length = 1,
Delay = 0,
FacetBase = 1,
NextAction = "Default",
},
};
func Definition(def) {
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(2000,0,7000),Trans_Rotate(-20,1,0,0),Trans_Rotate(30,0,1,0)), def);
}

View File

@ -13,6 +13,8 @@ protected func IsBuilt()
return GetCon() >= 100;
}
public func NoConstructionFlip() { return true; }
local ActMap = {/*
Idle = {
Prototype = Action,

View File

@ -9,7 +9,6 @@ Vertices=1
VertexY=1
Mass=1
Rotate=1
Placement=0
StretchGrowth=1
Oversize=1
ContactIncinerate=3

View File

@ -77,3 +77,4 @@ global func MakeGrasFunction()
}
local Name = "Grass";
local Placement = 0;

View File

@ -14,5 +14,4 @@ VertexCNAT=16,8
VertexFriction=10,100
Mass=6
StretchGrowth=4
Oversize=1
Placement=4
Oversize=1

View File

@ -50,4 +50,5 @@ protected func ControlUse(object clonk, int iX, int iY)
public func NutritionalValue() { return 5; }
local Name = "$Name$";
local Collectible = 0;
local Collectible = 0;
local Placement = 4;

View File

@ -11,6 +11,5 @@ VertexY=-7,7
VertexCNAT=4,3
VertexFriction=10,100
Mass=1
Placement=1
StretchGrowth=4
Oversize=1

View File

@ -18,37 +18,39 @@ private func Check()
if(!GBackLiquid()) SetAction("Limp");
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("ActMap", {
Sway = {
Prototype = Action,
Name = "Sway",
Procedure = DFA_NONE,
Directions = 2,
Length = 78,
Delay = 2,
X = 0,
Y = 0,
Wdt = 8,
Hgt = 8,
PhaseCall= "Check",
NextAction = "Sway",
Animation = "Sway",
},
Limp = {
Prototype = Action,
Name = "Limp",
Procedure = DFA_NONE,
Directions = 2,
Length = 1,
Delay = 1,
X = 0,
Y = 0,
Wdt = 6,
Hgt = 6,
NextAction = "Limp",
InLiquidAction = "Sway",
Animation = "Limp",
}, }, def);
}
local Name = "$Name$";
local Placement = 1;
local ActMap = {
Sway = {
Prototype = Action,
Name = "Sway",
Procedure = DFA_NONE,
Directions = 2,
Length = 78,
Delay = 2,
X = 0,
Y = 0,
Wdt = 8,
Hgt = 8,
PhaseCall= "Check",
NextAction = "Sway",
Animation = "Sway",
},
Limp = {
Prototype = Action,
Name = "Limp",
Procedure = DFA_NONE,
Directions = 2,
Length = 1,
Delay = 1,
X = 0,
Y = 0,
Wdt = 6,
Hgt = 6,
NextAction = "Limp",
InLiquidAction = "Sway",
Animation = "Limp",
},
};

View File

@ -6,10 +6,10 @@ Timer=350
TimerCall=Seed
Width=60
Height=110
Offset=-30,-55
Offset=-30,-110
Vertices=9
VertexX=0,0,0,0,0,0,0,0,0
VertexY=45,30,20,10,0,-10,-20,-30,-45
VertexY=-10,-25,-35,-45,-55,-65,-75,-85,-100
VertexCNAT=8,16,16,16,16,16,16,16,4
VertexFriction=50,50,25,25,25,25,50,50,50
Components=Wood=4

View File

@ -9,21 +9,18 @@ private func SeedAmount() { return 12; }
func Construction()
{
StartGrowth(5);
inherited(...);
}
private func Initialize()
{
// set random rotation so trees don't look alike too much
SetProperty("MeshTransformation", Trans_Rotate(RandomX(0,359),0,1,0));
inherited(...);
}
public func IsTree() { return true; }
public func ChopDown()
{
// Remove the bottom vertex
SetVertex(0, VTX_Y, 0, 1);
RemoveVertex(0);
// Remove the bottom vertex (via removing collision)
// this is done because Removing the Vertex would re-add it at the first rotation/con-update
SetVertex(0, VTX_CNAT, CNAT_NoCollision, 2);
_inherited(...);
}

View File

@ -28,7 +28,6 @@ global func GetDefMass() { return GetDefCoreVal("Mass", "DefCore"); }
global func GetDefComponents(nr) { return GetDefCoreVal("Components", "DefCore", nr); }
global func GetDefCollection(nr) { return GetDefCoreVal("Collection", "DefCore", nr); }
global func GetDefFireTop() { return GetDefCoreVal("FireTop", "DefCore"); }
global func GetDefPlacement() { return GetDefCoreVal("Placement", "DefCore"); }
global func GetDefContactIncinerate() { return GetDefCoreVal("ContactIncinerate", "DefCore"); }
global func GetDefBlastIncinerate() { return GetDefCoreVal("BlastIncinerate", "DefCore"); }
global func GetDefBurnTo() { return GetDefCoreVal("BurnTo", "DefCore"); }

View File

@ -99,4 +99,11 @@ global func GetBit(int value, int bit_nr)
global func ToggleBit(int old_val, int bit_nr)
{
return old_val ^ (1 << bit_nr);
}
// Returns -1 for DIR_Left and +1 for DIR_Right or 0 if no object context is present
global func GetCalcDir()
{
if (!this) return 0;
return GetDir() * 2 - 1;
}

View File

@ -150,7 +150,10 @@ global func GetMaxBreath()
// Makes an object gain Con until it is FullCon
global func StartGrowth(int value)
{
return AddEffect("IntGrowth", this, 1, 35, nil, nil, value);
var effect;
effect = AddEffect("IntGrowth", this, 1, 35, nil, nil, value);
effect.Time = Random(35);
return effect;
}
global func StopGrowth()

View File

@ -7,7 +7,6 @@ Version=5,2,0,1
Definition1=Objects.ocd
[Game]
Rules=Rule_EnergyNeed=1
[Player1]
Wealth=250

View File

@ -2435,7 +2435,7 @@ C4Object* C4Game::PlaceVegetation(C4ID id, int32_t iX, int32_t iY, int32_t iWdt,
}
// Place by placement type
switch (pDef->Placement)
switch (pDef->GetPropertyInt(P_Placement))
{
// Surface soil
@ -2543,7 +2543,7 @@ C4Object* C4Game::PlaceAnimal(C4ID idAnimal)
if (!pDef) return NULL;
int32_t iX,iY;
// Placement
switch (pDef->Placement)
switch (pDef->GetPropertyInt(P_Placement))
{
// Running free
case C4D_Place_Surface:

View File

@ -98,6 +98,10 @@ public:
#define C4ConsoleWindowClassname "C4Console"
#ifdef _WIN32
#define ConsoleDlgWindowStyle (WS_VISIBLE | WS_POPUP | WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX)
#endif
extern C4Console Console;
#endif

View File

@ -76,7 +76,6 @@ void C4Def::DefaultDefCore()
LineIntersect=0;
NoBurnDecay=0;
IncompleteActivity=0;
Placement=0;
AttractLightning=0;
Oversize=0;
Fragile=0;
@ -193,7 +192,6 @@ void C4Def::CompileFunc(StdCompiler *pComp)
pComp->Value(mkNamingAdapt(StdNullAdapt(), "PictureFE" ));
pComp->Value(mkNamingAdapt(Entrance, "Entrance", Rect0 ));
pComp->Value(mkNamingAdapt(Collection, "Collection", Rect0 ));
pComp->Value(mkNamingAdapt(Placement, "Placement", 0 ));
pComp->Value(mkNamingAdapt(Exclusive, "Exclusive", 0 ));
pComp->Value(mkNamingAdapt(ContactIncinerate, "ContactIncinerate", 0 ));
pComp->Value(mkNamingAdapt(BlastIncinerate, "BlastIncinerate", 0 ));

View File

@ -141,7 +141,6 @@ public:
int32_t LineIntersect;
int32_t NoBurnDecay;
int32_t IncompleteActivity;
int32_t Placement;
int32_t AttractLightning;
int32_t Oversize;
int32_t Fragile;

View File

@ -2236,6 +2236,7 @@ C4ScriptConstDef C4ScriptObjectConstMap[]=
{ "GFX_BLIT_Mod2" ,C4V_Int, C4GFXBLIT_MOD2}, //
{ "GFX_BLIT_ClrSfc_OwnClr" ,C4V_Int, C4GFXBLIT_CLRSFC_OWNCLR}, //
{ "GFX_BLIT_ClrSfc_Mod2" ,C4V_Int, C4GFXBLIT_CLRSFC_MOD2}, //
{ "GFX_BLIT_Wireframe" ,C4V_Int, C4GFXBLIT_WIREFRAME}, //
{ "GFX_BLIT_Custom" ,C4V_Int, C4GFXBLIT_CUSTOM}, //
{ "GFX_BLIT_Parent" ,C4V_Int, C4GFXBLIT_PARENT}, //

View File

@ -341,7 +341,7 @@ void C4Effect::Kill(C4Object *pObj)
// remove this effect
int32_t iPrevPrio = iPriority; SetDead();
if (pFnStop)
if (pFnStop->Exec(CommandTarget, &C4AulParSet(C4VObj(pObj), C4VPropList(this))).getInt() == C4Fx_Stop_Deny)
if (pFnStop->Exec(CommandTarget, &C4AulParSet(C4VObj(pObj), C4VPropList(this), C4VInt(C4FxCall_Normal))).getInt() == C4Fx_Stop_Deny)
// effect denied to be removed: recover
iPriority = iPrevPrio;
// reactivate other effects

View File

@ -48,9 +48,10 @@ typedef void* IDirect3DSurface9;
#define C4GFXBLIT_MOD2 2 // additive color modulation
#define C4GFXBLIT_CLRSFC_OWNCLR 4 // do not apply global modulation to ColorByOwner-surface
#define C4GFXBLIT_CLRSFC_MOD2 8 // additive color modulation for ClrByOwner-surface
#define C4GFXBLIT_WIREFRAME 16 // draws a mesh as wireframe
#define C4GFXBLIT_ALL 15 // bist mask covering all blit modes
#define C4GFXBLIT_NOADD 14 // bit mask covering all blit modes except additive
#define C4GFXBLIT_ALL 31 // bist mask covering all blit modes
#define C4GFXBLIT_NOADD 30 // bit mask covering all blit modes except additive
#define C4GFXBLIT_CUSTOM 128 // custom blitting mode - ignored by gfx system
#define C4GFXBLIT_PARENT 256 // blitting mode inherited by parent - ignored by gfx system

View File

@ -786,7 +786,9 @@ C4Window* C4Window::Init(WindowKind windowKind, C4AbstractApp * pApp, const char
gtk_widget_set_double_buffered (GTK_WIDGET(render_widget), false);
gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(Console.window));
#if GTK_CHECK_VERSION(3,0,0)
gtk_window_set_has_resize_grip(GTK_WINDOW(window), false);
#endif
}
else if (windowKind == W_Fullscreen)
{
@ -811,7 +813,9 @@ C4Window* C4Window::Init(WindowKind windowKind, C4AbstractApp * pApp, const char
g_object_set_property (G_OBJECT (render_widget), "can-focus", &val);
g_object_set_property (G_OBJECT (window), "can-focus", &val);
g_value_unset (&val);
#if GTK_CHECK_VERSION(3,0,0)
gtk_window_set_has_resize_grip(GTK_WINDOW(window), false);
#endif
}
else if (windowKind == W_GuiWindow)
{
@ -823,7 +827,9 @@ C4Window* C4Window::Init(WindowKind windowKind, C4AbstractApp * pApp, const char
g_signal_connect(G_OBJECT(window), "scroll-event", G_CALLBACK(OnScrollGD), this);
gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(Console.window));
#if GTK_CHECK_VERSION(3,0,0)
gtk_window_set_has_resize_grip(GTK_WINDOW(window), false);
#endif
}
else if (windowKind == W_Console)
{

View File

@ -69,7 +69,6 @@
#define C4ViewportClassName L"C4Viewport"
#define C4FullScreenClassName L"C4FullScreen"
#define ConsoleDlgClassName L"C4GUIdlg"
#define ConsoleDlgWindowStyle (WS_VISIBLE | WS_POPUP | WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX)
LRESULT APIENTRY FullScreenWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
@ -392,7 +391,7 @@ LRESULT APIENTRY ViewportWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
LRESULT APIENTRY DialogWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
// Determine dialog
Dialog *pDlg = ::pGUI->GetDialog(hwnd);
C4GUI::Dialog *pDlg = ::pGUI->GetDialog(hwnd);
if (!pDlg) return DefWindowProc(hwnd, uMsg, wParam, lParam);
// Process message
@ -554,13 +553,13 @@ C4Window * C4Window::Init(C4Window::WindowKind windowKind, C4AbstractApp * pApp,
WndClass.lpfnWndProc = DialogWinProc;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.hInstance = hInst;
WndClass.hInstance = pApp->GetInstance();
WndClass.hCursor = LoadCursor (NULL, IDC_ARROW); // - always use normal hw cursor
WndClass.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
WndClass.lpszMenuName = NULL;
WndClass.lpszClassName = ConsoleDlgClassName;
WndClass.hIcon = LoadIcon (hInst, MAKEINTRESOURCE (IDI_00_C4X) );
WndClass.hIconSm = LoadIcon (hInst, MAKEINTRESOURCE (IDI_00_C4X) );
WndClass.hIcon = LoadIcon (pApp->GetInstance(), MAKEINTRESOURCE (IDI_00_C4X) );
WndClass.hIconSm = LoadIcon (pApp->GetInstance(), MAKEINTRESOURCE (IDI_00_C4X) );
if (!RegisterClassExW(&WndClass))
return NULL;
}
@ -580,7 +579,7 @@ C4Window * C4Window::Init(C4Window::WindowKind windowKind, C4AbstractApp * pApp,
ConsoleDlgClassName, GetWideChar(Title),
ConsoleDlgWindowStyle,
CW_USEDEFAULT,CW_USEDEFAULT,rtSize.right-rtSize.left,rtSize.bottom-rtSize.top,
pParent->hWindow,NULL,pApp->GetInstance(),NULL);
::Console.hWindow,NULL,pApp->GetInstance(),NULL);
hRenderWindow = hWindow;
return hWindow ? this : 0;
}

View File

@ -1117,10 +1117,27 @@ namespace
for (; attach_iter != instance.AttachedMeshesEnd() && ((*attach_iter)->GetFlags() & StdMeshInstance::AM_DrawBefore); ++attach_iter)
RenderAttachedMesh(*attach_iter, dwModClr, dwBlitMode, dwPlayerColor, parity);
GLint modes[2];
// Check if we should draw in wireframe or normal mode
if(dwBlitMode & C4GFXBLIT_WIREFRAME)
{
// save old mode
glGetIntegerv(GL_POLYGON_MODE, modes);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
}
// Render each submesh
for (unsigned int i = 0; i < mesh.GetNumSubMeshes(); ++i)
RenderSubMeshImpl(instance, instance.GetSubMesh(i), dwModClr, dwBlitMode, dwPlayerColor, parity);
// reset old mode to prevent rendering errors
if(dwBlitMode & C4GFXBLIT_WIREFRAME)
{
glPolygonMode(GL_FRONT, modes[0]);
glPolygonMode(GL_BACK, modes[1]);
}
#if 0
// Draw attached bone
if (instance.GetAttachParent())

View File

@ -157,8 +157,9 @@ enum C4AulBCCType
AB_NEW_ARRAY, // semi-constant: array
AB_NEW_PROPLIST, // create a new proplist
AB_JUMP, // jump
AB_JUMPAND, // jump if zero, else pop the stack
AB_JUMPOR, // jump if not zero, else pop the stack
AB_JUMPAND, // jump if convertible to false, else pop the stack
AB_JUMPOR, // jump if convertible to true, else pop the stack
AB_JUMPNNIL, // jump if not nil, else pop the stack
AB_CONDN, // conditional jump (negated, pops stack)
AB_COND, // conditional jump (pops stack)
AB_FOREACH_NEXT, // foreach: next element

View File

@ -576,6 +576,20 @@ C4Value C4AulExec::Exec(C4AulBCC *pCPos, bool fPassErrors)
}
break;
case AB_JUMPNNIL: // ??
{
if (pCurVal[0].GetType() != C4V_Nil)
{
fJump = true;
pCPos += pCPos->Par.i;
}
else
{
PopValue();
}
break;
}
case AB_CONDN:
if (!pCurVal[0])
{

View File

@ -394,6 +394,7 @@ static C4ScriptOpDef C4ScriptOpMap[] =
{ 6, "|", AB_BitOr, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int},
{ 5, "&&", AB_JUMPAND, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Bool, C4V_Bool},
{ 4, "||", AB_JUMPOR, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Bool, C4V_Bool},
{ 3, "??", AB_JUMPNNIL, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Any, C4V_Any},
// changers
{ 2, "*=", AB_Mul, AB_ERR, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int},
@ -670,6 +671,7 @@ static const char * GetTTName(C4AulBCCType e)
case AB_JUMP: return "JUMP"; // jump
case AB_JUMPAND: return "JUMPAND";
case AB_JUMPOR: return "JUMPOR";
case AB_JUMPNNIL: return "JUMPNNIL"; // nil-coalescing operator ("??")
case AB_CONDN: return "CONDN"; // conditional jump (negated, pops stack)
case AB_COND: return "COND"; // conditional jump (pops stack)
case AB_FOREACH_NEXT: return "FOREACH_NEXT"; // foreach: next element
@ -828,10 +830,11 @@ int C4AulParse::GetStackValue(C4AulBCCType eType, intptr_t X)
case AB_COND:
case AB_POP_TO:
case AB_RETURN:
// JUMPAND/JUMPOR are special: They either jump over instructions adding one to the stack
// JUMPAND/JUMPOR/JUMPNNIL are special: They either jump over instructions adding one to the stack
// or decrement the stack. Thus, for stack counting purposes, they decrement.
case AB_JUMPAND:
case AB_JUMPOR:
case AB_JUMPNNIL:
return -1;
case AB_FUNC:
@ -1083,7 +1086,7 @@ int C4AulParse::JumpHere()
static bool IsJump(C4AulBCCType t)
{
return t == AB_JUMP || t == AB_JUMPAND || t == AB_JUMPOR || t == AB_CONDN || t == AB_COND;
return t == AB_JUMP || t == AB_JUMPAND || t == AB_JUMPOR || t == AB_JUMPNNIL || t == AB_CONDN || t == AB_COND;
}
void C4AulParse::SetJumpHere(int iJumpOp)
@ -2435,7 +2438,7 @@ void C4AulParse::Parse_Expression2(int iParentPrio)
}
Shift();
if (C4ScriptOpMap[OpID].Code == AB_JUMPAND || C4ScriptOpMap[OpID].Code == AB_JUMPOR)
if (C4ScriptOpMap[OpID].Code == AB_JUMPAND || C4ScriptOpMap[OpID].Code == AB_JUMPOR || C4ScriptOpMap[OpID].Code == AB_JUMPNNIL)
{
// create bytecode, remember position
// Jump or discard first parameter
@ -2966,7 +2969,7 @@ bool C4ScriptHost::Parse()
{
switch (pBCC->bccType)
{
case AB_JUMP: case AB_JUMPAND: case AB_JUMPOR: case AB_CONDN: case AB_COND:
case AB_JUMP: case AB_JUMPAND: case AB_JUMPOR: case AB_JUMPNNIL: case AB_CONDN: case AB_COND:
labels[pBCC + pBCC->Par.i] = ++labeln; break;
default: break;
}
@ -2992,7 +2995,7 @@ bool C4ScriptHost::Parse()
assert(!pBCC->Par.X); fprintf(stderr, "\n"); break;
case AB_CARRAY: case AB_CPROPLIST:
fprintf(stderr, "\t%p\n", reinterpret_cast<void *>(pBCC->Par.X)); break;
case AB_JUMP: case AB_JUMPAND: case AB_JUMPOR: case AB_CONDN: case AB_COND:
case AB_JUMP: case AB_JUMPAND: case AB_JUMPOR: case AB_JUMPNNIL: case AB_CONDN: case AB_COND:
fprintf(stderr, "\t%d\n", labels[pBCC + pBCC->Par.i]); break;
default:
fprintf(stderr, "\t%d\n", pBCC->Par.i); break;

View File

@ -144,6 +144,7 @@ C4StringTable::C4StringTable()
P[P_IncineratingObj] = "IncineratingObj";
P[P_Plane] = "Plane";
P[P_Tooltip] = "Tooltip";
P[P_Placement] = "Placement";
P[DFA_WALK] = "WALK";
P[DFA_FLIGHT] = "FLIGHT";
P[DFA_KNEEL] = "KNEEL";

View File

@ -293,6 +293,7 @@ enum C4PropertyName
P_IncineratingObj,
P_Plane,
P_Tooltip,
P_Placement,
// Default Action Procedures
DFA_WALK,
DFA_FLIGHT,

View File

@ -529,6 +529,9 @@ bool C4Value::operator == (const C4Value& Value2) const
case C4V_Array:
return Type == Value2.Type &&
(Data.Array == Value2.Data.Array || *(Data.Array) == *(Value2.Data.Array));
case C4V_Function:
return Type == Value2.Type &&
Data == Value2.Data;
default:
assert(!"Unexpected C4Value type (denumeration missing?)");
return Data == Value2.Data;