diff --git a/CMakeLists.txt b/CMakeLists.txt index 00433881e..af88d163b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -407,6 +407,8 @@ set(OC_CLONK_SOURCES src/object/C4DefList.h src/object/C4GameObjects.cpp src/object/C4GameObjects.h + src/object/C4Id.cpp + src/object/C4Id.h src/object/C4IDList.cpp src/object/C4IDList.h src/object/C4InfoCore.cpp @@ -485,6 +487,8 @@ set(MAPE_BASE_SOURCES src/lib/C4NameList.h src/lib/C4Rect.cpp src/lib/C4Rect.h + src/object/C4Id.cpp + src/object/C4Id.h ) set(MAPE_SOURCES @@ -872,10 +876,10 @@ if(USE_CONSOLE) SET(HAVE_LIBREADLINE ${READLINE_FOUND} CACHE INTERNAL "libreadline available") endif() +include(FindPkgConfig) # Set GTK link directory. This needs to be done before add_executable, # otherwise the path is not used for linking clonk if(USE_GTK) - include(FindPkgConfig) if (USE_GTK3) pkg_check_modules(GTK3 REQUIRED "glib-2.0 >= 2.32" "gtk+-3.0 >= 3.4") include_directories(${GTK3_INCLUDE_DIRS}) @@ -888,7 +892,6 @@ if(USE_GTK) endif() # Try to find GTK for mape -include(FindPkgConfig) if (PKG_CONFIG_FOUND) if (USE_GTK3) pkg_check_modules(MAPE_GTK glib-2.0>=2.32 gthread-2.0 gtk+-3.0>=3.4 gtksourceview-3.0) @@ -1060,8 +1063,6 @@ src/lib/C4Real.cpp src/lib/C4Real.h src/lib/C4Random.cpp src/lib/C4Random.h -src/object/C4Id.cpp -src/object/C4Id.h src/script/C4Aul.cpp src/script/C4AulDefFunc.h src/script/C4AulExec.cpp @@ -1395,8 +1396,10 @@ if(NOT HAVE_FMOD AND NOT USE_OPEN_AL OR USE_SDL_MAINLOOP AND NOT USE_OPEN_AL) SET(HAVE_SDL ${SDL_FOUND}) if(SDL_FOUND) include_directories(${SDL_INCLUDE_DIR}) - FINDLIB(SDLMIXER_LIBRARIES SDL_mixer) - if(SDLMIXER_LIBRARIES) + pkg_check_modules(SDLMIXER "SDL_mixer") + if(SDLMIXER_FOUND) + include_directories(${SDLMIXER_INCLUDE_DIRS}) + link_directories(${SDLMIXER_LIBRARY_DIRS}) SET(HAVE_LIBSDL_MIXER ON) endif() target_link_libraries(openclonk @@ -1438,7 +1441,7 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX) include(GccPchSupport) - option(USE_GCC_PCH "Use GCC precompiled headers" ON) + option(USE_GCC_PCH "Use GCC precompiled headers" OFF) endif() if(USE_GCC_PCH) add_precompiled_header(libmisc src/C4Include.h) diff --git a/docs/de.po b/docs/de.po index 3e3129239..2de08a0db 100644 --- a/docs/de.po +++ b/docs/de.po @@ -2733,16 +2733,16 @@ msgstr "Der Wind bläst immer in die Richtung in die die Kanone geschoben wird." #: sdk/script/fn/GetPlayerControlAssignment.xml:8(category) #: sdk/script/fn/GetPlayerByName.xml:8(category) #: sdk/script/fn/GetPlayerByIndex.xml:8(category) -#: sdk/script/fn/GetHomebaseProduction.xml:8(category) -#: sdk/script/fn/GetHomebaseMaterial.xml:8(category) +#: sdk/script/fn/GetBaseProduction.xml:8(category) +#: sdk/script/fn/GetBaseMaterial.xml:8(category) #: sdk/script/fn/GetHiRank.xml:17(desc) #: sdk/script/fn/GetCrewExtraData.xml:8(category) #: sdk/script/fn/GetBase.xml:8(category) #: sdk/script/fn/EliminatePlayer.xml:8(category) #: sdk/script/fn/DoWealth.xml:8(category) #: sdk/script/fn/DoPlayerScore.xml:8(category) -#: sdk/script/fn/DoHomebaseProduction.xml:8(category) -#: sdk/script/fn/DoHomebaseMaterial.xml:8(category) +#: sdk/script/fn/DoBaseProduction.xml:8(category) +#: sdk/script/fn/DoBaseMaterial.xml:8(category) #: sdk/script/fn/CreateScriptPlayer.xml:8(category) msgid "Player" msgstr "Spieler" @@ -7043,49 +7043,49 @@ msgstr "Gibt die ID des aufrufenden Objekts zurück." msgid "Creates a duplicate of the calling object." msgstr "Erstellt ein Duplikat des aufrufenden Objekts." -#: sdk/script/fn/GetHomebaseProduction.xml:16(desc) +#: sdk/script/fn/GetBaseProduction.xml:16(desc) msgid "Number of the player whose buying options you want to determine. The first player has the player number 0." msgstr "Die Nummer des Spielers, dessen Kaufmöglichkeiten abgefragt werden sollen. Der erste Spieler hat die Nummer 0." -#: sdk/script/fn/GetHomebaseProduction.xml:21(desc) +#: sdk/script/fn/GetBaseProduction.xml:21(desc) msgid "If specified, the function returns the number of objects of the given type which are resupplied to the player's home base. In this case index and category are ignored." msgstr "Wenn angegeben, gibt die Funktion die Menge der Objekte zurück, die in der Heimatbasis des Spielers nachgeliefert wird. index und category werden hierbei ignoriert." -#: sdk/script/fn/GetHomebaseProduction.xml:27(desc) -#: sdk/script/fn/GetHomebaseMaterial.xml:27(desc) +#: sdk/script/fn/GetBaseProduction.xml:27(desc) +#: sdk/script/fn/GetBaseMaterial.xml:27(desc) msgid "List index of the buyable item to check." msgstr "Der Index der gesuchten Kaufmöglichkeit." -#: sdk/script/fn/GetHomebaseProduction.xml:33(desc) -#: sdk/script/fn/GetHomebaseMaterial.xml:33(desc) +#: sdk/script/fn/GetBaseProduction.xml:33(desc) +#: sdk/script/fn/GetBaseMaterial.xml:33(desc) msgid "Category of buyable items you want to check." msgstr "Die Kategorie der gesuchten Kaufmöglichkeit." -#: sdk/script/fn/GetHomebaseProduction.xml:38(desc) +#: sdk/script/fn/GetBaseProduction.xml:38(desc) msgid "With id specified, the function returns how quickly objects of that type are resupplied to the player's home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category in the player's resupply list. This will return all object types from the resupply list, even if they are currently not being resupplied." msgstr "Bei angegebenen id gibt die Funktion zurück, wie schnell die Menge der Objekte in der Heimatbasis des Spielers nachgeliefert wird. index und category werden hierbei ignoriert. Wird id nicht angegeben, liefert die Funktion den indizierten Objekttyp der entsprechenden Kategorie der nachgelieferten Objekte des Spielers. Der Objekttyp (id) taucht in der Liste auf und wird zurückgeliefert, selbst wenn zur Zeit keine Objekte dieses Typs nachgeliefert werden." -#: sdk/script/fn/GetHomebaseProduction.xml:42(text) +#: sdk/script/fn/GetBaseProduction.xml:42(text) msgid "Gives a flintstone to the selected clonk of the first player if currently no flintstones are resupplied to the player's home base." msgstr "Gibt dem ausgewählten Clonk des ersten Spielers einen Feuerstein, wenn in seiner Heimatbasis keine Feuersteine nachgeliefert werden." -#: sdk/script/fn/GetHomebaseMaterial.xml:16(desc) +#: sdk/script/fn/GetBaseMaterial.xml:16(desc) msgid "Number of the player whose buying options to determine." msgstr "Die Nummer des Spieler, dessen Kaufmöglichkeiten abgefragt werden sollen. Der erste Spieler hat die Nummer 0." -#: sdk/script/fn/GetHomebaseMaterial.xml:21(desc) +#: sdk/script/fn/GetBaseMaterial.xml:21(desc) msgid "If specified, the function returns the number of objects of the given type which the player can buy at his home base. In this case index and category are ignored." msgstr "Wenn angegeben, gibt die Funktion die Menge der Objekte zurück, die der Spieler in seiner Heimatbasis kaufen kann. index und category werden hierbei ignoriert." -#: sdk/script/fn/GetHomebaseMaterial.xml:38(desc) +#: sdk/script/fn/GetBaseMaterial.xml:38(desc) msgid "With id specified, the function returns the number of objects of that type which the player can buy at his home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category buyable at the players home base. This will return object types which are generally buyable, even if currently no object of that type is available." msgstr "Bei angegebenen id gibt die Funktion die Menge der Objekte zurück, die der Spieler in seiner Heimatbasis kaufen kann. index und category werden hierbei ignoriert. Wird id nicht angegeben, liefert die Funktion den indizierten Objekttyp der entsprechenden Kategorie der kaufbaren Objekte des Spielers. Der Objekttyp (id) taucht in der Liste auf und wird zurückgeliefert, selbst wenn zur Zeit keine Objekte dieses Typs verfügbar sind." -#: sdk/script/fn/GetHomebaseMaterial.xml:42(text) +#: sdk/script/fn/GetBaseMaterial.xml:42(text) msgid "Returns the number of fire stones the first player can buy." msgstr "Meldet die Anzahl Feuersteine, die sich der Erste Spieler kaufen kann (sofern er das benötigte Geld hat)" -#: sdk/script/fn/GetHomebaseMaterial.xml:45(text) +#: sdk/script/fn/GetBaseMaterial.xml:45(text) msgid "Gives the notice \"The third buyable vehicle of this player is a ...\"" msgstr "Gibt die Nachricht \"The third buyable vehicle of this player is a ...\" aus" @@ -8503,43 +8503,43 @@ msgstr "Verändert den Punktewert eines Spielers." msgid "Deducts 100 points from this player." msgstr "Zieht dem Spieler 100 Punkte ab." -#: sdk/script/fn/DoHomebaseProduction.xml:16(desc) +#: sdk/script/fn/DoBaseProduction.xml:16(desc) msgid "Number of the player whose home base resupply list you want to change." msgstr "Spielernummer des Spielers, dessen Heimatbasismaterial-Nachlieferung verändert werden soll" -#: sdk/script/fn/DoHomebaseProduction.xml:21(desc) +#: sdk/script/fn/DoBaseProduction.xml:21(desc) msgid "id of the object type you want to adjust." msgstr "ID des Objekttyps, der schneller oder langsamer nachgeliefert werden soll." -#: sdk/script/fn/DoHomebaseProduction.xml:26(desc) +#: sdk/script/fn/DoBaseProduction.xml:26(desc) msgid "Change of the resupply value (positive or negative)." msgstr "Positive oder negative Veränderung der nachgelieferten Objektmenge" -#: sdk/script/fn/DoHomebaseProduction.xml:30(desc) +#: sdk/script/fn/DoBaseProduction.xml:30(desc) msgid "Changes resupply speed of buyable objects at the home base." msgstr "Verändert die Nachlieferung von kaufbaren Objekten in der Heimatbasis." -#: sdk/script/fn/DoHomebaseProduction.xml:34(text) +#: sdk/script/fn/DoBaseProduction.xml:34(text) msgid "No more flintstones are resupplied for the first player." msgstr "Feuersteine werden für den ersten Spieler nicht mehr nachgeliefert." -#: sdk/script/fn/DoHomebaseMaterial.xml:16(desc) +#: sdk/script/fn/DoBaseMaterial.xml:16(desc) msgid "Number of the player whose home base material you want to change." msgstr "Spielernummer des Spielers, dessen Heimatbasismaterial verändert werden soll" -#: sdk/script/fn/DoHomebaseMaterial.xml:21(desc) +#: sdk/script/fn/DoBaseMaterial.xml:21(desc) msgid "id of the buyable object type you want to adjust." msgstr "ID des Objekttyps, der mehr oder weniger oft kaufbar sein soll" -#: sdk/script/fn/DoHomebaseMaterial.xml:26(desc) +#: sdk/script/fn/DoBaseMaterial.xml:26(desc) msgid "Change of the available amount (positive or negative)." msgstr "Positive oder negative Veränderung der kaufbaren Objektmenge" -#: sdk/script/fn/DoHomebaseMaterial.xml:30(desc) +#: sdk/script/fn/DoBaseMaterial.xml:30(desc) msgid "Changes availability of buyable objects at the home base." msgstr "Verändert die Kaufbarkeit von Objekten in der Heimatbasis." -#: sdk/script/fn/DoHomebaseMaterial.xml:34(text) +#: sdk/script/fn/DoBaseMaterial.xml:34(text) msgid "The player can now buy one flint more." msgstr "Der Spieler kann sich jetzt einen Flint mehr kaufen." @@ -18652,8 +18652,8 @@ msgstr "Dieses Kommandozeilen-Programm dient zum Bearbeiten von Gruppendateien. #~ msgid "BaseImage" #~ msgstr "BaseImage" -#~ msgid "HomeBaseMaterial" -#~ msgstr "HomeBaseMaterial" +#~ msgid "BaseMaterial" +#~ msgstr "BaseMaterial" #~ msgid "Vegetation" #~ msgstr "Vegetation" @@ -18883,8 +18883,8 @@ msgstr "Dieses Kommandozeilen-Programm dient zum Bearbeiten von Gruppendateien. #~ msgid "CorrosionRate" #~ msgstr "CorrosionRate" -#~ msgid "HomeBaseProduction" -#~ msgstr "HomeBaseProduction" +#~ msgid "BaseProduction" +#~ msgstr "BaseProduction" #~ msgid "Activate" #~ msgstr "Activate" diff --git a/docs/sdk/definition/properties.xml b/docs/sdk/definition/properties.xml index 0d8b5ca8d..3ce07bec5 100644 --- a/docs/sdk/definition/properties.xml +++ b/docs/sdk/definition/properties.xml @@ -134,6 +134,11 @@ Stand = { Plane int 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. + + + SolidMaskPlane + int + If the object moves and other objects are attached to its SolidMask, only objects in front of this plane are moved along with it. Defaults to Plane if zero. Placement diff --git a/docs/sdk/definition/script.xml b/docs/sdk/definition/script.xml index 2ee6f6901..1d636ab23 100644 --- a/docs/sdk/definition/script.xml +++ b/docs/sdk/definition/script.xml @@ -82,6 +82,16 @@ Put When the object puts another object into a container. + + + DigOutObject + object obj + When the object dug out another object that was stucked in solid material. + + + DugOut + object object_by + When the object was spawned from dug out material. The object might get removed afterwards if the material has Dig2ObjectCollect=2. Damage @@ -449,6 +459,11 @@ func SaveScenarioObject(props) 0 Object drawing mode (see GetObjectBlitMode and SetObjectBlitMode) + + MeshMaterial + GetID()->GetMeshMaterial() + Custom assignments of mesh materials (see GetMeshMaterial and SetMeshMaterial) + Name GetID()->GetName() diff --git a/docs/sdk/playercontrols.xml b/docs/sdk/playercontrols.xml index 1ea97470d..2bd1c0b96 100644 --- a/docs/sdk/playercontrols.xml +++ b/docs/sdk/playercontrols.xml @@ -66,6 +66,11 @@ C4ID Optional ID that is passed to the script function. See ExtraData. + + CoordinateSpace + Game, Viewport + For viewport the given coordinates are relative to the players top left corner of the window. Default ist Game. + SendCursorPos Boolean @@ -218,7 +223,7 @@ TriggerMode - bitmask + Bitmask Trigger mode of this mapping. Bitmask based on the following values: diff --git a/docs/sdk/scenario/scenario.xml b/docs/sdk/scenario/scenario.xml index a84feb004..4ec8e329b 100644 --- a/docs/sdk/scenario/scenario.xml +++ b/docs/sdk/scenario/scenario.xml @@ -161,12 +161,12 @@ Objects the player should initially be able to create. - HomeBaseMaterial + BaseMaterial ID list Materials available to buy at game start. - HomeBaseProduction + BaseProduction ID list Additional supply of materials to buy. @@ -223,7 +223,7 @@ TopOpen Integer - 0 or 1. Determines wether the top of the game world should be open. + 0, 1 or 2. Determines wether the top of the game world should be open. Values analogous to BottomOpen. LeftOpen diff --git a/docs/sdk/script/fn/C4Id.xml b/docs/sdk/script/fn/C4Id.xml deleted file mode 100644 index 7bfe55a80..000000000 --- a/docs/sdk/script/fn/C4Id.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - C4Id - Script - Strings - 5.1 OC - - id - - - string - id_string - String to be converted into an id. - - - - Converts a string into an id. - - - C4Id("Rock") - Returns the id 'Rock'. - - - - jwk2002-04 - diff --git a/docs/sdk/script/fn/DeepEqual.xml b/docs/sdk/script/fn/DeepEqual.xml new file mode 100644 index 000000000..ec7d96265 --- /dev/null +++ b/docs/sdk/script/fn/DeepEqual.xml @@ -0,0 +1,36 @@ + + + + + + DeepEqual + Script + 5.5 OC + + bool + + + any + value1 + First value for comparison. + + + any + value2 + Second value for comparison. + + + + Compares two values. Unlike the ==-operator, DeepEqual compares the elements of proplists and arrays if two non-equal proplists are passed. + + + var foo={a=1}; +var bar={a=1}; +Log("Pointer comparison: %v, deep comparison: %v", foo==bar, DeepEqual(foo, bar)); + Logs "Pointer comparison: false, deep comparison: true". + + + + Sven22014-04 + diff --git a/docs/sdk/script/fn/DoHomebaseMaterial.xml b/docs/sdk/script/fn/DoBaseMaterial.xml similarity index 75% rename from docs/sdk/script/fn/DoHomebaseMaterial.xml rename to docs/sdk/script/fn/DoBaseMaterial.xml index ceb5fdf31..9ef84fa66 100644 --- a/docs/sdk/script/fn/DoHomebaseMaterial.xml +++ b/docs/sdk/script/fn/DoBaseMaterial.xml @@ -4,7 +4,7 @@ - DoHomebaseMaterial + DoBaseMaterial Player 5.1 OC @@ -30,17 +30,19 @@ Changes availability of buyable objects at the home base. - DoHomebaseMaterial(0, Firestone, 1); + DoBaseMaterial(0, Firestone, 1); The player can now buy one flint more. - GetHomebaseMaterial - GetHomebaseProduction - DoHomebaseProduction + GetBaseMaterial + SetBaseMaterial + GetBaseProduction + DoBaseProduction + SetBaseProduction Buy Sell - Sven22001-11 + Maikel2014-04 diff --git a/docs/sdk/script/fn/DoHomebaseProduction.xml b/docs/sdk/script/fn/DoBaseProduction.xml similarity index 73% rename from docs/sdk/script/fn/DoHomebaseProduction.xml rename to docs/sdk/script/fn/DoBaseProduction.xml index 7cf3d7f50..010989267 100644 --- a/docs/sdk/script/fn/DoHomebaseProduction.xml +++ b/docs/sdk/script/fn/DoBaseProduction.xml @@ -4,7 +4,7 @@ - DoHomebaseProduction + DoBaseProduction Player 5.1 OC @@ -30,17 +30,19 @@ Changes resupply speed of buyable objects at the home base. - DoHomebaseProduction(0, Firestone, -GetHomebaseProduction(0, Firestone)); + DoBaseProduction(0, Firestone, -GetBaseProduction(0, Firestone)); No more flintstones are resupplied for the first player. - GetHomebaseProduction - DoHomebaseMaterial - GetHomebaseMaterial + GetBaseProduction + SetBaseProduction + DoBaseMaterial + GetBaseMaterial + SetBaseMaterial Buy Sell - Clonk-Karl2008-03 + Maikel2014-04 diff --git a/docs/sdk/script/fn/GetHomebaseMaterial.xml b/docs/sdk/script/fn/GetBaseMaterial.xml similarity index 83% rename from docs/sdk/script/fn/GetHomebaseMaterial.xml rename to docs/sdk/script/fn/GetBaseMaterial.xml index 8cf75ea27..5b990d6da 100644 --- a/docs/sdk/script/fn/GetHomebaseMaterial.xml +++ b/docs/sdk/script/fn/GetBaseMaterial.xml @@ -4,7 +4,7 @@ - GetHomebaseMaterial + GetBaseMaterial Player 5.1 OC @@ -38,17 +38,19 @@ With id specified, the function returns the number of objects of that type which the player can buy at his home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category buyable at the players home base. This will return object types which are generally buyable, even if currently no object of that type is available. - Log("Player %s can buy %d firestones!",GetPlayerName(0), GetHomebaseMaterial(0,Firestone)); + Log("Player %s can buy %d firestones!",GetPlayerName(0), GetBaseMaterial(0,Firestone)); Returns the number of fire stones the first player can buy. - var def = GetHomebaseMaterial(0,nil,3,C4D_Vehicle); + var def = GetBaseMaterial(0,nil,3,C4D_Vehicle); Log("The third buyable vehicle of this player is a %i",def); Gives the notice "The third buyable vehicle of this player is a ..." - DoHomebaseMaterial - GetHomebaseProduction - DoHomebaseProduction + DoBaseMaterial + SetBaseMaterial + GetBaseProduction + DoBaseProduction + SetBaseProduction C4D_All C4D_Goal C4D_Living @@ -59,5 +61,5 @@ C4D_Vehicle - Günther2002-02 + Maikel2014-04 diff --git a/docs/sdk/script/fn/GetHomebaseProduction.xml b/docs/sdk/script/fn/GetBaseProduction.xml similarity index 82% rename from docs/sdk/script/fn/GetHomebaseProduction.xml rename to docs/sdk/script/fn/GetBaseProduction.xml index a9a3a6c57..5146f3d65 100644 --- a/docs/sdk/script/fn/GetHomebaseProduction.xml +++ b/docs/sdk/script/fn/GetBaseProduction.xml @@ -4,7 +4,7 @@ - GetHomebaseProduction + GetBaseProduction Player 5.1 OC @@ -38,14 +38,16 @@ With id specified, the function returns how quickly objects of that type are resupplied to the player's home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category in the player's resupply list. This will return all object types from the resupply list, even if they are currently not being resupplied. - if(!GetHomebaseProduction(0, Firestone)) GetCursor(0)->CreateContents(Firestone); + if(!GetBaseProduction(0, Firestone)) GetCursor(0)->CreateContents(Firestone); Gives a flintstone to the selected clonk of the first player if currently no flintstones are resupplied to the player's home base. - GetHomebaseMaterial - DoHomebaseMaterial - DoHomebaseProduction + GetBaseMaterial + DoBaseMaterial + SetBaseMaterial + DoBaseProduction + SetBaseProduction C4D_All C4D_Goal C4D_Living @@ -56,5 +58,5 @@ C4D_Vehicle - Clonk-Karl2008-03 + Maikel2014-04 diff --git a/docs/sdk/script/fn/GetDefinition.xml b/docs/sdk/script/fn/GetDefinition.xml index f0a66cfc2..c19607ac1 100644 --- a/docs/sdk/script/fn/GetDefinition.xml +++ b/docs/sdk/script/fn/GetDefinition.xml @@ -33,7 +33,7 @@ var spawn_weapon = weapon_list[Random(GetLength - GetHomebaseMaterial + GetBaseMaterial GetPlrKnowledge C4D_Goal C4D_Living diff --git a/docs/sdk/script/fn/GetLeagueProgressData.xml b/docs/sdk/script/fn/GetLeagueProgressData.xml new file mode 100644 index 000000000..71efbc218 --- /dev/null +++ b/docs/sdk/script/fn/GetLeagueProgressData.xml @@ -0,0 +1,25 @@ + + + + + + GetLeagueProgressData + Network + League + 5.5 OC + + string + + + int + player_id + ID of player whose progress data shall be returned. Use GetPlayerID() to get the ID of a joined player. + + + + Gets the league progress data. See SetLeagueProgressData for more information. + SetLeagueProgressDataGetLeagueScore + + Sven22014-04 + diff --git a/docs/sdk/script/fn/GetLeagueScore.xml b/docs/sdk/script/fn/GetLeagueScore.xml new file mode 100644 index 000000000..0a3e17676 --- /dev/null +++ b/docs/sdk/script/fn/GetLeagueScore.xml @@ -0,0 +1,27 @@ + + + + + + GetLeagueScore + Network + League + 5.5 OC + + int + + + int + player_id + ID of player whose score shall shall be returned. + + + + + Returns the league score of the given player. This function can be used for custom scoring e.g. in competition leagues. + Use GetPlayerID() to get the ID of a joined player. + GetLeagueProgressDataSetLeaguePerformance + + Sven22014-04 + diff --git a/docs/sdk/script/fn/GetMeshMaterial.xml b/docs/sdk/script/fn/GetMeshMaterial.xml index 909223127..90267953a 100644 --- a/docs/sdk/script/fn/GetMeshMaterial.xml +++ b/docs/sdk/script/fn/GetMeshMaterial.xml @@ -19,7 +19,7 @@ - Returns the material currently set for the calling object. + Returns the material currently set for the calling object. May also be called from definition context to return the default material of the graphics of this definition. if(GetMeshMaterial() == "Clonk_Body") @@ -28,8 +28,14 @@ else SetMeshMaterial("Clonk_Body"); If a clonk has its eyes open then this script makes it close them, otherwise they are opened. + + for (var i=0,mat; mat=GetID()->GetMeshMaterial(i); ++i) + SetMeshMaterial(mat, i); + Resets the mesh material of all submeshes of this object to their respective defaults. + SetMeshMaterial Clonk-Karl2010-04 + Sven22014-04 diff --git a/docs/sdk/script/fn/LogCallStack.xml b/docs/sdk/script/fn/LogCallStack.xml new file mode 100644 index 000000000..a6c8970d0 --- /dev/null +++ b/docs/sdk/script/fn/LogCallStack.xml @@ -0,0 +1,30 @@ + + + + + + LogCallStack + Developer + 5.3 OC + + bool + + Prints out the current call stack without breaking execution flow. + + + func Destruction() +{ + Log("Destruction of %v!", GetID()); + LogCallStack(); + return _inherited(...); +} + Helper function during development: When this object gets destructed, a call stack is printed. This may be useful to find out where a particular object removal call was coming from. + + + + FatalError + + + Sven22014-01 + diff --git a/docs/sdk/script/fn/PathFree.xml b/docs/sdk/script/fn/PathFree.xml index 9e6135f8b..84680a36a 100644 --- a/docs/sdk/script/fn/PathFree.xml +++ b/docs/sdk/script/fn/PathFree.xml @@ -50,6 +50,7 @@ for(var living in FindObjects(Find_OCF GetMaterial GBackSolid GetPathLength + PathFree2 Sven22002-08 diff --git a/docs/sdk/script/fn/PathFree2.xml b/docs/sdk/script/fn/PathFree2.xml new file mode 100644 index 000000000..485427317 --- /dev/null +++ b/docs/sdk/script/fn/PathFree2.xml @@ -0,0 +1,55 @@ + + + + + + PathFree2 + Landscape + 5.1 OC + + array + + + int + x1 + X coordinate of the start point + + + int + y1 + Y coordinate of the start point + + + int + x2 + X coordinate of the end point + + + int + y2 + Y coordinate of the end point + + + + Works like PathFree, but instead returns an array containing the coordinates of the first solid pixel found on line. Returns nil if the path is free. + All coordinates are global, even in local calls. + + + var x = Random(LandscapeWidth()), + pos = PathFree2(x, 0, x, LandscapeHeight()); +if(pos) + CreateObject(Idol, pos[0], pos[1]); + + Creates an Idol somewhere on the surface of the landscape. + + + + GetMaterial + GBackSolid + GetPathLength + PathFree + + + Apfelclonk2014-04 + diff --git a/docs/sdk/script/fn/SetBaseMaterial.xml b/docs/sdk/script/fn/SetBaseMaterial.xml new file mode 100644 index 000000000..fcec60107 --- /dev/null +++ b/docs/sdk/script/fn/SetBaseMaterial.xml @@ -0,0 +1,48 @@ + + + + + + SetBaseMaterial + Player + 5.1 OC + + bool + + + int + player + Number of the player whose home base material you want to set. + + + id + definition + id of the buyable object type you want to adjust. + + + int + cnt + Set the available amount (positive). + + + + Sets the availability of buyable objects at the home base. + + + SetBaseMaterial(0, Firestone, 10); + The first player can now buy ten flints. + + + + GetBaseMaterial + DoBaseMaterial + GetBaseProduction + SetBaseProduction + DoBaseProduction + Buy + Sell + + + Maikel2014-04 + diff --git a/docs/sdk/script/fn/SetBaseProduction.xml b/docs/sdk/script/fn/SetBaseProduction.xml new file mode 100644 index 000000000..b9ca948d1 --- /dev/null +++ b/docs/sdk/script/fn/SetBaseProduction.xml @@ -0,0 +1,48 @@ + + + + + + SetBaseProduction + Player + 5.1 OC + + bool + + + int + player + Number of the player whose home base resupply list you want to set. + + + id + type + id of the object type you want to adjust. + + + int + cnt + Set the resupply value (positive). + + + + Sets resupply speed of buyable objects at the home base. + + + SetBaseProduction(0, Firestone, 0); + No more flintstones are resupplied for the first player. + + + + GetBaseProduction + DoBaseProduction + DoBaseMaterial + SetBaseMaterial + GetBaseMaterial + Buy + Sell + + + Maikel2014-04 + diff --git a/docs/sdk/script/fn/SetLeaguePerformance.xml b/docs/sdk/script/fn/SetLeaguePerformance.xml new file mode 100644 index 000000000..26c431686 --- /dev/null +++ b/docs/sdk/script/fn/SetLeaguePerformance.xml @@ -0,0 +1,52 @@ + + + + + + SetLeaguePerformance + Network + League + 5.5 OC + + bool + + + int + score + New player or scenario score + + + int + player_id + ID of player whose score shall be set. If not given, global performance for all players is set. + + + + + Sets the league score. This function can be used for custom scenario scoring in competition or adventure leagues. + Use GetPlayerID() to get the ID of a joined player. + + + #appendto Rock +static g_rocks_collected; + +func Entrance(clonk) +{ + var plr = clonk->GetController(); + if (clonk->GetID() == Clonk && plr != NO_OWNER) + { + ++g_rocks_collected; + Log("%s found a rock! Score: %d", GetTaggedPlayerName(plr), g_rocks_collected); + SetLeaguePerformance(g_rocks_collected); + return RemoveObject(); + } + return _inherited(clonk, ...); +} + Rock script modification: Whenever a rock is collected by a Clonk, the score of all players is increased. + + + SetLeagueProgressDataGetLeagueScore + + Sven22014-04 + diff --git a/docs/sdk/script/fn/SetLeagueProgressData.xml b/docs/sdk/script/fn/SetLeagueProgressData.xml new file mode 100644 index 000000000..64da0e6ce --- /dev/null +++ b/docs/sdk/script/fn/SetLeagueProgressData.xml @@ -0,0 +1,56 @@ + + + + + + SetLeagueProgressData + Network + League + 5.5 OC + + bool + + + string + new_data + New data string for this player in this scenario. + + + int + player_id + ID of player whose progress data shall be set. Use GetPlayerID() to get the ID of a joined player. + + + + Sets the league progress data. This function can be used to store a per-scenario per-user data string in the league. The function is available for both melee and custom settlement leagues. The data is stored between league games and can later be retrieved using GetLeagueProgressData(). + Each scenario may store up to 2048 characters. The string may only contain alphanumeric characters plus space (" ") and underscore ("_"). Invalid characters will be removed by the league and not returned when GetLeagueProgressData is called after the next scenario start. + + + func SetLeagueProgressScore(int plr, int new_progress) +{ + // Safety: Valid players only + var plrid = GetPlayerID(plr); + if (!plrid) return; + // Progress must be between 0 and 25 + new_progress = BoundBy(new_progress, 0, 25); + // Get old progress from previous round + var progress_string = GetLeagueProgressData(plrid); + if (progress_string && GetLength(progress_string)) + { + var old_progress = GetChar(progress_string)-GetChar("A"); + // If old progress was better than new progress, keep old progress + new_progress = Max(old_progress, new_progress); + } + // Set new progress + SetLeagueProgressData(Format("%c", GetChar("A") + new_progress)); + SetLeaguePerformance(new_progress); + return true; +} + Helper script for a scenario that is using custom scoring in the league. LeagueProgressData is used to remember the last progress and ensure that progress never decreases. + + + GetLeagueProgressDataSetLeaguePerformance + + Sven22014-04 + diff --git a/docs/sdk/script/fn/SetPlayerZoom.xml b/docs/sdk/script/fn/SetPlayerZoom.xml new file mode 100644 index 000000000..31ea5ff45 --- /dev/null +++ b/docs/sdk/script/fn/SetPlayerZoom.xml @@ -0,0 +1,86 @@ + + + + + + SetPlayerZoom + Player + View + 5.5 OC + + bool + + + int + player + Player whose zoom or zoom limits are to be adjusted. NO_OWNER for all players. + + + int + zoom + New zoom factor. A factor of zero disables direct zoom definition and reverts to the default method of calculating zoom by view range. + + + int + precision + Value by which zoom is divided to achieve fractional numbers. + + + + int + flags + Flags controlling function behaviour: + + + Flag + Description + + + PLRZOOM_Direct + The zoom does not scroll slowly towards the new value, but is set directly. + + + PLRZOOM_NoIncrease + The new zoom is only to be set if it is smaller than the current value. + + + PLRZOOM_NoDecrease + The new zoom is only to be set if it is greater than the current value. + + + PLRZOOM_LimitMin + Set the minimum limit for zooming. The player cannot zoom out further than this. + + + PLRZOOM_LimitMax + Set the maximum limit for zooming. The player cannot zoom in further than this. + +
+
+ +
+
+ Changes zoom or zoom limits vor all viewports of a player to direct values. + Setting zoom to a direct value causes the game to look different depending on which screen resolution the player has configured. Use this function only if you want to achieve direct pixel correspondance between the game world and the screen, e.g. because your scenario provides low resolution graphics only or because your scenario should be played in certain screen resolutions only. Regular scenarios should use SetPlayerZoomByViewRange to achieve visuals whcih are independent of the player's monitor size. + + + func InitializePlayer(int plr) +{ + SetPlayerZoom(plr, 1,1, PLRZOOM_LimitMin | PLRZOOM_LimitMax); + SetPlayerViewLock(plr, true); + return true; +} + Code for a scenario script: The zoom is fixed to 1, i.e. one landscape pixel corresponds to one pixel on the screen. Zooming in or out is not possible. + + + + SetPlayerZoomByViewRange + SetPlayerViewLock + SetPlrView + SetPlrViewRange + SetFoW + +
+ Sven22010-09 +
diff --git a/docs/sdk/script/fn/SetPlayerZoomByViewRange.xml b/docs/sdk/script/fn/SetPlayerZoomByViewRange.xml index 5f870e417..6ca4eb0d0 100644 --- a/docs/sdk/script/fn/SetPlayerZoomByViewRange.xml +++ b/docs/sdk/script/fn/SetPlayerZoomByViewRange.xml @@ -60,7 +60,7 @@ - Disabled or enabled locked view for one or all players. If the view is locked, the player cannot scroll around to explore the map. + Adjusts the zoom or zoom limit of all viewports of a player. func InitializePlayer(int plr) @@ -74,6 +74,7 @@ + SetPlayerZoom SetPlayerViewLock SetPlrView SetPlrViewRange diff --git a/docs/sdk/script/operatoren.xml b/docs/sdk/script/operatoren.xml index 46fce6bb9..9d4b034d6 100644 --- a/docs/sdk/script/operatoren.xml +++ b/docs/sdk/script/operatoren.xml @@ -162,28 +162,14 @@ 9l == - Returns whether a equals b. + Returns whether a equals b. For proplists and arrays, pointers are compared. Use DeepEqual to compare contents. postfix bool, any/any 9l != - Returns whether a is unequal to b. - postfix - bool, any/any - - - 9l - === - Returns whether a and b refer to the same thing. - postfix - bool, any/any - - - 9l - !== - Returns whether a and b do not refer to the same thing. + Returns whether a is unequal to b. For proplists and arrays, pointers are compared. Use !DeepEqual to compare contents. postfix bool, any/any diff --git a/masterserver/web/server/index.php b/masterserver/web/server/index.php index 111657a78..065d20eca 100644 --- a/masterserver/web/server/index.php +++ b/masterserver/web/server/index.php @@ -39,16 +39,13 @@ if ($link && $db) { die(); } $server->cleanUp(true); //Cleanup old stuff - - // register new release if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'release-file') { try { registerRelease(); } catch(Exception $e) { C4Network::sendAnswer(C4Network::createError($e->getMessage())); } - // prepare data for the engine - } else if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) { + } else if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) { //data sent from engine? $input = $GLOBALS['HTTP_RAW_POST_DATA']; $action = ParseINI::parseValue('Action', $input); $csid = ParseINI::parseValue('CSID', $input); @@ -59,17 +56,17 @@ if ($link && $db) { switch ($action) { case 'Start': //start a new round if (ParseINI::parseValue('LeagueAddress', $reference)) { - C4Network::sendAnswer(C4Network::createError('IDS_MSG_LEAGUENOTSUPPORTED')); + C4Network::sendAnswer(C4Network::createError('League not supported!')); } else { $csid = $server->addReference($reference); if ($csid) { $answer = array('Status' => 'Success', 'CSID' => $csid); if(!testHostConn($input)) - $answer['Message'] = 'IDS_MSG_MASTERSERVNATERROR'; + $answer['Message'] = 'Your network failed to pass certain tests. It is unlikely that are you able to host for the public.|To fix that, you need port forwarding in your router.'; C4Network::sendAnswer(C4Network::createAnswer($answer)); unset($answer); } else { - C4Network::sendAnswer(C4Network::createError('IDS_MSG_MATERSERVSIGNUPFAIL')); + C4Network::sendAnswer(C4Network::createError('Round signup failed. (To many tries?)')); } } break; @@ -77,26 +74,26 @@ if ($link && $db) { if ($server->updateReference($csid, $reference)) { C4Network::sendAnswer(C4Network::createAnswer(array('Status' => 'Success'))); } else { - C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVUPDATEFAIL')); + C4Network::sendAnswer(C4Network::createError('Round update failed.')); } break; case 'End': //remove a round if ($server->removeReference($csid)) { C4Network::sendAnswer(C4Network::createAnswer(array('Status' => 'Success'))); } else { - C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVENDFAIL')); + C4Network::sendAnswer(C4Network::createError('Round end failed.')); } break; default: if (!empty($action)) { - C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVNOOP')); + C4Network::sendAnswer(C4Network::createError('Unknown action.')); } else { - C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVNOOP')); + C4Network::sendAnswer(C4Network::createError('No action defined.')); } break; } } else { - C4Network::sendAnswer(C4Network::createError('IDS_MSG_MASTERSERVWRONGENGINE')); + C4Network::sendAnswer(C4Network::createError('Wrong engine, "' . ParseINI::parseValue('Game', $input) . '" expected.')); } } else { //list availabe games $list = array(); diff --git a/planet/Arena.ocf/Hideout.ocs/Flag.ocd/FlagAmetyst.png b/planet/Arena.ocf/Hideout.ocs/Flag.ocd/FlagAmethyst.png similarity index 100% rename from planet/Arena.ocf/Hideout.ocs/Flag.ocd/FlagAmetyst.png rename to planet/Arena.ocf/Hideout.ocs/Flag.ocd/FlagAmethyst.png diff --git a/planet/Arena.ocf/Hideout.ocs/Flag.ocd/Scene.material b/planet/Arena.ocf/Hideout.ocs/Flag.ocd/Scene.material index aca1c5441..10af7627d 100644 --- a/planet/Arena.ocf/Hideout.ocs/Flag.ocd/Scene.material +++ b/planet/Arena.ocf/Hideout.ocs/Flag.ocd/Scene.material @@ -36,7 +36,7 @@ material FlagRight scene_blend alpha_blend texture_unit { - texture FlagAmetyst.png + texture FlagAmethyst.png tex_address_mode wrap filtering trilinear } diff --git a/planet/Arena.ocf/Hideout.ocs/Material.ocg/Ametyst.jpg b/planet/Arena.ocf/Hideout.ocs/Material.ocg/Amethyst.jpg similarity index 100% rename from planet/Arena.ocf/Hideout.ocs/Material.ocg/Ametyst.jpg rename to planet/Arena.ocf/Hideout.ocs/Material.ocg/Amethyst.jpg diff --git a/planet/Arena.ocf/Hideout.ocs/Material.ocg/Amethyst.ocm b/planet/Arena.ocf/Hideout.ocs/Material.ocg/Amethyst.ocm new file mode 100644 index 000000000..50c9bf1c5 --- /dev/null +++ b/planet/Arena.ocf/Hideout.ocs/Material.ocg/Amethyst.ocm @@ -0,0 +1,15 @@ +[Material] +Name=Amethyst +Shape=Rough +Density=70 +Friction=15 +BlastFree=1 +<<<<<<< HEAD:planet/Arena.ocf/Hideout.ocs/Material.ocg/Ametyst.ocm +Blast2Object=Chunk_Ice +======= +>>>>>>> remotes/origin/master:planet/Arena.ocf/Hideout.ocs/Material.ocg/Amethyst.ocm +MaxAirSpeed=100 +MaxSlide=1 +Corrode=60 +Placement=21 +TextureOverlay=Amethyst diff --git a/planet/Arena.ocf/Hideout.ocs/Material.ocg/Ametyst.ocm b/planet/Arena.ocf/Hideout.ocs/Material.ocg/Ametyst.ocm deleted file mode 100644 index b669b2f14..000000000 --- a/planet/Arena.ocf/Hideout.ocs/Material.ocg/Ametyst.ocm +++ /dev/null @@ -1,12 +0,0 @@ -[Material] -Name=Ametyst -Shape=Rough -Density=70 -Friction=15 -BlastFree=1 -Blast2Object=Chunk_Ice -MaxAirSpeed=100 -MaxSlide=1 -Corrode=60 -Placement=21 -TextureOverlay=Ametyst diff --git a/planet/Arena.ocf/Hideout.ocs/Material.ocg/Ruby.ocm b/planet/Arena.ocf/Hideout.ocs/Material.ocg/Ruby.ocm index bf3a909b6..fed49e9b6 100644 --- a/planet/Arena.ocf/Hideout.ocs/Material.ocg/Ruby.ocm +++ b/planet/Arena.ocf/Hideout.ocs/Material.ocg/Ruby.ocm @@ -4,7 +4,10 @@ Shape=Rough Density=70 Friction=15 BlastFree=1 +<<<<<<< HEAD Blast2Object=Chunk_Ice +======= +>>>>>>> remotes/origin/master MaxAirSpeed=100 MaxSlide=1 Corrode=60 diff --git a/planet/Arena.ocf/Hideout.ocs/Material.ocg/TEXMAP.TXT b/planet/Arena.ocf/Hideout.ocs/Material.ocg/TEXMAP.TXT index 22b499c87..8698fd46d 100644 --- a/planet/Arena.ocf/Hideout.ocs/Material.ocg/TEXMAP.TXT +++ b/planet/Arena.ocf/Hideout.ocs/Material.ocg/TEXMAP.TXT @@ -58,7 +58,7 @@ OverloadTextures 65=Ruby-Ruby 66=Ice-ice2 -67=Ametyst-Ametyst +67=Amethyst-Amethyst 68=Ice-ice3 70=Snow-snow1 diff --git a/planet/Arena.ocf/Hideout.ocs/StringTblUS.txt b/planet/Arena.ocf/Hideout.ocs/StringTblUS.txt index 341b17f01..e1c05102f 100644 --- a/planet/Arena.ocf/Hideout.ocs/StringTblUS.txt +++ b/planet/Arena.ocf/Hideout.ocs/StringTblUS.txt @@ -1,2 +1,2 @@ NameLeft=Team Ruby -NameRight=Team Ametyst \ No newline at end of file +NameRight=Team Amethyst \ No newline at end of file diff --git a/planet/Decoration.ocd/Info.txt b/planet/Decoration.ocd/Info.txt new file mode 100644 index 000000000..ac6324907 --- /dev/null +++ b/planet/Decoration.ocd/Info.txt @@ -0,0 +1,15 @@ +[Developer/Maintainer] +Maikel + +[Folder Information] +This folder contains objects with decorative purposes only. + +[Information for developers] +In this folder you should add objects which have a decorative purpose, this does not mean they cannot have +any interactions whatsoever. However, these objects do not play any role in the normal Objects.ocd and do +not depend on any other objects (under ideal circumstances). Please make sure you give your object a unique +identifier and place it in the most fitting sub folder of Decoration.ocd or create a new sub folder if +there is need for that. + +If you want to contribute to this folder feel free to do so and in case of questions contact the maintainer +in IRC or the forum. \ No newline at end of file diff --git a/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/DefCore.txt b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/DefCore.txt new file mode 100644 index 000000000..e79469361 --- /dev/null +++ b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/DefCore.txt @@ -0,0 +1,13 @@ +[DefCore] +id=StrawMan +Version=5,4,0,0 +Category=C4D_StaticBack +Width=12 +Height=20 +Offset=-6,-10 +Vertices=5 +VertexX=0,0,-4,4 +VertexY=-9,9,-2,-2 +VertexFriction=50,50,50,50 +Mass=15 +Rotate=1 diff --git a/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Graphics.mesh b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Graphics.mesh new file mode 100644 index 000000000..97090840a Binary files /dev/null and b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Graphics.mesh differ diff --git a/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Scene.material b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Scene.material new file mode 100644 index 000000000..500d24f46 --- /dev/null +++ b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Scene.material @@ -0,0 +1,22 @@ +material Strawman +{ + receive_shadows on + technique + { + pass + { + scene_blend alpha_blend + cull_hardware none + ambient 1.000000 1.000000 1.000000 1.000000 + diffuse 0.800000 0.800000 0.800000 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 12.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + texture_unit + { + texture strawman.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Script.c b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Script.c new file mode 100644 index 000000000..58eeebe30 --- /dev/null +++ b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Script.c @@ -0,0 +1,66 @@ +/** + Straw man + Clonk sized puppet that bursts if: + * struck by a weapon (sword, axe) + * hit by a projectile + * hit by a shockwave + Also incinerates on contact and blasts. + + @author Ringwall, Maikel +*/ + + +protected func Initialize() +{ + // Position straw man facing screen plus deviations around y-axis. + SetProperty("MeshTransformation", Trans_Rotate(30 + Random(76), 0, 1, 0)); + return; +} + +// Create straw particles and remove object when burst. +public func Burst() +{ + CreateParticle("Straw", 0, 0, PV_Random(-30, 30), PV_Random(-30, 30), PV_Random(30, 120), Particles_Straw(), 200); + return RemoveObject(); +} + +// Receptive to projectiles. +public func IsProjectileTarget() { return true; } + +// Burst on projectile hits. +public func OnProjectileHit() +{ + Burst(); +} + +// Burst on punching damage: sword or axe. +// Remove object after con < 30 from fire damage. +public func Damage(int change, int type) +{ + if (type == FX_Call_EngGetPunched) + return Burst(); + if (type == FX_Call_DmgFire && GetCon() < 30) + { + CastPXS("Ashes", 20, 15); + return RemoveObject(); + } +} + +// Receptive to shockwaves. +public func CanBeHitByShockwaves() { return true; } + +// Burst on shockwaves. +public func OnShockwaveHit(int level, int x, int y) +{ + Burst(); + return true; +} + + +/*-- Properties --*/ + +local Name = "$Name$"; +local Description = "$Description$"; +local Plane = 300; +local BlastIncinerate = 1; +local ContactIncinerate = 2; diff --git a/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/StringTblDE.txt b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/StringTblDE.txt new file mode 100644 index 000000000..a4b1e2fca --- /dev/null +++ b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/StringTblDE.txt @@ -0,0 +1,2 @@ +Name=Strohmann +Description=Straw puppet that may scare birds from your fields. \ No newline at end of file diff --git a/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/StringTblUS.txt b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/StringTblUS.txt new file mode 100644 index 000000000..8d5f11cb4 --- /dev/null +++ b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/StringTblUS.txt @@ -0,0 +1,2 @@ +Name=Straw man +Description=Straw puppet that may scare birds from your fields. \ No newline at end of file diff --git a/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Target.skeleton b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Target.skeleton new file mode 100644 index 000000000..00f709d3a Binary files /dev/null and b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/Target.skeleton differ diff --git a/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/strawman.png b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/strawman.png new file mode 100644 index 000000000..c885a392c Binary files /dev/null and b/planet/Decoration.ocd/Misc.ocd/StrawMan.ocd/strawman.png differ diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/DefCore.txt b/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/DefCore.txt similarity index 74% rename from planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/DefCore.txt rename to planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/DefCore.txt index b9bbbc898..7e7be612b 100644 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/DefCore.txt +++ b/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/DefCore.txt @@ -1,6 +1,6 @@ [DefCore] -id=Ruin3 -Version=5,2,90,21 +id=Ruin_ChemicalLab +Version=5,4,0,0 Category=C4D_Structure Width=50 Height=52 @@ -9,6 +9,4 @@ Vertices=6 VertexX=-1,10,20,-23,-23,0 VertexY=-17,-25,-14,25,25,25 VertexFriction=50,50,50,100,100,100 -Value=20 Mass=500 -Components=Wood=3;Metal=3 diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/Graphics.3.png b/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/Graphics.3.png similarity index 100% rename from planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/Graphics.3.png rename to planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/Graphics.3.png diff --git a/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/Script.c b/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/Script.c new file mode 100644 index 000000000..6b88e6543 --- /dev/null +++ b/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/Script.c @@ -0,0 +1,13 @@ +/** + ChemicalLab Ruin + + @author Sven2 +*/ + + +/*-- Properties --*/ + +local Name = "$Name$"; +local Description = "$Description$"; +local BlastIncinerate = 100; +local HitPoints = 70; \ No newline at end of file diff --git a/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/StringTblDE.txt b/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/StringTblDE.txt new file mode 100644 index 000000000..3b2acb4da --- /dev/null +++ b/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/StringTblDE.txt @@ -0,0 +1,2 @@ +Name=Chemielabor Ruine +Description=Relikt vergangener Siedlungen. \ No newline at end of file diff --git a/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/StringTblUS.txt b/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/StringTblUS.txt new file mode 100644 index 000000000..e8967cf65 --- /dev/null +++ b/planet/Decoration.ocd/Structures.ocd/RuinChemicalLab.ocd/StringTblUS.txt @@ -0,0 +1,2 @@ +Name==Chemical lab ruin +Description=Relic of past settlements. \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/DefCore.txt b/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/DefCore.txt similarity index 70% rename from planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/DefCore.txt rename to planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/DefCore.txt index c7ceb6bd5..78cb1418d 100644 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/DefCore.txt +++ b/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/DefCore.txt @@ -1,6 +1,6 @@ [DefCore] -id=Ruin2 -Version=5,2,0,1 +id=Ruin_Windmill +Version=5,4,0,0 Category=C4D_Structure Width=80 Height=96 @@ -9,6 +9,4 @@ Vertices=5 VertexX=0,25,15,-15,-25 VertexY=-10,-20,47,47,-20 VertexFriction=50,50,100,100,50 -Value=5 -Mass=100 -Components=Rock=6;Wood=2; +Mass=500 diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/Graphics.3.png b/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/Graphics.3.png similarity index 100% rename from planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/Graphics.3.png rename to planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/Graphics.3.png diff --git a/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/Script.c b/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/Script.c new file mode 100644 index 000000000..61eaa9958 --- /dev/null +++ b/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/Script.c @@ -0,0 +1,13 @@ +/** + Windmill Ruin + + @author Sven2 +*/ + + +/*-- Properties --*/ + +local Name = "$Name$"; +local Description = "$Description$"; +local BlastIncinerate = 100; +local HitPoints = 70; \ No newline at end of file diff --git a/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/StringTblDE.txt b/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/StringTblDE.txt new file mode 100644 index 000000000..08b410ee8 --- /dev/null +++ b/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/StringTblDE.txt @@ -0,0 +1,2 @@ +Name=Windmühle Ruine +Description=Relikt vergangener Siedlungen. \ No newline at end of file diff --git a/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/StringTblUS.txt b/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/StringTblUS.txt new file mode 100644 index 000000000..81ba2e2cc --- /dev/null +++ b/planet/Decoration.ocd/Structures.ocd/RuinWindmill.ocd/StringTblUS.txt @@ -0,0 +1,2 @@ +Name=Windmill ruin +Description=Relic of past settlements. \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/DefCore.txt b/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/DefCore.txt similarity index 76% rename from planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/DefCore.txt rename to planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/DefCore.txt index b20f0c2da..cf649e514 100644 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/DefCore.txt +++ b/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/DefCore.txt @@ -1,6 +1,6 @@ [DefCore] -id=Ruin1 -Version=5,2,0,1 +id=Ruin_WoodenCabin +Version=5,4,0,0 Category=C4D_Structure Width=94 Height=43 @@ -9,7 +9,5 @@ Vertices=7 VertexX=-26,26,-22,23,-38,-38,40 VertexY=-7,-6,19,19,4,19,19 VertexFriction=50,50,100,100 -Value=20 Mass=1000 -Components=Wood=5;Rock=4 Rotate=1 diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/Graphics.3.png b/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/Graphics.3.png similarity index 100% rename from planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/Graphics.3.png rename to planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/Graphics.3.png diff --git a/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/Script.c b/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/Script.c new file mode 100644 index 000000000..b31bb1a2c --- /dev/null +++ b/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/Script.c @@ -0,0 +1,13 @@ +/** + WoodenCabin Ruin + + @author Sven2 +*/ + + +/*-- Properties --*/ + +local Name = "$Name$"; +local Description = "$Description$"; +local BlastIncinerate = 100; +local HitPoints = 70; \ No newline at end of file diff --git a/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/StringTblDE.txt b/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/StringTblDE.txt new file mode 100644 index 000000000..6925f5e57 --- /dev/null +++ b/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/StringTblDE.txt @@ -0,0 +1,2 @@ +Name=Holzhütte Ruine +Description=Relikt vergangener Siedlungen. \ No newline at end of file diff --git a/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/StringTblUS.txt b/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/StringTblUS.txt new file mode 100644 index 000000000..6da7a74b7 --- /dev/null +++ b/planet/Decoration.ocd/Structures.ocd/RuinWoodenCabin.ocd/StringTblUS.txt @@ -0,0 +1,2 @@ +Name=Wooden cabin ruin +Description=Relic of past settlements. \ No newline at end of file diff --git a/planet/Missions.ocf/AcidDrilling.ocs/Scenario.txt b/planet/Missions.ocf/AcidDrilling.ocs/Scenario.txt index 603f030be..ebc2bda9f 100644 --- a/planet/Missions.ocf/AcidDrilling.ocs/Scenario.txt +++ b/planet/Missions.ocf/AcidDrilling.ocs/Scenario.txt @@ -14,6 +14,7 @@ Rules=Rule_TeamAccount=1;Rule_BuyAtFlagpole=1; [Player1] Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;GrapleBow=1;InventorsLab=1;Lorry=1;RopeLadder=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50 HomeBaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50 @@ -35,6 +36,29 @@ Crew=Clonk=2 Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;GrapleBow=1;InventorsLab=1;Lorry=1;RopeLadder=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50 HomeBaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50 +======= +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;GrapleBow=1;InventorsLab=1;Lorry=1;RopeLadder=1 +BaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50 +BaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50 + +[Player2] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;GrapleBow=1;InventorsLab=1;Lorry=1;RopeLadder=1 +BaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50 +BaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50 + +[Player3] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;GrapleBow=1;InventorsLab=1;Lorry=1;RopeLadder=1 +BaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50 +BaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50 + +[Player4] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;GrapleBow=1;InventorsLab=1;Lorry=1;RopeLadder=1 +BaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50 +BaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50 +>>>>>>> remotes/origin/master [Landscape] Sky=Clouds1 diff --git a/planet/Missions.ocf/DarkCastle.ocs/Objects.c b/planet/Missions.ocf/DarkCastle.ocs/Objects.c index 7aa19f56f..5ea8dc38d 100644 --- a/planet/Missions.ocf/DarkCastle.ocs/Objects.c +++ b/planet/Missions.ocf/DarkCastle.ocs/Objects.c @@ -228,15 +228,15 @@ func InitializeObjects() EnvPack_Candle_Shine0102->SetClrModulation(0xddffffff); EnvPack_Candle_Shine0102->SetObjectBlitMode(GFX_BLIT_Additive); - g_ruin1 = CreateObject(Ruin1, 97, 1179); + g_ruin1 = CreateObject(Ruin_WoodenCabin, 97, 1179); g_ruin1->SetR(16); g_ruin1.StaticSaveVar = "g_ruin1"; g_ruin1->SetPosition(97, 1150); - g_ruin2 = CreateObject(Ruin2, 353, 1145); + g_ruin2 = CreateObject(Ruin_Windmill, 353, 1145); g_ruin2.StaticSaveVar = "g_ruin2"; - g_ruin3 = CreateObject(Ruin3, 267, 1180); + g_ruin3 = CreateObject(Ruin_ChemicalLab, 267, 1180); g_ruin3.StaticSaveVar = "g_ruin3"; CreateObject(Foundry, 238, 1287); diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/Script.c b/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/Script.c deleted file mode 100644 index 5b1f4c508..000000000 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/Script.c +++ /dev/null @@ -1,6 +0,0 @@ -/*-- Ruin --*/ - -local Name = "$Name$"; -local Description ="$Description$"; -local BlastIncinerate = 100; -local HitPoints = 70; \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/StringTblDE.txt b/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/StringTblDE.txt deleted file mode 100644 index 293fcaa2a..000000000 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/StringTblDE.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name=Ruine -Description=Relikt vergangener Siedlungen. \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/StringTblUS.txt b/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/StringTblUS.txt deleted file mode 100644 index a402dc94c..000000000 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin1.ocd/StringTblUS.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name=Ruin -Description=Relic of past settlements. \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/Script.c b/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/Script.c deleted file mode 100644 index 5b1f4c508..000000000 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/Script.c +++ /dev/null @@ -1,6 +0,0 @@ -/*-- Ruin --*/ - -local Name = "$Name$"; -local Description ="$Description$"; -local BlastIncinerate = 100; -local HitPoints = 70; \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/StringTblDE.txt b/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/StringTblDE.txt deleted file mode 100644 index 293fcaa2a..000000000 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/StringTblDE.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name=Ruine -Description=Relikt vergangener Siedlungen. \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/StringTblUS.txt b/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/StringTblUS.txt deleted file mode 100644 index a402dc94c..000000000 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin2.ocd/StringTblUS.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name=Ruin -Description=Relic of past settlements. \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/Script.c b/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/Script.c deleted file mode 100644 index 5b1f4c508..000000000 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/Script.c +++ /dev/null @@ -1,6 +0,0 @@ -/*-- Ruin --*/ - -local Name = "$Name$"; -local Description ="$Description$"; -local BlastIncinerate = 100; -local HitPoints = 70; \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/StringTblDE.txt b/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/StringTblDE.txt deleted file mode 100644 index 293fcaa2a..000000000 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/StringTblDE.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name=Ruine -Description=Relikt vergangener Siedlungen. \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/StringTblUS.txt b/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/StringTblUS.txt deleted file mode 100644 index a402dc94c..000000000 --- a/planet/Missions.ocf/DarkCastle.ocs/Ruin3.ocd/StringTblUS.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name=Ruin -Description=Relic of past settlements. \ No newline at end of file diff --git a/planet/Missions.ocf/DarkCastle.ocs/Scenario.txt b/planet/Missions.ocf/DarkCastle.ocs/Scenario.txt index 086fbc32b..03833d803 100644 --- a/planet/Missions.ocf/DarkCastle.ocs/Scenario.txt +++ b/planet/Missions.ocf/DarkCastle.ocs/Scenario.txt @@ -5,6 +5,10 @@ Version=5,3,90 Difficulty=75 NoInitialize=true +[Definitions] +Definition1=Objects.ocd +Definition2=Decoration.ocd + [Game] Rules=Rule_TeamAccount=1;Rule_NoPowerNeed=1; diff --git a/planet/Missions.ocf/DeadlyGrotto.ocs/Scenario.txt b/planet/Missions.ocf/DeadlyGrotto.ocs/Scenario.txt index 9c79e81e1..b8613b5ad 100644 --- a/planet/Missions.ocf/DeadlyGrotto.ocs/Scenario.txt +++ b/planet/Missions.ocf/DeadlyGrotto.ocs/Scenario.txt @@ -13,6 +13,7 @@ Rules=Rule_TeamAccount=1;Rule_BuyAtFlagpole=1; [Player1] Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=5;Bread=5; HomeBaseProduction=Clonk=5;Bread=5; @@ -34,6 +35,29 @@ Crew=Clonk=2 Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=5;Bread=5; HomeBaseProduction=Clonk=5;Bread=5; +======= +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; + +[Player2] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; + +[Player3] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; + +[Player4] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; +>>>>>>> remotes/origin/master [Landscape] Sky=Clouds1 diff --git a/planet/Missions.ocf/GoldenMountain.ocs/Scenario.txt b/planet/Missions.ocf/GoldenMountain.ocs/Scenario.txt index 5fa36ce89..70f259e93 100644 --- a/planet/Missions.ocf/GoldenMountain.ocs/Scenario.txt +++ b/planet/Missions.ocf/GoldenMountain.ocs/Scenario.txt @@ -14,6 +14,7 @@ ValueOverloads=Ruby=5;Amethyst=5; [Player1] Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;InventorsLab=1;Elevator=1;ToolsWorkshop=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Dynamite=1;Hammer=1;JarOfWinds=1;Shovel=1;TeleGlove=1;GrappleBow=1;Ropeladder=1;Catapult=1;Pickaxe=1;DynamiteBox=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; HomeBaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; @@ -35,6 +36,29 @@ Crew=Clonk=2 Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;InventorsLab=1;Elevator=1;ToolsWorkshop=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Dynamite=1;Hammer=1;JarOfWinds=1;Shovel=1;TeleGlove=1;GrappleBow=1;Ropeladder=1;Catapult=1;Pickaxe=1;DynamiteBox=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; HomeBaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; +======= +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;InventorsLab=1;Elevator=1;ToolsWorkshop=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Dynamite=1;Hammer=1;JarOfWinds=1;Shovel=1;TeleGlove=1;GrappleBow=1;Ropeladder=1;Catapult=1;Pickaxe=1;DynamiteBox=1; +BaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; +BaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; + +[Player2] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;InventorsLab=1;Elevator=1;ToolsWorkshop=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Dynamite=1;Hammer=1;JarOfWinds=1;Shovel=1;TeleGlove=1;GrappleBow=1;Ropeladder=1;Catapult=1;Pickaxe=1;DynamiteBox=1; +BaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; +BaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; + +[Player3] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;InventorsLab=1;Elevator=1;ToolsWorkshop=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Dynamite=1;Hammer=1;JarOfWinds=1;Shovel=1;TeleGlove=1;GrappleBow=1;Ropeladder=1;Catapult=1;Pickaxe=1;DynamiteBox=1; +BaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; +BaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; + +[Player4] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;InventorsLab=1;Elevator=1;ToolsWorkshop=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Dynamite=1;Hammer=1;JarOfWinds=1;Shovel=1;TeleGlove=1;GrappleBow=1;Ropeladder=1;Catapult=1;Pickaxe=1;DynamiteBox=1; +BaseMaterial=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; +BaseProduction=Clonk=50;Bread=50;Wood=50;Metal=50;DynamiteBox=50;Dynamite=50; +>>>>>>> remotes/origin/master [Landscape] Sky=Clouds1 diff --git a/planet/Missions.ocf/MineRescue.ocs/Scenario.txt b/planet/Missions.ocf/MineRescue.ocs/Scenario.txt index 17619d258..68cf36ef5 100644 --- a/planet/Missions.ocf/MineRescue.ocs/Scenario.txt +++ b/planet/Missions.ocf/MineRescue.ocs/Scenario.txt @@ -13,30 +13,54 @@ Rules=Rule_EnergyNeed=1;Rule_TeamAccount=1;Rule_BuyAtFlagpole=1; [Player1] Position=193,42 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Idol=1;Foundry=1;ToolsWorkshop=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;InventorsLab=1;Lorry=1;Cannon=1;Catapult=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=2;Bread=2; HomeBaseProduction=Clonk=2;Bread=2; +======= +Knowledge=Idol=1;Foundry=1;ToolsWorkshop=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;InventorsLab=1;Lorry=1;Cannon=1;Catapult=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1; +BaseMaterial=Clonk=2;Bread=2; +BaseProduction=Clonk=2;Bread=2; +>>>>>>> remotes/origin/master [Player2] Position=193,42 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Idol=1;Foundry=1;ToolsWorkshop=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;InventorsLab=1;Lorry=1;Cannon=1;Catapult=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=2;Bread=2; HomeBaseProduction=Clonk=2;Bread=2; +======= +Knowledge=Idol=1;Foundry=1;ToolsWorkshop=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;InventorsLab=1;Lorry=1;Cannon=1;Catapult=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1 +BaseMaterial=Clonk=2;Bread=2; +BaseProduction=Clonk=2;Bread=2; +>>>>>>> remotes/origin/master [Player3] Position=193,42 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Idol=1;Foundry=1;ToolsWorkshop=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;InventorsLab=1;Lorry=1;Cannon=1;Catapult=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=2;Bread=2; HomeBaseProduction=Clonk=2;Bread=2; +======= +Knowledge=Idol=1;Foundry=1;ToolsWorkshop=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;InventorsLab=1;Lorry=1;Cannon=1;Catapult=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1 +BaseMaterial=Clonk=2;Bread=2; +BaseProduction=Clonk=2;Bread=2; +>>>>>>> remotes/origin/master [Player4] Position=193,42 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Idol=1;Foundry=1;ToolsWorkshop=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;InventorsLab=1;Lorry=1;Cannon=1;Catapult=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=2;Bread=2; HomeBaseProduction=Clonk=2;Bread=2; +======= +Knowledge=Idol=1;Foundry=1;ToolsWorkshop=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;InventorsLab=1;Lorry=1;Cannon=1;Catapult=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1 +BaseMaterial=Clonk=2;Bread=2; +BaseProduction=Clonk=2;Bread=2; +>>>>>>> remotes/origin/master [Landscape] BottomOpen=2 diff --git a/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/GraphicsBottom.4.png b/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/GraphicsBottom.4.png index 37250ca7d..9a1e44452 100644 Binary files a/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/GraphicsBottom.4.png and b/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/GraphicsBottom.4.png differ diff --git a/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/GraphicsTop.4.png b/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/GraphicsTop.4.png index 802f31e19..d8dd4b68f 100644 Binary files a/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/GraphicsTop.4.png and b/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/GraphicsTop.4.png differ diff --git a/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/Script.c b/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/Script.c index 44e601a49..fe1d02fca 100644 --- a/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/Script.c +++ b/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/Script.c @@ -19,7 +19,7 @@ func SetRight(object host) SetAction("Right", host); SetShape(0,0,4,32); SetPosition(host->GetX()+12, host->GetY()-16); - SetSolidMask(2,0,2,32,2,0); + SetSolidMask(0,0,2,32,2,0); SetVertexXY(0,-27,1); return true; } @@ -30,7 +30,7 @@ func SetRight2(object host) SetAction("Right", host); SetShape(0,0,4,32); SetPosition(host->GetX()+15, host->GetY()-48); - SetSolidMask(2,0,2,32,2,0); + SetSolidMask(0,0,2,32,2,0); SetVertexXY(0,-27-3,1+32); return true; } @@ -41,7 +41,7 @@ func SetTop(object host) SetAction("Top", host); SetShape(0,0,32,4); SetPosition(host->GetX()-16, host->GetY()-16); - SetSolidMask(0,4,32,4); + SetSolidMask(0,0,32,4); SetVertexXY(0,1,1); return true; } @@ -52,7 +52,7 @@ func SetBottom(object host) SetAction("Bottom", host); SetShape(0,0,32,4); SetPosition(host->GetX()-16, host->GetY()+12); - SetSolidMask(0,4,32,4); + SetSolidMask(0,0,32,4); SetVertexXY(0,1,-27); return true; } @@ -63,7 +63,7 @@ func SetBottom2(object host) SetAction("Bottom", host); SetShape(0,0,32,4); SetPosition(host->GetX()+13, host->GetY()+12); - SetSolidMask(0,4,32,4); + SetSolidMask(0,0,32,4); SetVertexXY(0,1-29,-27); return true; } diff --git a/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/SolidMask.png b/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/SolidMask.png new file mode 100644 index 000000000..1220b6d3b Binary files /dev/null and b/planet/Missions.ocf/Skylands.ocs/Scaffold.ocd/Wall.ocd/SolidMask.png differ diff --git a/planet/Missions.ocf/Skylands.ocs/Scenario.txt b/planet/Missions.ocf/Skylands.ocs/Scenario.txt index 0d2d29f3f..575d026f5 100644 --- a/planet/Missions.ocf/Skylands.ocs/Scenario.txt +++ b/planet/Missions.ocf/Skylands.ocs/Scenario.txt @@ -13,31 +13,55 @@ ValueOverloads=Nugget=10;GoldBar=50; [Player1] Wealth=50,0,0,250 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Plane_Engine=1;Scaffold=1;Foundry=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;SplitTerraflint=1;Barrel=1;Dynamite=1;DynamiteBox=1;Pump=1 HomeBaseMaterial=Loam=99;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 HomeBaseProduction=Loam=10;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +======= +Knowledge=Plane_Engine=1;Scaffold=1;Foundry=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Pump=1 +BaseMaterial=Loam=99;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +BaseProduction=Loam=10;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +>>>>>>> remotes/origin/master [Player2] Wealth=50,0,0,250 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Plane_Engine=1;Scaffold=1;Foundry=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;SplitTerraflint=1;Barrel=1;Dynamite=1;DynamiteBox=1;Pump=1HomeBaseMaterial=Loam=99;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 HomeBaseProduction=Loam=10;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +======= +Knowledge=Plane_Engine=1;Scaffold=1;Foundry=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Pump=1 +BaseMaterial=Loam=99;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +BaseProduction=Loam=10;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +>>>>>>> remotes/origin/master [Player3] Wealth=50,0,0,250 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Plane_Engine=1;Scaffold=1;Foundry=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;SplitTerraflint=1;Barrel=1;Dynamite=1;DynamiteBox=1;Pump=1HomeBaseMaterial=Loam=99;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 HomeBaseProduction=Loam=10;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +======= +Knowledge=Plane_Engine=1;Scaffold=1;Foundry=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Pump=1 +BaseMaterial=Loam=99;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +BaseProduction=Loam=10;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +>>>>>>> remotes/origin/master [Player4] Wealth=50,0,0,250 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Plane_Engine=1;Scaffold=1;Foundry=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;SplitTerraflint=1;Barrel=1;Dynamite=1;DynamiteBox=1;Pump=1HomeBaseMaterial=Loam=99;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 HomeBaseProduction=Loam=10;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +======= +Knowledge=Plane_Engine=1;Scaffold=1;Foundry=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Pump=1 +BaseMaterial=Loam=99;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +BaseProduction=Loam=10;Wood=5;Metal=3;Shovel=2;Axe=2;Hammer=2;Clonk=5;Bread=5;Firestone=5 +>>>>>>> remotes/origin/master [Landscape] Sky=Clouds2 -BottomOpen=true +BottomOpen=1 MapWidth=100,0,64,10000 MapHeight=200,0,40,10000 NewStyleLandscape=2 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/AncientColumn.png b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/AncientColumn.png new file mode 100644 index 000000000..d695c1369 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/AncientColumn.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/DefCore.txt new file mode 100644 index 000000000..ccbc09289 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/DefCore.txt @@ -0,0 +1,6 @@ +[DefCore] +id=Deco_AltMaterials +Version=5,2,0,1 +Category=C4D_StaticBack +Width=1 +Height=1 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/FlyAmanitaMushroom.jpg b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/FlyAmanitaMushroom.jpg new file mode 100644 index 000000000..581034403 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/FlyAmanitaMushroom.jpg differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/Graphics.png b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/Graphics.png new file mode 100644 index 000000000..3f531bb79 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/Graphics.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/Info.txt b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/Info.txt new file mode 100644 index 000000000..fd30f5e8f --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/Info.txt @@ -0,0 +1 @@ +This definition is not created. It just serves as a container for custom mesh materials, which aren't loaded unless the definition is valid. \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/Scene.material new file mode 100644 index 000000000..990e6cfb0 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/Scene.material @@ -0,0 +1,167 @@ +material GoldenChest +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.640000 0.640000 0.640000 1.000000 + specular 0.500000 0.500000 0.500000 1.000000 12.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + texture_unit + { + texture goldenchest.jpg + tex_address_mode wrap + filtering trilinear + } + } + } +} +material AncientColumn +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.640000 0.640000 0.640000 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 12.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + texture_unit + { + texture AncientColumn.png + tex_address_mode wrap + filtering trilinear + } + } + } +} + +material FlyAmanitaMushroom +{ + receive_shadows on + + technique + { + pass FlyAmanitaMushroom + { + ambient 0.800000011920929 0.800000011920929 0.800000011920929 1.0 + diffuse 1.0 1.0 1.0 1.0 + specular 0.0 0.0 0.0 1.0 12.5 + emissive 0.0 0.0 0.0 1.0 + + alpha_to_coverage off + cull_hardware clockwise + depth_write on + scene_blend one zero + + texture_unit + { + texture FlyAmanitaMushroom.jpg + tex_address_mode wrap + scale 1.0 1.0 + colour_op modulate + } + } + } +} + +material RuinedLorry +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.640000 0.640000 0.640000 1.000000 + specular 0.500000 0.500000 0.500000 1.000000 12.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + texture_unit + { + texture ruinedlorry.jpg + tex_address_mode wrap + filtering trilinear + } + } + } +} + + +material SpinWheelBaseAlt +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 1.000000 1.000000 1.000000 1.000000 + specular 0.500000 0.500000 0.500000 1.000000 12.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + texture_unit + { + texture SpinWheelBaseAlt.jpg + tex_address_mode wrap + filtering trilinear + } + } + } +} +material SpinWheelGearRed +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 1.000000 1.000000 1.000000 1.000000 + specular 0.500000 0.500000 0.500000 1.000000 12.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + texture_unit + { + texture SpinWheelGearRed.jpg + tex_address_mode wrap + filtering trilinear + } + } + } +} +material SpinWheelGearBlue +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 1.000000 1.000000 1.000000 1.000000 + specular 0.500000 0.500000 0.500000 1.000000 12.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + texture_unit + { + texture SpinWheelGearBlue.jpg + tex_address_mode wrap + filtering trilinear + } + } + } +} + +material IdolGrayColor +{ + receive_shadows on + technique + { + pass + { + ambient 0.5 0.5 0.5 1.000000 + diffuse 0.4 0.37 0.35 1.000000 + specular 0.266613 0.266613 0.266613 1.000000 12.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/SpinWheelBaseAlt.jpg b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/SpinWheelBaseAlt.jpg new file mode 100644 index 000000000..3e80a4cf2 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/SpinWheelBaseAlt.jpg differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/SpinWheelGearBlue.jpg b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/SpinWheelGearBlue.jpg new file mode 100644 index 000000000..ad9793392 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/SpinWheelGearBlue.jpg differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/SpinWheelGearRed.jpg b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/SpinWheelGearRed.jpg new file mode 100644 index 000000000..4ac5b4c19 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/SpinWheelGearRed.jpg differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/goldenchest.jpg b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/goldenchest.jpg new file mode 100644 index 000000000..36694b13d Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/goldenchest.jpg differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/ruinedlorry.jpg b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/ruinedlorry.jpg new file mode 100644 index 000000000..5b26e4acf Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/AltMaterials.ocd/ruinedlorry.jpg differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/DefCore.txt new file mode 100644 index 000000000..fa742568d --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/DefCore.txt @@ -0,0 +1,16 @@ +[DefCore] +id=Bone +Version=5,2,0,1 +Category=C4D_Object +Width=8 +Height=8 +Offset=-4,-4 +Vertices=2 +VertexX=-3,3 +VertexY=-3,3 +VertexFriction=50,50 +Value=1 +Mass=2 +Components=Wood=1 +Rotate=1 +StretchGrowth=1 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/Graphics.8.png b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/Graphics.8.png new file mode 100644 index 000000000..815df3a63 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/Graphics.8.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/Script.c new file mode 100644 index 000000000..b7ffc3180 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/Script.c @@ -0,0 +1,12 @@ +/*--- A Bone ---*/ + +protected func Hit() +{ + Sound("GeneralHit*"); + return 1; +} + +local Collectible = 1; +local Name = "$Name$"; +local Description = "$Description$"; +local Plane = 410; diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/StringTblDE.txt b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/StringTblDE.txt new file mode 100644 index 000000000..b0deaf273 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/StringTblDE.txt @@ -0,0 +1,2 @@ +Name=Knochen +Description=Relikt des Lebens. \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/StringTblUS.txt b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/StringTblUS.txt new file mode 100644 index 000000000..c82674dc5 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Bone.ocd/StringTblUS.txt @@ -0,0 +1,2 @@ +Name=Bone +Description=Relic of life. \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/LotsOfCoins.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/LotsOfCoins.ocd/DefCore.txt new file mode 100644 index 000000000..ede0e76e9 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/LotsOfCoins.ocd/DefCore.txt @@ -0,0 +1,10 @@ +[DefCore] +id=LotsOfCoins +Version=5,2,0,1 +Category=C4D_StaticBack +Width=55 +Height=17 +Offset=-27,-8 +Value=1000 +Mass=1000 +Components=GoldBar=20 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/LotsOfCoins.ocd/Graphics.8.png b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/LotsOfCoins.ocd/Graphics.8.png new file mode 100644 index 000000000..4d487ee17 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/LotsOfCoins.ocd/Graphics.8.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/DefCore.txt new file mode 100644 index 000000000..6b289ea7a --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/DefCore.txt @@ -0,0 +1,16 @@ +[DefCore] +id=Skull +Version=5,2,0,1 +Category=C4D_Object +Width=11 +Height=13 +Offset=-5,-6 +Vertices=5 +VertexX=-4,1,5,5,1 +VertexY=-5,-4,-5,5,5 +VertexFriction=50,50,50,50,50 +Value=2 +Mass=6 +Components=Wood=1 +Rotate=1 +StretchGrowth=1 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/Graphics.8.png b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/Graphics.8.png new file mode 100644 index 000000000..dbfaba6b6 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/Graphics.8.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/Script.c new file mode 100644 index 000000000..a710234d3 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/Script.c @@ -0,0 +1,12 @@ +/*--- A Skull ---*/ + +protected func Hit() +{ + Sound("GeneralHit*"); + return 1; +} + +local Collectible = 1; +local Name = "$Name$"; +local Description = "$Description$"; +local Plane = 410; diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/StringTblDE.txt b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/StringTblDE.txt new file mode 100644 index 000000000..c7757f923 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/StringTblDE.txt @@ -0,0 +1,2 @@ +Name=Schädel +Description=Relikt des Lebens. \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/StringTblUS.txt b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/StringTblUS.txt new file mode 100644 index 000000000..11202cb42 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Decoration.ocd/Skull.ocd/StringTblUS.txt @@ -0,0 +1,2 @@ +Name=Skull +Description=Relic of life. \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/DescDE.rtf b/planet/Missions.ocf/TreasureHunt.ocs/DescDE.rtf new file mode 100644 index 000000000..c9a8f7f8e Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/DescDE.rtf differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/DescUS.rtf b/planet/Missions.ocf/TreasureHunt.ocs/DescUS.rtf new file mode 100644 index 000000000..69a95af4b Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/DescUS.rtf differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/DefCore.txt new file mode 100644 index 000000000..9bd6b6471 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=DialogueSimple +Version=5,2,0,1 +Category=C4D_StaticBack +Picture=0,0,64,64 +Width=1 +Height=1 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/Graphics.png b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/Graphics.png new file mode 100644 index 000000000..e41ee72a1 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/Graphics.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsAlchemist.png b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsAlchemist.png new file mode 100644 index 000000000..ffa622b33 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsAlchemist.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsFarmer.png b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsFarmer.png new file mode 100644 index 000000000..97179cf78 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsFarmer.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsFarmer2.png b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsFarmer2.png new file mode 100644 index 000000000..5eeee5286 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsFarmer2.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsSteampunk.png b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsSteampunk.png new file mode 100644 index 000000000..db1a2ab75 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/GraphicsSteampunk.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/Script.c new file mode 100644 index 000000000..1b584cfe6 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Dialogue.ocd/Script.c @@ -0,0 +1,42 @@ +/* Nachrichten fuers Intro */ + +func MessageBoxAll(string message, object talker, bool permanent) +{ + if (permanent) permanent = "@"; else permanent = ""; + message = Format("%s%s: %s", permanent, talker->GetColor(), talker->GetName(), message); + CustomMessage(message, nil, NO_OWNER, 150,150, nil, GUI_MenuDeco, GetPortraitDef(talker)); +} + +func GetPortraitDef(object talker) +{ + var portrait = talker.portrait; + // Default definition has Clonk portrait + // (Can't get default from skin, because there's no function GetSkin D:) + if (!portrait || portrait == "" || portrait == "Clonk") return DialogueSimple; + // Otherwise, bind portrait to an invisible object + // (note: invisible object is leaked. can't really know when the message will be gone.) + if (!talker.portrait_obj) + { + talker.portrait_obj = CreateObject(DialogueSimple); + talker.portrait_obj->SetAction("Attach", talker); + talker.portrait_obj->SetGraphics(portrait); + talker.portrait_obj.Visibility = VIS_None; + } + return talker.portrait_obj; +} + +func AttachTargetLost() { return RemoveObject(); } + +local ActMap= +{ + Attach = + { + Prototype = Action, + Name="Attach", + Procedure=DFA_ATTACH, + NextAction="Attach", + Length=1, + FacetBase=1, + AbortCall = "AttachTargetLost" + } +}; \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Authors.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Authors.txt new file mode 100644 index 000000000..c6bb606f1 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Authors.txt @@ -0,0 +1 @@ +Decoration objects from EnvironmentPack by Dustin Ness (Dragonclonk) released under ISC. \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/DefCore.txt new file mode 100644 index 000000000..7780b173d --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/DefCore.txt @@ -0,0 +1,6 @@ +[DefCore] +id=EnvPack_Bag +Category=C4D_StaticBack +Width=10 +Height=10 +Offset=-5,-5 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/Graphics.mesh new file mode 100644 index 000000000..32f2e6c35 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/Scene.material new file mode 100644 index 000000000..156801a4e --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/Scene.material @@ -0,0 +1,23 @@ +material EnvPack_Bag +{ + receive_shadows on + technique + { + pass + { + cull_hardware none + scene_blend alpha_blend + ambient 1.000000 1.000000 1.000000 1.000000 + diffuse 0.800000 0.799920 0.799920 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 2.250000 + emissive 0.000000 0.000000 0.000000 1.000000 + + texture_unit + { + texture bag.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/Script.c new file mode 100644 index 000000000..6db518707 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/Script.c @@ -0,0 +1,7 @@ +/** + @author Dustin Neß (dness.de) +*/ + +protected func Construction() { +SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180),0,10), Trans_Scale(RandomX(130,200)))); +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/bag.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/bag.png new file mode 100644 index 000000000..d29267722 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Bag.ocd/bag.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/DefCore.txt new file mode 100644 index 000000000..d726bc1b9 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/DefCore.txt @@ -0,0 +1,6 @@ +[DefCore] +id=EnvPack_BridgeRustic_Back +Category=C4D_StaticBack +Width=46 +Height=18 +Offset=-23,-9 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Graphics.mesh new file mode 100644 index 000000000..5fd346c15 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Graphics.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Graphics.png new file mode 100644 index 000000000..2354f3791 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Graphics.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Scene.material new file mode 100644 index 000000000..d168f0989 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Scene.material @@ -0,0 +1,21 @@ +material EnvPack_BridgeRusticB +{ + receive_shadows on + technique + { + pass + { + ambient 1.000000 1.000000 1.000000 1.000000 + diffuse 0.300000 0.300000 0.300000 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 2.250000 + emissive 0.000000 0.000000 0.000000 1.000000 + + texture_unit + { + texture bridgerustic.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Script.c new file mode 100644 index 000000000..e462ae666 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/Script.c @@ -0,0 +1,22 @@ +protected func Initialize() +{ + //this.Plane = 400; +SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(15,0,10), Trans_Scale(200))); + //Trans_Translate(200,0,700), +} + +func SaveScenarioObject() { return false; } + +local ActMap = { + Attach = { + Prototype = Action, + Name = "Attach", + Procedure = DFA_ATTACH, + Directions = 1, + X = 0, + Y = 0, + Wdt = 64, + Hgt = 54, + NextAction = "Attach", + }, +}; \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/bridgerustic.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/bridgerustic.png new file mode 100644 index 000000000..57c15ba66 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Back.ocd/bridgerustic.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/DefCore.txt new file mode 100644 index 000000000..7f35049fb --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=EnvPack_BridgeRustic +Category=C4D_StaticBack +Width=46 +Height=18 +Offset=-23,-9 +SolidMask=0,0,46,18,0,0 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/DescDE.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/DescDE.rtf new file mode 100644 index 000000000..c5eb75494 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/DescDE.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f5\fnil\fprq2\fcharset0 Mangal;}{\f6\fnil\fprq0\fcharset128 Mangal;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af5\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af3\langfe2052\dbch\af6\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Rustikale Br\'fccke} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{{\*\bkmkstart __DdeLink__0_1927013023}\afs16\rtlch \ltrch\loch\fs16\lang1033{\*\bkmkend __DdeLink__0_1927013023} +Zwischen dir und dem Abgrund etwas Holz.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/DescUS.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/DescUS.rtf new file mode 100644 index 000000000..5ee97265f --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/DescUS.rtf @@ -0,0 +1,22 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Mangal;}{\f5\fnil\fprq0\fcharset128 Mangal;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af6\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af5\langfe2052\dbch\af3\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Rustic Bridge} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{{\*\bkmkstart result_box}{\*\bkmkend result_box}\afs16\rtlch \ltrch\loch\fs16\lang9 +Between you and the abyss some wood.}{\afs16\rtlch \ltrch\loch\fs16\lang1033 + } +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/DefCore.txt new file mode 100644 index 000000000..1e0808cc4 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/DefCore.txt @@ -0,0 +1,6 @@ +[DefCore] +id=EnvPack_BridgeRustic_Front +Category=C4D_StaticBack +Width=46 +Height=18 +Offset=-23,-9 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Graphics.mesh new file mode 100644 index 000000000..6aac743f6 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Graphics.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Graphics.png new file mode 100644 index 000000000..2354f3791 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Graphics.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Scene.material new file mode 100644 index 000000000..d1c25f6cf --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Scene.material @@ -0,0 +1,21 @@ +material EnvPack_BridgeRustic +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.800000 0.799920 0.799920 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 2.250000 + emissive 0.000000 0.000000 0.000000 1.000000 + + texture_unit + { + texture bridgerustic.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Script.c new file mode 100644 index 000000000..20696b266 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/Script.c @@ -0,0 +1,22 @@ +protected func Initialize() +{ + this.Plane = 400; + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(15,0,10), Trans_Scale(200))); + +} + +func SaveScenarioObject() { return false; } + +local ActMap = { + Attach = { + Prototype = Action, + Name = "Attach", + Procedure = DFA_ATTACH, + Directions = 1, + X = 0, + Y = 0, + Wdt = 64, + Hgt = 54, + NextAction = "Attach", + }, +}; \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/bridgerustic.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/bridgerustic.png new file mode 100644 index 000000000..57c15ba66 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Front.ocd/bridgerustic.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Graphics.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Graphics.png new file mode 100644 index 000000000..d07eccd10 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Graphics.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Script.c new file mode 100644 index 000000000..07676e846 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/Script.c @@ -0,0 +1,21 @@ +/** + @author Dustin Neß (dness.de) +*/ + +local graphicFront, graphicBack; + +protected func Construction() +{ + graphicBack = CreateObject(EnvPack_BridgeRustic_Back,-20,0,nil); + graphicBack->SetAction("Attach", this); + + + graphicFront = CreateObject(EnvPack_BridgeRustic_Front,0,0,nil); + graphicFront->SetAction("Attach", this); + + + + SetClrModulation(RGBa(0,0,0,0)); //Set SolidMask graphic invisible + + return true; +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/SolidMask.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/SolidMask.png new file mode 100644 index 000000000..d07eccd10 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/BridgeRustic.ocd/SolidMask.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/DefCore.txt new file mode 100644 index 000000000..0b7719914 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=EnvPack_Crate +Category=C4D_StaticBack +Width=10 +Height=10 +Offset=-5,-5 +StretchGrowth=1 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/Graphics.mesh new file mode 100644 index 000000000..d5acc6ca2 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/Scene.material new file mode 100644 index 000000000..adf0e049f --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/Scene.material @@ -0,0 +1,22 @@ +material EnvPack_Crate +{ + receive_shadows on + technique + { + pass + { + scene_blend alpha_blend + ambient 1.000000 1.000000 1.000000 1.000000 + diffuse 0.800000 0.799920 0.799920 1.000000 + specular 1.000000 1.000000 1.000000 1.000000 2.250000 + emissive 0.100000 0.100000 0.100000 1.000000 + + texture_unit + { + texture crate.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/Script.c new file mode 100644 index 000000000..0d4e7f660 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/Script.c @@ -0,0 +1,9 @@ +/** + @author Dustin Neß (dness.de) +*/ + +protected func Construction() +{ + //SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180),RandomX(-10,10),10), Trans_Scale(RandomX(5,10)))); + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180), 0, 1, 0), Trans_Scale(10))); +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/crate.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/crate.png new file mode 100644 index 000000000..eda98b3e9 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Crate.ocd/crate.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/DefCore.txt new file mode 100644 index 000000000..aa5d8bf64 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=EnvPack_Guidepost +Category=C4D_StaticBack +Width=10 +Height=36 +Offset=-5,-18 +StretchGrowth=1 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/Graphics.mesh new file mode 100644 index 000000000..9c132b725 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/Scene.material new file mode 100644 index 000000000..6b58f9640 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/Scene.material @@ -0,0 +1,22 @@ +material EnvPack_Guidepost +{ + receive_shadows on + technique + { + pass + { + scene_blend alpha_blend + ambient 1.000000 1.000000 1.000000 1.000000 + diffuse 0.800000 0.799920 0.799920 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 2.250000 + emissive 0.000000 0.000000 0.000000 1.000000 + + texture_unit + { + texture guidepost.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/Script.c new file mode 100644 index 000000000..0f83d124f --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/Script.c @@ -0,0 +1,8 @@ +/** + @author Dustin Neß (dness.de) +*/ + +protected func Construction() +{ + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180),0,10), Trans_Scale(360))); +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/guidepost.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/guidepost.png new file mode 100644 index 000000000..b9ad4090a Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Guidepost.ocd/guidepost.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DefCore.txt new file mode 100644 index 000000000..dbb5dce05 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DefCore.txt @@ -0,0 +1,6 @@ +[DefCore] +id=EnvPack_Lantern +Category=C4D_StaticBack +Width=20 +Height=42 +Offset=-10,-21 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DescDE.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DescDE.rtf new file mode 100644 index 000000000..63ba12b21 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DescDE.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Mangal;}{\f5\fnil\fprq0\fcharset128 Mangal;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af6\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af5\langfe2052\dbch\af3\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Laterne} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +Beleuchtet f\'fcr gew\'f6hnlich den Weg.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DescUS.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DescUS.rtf new file mode 100644 index 000000000..d4895f6d7 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DescUS.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f5\fnil\fprq2\fcharset0 Mangal;}{\f6\fnil\fprq0\fcharset128 Mangal;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af5\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af3\langfe2052\dbch\af6\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Lantern} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +Usually lit the way.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DescUS.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DescUS.txt new file mode 100644 index 000000000..68b193f86 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/DescUS.txt @@ -0,0 +1 @@ +Usually lit the way. \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Graphics.mesh new file mode 100644 index 000000000..a7594a2a8 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Scene.material new file mode 100644 index 000000000..29997d2e0 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Scene.material @@ -0,0 +1,23 @@ +material EnvPack_Lantern +{ + receive_shadows on + technique + { + pass + { + cull_hardware none + scene_blend alpha_blend + ambient 0.700000 0.700000 0.500000 1.000000 + diffuse 0.920000 0.920000 0.900000 1.000000 + specular 0.600000 0.600000 0.600000 1.000000 6.250000 + emissive 0.300000 0.300000 0.000000 1.000000 + + texture_unit + { + texture lantern.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Script.c new file mode 100644 index 000000000..74a0db9f4 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Script.c @@ -0,0 +1,75 @@ +/** + @author Dustin Neß (dness.de) +*/ + +local fShine = false; +local objShine; +local x = 0; +local y = 0; + +protected func Initialize() +{ + return SetAction("Shine"); +} + +protected func Construction() +{ + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-30, 30), 11, 40), Trans_Scale(400))); + objShine = CreateObject(EnvPack_Lantern_Shine, x, y + 15, -1); +} + +private func Shining() +{ + //check if position changed + if (x != GetX() && y != GetY()) + { + x = GetX(); + y = GetY(); + objShine->SetObjectBlitMode(GFX_BLIT_Additive); + objShine->SetClrModulation(RGBa(255, 255, 255, 228)); + objShine->SetPosition(GetX(), GetY() - 15); + } + + if (!fShine) + fShine = true; +} + +//flickering +private func Noise() +{ + if (RandomX(5) <= 2) + { + objShine->SetClrModulation(RGBa(255, 255, 255, RandomX(190, 228))); + } +} + +public func SetOn(fOn) +{ + if (fOn) + { + if (!FindObject(Find_ID(objShine))) + objShine = CreateObject(EnvPack_Lantern_Shine, 0, 15, -1); + SetAction("Shine"); + SetClrModulation(RGB(255, 255, 255)); + fShine = true; + } + else + { + objShine->RemoveObject(); + SetAction("Idle"); + SetClrModulation(RGB(155, 155, 155)); //Turn modell darker + fShine = false; + } + return true; +} + +local ActMap = { + Shine: { + Prototype: Action, + Name: "Shine", + StartCall: "Shining", + NextAction: "Shine", + EndCall: "Noise", + Delay: 5 + } +}; \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Shine.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Shine.ocd/DefCore.txt new file mode 100644 index 000000000..1292d0957 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Shine.ocd/DefCore.txt @@ -0,0 +1,6 @@ +[DefCore] +id=EnvPack_Lantern_Shine +Category=C4D_StaticBack +Width=50 +Height=50 +Offset=-25,-25 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Shine.ocd/Graphics.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Shine.ocd/Graphics.png new file mode 100644 index 000000000..66ae19a95 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Shine.ocd/Graphics.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Shine.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Shine.ocd/Script.c new file mode 100644 index 000000000..7e6450596 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/Shine.ocd/Script.c @@ -0,0 +1,2 @@ +// Don't save in Objects.c +func SaveScenarioObject() { return false; } diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/lantern.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/lantern.png new file mode 100644 index 000000000..0d8af4a91 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Lantern.ocd/lantern.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/DefCore.txt new file mode 100644 index 000000000..83bbc7461 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=EnvPack_Painting +Category=C4D_StaticBack +Width=16 +Height=14 +Offset=-8,-7 +StretchGrowth=1 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/DescDE.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/DescDE.rtf new file mode 100644 index 000000000..a7514de57 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/DescDE.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f5\fnil\fprq2\fcharset0 Mangal;}{\f6\fnil\fprq0\fcharset128 Mangal;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af5\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af3\langfe2052\dbch\af6\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Gem\'e4lde} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +H\'e4ngt herum und erfreut die Gem\'fcter.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/DescUS.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/DescUS.rtf new file mode 100644 index 000000000..c4ffcb3c8 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/DescUS.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f5\fnil\fprq2\fcharset0 Mangal;}{\f6\fnil\fprq0\fcharset128 Mangal;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af5\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af3\langfe2052\dbch\af6\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Painting} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +Just hanging around and pleased the minds.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/Graphics.mesh new file mode 100644 index 000000000..d0e5d22cf Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/Scene.material new file mode 100644 index 000000000..ef1fa5fee --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/Scene.material @@ -0,0 +1,22 @@ +material EnvPack_Painting +{ + receive_shadows on + technique + { + pass + { + ambient 0.800000 0.500000 0.500000 1.000000 + diffuse 0.800000 0.799920 0.799920 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 2.250000 + emissive 0.000000 0.000000 0.000000 1.000000 + + texture_unit Painting + { + texture painting.png + tex_address_mode wrap + filtering trilinear + } + } + } +} + diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/Script.c new file mode 100644 index 000000000..fd78b9ef2 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/Script.c @@ -0,0 +1,14 @@ +/** + @author Dustin Neß (dness.de) +*/ + +protected func Construction() +{ + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(10,0,10), Trans_Scale(50))); + RandomPainting(3); +} + +//Change when changing textures is prossible soon(?) +public func RandomPainting(iMax) { + return Random(iMax); +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/painting.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/painting.png new file mode 100644 index 000000000..f8a6869da Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Painting.ocd/painting.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/DefCore.txt new file mode 100644 index 000000000..b996f37e5 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/DefCore.txt @@ -0,0 +1,8 @@ +[DefCore] +id=EnvPack_Rail +Category=C4D_StaticBack +Width=20 +Height=12 +Offset=-10,-6 +StretchGrowth=1 +Rotate=1 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/DescDE.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/DescDE.rtf new file mode 100644 index 000000000..830cd9bfc --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/DescDE.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Mangal;}{\f5\fnil\fprq0\fcharset128 Mangal;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af6\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af5\langfe2052\dbch\af3\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Gel\'e4nder} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +Das Gel\'e4nder ist an schwieriges Terrain und Felsen angebracht.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/DescUS.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/DescUS.rtf new file mode 100644 index 000000000..0979f85c3 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/DescUS.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Mangal;}{\f5\fnil\fprq0\fcharset128 Mangal;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af6\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af5\langfe2052\dbch\af3\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Rail} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +The railing is attached to difficult terrain or climbs.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/Graphics.mesh new file mode 100644 index 000000000..24be1812e Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/Scene.material new file mode 100644 index 000000000..e044bf7d1 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/Scene.material @@ -0,0 +1,21 @@ +material EnvPack_Rail +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.800000 0.799920 0.799920 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 2.250000 + emissive 0.000000 0.000000 0.000000 1.000000 + + texture_unit + { + texture rail.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/Script.c new file mode 100644 index 000000000..c4ab99ff2 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/Script.c @@ -0,0 +1,23 @@ +/** + @author Dustin Neß (dness.de) +*/ + +protected func Construction() +{ + //random Side + if(Random(2)) + { + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(15,0,10), Trans_Scale(120))); + } else { + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(195,0,180), Trans_Scale(120))); + } +} + +//bring to front +public func SetToFront(bool fBool) { + if(fBool) { + return this.Plane = 510; + } else { + return this.Plane = 110; + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/rail.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/rail.png new file mode 100644 index 000000000..7c8f0f62d Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Rail.ocd/rail.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/DefCore.txt new file mode 100644 index 000000000..0d6259d89 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=EnvPack_Scarecrow +Category=C4D_StaticBack +Width=10 +Height=18 +Offset=-5,-9 +StretchGrowth=1 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/DescDE.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/DescDE.rtf new file mode 100644 index 000000000..db4b41ca9 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/DescDE.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f5\fnil\fprq2\fcharset0 Mangal;}{\f6\fnil\fprq0\fcharset128 Mangal;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af5\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af3\langfe2052\dbch\af6\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Vogelscheuche} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +Sollte Federvieh vom Feld fernhalten, tut es aber meist doch nicht.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/DescUS.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/DescUS.rtf new file mode 100644 index 000000000..9568bf0f2 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/DescUS.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f5\fnil\fprq2\fcharset0 Mangal;}{\f6\fnil\fprq0\fcharset128 Mangal;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af5\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af3\langfe2052\dbch\af6\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af3\langfe2052\dbch\af6\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Scarecrow} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +Should keep feather animal away from the field, but then it doesn't.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/Graphics.mesh new file mode 100644 index 000000000..991f655f6 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/Scene.material new file mode 100644 index 000000000..9a780083b --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/Scene.material @@ -0,0 +1,23 @@ +material EnvPack_Scarecrow +{ + receive_shadows on + technique + { + pass + { + cull_hardware none + scene_blend alpha_blend + ambient 1.000000 1.000000 1.000000 1.000000 + diffuse 0.800000 0.799920 0.799920 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 2.250000 + emissive 0.000000 0.000000 0.000000 1.000000 + + texture_unit + { + texture scarecrow.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/Script.c new file mode 100644 index 000000000..a5a22e0a4 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/Script.c @@ -0,0 +1,8 @@ +/** + @author Dustin Neß (dness.de) +*/ + +protected func Construction() +{ + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-30,-80),1,10), Trans_Scale(90))); +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/bag.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/bag.png new file mode 100644 index 000000000..d29267722 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/bag.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/scarecrow.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/scarecrow.png new file mode 100644 index 000000000..8759525a1 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/Scarecrow.ocd/scarecrow.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/DefCore.txt new file mode 100644 index 000000000..24faec744 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=EnvPack_TreeTrunks +Category=C4D_StaticBack +Width=24 +Height=10 +Offset=-10,-10 +StretchGrowth=1 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/DescDE.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/DescDE.rtf new file mode 100644 index 000000000..089c21132 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/DescDE.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Mangal;}{\f5\fnil\fprq0\fcharset128 Mangal;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af6\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af5\langfe2052\dbch\af3\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Baumst\'e4mme} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +Abgelagert und vergessen.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/DescUS.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/DescUS.rtf new file mode 100644 index 000000000..2a2fad44c --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/DescUS.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Mangal;}{\f5\fnil\fprq0\fcharset128 Mangal;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af6\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af5\langfe2052\dbch\af3\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Tree Trunks} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +Layed down and forgotten.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Graphics.mesh new file mode 100644 index 000000000..c91aa17ba Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Scene.material new file mode 100644 index 000000000..4a593c940 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Scene.material @@ -0,0 +1,21 @@ +material EnvPack_TreeTrunks +{ + receive_shadows on + technique + { + pass + { + ambient 0.000000 0.000000 0.000000 1.000000 + diffuse 0.640000 0.640000 0.640000 1.000000 + specular 1.300000 1.300000 0.300000 1.000000 12.500000 + emissive 0.300000 0.300000 0.300000 1.000000 + + texture_unit + { + texture treetrunks.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Script.c new file mode 100644 index 000000000..b5109280a --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Script.c @@ -0,0 +1,8 @@ +/** + @author Dustin Neß (dness.de) +*/ + +protected func Construction() +{ + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-40,40),0,20), Trans_Scale(550))); +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Title.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Title.png new file mode 100644 index 000000000..f5db88652 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/Title.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/treetrunks.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/treetrunks.png new file mode 100644 index 000000000..a778c4d0a Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/TreeTrunks.ocd/treetrunks.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/DefCore.txt new file mode 100644 index 000000000..ce7b5d039 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=EnvPack_WineBarrel +Category=C4D_StaticBack +Width=20 +Height=20 +Offset=-4,-4 +StretchGrowth=1 \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/DescDE.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/DescDE.rtf new file mode 100644 index 000000000..665463b66 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/DescDE.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Mangal;}{\f5\fnil\fprq0\fcharset128 Mangal;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af6\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af5\langfe2052\dbch\af3\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Weinfass} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +Dem Weintrinker ein Paradies.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/DescUS.rtf b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/DescUS.rtf new file mode 100644 index 000000000..70dc1baac --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/DescUS.rtf @@ -0,0 +1,21 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq0\fcharset0 Arial;}{\f4\fnil\fprq2\fcharset0 Mangal;}{\f5\fnil\fprq0\fcharset128 Mangal;}{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043 Standard;} +{\s15\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb240\sa120\keepn\cf0\kerning1\hich\af4\langfe2052\dbch\af6\loch\f2\fs28\lang1031 Überschrift;} +{\s16\sbasedon0\snext16{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af3\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Textkörper;} +{\s17\sbasedon16\snext17{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb0\sa120\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Liste;} +{\s18\sbasedon0\snext18{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sb120\sa120\cf0\i\kerning1\hich\af5\langfe2052\dbch\af3\ai\loch\f3\fs24\lang1031 Beschriftung;} +{\s19\sbasedon0\snext19{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af3\loch\f3\fs24\lang1031 Verzeichnis;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment OpenOffice.org}{\vern3400}}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\b\afs20\ab\rtlch \ltrch\loch\fs20\lang1033 +Wine Barrel} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\rtlch \ltrch\loch +} +\par \pard\plain \s0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\nowidctlpar\cf0\kerning1\hich\af3\langfe1043\dbch\af3\afs24\lang1081\loch\f3\fs24\lang1043{\afs16\rtlch \ltrch\loch\fs16\lang1033 +The wine drinker's paradise.} +\par } \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/Graphics.mesh b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/Graphics.mesh new file mode 100644 index 000000000..581bdc49f Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/Graphics.mesh differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/Scene.material b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/Scene.material new file mode 100644 index 000000000..fea9907c0 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/Scene.material @@ -0,0 +1,23 @@ +material EnvPack_WineBarrel +{ + receive_shadows on + technique + { + pass + { + cull_hardware none + scene_blend alpha_blend + ambient 0.200000 0.200000 0.200000 1.000000 + diffuse 0.900000 0.900000 0.900000 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 2.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + + texture_unit + { + texture winebarrel.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/Script.c new file mode 100644 index 000000000..2131ff0b7 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/Script.c @@ -0,0 +1,8 @@ +/** + @author Dustin Neß (dness.de) +*/ + +protected func Construction() +{ + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-50,50),0,10), Trans_Scale(500))); +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/winebarrel.png b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/winebarrel.png new file mode 100644 index 000000000..c3e687fcb Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/EnvironmentObjs.ocd/WineBarrel.ocd/winebarrel.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/DefCore.txt new file mode 100644 index 000000000..4fc0547c2 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/DefCore.txt @@ -0,0 +1,15 @@ +[DefCore] +id=GemOfPower +Version=5,2,0,1 +Category=C4D_Object +Width=8 +Height=8 +Offset=-4,-4 +Vertices=4 +VertexX=-4,0,4,0 +VertexY=0,-4,0,4 +VertexFriction=70,70,70,70 +Value=250 +Mass=16 +Components=Ruby=3;Amethyst=3 +Rotate=1 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/Graphics.8.png b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/Graphics.8.png new file mode 100644 index 000000000..5d9fd1c68 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/Graphics.8.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/Script.c new file mode 100644 index 000000000..380e5bcec --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/Script.c @@ -0,0 +1,36 @@ +/*--- Gem of Power---*/ + +#include Ruby + +local was_collected; + +func Entrance() +{ + if (!was_collected) + { + was_collected = true; + SetCategory(C4D_Object); + GameCallEx("OnTreasureCollected", this); + } + return _inherited(...); +} + +func QueryOnSell() +{ + GameCallEx("OnTreasureSold", this); + return false; // allow sale +} + +// returns the color of the gem (used for effects) +func GetGemColor() +{ + return RGB(0, Random(100), Random(100)); +} + +public func IsValuable(){ return true; } + +local Name = "$Name$"; +local Description = "$Description$"; +local Collectible = 1; +local Rebuy = true; +local Plane = 510; diff --git a/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/StringTblDE.txt b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/StringTblDE.txt new file mode 100644 index 000000000..d8490c908 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/StringTblDE.txt @@ -0,0 +1,2 @@ +Name=Juwel der Macht +Description=Ziel der Begierde von Schatzsuchern. \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/StringTblUS.txt b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/StringTblUS.txt new file mode 100644 index 000000000..84c5a483e --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/GemOfPower.ocd/StringTblUS.txt @@ -0,0 +1,2 @@ +Name=Gem of Power +Description=Made for treasure hunters. \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Map.bmp b/planet/Missions.ocf/TreasureHunt.ocs/Map.bmp new file mode 100644 index 000000000..4d2fb8481 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/Map.bmp differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Objects.c b/planet/Missions.ocf/TreasureHunt.ocs/Objects.c new file mode 100644 index 000000000..3b1f1fa6f --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Objects.c @@ -0,0 +1,540 @@ +/* Automatically created objects file */ + +func InitializeObjects() +{ + CreateObject(Grass, 1627, 396); + CreateObject(Grass, 1636, 385); + CreateObject(Grass, 1716, 366); + CreateObject(Grass, 1574, 493); + CreateObject(Grass, 1564, 493); + CreateObject(Grass, 1537, 525); + CreateObject(Grass, 1585, 486); + CreateObject(Grass, 1739, 430); + + var Column0010 = CreateObject(Column, 779, 591); + Column0010->SetClrModulation(0xffffd0d0); + Column0010->SetMeshMaterial("AncientColumn", 0); + Column0010.Plane = 50; + + var Chest0009 = CreateObject(Chest, 1002, 313); + Chest0009.Plane = 50; + + CreateObject(Goal_TreasureHunt, 0, 0); + + CreateObject(Rule_TeamAccount, 0, 0); + + CreateObject(Rule_NoPowerNeed, 0, 0); + + var LargeCaveMushroom0015 = CreateObject(LargeCaveMushroom, 1308, 1038); + LargeCaveMushroom0015->SetClrModulation(0xffe4effc); + var LargeCaveMushroom0019 = CreateObject(LargeCaveMushroom, 1345, 1028); + LargeCaveMushroom0019->SetClrModulation(0xffe1e3ee); + LargeCaveMushroom0019->SetMeshMaterial("FlyAmanitaMushroom", 0); + var LargeCaveMushroom0023 = CreateObject(LargeCaveMushroom, 1399, 1025); + LargeCaveMushroom0023->SetClrModulation(0xfff3e3e7); + LargeCaveMushroom0023->SetMeshMaterial("FlyAmanitaMushroom", 0); + var LargeCaveMushroom0027 = CreateObject(LargeCaveMushroom, 1464, 999); + LargeCaveMushroom0027->SetClrModulation(0xffe0e6dd); + var LargeCaveMushroom0031 = CreateObject(LargeCaveMushroom, 1450, 1012); + LargeCaveMushroom0031->SetClrModulation(0xffe4eae2); + var LargeCaveMushroom0035 = CreateObject(LargeCaveMushroom, 1523, 993); + LargeCaveMushroom0035->SetClrModulation(0xffe2deee); + LargeCaveMushroom0035->SetMeshMaterial("FlyAmanitaMushroom", 0); + + CreateObject(Trunk, 1000, 313); + CreateObject(Trunk, 1006, 313); + + CreateObject(EnvPack_Painting, 606, 434); + + CreateObject(EnvPack_Guidepost, 81, 743); + + CreateObject(EnvPack_BridgeRustic, 591, 356); + + CreateObject(EnvPack_Bag, 506, 968); + + CreateObject(EnvPack_Lantern, 356, 458); + + CreateObject(EnvPack_TreeTrunks, 601, 408); + + CreateObject(EnvPack_Rail, 564, 354); + CreateObject(EnvPack_Rail, 616, 356); + CreateObject(EnvPack_Rail, 633, 354); + CreateObject(EnvPack_Rail, 554, 353); + + CreateObject(EnvPack_WineBarrel, 627, 455); + + CreateObject(EnvPack_Crate, 494, 385); + + CreateObject(Fern, 1711, 368); + CreateObject(Fern, 1645, 384); + CreateObject(Fern, 1525, 535); + + var Rank0068 = CreateObject(Rank, 1320, 326); + Rank0068->SetR(148); + Rank0068->SetPosition(1320, 326); + var Rank0069 = CreateObject(Rank, 1327, 298); + Rank0069->SetR(165); + Rank0069->SetPosition(1327, 298); + var Rank0070 = CreateObject(Rank, 1424, 257); + Rank0070->SetR(108); + Rank0070->SetPosition(1424, 257); + var Rank0071 = CreateObject(Rank, 1430, 248); + Rank0071->SetR(39); + Rank0071->SetPosition(1430, 246); + var Rank0072 = CreateObject(Rank, 1413, 262); + Rank0072->SetR(128); + Rank0072->SetPosition(1413, 262); + var Rank0073 = CreateObject(Rank, 1396, 263); + Rank0073->SetR(-131); + Rank0073->SetPosition(1396, 263); + + CreateObject(SproutBerryBush, 1823, 493); + + CreateObject(Trunk, 401, 1147); + + CreateObject(Tree_Coconut, 78, 1152); + CreateObject(Tree_Coconut, 332, 1150); + + CreateObject(Tree_Coniferous, 1864, 464); + CreateObject(Tree_Coniferous, 2788, 679); + + var Lichen0095 = CreateObject(Lichen, 2694, 706); + Lichen0095->SetAction("Grown"); + + CreateObject(BigRock, 1301, 500); + CreateObject(BigRock, 1207, 282); + CreateObject(BigRock, 1291, 263); + + var Amethyst0101 = CreateObject(Amethyst, 803, 583); + Amethyst0101.Plane = 190; + + var Chest0103 = CreateObject(Chest, 515, 966); + Chest0103.tool_spawn = TeleGlove; + var Chest0104 = CreateObject(Chest, 227, 760); + Chest0104.tool_spawn = Pickaxe; + var Chest0105 = CreateObject(Chest, 634, 902); + Chest0105.tool_spawn = GrappleBow; + var Chest0106 = CreateObject(Chest, 616, 903); + Chest0106.tool_spawn = GrappleBow; + var Chest0107 = CreateObject(Chest, 472, 455); + var Chest0108 = CreateObject(Chest, 546, 383); + var Chest0109 = CreateObject(Chest, 840, 47); + Chest0109.tool_spawn = WindBag; + var Chest0110 = CreateObject(Chest, 853, 1574); + var Chest0111 = CreateObject(Chest, 1428, 1542); + var Chest0112 = CreateObject(Chest, 1765, 1191); + var Chest0113 = CreateObject(Chest, 1878, 719); + Chest0113.tool_spawn = Axe; + var Chest0114 = CreateObject(Chest, 1943, 714); + var Chest0115 = CreateObject(Chest, 2103, 1119); + var Chest0116 = CreateObject(Chest, 397, 583); + var Chest0117 = CreateObject(Chest, 871, 583); + Chest0117->SetMeshMaterial("GoldenChest", 0); + var Chest0118 = CreateObject(Chest, 12, 39); + var Chest0119 = CreateObject(Chest, 2786, 55); + var Chest0120 = CreateObject(Chest, 1830, 486); + Chest0120.tool_spawn = Hammer; + var Chest0121 = CreateObject(Chest, 730, 135); + var Chest0122 = CreateObject(Chest, 1626, 1590); + + var StoneDoor0123 = CreateObject(StoneDoor, 940, 1151); + StoneDoor0123->SetComDir(COMD_Down); + StoneDoor0123->MakeInvincible(); + var StoneDoor0125 = CreateObject(StoneDoor, 1092, 1151); + StoneDoor0125->SetComDir(COMD_Down); + StoneDoor0125->MakeInvincible(); + var StoneDoor0127 = CreateObject(StoneDoor, 564, 455); + StoneDoor0127->SetComDir(COMD_Down); + StoneDoor0127->MakeInvincible(); + var StoneDoor0129 = CreateObject(StoneDoor, 843, 735); + StoneDoor0129->SetComDir(COMD_Down); + StoneDoor0129->MakeInvincible(); + var StoneDoor0131 = CreateObject(StoneDoor, 1058, 719); + StoneDoor0131->SetComDir(COMD_Down); + StoneDoor0131->MakeInvincible(); + var StoneDoor0133 = CreateObject(StoneDoor, 1092, 1047); + StoneDoor0133->SetComDir(COMD_Down); + StoneDoor0133->MakeInvincible(); + var StoneDoor0135 = CreateObject(StoneDoor, 1892, 951); + StoneDoor0135->SetComDir(COMD_Down); + StoneDoor0135->MakeInvincible(); + var StoneDoor0137 = CreateObject(StoneDoor, 813, 735); + StoneDoor0137->SetComDir(COMD_Down); + StoneDoor0137->MakeInvincible(); + var StoneDoor0139 = CreateObject(StoneDoor, 781, 735); + StoneDoor0139->SetComDir(COMD_Down); + StoneDoor0139->SetClrModulation(0xffa0a0a0); + var StoneDoor0140 = CreateObject(StoneDoor, 692, 767); + StoneDoor0140->SetComDir(COMD_Down); + StoneDoor0140->MakeInvincible(); + var StoneDoor0142 = CreateObject(StoneDoor, 684, 350); + StoneDoor0142->SetComDir(COMD_Down); + StoneDoor0142->MakeInvincible(); + + var SpinWheel0144 = CreateObject(SpinWheel, 589, 457); + SpinWheel0144->SetMeshMaterial("SpinWheelGearRed", 0); + SpinWheel0144->SetStoneDoor(StoneDoor0123); + var SpinWheel0145 = CreateObject(SpinWheel, 611, 456); + SpinWheel0145->SetMeshMaterial("SpinWheelGearBlue", 0); + SpinWheel0145->SetStoneDoor(StoneDoor0125); + var SpinWheel0146 = CreateObject(SpinWheel, 619, 410); + SpinWheel0146->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel0146->SetStoneDoor(StoneDoor0127); + var SpinWheel0147 = CreateObject(SpinWheel, 1223, 1553); + SpinWheel0147->SetStoneDoor(StoneDoor0131); + var SpinWheel0148 = CreateObject(SpinWheel, 1117, 1048); + SpinWheel0148->SetStoneDoor(StoneDoor0133); + var SpinWheel0149 = CreateObject(SpinWheel, 2761, 690); + SpinWheel0149->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel0149->SetStoneDoor(StoneDoor0137); + var SpinWheel0150 = CreateObject(SpinWheel, 1850, 1463); + SpinWheel0150->SetMeshMaterial("SpinWheelGearRed", 0); + SpinWheel0150->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel0150->SetStoneDoor(StoneDoor0129); + var SpinWheel0151 = CreateObject(SpinWheel, 2793, 1521); + SpinWheel0151->SetMeshMaterial("SpinWheelGearRed", 0); + SpinWheel0151->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel0151->SetStoneDoor(StoneDoor0135); + var SpinWheel0152 = CreateObject(SpinWheel, 830, 735); + SpinWheel0152->SetStoneDoor(StoneDoor0140); + var SpinWheel0153 = CreateObject(SpinWheel, 703, 352); + SpinWheel0153->SetMeshMaterial("SpinWheelBaseAlt", 1); + SpinWheel0153->SetStoneDoor(StoneDoor0142); + + CreateObject(Pump, 1027, 1152); + + CreateObject(Sawmill, 1259, 1047); + + var ToolsWorkshop0158 = CreateObject(ToolsWorkshop, 1169, 903); + + var Column0160 = CreateObject(Column, 779, 488); + Column0160->SetR(180); + Column0160->SetClrModulation(0xffffd0d0); + Column0160->SetMeshMaterial("AncientColumn", 0); + Column0160->SetPosition(779, 488); + var Column0161 = CreateObject(Column, 1419, 217); + Column0161->SetMeshMaterial("AncientColumn", 0); + CreateObject(Column, 1386, 616); + + CreateObject(Ruin_Windmill, 1672, 377); + + CreateObject(Ruin_WoodenCabin, 1199, 1046); + + var Idol0165 = CreateObject(Idol, 1045, 721); + Idol0165->SetMeshMaterial("IdolGrayColor", 0); + + var LotsOfCoins0166 = CreateObject(LotsOfCoins, 805, 592); + LotsOfCoins0166.Plane = 200; + + var Idol0167 = CreateObject(Idol, 824, 583); + Idol0167->SetR(-4); + Idol0167.Plane = 220; + Idol0167->SetPosition(824, 568); + + var Lorry0168 = CreateObject(Lorry, 200, 1183); + var Lorry0170 = CreateObject(Lorry, 708, 1407); + Lorry0170->SetMeshMaterial("RuinedLorry", 0); + + var Catapult0172 = CreateObject(Catapult, 1714, 951); + Catapult0172->SetRDir(-2); + + CreateObject(StrawMan, 1924, 439); + CreateObject(StrawMan, 2642, 705); + + var Clonk0175 = CreateObject(Clonk, 316, 430); + Clonk0175->SetColor(0xff); + S2AI->AddAI(Clonk0175); + S2AI->SetHome(Clonk0175, 315, 422, DIR_Left); + S2AI->SetGuardRange(Clonk0175, 296, 322, 350, 140); + S2AI->SetEncounterCB(Clonk0175, "EncounterCastle"); + Clonk0175->SetDir(DIR_Left); + var Clonk0182 = CreateObject(Clonk, 501, 455); + Clonk0182->SetDir(DIR_Right); + Clonk0182->SetColor(0xff); + S2AI->AddAI(Clonk0182); + S2AI->SetHome(Clonk0182, 502, 445, DIR_Right); + S2AI->SetGuardRange(Clonk0182, 460, 300, 200, 160); + S2AI->SetMaxAggroDistance(Clonk0182, 60); + var Clonk0189 = CreateObject(Clonk, 534, 454); + Clonk0189->SetDir(DIR_Right); + Clonk0189->SetColor(0xff); + S2AI->AddAI(Clonk0189); + S2AI->SetHome(Clonk0189, 534, 446, DIR_Right); + S2AI->SetGuardRange(Clonk0189, 460, 300, 200, 160); + S2AI->SetMaxAggroDistance(Clonk0189, 60); + var Clonk0196 = CreateObject(Clonk, 671, 638); + Clonk0196->SetDir(DIR_Right); + Clonk0196->SetCon(150); + Clonk0196->SetColor(0xffffa000); + S2AI->AddAI(Clonk0196); + S2AI->SetHome(Clonk0196, 671, 629, DIR_Right); + S2AI->SetGuardRange(Clonk0196, 580, 480, 320, 175); + S2AI->SetEncounterCB(Clonk0196, "EncounterFinal"); + + CreateObject(Skull, 53, 1138); + + var Bone0204 = CreateObject(Bone, 35, 1135); + Bone0204->SetR(-45); + Bone0204->SetPosition(35, 1135); + CreateObject(Bone, 46, 1138); + + Lorry0168->CreateContents(Loam); + Lorry0168->CreateContents(Loam); + Lorry0168->CreateContents(Loam); + Lorry0168->CreateContents(Loam); + CreateObject(Loam, 153, 1235); + CreateObject(Loam, 357, 1320); + CreateObject(Loam, 265, 1454); + CreateObject(Loam, 528, 1453); + CreateObject(Loam, 554, 1456); + CreateObject(Loam, 988, 1287); + CreateObject(Loam, 1030, 1275); + CreateObject(Loam, 1065, 1270); + CreateObject(Loam, 1051, 1261); + CreateObject(Loam, 1049, 1282); + CreateObject(Loam, 1081, 1269); + CreateObject(Loam, 1334, 1052); + CreateObject(Loam, 1532, 861); + CreateObject(Loam, 1619, 807); + CreateObject(Loam, 1642, 442); + CreateObject(Loam, 1694, 402); + CreateObject(Loam, 1578, 527); + CreateObject(Loam, 1746, 459); + + var Metal0228 = CreateObject(Metal, 1922, 978); + Metal0228->SetR(20); + Metal0228->SetPosition(1922, 976); + + var Nugget0229 = CreateObject(Nugget, 812, 590); + Nugget0229->SetClrModulation(0xffffd0a0); + CreateObject(Nugget, 869, 583); + var Nugget0231 = CreateObject(Nugget, 853, 584); + Nugget0231->SetClrModulation(0xffffd0a0); + var Nugget0232 = CreateObject(Nugget, 823, 584); + Nugget0232->SetClrModulation(0xffffd0a0); + + Chest0108->CreateContents(GoldBar); + Chest0112->CreateContents(GoldBar); + Chest0111->CreateContents(GoldBar); + Chest0110->CreateContents(GoldBar); + Lorry0170->CreateContents(GoldBar); + Chest0109->CreateContents(GoldBar); + Chest0114->CreateContents(GoldBar); + Chest0115->CreateContents(GoldBar); + Chest0116->CreateContents(GoldBar); + var GoldBar0242 = Chest0009->CreateContents(GoldBar); + GoldBar0242->SetR(-1); + Chest0119->CreateContents(GoldBar); + var GoldBar0244 = Chest0118->CreateContents(GoldBar); + GoldBar0244->SetR(-97); + var GoldBar0245 = Chest0121->CreateContents(GoldBar); + GoldBar0245->SetClrModulation(0xffffd0a0); + GoldBar0245->SetR(-29); + var GoldBar0246 = CreateObject(GoldBar, 880, 542); + GoldBar0246->SetR(-29); + GoldBar0246->SetClrModulation(0xffffd0a0); + GoldBar0246->SetPosition(880, 540); + ToolsWorkshop0158->CreateContents(GoldBar); + CreateObject(GoldBar, 72, 1463); + CreateObject(GoldBar, 2746, 736); + CreateObject(GoldBar, 2507, 1262); + Chest0122->CreateContents(GoldBar); + var GoldBar0252 = CreateObject(GoldBar, 972, 1280); + GoldBar0252->SetR(55); + GoldBar0252->SetPosition(972, 1277); + + CreateObject(Ruby, 864, 585); + CreateObject(Ruby, 806, 587); + CreateObject(Ruby, 849, 581); + CreateObject(Ruby, 856, 588); + + var Amethyst0261 = CreateObject(Amethyst, 793, 587); + Amethyst0261->SetR(21); + Amethyst0261->SetPosition(793, 583); + CreateObject(Amethyst, 885, 561); + CreateObject(Amethyst, 828, 585); + + Lorry0168->CreateContents(Dynamite); + Lorry0168->CreateContents(Dynamite); + Chest0109->CreateContents(Dynamite); + Chest0109->CreateContents(Dynamite); + Chest0109->CreateContents(Dynamite); + CreateObject(Dynamite, 1046, 722); + Chest0106->CreateContents(Dynamite); + Chest0105->CreateContents(Dynamite); + Chest0106->CreateContents(Dynamite); + Chest0105->CreateContents(Dynamite); + Chest0103->CreateContents(Dynamite); + Chest0111->CreateContents(Dynamite); + Chest0111->CreateContents(Dynamite); + Chest0111->CreateContents(Dynamite); + Chest0114->CreateContents(Dynamite); + Chest0114->CreateContents(Dynamite); + Chest0114->CreateContents(Dynamite); + + var Bow0284 = Clonk0175->CreateContents(Bow); + + var Arrow0285 = Bow0284->CreateContents(Arrow); + Arrow0285->SetR(90); + var Arrow0286 = Clonk0175->CreateContents(Arrow); + Arrow0286->SetR(90); + var Arrow0287 = CreateObject(Arrow, 313, 431); + Arrow0287->SetR(90); + Arrow0287->SetPosition(313, 431); + var Arrow0288 = CreateObject(Arrow, 313, 431); + Arrow0288->SetR(90); + Arrow0288->SetPosition(313, 431); + var Arrow0289 = CreateObject(Arrow, 313, 431); + Arrow0289->SetR(90); + Arrow0289->SetPosition(313, 431); + var Arrow0290 = CreateObject(Arrow, 313, 431); + Arrow0290->SetR(90); + Arrow0290->SetPosition(313, 431); + var Arrow0291 = CreateObject(Arrow, 313, 431); + Arrow0291->SetR(90); + Arrow0291->SetPosition(313, 431); + var Arrow0292 = CreateObject(Arrow, 313, 431); + Arrow0292->SetR(90); + Arrow0292->SetPosition(313, 431); + var Arrow0293 = CreateObject(Arrow, 313, 431); + Arrow0293->SetR(90); + Arrow0293->SetPosition(313, 431); + var Arrow0294 = CreateObject(Arrow, 313, 431); + Arrow0294->SetR(90); + Arrow0294->SetPosition(313, 431); + var Arrow0295 = CreateObject(Arrow, 313, 431); + Arrow0295->SetR(90); + Arrow0295->SetPosition(313, 431); + + Chest0107->CreateContents(Bread); + Chest0107->CreateContents(Bread); + Lorry0170->CreateContents(Bread); + Lorry0170->CreateContents(Bread); + Lorry0170->CreateContents(Bread); + + Chest0107->CreateContents(DynamiteBox); + Chest0107->CreateContents(DynamiteBox); + Chest0118->CreateContents(DynamiteBox); + Chest0118->CreateContents(DynamiteBox); + Chest0119->CreateContents(DynamiteBox); + Chest0119->CreateContents(DynamiteBox); + Chest0122->CreateContents(DynamiteBox); + Chest0115->CreateContents(DynamiteBox); + Chest0121->CreateContents(DynamiteBox); + + Clonk0189->CreateContents(Sword); + Clonk0182->CreateContents(Sword); + Chest0109->CreateContents(Sword); + Clonk0196->CreateContents(Sword); + Clonk0196->CreateContents(Sword); + + var Seaweed0315 = CreateObject(Seaweed, 2494, 1263); + Seaweed0315->SetPhase(55); + var Seaweed0318 = CreateObject(Seaweed, 2508, 1263); + Seaweed0318->SetPhase(47); + var Seaweed0321 = CreateObject(Seaweed, 2520, 1263); + Seaweed0321->SetPhase(24); + var Seaweed0324 = CreateObject(Seaweed, 2508, 1263); + Seaweed0324->SetPhase(24); + var Seaweed0327 = CreateObject(Seaweed, 2503, 1263); + Seaweed0327->SetPhase(50); + var Seaweed0330 = CreateObject(Seaweed, 2526, 1262); + Seaweed0330->SetPhase(50); + var Seaweed0333 = CreateObject(Seaweed, 2514, 1262); + Seaweed0333->SetPhase(50); + var Seaweed0336 = CreateObject(Seaweed, 2499, 1263); + Seaweed0336->SetPhase(50); + var Seaweed0339 = CreateObject(Seaweed, 2663, 1278); + Seaweed0339->SetPhase(53); + var Seaweed0342 = CreateObject(Seaweed, 2769, 1272); + Seaweed0342->SetPhase(53); + var Seaweed0345 = CreateObject(Seaweed, 2751, 1279); + Seaweed0345->SetPhase(53); + var Seaweed0348 = CreateObject(Seaweed, 2762, 1271); + Seaweed0348->SetPhase(53); + var Seaweed0351 = CreateObject(Seaweed, 2775, 1279); + Seaweed0351->SetPhase(53); + var Seaweed0354 = CreateObject(Seaweed, 2762, 1271); + Seaweed0354->SetPhase(53); + var Seaweed0357 = CreateObject(Seaweed, 2661, 1278); + Seaweed0357->SetPhase(53); + var Seaweed0360 = CreateObject(Seaweed, 2416, 1245); + Seaweed0360->SetPhase(13); + var Seaweed0363 = CreateObject(Seaweed, 2395, 1239); + Seaweed0363->SetPhase(13); + var Seaweed0366 = CreateObject(Seaweed, 2396, 1239); + Seaweed0366->SetPhase(13); + var Seaweed0369 = CreateObject(Seaweed, 2332, 1145); + Seaweed0369->SetPhase(13); + var Seaweed0372 = CreateObject(Seaweed, 2407, 1246); + Seaweed0372->SetPhase(13); + + CreateObject(Mushroom, 1580, 760); + CreateObject(Mushroom, 1613, 776); + CreateObject(Mushroom, 1525, 848); + CreateObject(Mushroom, 1612, 863); + CreateObject(Mushroom, 1321, 895); + CreateObject(Mushroom, 1315, 896); + CreateObject(Mushroom, 1343, 904); + CreateObject(Mushroom, 1347, 903); + + CreateObject(Balloon, 491, 383); + + var Barrel0408 = CreateObject(Barrel, 623, 456); + Barrel0408->SetColor(0xff000000); + + CreateObject(Sproutberry, 1823, 488); + CreateObject(Sproutberry, 1823, 488); + CreateObject(Sproutberry, 1823, 488); + + var LotsOfCoins0413 = CreateObject(LotsOfCoins, 838, 592); + LotsOfCoins0413.Plane = 500; + + var Boompack0448 = CreateObject(Boompack, 543, 383); + Boompack0448->SetColor(0xff); + var Boompack0468 = CreateObject(Boompack, 548, 384); + Boompack0468->SetColor(0xff); + var Boompack0470 = CreateObject(Boompack, 1948, 713); + Boompack0470->SetColor(0xff); + var Boompack0471 = CreateObject(Boompack, 1944, 487); + Boompack0471->SetR(135); + Boompack0471->SetColor(0xff); + Boompack0471->SetPosition(1944, 483); + + var GemOfPower0414 = CreateObject(GemOfPower, 825, 572); + GemOfPower0414->SetCategory(C4D_StaticBack); + + CreateObject(Firestone, 564, 1135); + CreateObject(Firestone, 552, 1135); + CreateObject(Firestone, 562, 1135); + CreateObject(Firestone, 571, 1135); + CreateObject(Firestone, 567, 1135); + CreateObject(Firestone, 558, 1135); + CreateObject(Firestone, 546, 1135); + CreateObject(Firestone, 560, 1135); + CreateObject(Firestone, 546, 1135); + CreateObject(Firestone, 546, 1135); + CreateObject(Firestone, 555, 1135); + CreateObject(Firestone, 562, 1135); + CreateObject(Firestone, 550, 1135); + CreateObject(Firestone, 552, 1135); + CreateObject(Firestone, 342, 1225); + CreateObject(Firestone, 166, 1261); + CreateObject(Firestone, 234, 1424); + CreateObject(Firestone, 315, 431); + CreateObject(Firestone, 1359, 1061); + CreateObject(Firestone, 1348, 1042); + CreateObject(Firestone, 1384, 1055); + CreateObject(Firestone, 1417, 1107); + CreateObject(Firestone, 1432, 1113); + CreateObject(Firestone, 1436, 1104); + CreateObject(Firestone, 1340, 920); + CreateObject(Firestone, 1476, 876); + CreateObject(Firestone, 1549, 866); + CreateObject(Firestone, 1607, 792); + CreateObject(Firestone, 2053, 852); + CreateObject(Firestone, 2161, 943); + CreateObject(Firestone, 2073, 862); + CreateObject(Firestone, 2064, 852); + return true; +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Scenario.txt b/planet/Missions.ocf/TreasureHunt.ocs/Scenario.txt new file mode 100644 index 000000000..7bbba44cc --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Scenario.txt @@ -0,0 +1,36 @@ +[Head] +Icon=36 +Title=TreasureHunt +Version=5,4 +Difficulty=30 +NoInitialize=true + +[Definitions] +Definition2=Decoration.ocd + +[Game] +Rules=Rule_TeamAccount=1;Rule_NoPowerNeed=1 + +[Player1] +Knowledge=ToolsWorkshop=1;Foundry=1;Flagpole=1;Elevator=1;Armory=1;ChemicalLab=1;Lorry=1;Pickaxe=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Loam=1;Bucket=1;Sword=1;Metal=1;Balloon=1;Boompack=1;GrappleBow=1;JarOfWinds=1;Pipe=1;Pump=1;PowderKeg=1;Ropeladder=1;Bow=1;Arrow=1;Club=1;IronBomb=1;Javelin=1;Shield=1;Catapult=1;WallKit=1 + +[Player2] +Knowledge=ToolsWorkshop=1;Foundry=1;Flagpole=1;Elevator=1;Armory=1;ChemicalLab=1;Lorry=1;Pickaxe=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Loam=1;Bucket=1;Sword=1;Metal=1;Balloon=1;Boompack=1;GrappleBow=1;JarOfWinds=1;Pipe=1;Pump=1;PowderKeg=1;Ropeladder=1;Bow=1;Arrow=1;Club=1;IronBomb=1;Javelin=1;Shield=1;Catapult=1;WallKit=1 + +[Player3] +Knowledge=ToolsWorkshop=1;Foundry=1;Flagpole=1;Elevator=1;Armory=1;ChemicalLab=1;Lorry=1;Pickaxe=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Loam=1;Bucket=1;Sword=1;Metal=1;Balloon=1;Boompack=1;GrappleBow=1;JarOfWinds=1;Pipe=1;Pump=1;PowderKeg=1;Ropeladder=1;Bow=1;Arrow=1;Club=1;IronBomb=1;Javelin=1;Shield=1;Catapult=1;WallKit=1 + +[Player4] +Knowledge=ToolsWorkshop=1;Foundry=1;Flagpole=1;Elevator=1;Armory=1;ChemicalLab=1;Lorry=1;Pickaxe=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Loam=1;Bucket=1;Sword=1;Metal=1;Balloon=1;Boompack=1;GrappleBow=1;JarOfWinds=1;Pipe=1;Pump=1;PowderKeg=1;Ropeladder=1;Bow=1;Arrow=1;Club=1;IronBomb=1;Javelin=1;Shield=1;Catapult=1;WallKit=1 + +[Landscape] +Sky=Clouds2 +TopOpen=2 +MapWidth=200,0,64,10000 +MapHeight=200,0,40,10000 +NoScan=true + +[Weather] +Climate=0,10,0,100 +YearSpeed=0,0,0,100 +Wind=0,100,-100,100 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/Script.c new file mode 100644 index 000000000..1eb2aa142 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Script.c @@ -0,0 +1,165 @@ +/** + Treasure Hunt + Find the treasure and sell it + + @authors Sven2 +*/ + +static g_is_initialized; // set after first player join +static g_max_player_num; // max number of players that were ever joined +static g_plr_inventory; // array indexed by players: Array containing inventory of Clonk jsut before it died + +func DoInit(int first_player) +{ + CreateObject(Flagpole, 210,1185, first_player); + ClearFreeRect(530,1135, 50,2); + // Intro. Show message twice for longer duration. + Schedule(nil, Format("GameCall(%v, %d)", "DoIntroMessage", first_player), 50, 1); + Schedule(nil, Format("GameCall(%v, %d)", "DoIntroMessage", first_player), 100, 1); + return true; +} + +func DoIntroMessage(int first_player) +{ + var talker = GetCursor(first_player); + if (talker) DialogueSimple->MessageBoxAll("$MsgIntro1$", talker, false); + return true; +} + +func InitializePlayer(int plr) +{ + // Players only + if (GetPlayerType(plr)!=C4PT_User) return; + // Scenario init + if (!g_is_initialized) g_is_initialized = DoInit(plr); + // Harsh zoom range + for (var flag in [PLRZOOM_LimitMax, PLRZOOM_Direct]) + SetPlayerZoomByViewRange(plr,400,250,flag); + SetPlayerViewLock(plr, true); + // Create per-player-counted tools + if (g_max_player_num < GetPlayerCount(C4PT_User)) + { + ++g_max_player_num; + for (var obj in FindObjects(Find_ID(Chest))) + if (obj.tool_spawn) + obj->CreateContents(obj.tool_spawn); + } + // Initial join + JoinPlayer(plr); + GetCrew(plr)->CreateContents(Shovel); + return true; +} + +func RelaunchPlayer(int plr) +{ + var clonk = CreateObject(Clonk, 200, 1175, plr); + clonk->MakeCrewMember(plr); + SetCursor(plr, clonk); + JoinPlayer(plr); + // Recover carried objects + // Do not recover pipes, because that would draw ugly lines across the landscape + if (g_plr_inventory && g_plr_inventory[plr]) + { + for (var obj in g_plr_inventory[plr]) + if (obj && obj->GetID() != Pipe) obj->Enter(clonk); + g_plr_inventory[plr] = nil; + } + return true; +} + +func JoinPlayer(int plr) +{ + // Place in village + var crew; + for(var index = 0; crew = GetCrew(plr, index); ++index) + { + var x = 190 + Random(20); + var y = 1175; + crew->SetPosition(x , y); + crew->SetDir(DIR_Right); + crew->DoEnergy(1000); + AddEffect("IntRememberInventory", crew, 1, 0); + } + return true; +} + +global func FxIntRememberInventoryStop(object clonk, fx, int reason, bool temp) +{ + if (!temp && reason == FX_Call_RemoveDeath) + { + var plr = clonk->GetOwner(); + if (plr != NO_OWNER) + { + if (!g_plr_inventory) g_plr_inventory = []; + g_plr_inventory[plr] = []; + var i=0,obj; + while (obj=clonk->Contents(i)) g_plr_inventory[plr][i++] = obj; + } + } + return FX_OK; + +} + + +/* Enemy encounter messages */ + +func EncounterCastle(object enemy, object player) +{ + DialogueSimple->MessageBoxAll("$MsgEncounterCastle$", enemy); + return true; +} + +func EncounterFinal(object enemy, object player) +{ + DialogueSimple->MessageBoxAll("$MsgEncounterFinal$", enemy); + return true; +} + + +/* Events */ + +func OnTreasureCollected(object treasure) +{ + DialogueSimple->MessageBoxAll("$MsgTreasureCollected$", treasure->Contained()); + return true; +} + +static g_num_goldbars; +static const MAX_GOLD_BARS = 20; + +func OnGoldBarCollected(object collecter) +{ + ++g_num_goldbars; + UpdateLeagueScores(); + DialogueSimple->MessageBoxAll(Format("$MsgGoldBarCollected$", g_num_goldbars, MAX_GOLD_BARS), collecter); + return true; +} + +func OnGameOver() +{ + // Treasure was collected! + UpdateLeagueScores(); + return true; +} + +func UpdateLeagueScores() +{ + // +50 for finishing and +5 for every gold bar + var goal = FindObject(Find_ID(Goal_TreasureHunt)); + var goal_finished = (goal && goal->IsFulfilled()); + return SetLeagueProgressScore(g_num_goldbars, g_num_goldbars * 5 + goal_finished * 50); +} + +func OnInvincibleDamage(object damaged_target) +{ + // Closest Clonk remarks that the door is invincible + if (damaged_target && damaged_target->GetID() == StoneDoor) + { + var observer = damaged_target->FindObject(Find_ID(Clonk), Find_OCF(OCF_Alive), damaged_target->Sort_Distance()); + if (observer) + { + DialogueSimple->MessageBoxAll("$MsgStoneDoorNoDamage$", observer); + } + } + return true; +} diff --git a/planet/Missions.ocf/TreasureHunt.ocs/StringTblDE.txt b/planet/Missions.ocf/TreasureHunt.ocs/StringTblDE.txt new file mode 100644 index 000000000..d167c4327 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/StringTblDE.txt @@ -0,0 +1,6 @@ +MsgIntro1=Okay, das Juwel der Macht muss hier irgendwo in der Höhle sein. Das Gebiet scheint schwer passierbar. Vielleicht sollten wir uns erst einmal nach Werkzeugen umsehen. +MsgEncounterCastle=Ein Eindringling! Schnappt ihn! +MsgEncounterFinal=Nein nein, der Schatz gehört NUR MIR! +MsgTreasureCollected=Sehr gut! Nun muss der Schatz nur noch zurück zur Flagge. +MsgGoldBarCollected=Ich habe einen Goldbarren gefunden! (%d/%d) +MsgStoneDoorNoDamage=Diese Steintür ist zu stabil. Ich sollte einen Schalter suchen. diff --git a/planet/Missions.ocf/TreasureHunt.ocs/StringTblUS.txt b/planet/Missions.ocf/TreasureHunt.ocs/StringTblUS.txt new file mode 100644 index 000000000..895750233 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/StringTblUS.txt @@ -0,0 +1,6 @@ +MsgIntro1=OK, let's go and search for the Gem of Power. The terrain is rough, so we might need to look out for some tools first. +MsgEncounterCastle=Look out, an intruder! Catch him! +MsgEncounterFinal=The treasure is MINE ALONE! +MsgTreasureCollected=Excellent! Now we need to bring the treasure back to the flag. +MsgGoldBarCollected=I've found a gold bar! (%d/%d) +MsgStoneDoorNoDamage=This stone door is too resilient. I should search for a switch. diff --git a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/GoldBarSpecial.c b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/GoldBarSpecial.c new file mode 100644 index 000000000..2a86376d8 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/GoldBarSpecial.c @@ -0,0 +1,45 @@ +/* Goldbarren direkt einsammeln */ + +#appendto GoldBar + +func Entrance(container) +{ + if (container->GetAlive()) + { + DoSellEffect(container); + GameCall("OnGoldBarCollected", container); + RemoveObject(); + return true; + } + return _inherited(container, ...); +} + +func DoSellEffect(container) +{ + var value = 0; + var fm = CreateObject(FloatingMessage, 0,0, NO_OWNER); + fm->SetColor(250, 200, 50); + fm->FadeOut(2, 10); + fm->SetSpeed(0, -5); + fm->SetMessage("+1{{GoldBar}}"); + container->Sound("Cash"); + + var dust_particles = + { + Prototype = Particles_Dust(), + Size = PV_KeyFrames(0, 0, 0, 100, 10, 1000, 0), + Alpha = PV_KeyFrames(0, 0, 255, 750, 255, 1000, 0), + R = 200, + G = 125, + B = 125, + }; + + var flash_particles = + { + Prototype = Particles_Flash(), + Size = 20 + }; + + CreateParticle("Flash", 0,0, 0, 0, 8, flash_particles); + CreateParticle("Dust", 0,0, PV_Random(-10, 10), PV_Random(-10, 10), PV_Random(18, 36), dust_particles, 10); +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/Invincibility.c b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/Invincibility.c new file mode 100644 index 000000000..ec74386b4 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/Invincibility.c @@ -0,0 +1,21 @@ +// Helper functions to make stuff invincible / indestructible + +global func MakeInvincible() +{ + if (!this) return; + if (!GetEffect("IntInvincible", this)) AddEffect("IntInvincible", this, 1, 0); + return true; +} + +global func FxIntInvincibleDamage(target) +{ + GameCall("OnInvincibleDamage", target); + return 0; +} + +global func FxIntInvincibleSaveScen(object obj, proplist fx, proplist props) +{ + // this is invincible. Save to scenario. + props->AddCall("Invincible", obj, "MakeInvincible"); + return true; +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/LeagueProgress.c b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/LeagueProgress.c new file mode 100644 index 000000000..eeee601c7 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/LeagueProgress.c @@ -0,0 +1,25 @@ +/* Store league progress and score for all players */ + +global func SetLeagueProgressScore(int new_progress, int new_score) +{ + // Progress must be between 0 and 25 + new_progress = BoundBy(new_progress, 0, 25); + for (var i=0; i=2) + { + var old_progress = GetChar(progress_string,1)-GetChar("A"); + // If old progress was better than new progress, keep old progress + new_progress = Max(old_progress, new_progress); + } + // Set new progress + SetLeagueProgressData(Format("A%c", GetChar("A") + new_progress), plrid); + SetLeaguePerformance(new_score, plrid); + } + return true; +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/NoSeed.c b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/NoSeed.c new file mode 100644 index 000000000..37c0f20ad --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/NoSeed.c @@ -0,0 +1,10 @@ +/* Plants don't reproduce */ + +#appendto Library_Plant + +protected func Construction() +{ + var r = _inherited(...); + RemoveTimer("Seed"); + return r; +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/ToolSpawn.c b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/ToolSpawn.c new file mode 100644 index 000000000..4a5b61981 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/ToolSpawn.c @@ -0,0 +1,11 @@ +/* Save tool_spawn property to scenario */ +// tool_spawn is evaluated by scenario script + +#appendto Chest + +public func SaveScenarioObject(props) +{ + if (!inherited(props, ...)) return false; + if (this.tool_spawn) props->AddSet("ToolSpawn", this, "tool_spawn", this.tool_spawn); + return true; +} \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Teams.txt b/planet/Missions.ocf/TreasureHunt.ocs/Teams.txt new file mode 100644 index 000000000..e0f02c84a --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Teams.txt @@ -0,0 +1,4 @@ +[Teams] +Active=false +Custom=false +AutoGenerateTeams=true diff --git a/planet/Missions.ocf/TreasureHunt.ocs/Title.txt b/planet/Missions.ocf/TreasureHunt.ocs/Title.txt new file mode 100644 index 000000000..1a64596e3 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/Title.txt @@ -0,0 +1,2 @@ +DE:Schatzsuche +US:Treasure hunt \ No newline at end of file diff --git a/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/DefCore.txt b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/DefCore.txt new file mode 100644 index 000000000..43a53002c --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/DefCore.txt @@ -0,0 +1,5 @@ +[DefCore] +id=Goal_TreasureHunt +Version=5,2,0,1 +Category=C4D_StaticBack|C4D_Goal +Picture=0,0,128,128 diff --git a/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/Graphics.png b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/Graphics.png new file mode 100644 index 000000000..48219ed31 Binary files /dev/null and b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/Graphics.png differ diff --git a/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/Script.c b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/Script.c new file mode 100644 index 000000000..8eafe14b1 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/Script.c @@ -0,0 +1,61 @@ +/*-- + Treasure Hunt + Author: Sven2 + + Must find the treasure and sell it +--*/ + + +#include Library_Goal + +local is_fulfilled; + +public func IsFulfilled() { return is_fulfilled; } + +public func OnTreasureSold() { is_fulfilled = true; } + +public func GetDescription(int plr) +{ + var message; + if (IsFulfilled()) + message = "$MsgGoalFulfilled$"; + else + message = "$MsgGoalUnFulfilled$"; + return message; +} + +public func Activate(int byplr) +{ + if (IsFulfilled()) + ToggleGoalMessage(Format("$MsgGoalFulfilled$|$MsgSideGoal$", g_num_goldbars, MAX_GOLD_BARS), byplr); + else + ToggleGoalMessage(Format("$MsgGoalUnFulfilled$|$MsgSideGoal$", g_num_goldbars, MAX_GOLD_BARS), byplr); + return; +} + +// Shows or hides a message window with information. +private func ToggleGoalMessage(string msg, int plr) +{ + // If goal message open -> hide it. + if (GetEffect("GoalMessage", this)) + { + CustomMessage("", nil, plr, nil, nil, nil, nil, nil, MSG_HCenter); + RemoveEffect("GoalMessage", this); + return; + } + // Otherwise open a new message. + AddEffect("GoalMessage", this, 100, 0, this); + CustomMessage(Format("@%s", msg), nil, plr, 0, 16 + 64, 0xffffff, GUI_MenuDeco, this, MSG_HCenter); + return; +} + +protected func FxGoalMessageStart() {} + + +public func GetShortDescription(int plr) +{ + return Name; +} + +/*-- Proplist --*/ +local Name = "$Name$"; diff --git a/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/StringTblDE.txt b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/StringTblDE.txt new file mode 100644 index 000000000..3673e7a41 --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/StringTblDE.txt @@ -0,0 +1,4 @@ +Name=Schatzsuche +MsgSideGoal=Sekundärziel: %d von %d Goldbarren gefunden. +MsgGoalFulfilled=Schatz gefunden und verkauft :-) +MsgGoalUnFulfilled=Schatz noch nicht gefunden und verkauft :-( diff --git a/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/StringTblUS.txt b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/StringTblUS.txt new file mode 100644 index 000000000..af03f94fe --- /dev/null +++ b/planet/Missions.ocf/TreasureHunt.ocs/TreasureHunt.ocd/StringTblUS.txt @@ -0,0 +1,4 @@ +Name=Treasure hunt +MsgSideGoal=Side goal: %d of %d gold bars found. +MsgGoalFulfilled=Treasure found and sold. +MsgGoalUnFulfilled=Treasure not yet found and sold yet. diff --git a/planet/Objects.ocd/Clonk.ocd/Script.c b/planet/Objects.ocd/Clonk.ocd/Script.c index 7d94f5462..0cbd1ad87 100644 --- a/planet/Objects.ocd/Clonk.ocd/Script.c +++ b/planet/Objects.ocd/Clonk.ocd/Script.c @@ -208,6 +208,23 @@ func DigOutObject(object obj) return false; } +// Building material bridges (like loam bridge) +func Bridge() +{ + var proc = GetProcedure(); + // Clonk must stand on ground. Allow during SCALE; but Clonk won't keep animation if he's not actually near the ground + if (proc != "WALK" && proc != "SCALE") + return false; + if (proc == "WALK") + SetAction("BridgeStand"); + else + SetAction("BridgeScale"); + SetComDir(COMD_Stop); + SetXDir(0); + SetYDir(0); + return true; +} + /* Status */ // TODO: Make this more sophisticated, readd turn animation and other @@ -216,6 +233,7 @@ public func IsClonk() { return true; } public func IsJumping(){return WildcardMatch(GetAction(), "*Jump*");} public func IsWalking(){return GetProcedure() == "WALK";} +public func IsBridging(){return WildcardMatch(GetAction(), "Bridge*");} /* Carry items on the clonk */ @@ -315,8 +333,6 @@ func DoUpdateAttach(bool sec) iHandMesh[sec] = AttachMesh(obj, pos_hand, bone, trans); PlayAnimation(closehand, 6, Anim_Const(GetAnimationLength(closehand)), Anim_Const(1000)); } - else - ; // Don't display } else if(iAttachMode == CARRY_HandBack) { @@ -346,8 +362,6 @@ func DoUpdateAttach(bool sec) PlayAnimation("CarryArms", 6, Anim_Const(obj->~GetCarryPhase(this)), Anim_Const(1000)); fBothHanded = 1; } - else - ; // Don't display } else if(iAttachMode == CARRY_Spear) { @@ -420,7 +434,7 @@ func HasHandAction(sec, just_wear) func HasActionProcedure() { var action = GetAction(); - if (action == "Walk" || action == "Jump" || action == "WallJump" || action == "Kneel" || action == "Ride") + if (action == "Walk" || action == "Jump" || action == "WallJump" || action == "Kneel" || action == "Ride" || action == "BridgeStand") return true; return false; } @@ -536,6 +550,12 @@ func QueryCatchBlow(object obj) var r=0; var e=0; var i=0; + // Blocked by object effects? + while(e=GetEffect("*", obj, i++)) + if(EffectCall(obj, e, "QueryHitClonk", this)) + return true; + // Blocked by Clonk effects? + i=0; while(e=GetEffect("*Control*", this, i++)) { if(EffectCall(this, e, "QueryCatchBlow", obj)) @@ -546,6 +566,7 @@ func QueryCatchBlow(object obj) } if(r) return r; + // No blocking return _inherited(obj, ...); } @@ -736,9 +757,9 @@ Dig = { // InLiquidAction = "Swim", Attach = CNAT_Left | CNAT_Right | CNAT_Bottom, }, -Bridge = { +BridgeStand = { Prototype = Action, - Name = "Bridge", + Name = "BridgeStand", Procedure = DFA_THROW, Directions = 2, Length = 16, @@ -747,7 +768,22 @@ Bridge = { Y = 60, Wdt = 8, Hgt = 20, - NextAction = "Bridge", + NextAction = "BridgeStand", + StartCall = "StartStand", + InLiquidAction = "Swim", +}, +BridgeScale = { + Prototype = Action, + Name = "BridgeScale", + Procedure = DFA_THROW, + Directions = 2, + Length = 16, + Delay = 1, + X = 0, + Y = 60, + Wdt = 8, + Hgt = 20, + NextAction = "BridgeScale", InLiquidAction = "Swim", }, Swim = { diff --git a/planet/Objects.ocd/Environment.ocd/Cloud.ocd/Lightning.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/Cloud.ocd/Lightning.ocd/Script.c index a02ef5cdc..b48dec654 100644 --- a/planet/Objects.ocd/Environment.ocd/Cloud.ocd/Lightning.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/Cloud.ocd/Lightning.ocd/Script.c @@ -60,7 +60,7 @@ protected func FxLightningMoveTimer() { if (obj && !obj->~LightningStrike(3 + strength / 10)) { - if (GetOCF() & OCF_Alive) + if (obj->GetOCF() & OCF_Alive) Punch(obj, 3 + strength / 10); else // Todo: Lightning strikes may have controllers? Pass them for kill tracing. diff --git a/planet/Objects.ocd/Environment.ocd/Earthquake.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/Earthquake.ocd/Script.c index 6e9d251ab..626ea200b 100644 --- a/planet/Objects.ocd/Environment.ocd/Earthquake.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/Earthquake.ocd/Script.c @@ -118,7 +118,7 @@ protected func FxIntEarthquakeTimer(object target, effect, int time) dx = Random(str * 4 + 1) - str * 2; dy = Random(str * 4 + 1) - str * 2; cnt++; - } while (!GBackSemiSolid(x + dx, y + dy) && cnt < 10) + } while (!GBackSemiSolid(x + dx, y + dy) && cnt < 10); // No continuation. if (cnt >= 10) return FX_Execute_Kill; diff --git a/planet/Objects.ocd/Goals.ocd/DeathMatch.ocd/Script.c b/planet/Objects.ocd/Goals.ocd/DeathMatch.ocd/Script.c index 3887eb32d..2c22bc5fe 100644 --- a/planet/Objects.ocd/Goals.ocd/DeathMatch.ocd/Script.c +++ b/planet/Objects.ocd/Goals.ocd/DeathMatch.ocd/Script.c @@ -91,7 +91,8 @@ public func IsFulfilled() if(GetKillCount(GetPlayerByIndex(i)) >= maxkills) winner = GetPlayerByIndex(i); if (winner == nil) - return false; + // Otherwise just check if there are no enemies + return Goal_Melee->IsFulfilled(); // Eliminate all players, that are not in a team with one of the winners for (var i = 0; i < GetPlayerCount(); i++) { diff --git a/planet/Objects.ocd/Items.ocd/Resources.ocd/Ice.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Resources.ocd/Ice.ocd/Script.c index 232245fa3..149b4c074 100644 --- a/planet/Objects.ocd/Items.ocd/Resources.ocd/Ice.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Resources.ocd/Ice.ocd/Script.c @@ -2,7 +2,7 @@ protected func Hit() { - Sound("CrystalHit?"); + Sound("GlassHit?"); } protected func Construction() @@ -34,6 +34,9 @@ private func Freeze() DoCon(1); } +func IsLiquid() { return "Water"; } +func GetLiquidAmount() { return GetCon()*2; } + local Collectible = 1; local Name = "$Name$"; local Description = "$Description$"; diff --git a/planet/Objects.ocd/Items.ocd/Resources.ocd/Loam.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Resources.ocd/Loam.ocd/Script.c index ba37f6be8..348561c61 100644 --- a/planet/Objects.ocd/Items.ocd/Resources.ocd/Loam.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Resources.ocd/Loam.ocd/Script.c @@ -18,19 +18,11 @@ func Hit() // Item activation func ControlUseStart(object clonk, int x, int y) { - // Clonk must stand on ground. Allow during SCALE; but Clonk won't keep animation if he's not actually near the ground - var clnk_proc = clonk->GetProcedure(); - if (clnk_proc != "WALK" && clnk_proc != "SCALE") + if (!(clonk->~Bridge())) { clonk->CancelUse(); return true; } - - // Gfx - clonk->SetAction("Bridge"); - clonk->SetComDir(COMD_Stop); - clonk->SetXDir(0); - clonk->SetYDir(0); // Add bridge effect and pass target coordinates. AddEffect("IntBridge", clonk, 1, 1, this, nil, x, y); @@ -58,7 +50,7 @@ func FxIntBridgeStart(object clonk, proplist effect, int temp, int x, int y) func FxIntBridgeTimer(object clonk, proplist effect, int time) { // something happened - don't try to dig anymore - if (clonk->GetAction() != "Bridge") + if (!(clonk->~IsBridging())) { clonk->CancelUse(); return true; @@ -145,7 +137,7 @@ public func ControlUseCancel(object clonk, int x, int y) private func LoamDone(object clonk) { // Get out of animation - if (clonk->GetAction() == "Bridge") + if (clonk->IsBridging()) { clonk->SetAction("Walk"); clonk->SetComDir(COMD_Stop); diff --git a/planet/Objects.ocd/Items.ocd/Resources.ocd/Snow.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Resources.ocd/Snow.ocd/Script.c index 8959b2187..e249fe1ac 100644 --- a/planet/Objects.ocd/Items.ocd/Resources.ocd/Snow.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Resources.ocd/Snow.ocd/Script.c @@ -25,6 +25,9 @@ private func Hit() RemoveObject(); } +func IsLiquid() { return "Water"; } +func GetLiquidAmount() { return GetCon(); } + local Collectible = 1; local Name = "$Name$"; local Description = "$Description$"; diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/Axe.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/Axe.ocd/Script.c index f5a4d26d2..189f12e7e 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/Axe.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/Axe.ocd/Script.c @@ -196,7 +196,7 @@ func FxIntAxeTimer(object clonk, effect, int time) particles = {Prototype = Particles_WoodChip(), Attach = ATTACH_Back}; clonk->CreateParticle("WoodChip", x, 4, PV_Random(-12, 12), PV_Random(-13, -6), PV_Random(36 * 3, 36 * 10), particles, 10); // Damage tree - effect.tree->DoDamage(this.ChopStrength, 3, clonk->GetOwner()); // 3 = FX_Call_DmgChop + effect.tree->DoDamage(this.ChopStrength, FX_Call_DmgChop, clonk->GetOwner()); } //Make sure the clonk does not move clonk->SetComDir(COMD_Stop); diff --git a/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c index 7ba6be484..0085d4aa1 100644 --- a/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Tools.ocd/TeleGlove.ocd/Script.c @@ -217,6 +217,7 @@ public func LostTargetObject(object target) global func FxTeleGloveReleasedStart(object target, effect) { + effect.t0 = FrameCounter(); return; } @@ -230,6 +231,11 @@ global func FxTeleGloveWeightStop(object target, int num, int reason, bool temp) target->SetMass(target->GetDefCoreVal("Mass", "DefCore")); } +// Damaging Clonks with moving objects makes this tool stupidly strong. So it's blocked +// while moving the object and a few frames after release +global func FxTeleGloveWeightQueryHitClonk(object target, fx, object clonk) { return true; } +global func FxTeleGloveReleasedQueryHitClonk(object target, fx, object clonk) { return FrameCounter()-fx.t0 <= 5; } + protected func ControlUseStop(object clonk, ix, iy) { CancelUse(clonk); diff --git a/planet/Objects.ocd/Items.ocd/Weapons.ocd/GrenadeLauncher.ocd/Script.c b/planet/Objects.ocd/Items.ocd/Weapons.ocd/GrenadeLauncher.ocd/Script.c index 43fb517c0..411aa5f82 100644 --- a/planet/Objects.ocd/Items.ocd/Weapons.ocd/GrenadeLauncher.ocd/Script.c +++ b/planet/Objects.ocd/Items.ocd/Weapons.ocd/GrenadeLauncher.ocd/Script.c @@ -134,7 +134,7 @@ public func FinishedAiming(object clonk, int angle) if(!loaded) return; // Fire - if(Contents(0) && Contents(0)->IsGrenadeLauncherAmmo()) + if(Contents(0) && Contents(0)->~IsGrenadeLauncherAmmo()) FireWeapon(clonk, angle); clonk->StartShoot(this); return true; diff --git a/planet/Objects.ocd/Libraries.ocd/Base.ocd/BaseMaterial.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Base.ocd/BaseMaterial.ocd/Script.c index fafe6e37c..d375be40c 100644 --- a/planet/Objects.ocd/Libraries.ocd/Base.ocd/BaseMaterial.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Base.ocd/BaseMaterial.ocd/Script.c @@ -1,183 +1,330 @@ -/*--- The Base ---*/ - -// Author: Randrian -// TODO -> torough explanation how to use it - -func Initialize() -{ - var iPlrNumber = GetOwner()%4+1; - var szSection = Format("Player%d", iPlrNumber); // TODO: Check teams and get the fitting player section +/** + Base Material & Production + Library to control the players base material and production. The initial values are read + from the Scenario.txt entries and per script one can modify these by: + * GetBaseMaterial(int plr, id def, int index, int category) + * SetBaseMaterial(int plr, id def, int cnt) + * DoBaseMaterial(int plr, id def, int change) + * GetBaseProduction(int plr, id def, int index, int category) + * SetBaseProduction(int plr, id def, int cnt) + * DoBaseProduction(int plr, id def, int change) + Performs also two callbacks to a base of the player: + * OnBaseMaterialChange(id def, int change); + * OnBaseProductionChange(id def, int change); - aHomebaseMaterial = []; - aHomabaseProduction = []; - var iIndex; - var idID, iCount; - while(1) + @author Randrian, Maikel +*/ + + +// Local variables to store the player's material and production. +// Is an array filled with [id, count] arrays. +local base_material; +local base_production; +local production_unit = 0; + +// Maximum number of material. +static const BASEMATERIAL_MaxBaseMaterial = 25; +// Maximum number of production. +static const BASEMATERIAL_MaxBaseProduction = 10; +// Produce every X frames (currently set to a minute). +static const BASEMATERIAL_ProductionRate = 2160; + + +/*-- Global interface --*/ + +global func GetBaseMaterial(int plr, id def, int index, int category) +{ + var base = FindObject(Find_ID(BaseMaterial), Find_Owner(plr)); + if (!base) + base = CreateObject(BaseMaterial, AbsX(10), AbsY(10), plr); + if (base) + return base->GetBaseMat(def, index, category); +} + +global func SetBaseMaterial(int plr, id def, int cnt) +{ + var base = FindObject(Find_ID(BaseMaterial), Find_Owner(plr)); + if (!base) + base = CreateObject(BaseMaterial, AbsX(10), AbsY(10), plr); + if (base) + return base->SetBaseMat(def, cnt); +} + +global func DoBaseMaterial(int plr, id def, int change) +{ + var base = FindObject(Find_ID(BaseMaterial), Find_Owner(plr)); + if (!base) + base = CreateObject(BaseMaterial, AbsX(10), AbsY(10), plr); + if (base) + return base->DoBaseMat(def, change); +} + +global func GetBaseProduction(int plr, id def, int index, int category) +{ + var base = FindObject(Find_ID(BaseMaterial), Find_Owner(plr)); + if (!base) + base = CreateObject(BaseMaterial, AbsX(10), AbsY(10), plr); + if (base) + return base->GetBaseProd(def, index, category); +} + +global func SetBaseProduction(int plr, id def, int cnt) +{ + var base = FindObject(Find_ID(BaseMaterial), Find_Owner(plr)); + if (!base) + base = CreateObject(BaseMaterial, AbsX(10), AbsY(10), plr); + if (base) + return base->SetBaseProd(def, cnt); +} + +global func DoBaseProduction(int plr, id def, int change) +{ + var base = FindObject(Find_ID(BaseMaterial), Find_Owner(plr)); + if (!base) + base = CreateObject(BaseMaterial, AbsX(10), AbsY(10), plr); + if (base) + return base->DoBaseProd(def, change); +} + + +/*-- Object Interface --*/ + +protected func Initialize() +{ + // Gather base materials based on Scenario.txt player entries. + // TODO: Check teams and get the fitting player section + var plr = GetOwner() % 4 + 1; + var section = Format("Player%d", plr); + + // Initialize arrays for material and production. + base_material = []; + base_production = []; + + // Load materials from Scenario.txt + var index; + var def, count; + while (true) { - idID = GetScenarioVal ("HomeBaseMaterial", szSection, iIndex*2); - iCount = GetScenarioVal ("HomeBaseMaterial", szSection, iIndex*2+1); - if(!idID && !iCount) break; - if(idID) - aHomebaseMaterial[GetLength(aHomebaseMaterial)] = [idID, iCount]; - iIndex++; + def = GetScenarioVal("BaseMaterial", section, index * 2); + count = GetScenarioVal("BaseMaterial", section, index * 2 + 1); + if (!def && !count) break; + if (def) + PushBack(base_material, [def, count]); + index++; } - iIndex = 0; - while(1) + + // Load production from Scenario.txt + index = 0; + while (true) { - idID = GetScenarioVal ("HomeBaseProduction", szSection, iIndex*2); - iCount = GetScenarioVal ("HomeBaseProduction", szSection, iIndex*2+1); - if(!idID && !iCount) break; - if(idID) - aHomabaseProduction[GetLength(aHomabaseProduction)] = [idID, iCount]; - iIndex++; + def = GetScenarioVal("BaseProduction", section, index * 2); + count = GetScenarioVal("BaseProduction", section, index * 2 + 1); + if (!def && !count) break; + if (def) + PushBack(base_production, [def, count]); + index++; } - AddTimer("ExecHomeBaseProduction", 2100); + + // Add a timer for executing base production. + AddTimer("ExecBaseProduction", BASEMATERIAL_ProductionRate); + return; } -static const BaseMaterial_MaxHomeBaseProduction = 25; - -local ProductionUnit; - -func ExecHomeBaseProduction() +// Called every minute and updates the materials according to production. +public func ExecBaseProduction() { - // Do not exec if no base is around - if(!FindBase(GetOwner())) return; - - // Called every minute - ProductionUnit++; - var aArray; - // Look at all productions - for (aArray in aHomabaseProduction) - // if this id is produced check if it isn't already full - if (aArray[1]>0) - if (ProductionUnit % BoundBy(11-aArray[1],1,10) == 0) - if (DoGetHomebaseMaterial(aArray[0])DoGetHomebaseMaterial(idDef, iIndex, dwCategory); -} - -global func GetHomebaseProduction (int iPlr, id idDef, int iIndex, int dwCategory) -{ - var pObj = FindObject(Find_ID(BaseMaterial), Find_Owner(iPlr)); - if(!pObj) pObj = CreateObject(BaseMaterial,AbsX(10),AbsY(10),iPlr); - if(pObj) return pObj->DoGetHomebaseProduction(idDef, iIndex, dwCategory); -} - -global func DoHomebaseMaterial (int iPlr, id idID, int iChange) -{ - var pObj = FindObject(Find_ID(BaseMaterial), Find_Owner(iPlr)); - if(!pObj) pObj = CreateObject(BaseMaterial,AbsX(10),AbsY(10),iPlr); - if(pObj) return pObj->DoDoHomebaseMaterial(idID, iChange); -} - -global func DoHomebaseProduction (int iPlr, id idID, int iChange) -{ - var pObj = FindObject(Find_ID(BaseMaterial), Find_Owner(iPlr)); - if(!pObj) pObj = CreateObject(BaseMaterial,AbsX(10),AbsY(10),iPlr); - if(pObj) return pObj->DoDoHomebaseProduction(idID, iChange); -} - -// ---------------------------------------------------------------------- - -public func DoGetHomebaseMaterial (id idDef, int iIndex, int dwCategory) -{ - var aArray; - var iCount = 0; - // An ID given? Then try to get the count - if(idDef) + production_unit++; + // Look at all production. + for (var combo in base_production) { - for(aArray in aHomebaseMaterial) - if(aArray[0] == idDef) - return aArray[1]; + // Check if this id is produced and check if it isn't already full. + if (combo[1] > 0 && GetBaseMat(combo[0]) < BASEMATERIAL_MaxBaseMaterial) + { + // Produce the material every production value / BASEMATERIAL_MaxBaseProduction times. + if (production_unit % BoundBy(BASEMATERIAL_MaxBaseProduction + 1 - combo[1], 1, BASEMATERIAL_MaxBaseProduction) == 0) + DoBaseMat(combo[0], 1); + } + } + return; +} + +public func GetBaseMat(id def, int index, int category) +{ + // Get the count if the id is given. + if (def) + { + for (var combo in base_material) + if (combo[0] == def) + return combo[1]; return nil; } - // A index given? Look for the id - if (!dwCategory) dwCategory = 0xffffff; - for(aArray in aHomebaseMaterial) + // If an index is given look for the id. + if (!category) + category = 0xffffff; + var count = 0; + for (var combo in base_material) { - if(aArray[0]->GetCategory() & dwCategory) + if (combo[0]->GetCategory() & category) { - if(iCount == iIndex) return aArray[0]; - iCount++; + if (count == index) + return combo[0]; + count++; } } + return; } -public func DoGetHomebaseProduction (id idDef, int iIndex, int dwCategory) +public func SetBaseMat(id def, int cnt) { - var aArray; - var iCount = 0; - // An ID given? Then try to get the count - if(idDef) + if (cnt == nil) + return; + cnt = Max(0, cnt); + var change = 0; + // Scan through current list of id's and set material if available. + var found = false; + for (var index = 0; index < GetLength(base_material); ++index) { - for(aArray in aHomabaseProduction) - if(aArray[0] == idDef) - return aArray[1]; - return nil; - } - // A index given? Look for the id - for(aArray in aHomabaseProduction) - { - if(aArray[0]->GetCategory() & dwCategory) + if (base_material[index][0] == def) { - if(iCount == iIndex) return aArray[0]; - iCount++; + change = cnt - base_material[index][1]; + base_material[index][1] = cnt; + found = true; } } + // If material is not available add it to the existing list. + if (!found) + { + change = cnt; + PushBack(base_material, [def, cnt]); + } + // Callback to the bases of the player. + var i = 0, base; + while (base = FindBase(GetOwner(), i++)) + base->~OnBaseMaterialChange(def, change); + return; } -public func DoDoHomebaseMaterial (id idID, int iChange) +public func DoBaseMat(id def, int change) { - if(iChange == 0) return; - var aArray; - var iIndex = 0; - for(aArray in aHomebaseMaterial) + if (change == 0) + return; + // Scan through current list of id's and increase material if available. + var found = false; + for (var index = 0; index < GetLength(base_material); ++index) { - if(aArray[0] == idID) + if (base_material[index][0] == def) { - aHomebaseMaterial[iIndex][1] += iChange; - // Callback to the bases of the player - var i = 0, pBase; - while(pBase = FindBase(GetOwner(), i++)) - pBase->~OnHomebaseMaterialChange(); - return true; + // Change must at least be minus the original value. + change = Max(change, -base_material[index][1]); + base_material[index][1] += change; + found = true; } - iIndex++; } - return false; + // If material is not available add it to the existing list. + if (!found) + { + // Change must at least be zero. + change = Max(change, 0); + PushBack(base_material, [def, Max(change, 0)]); + } + // Callback to the bases of the player. + var i = 0, base; + while (base = FindBase(GetOwner(), i++)) + base->~OnBaseMaterialChange(def, change); + return; } -public func DoDoHomebaseProduction (id idID, int iChange) +public func GetBaseProd(id def, int index, int category) { - if(iChange == 0) return; - var aArray; - var iIndex = 0; - for(aArray in aHomabaseProduction) + // Get the count if the id is given. + if (def) { - if(aArray[0] == idID) - { - aHomabaseProduction[iIndex][1] += iChange; - return true; - } - iIndex++; + for (var combo in base_production) + if (combo[0] == def) + return combo[1]; + return; } - return false; + // If an index is given look for the id. + if (!category) + category = 0xffffff; + var count = 0; + for (var combo in base_production) + { + if (combo[0]->GetCategory() & category) + { + if (count == index) + return combo[0]; + count++; + } + } + return; } -// Internal management object not saved. -// Use Scenario.txt to adjust homebase material +public func SetBaseProd(id def, int cnt) +{ + if (cnt == nil) + return; + cnt = Max(0, cnt); + var change = 0; + // Scan through current list of id's and set production if available. + var found = false; + for (var index = 0; index < GetLength(base_production); ++index) + { + if (base_production[index][0] == def) + { + change = cnt - base_production[index][1]; + base_production[index][1] = cnt; + found = true; + } + } + // If material is not available add it to the existing list. + if (!found) + { + change = cnt; + PushBack(base_production, [def, cnt]); + } + // Callback to the bases of the player. + var i = 0, base; + while (base = FindBase(GetOwner(), i++)) + base->~OnBaseProductionChange(def, change); + return; +} + +public func DoBaseProd(id def, int change) +{ + if (change == 0) + return; + // Scan through current list of id's and increase production if available. + var found = false; + for (var index = 0; index < GetLength(base_production); ++index) + { + if (base_production[index][0] == def) + { + // Change must at least be minus the original value. + change = Max(change, -base_production[index][1]); + base_production[index][1] += change; + found = true; + } + } + // If production is not available add it to the existing list. + if (!found) + { + // Change must at least be zero. + change = Max(change, 0); + PushBack(base_production, [def, Max(change, 0)]); + } + // Callback to the bases of the player. + var i = 0, base; + while (base = FindBase(GetOwner(), i++)) + base->~OnBaseProductionChange(def, change); + return; +} + + +/*-- Miscellaneous --*/ + +// Internal management object not saved. Use Scenario.txt or script +// to adjust base materials and production. func SaveScenarioObject() { return false; } local Name = "$Name$"; diff --git a/planet/Objects.ocd/Libraries.ocd/Base.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Base.ocd/Script.c index 2a19711d7..5e89f6f40 100644 --- a/planet/Objects.ocd/Libraries.ocd/Base.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Base.ocd/Script.c @@ -39,11 +39,11 @@ public func CanBlockEnemies() { return true; } func GetBuyObject(int iIndex) { var aBuy = [0,0]; - var idDef = GetHomebaseMaterial(GetOwner(), nil, iIndex, C4D_All); + var idDef = GetBaseMaterial(GetOwner(), nil, iIndex, C4D_All); aBuy[0] = idDef; - aBuy[1] = GetHomebaseMaterial(GetOwner(), idDef, 0); + aBuy[1] = GetBaseMaterial(GetOwner(), idDef, 0); if(!idDef) return nil; - // The default implementation returns the Homebasemaerial of the playeer + // The default implementation returns the Basematerial of the playeer return aBuy; } @@ -71,14 +71,14 @@ func GetBuyValue(id idObj) } // change the amount of buyable material -func DoBaseMaterial(id idDef, int iCount) +func ChangeBaseMaterial(id idDef, int iCount) { - // by default use Homebase engine function - DoHomebaseMaterial(GetOwner(), idDef, iCount); + // by default use base engine function + DoBaseMaterial(GetOwner(), idDef, iCount); // this should also call UpdateClonkBuyMenus() if the standart function isn't used } -public func OnHomebaseMaterialChange() +public func OnBaseMaterialChange(id def, int change) { // and update the buy menu UpdateClonkBuyMenus(); @@ -209,7 +209,7 @@ func OpenBuyMenu(object pClonk, id idDef, int iSelection) var aBuy = [0,0,0]; var iIndex, iSelection; AddClonkBuyList(pClonk); - pClonk->CreateMenu (Library_Base, this, C4MN_Extra_Value, "$TxtNothingToBuy$", 0, C4MN_Style_Normal, 0, C4Id("BuyMenu")); + pClonk->CreateMenu (Library_Base, this, C4MN_Extra_Value, "$TxtNothingToBuy$", 0, C4MN_Style_Normal); for(aBuy in GetBuyObjects()) { if(aBuy[0] == idDef) iSelection = iIndex; @@ -228,7 +228,7 @@ func BuyDummy(id idDef, object pClonk, bool bRight, int iValue) func DoBuy(id idDef, int iForPlr, int iPayPlr, object pClonk, bool bRight, bool fShowErrors) { - if(!GetHomebaseMaterial(iPayPlr, idDef)) return; //TODO + if(!GetBaseMaterial(iPayPlr, idDef)) return; //TODO var iValue = GetBuyValue(idDef); // Has the clonk enought money? if(iValue > GetWealth(iPayPlr)) @@ -245,7 +245,7 @@ func DoBuy(id idDef, int iForPlr, int iPayPlr, object pClonk, bool bRight, bool DoWealth(iPayPlr, -iValue); Sound("UnCash", 0, 100, iForPlr+1); // TODO: get sound // Decrease the Basematerial - DoBaseMaterial(idDef, -1); + ChangeBaseMaterial(idDef, -1); // Deliver the object var pObj = CreateContents(idDef); pObj->SetOwner(iForPlr); @@ -369,7 +369,7 @@ func DoSell(object pObj, int iPlr, bool bRight) DoWealth(iPlr, GetSellValue(pObj)); Sound("Cash", 0, 100, iPlr+1); // TODO: get sound if(pObj.Rebuy) - DoBaseMaterial(pObj->GetID(), 1); + ChangeBaseMaterial(pObj->GetID(), 1); // right clicked? then sell other objects too var pNewObj; var bFound; diff --git a/planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c index 82feb034c..09ad7d462 100644 --- a/planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c @@ -439,6 +439,10 @@ public func CheckLiquids(id product, bool remove) for (var liq_container in FindObjects(Find_Container(this), Find_Func("IsLiquidContainer"))) if (liq_container->~GetBarrelMaterial() == liquid) liquid_amount += liq_container->~GetFillLevel(); + // Find objects that "are" liquid (e.g. ice) + for (var liq_object in FindObjects(Find_Container(this), Find_Func("IsLiquid"))) + if (liq_object->~IsLiquid() == liquid) + liquid_amount += liq_object->~GetLiquidAmount(); if (liquid_amount < need) return false; else if (remove) @@ -450,8 +454,16 @@ public func CheckLiquids(id product, bool remove) var val = liq_container->~GetLiquid(liquid, need - extracted); extracted += val[1]; if (extracted >= need) - break; - } + return true; + } + for (var liq_object in FindObjects(Find_Container(this), Find_Func("IsLiquid"))) + { + if (liq_object->~IsLiquid() != liquid) continue; + extracted += liq_object->~GetLiquidAmount(); + liq_object->RemoveObject(); + if (extracted >= need) + break; + } } } return true; @@ -681,9 +693,26 @@ protected func RejectEntrance(object obj) if (FuelNeed(product) > 0) if (obj->~IsFuel()) return false; +<<<<<<< HEAD // Liquid containers may be collected if a product needs them. if (LiquidNeed(product)) if (obj->~IsLiquidContainer()) +======= + } + // Liquid objects may be collected if a product needs them. + if (obj->~IsLiquid()) + { + for (var product in GetProducts()) + if (LiquidNeed(product)) + if (LiquidNeed(product)[0] == obj->~IsLiquid()) + return false; + } + // Liquid containers may be collected if a product needs them. + if (obj->~IsLiquidContainer()) + { + for (var product in GetProducts()) + if (LiquidNeed(product)) +>>>>>>> remotes/origin/master return false; // Material containers may be collected if a product needs them. if (MaterialNeed(product)) diff --git a/planet/Objects.ocd/Rules.ocd/Restart.ocd/Script.c b/planet/Objects.ocd/Rules.ocd/Restart.ocd/Script.c index f143e3c9e..b12a6ae10 100644 --- a/planet/Objects.ocd/Rules.ocd/Restart.ocd/Script.c +++ b/planet/Objects.ocd/Rules.ocd/Restart.ocd/Script.c @@ -8,7 +8,12 @@ public func Activate(int plr) // Remove the player's clonk, including contents. var clonk = GetCrew(plr); if (clonk) + { + while (clonk->Contents()) + clonk->Contents()->RemoveObject(); + clonk->Kill(clonk, true); clonk->RemoveObject(); + } } local Name = "$Name$"; diff --git a/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Script.c index 5d0fce55c..018e2c89d 100644 --- a/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/Elevator.ocd/Script.c @@ -106,19 +106,19 @@ func LostCase() func StartEngine() { - Sound("ElevatorStart", nil, nil, nil, nil, 100); + Sound("ElevatorStart", nil, nil, nil, nil, 400); ScheduleCall(this, "EngineLoop", 34); //Sound("ElevatorMoving", nil, nil, nil, 1); } func EngineLoop() { - Sound("ElevatorMoving", nil, nil, nil, 1, 100); + Sound("ElevatorMoving", nil, nil, nil, 1, 400); } func StopEngine() { Sound("ElevatorMoving", nil, nil, nil, -1); ClearScheduleCall(this, "EngineLoop"); - Sound("ElevatorStop", nil, nil, nil, nil, 100); + Sound("ElevatorStop", nil, nil, nil, nil, 400); } /* Construction */ diff --git a/planet/Objects.ocd/Structures.ocd/Flagpole.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/Flagpole.ocd/Script.c index 5919afcdc..262f20492 100644 --- a/planet/Objects.ocd/Structures.ocd/Flagpole.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/Flagpole.ocd/Script.c @@ -40,9 +40,9 @@ public func Interact(object clonk) { var menu; var i = 0, item, amount; - while (item = GetHomebaseMaterial(GetOwner(), nil, i++)) + while (item = GetBaseMaterial(GetOwner(), nil, i++)) { - amount = GetHomebaseMaterial(GetOwner(), item); + amount = GetBaseMaterial(GetOwner(), item); // Add even if amount==0 if (!menu) menu = clonk->CreateRingMenu(Flagpole, this); if (!menu) return false; @@ -69,7 +69,7 @@ public func Selected(object menu, proplist menu_item, bool alt) if (obj = Contents(i)) Contents(i)->Exit(0, GetDefHeight() / 2); // Update available count - menu_item->SetAmount(GetHomebaseMaterial(GetOwner(), def)); + menu_item->SetAmount(GetBaseMaterial(GetOwner(), def)); menu->Show(); return true; } diff --git a/planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c b/planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c index 6caa1d633..c3ad8e9ef 100644 --- a/planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c +++ b/planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c @@ -17,6 +17,7 @@ public func ControlUp(object clonk) { if (GetAction() == "Still" && targetdoor) { + if (clonk) SetPlrView(clonk->GetController(), targetdoor); targetdoor->OpenDoor(); SetAction("SpinLeft"); Sound("Chain"); @@ -27,6 +28,7 @@ public func ControlDown(object clonk) { if (GetAction() == "Still" && targetdoor) { + if (clonk) SetPlrView(clonk->GetController(), targetdoor); targetdoor->CloseDoor(); SetAction("SpinRight"); Sound("Chain"); diff --git a/planet/Objects.ocd/Vegetation.ocd/LargeCaveMushroom.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/LargeCaveMushroom.ocd/Script.c index 31ecf917f..4f88fb908 100644 --- a/planet/Objects.ocd/Vegetation.ocd/LargeCaveMushroom.ocd/Script.c +++ b/planet/Objects.ocd/Vegetation.ocd/LargeCaveMushroom.ocd/Script.c @@ -8,7 +8,7 @@ func Place(int amount, proplist rectangle, proplist settings) if (settings == nil) settings = {}; // Default behaviour var plants = []; - var terraform = settings.terrafom ?? true; + var terraform = settings.terraform ?? true; var max_tries = 2 * amount; var loc_area = nil; diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/Airship.skeleton b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship.skeleton similarity index 100% rename from planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/Airship.skeleton rename to planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship.skeleton diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/DefCore.txt b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/DefCore.txt deleted file mode 100644 index 98500326a..000000000 --- a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/DefCore.txt +++ /dev/null @@ -1,7 +0,0 @@ -[DefCore] -id=Airship_Graphic -Version=5,2,0,1 -Width=64 -Height=54 -Offset=-32,-27 -Category=C4D_Vehicle \ No newline at end of file diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/Script.c deleted file mode 100644 index 79d95ac7a..000000000 --- a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/Script.c +++ /dev/null @@ -1,75 +0,0 @@ -/** - Airship Graphics - - @authors Ringwaul -*/ - -local propanim; -local parent; - -protected func Initialize() -{ - propanim = PlayAnimation("Flight", 5, Anim_Const(0), Anim_Const(1000)); - AddEffect("CheckParent", this, 1, 1,this); -} - -private func FxCheckParentTimer(object target, proplist effect, int timer) -{ - if (!parent) - target->RemoveObject(); - return; -} - -//Moves the propeller 1 tick per call -func AnimationForward() -{ - var i = 50; - //Loop animation - if(GetAnimationPosition(propanim) + i > GetAnimationLength("Flight")) - { - SetAnimationPosition(propanim, Anim_Const(GetAnimationPosition(propanim) + i - GetAnimationLength("Flight"))); - return 1; - } - - //advance animation - else - { - SetAnimationPosition(propanim, Anim_Const(GetAnimationPosition(propanim) + i)); - return 1; - } - //SoundEffect? -} - -public func GetTurnAngle() -{ - var dir = parent->GetAnimDir(); - var r = GetAnimationPosition(parent.turnanim) * 1242 / 10000; - - if (dir == DIR_Left) - r = 180 - r; - return r; -} - -public func SetAirshipParent(object airship) -{ - parent = airship; -} - -// Only save main airship object -func SaveScenarioObject() { return false; } - -local ActMap = { - Attach = { - Prototype = Action, - Name = "Attach", - Procedure = DFA_ATTACH, - Directions = 1, - X = 0, - Y = 0, - Wdt = 64, - Hgt = 54, - NextAction = "Attach", - }, -}; - -local Plane = 500; \ No newline at end of file diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/AirshipHitbox.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/AirshipHitbox.ocd/Script.c index ff941724e..2f67db78b 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/AirshipHitbox.ocd/Script.c +++ b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/AirshipHitbox.ocd/Script.c @@ -1,29 +1,16 @@ //Airship Hitbox -local parent; - -public func Initialize() -{ - AddEffect("CheckParent", this,1,1,this); -} - -private func FxCheckParentTimer(object target, proplist, int timer) -{ - if(!parent) target->RemoveObject(); -} - public func IsProjectileTarget(target,shooter) { return true; } -public func Damage(int change) +public func Damage(int change, int caused_by) { - //forward the damage to airship parent - parent->DoDamage(change); + //forward the damage to airship parent (losing the damage type) + var parent = GetActionTarget(); + if (parent) parent->DoDamage(change, nil, caused_by); else RemoveObject(); } -public func SetAirshipParent(object airship) -{ - parent = airship; -} +// remove if airship is lost +public func AttachTargetLost() { RemoveObject(); } // Only save main airship object func SaveScenarioObject() { return false; } diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/Graphics.mesh b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Graphics.mesh similarity index 100% rename from planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/Graphics.mesh rename to planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Graphics.mesh diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Graphics.png b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Graphics.png deleted file mode 100644 index 895d53234..000000000 Binary files a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Graphics.png and /dev/null differ diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/Scene.material b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Scene.material similarity index 100% rename from planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/Scene.material rename to planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Scene.material diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Script.c b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Script.c index 3d5a2d7ac..2e3e6f500 100644 --- a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Script.c +++ b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Script.c @@ -1,20 +1,14 @@ /** Airship - Lighter-than-air travel and transport vehicle. The airship uses several objects to function; the base control/collision object, - an attached graphics object (due to former engine limitations with solidmasks), and a hitbox for the balloon. + Lighter-than-air travel and transport vehicle. The airship uses an attached hitbox object for the balloon. @authors Ringwaul */ #include Library_AlignVehicleRotation - -// Attached modules -local graphic; -local hitbox; - // Graphic module variables for animation -local turnanim; +local propanim, turnanim; local throttle; @@ -32,20 +26,17 @@ protected func Initialize() SetComDir(COMD_None); throttle = 0; - //Create 3D Graphic - graphic = CreateObject(Airship_Graphic); - graphic->SetAction("Attach", this); - graphic->SetAirshipParent(this); + // init graphics + propanim = PlayAnimation("Flight", 5, Anim_Const(0), Anim_Const(1000)); //Create Hitbox - hitbox = CreateObject(Airship_Hitbox); - hitbox->SetAction("Attach", this); - hitbox->SetAirshipParent(this); + var hitbox = CreateObject(Airship_Hitbox); + hitbox->SetAction("Attach", this); // The airship starts facing left; so default to that value SetDir(DIR_Left); - turnanim = graphic->PlayAnimation("TurnLeft", 10, Anim_Const(graphic->GetAnimationLength("TurnLeft")), Anim_Const(1000)); + turnanim = PlayAnimation("TurnLeft", 10, Anim_Const(GetAnimationLength("TurnLeft")), Anim_Const(1000)); // Start the Airship behaviour AddEffect("IntAirshipMovement", this, 1, 1, this); @@ -69,17 +60,43 @@ public func FxIntAirshipMovementStart(object target, proplist effect, int tempor } +//Moves the propeller 1 tick per call +func AnimationForward() +{ + var i = 50; + //Loop animation + if(GetAnimationPosition(propanim) + i > GetAnimationLength("Flight")) + { + SetAnimationPosition(propanim, Anim_Const(GetAnimationPosition(propanim) + i - GetAnimationLength("Flight"))); + return 1; + } + + //advance animation + else + { + SetAnimationPosition(propanim, Anim_Const(GetAnimationPosition(propanim) + i)); + return 1; + } + //SoundEffect? +} + +public func GetTurnAngle() +{ + var dir = GetAnimDir(); + var r = GetAnimationPosition(turnanim) * 1242 / 10000; + + if (dir == DIR_Left) + r = 180 - r; + return r; +} + public func FxIntAirshipMovementTimer(object target, proplist effect, int time) { - // Cancel effect if there is no graphic. - if (!graphic) - return -1; - // Is the engine running? if (GetComDir() != COMD_Stop && AirshipPilot()) { //Turn the propeller - graphic->AnimationForward(); + AnimationForward(); // Emit engine smoke var i = 20; @@ -87,7 +104,7 @@ public func FxIntAirshipMovementTimer(object target, proplist effect, int time) // Is the airship facing right? if (effect.AnimDir == DIR_Right) i = -25; - if (graphic->GetAnimationPosition(turnanim) == graphic->GetAnimationLength("TurnLeft")) //Don't smoke if turning... airship blocks view + if (GetAnimationPosition(turnanim) == GetAnimationLength("TurnLeft")) //Don't smoke if turning... airship blocks view { var particles = { @@ -151,12 +168,12 @@ func TurnAirship(int to_dir) animName = "TurnRight"; StopAnimation(turnanim); - turnanim = graphic->PlayAnimation(animName, 10, Anim_Linear(0, 0, graphic->GetAnimationLength(animName), 36, ANIM_Hold), Anim_Const(1000)); + turnanim = PlayAnimation(animName, 10, Anim_Linear(0, 0, GetAnimationLength(animName), 36, ANIM_Hold), Anim_Const(1000)); SetAnimDir(to_dir); var g = gondola; - AlignObjectsToRotation(graphic, g[0],g[1],g[2],g[3]); + AlignObjectsToRotation(this, g[0],g[1],g[2],g[3]); return; } @@ -280,7 +297,6 @@ private func AirshipPilot() } /* -- Airship Destruction --*/ -//This command is called from the hitbox object func AirshipDeath() { @@ -289,7 +305,7 @@ func AirshipDeath() //Now let's copy it's animation, and hold it there var animspot; - animspot = graphic->GetAnimationPosition(turnanim); + animspot = GetAnimationPosition(turnanim); if(turnanim == -1) burntairship->PlayAnimation("TurnLeft", 10, Anim_Const(animspot), Anim_Const(1000)); else burntairship->PlayAnimation("TurnRight", 10, Anim_Const(animspot), Anim_Const(1000)); @@ -297,11 +313,6 @@ func AirshipDeath() //Set ruin on fire burntairship->Incinerate(); - //Remove the old graphic (which also stops airship behaviour, how nifty!) - graphic->RemoveObject(); - //Remove the hitbox - hitbox->RemoveObject(); - //Make sure engine sound is gone Sound("FanLoop",nil,nil,nil,-1); @@ -338,4 +349,5 @@ local Name = "$Name$"; local Description = "$Description$"; local Touchable = 2; local Rebuy = true; -local Plane = 275; +local Plane = 500; +local SolidMaskPlane = 275; \ No newline at end of file diff --git a/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/airship.jpg b/planet/Objects.ocd/Vehicles.ocd/Airship.ocd/airship.jpg similarity index 100% rename from planet/Objects.ocd/Vehicles.ocd/Airship.ocd/Airship3DGraphics.ocd/airship.jpg rename to planet/Objects.ocd/Vehicles.ocd/Airship.ocd/airship.jpg diff --git a/planet/Parkour.ocf/Maze.ocs/Map.c b/planet/Parkour.ocf/Maze.ocs/Map.c index 1f2b3da06..1ee2d7a61 100644 --- a/planet/Parkour.ocf/Maze.ocs/Map.c +++ b/planet/Parkour.ocf/Maze.ocs/Map.c @@ -79,8 +79,8 @@ func FindCaveConnections() // But since nothing really "breaks" on this occasion, just stick with the simple check for now. var has_overlap = false; for (check_link in all_links) - if (check_link[0] !== cave && check_link[1] !== cave) - if (check_link[0] !== cave2 && check_link[1] !== cave2) + if (check_link[0] != cave && check_link[1] != cave) + if (check_link[0] != cave2 && check_link[1] != cave2) if (IsLineOverlap(cave.X, cave.Y, cave2.X, cave2.Y, check_link[0].X, check_link[0].Y, check_link[1].X, check_link[1].Y)) { has_overlap=true; break; } if (has_overlap) continue; @@ -121,7 +121,7 @@ func MakeMaze() cave.depth = path_length; for (var cave2 in cave.links[:]) // force a copy because cave.links is modified in the loop { - if (path_length && cave2 === path_to_cave[path_length-1]) continue; + if (path_length && cave2 == path_to_cave[path_length-1]) continue; // Only first path survives if (cave2.path) { diff --git a/planet/System.ocg/Fire.c b/planet/System.ocg/Fire.c index f16f1fc6d..06fc2bcc8 100644 --- a/planet/System.ocg/Fire.c +++ b/planet/System.ocg/Fire.c @@ -286,7 +286,7 @@ global func FxFireTimer(object target, proplist effect, int time) { if ((time*10) % 100 <= effect.strength) { - target->DoDamage(2, true, FX_Call_DmgFire, effect.caused_by); + target->DoDamage(2, FX_Call_DmgFire, effect.caused_by); if (target && !Random(2) && !effect.no_burn_decay) target->DoCon(-1); } diff --git a/planet/System.ocg/LanguageDE.txt b/planet/System.ocg/LanguageDE.txt index 3e835d22b..f7947e940 100644 --- a/planet/System.ocg/LanguageDE.txt +++ b/planet/System.ocg/LanguageDE.txt @@ -173,6 +173,7 @@ IDS_CTL_TROUBLE=Problembehebung IDS_CTL_UPDATE=&Update IDS_CTL_USEOTHERSERVER=anderen Internetserver verwenden IDS_CTL_WON=gewonnen +IDS_DESC_AUTOFRAMESKIP=Ãœberspringt automatisch Grafikframes, wenn das Spiel stockt. IDS_DESC_AUTOMATICUPDATES=Prüft beim Programmstart einmal pro Tag, ob Updates für die installierte Version verfügbar sind. IDS_DESC_CHANGESTHEWAYCONTROLDATAI=Legt fest, wie Steuerungsdaten in Netzwerkspielen zwischen Client-Rechnern ausgetauscht werden. IDS_DESC_CHECKONLINEFORNEWVERSIONS=Sucht online nach Updates für diese Version. @@ -410,30 +411,6 @@ IDS_LEAGUE_LEAGUEREPORTINGUNEXPECTED=Liga: unerwarteter Verbindungsabbruch wird IDS_LEAGUE_WAITINGFORLASTLEAGUESERVE=Warten auf letzte Meldung des Ligaservers... IDS_LGA_INVALIDRESPONSE3=Ungültige Antwort des Ligaservers (kein CSID). IDS_LGA_SERVERFAILURE=Ligaserver-Fehler: %s -IDS_LGA_TOOMANYGAMESTARTS=Zu viele Versuche, ein Spiel zu starten -IDS_LGA_INVALIDPRODUCTID=Ungültiges Produkt oder Version -IDS_LGA_WRONGCHECKSUM=Falsche Prüfsumme -IDS_LGA_WRONGRESCHECKSUM=Falsche Ressourcen-Prüfsumme -IDS_LGA_SETTLEOFFICIALSERVER=Siedlungs-Ligaspiele können nur auf einem offiziellen Server gespielt werden -IDS_LGA_SETTLEOLDENGINE=Siedlungs-Ligaspiele können nur mit der aktuellsten Spielversion gespielt werden -IDS_LGA_CANTADDSCEN=Szenario konnte nicht zur Liga hinzugefügt werden -IDS_LGA_CANTFINDLEAGUESCEN=Kein Liga-Szenario und die offene Liga ist nicht aktiv -IDS_LGA_LEAGUESCENNOMELEE=Szenario ist in dieser Version in keiner Liga eingetragen. Nur Melees können in der offenen Liga gespielt werden -IDS_LGA_GAMEALREADYENDED=Spiel ist schon beendet -IDS_LGA_CANTFINDSCEN=Szenario nicht gefunden -IDS_LGA_NOCSID=CSID fehlt -IDS_LGA_CANTFINDGAME=Spiel nicht gefunden -IDS_LGA_WRONGHOSTIP=Falsche/geänderte Host-IP -IDS_LGA_CUIDALREADYEXISTS=Für diese CUID existiert bereits ein Account -IDS_LGA_WEBCODEAUTHFAILED=Authentifizierung fehlgeschlagen -IDS_LGA_WEBCODEAUTHNA=Authentifizierung derzeit nicht verfügbar -IDS_LGA_LOGINFAILED=Login fehlgeschlagen -IDS_LGA_AUIDNOTFOUND=Spieler wurde nicht authentifiziert -IDS_LGA_USERALREADYJOINED=Spieler ist diesem Spiel bereits beigetreten -IDS_LGA_USERBANNED=Benutzer gebannt -IDS_LGA_GAMENOLEAGUE=Kein Ligaspiel -IDS_LGA_GAMERECORDCOMPLETE=Aufnahme bereits komplett -IDS_LGA_GAMERECORDTOOLARGE=Aufnahme zu groß IDS_LOG_COMMANDNOTALLOWEDINLEAGUE=Kommando in Ligaspielen nicht erlaubt! IDS_MENU_ABORT=Runde abbrechen IDS_MENU_ABORT_DESC=Die Runde ohne Auswertung abbrechen. @@ -507,6 +484,7 @@ IDS_MNU_VIEWPORT=Sichtfenster IDS_MSG_ALLOWSYOUTOJOINADIFFERENT=Erlaubt die Auswahl eines anderen Teams. IDS_MSG_ANTIALIASING_DESC=FSAA (MultiSampling)-Level einstellen IDS_MSG_ANUPDATETOVERSIONISAVAILA=Ein neues Update ist verfügbar. Soll das Update heruntergeladen und installiert werden? ++IDS_MSG_AUTOFRAMESKIP=Automatischer Frameskip IDS_MSG_AUTOWINDOWED=Automagisch IDS_MSG_BACKTOPLAYERDLG=Zurück zur Spielerauswahl. IDS_MSG_CANNOTSTARTSCENARIO=Start nicht möglich. @@ -564,13 +542,6 @@ IDS_MSG_KICKFROMCLIENTLIST=Rausgeworfen über die Clientliste IDS_MSG_KICKFROMLOBBY=Rausgeworfen aus der Lobby IDS_MSG_KICKFROMMSGBOARD=Rausgeworfen über die Konsole IDS_MSG_KICKFROMSTARTUPDLG=Rausgeworfen aus dem Startwartedialog -IDS_MSG_LEAGUENOTSUPPORTED=Der Masterserver unterstützt keine Liga. -IDS_MSG_MASTERSERVNATERROR=Es wurde festgestellt, dass aus deinem Netzwerk höchstwahrscheinlich keine Internetspiele gehostet werden können.|Um dies zu beheben, müssen bestimmte Ports an deinem Router freigeschaltet werden. Siehe dazu unsere FAQ für weitere Informationen. -IDS_MSG_MASTERSERVSIGNUPFAIL=Anmelden der Runde am Mastererver fehlgeschlagen. -IDS_MSG_MASTERSERVUPDATEFAIL=Aktualisierung der Runde am Masterserver fehlgeschlagen. -IDS_MSG_MASTERSERVENDFAIL=Dem Masterserver konnte nicht mitgeteilt werden, dass die Runde zuende beendet wurde. -IDS_MSG_MASTERSERVNOOP=Der Masterserver unterstützt diese Operation nicht. -IDS_MSG_MASTERSERVWRONGENGINE=Falsche Engine. IDS_MSG_LEAGUEEVALUATIONSUCCESSFU=Ligaspiel erfolgreich ausgewertet. IDS_MSG_LEAGUEGAMESIGNUP=Spiel bei Ligaserver %s angemeldet:|%s IDS_MSG_LEAGUEINVALIDUSERNAME=Der Benutzername enthält ungültige Zeichen. diff --git a/planet/System.ocg/LanguageUS.txt b/planet/System.ocg/LanguageUS.txt index 154a28004..b6b75dd25 100644 --- a/planet/System.ocg/LanguageUS.txt +++ b/planet/System.ocg/LanguageUS.txt @@ -173,6 +173,7 @@ IDS_CTL_TROUBLE=Troubleshooting IDS_CTL_UPDATE=&Update IDS_CTL_USEOTHERSERVER=Use alternate internet server IDS_CTL_WON=won +IDS_DESC_AUTOFRAMESKIP=Automatically skips graphics frames if the game is lagging. IDS_DESC_AUTOMATICUPDATES=With this option enabled, the program will automatically check for updates once a day at program start. IDS_DESC_CHANGESTHEWAYCONTROLDATAI=Changes the way control data is exchanged between network clients. IDS_DESC_CHECKONLINEFORNEWVERSIONS=Check online for new versions. @@ -410,30 +411,6 @@ IDS_LEAGUE_LEAGUEREPORTINGUNEXPECTED=League: Reporting unexpected disconnect (re IDS_LEAGUE_WAITINGFORLASTLEAGUESERVE=Waiting for last league server reply... IDS_LGA_INVALIDRESPONSE3=Invalid reply from internet server (no CSID). IDS_LGA_SERVERFAILURE=internet server error: %s -IDS_LGA_TOOMANYGAMESTARTS=Too many attempts to start a game -IDS_LGA_INVALIDPRODUCTID=Invalid product or version -IDS_LGA_WRONGCHECKSUM=Wrong checksum -IDS_LGA_WRONGRESCHECKSUM=Wrong resource checksum -IDS_LGA_SETTLEOFFICIALSERVER=Settle league games can only be played on official a server -IDS_LGA_SETTLEOLDENGINE=Settle league games can only be played using the latest game version -IDS_LGA_CANTADDSCEN=Scenario could not be added -IDS_LGA_CANTFINDLEAGUESCEN=Scenario not found and no open league active -IDS_LGA_LEAGUESCENNOMELEE=This scenario version is not registered in any league. Only melees can be played in the open league -IDS_LGA_GAMEALREADYENDED=Game already ended -IDS_LGA_CANTFINDSCEN=Scenario not found -IDS_LGA_NOCSID=CSID is missing -IDS_LGA_CANTFINDGAME=Game not found -IDS_LGA_WRONGHOSTIP=Wrong/changed host ip -IDS_LGA_CUIDALREADYEXISTS=There is already an account with this cuid -IDS_LGA_WEBCODEAUTHFAILED=Authentification failed -IDS_LGA_WEBCODEAUTHNA=Authentification not available at the moment -IDS_LGA_LOGINFAILED=Login failed -IDS_LGA_AUIDNOTFOUND=Player is not authentificated -IDS_LGA_USERALREADYJOINED=Player already joined this game -IDS_LGA_USERBANNED=User banned -IDS_LGA_GAMENOLEAGUE=Not a league game -IDS_LGA_GAMERECORDCOMPLETE=Record is already complete -IDS_LGA_GAMERECORDTOOLARGE=Record is too large IDS_LOG_COMMANDNOTALLOWEDINLEAGUE=Command not allowed in league games! IDS_MENU_ABORT=Abort round IDS_MENU_ABORT_DESC=Abort the round without evaluation. @@ -507,6 +484,7 @@ IDS_MNU_VIEWPORT=Viewport IDS_MSG_ALLOWSYOUTOJOINADIFFERENT=Allows you to join a different team. IDS_MSG_ANTIALIASING_DESC=Set FSAA (MultiSampling) level IDS_MSG_ANUPDATETOVERSIONISAVAILA=A new update is available. Do you want to download and install this update? +IDS_MSG_AUTOFRAMESKIP=Automatic frame skip IDS_MSG_AUTOWINDOWED=Automatic IDS_MSG_BACKTOPLAYERDLG=Back to player selection. IDS_MSG_CANNOTSTARTSCENARIO=Cannot start scenario. @@ -564,13 +542,6 @@ IDS_MSG_KICKFROMCLIENTLIST=kicked from client list IDS_MSG_KICKFROMLOBBY=kicked from lobby IDS_MSG_KICKFROMMSGBOARD=kicked from messageboard IDS_MSG_KICKFROMSTARTUPDLG=kicked from startup waiting dialog -IDS_MSG_LEAGUENOTSUPPORTED=League not supported by masterserver. -IDS_MSG_MASTERSERVNATERROR=Your network failed to pass certain tests. It is unlikely that you are able to host games in the internet.|To fix that, you need to forward the certain ports on your router. Refer to the FAQ on our website for more information. -IDS_MSG_MASTERSERVSIGNUPFAIL=Round signup at the masterserver failed. -IDS_MSG_MASTERSERVUPDATEFAIL=Round update at the masterserver failed. -IDS_MSG_MASTERSERVENDFAIL=Round end notification at the masterserver failed. -IDS_MSG_MASTERSERVNOOP=Operation not supported by the masterserver. -IDS_MSG_MASTERSERVWRONGENGINE=Wrong engine. IDS_MSG_LEAGUEEVALUATIONSUCCESSFU=League: evaluation successful. IDS_MSG_LEAGUEGAMESIGNUP=Game signed up at league server %s:|%s IDS_MSG_LEAGUEINVALIDUSERNAME=The user name contains invalid characters. diff --git a/planet/System.ocg/SaveScenario.c b/planet/System.ocg/SaveScenario.c index 2a3890361..92053d88e 100644 --- a/planet/System.ocg/SaveScenario.c +++ b/planet/System.ocg/SaveScenario.c @@ -260,7 +260,7 @@ global func SaveScenarioObject(props) // Called in object context: Default object writing procedure // Overwrite this method and return false for objects that should not be saved // Overwrite and call inherited for objects that add/remove/alter default creation/properties - var owner_string = ""; + var owner_string = "", i; if (GetOwner() != NO_OWNER) owner_string = Format(", %d", GetOwner()); props->Add(SAVEOBJ_Creation, "CreateObject(%i, %d, %d%s)", GetID(), GetX(), GetDefBottom(), owner_string); // Contained creation is added alongside regular creation because it is not yet known if CreateObject+Enter or CreateContents can be used due to dependencies. @@ -281,6 +281,8 @@ global func SaveScenarioObject(props) v = GetColor(); if (v && v != 0xffffffff) props->AddCall("Color", this, "SetColor", Format("0x%x", v)); v = GetClrModulation(); if (v && v != 0xffffffff) props->AddCall("ClrModulation", this, "SetClrModulation", Format("0x%08x", v)); v = GetObjectBlitMode();if (v) props->AddCall("BlitMode", this, "SetObjectBlitMode", GetBitmaskNameByValue(v & ~GFX_BLIT_Custom, "GFX_BLIT_")); + for (i=0; v=def->GetMeshMaterial(i); ++i) + if (GetMeshMaterial(i) != v) props->AddCall("MeshMaterial", this, "SetMeshMaterial", Format("%v", GetMeshMaterial(i)), i); v = GetName(); if (v != def->GetName()) props->AddCall("Name", this, "SetName", Format("%v", v)); // TODO: Escape quotation marks, backslashes, etc. in name v = this.MaxEnergy; if (v != def.MaxEnergy) props->AddSet ("MaxEnergy", this, "MaxEnergy", this.MaxEnergy); v = GetEnergy(); if (v != def.MaxEnergy/1000) props->AddCall("Energy", this, "DoEnergy", v-def.MaxEnergy/1000); @@ -293,7 +295,7 @@ global func SaveScenarioObject(props) // However, usually there is one base command and the rest is derived // (e.g.: A Get command may lead to multiple MoveTo commands to the // target object). So just store the topmost command. - var command, last_command, i=0; + var command, last_command; i=0; while (command = GetCommand(0, i++)) last_command = command; if (last_command) { diff --git a/planet/Worlds.ocf/AcidGoldMine.ocs/Landscape.txt b/planet/Worlds.ocf/AcidGoldMine.ocs/Landscape.txt index b1fe39597..b36aee5bb 100644 --- a/planet/Worlds.ocf/AcidGoldMine.ocs/Landscape.txt +++ b/planet/Worlds.ocf/AcidGoldMine.ocs/Landscape.txt @@ -1,4 +1,8 @@ -/* Acid world - by Sven2 */ +/** + Acid world + + @author Sven2 +*/ overlay VaryTex { turbulence=10; algo=rndchecker; zoomX=-100; zoomY=-100; }; overlay Mats { algo=rndchecker; a=10; zoomX=-100; zoomY=-100; turbulence=100; y=48px; hgt=168px; }; diff --git a/planet/Worlds.ocf/AcidGoldMine.ocs/Scenario.txt b/planet/Worlds.ocf/AcidGoldMine.ocs/Scenario.txt index 3c7df7d96..ec08e33cf 100644 --- a/planet/Worlds.ocf/AcidGoldMine.ocs/Scenario.txt +++ b/planet/Worlds.ocf/AcidGoldMine.ocs/Scenario.txt @@ -2,7 +2,7 @@ Title=AcidGoldMine Icon=22 Version=5,3,0,0 -Difficulty=120 +Difficulty=100 [Definitions] Definition1=Objects.ocd @@ -13,6 +13,7 @@ Rules=Rule_TeamAccount=1;Rule_BuyAtFlagpole=1; [Player1] Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=5;Bread=5; HomeBaseProduction=Clonk=5;Bread=5; @@ -34,6 +35,29 @@ Crew=Clonk=2 Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=5;Bread=5; HomeBaseProduction=Clonk=5;Bread=5; +======= +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; + +[Player2] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; + +[Player3] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; + +[Player4] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; +>>>>>>> remotes/origin/master [Landscape] Sky=Clouds1 diff --git a/planet/Worlds.ocf/AcidGoldMine.ocs/Script.c b/planet/Worlds.ocf/AcidGoldMine.ocs/Script.c index 573fbc708..f91b223de 100644 --- a/planet/Worlds.ocf/AcidGoldMine.ocs/Script.c +++ b/planet/Worlds.ocf/AcidGoldMine.ocs/Script.c @@ -1,4 +1,8 @@ -/* Acid gold mine */ +/** + Acid gold mine + + @author Sven2 +*/ static g_highest_plr_count; // max number of players that were ever in the round diff --git a/planet/Worlds.ocf/GemGrabbers.ocs/Map.c b/planet/Worlds.ocf/GemGrabbers.ocs/Map.c index 458076f91..25fc39812 100644 --- a/planet/Worlds.ocf/GemGrabbers.ocs/Map.c +++ b/planet/Worlds.ocf/GemGrabbers.ocs/Map.c @@ -4,7 +4,7 @@ and some smaller islands which also have gem stalactites hanging from the bottom. Each of the smaller islands have different materials. - @authors Maikel + @author Maikel */ #include Library_Map diff --git a/planet/Worlds.ocf/GemGrabbers.ocs/Scenario.txt b/planet/Worlds.ocf/GemGrabbers.ocs/Scenario.txt index 1b160d98a..128022386 100644 --- a/planet/Worlds.ocf/GemGrabbers.ocs/Scenario.txt +++ b/planet/Worlds.ocf/GemGrabbers.ocs/Scenario.txt @@ -2,7 +2,7 @@ Title=GemGrabbers Icon=35 Version=5,3,0,0 -Difficulty=100 +Difficulty=80 [Definitions] Definition1=Objects.ocd @@ -12,19 +12,15 @@ ValueOverloads=Ruby=10;Amethyst=10 [Player1] Crew=Clonk=2 -HomeBaseMaterial=Clonk=1 [Player2] Crew=Clonk=2 -HomeBaseMaterial=Clonk=1 [Player3] Crew=Clonk=2 -HomeBaseMaterial=Clonk=1 [Player4] Crew=Clonk=2 -HomeBaseMaterial=Clonk=1 [Landscape] Sky=Clouds1 diff --git a/planet/Worlds.ocf/GemGrabbers.ocs/Script.c b/planet/Worlds.ocf/GemGrabbers.ocs/Script.c index 10d827328..d881e1de2 100644 --- a/planet/Worlds.ocf/GemGrabbers.ocs/Script.c +++ b/planet/Worlds.ocf/GemGrabbers.ocs/Script.c @@ -9,7 +9,7 @@ * Some other hurdles. * Decoration on all the islands. - @authors Maikel + @author Maikel */ @@ -65,10 +65,11 @@ protected func InitializePlayer(int plr) GivePlayerKnowledge(plr); // Only clonks for sale at the homebase, depending on diffuculty: 3, 5, 10 available. - var nr_clonks = Max(8 - 2 * SCENOPT_Difficulty, 1); + var nr_clonks = Max(9 - 2 * SCENOPT_Difficulty, 1); if (SCENOPT_Difficulty == 1) nr_clonks += 3; - DoHomebaseMaterial(plr, Clonk, nr_clonks); + SetBaseMaterial(plr, Clonk, nr_clonks); + SetBaseProduction(plr, Clonk, nr_clonks); // Claim ownership of structures, last player who joins owns all the main island flags. for (var structure in FindObjects(Find_Or(Find_Category(C4D_Structure), Find_Func("IsFlagpole")))) diff --git a/planet/Worlds.ocf/GoldRush.ocs/Map.c b/planet/Worlds.ocf/GoldRush.ocs/Map.c index a4c79e3aa..80615e464 100644 --- a/planet/Worlds.ocf/GoldRush.ocs/Map.c +++ b/planet/Worlds.ocf/GoldRush.ocs/Map.c @@ -2,7 +2,7 @@ Gold Rush Dynamic map a few layers of materials below a flat shaped earth surface. - @authors Maikel + @author Maikel */ #include Library_Map diff --git a/planet/Worlds.ocf/GoldRush.ocs/Scenario.txt b/planet/Worlds.ocf/GoldRush.ocs/Scenario.txt index 7e1642da8..a720f1bf7 100644 --- a/planet/Worlds.ocf/GoldRush.ocs/Scenario.txt +++ b/planet/Worlds.ocf/GoldRush.ocs/Scenario.txt @@ -12,22 +12,38 @@ Definition1=Objects.ocd [Player1] Crew=Clonk=2 Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1; +<<<<<<< HEAD HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;SplitTerraflint=1 +======= +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +>>>>>>> remotes/origin/master [Player2] Crew=Clonk=2 Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1; +<<<<<<< HEAD HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;SplitTerraflint=1 +======= +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +>>>>>>> remotes/origin/master [Player3] Crew=Clonk=2 Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1; +<<<<<<< HEAD HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;SplitTerraflint=1 +======= +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +>>>>>>> remotes/origin/master [Player4] Crew=Clonk=2 Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1; +<<<<<<< HEAD HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;SplitTerraflint=1 +======= +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +>>>>>>> remotes/origin/master [Landscape] Sky=Clouds2 diff --git a/planet/Worlds.ocf/GoldRush.ocs/Script.c b/planet/Worlds.ocf/GoldRush.ocs/Script.c index 82f971f5c..e7c079e2b 100644 --- a/planet/Worlds.ocf/GoldRush.ocs/Script.c +++ b/planet/Worlds.ocf/GoldRush.ocs/Script.c @@ -2,7 +2,7 @@ Gold Rush A simple landscape with some gold, the goal is to mine some gold to gain wealth. - @authors Maikel + @author Maikel */ diff --git a/planet/Worlds.ocf/IronPeak.ocs/Map.c b/planet/Worlds.ocf/IronPeak.ocs/Map.c index 7332e5ea5..da493d872 100644 --- a/planet/Worlds.ocf/IronPeak.ocs/Map.c +++ b/planet/Worlds.ocf/IronPeak.ocs/Map.c @@ -3,7 +3,7 @@ A mountain peak filled with iron ore, firestone and coal, the crust consists of granite, rock, ice and some entrances. - @authors Maikel + @author Maikel */ #include Library_Map diff --git a/planet/Worlds.ocf/IronPeak.ocs/Scenario.txt b/planet/Worlds.ocf/IronPeak.ocs/Scenario.txt index 5057a8bdb..855f78c8d 100644 --- a/planet/Worlds.ocf/IronPeak.ocs/Scenario.txt +++ b/planet/Worlds.ocf/IronPeak.ocs/Scenario.txt @@ -13,26 +13,46 @@ Rules=Rule_TeamAccount=1; [Player1] Wealth=40 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;SplitTerraflint=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +======= +Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +>>>>>>> remotes/origin/master [Player2] Wealth=40 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;SplitTerraflint=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +======= +Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +>>>>>>> remotes/origin/master [Player3] Wealth=40 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;SplitTerraflint=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +======= +Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +>>>>>>> remotes/origin/master [Player4] Wealth=40 Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;SplitTerraflint=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +======= +Knowledge=Foundry=1;SteamEngine=1;ToolsWorkshop=1;ChemicalLab=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;Chest=1;Idol=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Ropeladder=1; +BaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1; +>>>>>>> remotes/origin/master [Landscape] InEarth=Rock=1;Firestone=3;Loam=2 diff --git a/planet/Worlds.ocf/IronPeak.ocs/Script.c b/planet/Worlds.ocf/IronPeak.ocs/Script.c index dedf0f0a5..c4b16face 100644 --- a/planet/Worlds.ocf/IronPeak.ocs/Script.c +++ b/planet/Worlds.ocf/IronPeak.ocs/Script.c @@ -2,7 +2,7 @@ Iron Peak A chilly mountain peak filled with iron ore and coal. - @authors Maikel + @author Maikel */ @@ -29,9 +29,6 @@ protected func Initialize() // Cover the mountain in some snow already. GiveMountainSnowCover(); - // Bottom of the map should only be open at the sides. - CloseMapBottom(); - // Add a snow storm effect, strong winds and lot's of snow. AddEffect("SnowStorm", nil, 100, 5, nil); @@ -43,27 +40,26 @@ protected func Initialize() // TODO: Make sure lorry stays on mountains. // Place some coniferous trees, but only up to 2/3 of the mountain. - Tree_Coniferous->Place(16+Random(5), Rectangle(0,LandscapeHeight()/3, LandscapeWidth(), 2*LandscapeHeight()/3)); + Tree_Coniferous->Place(16 + Random(5), Rectangle(0, LandscapeHeight() / 3, LandscapeWidth(), 2 * LandscapeHeight() / 3)); // Some mushrooms as source of food. - Mushroom->Place(30+Random(10)); + Mushroom->Place(30 + Random(10)); // Set time of day to evening and create some clouds and celestials. Cloud->Place(20); CreateObject(Environment_Celestial); var time = CreateObject(Environment_Time); - time->SetTime(60*22); + time->SetTime(60 * 22); time->SetCycleSpeed(0); // A light blue hue, to indicate the cold climate. var blue = 12; - SetGamma(RGB(0,0,blue), RGB(128-blue,128-blue,128+blue), RGB(255-blue,255-blue,255)); + SetGamma(RGB(0, 0, blue), RGB(128 - blue, 128 - blue, 128 + blue), RGB(255 - blue, 255 - blue, 255)); // Some natural disasters. // Earthquake->SetChance(30); // TODO: Rockfall. - - //LogMatCounts(); + return; } @@ -91,16 +87,6 @@ private func FindMountainLocation() return; } -private func LogMatCounts() -{ - for (var i = 0; i < 128; i++) - { - if (GetMaterialCount(i) > 0) - Log("Material %s has %d count.", MaterialName(i), GetMaterialCount(i) / 100); - } - return; -} - private func GiveMountainSnowCover() { // Loop over the map horizontally. @@ -116,15 +102,6 @@ private func GiveMountainSnowCover() return; } -private func CloseMapBottom() -{ - var y = LandscapeHeight() - 1; - for (var x = 0; x < LandscapeWidth(); x++) - if (!GBackSky(x, y)) - DrawMaterialQuad("Brick", x, y-1, x, y+1, x-1, y+1, x-1, y-1, true); - return; -} - // This effect should be called every 5 frames. global func FxSnowStormStart(object target, proplist effect) { @@ -174,7 +151,18 @@ protected func InitializePlayer(int plr) } index++; } - SetPlayerZoomByViewRange(plr, 5000, 3500, PLRZOOM_LimitMax); + SetPlayerZoomByViewRange(plr, 500, 350, PLRZOOM_LimitMax); return; } +/*-- Some helper functions --*/ + +global func LogMatCounts() +{ + for (var i = 0; i < 128; i++) + { + if (GetMaterialCount(i) > 0) + Log("Material %s has %d count.", MaterialName(i), GetMaterialCount(i) / 100); + } + return; +} diff --git a/planet/Worlds.ocf/Krakatoa.ocs/Scenario.txt b/planet/Worlds.ocf/Krakatoa.ocs/Scenario.txt index 1cc9d733a..f023bb293 100644 --- a/planet/Worlds.ocf/Krakatoa.ocs/Scenario.txt +++ b/planet/Worlds.ocf/Krakatoa.ocs/Scenario.txt @@ -12,6 +12,7 @@ Rules=Rule_EnergyNeed=1;Rule_TeamAccount=1;Rule_BuyAtFlagpole=1; [Player1] Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;Lorry=1;Cannon=1;Catapult=1;Airship=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; HomeBaseProduction=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; @@ -33,6 +34,29 @@ Crew=Clonk=2 Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;Lorry=1;Cannon=1;Catapult=1;Airship=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; HomeBaseProduction=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; +======= +Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;Lorry=1;Cannon=1;Catapult=1;Airship=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1; +BaseMaterial=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; +BaseProduction=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; + +[Player2] +Crew=Clonk=2 +Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;Lorry=1;Cannon=1;Catapult=1;Airship=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1; +BaseMaterial=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; +BaseProduction=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; + +[Player3] +Crew=Clonk=2 +Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;Lorry=1;Cannon=1;Catapult=1;Airship=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1; +BaseMaterial=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; +BaseProduction=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; + +[Player4] +Crew=Clonk=2 +Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Pump=1;ChemicalLab=1;Armory=1;Lorry=1;Cannon=1;Catapult=1;Airship=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;MetalBarrel=1;Dynamite=1;DynamiteBox=1;Bucket=1;Pipe=1;GrappleBow=1;PowderKeg=1;Ropeladder=1; +BaseMaterial=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; +BaseProduction=Clonk=2;Shovel=2;Axe=1;Hammer=1;Loam=5;Barrel=2;Bread=2; +>>>>>>> remotes/origin/master [Landscape] InEarth=Rock=1;Firestone=3;Loam=1 diff --git a/planet/Worlds.ocf/RubyCave.ocs/Landscape.txt b/planet/Worlds.ocf/RubyCave.ocs/Landscape.txt index 6be63d89f..ab2a1b7dc 100644 --- a/planet/Worlds.ocf/RubyCave.ocs/Landscape.txt +++ b/planet/Worlds.ocf/RubyCave.ocs/Landscape.txt @@ -1,4 +1,8 @@ -/* Ruby cave - by Sven2 */ +/** + Ruby cave + + @author Sven2 +*/ overlay VaryTex { turbulence=10; algo=rndchecker; zoomX=-100; zoomY=-100; }; overlay GraniteBorders {turbulence=100; mat=Granite; loosebounds=1; VaryTex {mat=Rock; tex=rock_cracked; a=1;};}; diff --git a/planet/Worlds.ocf/RubyCave.ocs/Scenario.txt b/planet/Worlds.ocf/RubyCave.ocs/Scenario.txt index 21deae00c..81a33e8f0 100644 --- a/planet/Worlds.ocf/RubyCave.ocs/Scenario.txt +++ b/planet/Worlds.ocf/RubyCave.ocs/Scenario.txt @@ -13,6 +13,7 @@ Rules=Rule_TeamAccount=1;Rule_BuyAtFlagpole=1; [Player1] Crew=Clonk=2 +<<<<<<< HEAD Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=5;Bread=5; HomeBaseProduction=Clonk=5;Bread=5; @@ -34,6 +35,29 @@ Crew=Clonk=2 Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1;SplitTerraflint=1 HomeBaseMaterial=Clonk=5;Bread=5; HomeBaseProduction=Clonk=5;Bread=5; +======= +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; + +[Player2] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; + +[Player3] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; + +[Player4] +Crew=Clonk=2 +Knowledge=Flagpole=1;Foundry=1;WindGenerator=1;SteamEngine=1;Compensator=1;Sawmill=1;ChemicalLab=1;Elevator=1;Pump=1;ToolsWorkshop=1;WallKit=1;GoldBar=1;Loam=1;Metal=1;Axe=1;Barrel=1;Bucket=1;Dynamite=1;Hammer=1;JarOfWinds=1;Pickaxe=1;Pipe=1;Shovel=1;TeleGlove=1;DynamiteBox=1 +BaseMaterial=Clonk=5;Bread=5; +BaseProduction=Clonk=5;Bread=5; +>>>>>>> remotes/origin/master [Landscape] Sky=Clouds1 diff --git a/planet/Worlds.ocf/RubyCave.ocs/Script.c b/planet/Worlds.ocf/RubyCave.ocs/Script.c index fe21827ea..d7147c5d4 100644 --- a/planet/Worlds.ocf/RubyCave.ocs/Script.c +++ b/planet/Worlds.ocf/RubyCave.ocs/Script.c @@ -1,4 +1,8 @@ -/* Ruby cave */ +/** + Ruby cave + + @author Sven2 +*/ func Initialize() { diff --git a/src/config/C4Config.cpp b/src/config/C4Config.cpp index 80c402b6c..2fabeb905 100644 --- a/src/config/C4Config.cpp +++ b/src/config/C4Config.cpp @@ -90,7 +90,6 @@ void C4ConfigGraphics::CompileFunc(StdCompiler *pComp) pComp->Value(mkNamingAdapt(ShowStartupMessages, "ShowStartupMessages", 1 ,false, true)); pComp->Value(mkNamingAdapt(ColorAnimation, "ColorAnimation", 0 ,false, true)); pComp->Value(mkNamingAdapt(HighResLandscape, "HighResLandscape", 1 ,false, true)); - pComp->Value(mkNamingAdapt(SmokeLevel, "SmokeLevel", 200 ,false, true)); pComp->Value(mkNamingAdapt(VerboseObjectLoading, "VerboseObjectLoading", 0 )); pComp->Value(mkNamingAdapt(VideoModule, "VideoModule", 0 ,false, true)); pComp->Value(mkNamingAdapt(MenuTransparency, "MenuTransparency", 1 ,false, true)); @@ -114,6 +113,7 @@ void C4ConfigGraphics::CompileFunc(StdCompiler *pComp) pComp->Value(mkNamingAdapt(NoOffscreenBlits, "NoOffscreenBlits", 1 )); pComp->Value(mkNamingAdapt(ClipManuallyE, "ClipManuallyE", 1 )); pComp->Value(mkNamingAdapt(MultiSampling, "MultiSampling", 4 )); + pComp->Value(mkNamingAdapt(AutoFrameSkip, "AutoFrameSkip", 1 )); } void C4ConfigSound::CompileFunc(StdCompiler *pComp) diff --git a/src/config/C4Config.h b/src/config/C4Config.h index e323c77b5..de3d22946 100644 --- a/src/config/C4Config.h +++ b/src/config/C4Config.h @@ -93,7 +93,6 @@ public: int32_t VerboseObjectLoading; int32_t ColorAnimation; int32_t HighResLandscape; - int32_t SmokeLevel; int32_t VideoModule; int32_t MenuTransparency; int32_t UpperBoard; @@ -117,6 +116,7 @@ public: int32_t ClipManuallyE; // do manual clipping in the easy cases int32_t NoOffscreenBlits; // if set, all blits to non-primary-surfaces are emulated int32_t MultiSampling; // multisampling samples + int32_t AutoFrameSkip; // if true, gfx frames are skipped when they would slow down the game void CompileFunc(StdCompiler *pComp); }; diff --git a/src/control/C4Control.cpp b/src/control/C4Control.cpp index 2d4c14d13..ce1150350 100644 --- a/src/control/C4Control.cpp +++ b/src/control/C4Control.cpp @@ -717,6 +717,8 @@ void C4ControlPlayerAction::Execute() const callback->Exec(nullptr, &pars); break; } + + case CPA_NoAction: break; } } diff --git a/src/control/C4GameParameters.cpp b/src/control/C4GameParameters.cpp index b886498ac..bcedde591 100644 --- a/src/control/C4GameParameters.cpp +++ b/src/control/C4GameParameters.cpp @@ -452,6 +452,9 @@ bool C4GameParameters::Load(C4Group &hGroup, C4Scenario *pScenario, const char * // network game? IsNetworkGame = Game.NetworkActive; + + // Auto frame skip by options + AutoFrameSkip = ::Config.Graphics.AutoFrameSkip; } @@ -505,9 +508,10 @@ void C4GameParameters::CompileFunc(StdCompiler *pComp, C4Scenario *pScenario) pComp->Value(mkNamingAdapt(AllowDebug, "AllowDebug", true)); pComp->Value(mkNamingAdapt(IsNetworkGame, "IsNetworkGame", false)); pComp->Value(mkNamingAdapt(ControlRate, "ControlRate", -1)); + pComp->Value(mkNamingAdapt(AutoFrameSkip, "AutoFrameSkip", false)); pComp->Value(mkNamingAdapt(Rules, "Rules", !pScenario ? C4IDList() : pScenario->Game.Rules)); pComp->Value(mkNamingAdapt(Goals, "Goals", !pScenario ? C4IDList() : pScenario->Game.Goals)); - pComp->Value(mkNamingAdapt(League, "League", StdStrBuf())); + pComp->Value(mkNamingAdapt(League, "League", StdStrBuf())); // These values are either stored separately (see Load/Save) or // don't make sense for savegames. diff --git a/src/control/C4GameParameters.h b/src/control/C4GameParameters.h index f0ad89f40..782d4a6bb 100644 --- a/src/control/C4GameParameters.h +++ b/src/control/C4GameParameters.h @@ -115,6 +115,9 @@ public: // Control rate int32_t ControlRate; + // Automatic frame skip enabled for this game? + bool AutoFrameSkip; + // Allow debug mode? bool AllowDebug; diff --git a/src/control/C4PlayerInfo.cpp b/src/control/C4PlayerInfo.cpp index d7479a5c0..8d72b3b11 100644 --- a/src/control/C4PlayerInfo.cpp +++ b/src/control/C4PlayerInfo.cpp @@ -48,6 +48,8 @@ void C4PlayerInfo::Clear() iLeagueProjectedGain = -1; eType = C4PT_User; idExtraData = C4ID::None; + iLeaguePerformance = 0; + sLeagueProgressData.Clear(); } void C4PlayerInfo::DeleteTempFile() @@ -248,6 +250,8 @@ void C4PlayerInfo::CompileFunc(StdCompiler *pComp) pComp->Value(mkNamingAdapt(mkIntPackAdapt(iLeagueRankSymbol), "LeagueRankSymbol", 0)); pComp->Value(mkNamingAdapt(mkIntPackAdapt(iLeagueProjectedGain), "ProjectedGain", -1)); pComp->Value(mkNamingAdapt(mkParAdapt(sClanTag, StdCompiler::RCT_All), "ClanTag", "")); + pComp->Value(mkNamingAdapt(mkIntPackAdapt(iLeaguePerformance), "LeaguePerformance", 0)); + pComp->Value(mkNamingAdapt(sLeagueProgressData, "LeagueProgressData", "")); // file resource if (pComp->isCompiler() && Game.C4S.Head.Replay) diff --git a/src/control/C4PlayerInfo.h b/src/control/C4PlayerInfo.h index b11bcad37..2248c97f9 100644 --- a/src/control/C4PlayerInfo.h +++ b/src/control/C4PlayerInfo.h @@ -95,13 +95,15 @@ private: int32_t iLeagueScoreProjected;// score on league server in case of win int32_t iLeagueProjectedGain; // projected league score increase if game is won - -1 for unknown; valid values always positive ValidatedStdCopyStrBuf sClanTag; // clan ("team") tag + int32_t iLeaguePerformance; // script-set league performance value, only set temporarily for masterserver end reference + StdCopyStrBuf sLeagueProgressData; // level progress data as reported by league public: C4PlayerInfo() // construct empty : dwFlags(0), eType(C4PT_User), iID(0), pRes(0), szFilename(), dwColor(0xffffffff), dwOriginalColor(0xffffffff), dwAlternateColor(0), idSavegamePlayer(0), idTeam(0), iInGameNumber(-1), iInGameJoinFrame(-1), iInGamePartFrame(-1), idExtraData(C4ID::None), sLeagueAccount(""), - iLeagueScore(0), iLeagueRank(0), iLeagueRankSymbol(0), iLeagueProjectedGain(-1) { } + iLeagueScore(0), iLeagueRank(0), iLeagueRankSymbol(0), iLeagueProjectedGain(-1), iLeaguePerformance(0) { } void Clear(); // clear fields @@ -132,8 +134,12 @@ public: bool SetSavegameResume(C4PlayerInfo *pSavegameInfo); // take over savegame player data to do resume void SetAuthID(const char *sznAuthID) { szAuthID = sznAuthID; } - void SetLeagueData(const char *szAccount, const char *szNewClanTag, int32_t iScore, int32_t iRank, int32_t iRankSymbol) - { sLeagueAccount.CopyValidated(szAccount); sClanTag.CopyValidated(szNewClanTag); iLeagueScore = iScore; iLeagueRank = iRank; iLeagueRankSymbol = iRankSymbol; } + void SetLeagueData(const char *szAccount, const char *szNewClanTag, int32_t iScore, int32_t iRank, int32_t iRankSymbol, const char *szProgressData) + { sLeagueAccount.CopyValidated(szAccount); sClanTag.CopyValidated(szNewClanTag); iLeagueScore = iScore; iLeagueRank = iRank; iLeagueRankSymbol = iRankSymbol; sLeagueProgressData.Copy(szProgressData); } + void SetLeaguePerformance(int32_t iNewPerf) + { iLeaguePerformance = iNewPerf; } + void SetLeagueProgressData(const char *szNewProgressData) + { if (szNewProgressData) sLeagueProgressData.Copy(szNewProgressData); else sLeagueProgressData.Clear(); } void SetVotedOut() { dwFlags |= PIF_VotedOut; } void SetLeagueProjectedGain(int32_t iProjectedGain) @@ -183,6 +189,7 @@ public: int32_t GetInGameNumber() const { return iInGameNumber; } // returns player number the player had in the game bool IsLeagueProjectedGainValid() const { return iLeagueProjectedGain>=0; } int32_t GetLeagueProjectedGain() const { return iLeagueProjectedGain; } // get score gain in primary league if this player's team wins + const char *GetLeagueProgressData() const { return sLeagueProgressData.getData(); } int32_t GetID() const { return iID; } // get unique ID, if assigned int32_t GetTeam() const { return idTeam; } diff --git a/src/control/C4Record.cpp b/src/control/C4Record.cpp index 24bca59e1..a24d26145 100644 --- a/src/control/C4Record.cpp +++ b/src/control/C4Record.cpp @@ -925,7 +925,7 @@ void C4Playback::Clear() if (Config.General.DebugRec) { C4IDPacket *pkt; - while (pkt = DebugRec.firstPkt()) DebugRec.Delete(pkt); + while ((pkt = DebugRec.firstPkt())) DebugRec.Delete(pkt); if (Config.General.DebugRecExternalFile[0]) DbgRecFile.Close(); } @@ -1035,7 +1035,7 @@ void C4Playback::Check(C4RecordChunkType eType, const uint8_t *pData, int iSize) { // check debug rec in list C4IDPacket *pkt; - if (pkt = DebugRec.firstPkt()) + if ((pkt = DebugRec.firstPkt())) { // copy from list PktInReplay = *static_cast(pkt->getPkt()); diff --git a/src/control/C4RoundResults.cpp b/src/control/C4RoundResults.cpp index a6030e09b..8c6ef2e37 100644 --- a/src/control/C4RoundResults.cpp +++ b/src/control/C4RoundResults.cpp @@ -24,6 +24,7 @@ #include #include #include +#include // *** C4RoundResultsPlayer @@ -39,6 +40,7 @@ void C4RoundResultsPlayer::CompileFunc(StdCompiler *pComp) pComp->Value(mkNamingAdapt(iLeagueScoreGain, "GameScore", -1)); // name used in league reply! pComp->Value(mkNamingAdapt(iLeagueRankNew, "Rank", 0)); // name used in league reply! pComp->Value(mkNamingAdapt(iLeagueRankSymbolNew, "RankSymbol", 0)); // name used in league reply! + pComp->Value(mkNamingAdapt(sLeagueProgressData, "LeagueProgressData", StdCopyStrBuf())); StdEnumEntry LeagueStatusEntries[] = { { "", RRPLS_Unknown }, @@ -70,6 +72,12 @@ void C4RoundResultsPlayer::EvaluatePlayer(C4Player *pPlr) fctBigIcon.Create(pPlr->BigIcon.Wdt, pPlr->BigIcon.Hgt); pPlr->BigIcon.Draw(fctBigIcon); } + // progress data by player + C4PlayerInfo *pInfo = pPlr->GetInfo(); + if (pInfo) + { + sLeagueProgressData.Copy(pInfo->GetLeagueProgressData()); + } // BigIcon from info: Doesn't work for some cases when player files got deleted already /*C4PlayerInfo *pInfo = pPlr->GetInfo(); assert(pInfo); @@ -85,6 +93,7 @@ void C4RoundResultsPlayer::EvaluateLeague(C4RoundResultsPlayer *pLeaguePlayerInf iLeagueScoreGain = pLeaguePlayerInfo->iLeagueScoreGain; iLeagueRankNew = pLeaguePlayerInfo->iLeagueRankNew; iLeagueRankSymbolNew = pLeaguePlayerInfo->iLeagueRankSymbolNew; + sLeagueProgressData =pLeaguePlayerInfo->sLeagueProgressData; } void C4RoundResultsPlayer::AddCustomEvaluationString(const char *szCustomString) @@ -106,6 +115,7 @@ bool C4RoundResultsPlayer::operator ==(const C4RoundResultsPlayer &cmp) if (iLeagueRankNew != cmp.iLeagueRankNew) return false; if (iLeagueRankSymbolNew != cmp.iLeagueRankSymbolNew) return false; if (eLeagueStatus != cmp.eLeagueStatus) return false; + if (sLeagueProgressData != cmp.sLeagueProgressData) return false; return true; } @@ -123,6 +133,7 @@ C4RoundResultsPlayer &C4RoundResultsPlayer::operator =(const C4RoundResultsPlaye iLeagueRankNew = cpy.iLeagueRankNew; iLeagueRankSymbolNew = cpy.iLeagueRankSymbolNew; eLeagueStatus = cpy.eLeagueStatus; + sLeagueProgressData = cpy.sLeagueProgressData; return *this; } @@ -282,8 +293,8 @@ void C4RoundResults::EvaluateGoals(C4IDList &GoalList, C4IDList &FulfilledGoalLi { // determine if the goal is fulfilled - do the calls even if the menu is not to be opened to ensure synchronization bool fFulfilled = false;; - C4Object *pObj; - if ((pObj = ::Objects.Find(idGoal))) + C4Object *pObj = C4Id2Def(idGoal) ? ::Objects.Find(::Definitions.ID2Def(idGoal)) : NULL; + if (pObj) { // Check fulfilled per player, this enables the possibility of rivalry. C4AulParSet pars(C4VInt(iPlayerNumber)); @@ -360,15 +371,28 @@ bool C4RoundResults::SettlementScoreIsHidden() return fHideSettlementScore; } -void C4RoundResults::SetLeaguePerformance(int32_t iNewPerf) +void C4RoundResults::SetLeaguePerformance(int32_t iNewPerf, int32_t idPlayer) { - // Store to be sent later - iLeaguePerformance = iNewPerf; -} + // Store to be sent later. idPlayer == 0 means global performance. + if(!idPlayer) + { + iLeaguePerformance = iNewPerf; + } + else + { + C4RoundResultsPlayer *pOwnPlr = Players.GetCreateByID(idPlayer); + pOwnPlr->SetLeaguePerformance(iNewPerf); + } + } -int32_t C4RoundResults::GetLeaguePerformance() const +int32_t C4RoundResults::GetLeaguePerformance(int32_t idPlayer) const { - return iLeaguePerformance; + if(!idPlayer) + return iLeaguePerformance; + else + if(C4RoundResultsPlayer *pPlr = Players.GetByID(idPlayer)) + return pPlr->GetLeaguePerformance(); + return 0; } bool C4RoundResults::Load(C4Group &hGroup, const char *szFilename) diff --git a/src/control/C4RoundResults.h b/src/control/C4RoundResults.h index b9bba5600..554c7d0de 100644 --- a/src/control/C4RoundResults.h +++ b/src/control/C4RoundResults.h @@ -51,13 +51,15 @@ private: int32_t iLeagueScoreGain; // league score gained by this round - -1 for unknown int32_t iLeagueRankNew; // rank on league server after this round int32_t iLeagueRankSymbolNew; // rank symbol on league server after this round + int32_t iLeaguePerformance; // script-set performance value, effect league-dependent + StdCopyStrBuf sLeagueProgressData; // scenario-specific data to store more proigress info (which levels were done, etc.) enum LeagueStatus { RRPLS_Unknown=0, RRPLS_Lost, RRPLS_Won } eLeagueStatus; // whether player lost or won public: - C4RoundResultsPlayer() : id(0), iTotalPlayingTime(0), iScoreOld(-1), iScoreNew(-1), iLeagueScoreNew(-1), iLeagueScoreGain(0), iLeagueRankNew(0), iLeagueRankSymbolNew(0), eLeagueStatus(RRPLS_Unknown) {} + C4RoundResultsPlayer() : id(0), iTotalPlayingTime(0), iScoreOld(-1), iScoreNew(-1), iLeagueScoreNew(-1), iLeagueScoreGain(0), iLeagueRankNew(0), iLeagueRankSymbolNew(0), iLeaguePerformance(0), sLeagueProgressData(), eLeagueStatus(RRPLS_Unknown) {} C4RoundResultsPlayer(const C4RoundResultsPlayer &cpy) { *this=cpy; } void CompileFunc(StdCompiler *pComp); @@ -75,12 +77,14 @@ public: int32_t GetLeagueScoreGain() const { return iLeagueScoreGain; } int32_t GetLeagueRankNew() const { return iLeagueRankNew; } // returns rank on league server after round evaluation (0 for not assigned) int32_t GetLeagueRankSymbolNew() const { return iLeagueRankSymbolNew; } + int32_t GetLeaguePerformance() const { return iLeaguePerformance; } void EvaluateLeague(C4RoundResultsPlayer *pLeaguePlayer); // called from league evaluation; set league fields void EvaluatePlayer(C4Player *pPlr); // called from C4Player::Evaluate; set fields by player void SetID(int32_t idNew) { this->id=idNew; } void AddCustomEvaluationString(const char *szCustomString); + void SetLeaguePerformance(int32_t iNewPerf) { iLeaguePerformance = iNewPerf; } bool operator ==(const C4RoundResultsPlayer &cmp); C4RoundResultsPlayer &operator =(const C4RoundResultsPlayer &cpy); @@ -182,10 +186,10 @@ public: void HideSettlementScore(bool fHide=true); bool SettlementScoreIsHidden(); - // Set league performance - // Used for settlement league scenarios that use a measure different from the elapsed game time - void SetLeaguePerformance(int32_t iNewPerf); - int32_t GetLeaguePerformance() const; + // Used for special league scenarios, e.g. settlement scenarios that wish to use a + // measure different from the elapsed game time + void SetLeaguePerformance(int32_t iNewPerf, int32_t idPlayer = 0); + int32_t GetLeaguePerformance(int32_t idPlayer = 0) const; const C4RoundResultsPlayers &GetPlayers() const { return Players; } const char *GetCustomEvaluationStrings() const { return sCustomEvaluationStrings.getData(); } diff --git a/src/control/C4Teams.cpp b/src/control/C4Teams.cpp index fa6131f86..4620c42dd 100644 --- a/src/control/C4Teams.cpp +++ b/src/control/C4Teams.cpp @@ -179,7 +179,7 @@ void C4Team::RecheckColor(C4TeamList &rForList) 0x00FFFF, 0x784830 }; // cyan, dk brown // no color assigned yet: Generate by team ID - if (iID >=1 && iID <=defTeamColorCount+1) + if (iID >=1 && iID <=defTeamColorCount) { // default colors dwClr = defTeamColorRGB[iID-1] | 0xff000000; diff --git a/src/editor/C4EditCursor.cpp b/src/editor/C4EditCursor.cpp index d68292e2b..16d373b4c 100644 --- a/src/editor/C4EditCursor.cpp +++ b/src/editor/C4EditCursor.cpp @@ -153,7 +153,7 @@ bool C4EditCursor::Move(float iX, float iY, DWORD dwKeyState) Target = ((dwKeyState & MK_SHIFT) && Selection.Last) ? Selection.Last->Obj : NULL; do { - Target = Game.FindObject(C4ID::None,X,Y,0,0,OCF_NotContained, Target); + Target = Game.FindObject(NULL,X,Y,0,0,OCF_NotContained, Target); } while ((dwKeyState & MK_SHIFT) && Target && Selection.GetLink(Target)); } @@ -228,7 +228,7 @@ void C4EditCursor::ClearSelection() // remove all objects from selection and do script callbacks // iterate safely because callback might delete selected objects! C4Object *obj; - while (obj = Selection.GetObject(0)) + while ((obj = Selection.GetObject(0))) { Selection.Remove(obj); if (obj->Status) diff --git a/src/game/C4Application.cpp b/src/game/C4Application.cpp index 740212977..0d6705bcc 100644 --- a/src/game/C4Application.cpp +++ b/src/game/C4Application.cpp @@ -681,7 +681,6 @@ void C4Application::GameTick() // Game if (Game.IsRunning) Game.Execute(); - Game.DoSkipFrame = false; // Sound SoundSystem.Execute(); // Gamepad @@ -693,15 +692,13 @@ void C4Application::GameTick() void C4Application::Draw() { // Graphics - if (!Game.DoSkipFrame) - { - // Fullscreen mode - if (!isEditor) - FullScreen.Execute(); - // Console mode - else - Console.Execute(); - } + + // Fullscreen mode + if (!isEditor) + FullScreen.Execute(); + // Console mode + else + Console.Execute(); } void C4Application::SetGameTickDelay(int iDelay) @@ -836,26 +833,28 @@ bool C4Application::FullScreenMode() C4ApplicationGameTimer::C4ApplicationGameTimer() : CStdMultimediaTimerProc(26), - tLastGameTick(C4TimeMilliseconds::NegativeInfinity), iGameTickDelay(0) + tLastGameTick(C4TimeMilliseconds::NegativeInfinity), iGameTickDelay(28), iExtraGameTickDelay(0) { } void C4ApplicationGameTimer::SetGameTickDelay(uint32_t iDelay) { + // Remember delay + iGameTickDelay = iDelay; // Smaller than minimum refresh delay? if (iDelay < uint32_t(Config.Graphics.MaxRefreshDelay)) { // Set critical timer SetDelay(iDelay); // No additional breaking needed - iGameTickDelay = 0; + iExtraGameTickDelay = 0; } else { // Set critical timer SetDelay(Config.Graphics.MaxRefreshDelay); // Slow down game tick - iGameTickDelay = iDelay; + iExtraGameTickDelay = iDelay; } } @@ -865,9 +864,9 @@ bool C4ApplicationGameTimer::Execute(int iTimeout, pollfd *) if (!CheckAndReset()) return true; C4TimeMilliseconds tNow = C4TimeMilliseconds::Now(); // Execute - if (tNow >= tLastGameTick + iGameTickDelay || Game.GameGo) + if (tNow >= tLastGameTick + iExtraGameTickDelay || Game.GameGo) { - if(iGameTickDelay) + if (iGameTickDelay) tLastGameTick += iGameTickDelay; else tLastGameTick = tNow; @@ -878,8 +877,18 @@ bool C4ApplicationGameTimer::Execute(int iTimeout, pollfd *) Application.GameTick(); } - // Draw always - Application.Draw(); + // Draw + if (!Game.DoSkipFrame) + { + C4TimeMilliseconds tPreGfxTime = C4TimeMilliseconds::Now(); + + Application.Draw(); + + // Automatic frame skip if graphics are slowing down the game (skip max. every 2nd frame) + Game.DoSkipFrame = Game.Parameters.AutoFrameSkip && (tPreGfxTime + iGameTickDelay < C4TimeMilliseconds::Now()); + } else { + Game.DoSkipFrame=false; + } return true; } diff --git a/src/game/C4Application.h b/src/game/C4Application.h index 2bdbdc75c..6b234affc 100644 --- a/src/game/C4Application.h +++ b/src/game/C4Application.h @@ -110,6 +110,7 @@ public: private: C4TimeMilliseconds tLastGameTick; unsigned int iGameTickDelay; + unsigned int iExtraGameTickDelay; public: void SetGameTickDelay(uint32_t iDelay); diff --git a/src/game/C4Game.cpp b/src/game/C4Game.cpp index e41e1641d..87993aab5 100644 --- a/src/game/C4Game.cpp +++ b/src/game/C4Game.cpp @@ -319,12 +319,14 @@ bool C4Game::PreInit() { LogFatal(LoadResStr("IDS_ERR_NOGFXSYS")); return false; } // load GUI +#ifndef USE_CONSOLE C4Rect r; if (Application.isEditor) Console.GetSize(&r); else FullScreen.GetSize(&r); pGUI->Init(0, 0, r.Wdt, r.Hgt); +#endif fPreinited = true; @@ -1124,7 +1126,7 @@ C4Object* C4Game::OverlapObject(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt return NULL; } -C4Object* C4Game::FindObject(C4ID id, +C4Object* C4Game::FindObject(C4Def * pDef, int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, DWORD ocf, C4Object *pFindNext) @@ -1134,15 +1136,10 @@ C4Object* C4Game::FindObject(C4ID id, int32_t iClosest = 0,iDistance,iFartherThan=-1; C4Object *cObj; C4ObjectLink *cLnk; - C4Def *pDef; C4Object *pFindNextCpy=pFindNext; - // check the easy cases first - if (id!=C4ID::None) - { - if (!(pDef=C4Id2Def(id))) return NULL; // no valid def - if (!pDef->Count) return NULL; // no instances at all - } + // check the easy case first: no instances at all? + if (pDef && !pDef->Count) return NULL; // Finding next closest: find closest but further away than last closest if (pFindNext && (iWdt==-1) && (iHgt==-1)) @@ -1159,7 +1156,7 @@ C4Object* C4Game::FindObject(C4ID id, // Status if (cObj->Status) // ID - if ((id==C4ID::None) || (cObj->Def->id==id)) + if (!pDef || (cObj->Def == pDef)) // OCF (match any specified) if (cObj->OCF & ocf) // Area @@ -2838,7 +2835,6 @@ bool C4Game::InitKeyboard() // console keys KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(K_PAUSE ), "ConsolePauseToggle", KEYSCOPE_Console, new C4KeyCB (Console, &C4Console::TogglePause))); - KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(K_SPACE ), "EditCursorModeToggle", KEYSCOPE_Console, new C4KeyCB (Console.EditCursor, &C4EditCursor::ToggleMode))); KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(K_ADD ), "ToolsDlgGradeUp", KEYSCOPE_Console, new C4KeyCBEx(Console.ToolsDlg, +5, &C4ToolsDlg::ChangeGrade))); KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(K_SUBTRACT ), "ToolsDlgGradeDown", KEYSCOPE_Console, new C4KeyCBEx(Console.ToolsDlg, -5, &C4ToolsDlg::ChangeGrade))); KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(K_M, KEYS_Control), "ToolsDlgPopMaterial", KEYSCOPE_Console, new C4KeyCB (Console.ToolsDlg, &C4ToolsDlg::PopMaterial))); @@ -2848,6 +2844,7 @@ bool C4Game::InitKeyboard() KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(K_DELETE ), "EditCursorDelete", KEYSCOPE_Console, new C4KeyCB (Console.EditCursor, &C4EditCursor::Delete))); // no default keys assigned + KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(KEY_Default ), "EditCursorModeToggle", KEYSCOPE_Console, new C4KeyCB (Console.EditCursor, &C4EditCursor::ToggleMode))); KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(KEY_Default ), "ChartToggle", C4KeyScope(KEYSCOPE_Generic | KEYSCOPE_Gui), new C4KeyCB (*this, &C4Game::ToggleChart))); KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(KEY_Default ), "NetObsNextPlayer", KEYSCOPE_FreeView, new C4KeyCB (::Viewports, &C4ViewportList::ViewportNextPlayer))); KeyboardInput.RegisterKey(new C4CustomKey(C4KeyCodeEx(KEY_Default ), "CtrlRateDown", KEYSCOPE_Generic, new C4KeyCBEx(Control, -1, &C4GameControl::KeyAdjustControlRate))); diff --git a/src/game/C4Game.h b/src/game/C4Game.h index 623550854..2ddc8bf83 100644 --- a/src/game/C4Game.h +++ b/src/game/C4Game.h @@ -189,7 +189,7 @@ public: C4Object *CreateInfoObject(C4ObjectInfo *cinf, int32_t owner, int32_t tx=50, int32_t ty=50); C4Object *OverlapObject(int32_t tx, int32_t ty, int32_t wdt, int32_t hgt, int32_t Plane); - C4Object *FindObject(C4ID id, + C4Object *FindObject(C4Def * pDef, int32_t iX=0, int32_t iY=0, int32_t iWdt=0, int32_t iHgt=0, DWORD ocf=OCF_All, C4Object *pFindNext=NULL); diff --git a/src/game/ClonkMain.cpp b/src/game/ClonkMain.cpp index 42f6b217f..a0a18c460 100644 --- a/src/game/ClonkMain.cpp +++ b/src/game/ClonkMain.cpp @@ -125,41 +125,70 @@ int main() #include #endif -static void crash_handler(int signo) +static void crash_handler(int signo, siginfo_t * si, void *) { - int logfd = STDERR_FILENO; - for (;;) + static unsigned signal_count = 0; + ++signal_count; + switch (signo) { - // Print out the signal - write(logfd, C4VERSION ": Caught signal ", sizeof (C4VERSION ": Caught signal ") - 1); - switch (signo) + case SIGINT: case SIGTERM: case SIGHUP: + if (signal_count < 2) { + Application.Quit(); + break; + } // else/fallthrough + default: + int logfd = STDERR_FILENO; + for (;;) { - case SIGBUS: write(logfd, "SIGBUS", sizeof ("SIGBUS") - 1); break; - case SIGILL: write(logfd, "SIGILL", sizeof ("SIGILL") - 1); break; - case SIGSEGV: write(logfd, "SIGSEGV", sizeof ("SIGSEGV") - 1); break; - case SIGABRT: write(logfd, "SIGABRT", sizeof ("SIGABRT") - 1); break; - case SIGINT: write(logfd, "SIGINT", sizeof ("SIGINT") - 1); break; - case SIGQUIT: write(logfd, "SIGQUIT", sizeof ("SIGQUIT") - 1); break; - case SIGFPE: write(logfd, "SIGFPE", sizeof ("SIGFPE") - 1); break; - case SIGTERM: write(logfd, "SIGTERM", sizeof ("SIGTERM") - 1); break; + // Print out the signal + write(logfd, C4VERSION ": Caught signal ", sizeof (C4VERSION ": Caught signal ") - 1); + switch (signo) + { + case SIGBUS: write(logfd, "SIGBUS", sizeof ("SIGBUS") - 1); break; + case SIGILL: write(logfd, "SIGILL", sizeof ("SIGILL") - 1); break; + case SIGSEGV: write(logfd, "SIGSEGV", sizeof ("SIGSEGV") - 1); break; + case SIGABRT: write(logfd, "SIGABRT", sizeof ("SIGABRT") - 1); break; + case SIGINT: write(logfd, "SIGINT", sizeof ("SIGINT") - 1); break; + case SIGHUP: write(logfd, "SIGHUP", sizeof ("SIGHUP") - 1); break; + case SIGFPE: write(logfd, "SIGFPE", sizeof ("SIGFPE") - 1); break; + case SIGTERM: write(logfd, "SIGTERM", sizeof ("SIGTERM") - 1); break; + } + char hex[sizeof(void *) * 2]; + int i; intptr_t x = reinterpret_cast(si->si_addr); + switch (signo) + { + case SIGILL: case SIGFPE: case SIGSEGV: case SIGBUS: case SIGTRAP: + write(logfd, " (0x", sizeof (" (0x") - 1); + for (int i = sizeof(void *) * 2 - 1; i >= 0; --i) + { + if ((x & 0xf) > 9) + hex[i] = 'a' + (x & 0xf) - 9; + else + hex[i] = '0' + (x & 0xf); + x >>= 4; + } + write(logfd, hex, sizeof (hex)); + write(logfd, ")", sizeof (")") - 1); + break; + } + write(logfd, "\n", sizeof ("\n") - 1); + if (logfd == STDERR_FILENO) logfd = GetLogFD(); + else break; + if (logfd < 0) break; } - write(logfd, "\n", sizeof ("\n") - 1); - if (logfd == STDERR_FILENO) logfd = GetLogFD(); - else break; - if (logfd < 0) break; - } #ifdef HAVE_EXECINFO_H - // Get the backtrace - void *stack[100]; - int count = backtrace(stack, 100); - // Print it out - backtrace_symbols_fd (stack, count, STDERR_FILENO); - // Also to the log file - if (logfd >= 0) - backtrace_symbols_fd (stack, count, logfd); + // Get the backtrace + void *stack[100]; + int count = backtrace(stack, 100); + // Print it out + backtrace_symbols_fd (stack, count, STDERR_FILENO); + // Also to the log file + if (logfd >= 0) + backtrace_symbols_fd (stack, count, logfd); #endif - // Bye. - _exit(C4XRV_Failure); + // Bye. + _exit(C4XRV_Failure); + } } #endif // HAVE_SIGNAL_H @@ -181,15 +210,21 @@ int main (int argc, char * argv[]) return C4XRV_Failure; } #ifdef HAVE_SIGNAL_H + struct sigaction sa; + sa.sa_sigaction = crash_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_SIGINFO; + // Quit the program when asked + sigaction(SIGINT, &sa, NULL); + sigaction(SIGTERM, &sa, NULL); + sigaction(SIGHUP, &sa, NULL); // Set up debugging facilities - signal(SIGBUS, crash_handler); - signal(SIGILL, crash_handler); - signal(SIGSEGV, crash_handler); - signal(SIGABRT, crash_handler); - signal(SIGINT, crash_handler); - signal(SIGQUIT, crash_handler); - signal(SIGFPE, crash_handler); - signal(SIGTERM, crash_handler); + sa.sa_flags |= SA_RESETHAND; + sigaction(SIGBUS, &sa, NULL); + sigaction(SIGILL, &sa, NULL); + sigaction(SIGSEGV, &sa, NULL); + sigaction(SIGABRT, &sa, NULL); + sigaction(SIGFPE, &sa, NULL); #endif // Init application diff --git a/src/gamescript/C4Effect.h b/src/gamescript/C4Effect.h index 03c60ef30..069a6d3d1 100644 --- a/src/gamescript/C4Effect.h +++ b/src/gamescript/C4Effect.h @@ -51,6 +51,7 @@ #define C4FxCall_DmgScript 0 // damage through script call #define C4FxCall_DmgBlast 1 // damage through blast #define C4FxCall_DmgFire 2 // damage through fire +#define C4FxCall_DmgChop 3 // damage through chopping // energy loss callbacks #define C4FxCall_EngScript 32 // energy loss through script call diff --git a/src/gamescript/C4FindObject.cpp b/src/gamescript/C4FindObject.cpp index 546e14475..013df7087 100644 --- a/src/gamescript/C4FindObject.cpp +++ b/src/gamescript/C4FindObject.cpp @@ -87,7 +87,7 @@ C4FindObject *C4FindObject::CreateByValue(const C4Value &DataVal, C4SortObject * return new C4FindObjectExclude(Data[1].getObj()); case C4FO_ID: - return new C4FindObjectID(Data[1].getC4ID()); + return new C4FindObjectDef(Data[1].getPropList()); // #973: For all criteria using coordinates: If FindObject et al. are called in object context, offset by object center @@ -606,15 +606,14 @@ bool C4FindObjectExclude::Check(C4Object *pObj) return pObj != pExclude; } -bool C4FindObjectID::Check(C4Object *pObj) +bool C4FindObjectDef::Check(C4Object *pObj) { - return pObj->id == id; + return pObj->GetPrototype() == def; } -bool C4FindObjectID::IsImpossible() +bool C4FindObjectDef::IsImpossible() { - C4Def * pDef = C4Id2Def(id); - return !pDef || !pDef->Count; + return !def || !def->GetDef() || !def->GetDef()->Count; } bool C4FindObjectInRect::Check(C4Object *pObj) diff --git a/src/gamescript/C4FindObject.h b/src/gamescript/C4FindObject.h index 12e8c9306..5cf2eb978 100644 --- a/src/gamescript/C4FindObject.h +++ b/src/gamescript/C4FindObject.h @@ -169,13 +169,13 @@ protected: virtual bool Check(C4Object *pObj); }; -class C4FindObjectID : public C4FindObject +class C4FindObjectDef : public C4FindObject { public: - C4FindObjectID(C4ID id) - : id(id) { } + C4FindObjectDef(C4PropList * def) + : def(def) { } private: - C4ID id; + C4PropList * def; protected: virtual bool Check(C4Object *pObj); virtual bool IsImpossible(); diff --git a/src/gamescript/C4GameScript.cpp b/src/gamescript/C4GameScript.cpp index 7611f1337..46a0d9e13 100644 --- a/src/gamescript/C4GameScript.cpp +++ b/src/gamescript/C4GameScript.cpp @@ -206,7 +206,7 @@ static bool FnCheckConstructionSite(C4PropList * _this, C4PropList * PropList, i { // Make sure parameters are valid if (!PropList || !PropList->GetDef()) - return NULL; + return false; // Local object calls override position offset, owner if (Object(_this)) @@ -716,6 +716,38 @@ static bool FnSetPlayerZoomByViewRange(C4PropList * _this, long plr_idx, long ra return true; } +static bool FnSetPlayerZoom(C4PropList * _this, long plr_idx, long zoom, long precision, long flags) +{ + // parameter safety. 0/0 means "reset to default". + if (zoom < 0 || precision < 0) return false; + // special player NO_OWNER: apply to all viewports + if (plr_idx == NO_OWNER) + { + for (C4Player *plr = ::Players.First; plr; plr=plr->Next) + if (plr->Number != NO_OWNER) // can't happen, but would be a crash if it did... + FnSetPlayerZoom(_this, plr->Number, zoom, precision, flags); + return true; + } + else + { + // zoom factor calculation + if (!precision) precision = 1; + C4Fixed fZoom = itofix(zoom, precision); + // safety check on player only, so function return result is always in sync + C4Player *plr = ::Players.Get(plr_idx); + if (!plr) return false; + // adjust values in player + if (!(flags & (PLRZOOM_LimitMin | PLRZOOM_LimitMax))) + plr->SetZoom(fZoom, !!(flags & PLRZOOM_Direct), !!(flags & PLRZOOM_NoIncrease), !!(flags & PLRZOOM_NoDecrease)); + else + { + if (flags & PLRZOOM_LimitMin) plr->SetMinZoom(fZoom, !!(flags & PLRZOOM_NoIncrease), !!(flags & PLRZOOM_NoDecrease)); + if (flags & PLRZOOM_LimitMax) plr->SetMaxZoom(fZoom, !!(flags & PLRZOOM_NoIncrease), !!(flags & PLRZOOM_NoDecrease)); + } + } + return true; +} + static bool FnSetPlayerViewLock(C4PropList * _this, long plr_idx, bool is_locked) { // special player NO_OWNER: apply to all players @@ -732,26 +764,26 @@ static bool FnSetPlayerViewLock(C4PropList * _this, long plr_idx, bool is_locked return true; } -static bool FnDoHomebaseMaterial(C4PropList * _this, long iPlr, C4ID id, long iChange) +static bool FnDoBaseMaterial(C4PropList * _this, long iPlr, C4ID id, long iChange) { // validity check if (!ValidPlr(iPlr)) return false; C4Def *pDef = C4Id2Def(id); if (!pDef) return false; // add to material - long iLastcount = ::Players.Get(iPlr)->HomeBaseMaterial.GetIDCount(id); - return ::Players.Get(iPlr)->HomeBaseMaterial.SetIDCount(id,iLastcount+iChange,true); + long iLastcount = ::Players.Get(iPlr)->BaseMaterial.GetIDCount(id); + return ::Players.Get(iPlr)->BaseMaterial.SetIDCount(id,iLastcount+iChange,true); } -static bool FnDoHomebaseProduction(C4PropList * _this, long iPlr, C4ID id, long iChange) +static bool FnDoBaseProduction(C4PropList * _this, long iPlr, C4ID id, long iChange) { // validity check if (!ValidPlr(iPlr)) return false; C4Def *pDef = C4Id2Def(id); if (!pDef) return false; // add to material - long iLastcount = ::Players.Get(iPlr)->HomeBaseProduction.GetIDCount(id); - return ::Players.Get(iPlr)->HomeBaseProduction.SetIDCount(id,iLastcount+iChange,true); + long iLastcount = ::Players.Get(iPlr)->BaseProduction.GetIDCount(id); + return ::Players.Get(iPlr)->BaseProduction.SetIDCount(id,iLastcount+iChange,true); } static bool FnSetPlrKnowledge(C4PropList * _this, long iPlr, C4ID id, bool fRemove) @@ -810,22 +842,22 @@ static C4Value FnGetComponent(C4PropList * _this, C4ID idComponent, int iIndex, return C4Value(); } -static C4Value FnGetHomebaseMaterial(C4PropList * _this, int iPlr, C4ID id, int iIndex, int dwCategory) +static C4Value FnGetBaseMaterial(C4PropList * _this, int iPlr, C4ID id, int iIndex, int dwCategory) { if (!ValidPlr(iPlr)) return C4VBool(false); // Search by id, return available count - if (id) return C4VInt(::Players.Get(iPlr)->HomeBaseMaterial.GetIDCount(id)); + if (id) return C4VInt(::Players.Get(iPlr)->BaseMaterial.GetIDCount(id)); // Search indexed item of given category, return C4ID - return C4VPropList(C4Id2Def(::Players.Get(iPlr)->HomeBaseMaterial.GetID( ::Definitions, dwCategory, iIndex ))); + return C4VPropList(C4Id2Def(::Players.Get(iPlr)->BaseMaterial.GetID( ::Definitions, dwCategory, iIndex ))); } -static C4Value FnGetHomebaseProduction(C4PropList * _this, int iPlr, C4ID id, int iIndex, int dwCategory) +static C4Value FnGetBaseProduction(C4PropList * _this, int iPlr, C4ID id, int iIndex, int dwCategory) { if (!ValidPlr(iPlr)) return C4VBool(false); // Search by id, return available count - if (id) return C4VInt(::Players.Get(iPlr)->HomeBaseProduction.GetIDCount(id)); + if (id) return C4VInt(::Players.Get(iPlr)->BaseProduction.GetIDCount(id)); // Search indexed item of given category, return C4ID - return C4VPropList(C4Id2Def(::Players.Get(iPlr)->HomeBaseProduction.GetID( ::Definitions, dwCategory, iIndex ))); + return C4VPropList(C4Id2Def(::Players.Get(iPlr)->BaseProduction.GetID( ::Definitions, dwCategory, iIndex ))); } static long FnGetWealth(C4PropList * _this, long iPlr) @@ -927,11 +959,14 @@ static bool FnSurrenderPlayer(C4PropList * _this, long iPlr) } // undocumented! -static bool FnSetLeaguePerformance(C4PropList * _this, long iScore) -{ - Game.RoundResults.SetLeaguePerformance(iScore); +static bool FnSetLeaguePerformance(C4PropList * _this, long iScore, long idPlayer) + { + if(!Game.Parameters.isLeague()) return false; + if(idPlayer && !Game.PlayerInfos.GetPlayerInfoByID(idPlayer)) return false; + Game.RoundResults.SetLeaguePerformance(iScore, idPlayer); return true; -} + } + static const int32_t CSPF_FixedAttributes = 1<<0, CSPF_NoScenarioInit = 1<<1, @@ -1132,6 +1167,34 @@ static C4String *FnGetLeague(C4PropList * _this, long idx) return String(sIdxLeague.getData()); } +static int32_t FnGetLeagueScore(C4PropList * _this, long idPlayer) +{ + // security + if (idPlayer < 1) return 0; + // get info + C4PlayerInfo *pInfo = Game.PlayerInfos.GetPlayerInfoByID(idPlayer); + if (!pInfo) return 0; + // get league score + return pInfo->getLeagueScore(); +} + +static bool FnSetLeagueProgressData(C4PropList * _this, C4String *pNewData, long idPlayer) +{ + if(!Game.Parameters.League.getLength() || !idPlayer) return false; + C4PlayerInfo *info = Game.PlayerInfos.GetPlayerInfoByID(idPlayer); + if (!info) return false; + info->SetLeagueProgressData(pNewData ? pNewData->GetCStr() : NULL); + return true; +} + +static C4String *FnGetLeagueProgressData(C4PropList * _this, long idPlayer) +{ + if(!Game.Parameters.League.getLength()) return NULL; + C4PlayerInfo *info = Game.PlayerInfos.GetPlayerInfoByID(idPlayer); + if (!info) return NULL; + return String(info->GetLeagueProgressData()); +} + // undocumented! static bool FnTestMessageBoard(C4PropList * _this, long iForPlr, bool fTestIfInUse) { @@ -1566,8 +1629,9 @@ static bool FnCreateParticle(C4PropList * _this, C4String *name, C4Value x, C4Va static bool FnClearParticles(C4PropList * _this) { +#ifndef USE_CONSOLE C4Object *obj; - if (obj = Object(_this)) + if ((obj = Object(_this))) { if (obj->BackParticles) obj->BackParticles->Clear(); @@ -1579,7 +1643,7 @@ static bool FnClearParticles(C4PropList * _this) if (::Particles.GetGlobalParticles()) ::Particles.GetGlobalParticles()->Clear(); } - +#endif // always return true return true; } @@ -2429,7 +2493,10 @@ void InitGameFunctionMap(C4AulScriptEngine *pEngine) AddFunc(pEngine, "GetPlayerByIndex", FnGetPlayerByIndex); AddFunc(pEngine, "EliminatePlayer", FnEliminatePlayer); AddFunc(pEngine, "SurrenderPlayer", FnSurrenderPlayer); + AddFunc(pEngine, "FnGetLeagueScore", FnGetLeagueScore); AddFunc(pEngine, "SetLeaguePerformance", FnSetLeaguePerformance); + AddFunc(pEngine, "SetLeagueProgressData", FnSetLeagueProgressData); + AddFunc(pEngine, "GetLeagueProgressData", FnGetLeagueProgressData); AddFunc(pEngine, "CreateScriptPlayer", FnCreateScriptPlayer); AddFunc(pEngine, "GetCursor", FnGetCursor); AddFunc(pEngine, "GetViewCursor", FnGetViewCursor); @@ -2454,9 +2521,10 @@ void InitGameFunctionMap(C4AulScriptEngine *pEngine) AddFunc(pEngine, "SetClimate", FnSetClimate); AddFunc(pEngine, "GetClimate", FnGetClimate); AddFunc(pEngine, "SetPlayerZoomByViewRange", FnSetPlayerZoomByViewRange); + AddFunc(pEngine, "SetPlayerZoom", FnSetPlayerZoom); AddFunc(pEngine, "SetPlayerViewLock", FnSetPlayerViewLock); - AddFunc(pEngine, "DoHomebaseMaterial", FnDoHomebaseMaterial); - AddFunc(pEngine, "DoHomebaseProduction", FnDoHomebaseProduction); + AddFunc(pEngine, "DoBaseMaterial", FnDoBaseMaterial); + AddFunc(pEngine, "DoBaseProduction", FnDoBaseProduction); AddFunc(pEngine, "GainMissionAccess", FnGainMissionAccess); AddFunc(pEngine, "IsNetwork", FnIsNetwork); AddFunc(pEngine, "GetLeague", FnGetLeague); @@ -2530,8 +2598,8 @@ void InitGameFunctionMap(C4AulScriptEngine *pEngine) F(GetPlrKnowledge); F(GetComponent); - F(GetHomebaseMaterial); - F(GetHomebaseProduction); + F(GetBaseMaterial); + F(GetBaseProduction); F(GetDefCoreVal); F(GetObjectVal); F(GetObjectInfoCoreVal); @@ -2579,6 +2647,7 @@ C4ScriptConstDef C4ScriptGameConstMap[]= { "FX_Call_DmgScript" ,C4V_Int, C4FxCall_DmgScript }, // damage through script call { "FX_Call_DmgBlast" ,C4V_Int, C4FxCall_DmgBlast }, // damage through blast { "FX_Call_DmgFire" ,C4V_Int, C4FxCall_DmgFire }, // damage through fire + { "FX_Call_DmgChop" ,C4V_Int, C4FxCall_DmgChop }, // damage through chopping { "FX_Call_Energy" ,C4V_Int, 32 }, // bitmask for generic energy loss { "FX_Call_EngScript" ,C4V_Int, C4FxCall_EngScript }, // energy loss through script call { "FX_Call_EngBlast" ,C4V_Int, C4FxCall_EngBlast }, // energy loss through blast diff --git a/src/gamescript/C4Script.h b/src/gamescript/C4Script.h index 730b31d05..bb3d35999 100644 --- a/src/gamescript/C4Script.h +++ b/src/gamescript/C4Script.h @@ -111,6 +111,7 @@ bool C4ValueToMatrix(const C4ValueArray& array, StdMeshMatrix* matrix); #define PSF_EditCursorSelection "~EditCursorSelection" #define PSF_EditCursorDeselection "~EditCursorDeselection" #define PSF_DigOutObject "~DigOutObject" // C4Object *obj +#define PSF_OnDugOut "~DugOut" //C4Object *by_obj #define PSF_SaveScenarioObjects "~SaveScenarioObjects" // int file_handle // Effect callbacks diff --git a/src/graphics/C4DrawT.cpp b/src/graphics/C4DrawT.cpp index 9278ffcc9..8884d27b2 100644 --- a/src/graphics/C4DrawT.cpp +++ b/src/graphics/C4DrawT.cpp @@ -17,6 +17,11 @@ #include #include +CStdNoGfx::CStdNoGfx() +{ + Default(); +} + bool CStdNoGfx::CreatePrimarySurfaces(bool Fullscreen, unsigned int iXRes, unsigned int iYRes, int iColorDepth, unsigned int iMonitor) { Log("Graphics disabled."); @@ -30,4 +35,3 @@ bool CStdNoGfx::PrepareMaterial(StdMeshMaterial& mesh) { mesh.BestTechniqueIndex=0; return true; } - diff --git a/src/graphics/C4DrawT.h b/src/graphics/C4DrawT.h index 67686d33a..7e045226d 100644 --- a/src/graphics/C4DrawT.h +++ b/src/graphics/C4DrawT.h @@ -23,6 +23,7 @@ class CStdNoGfx : public C4Draw { public: + CStdNoGfx(); virtual bool BeginScene() { return true; } virtual void EndScene() { } virtual void TaskOut() { } diff --git a/src/graphics/C4FontLoader.cpp b/src/graphics/C4FontLoader.cpp index 79f36951b..a13c6d6a9 100644 --- a/src/graphics/C4FontLoader.cpp +++ b/src/graphics/C4FontLoader.cpp @@ -876,7 +876,9 @@ int CStdFont::BreakMessage(const char *szMsg, int iWdt, StdStrBuf *pOut, bool fC int CStdFont::GetMessageBreak(const char *szMsg, const char **ppNewPos, int iBreakWidth, float fZoom) { #ifdef USE_CONSOLE - *ppNewPos = szMsg; return 0; + *ppNewPos = szMsg; + while(**ppNewPos) ++*ppNewPos; + return *ppNewPos - szMsg; #else // safety if (!szMsg || !*szMsg) { *ppNewPos = szMsg; return 0; } diff --git a/src/gui/C4GameOverDlg.cpp b/src/gui/C4GameOverDlg.cpp index f26eec8f7..47db92c50 100644 --- a/src/gui/C4GameOverDlg.cpp +++ b/src/gui/C4GameOverDlg.cpp @@ -61,7 +61,7 @@ C4GoalDisplay::GoalPicture::GoalPicture(const C4Rect &rcBounds, C4ID idGoal, boo { Picture.Create(C4PictureSize, C4PictureSize); // get an object instance to draw (optional; may be zero) - C4Object *pGoalObj = ::Objects.Find(idGoal); + C4Object *pGoalObj = ::Objects.Find(pDrawDef); // draw goal def! pDrawDef->Draw(Picture, false, 0, pGoalObj); } @@ -238,11 +238,11 @@ C4GameOverDlg::C4GameOverDlg() : C4GUI::Dialog( (C4GUI::GetScreenWdt() < 800) ? btnContinue->SetToolTip(Game.NextMissionDesc.getData()); } } + fIsQuitBtnVisible = fIsNetDone || !::Network.isHost(); // updates Application.Add(this); Update(); // initial focus on quit button if visible, so space/enter/low gamepad buttons quit - fIsQuitBtnVisible = fIsNetDone || !::Network.isHost(); if (fIsQuitBtnVisible) SetFocus(btnExit, false); } @@ -301,20 +301,20 @@ void C4GameOverDlg::SetNetResult(const char *szResultString, C4RoundResults::Net void C4GameOverDlg::OnExitBtn(C4GUI::Control *btn) { // callback: exit button pressed. - Close(false); Application.QuitGame(); + Close(false); } void C4GameOverDlg::OnContinueBtn(C4GUI::Control *btn) { // callback: continue button pressed - Close(true); // unpauses if (fHasNextMissionButton) { // switch to next mission if next mission button is pressed Application.SetNextMission(Game.NextMission.getData()); Application.QuitGame(); } + Close(true); // unpauses and deletes this object } void C4GameOverDlg::OnShown() @@ -330,7 +330,7 @@ void C4GameOverDlg::OnShown() void C4GameOverDlg::OnClosed(bool fOK) { - typedef C4GUI::Dialog BaseClass; - BaseClass::OnClosed(fOK); // deletes this! Game.Unpause(); + typedef C4GUI::Dialog BaseClass; + BaseClass::OnClosed(fOK); // deletes this object! } diff --git a/src/gui/C4MainMenu.cpp b/src/gui/C4MainMenu.cpp index ec7eff478..73c3814f4 100644 --- a/src/gui/C4MainMenu.cpp +++ b/src/gui/C4MainMenu.cpp @@ -804,8 +804,8 @@ bool C4MainMenu::MenuCommand(const char *szCommand, bool fIsCloseCommand) { if (!ValidPlr(Player)) return false; // observers may not look at goal/rule info, because it requires queue activation Close(true); - C4Object *pObj; C4ID idItem(szCommand+12); - if ((pObj = ::Objects.Find(idItem))) + C4Object *pObj; C4ID idItem(szCommand+12); C4Def * pDef = C4Id2Def(idItem); + if (pDef && (pObj = ::Objects.Find(pDef))) ::Control.DoInput(CID_PlrAction, C4ControlPlayerAction::ActivateGoal(::Players.Get(Player), pObj), CDT_Queue); else return false; diff --git a/src/gui/C4MouseControl.cpp b/src/gui/C4MouseControl.cpp index 0e39d7706..d4f036463 100644 --- a/src/gui/C4MouseControl.cpp +++ b/src/gui/C4MouseControl.cpp @@ -638,16 +638,16 @@ void C4MouseControl::DragNone() // check if target object allows scripted dragging if (fAllowDrag && DownTarget && (!FogOfWar || (DownTarget->Category & C4D_IgnoreFoW))) { - C4Object *drag_image_obj; C4ID drag_image_id; + C4Object *drag_image_obj; C4Def * drag_image_def; // Drag only if MD_SOURCE is set and drag image is present if ( (DownTarget->GetPropertyInt(P_MouseDrag) & C4MC_MD_DragSource) && - DownTarget->GetDragImage(&drag_image_obj, &drag_image_id)) + DownTarget->GetDragImage(&drag_image_obj, &drag_image_def)) { Drag=C4MC_Drag_Script; if(drag_image_obj) DragImageObject = drag_image_obj; - else DragImageDef = C4Id2Def(drag_image_id); + else DragImageDef = drag_image_def; DragObject = DownTarget; } diff --git a/src/gui/C4StartupOptionsDlg.cpp b/src/gui/C4StartupOptionsDlg.cpp index 186b8dbcc..43d7410cd 100644 --- a/src/gui/C4StartupOptionsDlg.cpp +++ b/src/gui/C4StartupOptionsDlg.cpp @@ -834,8 +834,8 @@ C4StartupOptionsDlg::C4StartupOptionsDlg() : C4StartupDlg(LoadResStrNoAmp("IDS_D pCombo->SetText(GetWindowedName()); pGroupResolution->AddElement(pCombo); // --subgroup options - iNumGfxOptions = 4, iOpt=0; - C4GUI::GroupBox *pGroupOptions = new C4GUI::GroupBox(caSheetGraphics.GetGridCell(0,2,1,2)); + iNumGfxOptions = 5, iOpt=0; + C4GUI::GroupBox *pGroupOptions = new C4GUI::GroupBox(caSheetGraphics.GetGridCell(0,1,1,2)); pGroupOptions->SetTitle(LoadResStrNoAmp("IDS_DLG_OPTIONS")); pGroupOptions->SetFont(pUseFont); pGroupOptions->SetColors(C4StartupEditBorderColor, C4StartupFontClr); @@ -881,27 +881,11 @@ C4StartupOptionsDlg::C4StartupOptionsDlg() : C4StartupDlg(LoadResStrNoAmp("IDS_D pCheck->SetToolTip(LoadResStr("IDS_MSG_HIGHRESLANDSCAPE_DESC")); pCheck->SetFont(pUseFont, C4StartupFontClr, C4StartupFontClrDisabled); pGroupOptions->AddElement(pCheck); - // --subgroup effects - C4GUI::GroupBox *pGroupEffects = new C4GUI::GroupBox(caSheetGraphics.GetGridCell(1,2,1,2)); - pGroupEffects->SetTitle(LoadResStrNoAmp("IDS_CTL_SMOKE")); - pGroupEffects->SetFont(pUseFont); - pGroupEffects->SetColors(C4StartupEditBorderColor, C4StartupFontClr); - pSheetGraphics->AddElement(pGroupEffects); - C4GUI::ComponentAligner caGroupEffects(pGroupEffects->GetClientRect(), iIndentX1, iIndentY2, true); - iNumGfxOptions = 1; iOpt=0; - // effects level slider - C4GUI::ComponentAligner caEffectsLevel(caGroupEffects.GetGridCell(0,1,iOpt++,iNumGfxOptions), 1,0,false); - StdStrBuf sEffectsTxt; sEffectsTxt.Copy(LoadResStr("IDS_CTL_SMOKELOW")); - w=20; q=12; pUseFont->GetTextExtent(sEffectsTxt.getData(), w,q, true); - pGroupEffects->AddElement(new C4GUI::Label(sEffectsTxt.getData(), caEffectsLevel.GetFromLeft(w,q), ACenter, C4StartupFontClr, pUseFont, false, false)); - sEffectsTxt.Copy(LoadResStr("IDS_CTL_SMOKEHI")); - w=20; q=12; pUseFont->GetTextExtent(sEffectsTxt.getData(), w,q, true); - pGroupEffects->AddElement(new C4GUI::Label(sEffectsTxt.getData(), caEffectsLevel.GetFromRight(w,q), ACenter, C4StartupFontClr, pUseFont, false, false)); - pEffectLevelSlider = new C4GUI::ScrollBar(caEffectsLevel.GetCentered(caEffectsLevel.GetInnerWidth(), C4GUI_ScrollBarHgt), true, new C4GUI::ParCallbackHandler(this, &C4StartupOptionsDlg::OnEffectsSliderChange), 301); - pEffectLevelSlider->SetDecoration(&C4Startup::Get()->Graphics.sfctBookScroll, false); - pEffectLevelSlider->SetToolTip(LoadResStr("IDS_MSG_PARTICLES_DESC")); - pEffectLevelSlider->SetScrollPos(Config.Graphics.SmokeLevel); - pGroupEffects->AddElement(pEffectLevelSlider); + // automatic gfx frame skip + pCheck = new BoolConfig(caGroupOptions.GetGridCell(0,1,iOpt++,iNumGfxOptions,-1,iCheckHgt,true), LoadResStr("IDS_MSG_AUTOFRAMESKIP"), NULL, &Config.Graphics.AutoFrameSkip); + pCheck->SetToolTip(LoadResStr("IDS_DESC_AUTOFRAMESKIP")); + pCheck->SetFont(pUseFont, C4StartupFontClr, C4StartupFontClrDisabled); + pGroupOptions->AddElement(pCheck); // --- page sound C4GUI::ComponentAligner caSheetSound(pSheetSound->GetClientRect(), iIndentX1, iIndentY1, true); @@ -1439,11 +1423,6 @@ void C4StartupOptionsDlg::SaveGfxShader() } } -void C4StartupOptionsDlg::OnEffectsSliderChange(int32_t iNewVal) -{ - Config.Graphics.SmokeLevel = iNewVal; -} - void C4StartupOptionsDlg::OnFEMusicCheck(C4GUI::Element *pCheckBox) { // option change is reflected immediately diff --git a/src/gui/C4StartupOptionsDlg.h b/src/gui/C4StartupOptionsDlg.h index 7be14395c..9a4649561 100644 --- a/src/gui/C4StartupOptionsDlg.h +++ b/src/gui/C4StartupOptionsDlg.h @@ -137,11 +137,9 @@ private: bool TryNewResolution(int32_t iResX, int32_t iResY); StdStrBuf GetGfxResString(int32_t iResX, int32_t iResY); // convert resolution to string to be displayed in resolution choice combobox const char * GetWindowedName(int32_t mode = -1); - void OnEffectsSliderChange(int32_t iNewVal); C4GUI::CheckBox *pShaders; int32_t iGfxTexIndent; - C4GUI::ScrollBar *pEffectLevelSlider; void LoadGfxShader(); void SaveGfxShader(); diff --git a/src/landscape/C4Landscape.cpp b/src/landscape/C4Landscape.cpp index 523823964..6a27d7087 100644 --- a/src/landscape/C4Landscape.cpp +++ b/src/landscape/C4Landscape.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -546,6 +547,7 @@ void C4Landscape::BlastMaterial2Objects(int32_t tx, int32_t ty, C4MaterialList * void C4Landscape::DigMaterial2Objects(int32_t tx, int32_t ty, C4MaterialList *mat_list, C4Object *pCollect) { + C4AulParSet pars(C4VObj(pCollect)); for (int32_t mat=0; mat< ::MaterialMap.Num; mat++) { if (mat_list->Amount[mat]) @@ -555,6 +557,7 @@ void C4Landscape::DigMaterial2Objects(int32_t tx, int32_t ty, C4MaterialList *ma while (mat_list->Amount[mat] >= ::MaterialMap.Map[mat].Dig2ObjectRatio) { C4Object *pObj = Game.CreateObject(::MaterialMap.Map[mat].Dig2Object, NULL, NO_OWNER, tx, ty); + if (pObj && pObj->Status) pObj->Call(PSF_OnDugOut, &pars); // Try to collect object if(::MaterialMap.Map[mat].Dig2ObjectCollect && pCollect && pObj) if(!pCollect->Collect(pObj)) @@ -751,11 +754,11 @@ bool C4Landscape::_SetPixIfMask(int32_t x, int32_t y, BYTE npix, BYTE nMask) bool C4Landscape::CheckInstability(int32_t tx, int32_t ty, int32_t recursion_count) { int32_t mat=GetMat(tx,ty); - if (MatValid(mat)) + if (MatValid(mat)) { if (::MaterialMap.Map[mat].Instable) return ::MassMover.Create(tx,ty); // Get rid of single pixels - else if (::MaterialMap.Map[mat].DigFree && recursion_count<10) + else if (::MaterialMap.Map[mat].DigFree && recursion_count<10) if ((!::GBackSolid(tx,ty+1)) + (!::GBackSolid(tx,ty-1)) + (!::GBackSolid(tx+1,ty)) + (!::GBackSolid(tx-1,ty)) >= 3) { if (!ClearPix(tx,ty)) return false; @@ -769,6 +772,7 @@ bool C4Landscape::CheckInstability(int32_t tx, int32_t ty, int32_t recursion_cou CheckInstability(tx,ty+1,recursion_count); return true; } + } return false; } @@ -929,7 +933,7 @@ bool C4Landscape::Incinerate(int32_t x, int32_t y) if (MatValid(mat)) if (::MaterialMap.Map[mat].Inflammable) // Not too much FLAMs - if (!Game.FindObject (C4ID::Flame, x - 4, y - 1, 8, 20)) + if (!Game.FindObject (C4Id2Def(C4ID::Flame), x - 4, y - 1, 8, 20)) if (Game.CreateObject(C4ID::Flame,NULL,NO_OWNER,x,y)) return true; return false; @@ -1143,6 +1147,7 @@ void C4Landscape::Clear(bool fClearMapCreator, bool fClearSky, bool fClearRender if (fClearSky) Sky.Clear(); // clear surfaces, if assigned if (fClearRenderer) { delete pLandscapeRender; pLandscapeRender=NULL; } + delete [] TopRowPix; TopRowPix=NULL; delete [] BottomRowPix; BottomRowPix=NULL; delete Surface8; Surface8=NULL; delete Map; Map=NULL; @@ -1322,7 +1327,7 @@ bool C4Landscape::Init(C4Group &hGroup, bool fOverloadCurrent, bool fLoadSky, bo } // Init out-of-landscape pixels for bottom - InitBottomRowPix(); + InitTopAndBottomRowPix(); Game.SetInitProgress(84); @@ -1454,11 +1459,12 @@ bool C4Landscape::SaveDiffInternal(C4Group &hGroup, bool fSyncSave) bool fChanged = false; if (!fSyncSave) for (int y = 0; y < Height; y++) - for (int x = 0; x < Width; x++) + for (int x = 0; x < Width; x++) { if (pInitial[y * Width + x] == _GetPix(x, y)) Surface8->SetPix(x,y,0xff); else fChanged = true; + } if (fSyncSave || fChanged) { @@ -1556,6 +1562,7 @@ void C4Landscape::Default() { Mode=C4LSC_Undefined; Surface8=NULL; + TopRowPix=NULL; BottomRowPix=NULL; pLandscapeRender=NULL; Map=NULL; @@ -1663,17 +1670,39 @@ bool C4Landscape::SaveTextures(C4Group &hGroup) return true; } -bool C4Landscape::InitBottomRowPix() +bool C4Landscape::InitTopAndBottomRowPix() { - // Init BottomRowPix array, which determines if out-of-landscape pixels on bottom side of the map are solid or not - // In case of BottomOpen=2, unit by map and not landscape to avoid runtime join sync losses - delete [] BottomRowPix; // safety + // Init Top-/BottomRowPix array, which determines if out-of-landscape pixels on top/bottom side of the map are solid or not + // In case of Top-/BottomOpen=2, unit by map and not landscape to avoid runtime join sync losses + delete [] TopRowPix; delete [] BottomRowPix; // safety if (!Width) return true; + TopRowPix = new uint8_t[Width]; BottomRowPix = new uint8_t[Width]; - // must access Game.C4S here because Landscape.BottomOpen may not be initialized yet + // must access Game.C4S here because Landscape.TopOpen / Landscape.BottomOpen may not be initialized yet // why is there a local copy of that static variable anyway? + int32_t top_open_flag = Game.C4S.Landscape.TopOpen; int32_t bottom_open_flag = Game.C4S.Landscape.BottomOpen; + if (top_open_flag == 2 && !Map) top_open_flag = 1; if (bottom_open_flag == 2 && !Map) bottom_open_flag = 1; + + // Init TopRowPix + switch (top_open_flag) + { + // TopOpen=0: Top is closed + case 0: for (int32_t x=0; xGetPix(x/MapZoom,0); + TopRowPix[x] = ((map_pix & IFT) ? MCVehic : 0); + } + break; + // TopOpen=1: Top is open + default: for (int32_t x=0; x=Height) { @@ -206,7 +205,7 @@ protected: bool TexOZoom(CSurface8 * sfcMap, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, DWORD *dwpTextureUsage, int32_t iToX=0,int32_t iToY=0); bool MapToSurface(CSurface8 * sfcMap, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, int32_t iToX, int32_t iToY, int32_t iToWdt, int32_t iToHgt, int32_t iOffX, int32_t iOffY); bool MapToLandscape(CSurface8 * sfcMap, int32_t iMapX, int32_t iMapY, int32_t iMapWdt, int32_t iMapHgt, int32_t iOffsX = 0, int32_t iOffsY = 0, bool noClear = false); // zoom map segment to surface (or sector surfaces) - bool InitBottomRowPix(); // inti out-of-landscape pixels for bottom side + bool InitTopAndBottomRowPix(); // inti out-of-landscape pixels for bottom side bool GetMapColorIndex(const char *szMaterial, const char *szTexture, bool fIFT, BYTE &rbyCol); bool SkyToLandscape(int32_t iToX, int32_t iToY, int32_t iToWdt, int32_t iToHgt, int32_t iOffX, int32_t iOffY); CSurface8 * CreateMap(); // create map by landscape attributes diff --git a/src/landscape/C4LandscapeRender.cpp b/src/landscape/C4LandscapeRender.cpp index c6b455582..b148432cb 100644 --- a/src/landscape/C4LandscapeRender.cpp +++ b/src/landscape/C4LandscapeRender.cpp @@ -195,8 +195,8 @@ bool C4LandscapeRenderGL::InitMaterialTexture(C4TextureMap *pTexs) // Find first (actual) texture int iRefTexIx = 0; C4Texture *pRefTex; C4Surface *pRefSfc = NULL; - for(; pRefTex = pTexs->GetTexture(pTexs->GetTexture(iRefTexIx)); iRefTexIx++) - if(pRefSfc = pRefTex->Surface32) + for(; (pRefTex = pTexs->GetTexture(pTexs->GetTexture(iRefTexIx))); iRefTexIx++) + if((pRefSfc = pRefTex->Surface32)) break; if(!pRefSfc) return false; @@ -901,7 +901,7 @@ void C4LandscapeRenderGL::AddTexturesFromMap(C4TextureMap *pMap) // Future work... const C4TexMapEntry *pEntry; - for(int32_t i = 0; pEntry = pMap->GetEntry(i); i++) + for(int32_t i = 0; (pEntry = pMap->GetEntry(i)); i++) // ToDo: Properly handle jumping back AddTextureAnim(pEntry->GetTextureName()); @@ -926,7 +926,7 @@ void C4LandscapeRenderGL::BuildMatMap(GLfloat *pFMap, GLubyte *pIMap) // Got animation? int iPhases = 1; const char *p = pEntry->GetTextureName(); - while(p = strchr(p, '-')) { p++; iPhases++; } + while((p = strchr(p, '-'))) { p++; iPhases++; } // Hard-coded hack. Fix me! const int iPhaseLength = 300; float phase = (iPhases == 1 ? 0 : float(C4TimeMilliseconds::Now().AsInt() % (iPhases * iPhaseLength)) / iPhaseLength); diff --git a/src/landscape/C4MapCreatorS2.cpp b/src/landscape/C4MapCreatorS2.cpp index 9dfc3aeae..4a496fc42 100644 --- a/src/landscape/C4MapCreatorS2.cpp +++ b/src/landscape/C4MapCreatorS2.cpp @@ -1129,7 +1129,7 @@ void C4MCParser::ParseTo(C4MCNode *pToNode) else if (SEqual(CurrTokenIdtf, C4MC_Point) && !pToNode->GetNodeByName(CurrTokenIdtf)) { // only in overlays - if (!pToNode->Type() == MCN_Overlay) + if (!(pToNode->Type() == MCN_Overlay)) throw C4MCParserErr(this, C4MCErr_PointOnlyOvl); // create point node, using default template pNewNode = new C4MCPoint(this, pToNode, MapCreator->DefaultPoint, false); diff --git a/src/landscape/C4MapScript.cpp b/src/landscape/C4MapScript.cpp index 750878396..0286ba840 100644 --- a/src/landscape/C4MapScript.cpp +++ b/src/landscape/C4MapScript.cpp @@ -130,7 +130,7 @@ void C4MapScriptMatTexMask::UnmaskSpec(C4String *spec) const char *tex_name; int32_t col; for (int32_t itex=0; (tex_name=::TextureMap.GetTexture(itex)); itex++) - if (col = ::TextureMap.GetIndex(cspec,tex_name,false)) + if ((col = ::TextureMap.GetIndex(cspec,tex_name,false))) mat_mask[col] = true; } } @@ -262,7 +262,7 @@ static bool FnLayerSetPixel(C4PropList * _this, int32_t x, int32_t y, const C4Va C4MapScriptLayer *layer = _this->GetMapScriptLayer(); if (!layer) return false; int32_t to_value; C4String *to_value_s; - if (to_value_s = to_value_c4v.getStr()) + if ((to_value_s = to_value_c4v.getStr())) { to_value = FnParTexCol(to_value_s); } @@ -300,13 +300,13 @@ static bool FnLayerFindPosition(C4PropList * _this, C4PropList *out_pos, const C { // Layer script function: Find a position (x,y) that has a color matching mask_spec. Set resulting position as X,Y properties in out_pos prop list C4MapScriptLayer *layer = _this->GetMapScriptLayer(); - if (!layer) return NULL; + if (!layer) return false; C4MapScriptMatTexMask mat_mask(mask_spec); C4Rect search_rect; - if (!FnParRect(layer, rect, &search_rect)) return NULL; + if (!FnParRect(layer, rect, &search_rect)) return false; int32_t x,y; bool result; if (!max_tries) max_tries = 500; - if (result = layer->FindPos(search_rect, mat_mask, &x, &y, max_tries)) + if ((result = layer->FindPos(search_rect, mat_mask, &x, &y, max_tries))) { if (out_pos && !out_pos->IsFrozen()) { @@ -409,7 +409,7 @@ bool C4MapScriptLayer::Blit(const C4Rect &rcBounds, const C4MapScriptAlgo *algo) uint8_t col; for (int32_t y=rcBounds.y; y_SetPix(x,y,col); return true; } @@ -605,4 +605,4 @@ bool C4MapScriptHost::InitializeMap(C4Group &group, CSurface8 **pmap_surface) return !!result; } -C4MapScriptHost MapScript; \ No newline at end of file +C4MapScriptHost MapScript; diff --git a/src/landscape/C4MapScriptAlgo.cpp b/src/landscape/C4MapScriptAlgo.cpp index 7a0ebecf8..d05ad43fc 100644 --- a/src/landscape/C4MapScriptAlgo.cpp +++ b/src/landscape/C4MapScriptAlgo.cpp @@ -35,7 +35,7 @@ bool C4MapScriptAlgo::GetXYProps(const C4PropList *props, C4PropertyName k, int3 } C4Value val; C4ValueArray *arr; props->GetProperty(k, &val); - if (arr = val.getArray()) + if ((arr = val.getArray())) { if (arr->GetSize() != 2) throw new C4AulExecError(FormatString("C4MapScriptAlgo: Expected either integer or array with two integer elements in property \"%s\".", Strings.P[k].GetCStr()).getData()); @@ -246,7 +246,7 @@ C4MapScriptAlgoModifier::C4MapScriptAlgoModifier(const C4PropList *props, int32_ for (int32_t i=0; iGetItem(i).getPropList()); - if (!new_algo) throw new C4AulExecError(FormatString("C4MapScriptAlgo: Operand %d in property \"Op\" not valid.", (int)min_ops, (int)max_ops).getData()); + if (!new_algo) throw new C4AulExecError(FormatString("C4MapScriptAlgo: Operand %d in property \"Op\" not valid.", (int)i).getData()); operands[i] = new_algo; } } @@ -280,7 +280,7 @@ uint8_t C4MapScriptAlgoOr::operator () (int32_t x, int32_t y) const // Return first nonzero operand uint8_t val; for (std::vector::const_iterator i=operands.begin(); i != operands.end(); ++i) - if (val=(**i)(x,y)) return val; + if ((val=(**i)(x,y))) return val; // If all operands are zero, return zero. return 0; } diff --git a/src/landscape/C4Material.cpp b/src/landscape/C4Material.cpp index bd502f0e8..469a8b06e 100644 --- a/src/landscape/C4Material.cpp +++ b/src/landscape/C4Material.cpp @@ -125,10 +125,10 @@ bool C4MaterialShape::Load(C4Group &group, const char *filename) { min = max = *j; } - if (j ->x<- overlap_left ) overlap_left =- j ->x; - if (j ->y<- overlap_top ) overlap_top =- j ->y; - if (j ->x> wdt+overlap_right ) overlap_right = j ->x- wdt; - if (j ->y> hgt+overlap_bottom) overlap_bottom = j ->y- hgt; + if (j ->x<- overlap_left ) overlap_left = -j->x; + if (j ->y<- overlap_top ) overlap_top = -j->y; + if (j ->x> wdt+overlap_right ) overlap_right = j->x - wdt; + if (j ->y> hgt+overlap_bottom) overlap_bottom = j->y - hgt; } center.x /= n; center.y /= n; i->center = center; i->min = min; i->max = max; @@ -585,9 +585,12 @@ bool C4MaterialMap::CrossMapMaterials(const char* szEarthMaterial) // Called aft { // single material target if (pReact->fInverseSpec) - for (int32_t cnt2=-1; cnt2TargetSpec.getData(), "All")) { diff --git a/src/landscape/C4Particles.cpp b/src/landscape/C4Particles.cpp index 4d0399318..c131b9aa3 100644 --- a/src/landscape/C4Particles.cpp +++ b/src/landscape/C4Particles.cpp @@ -1290,6 +1290,8 @@ void C4ParticleSystem::ExecuteCalculation() particleListAccessMutex.Leave(); } } +#else // ifdef USE_CONSOLE +void C4ParticleSystem::DoInit() {} #endif C4ParticleList *C4ParticleSystem::GetNewParticleList(C4Object *forObject) @@ -1504,9 +1506,11 @@ void C4ParticleSystem::Clear() void C4ParticleSystem::ClearAllParticles() { +#ifndef USE_CONSOLE particleListAccessMutex.Enter(); particleLists.clear(); particleListAccessMutex.Leave(); +#endif } C4ParticleDef *C4ParticleSystemDefinitionList::GetDef(const char *name, C4ParticleDef *exclude) @@ -1521,12 +1525,10 @@ C4ParticleDef *C4ParticleSystemDefinitionList::GetDef(const char *name, C4Partic return 0; } -#ifndef USE_CONSOLE void C4ParticleSystemDefinitionList::Clear() { // the particle definitions update the list in their destructor while (first) delete first; } -#endif C4ParticleSystem Particles; diff --git a/src/landscape/C4Particles.h b/src/landscape/C4Particles.h index 3a339c8de..535f67a36 100644 --- a/src/landscape/C4Particles.h +++ b/src/landscape/C4Particles.h @@ -408,14 +408,12 @@ public: // cares for the management of particle definitions class C4ParticleSystemDefinitionList { -#ifndef USE_CONSOLE private: // pointers to the last and first element of linked list of particle definitions C4ParticleDef *first, *last; public: C4ParticleSystemDefinitionList() : first(0), last(0) {} void Clear(); -#endif C4ParticleDef *GetDef(const char *name, C4ParticleDef *exclude=0); friend class C4ParticleDef; @@ -435,13 +433,11 @@ class C4ParticleSystem friend class CalculationThread; private: -#ifndef USE_CONSOLE // contains an array with indices for vertices, separated by a primitive restart index std::vector primitiveRestartIndices; // these are fallbacks for if primitiveRestartIndex is not supported by the graphics card std::vector multiDrawElementsCountArray; std::vector multiDrawElementsIndexArray; -#endif std::list particleLists; CalculationThread calculationThread; @@ -509,13 +505,14 @@ public: // creates a new particle void Create(C4ParticleDef *of_def, C4ParticleValueProvider &x, C4ParticleValueProvider &y, C4ParticleValueProvider &speedX, C4ParticleValueProvider &speedY, C4ParticleValueProvider &lifetime, C4PropList *properties, int amount = 1, C4Object *object=NULL); + +#endif // removes all of the existing particles (used f.e. for scenario section loading) void ClearAllParticles(); friend class C4ParticleList; -#endif }; diff --git a/src/landscape/C4Scenario.cpp b/src/landscape/C4Scenario.cpp index c2418847b..0f97b8ab5 100644 --- a/src/landscape/C4Scenario.cpp +++ b/src/landscape/C4Scenario.cpp @@ -216,8 +216,8 @@ void C4SPlrStart::Default() ReadyVehic.Default(); ReadyMaterial.Default(); BuildKnowledge.Default(); - HomeBaseMaterial.Default(); - HomeBaseProduction.Default(); + BaseMaterial.Default(); + BaseProduction.Default(); } bool C4SPlrStart::EquipmentEqual(C4SPlrStart &rhs) @@ -233,8 +233,8 @@ bool C4SPlrStart::operator==(const C4SPlrStart& rhs) && (ReadyVehic == rhs.ReadyVehic) && (ReadyMaterial == rhs.ReadyMaterial) && (BuildKnowledge == rhs.BuildKnowledge) - && (HomeBaseMaterial == rhs.HomeBaseMaterial) - && (HomeBaseProduction == rhs.HomeBaseProduction); + && (BaseMaterial == rhs.BaseMaterial) + && (BaseProduction == rhs.BaseProduction); } void C4SPlrStart::CompileFunc(StdCompiler *pComp) @@ -249,8 +249,8 @@ void C4SPlrStart::CompileFunc(StdCompiler *pComp) pComp->Value(mkNamingAdapt(ReadyVehic, "Vehicles", C4IDList())); pComp->Value(mkNamingAdapt(ReadyMaterial, "Material", C4IDList())); pComp->Value(mkNamingAdapt(BuildKnowledge, "Knowledge", C4IDList())); - pComp->Value(mkNamingAdapt(HomeBaseMaterial, "HomeBaseMaterial", C4IDList())); - pComp->Value(mkNamingAdapt(HomeBaseProduction, "HomeBaseProduction", C4IDList())); + pComp->Value(mkNamingAdapt(BaseMaterial, "BaseMaterial", C4IDList())); + pComp->Value(mkNamingAdapt(BaseProduction, "BaseProduction", C4IDList())); } void C4SLandscape::Default() diff --git a/src/landscape/C4Scenario.h b/src/landscape/C4Scenario.h index bf7c4ffab..03bff4622 100644 --- a/src/landscape/C4Scenario.h +++ b/src/landscape/C4Scenario.h @@ -146,8 +146,8 @@ public: C4IDList ReadyVehic; C4IDList ReadyMaterial; C4IDList BuildKnowledge; - C4IDList HomeBaseMaterial; - C4IDList HomeBaseProduction; + C4IDList BaseMaterial; + C4IDList BaseProduction; public: void Default(); bool EquipmentEqual(C4SPlrStart &rhs); diff --git a/src/landscape/C4SolidMask.cpp b/src/landscape/C4SolidMask.cpp index ee5ae2a1d..ab7b17156 100644 --- a/src/landscape/C4SolidMask.cpp +++ b/src/landscape/C4SolidMask.cpp @@ -189,7 +189,7 @@ void C4SolidMask::Put(bool fCauseInstability, C4TargetRect *pClipRect, bool fRes for (int i = 0; i < iAttachingObjectsCount; ++i) { C4Object *pObj = ppAttachingObjects[i]; - if (pObj->IsMoveableBySolidMask(pForObject->GetPlane())) + if (pObj->IsMoveableBySolidMask(pForObject->GetSolidMaskPlane())) if (!pObj->Shape.ContactCheck(fixtoi(pObj->GetFixedX()+dx), fixtoi(pObj->GetFixedY()+dy))) if (pObj->iLastAttachMovementFrame != Game.FrameCounter) { @@ -290,7 +290,7 @@ void C4SolidMask::Remove(bool fBackupAttachment) C4LSector *pSct; C4Object *pObj; for (C4ObjectList *pLst=SolidArea.FirstObjectShapes(&pSct); pLst; pLst=SolidArea.NextObjectShapes(pLst, &pSct)) for (C4ObjectLink *clnk=pLst->First; clnk; clnk=clnk->Next) - if ((pObj = clnk->Obj) && pObj != pForObject && pObj->IsMoveableBySolidMask(pForObject->GetPlane()) && !pObj->Shape.CheckContact(pObj->GetX(),pObj->GetY())) + if ((pObj = clnk->Obj) && pObj != pForObject && pObj->IsMoveableBySolidMask(pForObject->GetSolidMaskPlane()) && !pObj->Shape.CheckContact(pObj->GetX(),pObj->GetY())) { // check for any contact to own SolidMask - attach-directions, bottom - "stuck" (CNAT_Center) is ignored, because that causes problems with things being stuck in basements :( int iVtx = 0; diff --git a/src/lib/C4Random.cpp b/src/lib/C4Random.cpp index da0643611..4102ac040 100644 --- a/src/lib/C4Random.cpp +++ b/src/lib/C4Random.cpp @@ -22,7 +22,15 @@ #include int RandomCount = 0; -unsigned int RandomHold = 0; +static unsigned int RandomHold = 0; + +void FixedRandom(DWORD dwSeed) +{ + // for SafeRandom + srand((unsigned)time(NULL)); + RandomHold = dwSeed; + RandomCount = 0; +} int Random(int iRange) { diff --git a/src/lib/C4Random.h b/src/lib/C4Random.h index d6ecb2388..72d8a65df 100644 --- a/src/lib/C4Random.h +++ b/src/lib/C4Random.h @@ -23,15 +23,8 @@ #include extern int RandomCount; -extern unsigned int RandomHold; -inline void FixedRandom(DWORD dwSeed) -{ - // for SafeRandom - srand((unsigned)time(NULL)); - RandomHold=dwSeed; - RandomCount=0; -} +void FixedRandom(DWORD dwSeed); int Random(int iRange); diff --git a/src/lib/StdBuf.h b/src/lib/StdBuf.h index 5b18435fd..91d3efbfe 100644 --- a/src/lib/StdBuf.h +++ b/src/lib/StdBuf.h @@ -668,7 +668,7 @@ public: // get an indexed section from the string like Section1;Section2;Section3 bool GetSection(size_t idx, StdStrBuf *psOutSection, char cSeparator=';') const; - // Checks wether the contents are valid UTF-8, and if not, convert them from windows-1252 to UTF-8. + // Checks whether the content is valid UTF-8, and if not, convert it from windows-1252 to UTF-8. void EnsureUnicode(); // convert to lower case diff --git a/src/mape/cpp-handles/stub-handle.cpp b/src/mape/cpp-handles/stub-handle.cpp index 15514faa2..e253e6ff1 100644 --- a/src/mape/cpp-handles/stub-handle.cpp +++ b/src/mape/cpp-handles/stub-handle.cpp @@ -102,7 +102,7 @@ void C4Def::IncludeDefinition(C4Def*) {} C4DefList::C4DefList() {} C4DefList::~C4DefList() {} -C4Def* C4DefList::ID2Def(C4ID) {return NULL;} +C4Def* C4DefList::GetByName(const StdStrBuf &) {return NULL;} void C4DefList::Draw(C4ID, C4Facet &, bool, int32_t) {} C4Def * C4DefList::GetDef(int) {return 0;} int C4DefList::GetDefCount() {return 0;} diff --git a/src/network/C4League.cpp b/src/network/C4League.cpp index fb8e0cdec..cc60afa7d 100644 --- a/src/network/C4League.cpp +++ b/src/network/C4League.cpp @@ -165,6 +165,12 @@ int32_t C4LeagueResponseHeadAuthCheck::getRankSymbol(const char *szLeague) const return 0; } +const char *C4LeagueResponseHeadAuthCheck::getProgressData(const char *szLeague) const +{ + // progress data is the same for all leagues + return ProgressData.getData(); +} + void C4LeagueResponseHeadAuthCheck::CompileFunc(StdCompiler *pComp) { // Base members @@ -176,6 +182,9 @@ void C4LeagueResponseHeadAuthCheck::CompileFunc(StdCompiler *pComp) pComp->Value(mkNamingAdapt(mkArrayAdapt(Ranks, C4NetMaxLeagues, 0), "Rank")); pComp->Value(mkNamingAdapt(mkArrayAdapt(RankSymbols, C4NetMaxLeagues, 0), "RankSymbol")); + // Progress data (per scenario; not per league) + pComp->Value(mkNamingAdapt(mkParAdapt(ProgressData, StdCompiler::RCT_All), "ProgressData", "")); + // Clan tag pComp->Value(mkNamingAdapt(mkParAdapt(ClanTag, StdCompiler::RCT_All), "ClanTag", "")); @@ -466,7 +475,7 @@ bool C4LeagueClient::GetAuthCheckReply(StdStrBuf *pMessage, const char *szLeague if (pMessage) pMessage->Copy(Head.getMessage()); if (szLeague && pPlrInfo) - pPlrInfo->SetLeagueData(Head.getAccount(), Head.getClanTag(), Head.getScore(szLeague), Head.getRank(szLeague), Head.getRankSymbol(szLeague)); + pPlrInfo->SetLeagueData(Head.getAccount(), Head.getClanTag(), Head.getScore(szLeague), Head.getRank(szLeague), Head.getRankSymbol(szLeague), Head.getProgressData(szLeague)); return Head.isSuccess(); } diff --git a/src/network/C4League.h b/src/network/C4League.h index 8c162739b..077f0815a 100644 --- a/src/network/C4League.h +++ b/src/network/C4League.h @@ -166,12 +166,14 @@ private: int32_t Ranks[C4NetMaxLeagues]; int32_t RankSymbols[C4NetMaxLeagues]; StdCopyStrBuf ClanTag; + StdCopyStrBuf ProgressData; public: int32_t getScore(const char *szLeague) const; int32_t getRank(const char *szLeague) const; int32_t getRankSymbol(const char *szLeague) const; const char *getClanTag() const { return ClanTag.getData(); } + const char *getProgressData(const char *szLeague) const; void CompileFunc(StdCompiler *pComp); }; diff --git a/src/network/C4Network2.cpp b/src/network/C4Network2.cpp index 29382755d..155233f34 100644 --- a/src/network/C4Network2.cpp +++ b/src/network/C4Network2.cpp @@ -145,7 +145,7 @@ C4Network2::C4Network2() pVoteDialog(NULL), fPausedForVote(false), iLastOwnVoting(0), - fStreaming(NULL) + fStreaming(false) { } @@ -2017,7 +2017,7 @@ bool C4Network2::LeagueStart(bool *pCancel) !pLeagueClient->GetStartReply(&LeagueServerMessage, &League, &StreamingAddr, &Seed, &MaxPlayersLeague)) { const char *pError = pLeagueClient->GetError() ? pLeagueClient->GetError() : - LeagueServerMessage.getLength() ? LoadResStr(LeagueServerMessage.getData()) : + LeagueServerMessage.getLength() ? LeagueServerMessage.getData() : LoadResStr("IDS_NET_ERR_LEAGUE_EMPTYREPLY"); StdStrBuf Message = FormatString(LoadResStr("IDS_NET_ERR_LEAGUE_REGGAME"), pError); // Log message @@ -2041,7 +2041,7 @@ bool C4Network2::LeagueStart(bool *pCancel) // Show message if (LeagueServerMessage.getLength()) { - StdStrBuf Message = FormatString(LoadResStr("IDS_MSG_LEAGUEGAMESIGNUP"), pLeagueClient->getServerName(), LoadResStr(LeagueServerMessage.getData())); + StdStrBuf Message = FormatString(LoadResStr("IDS_MSG_LEAGUEGAMESIGNUP"), pLeagueClient->getServerName(), LeagueServerMessage.getData()); // Log message Log(Message.getData()); // Show message @@ -2127,7 +2127,7 @@ bool C4Network2::LeagueUpdateProcessReply() if (!fSucc) { const char *pError = pLeagueClient->GetError() ? pLeagueClient->GetError() : - LeagueServerMessage.getLength() ? LoadResStr(LeagueServerMessage.getData()) : + LeagueServerMessage.getLength() ? LeagueServerMessage.getData() : LoadResStr("IDS_NET_ERR_LEAGUE_EMPTYREPLY"); StdStrBuf Message = FormatString(LoadResStr("IDS_NET_ERR_LEAGUE_UPDATEGAME"), pError); // Show message - no dialog, because it's not really fatal and might happen in the running game @@ -2205,7 +2205,7 @@ bool C4Network2::LeagueEnd(const char *szRecordName, const BYTE *pRecordSHA) if (!pLeagueClient->isSuccess() || !pLeagueClient->GetEndReply(&LeagueServerMessage, &RoundResults)) { const char *pError = pLeagueClient->GetError() ? pLeagueClient->GetError() : - LeagueServerMessage.getLength() ? LoadResStr(LeagueServerMessage.getData()) : + LeagueServerMessage.getLength() ? LeagueServerMessage.getData() : LoadResStr("IDS_NET_ERR_LEAGUE_EMPTYREPLY"); sResultMessage.Take(FormatString(LoadResStr("IDS_NET_ERR_LEAGUE_SENDRESULT"), pError)); if (Application.isEditor) continue; @@ -2355,7 +2355,7 @@ bool C4Network2::LeaguePlrAuth(C4PlayerInfo *pInfo) bool fSuccess; if (Message.getLength()) fSuccess = ::pGUI->ShowMessageModal( - LoadResStr(Message.getData()), LoadResStr("IDS_DLG_LEAGUESIGNUPCONFIRM"), + Message.getData(), LoadResStr("IDS_DLG_LEAGUESIGNUPCONFIRM"), C4GUI::MessageDialog::btnOKAbort, C4GUI::Ico_Ex_League); else if (AccountMaster.getLength()) fSuccess = ::pGUI->ShowMessageModal( @@ -2441,7 +2441,7 @@ bool C4Network2::LeaguePlrAuthCheck(C4PlayerInfo *pInfo) // Check if league server approves. pInfo will have league info if this call is successful. if (!pLeagueClient->GetAuthCheckReply(&Message, Game.Parameters.League.getData(), pInfo)) { - LeagueShowError(FormatString(LoadResStr("IDS_MSG_LEAGUEJOINREFUSED"), pInfo->GetName(), LoadResStr(Message.getData())).getData()); + LeagueShowError(FormatString(LoadResStr("IDS_MSG_LEAGUEJOINREFUSED"), pInfo->GetName(), Message.getData()).getData()); return false; } @@ -2476,7 +2476,7 @@ void C4Network2::LeagueNotifyDisconnect(int32_t iClientID, C4LeagueDisconnectRea szMsg = LoadResStr("IDS_MSG_LEAGUEUNEXPECTEDDISCONNEC"); else szMsg = LoadResStr("IDS_ERR_LEAGUEERRORREPORTINGUNEXP"); - LogF(szMsg, LoadResStr(sMessage.getData())); + LogF(szMsg, sMessage.getData()); } void C4Network2::LeagueWaitNotBusy() diff --git a/src/network/C4Network2Reference.cpp b/src/network/C4Network2Reference.cpp index c3f0e1ad8..3daa300b5 100644 --- a/src/network/C4Network2Reference.cpp +++ b/src/network/C4Network2Reference.cpp @@ -52,11 +52,16 @@ void C4Network2Reference::InitLocal() Parameters = ::Game.Parameters; // Discard player resources (we don't want these infos in the reference) + // Add league performance (but only after game end) C4ClientPlayerInfos *pClientInfos; C4PlayerInfo *pPlayerInfo; int32_t i, j; for (i = 0; (pClientInfos = Parameters.PlayerInfos.GetIndexedInfo(i)); i++) for (j = 0; (pPlayerInfo = pClientInfos->GetPlayerInfo(j)); j++) + { pPlayerInfo->DiscardResource(); + if(::Game.GameOver) + pPlayerInfo->SetLeaguePerformance(::Game.RoundResults.GetLeaguePerformance(pPlayerInfo->GetID())); + } // Special additional information in reference Icon = ::Game.C4S.Head.Icon; diff --git a/src/object/C4Command.cpp b/src/object/C4Command.cpp index 8342af1dc..d2f7a076e 100644 --- a/src/object/C4Command.cpp +++ b/src/object/C4Command.cpp @@ -940,7 +940,7 @@ void C4Command::Get() // Get target specified by container and type if (!Target && Target2 && Data) - if (!(Target = Target2->Contents.Find(Data.getC4ID()))) + if (!(Target = Target2->Contents.Find(Data.getDef()))) { Finish(); return; } // No target: failure @@ -1116,7 +1116,7 @@ void C4Command::Activate() C4Object *pObj; C4ObjectLink *cLnk; if (!Target) for (cLnk=Target2->Contents.First; cLnk && (pObj=cLnk->Obj); cLnk=cLnk->Next) - if (pObj->Status && (pObj->Def->id==Data.getC4ID())) + if (pObj->Status && (pObj->Def==Data.getDef())) if (!pObj->Command || (pObj->Command->Command!=C4CMD_Exit)) { Target=pObj; break; } // No target @@ -1155,7 +1155,7 @@ void C4Command::Put() // Notice: Put command is currently using Ty as an interna // Thing to put specified by type if (!Target2 && Data) - if (!(Target2 = cObj->Contents.Find(Data.getC4ID()))) + if (!(Target2 = cObj->Contents.Find(Data.getDef()))) { Finish(); return; } // No thing to put specified @@ -1623,7 +1623,7 @@ void C4Command::Acquire() if (!Data) { Finish(); return; } // Target material in inventory: done - if (cObj->Contents.Find(Data.getC4ID())) + if (cObj->Contents.Find(Data.getDef())) { Finish(true); return; } // script overload @@ -1640,7 +1640,7 @@ void C4Command::Acquire() // Find available material C4Object *pMaterial=NULL; // Next closest - while ((pMaterial = Game.FindObject(Data.getC4ID(),cObj->GetX(),cObj->GetY(),-1,-1,OCF_Available,pMaterial))) + while ((pMaterial = Game.FindObject(Data.getDef(),cObj->GetX(),cObj->GetY(),-1,-1,OCF_Available,pMaterial))) // Object is not in container to be ignored if (!Target2 || pMaterial->Contained!=Target2) // Object is near enough @@ -1733,7 +1733,7 @@ void C4Command::Fail(const char *szFailMessage) if (szFailMessage) break; // Fail message with name of target type SCopy(LoadResStr(CommandNameID(Command)), szCommandName); - C4Def *pDef; pDef = ::Definitions.ID2Def(Data.getC4ID()); + C4Def *pDef; pDef = Data.getDef(); SCopy(pDef ? pDef->GetName() : LoadResStr("IDS_OBJ_UNKNOWN"), szObjectName); str.Format(LoadResStr("IDS_CON_FAILUREOF"), szCommandName, szObjectName); break; diff --git a/src/object/C4Def.cpp b/src/object/C4Def.cpp index 217e8d96b..44420d568 100644 --- a/src/object/C4Def.cpp +++ b/src/object/C4Def.cpp @@ -352,11 +352,14 @@ bool C4Def::Load(C4Group &hGroup, DebugLogF(" Error loading SolidMask of %s (%s)", hGroup.GetFullName().getData(), id.ToString()); return false; } + // check SolidMask size + if (SolidMask.x<0 || SolidMask.y<0 || SolidMask.x+SolidMask.Wdt>pSolidMask->Wdt || SolidMask.y+SolidMask.Hgt>pSolidMask->Hgt) SolidMask.Default(); } else if (SolidMask.Wdt) { // Warning in case someone wants to define SolidMasks the old way (in the main graphics file) DebugLogF("WARNING: Definition %s (%s) defines SolidMask in DefCore but has no SolidMask file!", hGroup.GetFullName().getData(), id.ToString()); + SolidMask.Default(); } // Read surface bitmap @@ -459,8 +462,6 @@ bool C4Def::Load(C4Group &hGroup, // Bitmap post-load settings if (Graphics.GetBitmap()) { - // check SolidMask - if (SolidMask.x<0 || SolidMask.y<0 || SolidMask.x+SolidMask.Wdt>Graphics.Bmp.Bitmap->Wdt || SolidMask.y+SolidMask.Hgt>Graphics.Bmp.Bitmap->Hgt) SolidMask.Default(); // Set MainFace (unassigned bitmap: will be set by GetMainFace()) MainFace.Set(NULL,0,0,Shape.Wdt,Shape.Hgt); } @@ -481,7 +482,6 @@ bool C4Def::Load(C4Group &hGroup, { TopFace.Default(); PictureRect.Default(); - SolidMask.Default(); } // Temporary flag diff --git a/src/object/C4DefGraphics.h b/src/object/C4DefGraphics.h index aa2480b70..a88c24d16 100644 --- a/src/object/C4DefGraphics.h +++ b/src/object/C4DefGraphics.h @@ -69,6 +69,7 @@ public: bool Load(C4Group &hGroup, bool fColorByOwner); // load graphics from group C4DefGraphics *Get(const char *szGrpName); // get graphics by name void Clear(); // clear fields; delete additional graphics + bool IsMesh() const { return Type == TYPE_Mesh; } bool IsColorByOwner() // returns whether ColorByOwner-surfaces have been created { return Type == TYPE_Mesh || !!Bmp.BitmapClr; } // Mesh can always apply PlayerColor (if used in its material) bool CopyGraphicsFrom(C4DefGraphics &rSource); // copy bitmaps from source graphics diff --git a/src/object/C4DefList.cpp b/src/object/C4DefList.cpp index 6ec94946f..11c89f20b 100644 --- a/src/object/C4DefList.cpp +++ b/src/object/C4DefList.cpp @@ -211,6 +211,11 @@ C4Def* C4DefList::ID2Def(C4ID id) return NULL; } +C4Def * C4DefList::GetByName(const StdStrBuf & name) +{ + return ID2Def(C4ID(name)); +} + int32_t C4DefList::GetIndex(C4ID id) { C4Def *cdef; diff --git a/src/object/C4DefList.h b/src/object/C4DefList.h index 2da5c51af..a2e9935ba 100644 --- a/src/object/C4DefList.h +++ b/src/object/C4DefList.h @@ -48,6 +48,7 @@ public: C4Def *ID2Def(C4ID id); C4Def *GetDef(int32_t Index); C4Def *GetByPath(const char *szPath); + C4Def *GetByName(const StdStrBuf &); int32_t GetDefCount(); int32_t GetIndex(C4ID id); int32_t RemoveTemporary(); diff --git a/src/object/C4Object.cpp b/src/object/C4Object.cpp index 8b7f9bc16..3158837ed 100644 --- a/src/object/C4Object.cpp +++ b/src/object/C4Object.cpp @@ -1121,8 +1121,6 @@ void C4Object::AssignDeath(bool fForced) ++Info->DeathCount; Info->Retire(); } - // Lose contents - while ((thing=Contents.GetObject())) thing->Exit(thing->GetX(),thing->GetY()); // Remove from crew/cursor/view C4Player *pPlr = ::Players.Get(Owner); if (pPlr) pPlr->ClearPointers(this, true); @@ -1132,11 +1130,12 @@ void C4Object::AssignDeath(bool fForced) // Engine script call C4AulParSet pars(C4VInt(iDeathCausingPlayer)); Call(PSF_Death, &pars); + // Lose contents + while ((thing=Contents.GetObject())) thing->Exit(thing->GetX(),thing->GetY()); // Update OCF. Done here because previously it would have been done in the next frame // Whats worse: Having the OCF change because of some unrelated script-call like // SetCategory, or slightly breaking compatibility? SetOCF(); - // Engine broadcast: relaunch player (in CR, this was called from clonk script. // Now, it is done for every crew member) if(pPlr) @@ -1960,13 +1959,13 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode, f //sprintf(szCommand,"%s %d/%d",CommandName(pCom->Command),pCom->Tx,pCom->Ty,iAngle); break; case C4CMD_Put: - sprintf(szCommand,"%s %s to %s",CommandName(pCom->Command),pCom->Target2 ? pCom->Target2->GetName() : pCom->Data ? pCom->Data.getC4ID().ToString() : "Content",pCom->Target ? pCom->Target->GetName() : ""); + sprintf(szCommand,"%s %s to %s",CommandName(pCom->Command),pCom->Target2 ? pCom->Target2->GetName() : pCom->Data ? pCom->Data.GetDataString().getData() : "Content",pCom->Target ? pCom->Target->GetName() : ""); break; case C4CMD_Buy: case C4CMD_Sell: - sprintf(szCommand,"%s %s at %s",CommandName(pCom->Command),pCom->Data.getC4ID().ToString(),pCom->Target ? pCom->Target->GetName() : "closest base"); + sprintf(szCommand,"%s %s at %s",CommandName(pCom->Command),pCom->Data.GetDataString().getData(),pCom->Target ? pCom->Target->GetName() : "closest base"); break; case C4CMD_Acquire: - sprintf(szCommand,"%s %s",CommandName(pCom->Command),pCom->Data.getC4ID().ToString()); + sprintf(szCommand,"%s %s",CommandName(pCom->Command),pCom->Data.GetDataString().getData()); break; case C4CMD_Call: sprintf(szCommand,"%s %s in %s",CommandName(pCom->Command),pCom->Text->GetCStr(),pCom->Target ? pCom->Target->GetName() : "(null)"); @@ -2628,7 +2627,7 @@ C4Object *C4Object::ComposeContents(C4ID id) // Remove components for (cnt=0; (c_id=NeededComponents.GetID(cnt)); cnt++) for (cnt2=0; cnt2AssignRemoval(); @@ -4460,17 +4459,17 @@ void C4Object::GetParallaxity(int32_t *parX, int32_t *parY) const *parY = par->GetItem(1).getInt(); } -bool C4Object::GetDragImage(C4Object **drag_object, C4ID *drag_id) const +bool C4Object::GetDragImage(C4Object **drag_object, C4Def **drag_def) const { // drag is possible if MouseDragImage is assigned C4Value parV; GetProperty(P_MouseDragImage, &parV); if (!parV) return false; // determine drag object/id - C4Object *obj=NULL; C4ID id; - if (parV.CheckConversion(C4V_Object)) obj = parV.getObj(); - else if (parV.CheckConversion(C4V_Def)) id = parV.getC4ID(); + C4Object *obj = parV.getObj(); + C4Def * def = NULL; + if (!obj) def = parV.getDef(); if (drag_object) *drag_object = obj; - if (drag_id) *drag_id = id; + if (drag_def) *drag_def = def; // drag possible, even w./o image return true; } @@ -5044,3 +5043,10 @@ C4ValueArray * C4Object::GetProperties() const (*a)[i++] = C4VString(&::Strings.P[P_Plane]); return a; } + +int32_t C4Object::GetSolidMaskPlane() const +{ + // use SolidMaskPlane property. Fallback to object plane if unassigned. + int32_t plane = GetPropertyInt(P_SolidMaskPlane); + return plane ? plane : GetPlane(); +} diff --git a/src/object/C4Object.h b/src/object/C4Object.h index e5432fe5a..0420cede9 100644 --- a/src/object/C4Object.h +++ b/src/object/C4Object.h @@ -194,6 +194,7 @@ public: void Resort(); void SetPlane(int32_t z) { if (z) Plane = z; Resort(); } int32_t GetPlane() const { return Plane; } + int32_t GetSolidMaskPlane() const; int32_t GetAudible() const; void SetCommand(int32_t iCommand, C4Object *pTarget, C4Value iTx, int32_t iTy=0, C4Object *pTarget2=NULL, bool fControl=false, C4Value iData=C4VNull, int32_t iRetries=0, C4String *szText=NULL); void SetCommand(int32_t iCommand, C4Object *pTarget=NULL, int32_t iTx=0, int32_t iTy=0, C4Object *pTarget2=NULL, bool fControl=false, C4Value iData=C4VNull, int32_t iRetries=0, C4String *szText=NULL) @@ -339,7 +340,7 @@ public: bool IsInLiquidCheck() const; // returns whether the Clonk is within liquid material void UpdateInLiquid(); // makes splash when a liquid is entered void GrabContents(C4Object *pFrom); // grab all contents that don't reject it - bool GetDragImage(C4Object **drag_object, C4ID *drag_id) const; // return true if object is draggable; assign drag_object/drag_id to gfx to be used for dragging + bool GetDragImage(C4Object **drag_object, C4Def **drag_id) const; // return true if object is draggable; assign drag_object/drag_id to gfx to be used for dragging protected: void SideBounds(C4Real &ctcox); // apply bounds at side; regarding bourder bound and pLayer diff --git a/src/object/C4ObjectList.cpp b/src/object/C4ObjectList.cpp index 5d322fe69..ffefedd40 100644 --- a/src/object/C4ObjectList.cpp +++ b/src/object/C4ObjectList.cpp @@ -270,13 +270,13 @@ bool C4ObjectList::Remove(C4Object *pObj) return true; } -C4Object* C4ObjectList::Find(C4ID id, int owner, DWORD dwOCF) +C4Object* C4ObjectList::Find(C4Def * def, int owner, DWORD dwOCF) { C4ObjectLink *cLnk; // Find link and object for (cLnk=First; cLnk; cLnk=cLnk->Next) if (cLnk->Obj->Status) - if (cLnk->Obj->Def->id==id) + if (cLnk->Obj->Def==def) if ((owner==ANY_OWNER) || (cLnk->Obj->Owner==owner)) if (dwOCF & cLnk->Obj->OCF) return cLnk->Obj; diff --git a/src/object/C4ObjectList.h b/src/object/C4ObjectList.h index 69d34712a..731b30f7f 100644 --- a/src/object/C4ObjectList.h +++ b/src/object/C4ObjectList.h @@ -116,7 +116,7 @@ public: const C4Object* GetObject(int Index=0) const; C4Object* GetObject(int Index=0) { return const_cast(const_cast(this)->GetObject(Index)); } - C4Object* Find(C4ID id, int iOwner=ANY_OWNER, DWORD dwOCF=OCF_All); + C4Object* Find(C4Def * def, int iOwner=ANY_OWNER, DWORD dwOCF=OCF_All); C4Object* FindOther(C4ID id, int iOwner=ANY_OWNER); const C4ObjectLink* GetLink(const C4Object *pObj) const; diff --git a/src/object/C4ObjectMenu.cpp b/src/object/C4ObjectMenu.cpp index 773021315..b45c99874 100644 --- a/src/object/C4ObjectMenu.cpp +++ b/src/object/C4ObjectMenu.cpp @@ -162,7 +162,7 @@ bool C4ObjectMenu::DoRefillInternal(bool &rfRefilled) { // easy way: only if first concat check matches // this doesn't catch all possibilities, but that will rarely matter - C4Object *pObj2=pTarget->Contents.Find(pDef->id, ANY_OWNER, OCF_FullCon); + C4Object *pObj2=pTarget->Contents.Find(pDef, ANY_OWNER, OCF_FullCon); if (pObj2) if (pObj2->CanConcatPictureWith(pObj)) pObj = pObj2; } // Caption @@ -199,7 +199,7 @@ bool C4ObjectMenu::DoRefillInternal(bool &rfRefilled) { // easy way: only if first concat check matches // this doesn't catch all possibilities, but that will rarely matter - C4Object *pObj2 = pTarget->Contents.Find(pDef->id, ANY_OWNER, OCF_FullCon); + C4Object *pObj2 = pTarget->Contents.Find(pDef, ANY_OWNER, OCF_FullCon); if (pObj2) if (pObj2->CanConcatPictureWith(pObj)) pObj = pObj2; } // Determine whether to get or activate diff --git a/src/object/C4ObjectScript.cpp b/src/object/C4ObjectScript.cpp index 2d5230be0..4a4908ae0 100644 --- a/src/object/C4ObjectScript.cpp +++ b/src/object/C4ObjectScript.cpp @@ -304,7 +304,7 @@ static C4Void FnDoDamage(C4Object *Obj, long iChange, Nillable iDmgType, N // iCausedBy = cthr->Caller->Obj->Controller; //else iCausedBy = NO_OWNER; - Obj->DoDamage(iChange,iCausedBy, iDmgType); + Obj->DoDamage(iChange, iCausedBy, iDmgType); return C4Void(); } @@ -1156,7 +1156,7 @@ static C4Object *FnContents(C4Object *Obj, long index) return NULL; } -static bool FnShiftContents(C4Object *Obj, bool fShiftBack, C4ID idTarget, bool fDoCalls) +static bool FnShiftContents(C4Object *Obj, bool fShiftBack, C4Def * idTarget, bool fDoCalls) { // regular shift if (!idTarget) return !!Obj->ShiftContents(fShiftBack, fDoCalls); @@ -1186,7 +1186,7 @@ static long FnContentsCount(C4Object *Obj, C4ID id) return Obj->Contents.ObjectCount(id); } -static C4Object *FnFindContents(C4Object *Obj, C4ID c_id) +static C4Object *FnFindContents(C4Object *Obj, C4Def * c_id) { return Obj->Contents.Find(c_id); } @@ -2150,13 +2150,28 @@ static bool FnSetAttachTransform(C4Object *Obj, long iAttachNumber, C4ValueArray return true; } -static Nillable FnGetMeshMaterial(C4Object *Obj, int iSubMesh) +static Nillable FnGetMeshMaterial(C4PropList * _this, int iSubMesh) { - if (!Obj || !Obj->pMeshInstance) return C4Void(); - if (iSubMesh < 0 || (unsigned int)iSubMesh >= Obj->pMeshInstance->GetNumSubMeshes()) return C4Void(); - - StdSubMeshInstance& submesh = Obj->pMeshInstance->GetSubMesh(iSubMesh); - return String(submesh.GetMaterial().Name.getData()); + // Called in object or definition context? + C4Object *Obj = Object(_this); + if (!Obj) + { + if (!_this || !_this->GetDef()) throw new NeedNonGlobalContext("GetMeshMaterial"); + // Called in definition context: Get definition default mesh material + C4Def *def = _this->GetDef(); + if (!def->Graphics.IsMesh()) return C4Void(); + if (iSubMesh < 0 || (unsigned int)iSubMesh >= def->Graphics.Mesh->GetNumSubMeshes()) return C4Void(); + const StdSubMesh &submesh = def->Graphics.Mesh->GetSubMesh(iSubMesh); + return String(submesh.GetMaterial().Name.getData()); + } + else + { + // Called in object context: Get material of mesh instance + if (!Obj->pMeshInstance) return C4Void(); + if (iSubMesh < 0 || (unsigned int)iSubMesh >= Obj->pMeshInstance->GetNumSubMeshes()) return C4Void(); + StdSubMeshInstance& submesh = Obj->pMeshInstance->GetSubMesh(iSubMesh); + return String(submesh.GetMaterial().Name.getData()); + } } static bool FnSetMeshMaterial(C4Object *Obj, C4String* Material, int iSubMesh) @@ -2183,6 +2198,10 @@ static bool FnCreateParticleAtBone(C4Object* Obj, C4String* szName, C4String* sz const StdMesh& mesh = Obj->pMeshInstance->GetMesh(); const StdMeshBone* bone = mesh.GetBoneByName(szBoneName->GetData()); if(!bone) return false; + // get particle + C4ParticleDef *pDef=::Particles.definitions.GetDef(FnStringPar(szName)); + if (!pDef) return false; +#ifndef USE_CONSOLE // Get transform Obj->pMeshInstance->UpdateBoneTransforms(); const StdMeshMatrix transform = Obj->pMeshInstance->GetBoneTransform(bone->Index) * StdMeshMatrix::Transform(bone->Transformation); @@ -2278,9 +2297,6 @@ static bool FnCreateParticleAtBone(C4Object* Obj, C4String* szName, C4String* sz x.x += DrawTransform(0,3); x.y += DrawTransform(1,3); x.z += DrawTransform(2,3); - // get particle - C4ParticleDef *pDef=::Particles.definitions.GetDef(FnStringPar(szName)); - if (!pDef) return false; // construct data C4ParticleValueProvider valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime; @@ -2292,6 +2308,7 @@ static bool FnCreateParticleAtBone(C4Object* Obj, C4String* szName, C4String* sz // cast ::Particles.Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, Obj); +#endif // success, even if not created return true; diff --git a/src/platform/C4AppGTK.cpp b/src/platform/C4AppGTK.cpp index 31b56a8bc..208e1a6c4 100644 --- a/src/platform/C4AppGTK.cpp +++ b/src/platform/C4AppGTK.cpp @@ -214,7 +214,7 @@ static XRROutputInfo* GetXRROutputInfoForWindow(Display* dpy, Window w) RROutput output = XRRGetOutputPrimary(dpy, w); if(output != 0) { - info = XRRGetOutputInfo(dpy, r, XRRGetOutputPrimary(dpy, w)); + info = XRRGetOutputInfo(dpy, r, output); if (!info) { XRRFreeScreenResources(r); diff --git a/src/platform/PlatformAbstraction.h b/src/platform/PlatformAbstraction.h index 0e6a9b8d5..a040ddc0c 100644 --- a/src/platform/PlatformAbstraction.h +++ b/src/platform/PlatformAbstraction.h @@ -80,31 +80,7 @@ // Integer dataypes -#ifdef HAVE_STDINT_H #include -#elif defined(_MSC_VER) -#include -typedef signed __int8 int8_t; -typedef signed __int16 int16_t; -typedef signed __int32 int32_t; -typedef signed __int64 int64_t; -typedef unsigned __int8 uint8_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int32 uint32_t; -typedef unsigned __int64 uint64_t; -// Copied from newer stddef.h -#ifndef _INTPTR_T_DEFINED -#ifdef _WIN64 -typedef __int64 intptr_t; -#else -typedef __int32 intptr_t; -#endif -#define _INTPTR_T_DEFINED -#endif -#else -#error Could not find integer datatypes! -#endif - #ifdef HAVE_UNISTD_H diff --git a/src/platform/StdSchedulerPoll.cpp b/src/platform/StdSchedulerPoll.cpp index 8f91cc0bd..eeaf5439f 100644 --- a/src/platform/StdSchedulerPoll.cpp +++ b/src/platform/StdSchedulerPoll.cpp @@ -177,9 +177,9 @@ bool StdScheduler::DoScheduleProcs(int iTimeout) } } } - else if (cnt < 0) + else if (cnt < 0 && errno != EINTR) { - printf("StdScheduler::Execute: poll failed: %s\n",strerror(errno)); + printf("StdScheduler::%s: poll failed: %s\n",__func__,strerror(errno)); } return fSuccess; } @@ -245,4 +245,4 @@ void *StdThread::_ThreadFunc(void *pPar) return reinterpret_cast(pThread->ThreadFunc()); } -#endif \ No newline at end of file +#endif diff --git a/src/player/C4Player.cpp b/src/player/C4Player.cpp index 022403c6f..84a1a4092 100644 --- a/src/player/C4Player.cpp +++ b/src/player/C4Player.cpp @@ -206,7 +206,7 @@ void C4Player::Execute() // ::Game.iTick35 if (!::Game.iTick35 && Status==PS_Normal) { - ExecHomeBaseProduction(); + ExecBaseProduction(); CheckElimination(); if (pMsgBoardQuery && LocalControl) ExecMsgBoardQueries(); } @@ -582,10 +582,10 @@ bool C4Player::ScenarioInit() // Wealth, home base materials, abilities Wealth=Game.C4S.PlrStart[PlrStartIndex].Wealth.Evaluate(); - HomeBaseMaterial=Game.C4S.PlrStart[PlrStartIndex].HomeBaseMaterial; - HomeBaseMaterial.ConsolidateValids(::Definitions); - HomeBaseProduction=Game.C4S.PlrStart[PlrStartIndex].HomeBaseProduction; - HomeBaseProduction.ConsolidateValids(::Definitions); + BaseMaterial=Game.C4S.PlrStart[PlrStartIndex].BaseMaterial; + BaseMaterial.ConsolidateValids(::Definitions); + BaseProduction=Game.C4S.PlrStart[PlrStartIndex].BaseProduction; + BaseProduction.ConsolidateValids(::Definitions); Knowledge=Game.C4S.PlrStart[PlrStartIndex].BuildKnowledge; Knowledge.ConsolidateValids(::Definitions); @@ -607,7 +607,12 @@ bool C4Player::ScenarioInit() int32_t iPosition=iStartPos; // Distribute according to availability while (::Players.PositionTaken(iPosition)) - { ++iPosition%=iMaxPos; if (iPosition==iStartPos) break; } + { + ++iPosition; + iPosition %= iMaxPos; + if (iPosition == iStartPos) + break; + } Position=iPosition; // Set x position ptx=BoundBy(16+Position*(GBackWdt-32)/(iMaxPos-1),0,GBackWdt-16); @@ -926,6 +931,7 @@ void C4Player::Default() NoEliminationCheck = false; Evaluated = false; ZoomLimitMinWdt=ZoomLimitMinHgt=ZoomLimitMaxWdt=ZoomLimitMaxHgt=ZoomWdt=ZoomHgt=0; + ZoomLimitMinVal=ZoomLimitMaxVal=ZoomVal=Fix0; ViewLock = true; } @@ -1141,6 +1147,9 @@ void C4Player::CompileFunc(StdCompiler *pComp, C4ValueNumbers * numbers) pComp->Value(mkNamingAdapt(ZoomLimitMaxHgt, "ZoomLimitMaxHgt", 0)); pComp->Value(mkNamingAdapt(ZoomWdt, "ZoomWdt", 0)); pComp->Value(mkNamingAdapt(ZoomHgt, "ZoomHgt", 0)); + pComp->Value(mkNamingAdapt(ZoomLimitMinVal, "ZoomLimitMinVal", Fix0)); + pComp->Value(mkNamingAdapt(ZoomLimitMaxVal, "ZoomLimitMaxVal", Fix0)); + pComp->Value(mkNamingAdapt(ZoomVal, "ZoomVal", Fix0)); pComp->Value(mkNamingAdapt(fFogOfWar, "FogOfWar", false)); bool bForceFogOfWar = false; pComp->Value(mkNamingAdapt(bForceFogOfWar, "ForceFogOfWar", false)); @@ -1157,8 +1166,8 @@ void C4Player::CompileFunc(StdCompiler *pComp, C4ValueNumbers * numbers) pComp->Value(mkNamingAdapt(ViewCursor, "ViewCursor", C4ObjectPtr::Null)); pComp->Value(mkNamingAdapt(MessageStatus, "MessageStatus", 0)); pComp->Value(mkNamingAdapt(toC4CStr(MessageBuf),"MessageBuf", "")); - pComp->Value(mkNamingAdapt(HomeBaseMaterial, "HomeBaseMaterial" )); - pComp->Value(mkNamingAdapt(HomeBaseProduction, "HomeBaseProduction" )); + pComp->Value(mkNamingAdapt(BaseMaterial, "BaseMaterial" )); + pComp->Value(mkNamingAdapt(BaseProduction, "BaseProduction" )); pComp->Value(mkNamingAdapt(Knowledge, "Knowledge" )); pComp->Value(mkNamingAdapt(mkParAdapt(Crew, numbers), "Crew" )); pComp->Value(mkNamingAdapt(CrewInfoList.iNumCreated, "CrewCreated", 0)); @@ -1189,18 +1198,18 @@ bool C4Player::LoadRuntimeData(C4Group &hGroup, C4ValueNumbers * numbers) return true; } -void C4Player::ExecHomeBaseProduction() +void C4Player::ExecBaseProduction() { - const int32_t MaxHomeBaseProduction = 25; + const int32_t MaxBaseProduction = 25; ProductionDelay++; if (ProductionDelay>=60) // Minute Production Unit { ProductionDelay=0; ProductionUnit++; - for (int32_t cnt=0; HomeBaseProduction.GetID(cnt); cnt++) - if (HomeBaseProduction.GetCount(cnt)>0) - if (ProductionUnit % BoundBy(11-HomeBaseProduction.GetCount(cnt),1,10) ==0) - if (HomeBaseMaterial.GetIDCount(HomeBaseProduction.GetID(cnt))0) + if (ProductionUnit % BoundBy(11-BaseProduction.GetCount(cnt),1,10) ==0) + if (BaseMaterial.GetIDCount(BaseProduction.GetID(cnt)) < MaxBaseProduction) + BaseMaterial.IncreaseIDCount(BaseProduction.GetID(cnt)); } } @@ -1279,8 +1288,8 @@ void C4Player::DefaultRuntimeData() MessageStatus=0; MessageBuf[0]=0; Hostility.clear(); - HomeBaseMaterial.Default(); - HomeBaseProduction.Default(); + BaseMaterial.Default(); + BaseProduction.Default(); Knowledge.Default(); FlashCom=0; } @@ -1931,6 +1940,24 @@ void C4Player::SetMaxZoomByViewRange(int32_t range_wdt, int32_t range_hgt, bool ZoomLimitsToViewports(); } +void C4Player::SetZoom(C4Fixed zoom, bool direct, bool no_increase, bool no_decrease) +{ + AdjustZoomParameter(&ZoomVal, zoom, no_increase, no_decrease); + ZoomToViewports(direct, no_increase, no_decrease); +} + +void C4Player::SetMinZoom(C4Fixed zoom, bool no_increase, bool no_decrease) +{ + AdjustZoomParameter(&ZoomLimitMinVal, zoom, no_increase, no_decrease); + ZoomLimitsToViewports(); +} + +void C4Player::SetMaxZoom(C4Fixed zoom, bool no_increase, bool no_decrease) +{ + AdjustZoomParameter(&ZoomLimitMaxVal, zoom, no_increase, no_decrease); + ZoomLimitsToViewports(); +} + void C4Player::ZoomToViewports(bool direct, bool no_increase, bool no_decrease) { C4Viewport *vp = NULL; @@ -1940,7 +1967,7 @@ void C4Player::ZoomToViewports(bool direct, bool no_increase, bool no_decrease) void C4Player::ZoomToViewport(C4Viewport* vp, bool direct, bool no_increase, bool no_decrease) { - float new_zoom = vp->GetZoomByViewRange((ZoomWdt || ZoomHgt) ? ZoomWdt : C4VP_DefViewRangeX,ZoomHgt); + float new_zoom = ZoomVal ? fixtof(ZoomVal) : vp->GetZoomByViewRange((ZoomWdt || ZoomHgt) ? ZoomWdt : C4VP_DefViewRangeX,ZoomHgt); float old_zoom = vp->GetZoomTarget(); if (new_zoom > old_zoom && no_increase) return; if (new_zoom < old_zoom && no_decrease) return; @@ -1956,8 +1983,8 @@ void C4Player::ZoomLimitsToViewports() void C4Player::ZoomLimitsToViewport(C4Viewport* vp) { - float zoom_max = vp->GetZoomByViewRange((ZoomLimitMinWdt || ZoomLimitMinHgt) ? ZoomLimitMinWdt : C4VP_DefMinViewRangeX,ZoomLimitMinHgt); - float zoom_min = vp->GetZoomByViewRange((ZoomLimitMaxWdt || ZoomLimitMaxHgt) ? ZoomLimitMaxWdt : C4VP_DefMaxViewRangeX,ZoomLimitMaxHgt); + float zoom_max = ZoomLimitMaxVal ? fixtof(ZoomLimitMaxVal) : vp->GetZoomByViewRange((ZoomLimitMinWdt || ZoomLimitMinHgt) ? ZoomLimitMinWdt : C4VP_DefMinViewRangeX,ZoomLimitMinHgt); + float zoom_min = ZoomLimitMinVal ? fixtof(ZoomLimitMinVal) : vp->GetZoomByViewRange((ZoomLimitMaxWdt || ZoomLimitMaxHgt) ? ZoomLimitMaxWdt : C4VP_DefMaxViewRangeX,ZoomLimitMaxHgt); vp->SetZoomLimits(zoom_min, zoom_max); } @@ -1977,6 +2004,22 @@ bool C4Player::AdjustZoomParameter(int32_t *range_par, int32_t new_val, bool no_ return true; } +bool C4Player::AdjustZoomParameter(C4Fixed *zoom_par, C4Fixed new_val, bool no_increase, bool no_decrease) +{ + // helper function: Adjust *zoom_par to new_val if increase/decrease not forbidden + if (new_val < *zoom_par) + { + if (!no_decrease) *zoom_par = new_val; + return !no_decrease; + } + else if(new_val > *zoom_par) + { + if (!no_increase) *zoom_par = new_val; + return !no_increase; + } + return true; +} + void C4Player::SetViewLocked(bool to_val) { if ((ViewLock = to_val)) diff --git a/src/player/C4Player.h b/src/player/C4Player.h index 7c4b3c7fc..bd64bb9e1 100644 --- a/src/player/C4Player.h +++ b/src/player/C4Player.h @@ -111,14 +111,15 @@ public: bool fFogOfWarInitialized; // No Save // C4ObjectList FoWViewObjs; // No Save // int32_t ZoomLimitMinWdt,ZoomLimitMinHgt,ZoomLimitMaxWdt,ZoomLimitMaxHgt,ZoomWdt,ZoomHgt; // zoom limits and last zoom set by script + C4Fixed ZoomLimitMinVal,ZoomLimitMaxVal,ZoomVal; // direct zoom values. // Game int32_t Wealth; int32_t CurrentScore,InitialScore; int32_t ObjectsOwned; HostilitySet Hostility; // Home Base - C4IDList HomeBaseMaterial; - C4IDList HomeBaseProduction; + C4IDList BaseMaterial; + C4IDList BaseProduction; int32_t ProductionDelay,ProductionUnit; // Crew C4ObjectInfoList CrewInfoList; // No Save // @@ -214,7 +215,7 @@ protected: void UpdateView(); void CheckElimination(); void UpdateCounts(); - void ExecHomeBaseProduction(); + void ExecBaseProduction(); void PlaceReadyBase(int32_t &tx, int32_t &ty, C4Object **pFirstBase); void PlaceReadyVehic(int32_t tx1, int32_t tx2, int32_t ty, C4Object *FirstBase); void PlaceReadyMaterial(int32_t tx1, int32_t tx2, int32_t ty, C4Object *FirstBase); @@ -260,6 +261,9 @@ public: void SetZoomByViewRange(int32_t range_wdt, int32_t range_hgt, bool direct, bool no_increase, bool no_decrease); void SetMinZoomByViewRange(int32_t range_wdt, int32_t range_hgt, bool no_increase, bool no_decrease); void SetMaxZoomByViewRange(int32_t range_wdt, int32_t range_hgt, bool no_increase, bool no_decrease); + void SetZoom(C4Fixed zoom, bool direct, bool no_increase, bool no_decrease); + void SetMinZoom(C4Fixed zoom, bool no_increase, bool no_decrease); + void SetMaxZoom(C4Fixed zoom, bool no_increase, bool no_decrease); void ZoomToViewports(bool direct, bool no_increase=false, bool no_decrease=false); void ZoomToViewport(C4Viewport* vp, bool direct, bool no_increase=false, bool no_decrease=false); void ZoomLimitsToViewports(); @@ -267,6 +271,7 @@ public: private: bool AdjustZoomParameter(int32_t *range_par, int32_t new_val, bool no_increase, bool no_decrease); + bool AdjustZoomParameter(C4Fixed *zoom_par, C4Fixed new_val, bool no_increase, bool no_decrease); }; #endif diff --git a/src/script/C4Aul.h b/src/script/C4Aul.h index 565c4a61a..1396d8941 100644 --- a/src/script/C4Aul.h +++ b/src/script/C4Aul.h @@ -109,8 +109,6 @@ enum C4AulBCCType AB_LessThanEqual, // <= AB_GreaterThan, // > AB_GreaterThanEqual, // >= - AB_Identical, // === - AB_NotIdentical, // !== AB_Equal, // == AB_NotEqual, // != AB_BitAnd, // & diff --git a/src/script/C4AulDefFunc.h b/src/script/C4AulDefFunc.h index 3cd44593f..812967f3e 100644 --- a/src/script/C4AulDefFunc.h +++ b/src/script/C4AulDefFunc.h @@ -137,7 +137,7 @@ template <> struct C4ValueConv template <> struct C4ValueConv { inline static C4V_Type Type() { return C4V_PropList; } - inline static C4ID FromC4V(C4Value &v) { return v.getC4ID(); } + inline static C4ID FromC4V(C4Value &v) { C4Def * def = v.getDef(); return def ? def->id : C4ID::None; } inline static C4ID _FromC4V(C4Value &v) { return FromC4V(v); } inline static C4Value ToC4V(C4ID v) { return C4VPropList(C4Id2Def(v)); } }; @@ -186,8 +186,8 @@ template <> struct C4ValueConv template <> struct C4ValueConv { inline static C4V_Type Type() { return C4V_Def; } - inline static C4Def *FromC4V(C4Value &v) { C4PropList * p = v.getPropList(); return p ? p->GetDef() : 0; } - inline static C4Def *_FromC4V(C4Value &v) { C4PropList * p = v._getPropList(); return p ? p->GetDef() : 0; } + inline static C4Def *FromC4V(C4Value &v) { return v.getDef(); } + inline static C4Def *_FromC4V(C4Value &v) { return v._getDef(); } inline static C4Value ToC4V(C4Def *v) { return C4VPropList(v); } }; template <> struct C4ValueConv diff --git a/src/script/C4AulExec.cpp b/src/script/C4AulExec.cpp index 6d03fc839..3872c892b 100644 --- a/src/script/C4AulExec.cpp +++ b/src/script/C4AulExec.cpp @@ -402,31 +402,17 @@ C4Value C4AulExec::Exec(C4AulBCC *pCPos, bool fPassErrors) PopValue(); break; } - case AB_Identical: // === - { - C4Value *pPar1 = pCurVal - 1, *pPar2 = pCurVal; - pPar1->SetBool(pPar1->GetType() == pPar2->GetType() && pPar1->GetData() == pPar2->GetData()); - PopValue(); - break; - } - case AB_NotIdentical: // !== - { - C4Value *pPar1 = pCurVal - 1, *pPar2 = pCurVal; - pPar1->SetBool(pPar1->GetType() != pPar2->GetType() || pPar1->GetData() != pPar2->GetData()); - PopValue(); - break; - } case AB_Equal: // == { C4Value *pPar1 = pCurVal - 1, *pPar2 = pCurVal; - pPar1->SetBool(*pPar1 == *pPar2); + pPar1->SetBool(pPar1->IsIdenticalTo(*pPar2)); PopValue(); break; } case AB_NotEqual: // != { C4Value *pPar1 = pCurVal - 1, *pPar2 = pCurVal; - pPar1->SetBool(*pPar1 != *pPar2); + pPar1->SetBool(!pPar1->IsIdenticalTo(*pPar2)); PopValue(); break; } @@ -836,13 +822,7 @@ C4AulBCC *C4AulExec::Call(C4AulFunc *pFunc, C4Value *pReturn, C4Value *pPars, C4 pContext = pCurCtx->Obj; } - // Convert parameters (typecheck) - const C4V_Type *pTypes = pFunc->GetParType(); - for (int i = 0; i < pFunc->GetParCount(); i++) - if (!pPars[i].CheckParConversion(pTypes[i])) - throw new C4AulExecError(FormatString("call to \"%s\" parameter %d: passed %s, but expected %s", - pFunc->GetName(), i + 1, pPars[i].GetTypeName(), GetC4VName(pTypes[i]) - ).getData()); + pFunc->CheckParTypes(pPars); // Script function? C4AulScriptFunc *pSFunc = pFunc->SFunc(); diff --git a/src/script/C4AulFunc.cpp b/src/script/C4AulFunc.cpp index c89b373b6..80e3bd505 100644 --- a/src/script/C4AulFunc.cpp +++ b/src/script/C4AulFunc.cpp @@ -60,3 +60,15 @@ StdStrBuf C4AulFunc::GetFullName() r.Append(Name->GetData()); return r; } + +void C4AulFunc::CheckParTypes(const C4Value pPars[]) const { + // Convert parameters (typecheck) + const C4V_Type *pTypes = GetParType(); + int parcount = GetParCount(); + for (int i = 0; i < parcount; i++) { + if (!pPars[i].CheckParConversion(pTypes[i])) + throw new C4AulExecError(FormatString("call to \"%s\" parameter %d: passed %s, but expected %s", + GetName(), i + 1, pPars[i].GetTypeName(), GetC4VName(pTypes[i]) + ).getData()); + } +} diff --git a/src/script/C4AulFunc.h b/src/script/C4AulFunc.h index 441b8ab81..464b66ad6 100644 --- a/src/script/C4AulFunc.h +++ b/src/script/C4AulFunc.h @@ -82,6 +82,7 @@ public: return Exec(p, pPars->Par, fPassErrors); } virtual C4Value Exec(C4PropList * p, C4Value pPars[], bool fPassErrors=false) = 0; + void CheckParTypes(const C4Value pPars[]) const; }; #endif diff --git a/src/script/C4AulLink.cpp b/src/script/C4AulLink.cpp index 56e767e23..dabf8a18e 100644 --- a/src/script/C4AulLink.cpp +++ b/src/script/C4AulLink.cpp @@ -40,11 +40,11 @@ bool C4ScriptHost::ResolveAppends(C4DefList *rDefs) { // resolve local appends if (State != ASS_PREPARSED) return false; - for (std::list::iterator a = Appends.begin(); a != Appends.end(); ++a) + for (std::list::iterator a = Appends.begin(); a != Appends.end(); ++a) { - if (*a) + if (*a != "*") { - C4Def *Def = rDefs->ID2Def(*a); + C4Def *Def = rDefs->GetByName(*a); if (Def) { if (std::find(Def->Script.SourceScripts.begin(), Def->Script.SourceScripts.end(), GetScriptHost()) == Def->Script.SourceScripts.end()) @@ -55,7 +55,7 @@ bool C4ScriptHost::ResolveAppends(C4DefList *rDefs) // save id in buffer because AulWarn will use the buffer of C4IdText // to get the id of the object in which the error occurs... // (stupid static buffers...) - Warn("#appendto %s not found", a->ToString()); + Warn("#appendto %s not found", a->getData()); } } else @@ -91,9 +91,9 @@ bool C4ScriptHost::ResolveIncludes(C4DefList *rDefs) } Resolving=true; // append all includes to local script - for (std::list::reverse_iterator i = Includes.rbegin(); i != Includes.rend(); ++i) + for (std::list::reverse_iterator i = Includes.rbegin(); i != Includes.rend(); ++i) { - C4Def *Def = rDefs->ID2Def(*i); + C4Def *Def = rDefs->GetByName(*i); if (Def) { // resolve #includes in included script first (#include-chains :( ) @@ -112,7 +112,7 @@ bool C4ScriptHost::ResolveIncludes(C4DefList *rDefs) // save id in buffer because AulWarn will use the buffer of C4IdText // to get the id of the object in which the error occurs... // (stupid static buffers...) - Warn("#include %s not found", i->ToString()); + Warn("#include %s not found", i->getData()); } } IncludesResolved = true; diff --git a/src/script/C4AulParse.cpp b/src/script/C4AulParse.cpp index 639da125b..a75210c0a 100644 --- a/src/script/C4AulParse.cpp +++ b/src/script/C4AulParse.cpp @@ -182,7 +182,8 @@ private: C4AulTokenType GetNextToken(OperatorPolicy Operator = OperatorsPlease); // get next token of SPos void Shift(OperatorPolicy Operator = OperatorsPlease); - void Match(C4AulTokenType TokenType, const char * Message = NULL); + void Match(C4AulTokenType TokenType, const char * Expected = NULL); + void Check(C4AulTokenType TokenType, const char * Expected = NULL); void UnexpectedToken(const char * Expected) NORETURN; static const char * GetTokenName(C4AulTokenType TokenType); @@ -357,7 +358,6 @@ struct C4ScriptOpDef unsigned short Priority; const char* Identifier; C4AulBCCType Code; - C4AulBCCType ResultModifier; // code to apply to result after it was calculated bool Postfix; bool Changer; // changes first operand to result, rewrite to "a = a (op) b" bool NoSecondStatement; // no second statement expected (++/-- postfix) @@ -368,57 +368,55 @@ struct C4ScriptOpDef static C4ScriptOpDef C4ScriptOpMap[] = { - // priority postfix - // | identifier | changer - // | | Bytecode Result | | no second id - // | | | Modifier | | | RetType ParType1 ParType2 + // priority postfix + // | identifier | changer + // | | Bytecode | | no second id + // | | | | | | RetType ParType1 ParType2 // prefix - { 15, "++", AB_Inc, AB_ERR, 0, 1, 0, C4V_Int, C4V_Int, C4V_Any}, - { 15, "--", AB_Dec, AB_ERR, 0, 1, 0, C4V_Int, C4V_Int, C4V_Any}, - { 15, "~", AB_BitNot, AB_ERR, 0, 0, 0, C4V_Int, C4V_Int, C4V_Any}, - { 15, "!", AB_Not, AB_ERR, 0, 0, 0, C4V_Bool, C4V_Bool, C4V_Any}, - { 15, "+", AB_ERR, AB_ERR, 0, 0, 0, C4V_Int, C4V_Int, C4V_Any}, - { 15, "-", AB_Neg, AB_ERR, 0, 0, 0, C4V_Int, C4V_Int, C4V_Any}, + { 15, "++", AB_Inc, 0, 1, 0, C4V_Int, C4V_Int, C4V_Any}, + { 15, "--", AB_Dec, 0, 1, 0, C4V_Int, C4V_Int, C4V_Any}, + { 15, "~", AB_BitNot, 0, 0, 0, C4V_Int, C4V_Int, C4V_Any}, + { 15, "!", AB_Not, 0, 0, 0, C4V_Bool, C4V_Bool, C4V_Any}, + { 15, "+", AB_ERR, 0, 0, 0, C4V_Int, C4V_Int, C4V_Any}, + { 15, "-", AB_Neg, 0, 0, 0, C4V_Int, C4V_Int, C4V_Any}, // postfix (whithout second statement) - { 16, "++", AB_Inc, AB_Dec, 1, 1, 1, C4V_Int, C4V_Int, C4V_Any}, - { 16, "--", AB_Dec, AB_Inc, 1, 1, 1, C4V_Int, C4V_Int, C4V_Any}, + { 16, "++", AB_Inc, 1, 1, 1, C4V_Int, C4V_Int, C4V_Any}, + { 16, "--", AB_Dec, 1, 1, 1, C4V_Int, C4V_Int, C4V_Any}, // postfix - { 14, "**", AB_Pow, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 13, "/", AB_Div, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 13, "*", AB_Mul, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 13, "%", AB_Mod, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 12, "-", AB_Sub, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 12, "+", AB_Sum, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 11, "<<", AB_LeftShift, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 11, ">>", AB_RightShift, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 10, "<", AB_LessThan, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Int, C4V_Int}, - { 10, "<=", AB_LessThanEqual, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Int, C4V_Int}, - { 10, ">", AB_GreaterThan, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Int, C4V_Int}, - { 10, ">=", AB_GreaterThanEqual,AB_ERR, 1, 0, 0, C4V_Bool, C4V_Int, C4V_Int}, - { 9, "===", AB_Identical, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Any, C4V_Any}, - { 9, "!==", AB_NotIdentical, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Any, C4V_Any}, - { 9, "==", AB_Equal, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Any, C4V_Any}, - { 9, "!=", AB_NotEqual, AB_ERR, 1, 0, 0, C4V_Bool, C4V_Any, C4V_Any}, - { 8, "&", AB_BitAnd, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 6, "^", AB_BitXOr, AB_ERR, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, - { 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}, + { 14, "**", AB_Pow, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 13, "/", AB_Div, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 13, "*", AB_Mul, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 13, "%", AB_Mod, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 12, "-", AB_Sub, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 12, "+", AB_Sum, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 11, "<<", AB_LeftShift, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 11, ">>", AB_RightShift, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 10, "<", AB_LessThan, 1, 0, 0, C4V_Bool, C4V_Int, C4V_Int}, + { 10, "<=", AB_LessThanEqual, 1, 0, 0, C4V_Bool, C4V_Int, C4V_Int}, + { 10, ">", AB_GreaterThan, 1, 0, 0, C4V_Bool, C4V_Int, C4V_Int}, + { 10, ">=", AB_GreaterThanEqual, 1, 0, 0, C4V_Bool, C4V_Int, C4V_Int}, + { 9, "==", AB_Equal, 1, 0, 0, C4V_Bool, C4V_Any, C4V_Any}, + { 9, "!=", AB_NotEqual, 1, 0, 0, C4V_Bool, C4V_Any, C4V_Any}, + { 8, "&", AB_BitAnd, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 6, "^", AB_BitXOr, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 6, "|", AB_BitOr, 1, 0, 0, C4V_Int, C4V_Int, C4V_Int}, + { 5, "&&", AB_JUMPAND, 1, 0, 0, C4V_Bool, C4V_Bool, C4V_Bool}, + { 4, "||", AB_JUMPOR, 1, 0, 0, C4V_Bool, C4V_Bool, C4V_Bool}, + { 3, "??", AB_JUMPNNIL, 1, 0, 0, C4V_Bool, C4V_Any, C4V_Any}, // changers - { 2, "*=", AB_Mul, AB_ERR, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, - { 2, "/=", AB_Div, AB_ERR, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, - { 2, "%=", AB_Mod, AB_ERR, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, - { 2, "+=", AB_Sum, AB_ERR, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, - { 2, "-=", AB_Sub, AB_ERR, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, - { 2, "&=", AB_BitAnd, AB_ERR, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, - { 2, "|=", AB_BitOr, AB_ERR, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, - { 2, "^=", AB_BitXOr, AB_ERR, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, + { 2, "*=", AB_Mul, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, + { 2, "/=", AB_Div, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, + { 2, "%=", AB_Mod, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, + { 2, "+=", AB_Sum, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, + { 2, "-=", AB_Sub, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, + { 2, "&=", AB_BitAnd, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, + { 2, "|=", AB_BitOr, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, + { 2, "^=", AB_BitXOr, 1, 1, 0, C4V_Int, C4V_Int, C4V_Int}, - { 0, NULL, AB_ERR, AB_ERR, 0, 0, 0, C4V_Nil, C4V_Nil, C4V_Nil} + { 0, NULL, AB_ERR, 0, 0, 0, C4V_Nil, C4V_Nil, C4V_Nil} }; int C4AulParse::GetOperator(const char* pScript) @@ -662,8 +660,6 @@ static const char * GetTTName(C4AulBCCType e) case AB_LessThanEqual: return "LessThanEqual"; // <= case AB_GreaterThan: return "GreaterThan"; // > case AB_GreaterThanEqual: return "GreaterThanEqual"; // >= - case AB_Identical: return "Identical"; // === - case AB_NotIdentical: return "NotIdentical"; // !== case AB_Equal: return "Equal"; // == case AB_NotEqual: return "NotEqual"; // != case AB_BitAnd: return "BitAnd"; // & @@ -812,8 +808,6 @@ int C4AulParse::GetStackValue(C4AulBCCType eType, intptr_t X) case AB_LessThanEqual: case AB_GreaterThan: case AB_GreaterThanEqual: - case AB_Identical: - case AB_NotIdentical: case AB_Equal: case AB_NotEqual: case AB_BitAnd: @@ -925,7 +919,7 @@ int C4AulParse::AddBCC(C4AulBCCType eType, intptr_t X) // Prune unneeded Incs / Decs if(eType == AB_STACK && X < 0 && (pCPos1->bccType == AB_Inc || pCPos1->bccType == AB_Dec)) { - if(C4ScriptOpMap[pCPos1->Par.i].ResultModifier != pCPos1->bccType) + if(!pCPos1->Par.X) { pCPos1->bccType = eType; pCPos1->Par.i = X; @@ -1026,7 +1020,7 @@ C4V_Type C4AulParse::GetLastRetType(C4V_Type to) case AB_LeftShift: case AB_RightShift: case AB_BitAnd: case AB_BitXOr: case AB_BitOr: from = C4V_Int; break; case AB_Not: case AB_LessThan: case AB_LessThanEqual: case AB_GreaterThan: case AB_GreaterThanEqual: - case AB_Identical: case AB_NotIdentical: case AB_Equal: case AB_NotEqual: + case AB_Equal: case AB_NotEqual: from = C4V_Bool; break; default: from = C4V_Any; break; @@ -1187,12 +1181,14 @@ void C4AulParse::Shift(OperatorPolicy Operator) { TokenType = GetNextToken(Operator); } -void C4AulParse::Match(C4AulTokenType RefTokenType, const char * Message) +void C4AulParse::Check(C4AulTokenType RefTokenType, const char * Expected) { if (TokenType != RefTokenType) - // error - throw new C4AulParseError(this, Message ? Message : - FormatString("%s expected, but found %s", GetTokenName(RefTokenType), GetTokenName(TokenType)).getData()); + UnexpectedToken(Expected ? Expected : GetTokenName(RefTokenType)); +} +void C4AulParse::Match(C4AulTokenType RefTokenType, const char * Expected) +{ + Check(RefTokenType, Expected); Shift(); } void C4AulParse::UnexpectedToken(const char * Expected) @@ -1243,12 +1239,11 @@ void C4AulParse::Parse_Script(C4ScriptHost * scripthost) { Shift(); // get id of script to include - if (TokenType != ATT_IDTF) - UnexpectedToken("identifier"); + Check(ATT_IDTF, "script name"); if (Type == PREPARSER) { // add to include list - Host->Includes.push_back(C4ID(StdStrBuf(Idtf))); + Host->Includes.push_back(StdCopyStrBuf(Idtf)); } Shift(); } @@ -1261,14 +1256,14 @@ void C4AulParse::Parse_Script(C4ScriptHost * scripthost) if (Type == PREPARSER) { // get id of script to include/append - C4ID Id; + StdCopyStrBuf Id; switch (TokenType) { case ATT_IDTF: - Id = C4ID(StdStrBuf(Idtf)); + Id = StdCopyStrBuf(Idtf); break; case ATT_STAR: // "*" - Id = C4ID::None; + Id = StdCopyStrBuf("*"); break; default: // -> ID expected @@ -1353,8 +1348,7 @@ void C4AulParse::Parse_Function() throw new C4AulParseError(this, "Declaration expected, but found identifier ", Idtf); Shift(); // get next token, must be func name - if (TokenType != ATT_IDTF) - UnexpectedToken("function name"); + Check(ATT_IDTF, "function name"); // check: symbol already in use? switch (Acc) { @@ -1412,13 +1406,10 @@ void C4AulParse::Parse_Function() { Fn->ClearCode(); } + Shift(); // Parse function body - Shift(); - // expect an opening bracket now - if (TokenType != ATT_BOPEN) - UnexpectedToken("'('"); - Shift(); + Match(ATT_BOPEN); // get pars int cpar = 0; while (TokenType != ATT_BCLOSE) @@ -1426,11 +1417,15 @@ void C4AulParse::Parse_Function() // too many parameters? if (cpar >= C4AUL_MAX_Par) throw new C4AulParseError(this, "'func' parameter list: too many parameters (max 10)"); - // must be a name or type now - if (TokenType != ATT_IDTF) + if (TokenType == ATT_LDOTS) { - UnexpectedToken("parameter or closing bracket"); + if (Type == PREPARSER) Fn->ParCount = C4AUL_MAX_Par; + Shift(); + // don't allow any more parameters after ellipsis + break; } + // must be a name or type now + Check(ATT_IDTF, "parameter, '...', or ')'"); // type identifier? C4V_Type t = C4V_Any; if (SEqual(Idtf, C4AUL_TypeInt)) { t = C4V_Int; Shift(); } @@ -1465,9 +1460,7 @@ void C4AulParse::Parse_Function() break; } // must be a comma now - if (TokenType != ATT_COMMA) - UnexpectedToken("comma or closing bracket"); - Shift(); + Match(ATT_COMMA, "',' or ')'"); cpar++; } Match(ATT_BCLOSE); @@ -1611,7 +1604,6 @@ void C4AulParse::Parse_Statement() else if (SEqual(Idtf, C4AUL_Do)) // while { Parse_DoWhile(); - break; } else if (SEqual(Idtf, C4AUL_While)) // while { @@ -1742,6 +1734,8 @@ int C4AulParse::Parse_Params(int iMaxCnt, const char * sWarn, C4AulFunc * pFunc) case ATT_LDOTS: // functions using ... always take as many parameters as possible assert(Type == PREPARSER || Fn->ParCount == C4AUL_MAX_Par); + if (Type == PREPARSER && Fn->ParCount != C4AUL_MAX_Par && Config.Developer.ExtraWarnings) + Warn("'...' in function body forces function to take varargs"); Fn->ParCount = C4AUL_MAX_Par; Shift(); // Push all unnamed parameters of the current function as parameters @@ -1775,14 +1769,12 @@ int C4AulParse::Parse_Params(int iMaxCnt, const char * sWarn, C4AulFunc * pFunc) } ++size; // end of parameter list? - if (TokenType == ATT_COMMA) - Shift(); - else if (TokenType == ATT_BCLOSE) + if (TokenType == ATT_BCLOSE) { Shift(); fDone = true; } - else UnexpectedToken("',' or ')'"); + else Match(ATT_COMMA, "',' or ')'"); break; } while (!fDone); // too many parameters? @@ -2115,8 +2107,7 @@ void C4AulParse::Parse_ForEach() Shift(); } // get variable name - if (TokenType != ATT_IDTF) - UnexpectedToken("variable name"); + Check(ATT_IDTF, "variable name"); if (Type == PREPARSER) { // insert variable @@ -2242,6 +2233,8 @@ void C4AulParse::Parse_Expression(int iParentPrio) } else if (SEqual(Idtf, C4AUL_Par)) { + if (Type == PREPARSER && Fn->ParCount != C4AUL_MAX_Par && Config.Developer.ExtraWarnings) + Warn("calling 'Par' in function body forces function to take varargs"); // functions using Par() always take as many parameters as possible Fn->ParCount = C4AUL_MAX_Par; // and for Par @@ -2498,13 +2491,15 @@ void C4AulParse::Parse_Expression2(int iParentPrio) Warn(FormatString("operator \"%s\" right side gets %s instead of %s", op->Identifier, GetC4VName(from), GetC4VName(to)).getData(), NULL); } // write byte code - AddBCC(op->Code, op - &C4ScriptOpMap[0]); - // write setter and mofidier + AddBCC(op->Code, 0); + // write setter and modifier if (op->Changer) { AddBCC(Setter.bccType, Setter.Par.X); - if(op->ResultModifier != AB_ERR) - AddBCC(op->ResultModifier, op - &C4ScriptOpMap[0]); + // postfix ++ works by increasing, storing, then decreasing + // in case the result is thrown away, AddBCC will remove the decrease operation + if((op->Code == AB_Inc || op->Code == AB_Dec) && op->Postfix) + AddBCC(op->Code == AB_Inc ? AB_Dec : AB_Inc, 1); } } } @@ -2544,13 +2539,12 @@ void C4AulParse::Parse_Expression2(int iParentPrio) break; case ATT_DOT: Shift(); - if (TokenType != ATT_IDTF) - UnexpectedToken("Identifier"); + Check(ATT_IDTF, "property name"); { C4String * pKey = Strings.RegString(Idtf); AddBCC(AB_PROP, (intptr_t) pKey); - Shift(); } + Shift(); break; case ATT_CALL: case ATT_CALLFS: { @@ -2582,8 +2576,7 @@ void C4AulParse::Parse_Var() while (1) { // get desired variable name - if (TokenType != ATT_IDTF) - UnexpectedToken("variable name"); + Check(ATT_IDTF, "variable name"); if (Type == PREPARSER) { // insert variable @@ -2601,16 +2594,9 @@ void C4AulParse::Parse_Var() Parse_Expression(); AddBCC(AB_POP_TO, 1 + iVarID - (iStack + Fn->VarNamed.iSize)); } - switch (TokenType) - { - case ATT_COMMA: - Shift(); - break; - case ATT_SCOLON: + if (TokenType == ATT_SCOLON) return; - default: - UnexpectedToken("',' or ';'"); - } + Match(ATT_COMMA, "',' or ';'"); } } @@ -2619,11 +2605,10 @@ void C4AulParse::Parse_Local() Shift(); while (1) { + Check(ATT_IDTF, "variable name"); if (Type == PREPARSER) { // get desired variable name - if (TokenType != ATT_IDTF) - UnexpectedToken("variable name"); // check: symbol already in use? if (Host->GetPropList() && Host->GetPropList()->GetFunc(Idtf)) throw new C4AulParseError(this, "variable definition: name already in use"); @@ -2632,7 +2617,7 @@ void C4AulParse::Parse_Local() } char Name[C4AUL_MAX_Identifier] = ""; // current identifier SCopy(Idtf, Name); - Match(ATT_IDTF); + Shift(); if (TokenType == ATT_SET) { if (!Host->GetPropList()) @@ -2642,16 +2627,9 @@ void C4AulParse::Parse_Local() assert(Host->GetPropList()->IsStatic()); Parse_ConstExpression(Host->GetPropList()->IsStatic(), key); } - switch (TokenType) - { - case ATT_COMMA: - Shift(); - break; - case ATT_SCOLON: + if (TokenType == ATT_SCOLON) return; - default: - UnexpectedToken("',' or ';'"); - } + Match(ATT_COMMA, "',' or ';'"); } } @@ -2666,11 +2644,10 @@ void C4AulParse::Parse_Static() } while (1) { + Check(ATT_IDTF, "variable name"); if (Type == PREPARSER) { // get desired variable name - if (TokenType != ATT_IDTF) - UnexpectedToken("variable name"); // global variable definition // check: symbol already in use? if (Engine->GetPropList()->GetFunc(Idtf)) Error("function and variable with name %s", Idtf); @@ -2681,17 +2658,10 @@ void C4AulParse::Parse_Static() Engine->GlobalNamedNames.AddName(Idtf); } } - Match(ATT_IDTF); - switch (TokenType) - { - case ATT_COMMA: - Shift(); - break; - case ATT_SCOLON: + Shift(); + if (TokenType == ATT_SCOLON) return; - default: - UnexpectedToken("',' or ';'"); - } + Match(ATT_COMMA, "',' or ';'"); } } @@ -2799,8 +2769,21 @@ C4Value C4AulParse::Parse_ConstExpression(C4PropListStatic * parent, C4String * default: UnexpectedToken("constant value"); } - // expect ',' (next global) or ';' (end of definition) now Shift(); + while (TokenType == ATT_DOT) + { + Shift(); + Check(ATT_IDTF, "property name"); + if (Type == PARSER) + { + C4String * k = ::Strings.FindString(Idtf); + if (!r.CheckConversion(C4V_PropList)) + throw new C4AulParseError(this, FormatString("proplist access: proplist expected, got %s", r.GetTypeName()).getData()); + if (!k || !r._getPropList()->GetPropertyByS(k, &r)) + r.Set0(); + } + Shift(); + } if (TokenType == ATT_OPERATOR) { C4ScriptOpDef * op = &C4ScriptOpMap[cInt]; @@ -2834,40 +2817,29 @@ void C4AulParse::Parse_Const() // get global constant definition(s) while (1) { - char Name[C4AUL_MAX_Identifier] = ""; // current identifier + Check(ATT_IDTF, "constant name"); // get desired variable name - if (TokenType != ATT_IDTF) - UnexpectedToken("constant name"); + char Name[C4AUL_MAX_Identifier] = ""; SCopy(Idtf, Name); // check func lists - functions of same name are not allowed if (Engine->GetPropList()->GetFunc(Idtf)) Error("definition of constant hidden by function %s", Idtf); if (Engine->GlobalNamedNames.GetItemNr(Idtf) != -1) Error("constant and variable with name %s", Idtf); - Match(ATT_IDTF); - // expect '=' - if (TokenType != ATT_SET) - UnexpectedToken("'='"); + Shift(); + Match(ATT_SET); // expect value. Theoretically, something like C4AulScript::ExecOperator could be used here // this would allow for definitions like "static const OCF_CrewMember = 1<<20" // However, such stuff should better be generalized, so the preparser (and parser) // can evaluate any constant expression, including functions with constant retval (e.g. Sqrt) // So allow only simple constants for now. - Shift(); C4RefCntPointer key = ::Strings.RegString(Name); Parse_ConstExpression(NULL, key); - switch (TokenType) - { - case ATT_COMMA: - Shift(); - break; - case ATT_SCOLON: + if (TokenType == ATT_SCOLON) return; - default: - UnexpectedToken("',' or ';'"); - } + Match(ATT_COMMA, "',' or ';'"); } } diff --git a/src/script/C4PropList.cpp b/src/script/C4PropList.cpp index 4cda1148c..17ea67893 100644 --- a/src/script/C4PropList.cpp +++ b/src/script/C4PropList.cpp @@ -221,8 +221,6 @@ C4PropList::C4PropList(C4PropList * prototype): FirstRef(NULL), prototype(prototype), constant(false), Status(1) { - if (prototype) - SetProperty(P_Prototype, C4VPropList(prototype)); #ifdef _DEBUG PropLists.Add(this); #endif @@ -236,9 +234,7 @@ void C4PropList::Denumerate(C4ValueNumbers * numbers) const_cast(p->Value).Denumerate(numbers); p = Properties.Next(p); } - C4Value v; - if(GetProperty(P_Prototype, &v)) - prototype = v.getPropList(); + prototype.Denumerate(numbers); } C4PropList::~C4PropList() @@ -279,9 +275,41 @@ bool C4PropList::operator==(const C4PropList &b) const void C4PropList::CompileFunc(StdCompiler *pComp, C4ValueNumbers * numbers) { - pComp->Value(constant); + bool oldFormat = false; + // constant proplists are not serialized to savegames, but recreated from the game data instead + assert(!constant); + if (pComp->isCompiler() && pComp->hasNaming()) + { + // backwards compat to savegames and scenarios before 5.5 + try + { + pComp->Value(constant); + oldFormat = true; + } + catch (StdCompiler::NotFoundException *pEx) + { + delete pEx; + pComp->Value(mkParAdapt(prototype, numbers)); + } + } + else + pComp->Value(mkParAdapt(prototype, numbers)); pComp->Separator(StdCompiler::SEP_SEP2); pComp->Value(mkParAdapt(Properties, numbers)); + if (oldFormat) + { + if (Properties.Has(&::Strings.P[P_Prototype])) + { + prototype = Properties.Get(&::Strings.P[P_Prototype]).Value; + Properties.Remove(&::Strings.P[P_Prototype]); + } + } + for(C4PropList * it = GetPrototype(); it; it = it->GetPrototype()) + if(it == this) + { + prototype.Set0(); + pComp->excCorrupt("Cyclic prototype structure"); + } } void CompileNewFunc(C4PropList *&pStruct, StdCompiler *pComp, C4ValueNumbers * const & rPar) @@ -400,43 +428,43 @@ void C4PropList::SetName(const char* NewName) C4Object * C4PropList::GetObject() { - if (prototype) return prototype->GetObject(); + if (GetPrototype()) return GetPrototype()->GetObject(); return 0; } C4Def * C4PropList::GetDef() { - if (prototype) return prototype->GetDef(); + if (GetPrototype()) return GetPrototype()->GetDef(); return 0; } C4Def const * C4PropList::GetDef() const { - if (prototype) return prototype->GetDef(); + if (GetPrototype()) return GetPrototype()->GetDef(); return 0; } class C4MapScriptLayer * C4PropList::GetMapScriptLayer() { - if (prototype) return prototype->GetMapScriptLayer(); + if (GetPrototype()) return GetPrototype()->GetMapScriptLayer(); return NULL; } class C4MapScriptMap * C4PropList::GetMapScriptMap() { - if (prototype) return prototype->GetMapScriptMap(); + if (GetPrototype()) return GetPrototype()->GetMapScriptMap(); return NULL; } C4PropListNumbered * C4PropList::GetPropListNumbered() { - if (prototype) return prototype->GetPropListNumbered(); + if (GetPrototype()) return GetPrototype()->GetPropListNumbered(); return 0; } C4Effect * C4PropList::GetEffect() { - if (prototype) return prototype->GetEffect(); + if (GetPrototype()) return GetPrototype()->GetEffect(); return 0; } @@ -479,8 +507,13 @@ bool C4PropList::GetPropertyByS(C4String * k, C4Value *pResult) const *pResult = Properties.Get(k).Value; return true; } - else if(prototype) - return prototype->GetPropertyByS(k, pResult); + else if (k == &Strings.P[P_Prototype]) + { + *pResult = prototype; + return true; + } + else if(GetPrototype()) + return GetPrototype()->GetPropertyByS(k, pResult); else return false; } @@ -492,9 +525,9 @@ C4String * C4PropList::GetPropertyStr(C4PropertyName n) const { return Properties.Get(k).Value.getStr(); } - if (prototype) + if (GetPrototype()) { - return prototype->GetPropertyStr(n); + return GetPrototype()->GetPropertyStr(n); } return 0; } @@ -506,9 +539,9 @@ C4AulFunc * C4PropList::GetFunc(C4String * k) const { return Properties.Get(k).Value.getFunction(); } - if (prototype) + if (GetPrototype()) { - return prototype->GetFunc(k); + return GetPrototype()->GetFunc(k); } return 0; } @@ -551,9 +584,9 @@ C4PropertyName C4PropList::GetPropertyP(C4PropertyName n) const return C4PropertyName(v - &Strings.P[0]); return P_LAST; } - if (prototype) + if (GetPrototype()) { - return prototype->GetPropertyP(n); + return GetPrototype()->GetPropertyP(n); } return P_LAST; } @@ -565,9 +598,9 @@ int32_t C4PropList::GetPropertyInt(C4PropertyName n) const { return Properties.Get(k).Value.getInt(); } - if (prototype) + if (GetPrototype()) { - return prototype->GetPropertyInt(n); + return GetPrototype()->GetPropertyInt(n); } return 0; } @@ -579,9 +612,9 @@ C4PropList *C4PropList::GetPropertyPropList(C4PropertyName n) const { return Properties.Get(k).Value.getPropList(); } - if (prototype) + if (GetPrototype()) { - return prototype->GetPropertyPropList(n); + return GetPrototype()->GetPropertyPropList(n); } return NULL; } @@ -590,9 +623,9 @@ C4ValueArray * C4PropList::GetProperties() const { C4ValueArray * a; int i; - if (prototype) + if (GetPrototype()) { - a = prototype->GetProperties(); + a = GetPrototype()->GetProperties(); i = a->GetSize(); a->SetSize(i + Properties.GetSize()); } @@ -626,16 +659,15 @@ void C4PropList::SetPropertyByS(C4String * k, const C4Value & to) { assert(!constant); /*assert(Strings.Set.Has(k));*/ - if (k == &Strings.P[P_Prototype] && to.GetType() == C4V_PropList) + if (k == &Strings.P[P_Prototype]) { - C4PropList * newpt = to.GetData().PropList; - for(C4PropList * it = newpt; it; it = it->prototype) + C4PropList * newpt = to.getPropList(); + for(C4PropList * it = newpt; it; it = it->GetPrototype()) if(it == this) throw new C4AulExecError("Trying to create cyclic prototype structure"); - prototype = newpt; - //return; + prototype.SetPropList(newpt); } - if (Properties.Has(k)) + else if (Properties.Has(k)) { Properties.Get(k).Value = to; } @@ -657,7 +689,10 @@ void C4PropList::SetPropertyByS(C4String * k, const C4Value & to) void C4PropList::ResetProperty(C4String * k) { - Properties.Remove(k); + if (k == &Strings.P[P_Prototype]) + prototype.Set0(); + else + Properties.Remove(k); } void C4PropList::Iterator::Init() @@ -690,9 +725,9 @@ C4PropList::Iterator C4PropList::begin() { C4PropList::Iterator iter; - if (prototype) + if (GetPrototype()) { - iter = prototype->begin(); + iter = GetPrototype()->begin(); } else { diff --git a/src/script/C4PropList.h b/src/script/C4PropList.h index 04d5ac255..48e569566 100644 --- a/src/script/C4PropList.h +++ b/src/script/C4PropList.h @@ -67,7 +67,7 @@ class C4PropListNumbered; class C4PropList { public: - void Clear() { constant = false; Properties.Clear(); prototype = 0; } + void Clear() { constant = false; Properties.Clear(); prototype.Set0(); } const char *GetName() const; virtual void SetName (const char *NewName = 0); @@ -77,10 +77,11 @@ public: virtual C4Object * GetObject(); virtual C4Effect * GetEffect(); virtual C4PropListNumbered * GetPropListNumbered(); - C4PropList * GetPrototype() const { return prototype; } virtual class C4MapScriptLayer * GetMapScriptLayer(); virtual class C4MapScriptMap * GetMapScriptMap(); + C4PropList * GetPrototype() const { return prototype._getPropList(); } + // saved as a reference to a global constant? virtual class C4PropListStatic * IsStatic() { return NULL; } // saved as a reference to separately saved objects? @@ -146,7 +147,7 @@ private: void DelRef(const C4Value *pRef, C4Value * pNextRef); C4Value *FirstRef; // No-Save C4Set Properties; - C4PropList * prototype; + C4Value prototype; bool constant; // if true, this proplist is not changeable friend class C4Value; friend class C4ScriptHost; diff --git a/src/script/C4Script.cpp b/src/script/C4Script.cpp index 6e289e009..ab982cd47 100644 --- a/src/script/C4Script.cpp +++ b/src/script/C4Script.cpp @@ -67,13 +67,6 @@ StdStrBuf FnStringFormat(C4PropList * _this, C4String *szFormatPar, C4Value * Pa } // C4ID case 'i': - { - if (cPar >= ParCount) throw new C4AulExecError("format placeholder without parameter"); - C4ID id = Pars[cPar++].getC4ID(); - StringBuf.Append(id.ToString()); - cpFormat+=SLen(szField); - break; - } // C4Value case 'v': { @@ -211,7 +204,7 @@ static C4ValueArray * FnGetProperties(C4PropList * _this, C4PropList * p) static C4Value FnCall(C4PropList * _this, C4Value * Pars) { if (!_this) _this = ::ScriptEngine.GetPropList(); - C4AulParSet ParSet(&Pars[1], 9); + C4AulParSet ParSet(&Pars[1], C4AUL_MAX_Par - 1); C4AulFunc * fn = Pars[0].getFunction(); C4String * name; if (!fn) @@ -231,6 +224,7 @@ static C4Value FnCall(C4PropList * _this, C4Value * Pars) } if (!fn) throw new C4AulExecError(FormatString("Call: no function %s", Pars[0].GetDataString().getData()).getData()); + fn->CheckParTypes(ParSet.Par); return fn->Exec(_this, &ParSet, true); } @@ -251,11 +245,6 @@ static C4Value FnFormat(C4PropList * _this, C4Value * Pars) return C4VString(FnStringFormat(_this, Pars[0].getStr(), &Pars[1], 9)); } -static C4ID FnC4Id(C4PropList * _this, C4String *szID) -{ - return(C4ID(FnStringPar(szID))); -} - static long FnAbs(C4PropList * _this, long iVal) { return Abs(iVal); @@ -414,13 +403,19 @@ static int FnGetIndexOf(C4PropList * _this, C4ValueArray * pArray, const C4Value if (!pArray) return -1; int32_t iSize = pArray->GetSize(); for (int32_t i = 0; i < iSize; ++i) - if (Needle == pArray->GetItem(i)) + if (Needle.IsIdenticalTo(pArray->GetItem(i))) // element found return i; // element not found return -1; } +static bool FnDeepEqual(C4PropList * _this, const C4Value & v1, const C4Value & v2) +{ + // return if v1==v2 with deep comparison on arrays and proplists + return v1 == v2; +} + static C4Void FnSetLength(C4PropList * _this, C4ValueArray *pArray, int iNewSize) { // safety @@ -532,16 +527,12 @@ static bool FnStartCallTrace(C4PropList * _this) return true; } -static bool FnStartScriptProfiler(C4PropList * _this, C4ID idScript) +static bool FnStartScriptProfiler(C4PropList * _this, C4Def * pDef) { // get script to profile C4AulScript *pScript; - if (idScript) - { - C4Def *pDef = C4Id2Def(idScript); - if (!pDef) return false; + if (pDef) pScript = &pDef->Script; - } else pScript = &::ScriptEngine; // profile it @@ -676,7 +667,6 @@ void InitCoreFunctionMap(C4AulScriptEngine *pEngine) F(GetProperty); F(SetProperty); F(ResetProperty); - F(C4Id); F(Distance); F(Angle); F(GetChar); @@ -686,6 +676,7 @@ void InitCoreFunctionMap(C4AulScriptEngine *pEngine) F(GetLength); F(SetLength); F(GetIndexOf); + F(DeepEqual); F(FatalError); F(StartCallTrace); F(StartScriptProfiler); diff --git a/src/script/C4ScriptHost.cpp b/src/script/C4ScriptHost.cpp index 77b497a93..97edef95f 100644 --- a/src/script/C4ScriptHost.cpp +++ b/src/script/C4ScriptHost.cpp @@ -167,7 +167,7 @@ bool C4DefScriptHost::Parse() case C4D_Living | C4D_Foreground: Plane = 1400; break; case C4D_Object | C4D_Foreground: Plane = 1500; break; default: - Warn("Def %s (%s) has invalid category", Def->GetName(), Def->id.ToString()); + Warn("Def %s (%s) has invalid category", Def->GetName(), Def->GetDataString().getData()); gotplane = false; break; } @@ -175,7 +175,7 @@ bool C4DefScriptHost::Parse() } if (!Def->GetPlane()) { - Warn("Def %s (%s) has invalid Plane", Def->GetName(), Def->id.ToString()); + Warn("Def %s (%s) has invalid Plane", Def->GetName(), Def->GetDataString().getData()); Def->SetProperty(P_Plane, C4VInt(1)); } return r; @@ -213,7 +213,7 @@ bool C4GameScriptHost::Load(C4Group & g, const char * f, const char * l, C4LangS C4PropListStatic * pScen = new C4PropListScen(NULL, &::Strings.P[P_Scenario]); ScenPropList.SetPropList(pScen); ::ScriptEngine.RegisterGlobalConstant("Scenario", ScenPropList); - ScenPrototype.SetPropList(pScen->GetPropertyPropList(P_Prototype)); + ScenPrototype.SetPropList(pScen->GetPrototype()); Reg2List(&ScriptEngine); return C4ScriptHost::Load(g, f, l, t); } diff --git a/src/script/C4ScriptHost.h b/src/script/C4ScriptHost.h index 6b9700f40..0a6cc47c6 100644 --- a/src/script/C4ScriptHost.h +++ b/src/script/C4ScriptHost.h @@ -48,8 +48,8 @@ protected: virtual void UnLink(); // reset to unlinked state - std::list Includes; // include list - std::list Appends; // append list + std::list Includes; // include list + std::list Appends; // append list virtual void AddEngineFunctions() {}; // add any engine functions specific to this script host void CopyPropList(C4Set & from, C4PropListStatic * to); diff --git a/src/script/C4ScriptStandalone.cpp b/src/script/C4ScriptStandalone.cpp index 97f4a3c92..f04f60e2e 100644 --- a/src/script/C4ScriptStandalone.cpp +++ b/src/script/C4ScriptStandalone.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef _DEBUG C4Set C4PropList::PropLists; @@ -46,7 +47,7 @@ const char * C4Config::AtRelativePath(char const*s) {return s;} C4DefList Definitions; C4DefList::C4DefList() {} C4DefList::~C4DefList() {} -C4Def* C4DefList::ID2Def(C4ID id) {return NULL;} +C4Def* C4DefList::GetByName(const StdStrBuf &) {return NULL;} C4Def * C4DefList::GetDef(int) {return 0;} int C4DefList::GetDefCount() {return 0;} void C4DefList::CallEveryDefinition() {} @@ -109,6 +110,9 @@ int c4s_runscript(const char * filename) { InitCoreFunctionMap(&ScriptEngine); + // Seed PRNG + FixedRandom(time(NULL)); + C4Group File; if (!File.Open(GetWorkingDirectory())) { diff --git a/src/script/C4StringTable.cpp b/src/script/C4StringTable.cpp index a42262441..6e2758a4f 100644 --- a/src/script/C4StringTable.cpp +++ b/src/script/C4StringTable.cpp @@ -142,6 +142,7 @@ C4StringTable::C4StringTable() P[P_Blasted] = "Blasted"; P[P_IncineratingObj] = "IncineratingObj"; P[P_Plane] = "Plane"; + P[P_SolidMaskPlane] = "SolidMaskPlane"; P[P_Tooltip] = "Tooltip"; P[P_Placement] = "Placement"; P[P_BlastIncinerate] = "BlastIncinerate"; diff --git a/src/script/C4StringTable.h b/src/script/C4StringTable.h index 5c5750d6d..ebdb6595c 100644 --- a/src/script/C4StringTable.h +++ b/src/script/C4StringTable.h @@ -348,6 +348,7 @@ enum C4PropertyName P_Blasted, // unused? P_IncineratingObj, // unused? P_Plane, + P_SolidMaskPlane, P_Tooltip, P_Placement, P_BlastIncinerate, diff --git a/src/script/C4Value.cpp b/src/script/C4Value.cpp index c1f9be11b..34cbec18a 100644 --- a/src/script/C4Value.cpp +++ b/src/script/C4Value.cpp @@ -74,6 +74,16 @@ C4Object * C4Value::_getObj() const return Data.PropList ? Data.PropList->GetObject() : NULL; } +C4Def * C4Value::getDef() const +{ + return CheckConversion(C4V_Def) ? Data.PropList->GetDef() : NULL; +} + +C4Def * C4Value::_getDef() const +{ + return Data.PropList ? Data.PropList->GetDef() : NULL; +} + C4Value C4VObj(C4Object *pObj) { return C4Value(static_cast(pObj)); } bool C4Value::FnCnvObject() const @@ -564,15 +574,6 @@ bool C4Value::operator != (const C4Value& Value2) const return !(*this == Value2); } -C4ID C4Value::getC4ID() const -{ - C4PropList * p = getPropList(); - if (!p) return C4ID::None; - C4Def * d = p->GetDef(); - if (!d) return C4ID::None; - return d->id; -} - void C4Value::LogDeletedObjectWarning(C4PropList * p) { if (p->GetPropListNumbered()) diff --git a/src/script/C4Value.h b/src/script/C4Value.h index 58f6169a9..0d34cc461 100644 --- a/src/script/C4Value.h +++ b/src/script/C4Value.h @@ -90,8 +90,8 @@ public: // Checked getters int32_t getInt() const { return CheckConversion(C4V_Int) ? Data.Int : 0; } bool getBool() const { return CheckConversion(C4V_Bool) ? !! Data : 0; } - C4ID getC4ID() const; C4Object * getObj() const; + C4Def * getDef() const; C4PropList * getPropList() const { return CheckConversion(C4V_PropList) ? Data.PropList : NULL; } C4String * getStr() const { return CheckConversion(C4V_String) ? Data.Str : NULL; } C4ValueArray * getArray() const { return CheckConversion(C4V_Array) ? Data.Array : NULL; } @@ -101,6 +101,7 @@ public: int32_t _getInt() const { return Data.Int; } bool _getBool() const { return !! Data.Int; } C4Object *_getObj() const; + C4Def *_getDef() const; C4String *_getStr() const { return Data.Str; } C4ValueArray *_getArray() const { return Data.Array; } C4AulFunc *_getFunction() const { return Data.Fn; } @@ -124,6 +125,9 @@ public: bool operator == (const C4Value& Value2) const; bool operator != (const C4Value& Value2) const; + // Identical comparison + bool IsIdenticalTo(const C4Value &cmp) const { return GetType()==cmp.GetType() && GetData()==cmp.GetData(); } + // Change and set Type to int in case it was nil or bool before C4Value & operator += (int32_t by) { Data.Int += by; Type=C4V_Int; return *this; } C4Value & operator -= (int32_t by) { Data.Int -= by; Type=C4V_Int; return *this; }