merged master into Controls
Conflicts: planet/Objects.ocd/Libraries.ocd/Structure.ocd/Script.cControls
|
@ -4,9 +4,10 @@ autom4te.cache
|
|||
.deps
|
||||
deps
|
||||
*.o
|
||||
./clonk
|
||||
./netpuncher
|
||||
./c4group
|
||||
/clonk
|
||||
/netpuncher
|
||||
/c4group
|
||||
/c4script
|
||||
.dirstamp
|
||||
*.a
|
||||
*.c4p
|
||||
|
@ -107,8 +108,6 @@ BuildLog.htm
|
|||
xcode/build
|
||||
*.xcodeproj
|
||||
|
||||
.anjuta*
|
||||
|
||||
# Binaries
|
||||
*.app
|
||||
*.exe
|
||||
|
@ -120,11 +119,16 @@ planet/nohg*
|
|||
planet/.project
|
||||
|
||||
# Code::Blocks files
|
||||
clonk.layout
|
||||
clonk.sdf
|
||||
clonk.cbp
|
||||
openclonk.layout
|
||||
openclonk.sdf
|
||||
openclonk.cbp
|
||||
|
||||
# MacOSX saved searches
|
||||
*.savedSearch
|
||||
planet/OpenClonk.bat
|
||||
planet/openclonk.sln
|
||||
WindowsGamesExplorer.xml
|
||||
|
||||
# Mape
|
||||
mape
|
||||
mape-icons.h
|
||||
|
|
468
CMakeLists.txt
|
@ -40,6 +40,13 @@ separate_arguments(OC_EXE_LINKER_FLAGS)
|
|||
set(OC_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG})
|
||||
separate_arguments(OC_EXE_LINKER_FLAGS_DEBUG)
|
||||
|
||||
function(unseparate_arguments _var _list)
|
||||
foreach(_arg ${_list})
|
||||
set(_string "${_string} ${_arg}")
|
||||
endforeach()
|
||||
set(${_var} "${_string}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
############################################################################
|
||||
# User selectable options
|
||||
############################################################################
|
||||
|
@ -162,23 +169,11 @@ endif()
|
|||
# configurations.
|
||||
set(OC_CLONK_SOURCES
|
||||
src/C4Globals.cpp
|
||||
src/c4group/C4ComponentHost.cpp
|
||||
src/c4group/C4ComponentHost.h
|
||||
src/c4group/C4Components.h
|
||||
src/c4group/C4Extra.cpp
|
||||
src/c4group/C4Extra.h
|
||||
src/c4group/C4Group.cpp
|
||||
src/c4group/C4Group.h
|
||||
src/c4group/C4GroupSet.cpp
|
||||
src/c4group/C4GroupSet.h
|
||||
src/c4group/C4LangStringTable.cpp
|
||||
src/c4group/C4LangStringTable.h
|
||||
src/c4group/C4Language.cpp
|
||||
src/c4group/C4Language.h
|
||||
src/c4group/C4Update.cpp
|
||||
src/c4group/C4Update.h
|
||||
src/c4group/CStdFile.cpp
|
||||
src/c4group/CStdFile.h
|
||||
src/C4Include.h
|
||||
src/C4Prototypes.h
|
||||
src/C4Version.h
|
||||
|
@ -248,6 +243,7 @@ set(OC_CLONK_SOURCES
|
|||
src/graphics/C4DrawGL.cpp
|
||||
src/graphics/C4DrawGLCtx.cpp
|
||||
src/graphics/C4DrawGL.h
|
||||
src/graphics/C4DrawMeshGL.cpp
|
||||
src/graphics/C4DrawT.cpp
|
||||
src/graphics/C4DrawT.h
|
||||
src/graphics/C4Draw.h
|
||||
|
@ -354,6 +350,7 @@ set(OC_CLONK_SOURCES
|
|||
src/landscape/C4PXS.cpp
|
||||
src/landscape/C4PXS.h
|
||||
src/landscape/C4Scenario.cpp
|
||||
src/landscape/C4ScenarioSection.cpp
|
||||
src/landscape/C4Scenario.h
|
||||
src/landscape/C4Sky.cpp
|
||||
src/landscape/C4Sky.h
|
||||
|
@ -363,20 +360,12 @@ set(OC_CLONK_SOURCES
|
|||
src/landscape/C4Texture.h
|
||||
src/landscape/C4Weather.cpp
|
||||
src/landscape/C4Weather.h
|
||||
src/lib/C4InputValidation.cpp
|
||||
src/lib/C4InputValidation.h
|
||||
src/lib/C4LogBuf.cpp
|
||||
src/lib/C4LogBuf.h
|
||||
src/lib/C4Log.cpp
|
||||
src/lib/C4Log.h
|
||||
src/lib/C4Markup.cpp
|
||||
src/lib/C4Markup.h
|
||||
src/lib/C4NameList.cpp
|
||||
src/lib/C4NameList.h
|
||||
src/lib/C4Random.cpp
|
||||
src/lib/C4Random.h
|
||||
src/lib/C4Real.cpp
|
||||
src/lib/C4Real.h
|
||||
src/lib/C4Rect.cpp
|
||||
src/lib/C4Rect.h
|
||||
src/lib/C4RTF.cpp
|
||||
|
@ -385,17 +374,10 @@ set(OC_CLONK_SOURCES
|
|||
src/lib/C4Stat.h
|
||||
src/lib/PathFinder.cpp
|
||||
src/lib/PathFinder.h
|
||||
src/lib/SHA1.h
|
||||
src/lib/Standard.cpp
|
||||
src/lib/Standard.h
|
||||
src/lib/StdAdaptors.h
|
||||
src/lib/StdBase64.cpp
|
||||
src/lib/StdBase64.h
|
||||
src/lib/StdBuf.cpp
|
||||
src/lib/StdBuf.h
|
||||
src/lib/StdColors.h
|
||||
src/lib/StdCompiler.cpp
|
||||
src/lib/StdCompiler.h
|
||||
src/lib/StdMesh.cpp
|
||||
src/lib/StdMesh.h
|
||||
src/lib/StdMeshLoaderBinaryChunks.cpp
|
||||
|
@ -410,8 +392,6 @@ set(OC_CLONK_SOURCES
|
|||
src/lib/StdMeshMath.h
|
||||
src/lib/StdMeshUpdate.cpp
|
||||
src/lib/StdMeshUpdate.h
|
||||
src/lib/StdResStr2.cpp
|
||||
src/lib/StdResStr2.h
|
||||
src/lib/StdResStr.h
|
||||
src/network/C4Client.cpp
|
||||
src/network/C4Client.h
|
||||
|
@ -421,8 +401,6 @@ set(OC_CLONK_SOURCES
|
|||
src/network/C4InteractiveThread.h
|
||||
src/network/C4League.cpp
|
||||
src/network/C4League.h
|
||||
src/network/C4NetIO.cpp
|
||||
src/network/C4NetIO.h
|
||||
src/network/C4Network2Client.cpp
|
||||
src/network/C4Network2Client.h
|
||||
src/network/C4Network2.cpp
|
||||
|
@ -458,8 +436,6 @@ 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
|
||||
|
@ -507,15 +483,8 @@ set(OC_CLONK_SOURCES
|
|||
src/platform/C4Video.h
|
||||
src/platform/C4Window.h
|
||||
src/platform/C4windowswrapper.h
|
||||
src/platform/GetTime.cpp
|
||||
src/platform/PlatformAbstraction.cpp
|
||||
src/platform/PlatformAbstraction.h
|
||||
src/platform/StdFile.cpp
|
||||
src/platform/StdFile.h
|
||||
src/platform/StdRegistry.cpp
|
||||
src/platform/StdRegistry.h
|
||||
src/platform/StdScheduler.cpp
|
||||
src/platform/StdScheduler.h
|
||||
src/platform/StdSync.h
|
||||
src/platform/StdVideo.cpp
|
||||
src/platform/StdVideo.h
|
||||
|
@ -525,37 +494,104 @@ set(OC_CLONK_SOURCES
|
|||
src/player/C4PlayerList.h
|
||||
src/player/C4RankSystem.cpp
|
||||
src/player/C4RankSystem.h
|
||||
src/script/C4Aul.cpp
|
||||
src/script/C4AulDebug.cpp
|
||||
src/script/C4AulDebug.h
|
||||
src/script/C4AulDefFunc.h
|
||||
src/script/C4AulExec.cpp
|
||||
src/script/C4AulExec.h
|
||||
src/script/C4AulFunc.cpp
|
||||
src/script/C4AulFunc.h
|
||||
src/script/C4Aul.h
|
||||
src/script/C4AulLink.cpp
|
||||
src/script/C4AulParse.cpp
|
||||
src/script/C4PropList.cpp
|
||||
src/script/C4PropList.h
|
||||
src/script/C4Script.cpp
|
||||
src/script/C4ScriptHost.cpp
|
||||
src/script/C4ScriptHost.h
|
||||
src/script/C4StringTable.cpp
|
||||
src/script/C4StringTable.h
|
||||
src/script/C4ValueArray.cpp
|
||||
src/script/C4ValueArray.h
|
||||
src/script/C4Value.cpp
|
||||
src/script/C4Value.h
|
||||
src/script/C4ValueMap.cpp
|
||||
src/script/C4ValueMap.h
|
||||
src/zlib/gzio.c
|
||||
src/zlib/gzio.h
|
||||
src/zlib/zutil.h
|
||||
thirdparty/timsort/sort.h
|
||||
)
|
||||
|
||||
set(MAPE_BASE_SOURCES
|
||||
src/landscape/C4MapCreatorS2.cpp
|
||||
src/landscape/C4MapCreatorS2.h
|
||||
src/landscape/C4Material.cpp
|
||||
src/landscape/C4Material.h
|
||||
src/landscape/C4Texture.cpp
|
||||
src/landscape/C4Texture.h
|
||||
src/landscape/C4Scenario.cpp
|
||||
src/landscape/C4Scenario.h
|
||||
src/lib/C4NameList.cpp
|
||||
src/lib/C4NameList.h
|
||||
src/lib/C4Rect.cpp
|
||||
src/lib/C4Rect.h
|
||||
)
|
||||
|
||||
set(MAPE_SOURCES
|
||||
src/mape/cpp-handles/group-handle.h
|
||||
src/mape/cpp-handles/group-handle.cpp
|
||||
src/mape/cpp-handles/log-handle.h
|
||||
src/mape/cpp-handles/log-handle.cpp
|
||||
src/mape/cpp-handles/mapgen-handle.h
|
||||
src/mape/cpp-handles/mapgen-handle.cpp
|
||||
src/mape/cpp-handles/material-handle.h
|
||||
src/mape/cpp-handles/material-handle.cpp
|
||||
src/mape/cpp-handles/random-handle.h
|
||||
src/mape/cpp-handles/random-handle.cpp
|
||||
src/mape/cpp-handles/texture-handle.h
|
||||
src/mape/cpp-handles/texture-handle.cpp
|
||||
src/mape/cpp-handles/version-handle.h
|
||||
src/mape/cpp-handles/version-handle.cpp
|
||||
src/mape/cpp-handles/stub-handle.cpp
|
||||
src/mape/configfile.c
|
||||
src/mape/configfile.h
|
||||
src/mape/diskview.c
|
||||
src/mape/diskview.h
|
||||
src/mape/editview.c
|
||||
src/mape/editview.h
|
||||
src/mape/fileicon.c
|
||||
src/mape/fileicon.h
|
||||
src/mape/forward.h
|
||||
src/mape/group.c
|
||||
src/mape/group.h
|
||||
src/mape/header.c
|
||||
src/mape/header.h
|
||||
src/mape/iconview.c
|
||||
src/mape/iconview.h
|
||||
src/mape/mape.c
|
||||
src/mape/mapgen.c
|
||||
src/mape/mapgen.h
|
||||
src/mape/material.c
|
||||
src/mape/material.h
|
||||
src/mape/mattexview.c
|
||||
src/mape/mattexview.h
|
||||
src/mape/preferences.c
|
||||
src/mape/preferences.h
|
||||
src/mape/preferencesdialog.c
|
||||
src/mape/preferencesdialog.h
|
||||
src/mape/preview.c
|
||||
src/mape/preview.h
|
||||
src/mape/random.c
|
||||
src/mape/random.h
|
||||
src/mape/statusbar.c
|
||||
src/mape/statusbar.h
|
||||
src/mape/texture.c
|
||||
src/mape/texture.h
|
||||
src/mape/window.c
|
||||
src/mape/window.h
|
||||
)
|
||||
|
||||
mark_as_advanced(OC_CLONK_SOURCES)
|
||||
mark_as_advanced(OC_SYSTEM_SOURCES)
|
||||
mark_as_advanced(MAPE_SOURCES)
|
||||
|
||||
# generated source files
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mape-icons.h
|
||||
COMMAND
|
||||
gdk-pixbuf-csource "--raw" "--static" "--build-list"
|
||||
"mape_icon_ocd" "${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocd.ico"
|
||||
"mape_icon_ocf" "${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocf.ico"
|
||||
"mape_icon_ocg" "${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocg.ico"
|
||||
"mape_icon_ocm" "${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocm.ico"
|
||||
"mape_icon_ocs" "${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocs.ico"
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/mape-icons.h
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocd.ico
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocf.ico
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocg.ico
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocm.ico
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocs.ico
|
||||
VERBATIM
|
||||
)
|
||||
list(APPEND MAPE_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/mape-icons.h)
|
||||
|
||||
# source files specific to an operating system
|
||||
if(APPLE)
|
||||
|
@ -682,6 +718,7 @@ if(PROJECT_FOLDERS)
|
|||
source_group("Config" src/config/.*)
|
||||
source_group("Control" src/control/.*)
|
||||
source_group("Editing" src/editor/.*)
|
||||
source_group("Mape" src/mape/.*)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
|
@ -833,16 +870,31 @@ endif()
|
|||
if(USE_GTK)
|
||||
include(FindPkgConfig)
|
||||
if (USE_GTK3)
|
||||
pkg_check_modules(GTK3 REQUIRED "glib-2.0 >= 2.27.5" "gtk+-3.0 >= 2.99.0")
|
||||
pkg_check_modules(GTK3 REQUIRED "glib-2.0 >= 2.32" "gtk+-3.0 >= 3.4")
|
||||
include_directories(${GTK3_INCLUDE_DIRS})
|
||||
link_directories(${GTK3_LIBRARY_DIRS})
|
||||
else()
|
||||
pkg_check_modules(GTK REQUIRED "glib-2.0 >= 2.8" "gtk+-2.0 >= 2.8")
|
||||
pkg_check_modules(GTK REQUIRED "glib-2.0 >= 2.24" "gtk+-2.0 >= 2.20")
|
||||
include_directories(${GTK_INCLUDE_DIRS})
|
||||
link_directories(${GTK_LIBRARY_DIRS})
|
||||
endif()
|
||||
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)
|
||||
else()
|
||||
pkg_check_modules(MAPE_GTK glib-2.0>=2.24 gthread-2.0 gtk+-2.0>=2.20 gtksourceview-2.0)
|
||||
endif()
|
||||
endif()
|
||||
if(MAPE_GTK_FOUND)
|
||||
# hrm, cmake doesn't have target_include_directories...
|
||||
include_directories(${MAPE_GTK_INCLUDE_DIRS})
|
||||
link_directories(${MAPE_GTK_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
if(USE_OPEN_AL)
|
||||
if(MSVC)
|
||||
if(${FIND_LIBRARY_USE_LIB64_PATHS})
|
||||
|
@ -916,97 +968,121 @@ endif()
|
|||
# Generate output files
|
||||
############################################################################
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
add_executable(clonk WIN32 MACOSX_BUNDLE
|
||||
add_executable(openclonk WIN32 MACOSX_BUNDLE
|
||||
${OC_SYSTEM_SOURCES}
|
||||
${OC_CLONK_SOURCES}
|
||||
)
|
||||
|
||||
if(MAPE_GTK_FOUND)
|
||||
add_executable(mape ${MAPE_BASE_SOURCES} ${MAPE_SOURCES})
|
||||
unseparate_arguments(MAPE_GTK_CFLAGS "${MAPE_GTK_CFLAGS}")
|
||||
set_property(TARGET mape PROPERTY COMPILE_FLAGS "${MAPE_GTK_CFLAGS}")
|
||||
unseparate_arguments(MAPE_GTK_LDFLAGS "${MAPE_GTK_LDFLAGS}")
|
||||
set_property(TARGET mape PROPERTY LINK_FLAGS "${MAPE_GTK_LDFLAGS}")
|
||||
endif()
|
||||
|
||||
add_executable(c4group
|
||||
src/c4group/C4GroupMain.cpp
|
||||
src/c4group/C4Group.cpp
|
||||
src/lib/C4InputValidation.cpp
|
||||
src/c4group/C4Update.cpp
|
||||
src/lib/Standard.cpp
|
||||
src/c4group/CStdFile.cpp
|
||||
src/lib/C4Markup.cpp
|
||||
src/lib/StdBuf.cpp
|
||||
src/lib/StdCompiler.cpp
|
||||
src/platform/StdFile.cpp
|
||||
src/platform/StdRegistry.cpp
|
||||
src/lib/StdResStr2.cpp
|
||||
src/lib/C4SimpleLog.cpp
|
||||
src/zlib/gzio.c
|
||||
src/C4Include.cpp
|
||||
)
|
||||
|
||||
add_executable(netpuncher EXCLUDE_FROM_ALL
|
||||
src/C4Include.cpp
|
||||
src/lib/C4SimpleLog.cpp
|
||||
src/lib/StdBuf.cpp
|
||||
src/lib/Standard.cpp
|
||||
src/platform/GetTime.cpp
|
||||
src/platform/StdScheduler.cpp
|
||||
src/platform/StdFile.cpp
|
||||
src/network/C4NetIO.cpp
|
||||
src/netpuncher/main.cpp
|
||||
)
|
||||
|
||||
add_library(libmisc
|
||||
src/c4group/C4Group.cpp
|
||||
src/c4group/C4Group.h
|
||||
src/c4group/C4Update.cpp
|
||||
src/c4group/C4Update.h
|
||||
src/c4group/CStdFile.cpp
|
||||
src/c4group/CStdFile.h
|
||||
src/lib/C4InputValidation.cpp
|
||||
src/lib/C4InputValidation.h
|
||||
src/lib/SHA1.h
|
||||
src/lib/Standard.cpp
|
||||
src/lib/Standard.h
|
||||
src/lib/StdBuf.cpp
|
||||
src/lib/StdBuf.h
|
||||
src/lib/StdCompiler.cpp
|
||||
src/lib/StdCompiler.h
|
||||
src/lib/C4Markup.cpp
|
||||
src/lib/C4Markup.h
|
||||
src/lib/StdResStr2.cpp
|
||||
src/lib/StdResStr2.h
|
||||
src/network/C4NetIO.cpp
|
||||
src/network/C4NetIO.h
|
||||
src/platform/GetTime.cpp
|
||||
src/platform/StdFile.cpp
|
||||
src/platform/StdFile.h
|
||||
src/platform/StdRegistry.cpp
|
||||
src/platform/StdRegistry.h
|
||||
src/platform/StdScheduler.cpp
|
||||
src/platform/StdScheduler.h
|
||||
src/zlib/gzio.c
|
||||
src/zlib/gzio.h
|
||||
src/zlib/zutil.h
|
||||
|
||||
src/C4Include.cpp
|
||||
src/lib/C4SimpleLog.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(libmisc ${ZLIB_LIBRARIES})
|
||||
|
||||
add_library(libc4script
|
||||
src/c4group/C4GroupSet.cpp
|
||||
src/c4group/C4GroupSet.h
|
||||
src/c4group/C4ComponentHost.cpp
|
||||
src/c4group/C4ComponentHost.h
|
||||
src/c4group/C4LangStringTable.cpp
|
||||
src/c4group/C4LangStringTable.h
|
||||
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
|
||||
src/script/C4AulExec.h
|
||||
src/script/C4AulFunc.cpp
|
||||
src/script/C4AulFunc.h
|
||||
src/script/C4Aul.h
|
||||
src/script/C4AulLink.cpp
|
||||
src/script/C4AulParse.cpp
|
||||
src/script/C4PropList.cpp
|
||||
src/script/C4PropList.h
|
||||
src/script/C4Script.cpp
|
||||
src/script/C4ScriptHost.cpp
|
||||
src/script/C4ScriptHost.h
|
||||
src/script/C4StringTable.cpp
|
||||
src/script/C4StringTable.h
|
||||
src/script/C4ValueArray.cpp
|
||||
src/script/C4ValueArray.h
|
||||
src/script/C4Value.cpp
|
||||
src/script/C4Value.h
|
||||
src/script/C4ValueMap.cpp
|
||||
src/script/C4ValueMap.h
|
||||
)
|
||||
|
||||
add_executable(c4script
|
||||
include/c4script/c4script.h
|
||||
src/c4group/C4Group.cpp
|
||||
src/c4group/C4Group.h
|
||||
src/c4group/CStdFile.cpp
|
||||
src/c4group/CStdFile.h
|
||||
src/lib/C4InputValidation.cpp
|
||||
src/lib/C4InputValidation.h
|
||||
src/lib/C4SimpleLog.cpp
|
||||
src/lib/Standard.cpp
|
||||
src/lib/Standard.h
|
||||
src/lib/StdBuf.cpp
|
||||
src/lib/StdBuf.h
|
||||
src/lib/StdCompiler.cpp
|
||||
src/lib/StdCompiler.h
|
||||
src/lib/C4Markup.cpp
|
||||
src/lib/C4Markup.h
|
||||
src/lib/StdResStr2.cpp
|
||||
src/lib/StdResStr2.h
|
||||
src/platform/GetTime.cpp
|
||||
src/platform/StdFile.cpp
|
||||
src/platform/StdFile.h
|
||||
src/lib/C4Real.cpp
|
||||
src/lib/C4Random.cpp
|
||||
src/script/C4Aul.cpp
|
||||
src/script/C4AulExec.cpp
|
||||
src/script/C4AulFunc.cpp
|
||||
src/script/C4AulLink.cpp
|
||||
src/script/C4AulParse.cpp
|
||||
src/script/C4StringTable.cpp
|
||||
src/script/C4PropList.cpp
|
||||
src/script/C4ScriptHost.cpp
|
||||
src/script/C4ScriptMain.cpp
|
||||
src/script/C4ScriptStandalone.cpp
|
||||
src/script/C4ValueArray.cpp
|
||||
src/script/C4Value.cpp
|
||||
src/script/C4ValueMap.cpp
|
||||
src/object/C4Id.cpp
|
||||
src/script/C4Script.cpp
|
||||
src/c4group/C4GroupSet.cpp
|
||||
src/c4group/C4ComponentHost.cpp
|
||||
src/c4group/C4LangStringTable.cpp
|
||||
src/zlib/gzio.c
|
||||
src/C4Include.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
${FREETYPE_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
${JPEG_LIBRARIES}
|
||||
${ICONV_LIBRARY}
|
||||
libc4script
|
||||
libmisc
|
||||
)
|
||||
|
||||
if(USE_OPEN_AL)
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
${OPENAL_LIBRARY}
|
||||
${ALUT_LIBRARY}
|
||||
${VORBIS_LIBRARY}
|
||||
|
@ -1014,11 +1090,25 @@ if(USE_OPEN_AL)
|
|||
${OGG_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(c4group
|
||||
${ZLIB_LIBRARIES}
|
||||
|
||||
if(MAPE_GTK_FOUND)
|
||||
target_link_libraries(mape
|
||||
libc4script
|
||||
libmisc
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(netpuncher
|
||||
libmisc
|
||||
)
|
||||
|
||||
target_link_libraries(c4group
|
||||
libmisc
|
||||
)
|
||||
|
||||
target_link_libraries(c4script
|
||||
${ZLIB_LIBRARIES}
|
||||
libc4script
|
||||
libmisc
|
||||
)
|
||||
if(HAVE_PTHREAD)
|
||||
target_link_libraries(netpuncher
|
||||
|
@ -1027,9 +1117,14 @@ if(HAVE_PTHREAD)
|
|||
target_link_libraries(c4script
|
||||
pthread
|
||||
)
|
||||
if(MAPE_GTK_FOUND)
|
||||
target_link_libraries(mape
|
||||
pthread
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
if(USE_CONSOLE)
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
pthread
|
||||
${READLINE_LIBRARIES}
|
||||
)
|
||||
|
@ -1038,14 +1133,17 @@ if(UNIX AND NOT APPLE)
|
|||
target_link_libraries(c4group rt)
|
||||
target_link_libraries(c4script rt)
|
||||
target_link_libraries(netpuncher rt)
|
||||
target_link_libraries(clonk rt)
|
||||
target_link_libraries(openclonk rt)
|
||||
if(MAPE_GTK_FOUND)
|
||||
target_link_libraries(mape rt)
|
||||
endif()
|
||||
endif()
|
||||
set_property(TARGET clonk APPEND PROPERTY COMPILE_DEFINITIONS GLEW_STATIC)
|
||||
set_property(TARGET openclonk APPEND PROPERTY COMPILE_DEFINITIONS GLEW_STATIC)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _DEBUG)
|
||||
|
||||
# This expands some variables in Info.plist as a side-effect. XCode might then
|
||||
# expand a second time, using the same syntax. Try not to get confused by this!
|
||||
set_target_properties(clonk PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/src/res/Info.plist")
|
||||
set_target_properties(openclonk PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/src/res/Info.plist")
|
||||
|
||||
if(MSVC)
|
||||
# set target output filenames to a per-configuration value
|
||||
|
@ -1059,7 +1157,7 @@ if(MSVC)
|
|||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
oc_set_target_names(clonk)
|
||||
oc_set_target_names(openclonk)
|
||||
oc_set_target_names(c4group)
|
||||
oc_set_target_names(c4script)
|
||||
oc_set_target_names(netpuncher)
|
||||
|
@ -1070,7 +1168,7 @@ endif()
|
|||
############################################################################
|
||||
if(HAVE_PRECOMPILED_HEADERS)
|
||||
if(MSVC_VERSION)
|
||||
get_property(OC_SOURCES TARGET clonk PROPERTY SOURCES)
|
||||
get_property(OC_SOURCES TARGET openclonk PROPERTY SOURCES)
|
||||
foreach(FILE ${OC_SOURCES})
|
||||
get_filename_component(FILE_EXT ${FILE} EXT)
|
||||
get_filename_component(FILE_NAME_WE ${FILE} NAME_WE)
|
||||
|
@ -1131,7 +1229,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||
option(USE_GCC_PCH "Use GCC precompiled headers" ON)
|
||||
endif()
|
||||
if(USE_GCC_PCH)
|
||||
add_precompiled_header(clonk src/C4Include.h)
|
||||
add_precompiled_header(openclonk src/C4Include.h)
|
||||
add_precompiled_header(c4group src/C4Include.h)
|
||||
add_precompiled_header(c4script src/C4Include.h)
|
||||
endif()
|
||||
|
@ -1141,20 +1239,20 @@ endif()
|
|||
############################################################################
|
||||
|
||||
if (APPLE)
|
||||
add_custom_command(TARGET clonk
|
||||
add_custom_command(TARGET openclonk
|
||||
POST_BUILD COMMAND "/usr/bin/ruby" "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_bundle_libs"
|
||||
)
|
||||
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/C4Include.h")
|
||||
|
||||
SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES)
|
||||
SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++ objective-c++")
|
||||
SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/C4Include.h")
|
||||
SET_TARGET_PROPERTIES(openclonk PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES)
|
||||
SET_TARGET_PROPERTIES(openclonk PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++ objective-c++")
|
||||
SET_TARGET_PROPERTIES(openclonk PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/C4Include.h")
|
||||
SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES)
|
||||
SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++ objective-c++")
|
||||
SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/C4Include.h")
|
||||
SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
|
||||
SET_TARGET_PROPERTIES(openclonk PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
|
||||
|
||||
if (USE_APPLE_CLANG)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
|
||||
|
@ -1162,7 +1260,7 @@ if (APPLE)
|
|||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++0x -stdlib=libc++ -g -Wall")
|
||||
SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++0x objective-c++0x")
|
||||
SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++0x objective-c++0x")
|
||||
SET_TARGET_PROPERTIES(openclonk PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++0x objective-c++0x")
|
||||
|
||||
set(HAVE_RVALUE_REF ON)
|
||||
else()
|
||||
|
@ -1177,12 +1275,12 @@ CHECK_INCLUDE_FILE_CXX(getopt.h HAVE_GETOPT_H)
|
|||
if(NOT HAVE_GETOPT_H)
|
||||
include_directories(thirdparty/getopt)
|
||||
add_subdirectory(thirdparty/getopt)
|
||||
target_link_libraries(clonk getopt)
|
||||
target_link_libraries(openclonk getopt)
|
||||
elseif(MINGW)
|
||||
# Link libiberty which my contain getopt with mingw
|
||||
FINDLIB(iberty_LIBRARIES iberty)
|
||||
if(iberty_LIBRARIES)
|
||||
target_link_libraries(clonk iberty)
|
||||
target_link_libraries(openclonk iberty)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -1190,12 +1288,12 @@ CHECK_INCLUDE_FILE_CXX(getopt.h HAVE_GETOPT_H)
|
|||
|
||||
# TinyXML
|
||||
add_subdirectory(thirdparty/tinyxml)
|
||||
target_link_libraries(clonk tinyxml)
|
||||
target_link_libraries(openclonk tinyxml)
|
||||
|
||||
if(WIN32)
|
||||
find_package(DbgHelp)
|
||||
if(DBGHELP_FOUND)
|
||||
target_link_libraries(clonk ${DBGHELP_LIBRARIES})
|
||||
target_link_libraries(openclonk ${DBGHELP_LIBRARIES})
|
||||
include_directories(${DBGHELP_INCLUDE_DIR})
|
||||
endif()
|
||||
set(HAVE_DBGHELP ${DBGHELP_FOUND})
|
||||
|
@ -1205,7 +1303,7 @@ if(USE_GL)
|
|||
include(FindOpenGL)
|
||||
FINDLIB(GLEW_LIBRARIES NAMES GLEW glew32 glew32s)
|
||||
FIND_PATH(GLEW_INCLUDE_DIR NAMES GL/glew.h)
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
${GLEW_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
)
|
||||
|
@ -1216,7 +1314,7 @@ if(USE_DIRECTX)
|
|||
FINDLIB(DIRECT3DX_LIBRARIES d3dx9)
|
||||
FIND_PATH(DIRECT3D_INCLUDE_DIR NAMES d3d9.h)
|
||||
FIND_PATH(DIRECT3DX_INCLUDE_DIR NAMES d3dx9.h)
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
${DIRECT3D_LIBRARIES}
|
||||
${DIRECT3DX_LIBRARIES}
|
||||
)
|
||||
|
@ -1229,26 +1327,29 @@ if(USE_GTK)
|
|||
SET(WITH_DEVELOPER_MODE ${GTK_FOUND})
|
||||
SET(WITH_GLIB ${GTK_FOUND})
|
||||
if(USE_GTK3)
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
${GTK3_LIBRARIES}
|
||||
)
|
||||
else()
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
${GTK_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
if(MAPE_GTK_FOUND)
|
||||
target_link_libraries(mape ${MAPE_GTK_LIBRARIES})
|
||||
endif()
|
||||
if(USE_X11)
|
||||
FINDLIB(X11_LIBRARIES X11)
|
||||
FINDLIB(XRANDR_LIBRARIES Xrandr)
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
${X11_LIBRARIES}
|
||||
${XRANDR_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
if(USE_COCOA)
|
||||
#stupid fix: just link to iconv that way
|
||||
TARGET_LINK_LIBRARIES(clonk "-framework Cocoa -framework AppKit -framework Quartz -framework OpenAL -framework AudioToolBox -liconv")
|
||||
TARGET_LINK_LIBRARIES(openclonk "-framework Cocoa -framework AppKit -framework Quartz -framework OpenAL -framework AudioToolBox -liconv")
|
||||
endif()
|
||||
if (WIN32)
|
||||
# CMake is too incompetent to check whether these libraries can be linked to
|
||||
|
@ -1256,23 +1357,26 @@ if (WIN32)
|
|||
FINDLIB(VFW32_LIBRARIES vfw32)
|
||||
FINDLIB(wavifil32_LIBRARIES wavifil32)
|
||||
if (VFW32_LIBRARIES)
|
||||
target_link_libraries(clonk vfw32)
|
||||
target_link_libraries(openclonk vfw32)
|
||||
set(HAVE_VFW32 TRUE)
|
||||
elseif(wavifil32_LIBRARIES)
|
||||
target_link_libraries(clonk wavifil32 msvfw32)
|
||||
target_link_libraries(openclonk wavifil32 msvfw32)
|
||||
set(HAVE_VFW32 TRUE)
|
||||
endif()
|
||||
|
||||
target_link_libraries(clonk ws2_32 winmm)
|
||||
target_link_libraries(openclonk ws2_32 winmm)
|
||||
target_link_libraries(c4group ws2_32)
|
||||
target_link_libraries(netpuncher ws2_32 winmm)
|
||||
target_link_libraries(c4script ws2_32 winmm)
|
||||
if(MAPE_GTK_FOUND)
|
||||
target_link_libraries(mape winmm)
|
||||
endif()
|
||||
|
||||
if(NOT USE_OPEN_AL)
|
||||
find_package(FMod)
|
||||
if(FMOD_FOUND)
|
||||
set(HAVE_FMOD TRUE)
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
${FMOD_LIBRARIES}
|
||||
)
|
||||
include_directories(${FMOD_INCLUDE_DIR})
|
||||
|
@ -1290,7 +1394,7 @@ if(NOT HAVE_FMOD AND NOT USE_OPEN_AL OR USE_SDL_MAINLOOP AND NOT USE_OPEN_AL)
|
|||
if(SDLMIXER_LIBRARIES)
|
||||
SET(HAVE_LIBSDL_MIXER ON)
|
||||
endif()
|
||||
target_link_libraries(clonk
|
||||
target_link_libraries(openclonk
|
||||
${SDL_LIBRARY}
|
||||
${SDLMIXER_LIBRARIES}
|
||||
)
|
||||
|
@ -1299,22 +1403,10 @@ endif()
|
|||
|
||||
if(HAVE_UPNP)
|
||||
include_directories(${UPNP_INCLUDE_DIR})
|
||||
target_link_libraries(clonk ${UPNP_LIBRARIES})
|
||||
target_link_libraries(openclonk ${UPNP_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# GTest
|
||||
include(FindGTest)
|
||||
if(GTEST_FOUND)
|
||||
include_directories(${GTEST_INCLUDE_DIRS})
|
||||
add_executable(tests EXCLUDE_FROM_ALL
|
||||
tests/UnicodeHandlingTest.cpp
|
||||
tests/main.cpp
|
||||
)
|
||||
target_link_libraries(tests ${GTEST_LIBRARIES})
|
||||
if(HAVE_PTHREAD)
|
||||
target_link_libraries(tests pthread)
|
||||
endif()
|
||||
endif()
|
||||
add_subdirectory(tests EXCLUDE_FROM_ALL)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
|
@ -1329,7 +1421,7 @@ endif()
|
|||
############################################################################
|
||||
# installation
|
||||
############################################################################
|
||||
# Install the icon into share/icons/hicolor/48x48/apps/clonk.png. Do this by
|
||||
# Install the icon into share/icons/hicolor/48x48/apps/openclonk.png. Do this by
|
||||
# extracting the correct size from oc.ico. Currently this is layer 2 - let's
|
||||
# hope that it stays this way.
|
||||
|
||||
|
@ -1349,17 +1441,17 @@ install(
|
|||
)"
|
||||
)
|
||||
|
||||
# TODO: Check for convert at configure step?
|
||||
FIND_PACKAGE(ImageMagick COMPONENTS convert)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clonk.png
|
||||
COMMAND convert "${CMAKE_CURRENT_SOURCE_DIR}/src/res/oc.ico[2]" "${CMAKE_CURRENT_BINARY_DIR}/clonk.png"
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/openclonk.png
|
||||
COMMAND convert "${CMAKE_CURRENT_SOURCE_DIR}/src/res/oc.ico[2]" "${CMAKE_CURRENT_BINARY_DIR}/openclonk.png"
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/res/oc.ico
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target(icon DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clonk.png)
|
||||
add_custom_target(icon DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/openclonk.png)
|
||||
add_dependencies(data icon)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/clonk.png
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/openclonk.png
|
||||
DESTINATION share/icons/hicolor/48x48/apps
|
||||
)
|
||||
|
||||
|
@ -1377,10 +1469,10 @@ set(OC_C4GROUPS
|
|||
)
|
||||
|
||||
get_target_property(C4GROUP_LOCATION c4group LOCATION)
|
||||
get_target_property(CLONK_LOCATION clonk LOCATION)
|
||||
get_target_property(CLONK_LOCATION openclonk LOCATION)
|
||||
foreach(group ${OC_C4GROUPS})
|
||||
if (APPLE)
|
||||
add_custom_command(TARGET clonk
|
||||
add_custom_command(TARGET openclonk
|
||||
POST_BUILD COMMAND "/bin/sh" "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_pack_gamedata.sh"
|
||||
"${C4GROUP_LOCATION}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}"
|
||||
|
@ -1403,10 +1495,10 @@ if (NOT APPLE)
|
|||
endif()
|
||||
|
||||
# Install new files
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/clonk.desktop DESTINATION share/applications)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/openclonk.desktop DESTINATION share/applications)
|
||||
|
||||
# Install binaries
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/clonk ${CMAKE_CURRENT_BINARY_DIR}/c4group DESTINATION bin/)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/openclonk ${CMAKE_CURRENT_BINARY_DIR}/c4group DESTINATION bin/)
|
||||
|
||||
############################################################################
|
||||
# setup_openclonk.exe
|
||||
|
@ -1426,7 +1518,7 @@ add_custom_command(
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/header.bmp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/inst.ico
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/uninst.ico
|
||||
${OC_C4GROUPS} clonk c4group
|
||||
${OC_C4GROUPS} openclonk c4group
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
|
|
238
Makefile.am
|
@ -17,11 +17,15 @@
|
|||
|
||||
ACLOCAL_AMFLAGS = -I autotools --install
|
||||
|
||||
bin_PROGRAMS = clonk c4group puncher c4script
|
||||
bin_PROGRAMS = openclonk c4group puncher c4script
|
||||
|
||||
if MAPE
|
||||
bin_PROGRAMS += mape
|
||||
endif
|
||||
|
||||
EXTRA_PROGRAMS = tstc4netio gunzip4c4group
|
||||
|
||||
noinst_LIBRARIES = lib.a
|
||||
noinst_LIBRARIES = libmisc.a libc4script.a
|
||||
|
||||
# Some defines and warning options
|
||||
if RECENT_GCC
|
||||
|
@ -107,7 +111,7 @@ WARNING_FLAGS += -Winvalid-pch
|
|||
|
||||
endif
|
||||
|
||||
lib_a_SOURCES = \
|
||||
libmisc_a_SOURCES = \
|
||||
src/c4group/C4Group.cpp \
|
||||
src/c4group/C4Group.h \
|
||||
src/c4group/C4Update.cpp \
|
||||
|
@ -139,17 +143,47 @@ src/zlib/gzio.c \
|
|||
src/zlib/gzio.h \
|
||||
src/zlib/zutil.h
|
||||
|
||||
clonk_SOURCES = \
|
||||
src/C4Globals.cpp \
|
||||
libc4script_a_SOURCES = \
|
||||
src/c4group/C4GroupSet.cpp \
|
||||
src/c4group/C4GroupSet.h \
|
||||
src/c4group/C4ComponentHost.cpp \
|
||||
src/c4group/C4ComponentHost.h \
|
||||
src/c4group/C4LangStringTable.cpp \
|
||||
src/c4group/C4LangStringTable.h \
|
||||
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 \
|
||||
src/script/C4AulExec.h \
|
||||
src/script/C4AulFunc.cpp \
|
||||
src/script/C4AulFunc.h \
|
||||
src/script/C4Aul.h \
|
||||
src/script/C4AulLink.cpp \
|
||||
src/script/C4AulParse.cpp \
|
||||
src/script/C4PropList.cpp \
|
||||
src/script/C4PropList.h \
|
||||
src/script/C4Script.cpp \
|
||||
src/script/C4ScriptHost.cpp \
|
||||
src/script/C4ScriptHost.h \
|
||||
src/script/C4StringTable.cpp \
|
||||
src/script/C4StringTable.h \
|
||||
src/script/C4ValueArray.cpp \
|
||||
src/script/C4ValueArray.h \
|
||||
src/script/C4Value.cpp \
|
||||
src/script/C4Value.h \
|
||||
src/script/C4ValueMap.cpp \
|
||||
src/script/C4ValueMap.h
|
||||
|
||||
openclonk_SOURCES = \
|
||||
src/C4Globals.cpp \
|
||||
src/c4group/C4Components.h \
|
||||
src/c4group/C4Extra.cpp \
|
||||
src/c4group/C4Extra.h \
|
||||
src/c4group/C4GroupSet.cpp \
|
||||
src/c4group/C4GroupSet.h \
|
||||
src/c4group/C4LangStringTable.cpp \
|
||||
src/c4group/C4LangStringTable.h \
|
||||
src/c4group/C4Language.cpp \
|
||||
src/c4group/C4Language.h \
|
||||
src/C4Include.h \
|
||||
|
@ -221,6 +255,7 @@ src/graphics/C4DrawD3DShader.h \
|
|||
src/graphics/C4DrawGL.cpp \
|
||||
src/graphics/C4DrawGLCtx.cpp \
|
||||
src/graphics/C4DrawGL.h \
|
||||
src/graphics/C4DrawMeshGL.cpp \
|
||||
src/graphics/C4DrawT.cpp \
|
||||
src/graphics/C4DrawT.h \
|
||||
src/graphics/C4Draw.h \
|
||||
|
@ -328,6 +363,7 @@ src/landscape/C4PXS.cpp \
|
|||
src/landscape/C4PXS.h \
|
||||
src/landscape/C4Scenario.cpp \
|
||||
src/landscape/C4Scenario.h \
|
||||
src/landscape/C4ScenarioSection.cpp \
|
||||
src/landscape/C4Sky.cpp \
|
||||
src/landscape/C4Sky.h \
|
||||
src/landscape/C4SolidMask.cpp \
|
||||
|
@ -342,10 +378,6 @@ src/lib/C4Log.cpp \
|
|||
src/lib/C4Log.h \
|
||||
src/lib/C4NameList.cpp \
|
||||
src/lib/C4NameList.h \
|
||||
src/lib/C4Random.cpp \
|
||||
src/lib/C4Random.h \
|
||||
src/lib/C4Real.cpp \
|
||||
src/lib/C4Real.h \
|
||||
src/lib/C4Rect.cpp \
|
||||
src/lib/C4Rect.h \
|
||||
src/lib/C4RTF.cpp \
|
||||
|
@ -417,8 +449,6 @@ src/object/C4DefList.cpp \
|
|||
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 \
|
||||
|
@ -492,30 +522,8 @@ src/res/Play.h \
|
|||
src/res/Rect.h \
|
||||
src/res/resource.h \
|
||||
src/res/Static.h \
|
||||
src/script/C4Aul.cpp \
|
||||
src/script/C4AulDebug.cpp \
|
||||
src/script/C4AulDebug.h \
|
||||
src/script/C4AulDefFunc.h \
|
||||
src/script/C4AulExec.cpp \
|
||||
src/script/C4AulExec.h \
|
||||
src/script/C4AulFunc.cpp \
|
||||
src/script/C4AulFunc.h \
|
||||
src/script/C4Aul.h \
|
||||
src/script/C4AulLink.cpp \
|
||||
src/script/C4AulParse.cpp \
|
||||
src/script/C4PropList.cpp \
|
||||
src/script/C4PropList.h \
|
||||
src/script/C4Script.cpp \
|
||||
src/script/C4ScriptHost.cpp \
|
||||
src/script/C4ScriptHost.h \
|
||||
src/script/C4StringTable.cpp \
|
||||
src/script/C4StringTable.h \
|
||||
src/script/C4ValueArray.cpp \
|
||||
src/script/C4ValueArray.h \
|
||||
src/script/C4Value.cpp \
|
||||
src/script/C4Value.h \
|
||||
src/script/C4ValueMap.cpp \
|
||||
src/script/C4ValueMap.h \
|
||||
thirdparty/timsort/sort.h \
|
||||
thirdparty/tinyxml/tinystr.cpp \
|
||||
thirdparty/tinyxml/tinystr.h \
|
||||
|
@ -525,29 +533,29 @@ thirdparty/tinyxml/tinyxml.h \
|
|||
thirdparty/tinyxml/tinyxmlparser.cpp
|
||||
|
||||
if WIN32
|
||||
clonk_SOURCES += \
|
||||
openclonk_SOURCES += \
|
||||
src/platform/C4CrashHandlerWin32.cpp \
|
||||
src/res/engine.rc \
|
||||
src/res/resource.h
|
||||
endif
|
||||
|
||||
if MACOSX
|
||||
clonk_SOURCES += \
|
||||
openclonk_SOURCES += \
|
||||
src/platform/C4AppDelegate.h \
|
||||
src/platform/C4AppDelegate.mm \
|
||||
src/platform/C4FileMonitorMac.mm
|
||||
else
|
||||
clonk_SOURCES += \
|
||||
openclonk_SOURCES += \
|
||||
src/game/ClonkMain.cpp
|
||||
endif
|
||||
|
||||
if SDL_MAIN_LOOP
|
||||
clonk_SOURCES += \
|
||||
openclonk_SOURCES += \
|
||||
src/platform/C4AppSDL.cpp \
|
||||
src/platform/C4WindowSDL.cpp
|
||||
else
|
||||
if GTK
|
||||
clonk_SOURCES += \
|
||||
openclonk_SOURCES += \
|
||||
src/editor/C4ConsoleGTK.cpp \
|
||||
src/editor/C4ConsoleGTKDlg.cpp \
|
||||
src/editor/C4ConsoleGTKDlg.h \
|
||||
|
@ -556,18 +564,18 @@ src/platform/C4AppGTKImpl.h \
|
|||
src/platform/C4WindowGTK.cpp
|
||||
else
|
||||
if CONSOLE
|
||||
clonk_SOURCES += \
|
||||
openclonk_SOURCES += \
|
||||
src/platform/C4AppT.cpp
|
||||
else
|
||||
if WIN32
|
||||
clonk_SOURCES += \
|
||||
openclonk_SOURCES += \
|
||||
src/editor/C4ConsoleWin32.cpp \
|
||||
src/platform/C4WindowWin32.cpp \
|
||||
src/platform/StdJoystick.cpp \
|
||||
src/platform/StdJoystick.h
|
||||
endif
|
||||
if MACOSX
|
||||
clonk_SOURCES += \
|
||||
openclonk_SOURCES += \
|
||||
src/editor/C4ConsoleCocoa.mm \
|
||||
src/editor/C4EditorWindowController.h \
|
||||
src/editor/C4EditorWindowController.mm \
|
||||
|
@ -587,22 +595,22 @@ endif
|
|||
endif
|
||||
|
||||
if AUTOUPDATE
|
||||
clonk_SOURCES += \
|
||||
openclonk_SOURCES += \
|
||||
src/gui/C4UpdateDlg.cpp \
|
||||
src/gui/C4UpdateDlg.h
|
||||
endif
|
||||
|
||||
if LIBUPNP
|
||||
clonk_SOURCES += src/network/C4Network2UPnPLinux.cpp
|
||||
openclonk_SOURCES += src/network/C4Network2UPnPLinux.cpp
|
||||
else
|
||||
if NATUPNP
|
||||
clonk_SOURCES += src/network/C4Network2UPnPWin32.cpp
|
||||
openclonk_SOURCES += src/network/C4Network2UPnPWin32.cpp
|
||||
else
|
||||
clonk_SOURCES += src/network/C4Network2UPnPDummy.cpp
|
||||
openclonk_SOURCES += src/network/C4Network2UPnPDummy.cpp
|
||||
endif
|
||||
endif
|
||||
|
||||
clonk_CPPFLAGS = \
|
||||
openclonk_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
$(GLEW_CFLAGS) \
|
||||
$(GTK_CFLAGS) \
|
||||
|
@ -611,8 +619,9 @@ $(FREETYPE_CFLAGS) \
|
|||
$(SDL_CFLAGS) \
|
||||
$(LIBUPNP_CFLAGS)
|
||||
|
||||
clonk_LDADD = \
|
||||
lib.a \
|
||||
openclonk_LDADD = \
|
||||
libc4script.a \
|
||||
libmisc.a \
|
||||
$(LDADD) \
|
||||
$(LIBICONV) \
|
||||
$(GTK_LIBS) \
|
||||
|
@ -637,7 +646,7 @@ c4group_SOURCES += src/c4group/Resource.rc
|
|||
endif
|
||||
|
||||
c4group_LDADD = \
|
||||
lib.a \
|
||||
libmisc.a \
|
||||
$(LDADD) \
|
||||
$(LIBICONV) \
|
||||
$(Z_LIBS) \
|
||||
|
@ -650,7 +659,7 @@ src/lib/C4SimpleLog.cpp \
|
|||
src/c4group/gunzip4c4group.cpp
|
||||
|
||||
gunzip4c4group_LDADD = \
|
||||
lib.a \
|
||||
libmisc.a \
|
||||
$(LDADD) \
|
||||
$(Z_LIBS) \
|
||||
$(PTHREAD_LIBS)
|
||||
|
@ -662,7 +671,7 @@ src/lib/C4SimpleLog.cpp \
|
|||
src/netpuncher/main.cpp
|
||||
|
||||
puncher_LDADD = \
|
||||
lib.a \
|
||||
libmisc.a \
|
||||
$(LDADD) \
|
||||
$(PTHREAD_LIBS)
|
||||
|
||||
|
@ -677,7 +686,7 @@ src/lib/C4SimpleLog.cpp \
|
|||
src/netio/TstC4NetIO.cpp
|
||||
|
||||
tstc4netio_LDADD = \
|
||||
lib.a \
|
||||
libmisc.a \
|
||||
$(LDADD) \
|
||||
$(Z_LIBS) \
|
||||
$(PTHREAD_LIBS)
|
||||
|
@ -688,31 +697,14 @@ endif
|
|||
|
||||
## c4script shell
|
||||
c4script_SOURCES = \
|
||||
include/c4script/c4script.h \
|
||||
src/lib/C4SimpleLog.cpp \
|
||||
src/lib/C4Real.cpp \
|
||||
src/lib/C4Random.cpp \
|
||||
src/script/C4Aul.cpp \
|
||||
src/script/C4AulExec.cpp \
|
||||
src/script/C4AulFunc.cpp \
|
||||
src/script/C4AulLink.cpp \
|
||||
src/script/C4AulParse.cpp \
|
||||
src/script/C4StringTable.cpp \
|
||||
src/script/C4PropList.cpp \
|
||||
src/script/C4ScriptHost.cpp \
|
||||
include/c4script/c4script.h \
|
||||
src/script/C4ScriptMain.cpp \
|
||||
src/script/C4ScriptStandalone.cpp \
|
||||
src/script/C4ValueArray.cpp \
|
||||
src/script/C4Value.cpp \
|
||||
src/script/C4ValueMap.cpp \
|
||||
src/object/C4Id.cpp \
|
||||
src/script/C4Script.cpp \
|
||||
src/c4group/C4GroupSet.cpp \
|
||||
src/c4group/C4ComponentHost.cpp \
|
||||
src/c4group/C4LangStringTable.cpp
|
||||
src/script/C4ScriptStandalone.cpp
|
||||
|
||||
c4script_LDADD = \
|
||||
lib.a \
|
||||
libc4script.a \
|
||||
libmisc.a \
|
||||
$(LDADD) \
|
||||
$(Z_LIBS)
|
||||
|
||||
|
@ -720,6 +712,96 @@ if WIN32
|
|||
c4script_LDADD += -lwinmm
|
||||
endif
|
||||
|
||||
## mape
|
||||
mape_SOURCES = \
|
||||
mape-icons.h \
|
||||
src/landscape/C4MapCreatorS2.cpp \
|
||||
src/landscape/C4Material.cpp \
|
||||
src/landscape/C4Scenario.cpp \
|
||||
src/landscape/C4Texture.cpp \
|
||||
src/lib/C4NameList.cpp \
|
||||
src/lib/C4Rect.cpp \
|
||||
src/mape/configfile.c \
|
||||
src/mape/configfile.h \
|
||||
src/mape/cpp-handles/group-handle.cpp \
|
||||
src/mape/cpp-handles/group-handle.h \
|
||||
src/mape/cpp-handles/log-handle.cpp \
|
||||
src/mape/cpp-handles/log-handle.h \
|
||||
src/mape/cpp-handles/mapgen-handle.cpp \
|
||||
src/mape/cpp-handles/mapgen-handle.h \
|
||||
src/mape/cpp-handles/material-handle.cpp \
|
||||
src/mape/cpp-handles/material-handle.h \
|
||||
src/mape/cpp-handles/random-handle.cpp \
|
||||
src/mape/cpp-handles/random-handle.h \
|
||||
src/mape/cpp-handles/stub-handle.cpp \
|
||||
src/mape/cpp-handles/texture-handle.cpp \
|
||||
src/mape/cpp-handles/texture-handle.h \
|
||||
src/mape/cpp-handles/version-handle.cpp \
|
||||
src/mape/cpp-handles/version-handle.h \
|
||||
src/mape/diskview.c \
|
||||
src/mape/diskview.h \
|
||||
src/mape/editview.c \
|
||||
src/mape/editview.h \
|
||||
src/mape/fileicon.c \
|
||||
src/mape/fileicon.h \
|
||||
src/mape/forward.h \
|
||||
src/mape/group.c \
|
||||
src/mape/group.h \
|
||||
src/mape/header.c \
|
||||
src/mape/header.h \
|
||||
src/mape/iconview.c \
|
||||
src/mape/iconview.h \
|
||||
src/mape/mape.c \
|
||||
src/mape/mapgen.c \
|
||||
src/mape/mapgen.h \
|
||||
src/mape/material.c \
|
||||
src/mape/material.h \
|
||||
src/mape/mattexview.c \
|
||||
src/mape/mattexview.h \
|
||||
src/mape/preferences.c \
|
||||
src/mape/preferences.h \
|
||||
src/mape/preferencesdialog.c \
|
||||
src/mape/preferencesdialog.h \
|
||||
src/mape/preview.c \
|
||||
src/mape/preview.h \
|
||||
src/mape/random.c \
|
||||
src/mape/random.h \
|
||||
src/mape/statusbar.c \
|
||||
src/mape/statusbar.h \
|
||||
src/mape/texture.c \
|
||||
src/mape/texture.h \
|
||||
src/mape/window.c \
|
||||
src/mape/window.h \
|
||||
src/script/C4Script.cpp
|
||||
|
||||
mape_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
$(MAPE_CFLAGS)
|
||||
|
||||
mape_LDADD = \
|
||||
libc4script.a \
|
||||
libmisc.a \
|
||||
$(LDADD) \
|
||||
$(MAPE_LIBS) \
|
||||
$(Z_LIBS)
|
||||
|
||||
mape_icons = \
|
||||
$(srcdir)/src/res/ocd.ico \
|
||||
$(srcdir)/src/res/ocf.ico \
|
||||
$(srcdir)/src/res/ocg.ico \
|
||||
$(srcdir)/src/res/ocm.ico \
|
||||
$(srcdir)/src/res/ocs.ico
|
||||
mape-icons.h: $(mape_icons)
|
||||
gdk-pixbuf-csource --raw --static --build-list \
|
||||
mape_icon_ocd "$(srcdir)/src/res/ocd.ico" \
|
||||
mape_icon_ocf "$(srcdir)/src/res/ocf.ico" \
|
||||
mape_icon_ocg "$(srcdir)/src/res/ocg.ico" \
|
||||
mape_icon_ocm "$(srcdir)/src/res/ocm.ico" \
|
||||
mape_icon_ocs "$(srcdir)/src/res/ocs.ico" \
|
||||
> $@
|
||||
BUILT_SOURCES += mape-icons.h
|
||||
CLEANFILES += mape-icons.h
|
||||
|
||||
## documentation
|
||||
dist_doc_DATA = planet/AUTHORS planet/COPYING licenses/LGPL.txt Credits.txt
|
||||
|
||||
|
@ -752,7 +834,7 @@ if WIN32
|
|||
tools/install/firewall.dll: $(srcdir)/tools/install/firewall.cpp
|
||||
mkdir -p tools/install
|
||||
$(CXX) -shared -o tools/install/firewall.dll $(srcdir)/tools/install/firewall.cpp -lole32 -loleaut32
|
||||
setup_openclonk.exe: $(srcdir)/tools/install/oc.nsi c4group$(EXEEXT) clonk$(EXEEXT) $(c4groups)
|
||||
setup_openclonk.exe: $(srcdir)/tools/install/oc.nsi c4group$(EXEEXT) openclonk$(EXEEXT) $(c4groups)
|
||||
makensis -NOCD -DSRCDIR=$(srcdir) '-DPROGRAMFILES=$$PROGRAMFILES' \
|
||||
-DPRODUCT_NAME="$$(sed -n 's/SET(C4ENGINENAME\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)$$(sed -n 's/SET(C4VERSIONBUILDNAME\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)" \
|
||||
-DPRODUCT_COMPANY="$$(sed -n 's/SET(C4PROJECT\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)" \
|
||||
|
|
|
@ -64,7 +64,7 @@ Running
|
|||
|
||||
You can run the game from the build directory:
|
||||
|
||||
./clonk
|
||||
./openclonk
|
||||
|
||||
See docs/sdk/cmdline.xml for the supported command line options.
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ and pass --with-directx to configure below.
|
|||
Start msys (your MinGW directory, e.g. C:\MinGW -> msys.bat),
|
||||
cd to this directory, and execute:
|
||||
|
||||
./autogen.sh && ./configure && make
|
||||
autoreconf -i && ./configure && make
|
||||
|
||||
To compile a debugbuild, pass --enable-debug to configure. Other options are
|
||||
listed by ./configure --help.
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
aclocal -I autotools --install
|
||||
autoheader
|
||||
autoconf
|
||||
automake -a
|
||||
|
37
clonk.anjuta
|
@ -1,37 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<anjuta>
|
||||
<plugin name="GBF Project Manager"
|
||||
url="http://anjuta.org/plugins/"
|
||||
mandatory="yes">
|
||||
<require group="Anjuta Plugin"
|
||||
attribute="Interfaces"
|
||||
value="IAnjutaProjectManager"/>
|
||||
<require group="Project"
|
||||
attribute="Supported-Project-Types"
|
||||
value="automake"/>
|
||||
</plugin>
|
||||
<plugin name="Symbol Browser"
|
||||
url="http://anjuta.org/plugins/"
|
||||
mandatory="yes">
|
||||
<require group="Anjuta Plugin"
|
||||
attribute="Interfaces"
|
||||
value="IAnjutaSymbolManager"/>
|
||||
</plugin>
|
||||
<plugin name="Make Build System"
|
||||
url="http://anjuta.org/plugins/"
|
||||
mandatory="yes">
|
||||
<require group="Anjuta Plugin"
|
||||
attribute="Interfaces"
|
||||
value="IAnjutaBuildable"/>
|
||||
<require group="Build"
|
||||
attribute="Supported-Build-Types"
|
||||
value="make"/>
|
||||
</plugin>
|
||||
<plugin name="Debug Manager"
|
||||
url="http://anjuta.org/plugins/"
|
||||
mandatory="no">
|
||||
<require group="Anjuta Plugin"
|
||||
attribute="Interfaces"
|
||||
value="IAnjutaDebugManager"/>
|
||||
</plugin>
|
||||
</anjuta>
|
14
configure.ac
|
@ -20,7 +20,7 @@ dnl Process this file with autoconf to produce a configure script.
|
|||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
AC_PREREQ([2.67])
|
||||
AC_INIT([clonk], [m4_esyscmd([sed -n 's/SET(C4XVER1\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r'
|
||||
AC_INIT([openclonk], [m4_esyscmd([sed -n 's/SET(C4XVER1\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r'
|
||||
]).m4_esyscmd([sed -n 's/SET(C4XVER2\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r'
|
||||
]).m4_esyscmd([sed -n 's/SET(C4XVER3\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r'])])
|
||||
AC_COPYRIGHT([©2005-2011 Günther Brammer])
|
||||
|
@ -129,8 +129,8 @@ AC_ARG_ENABLE([sound],
|
|||
, [if test $enable_console = yes; then enable_sound=no; else enable_sound=yes; fi])
|
||||
|
||||
# GTK+
|
||||
GTK2_REQUIRED="glib-2.0 >= 2.8 gtk+-2.0 >= 2.8"
|
||||
GTK3_REQUIRED="glib-2.0 >= 2.27.5 gtk+-3.0 >= 2.99.0"
|
||||
GTK2_REQUIRED="glib-2.0 >= 2.24 gtk+-2.0 >= 2.20"
|
||||
GTK3_REQUIRED="glib-2.0 >= 2.32 gtk+-3.0 >= 3.4"
|
||||
PKG_PROG_PKG_CONFIG
|
||||
AC_MSG_CHECKING([which gtk+ version to compile against])
|
||||
AC_ARG_WITH([gtk],
|
||||
|
@ -151,15 +151,23 @@ AC_MSG_RESULT([$with_gtk])
|
|||
AS_IF([test $with_gtk != no],[
|
||||
case "$with_gtk" in
|
||||
2.0) GTK_REQUIRED="$GTK2_REQUIRED"
|
||||
MAPE_REQUIRED="$GTK2_REQUIRED gthread-2.0 gtksourceview-2.0"
|
||||
;;
|
||||
3.0) GTK_REQUIRED="$GTK3_REQUIRED"
|
||||
MAPE_REQUIRED="$GTK3_REQUIRED gthread-2.0 gtksourceview-3.0"
|
||||
;;
|
||||
esac
|
||||
PKG_CHECK_MODULES(GTK, [$GTK_REQUIRED])
|
||||
AC_ARG_ENABLE([mape],
|
||||
[AS_HELP_STRING([--enable-mape],[build mape landscape.txt editor [default: auto]])], [],
|
||||
[PKG_CHECK_EXISTS([$MAPE_REQUIRED], [enable_mape=yes], [enable_mape=no])])
|
||||
AS_IF([test $enable_mape != no],
|
||||
[PKG_CHECK_MODULES(MAPE, [$MAPE_REQUIRED])])
|
||||
AC_DEFINE([WITH_GLIB], 1, [Glib])
|
||||
AC_DEFINE([WITH_DEVELOPER_MODE], 1, [Developer mode])
|
||||
])
|
||||
AM_CONDITIONAL(GTK, [test $with_gtk != no])
|
||||
AM_CONDITIONAL(MAPE, [test $enable_mape != no])
|
||||
|
||||
# OpenAL
|
||||
AC_ARG_WITH([openal],
|
||||
|
|
|
@ -15,14 +15,11 @@ clonk.xsl also uses it to match the processing for it. -->
|
|||
search <input id="searchInput" name="s" type="text" value="" /> in the
|
||||
<select name="p">
|
||||
<option value="blog">blog</option>
|
||||
<option selected="selected" value="functions">c4script function list</option>
|
||||
<option value="docs">c4script reference</option>
|
||||
<option value="functionsDE">c4script function list (DE)</option>
|
||||
<option value="docsDE">c4script reference (DE)</option>
|
||||
<option selected="selected" value="docs">c4script documentation</option>
|
||||
<option value="bugtrack">bugtracker</option>
|
||||
<option value="forum">forum</option>
|
||||
<option value="hg">hg changelog</option>
|
||||
<option value="hg-resources">hg resources changelog</option>
|
||||
<option value="git">repository</option>
|
||||
<option value="git-resources">resources repository</option>
|
||||
<option value="wiki">website</option>
|
||||
</select>
|
||||
<input type='submit' class="nav_searchButton" id="searchButton" value="Go" title="Search" />
|
||||
|
@ -55,8 +52,8 @@ clonk.xsl also uses it to match the processing for it. -->
|
|||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://forum.openclonk.org/" target="_top">Forum</a><!--[if lt IE 9]></span><![endif]--></li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://wiki.openclonk.org/w/Development" target="_top">Development</a><!--[if lt IE 9]></span><![endif]--> <ul>
|
||||
<li><a href="http://bugs.openclonk.org" target="_top">Bugtracker</a></li>
|
||||
<li><a href="http://hg.openclonk.org/openclonk/" target="_top">Repository</a></li>
|
||||
<li><a href="http://hg.openclonk.org/openclonk-resources/" target="_top">Resource Repository</a></li>
|
||||
<li><a href="http://git.openclonk.org/openclonk.git" target="_top">Repository</a></li>
|
||||
<li><a href="http://git.openclonk.org/openclonk-resources.git" target="_top">Resource Repository</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a class="current" href="http://wiki.openclonk.org/w/C4Script_Documentation" target="_top">Documentation</a><!--[if lt IE 9]></span><![endif]--> <ul>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE doc
|
||||
SYSTEM '../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
|
||||
|
@ -71,9 +71,24 @@
|
|||
<col>Attachment to surfaces: <emlink href="definition/cnat.html">CNAT Value</emlink>, e.g. value 8 if the object should attach to the floor like a walking clonk does; or 4 for attachment to the ceiling like a hangling clonk. Only evaluated if the procedure is NONE.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Facet</literal_col>
|
||||
<col>6 integers</col>
|
||||
<col>Animation graphics: Target rectangle from Graphics.png relative to upper left corner of unrotated object shape.</col>
|
||||
<literal_col>X</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Animation graphics: X coordinate from Graphics.png.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Y</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Animation graphics: Y coordinate from Graphics.png.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Wdt</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Width of the animation graphic from Graphics.png.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Hgt</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Height of the animation graphic from Graphics.png.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>FacetBase</literal_col>
|
||||
|
|
|
@ -323,6 +323,16 @@
|
|||
<col>int player, int new_team, int old_team</col>
|
||||
<col>Callback in game goal, rule, and environment objects and in the scenario script. Called when a player has successfully switch from old_team to new_team (see <funclink>SetPlayerTeam</funclink>).</col>
|
||||
</row>
|
||||
<row id="EditCursorSelection">
|
||||
<literal_col>EditCursorSelection</literal_col>
|
||||
<col></col>
|
||||
<col>When object is selected in editor. Use this callback to display extra information for scenario designers.</col>
|
||||
</row>
|
||||
<row id="EditCursorDeselection">
|
||||
<literal_col>EditCursorDeselection</literal_col>
|
||||
<col></col>
|
||||
<col>When object is deselected in editor. Use this callback to hide any information previously shown in EditCursorSelection.</col>
|
||||
</row>
|
||||
</table>
|
||||
|
||||
</text>
|
||||
|
|
|
@ -330,6 +330,11 @@
|
|||
<col>Integer</col>
|
||||
<col>Granularity of the Fog of War. Default: 64. Warning: smaller values will improve the looks of the FoW but will also severely increase processing times.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>FlatChunkShapes</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>0 or 1. If 1, all landscape chunks are drawn flat when the map is zoomed to draw the landscape. Set this while drawing a static map in console mode to fix small gaps of lower order materials hidden behind materials of chunky shape.</col>
|
||||
</row>
|
||||
</table>
|
||||
</text>
|
||||
<text>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE doc
|
||||
SYSTEM '../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
|
||||
|
@ -71,12 +71,12 @@ func Activate(object caster, object caster2)
|
|||
|
||||
func FxInvisPSpellStart(object target, proplist effect)
|
||||
{
|
||||
// Vorherige Sichtbarkeit des Zauberers speichern
|
||||
// Save the casters previous visibility
|
||||
effect.visibility = target.Visibility;
|
||||
effect.old_mod = target-><funclink>GetClrModulation</funclink>();
|
||||
// Zauberer unsichtbar machen
|
||||
// Make the caster invisible
|
||||
target.Visibility = <funclink>VIS_Owner</funclink> | <funclink>VIS_Allies</funclink> | <funclink>VIS_God</funclink>;
|
||||
// Halbdurchsichtig bläulich für den Besitzer und Verbündete
|
||||
// Semitransparent and slightly blue for owner and allies
|
||||
target->SetClrModulation(<funclink>ModulateColor</funclink>(effect.old_mod, RGBa(127,127,255,127)));
|
||||
// Fertig
|
||||
return true;
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>CreateParticleAtBone</title>
|
||||
<category>Particle</category>
|
||||
<version>5.4 OC</version>
|
||||
<syntax>
|
||||
<rtype>bool</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>string</type>
|
||||
<name>szName</name>
|
||||
<desc>Name of the particle</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>string</type>
|
||||
<name>szBoneName</name>
|
||||
<desc>Name of the bone at which to create the particle</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>array</type>
|
||||
<name>pos</name>
|
||||
<desc>Vector of three elements with the X,Y and Z coordinates of the particle relative to the bone position and orientation.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>array</type>
|
||||
<name>dir</name>
|
||||
<desc>Vector of three elements with the X,Y and Z components of the velocity of theparticle relative to the bone orientation.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>a</name>
|
||||
<desc>Extra parameter. This is usually the size of the particle in 1/5 pixels.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>b</name>
|
||||
<desc>Extra parameter. This is usually the color modulation of the particle.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>object</type>
|
||||
<name>target</name>
|
||||
<desc>Target object for object local particles. Object local particles are drawn directly on top of the object and are removed when the object is deleted.</desc>
|
||||
<optional />
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>behind_target</name>
|
||||
<desc>If specified and not <code>false</code>, the particle is drawn directly behind the target object.</desc>
|
||||
<optional />
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Creates a particle relative to a bone of the calling object's skeleton. The named particle definition must be loaded. For more information see the particle documentation.</desc>
|
||||
<remark>This function returns <code>false</code> if the particle definition was not found, or the function is called for an object which does not have a mesh graphics, or the skeleton of the mesh does not have a bone called <code>szBoneName</code>. Otherwise, <code>true</code> is returned. There is no return value indicating whether the particle has actually been created. This must be so to prevent synchronization problems in network games, as particles may be handled differently on each computer in the network.</remark>
|
||||
<examples>
|
||||
<example>
|
||||
<code>func InitializePlayer(int plr)
|
||||
{
|
||||
AddEffect("IntColorize", 0, 1, 1);
|
||||
}
|
||||
|
||||
global func FxIntColorizeTimer()
|
||||
{
|
||||
FindObject(Find_ID(Clonk))->CreateParticleAtBone("PSpark", "skeleton_body", [0, 0, 0], [0, 0, 0], 8, RGB(255,0,0));
|
||||
FindObject(Find_ID(Clonk))->CreateParticleAtBone("PSpark", "pos_hand1", [0, 0, 0], [0, 0, 0], 8, RGB(0,255,0));
|
||||
FindObject(Find_ID(Clonk))->CreateParticleAtBone("PSpark", "pos_hand2", [0, 0, 0], [0, 0, 0], 8, RGB(0,0,255));
|
||||
return(0);
|
||||
}</code>
|
||||
<text>Scenario script. Creates an effect which traces a Clonk's body, left hand and right hand with differently colored sparks.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
<funclink>CreateParticle</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Clonk-Karl</author><date>2012-12</date>
|
||||
</funcs>
|
|
@ -9,7 +9,7 @@
|
|||
<subcat>Display</subcat>
|
||||
<version>5.1 OC</version>
|
||||
<syntax><rtype>int</rtype></syntax>
|
||||
<desc>Gets the RGB color value of the ColorByOwner areas of an object. These are controlled by <funclink>SetOwner</funclink>, <funclink>SetColor</funclink> or <placeholder-3/>.</desc>
|
||||
<desc>Gets the RGB color value of the ColorByOwner areas of an object. These are controlled by <funclink>SetOwner</funclink> or <funclink>SetColor</funclink>.</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<code>otherclonk-><funclink>SetColor</funclink>(GetColor());</code>
|
||||
|
|
|
@ -37,11 +37,11 @@
|
|||
<remark>Accordingly, the specified script can be a single command only. It may not contain multiple commands separated by ";".</remark>
|
||||
<examples>
|
||||
<example>
|
||||
<code>Schedule("<funclink>Explode</funclink>(50)", 1000, 0, <funclink>FindObject</funclink>(<funclink>Find_ID</funclink>(Clonk)));</code>
|
||||
<code>Schedule(<funclink>FindObject</funclink>(<funclink>Find_ID</funclink>(Clonk)), "<funclink>Explode</funclink>(50)"<funclink></funclink>, 1000);</code>
|
||||
<text>Makes a clonk explode after 1000 ticks delay.</text>
|
||||
</example>
|
||||
<example>
|
||||
<code>Schedule("<funclink>SetWealth</funclink>(<funclink>GetPlayerByIndex</funclink>(0), <funclink>GetWealth</funclink>(<funclink>GetPlayerByIndex</funclink>(0)) + 1)", 1, 100);</code>
|
||||
<code>Schedule(<code>nil</code>, "<funclink>DoWealth</funclink>(<funclink>GetPlayerByIndex</funclink>(0), 1)"<funclink></funclink>, 1, 100);</code>
|
||||
<text>Gives one unit of money per frame to the first player for 100 frames. Notice that if the first player is eliminated, the donations will continue for the next (first) player, since the receiving player is determined anew in each execution.</text>
|
||||
</example>
|
||||
</examples>
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
<examples>
|
||||
<example>
|
||||
<code>SetGamma(<funclink>RGB</funclink>(50,0,0), <funclink>RGB</funclink>(140,100,100), <funclink>RGB</funclink>(255,220,220));</code>
|
||||
<text>Adds a light blue hue to the game.</text>
|
||||
<text>Adds a light red hue to the game.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<version>5.1 OC</version>
|
||||
<syntax><rtype>array</rtype></syntax>
|
||||
<desc>Sort criterion: Sorts the found objects randomly.</desc>
|
||||
<remark>Sort_Random should not be used together with <placeholder-1/> to find a random, matching object. Instead the first object of a <placeholder-2/> search with a SortRandom parameter can be used for instance.</remark>
|
||||
<remark>Sort_Random should not be used together with <funclink>FindObject</funclink> to find a random, matching object. Instead the first object of a <funclink>FindObjects</funclink> search with a SortRandom parameter can be used for instance.</remark>
|
||||
<remark>For additional information on the use of this function see <funclink>FindObjects</funclink>.</remark>
|
||||
<related><funclink>FindObjects</funclink></related>
|
||||
</func>
|
||||
|
|
|
@ -4,7 +4,7 @@ Name=OpenClonk
|
|||
Comment=An action-packed game of strategy, tactics, and skill.
|
||||
Comment[de]=Ein actiongeladenes Taktikspiel.
|
||||
GenericName=Multiplayer action, tactics and skill game
|
||||
Icon=clonk
|
||||
Exec=clonk
|
||||
Icon=openclonk
|
||||
Exec=openclonk
|
||||
Categories=Game;ActionGame;
|
||||
StartupNotify=true
|
|
@ -1,2 +1,3 @@
|
|||
* -crlf
|
||||
|
||||
* text=auto
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[DefCore]
|
||||
id=DebugLine
|
||||
Version=5,2,0,1
|
||||
Category=C4D_StaticBack
|
||||
Vertices=2
|
||||
Line=1
|
After Width: | Height: | Size: 141 B |
|
@ -0,0 +1,28 @@
|
|||
/*-- Debug dusplay line --*/
|
||||
|
||||
// definition call: create line
|
||||
func Create(int x1,int y1,int x2,int y2,int clr)
|
||||
{
|
||||
var obj = CreateObject(DebugLine);
|
||||
obj->Set(x1,y1,x2,y2,clr);
|
||||
return obj;
|
||||
}
|
||||
|
||||
func Set(int x1,int y1,int x2,int y2,int clr)
|
||||
{
|
||||
//SetAction("Connect");
|
||||
SetVertexXY(0, x1,y1);
|
||||
SetVertexXY(1, x2,y2);
|
||||
this.LineColors = [clr, clr];
|
||||
return;
|
||||
}
|
||||
|
||||
local ActMap = {
|
||||
Connect = {
|
||||
Prototype = Action,
|
||||
Name = "Connect",
|
||||
Procedure = DFA_CONNECT,
|
||||
NextAction = "Connect"
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
[DefCore]
|
||||
id=S2AI
|
||||
Version=5,2,0,1
|
||||
Category=C4D_Vehicle | C4D_MouseIgnore
|
||||
Width=1
|
||||
Height=1
|
||||
Mass=1
|
||||
|
After Width: | Height: | Size: 133 B |
|
@ -0,0 +1,660 @@
|
|||
static const S2AI_DefMaxAggroDistance = 200, // lose sight to target if it is this far away (unles we're ranged - then always guard the range rect)
|
||||
S2AI_DefGuardRangeX = 300, // search targets this far away in either direction (searching in rectangle)
|
||||
S2AI_DefGuardRangeY = 150, // search targets this far away in either direction (searching in rectangle)
|
||||
S2AI_AlertTime = 800; // number of frames after alert after which AI no longer checks for projectiles
|
||||
|
||||
/* Public interface */
|
||||
|
||||
// Add AI execution timer to target Clonk
|
||||
func AddAI(object clonk)
|
||||
{
|
||||
var fx = GetEffect("S2AI", clonk);
|
||||
if (!fx) fx = AddEffect("S2AI", clonk, 1, 3, nil, S2AI);
|
||||
if (!fx || !clonk) return nil;
|
||||
clonk.ExecuteS2AI = S2AI.Execute;
|
||||
if (clonk->GetProcedure() == "PUSH") fx.vehicle = clonk->GetActionTarget();
|
||||
BindInventory(clonk);
|
||||
SetHome(clonk);
|
||||
SetGuardRange(clonk, fx.home_x-S2AI_DefGuardRangeX, fx.home_y-S2AI_DefGuardRangeY, S2AI_DefGuardRangeX*2, S2AI_DefGuardRangeY*2);
|
||||
SetMaxAggroDistance(clonk, S2AI_DefMaxAggroDistance);
|
||||
return fx;
|
||||
}
|
||||
|
||||
func GetAI(object clonk) { return GetEffect("S2AI", clonk); }
|
||||
|
||||
// Set the current inventory to be removed when the clonk dies. Only works if clonk has an AI.
|
||||
func BindInventory(object clonk)
|
||||
{
|
||||
var fx = GetEffect("S2AI", clonk);
|
||||
if (!fx || !clonk) return false;
|
||||
var cnt = clonk->ContentsCount();
|
||||
fx.bound_weapons = CreateArray(cnt);
|
||||
for (var i=0; i<cnt; ++i) fx.bound_weapons[i] = clonk->Contents(i);
|
||||
clonk->Call(S2AI.UpdateDebugDisplay, fx);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Set the home position the Clonk returns to if he has no target
|
||||
func SetHome(object clonk, int x, int y, int dir)
|
||||
{
|
||||
var fx = GetEffect("S2AI", clonk);
|
||||
if (!fx || !clonk) return false;
|
||||
// nil/nil defaults to current position
|
||||
if (!GetType(x)) x=clonk->GetX();
|
||||
if (!GetType(y)) y=clonk->GetY();
|
||||
if (!GetType(dir)) dir=clonk->GetDir();
|
||||
fx.home_x = x; fx.home_y = y;
|
||||
fx.home_dir = dir;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Set the guard range to the provided rectangle
|
||||
func SetGuardRange(object clonk, int x, int y, int wdt, int hgt)
|
||||
{
|
||||
var fx = GetEffect("S2AI", clonk);
|
||||
if (!fx || !clonk) return false;
|
||||
fx.guard_range_check = Find_AtRect(x-GetX(),y-GetY(),wdt,hgt);
|
||||
fx.guard_range = {x=x, y=y, wdt=wdt, hgt=hgt};
|
||||
clonk->Call(S2AI.UpdateDebugDisplay, fx);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Set the maximum distance the enemy will follow an attacking Clonk
|
||||
func SetMaxAggroDistance(object clonk, int max_dist)
|
||||
{
|
||||
var fx = GetEffect("S2AI", clonk);
|
||||
if (!fx || !clonk) return false;
|
||||
fx.max_aggro_distance = max_dist;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Set range in which, on first encounter, allied AI Clonks get the same aggro target set
|
||||
func SetAllyAlertRange(object clonk, int new_range)
|
||||
{
|
||||
var fx = GetEffect("S2AI", clonk);
|
||||
if (!fx || !clonk) return false;
|
||||
fx.ally_alert_range = new_range;
|
||||
clonk->Call(S2AI.UpdateDebugDisplay, fx);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Set callback function name to be called in game script when this AI is first encountered
|
||||
// Callback function first parameter is (this) AI clonk, second parameter is player clonk.
|
||||
// The callback should return true to be cleared and not called again. Otherwise, it will be called every time a new target is found.
|
||||
func SetEncounterCB(object clonk, string cb_fn)
|
||||
{
|
||||
var fx = GetEffect("S2AI", clonk);
|
||||
if (!fx || !clonk) return false;
|
||||
fx.encounter_cb = cb_fn;
|
||||
clonk->Call(S2AI.UpdateDebugDisplay, fx);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* AI effect callback functions */
|
||||
|
||||
protected func FxS2AITimer(clonk, fx, int time) { clonk->ExecuteS2AI(fx, time); return FX_OK; }
|
||||
|
||||
protected func FxS2AIStop(clonk, fx, int reason)
|
||||
{
|
||||
// remove debug display
|
||||
if (fx.debug) clonk->Call(S2AI.EditCursorDeselection, fx);
|
||||
// remove weapons on death
|
||||
if (reason == FX_Call_RemoveDeath)
|
||||
{
|
||||
if (fx.bound_weapons) for (var obj in fx.bound_weapons) if (obj && obj->Contained()==clonk) obj->RemoveObject();
|
||||
}
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
protected func FxS2AIDamage(clonk, fx, int dmg, int cause)
|
||||
{
|
||||
// AI takes damage: Make sure we're alert so evasion and healing scripts are executed!
|
||||
// It might also be feasible to execute encounter callbacks here (in case an AI is shot from a position it cannot see).
|
||||
// However, the attacking Clonk is not known and the callback might be triggered e.g. by an unfortunate meteorite or lightning blast.
|
||||
// So let's just keep it at alert state for now.
|
||||
if (dmg<0) fx.alert=fx.time;
|
||||
return dmg;
|
||||
}
|
||||
|
||||
|
||||
/* AI execution timer functions */
|
||||
|
||||
// called in context of the Clonk that is being controlled
|
||||
private func Execute(proplist fx, int time)
|
||||
{
|
||||
fx.time = time;
|
||||
// Evasion, healing etc. if alert
|
||||
if (fx.alert) if (ExecuteProtection(fx)) return true;
|
||||
// Find something to fight with
|
||||
if (!fx.weapon) { CancelAiming(fx); if (!ExecuteArm(fx)) return ExecuteIdle(fx); else if (!fx.weapon) return true; }
|
||||
// Weapon out of ammo?
|
||||
if (fx.ammo_check && !Call(fx.ammo_check, fx, fx.weapon)) { fx.weapon=nil; return false; }
|
||||
// Find an enemy
|
||||
if (fx.target) if (!fx.target->GetAlive() || (!fx.ranged && ObjectDistance(fx.target) >= fx.max_aggro_distance)) fx.target = nil;
|
||||
if (!fx.target)
|
||||
{
|
||||
CancelAiming(fx);
|
||||
if (!(fx.target = FindTarget(fx))) return ExecuteIdle(fx);
|
||||
// first encounter callback. might display a message.
|
||||
if (fx.encounter_cb) if (GameCall(fx.encounter_cb, this, fx.target)) fx.encounter_cb = nil;
|
||||
// wake up nearby allies
|
||||
if (fx.ally_alert_range)
|
||||
{
|
||||
var ally_fx;
|
||||
for (var ally in FindObjects(Find_Distance(fx.ally_alert_range), Find_Exclude(this), Find_OCF(OCF_Alive), Find_Owner(GetOwner())))
|
||||
if (ally_fx = S2AI->GetAI(ally))
|
||||
if (!ally_fx.target)
|
||||
{
|
||||
ally_fx.target = fx.target;
|
||||
ally_fx.alert = ally_fx.time;
|
||||
if (ally_fx.encounter_cb) if (GameCall(ally_fx.encounter_cb, ally, fx.target)) ally_fx.encounter_cb = nil;
|
||||
}
|
||||
// waking up works only once. after that, AI might have moved and wake up Clonks it shouldn't
|
||||
fx.ally_alert_range = nil;
|
||||
}
|
||||
}
|
||||
// Attack it!
|
||||
return Call(fx.strategy, fx);
|
||||
}
|
||||
|
||||
private func ExecuteProtection(fx)
|
||||
{
|
||||
// Search for nearby projectiles. Ranged AI also searches for enemy clonks to evade.
|
||||
var enemy_search;
|
||||
if (fx.ranged) enemy_search = Find_And(Find_OCF(OCF_Alive), Find_Not(Find_Owner(GetOwner())));
|
||||
//Log("ExecProt");
|
||||
var projectiles = FindObjects(Find_InRect(-150,-50,300,80), Find_Or(Find_Category(C4D_Object), Find_Func("IsDangerous4AI"), Find_Func("IsArrow"), enemy_search), Find_OCF(OCF_HitSpeed2), Find_NoContainer(), Sort_Distance());
|
||||
for (var obj in projectiles)
|
||||
{
|
||||
var dx = obj->GetX()-GetX(), dy = obj->GetY()-GetY();
|
||||
var vx = obj->GetXDir(), vy = obj->GetYDir();
|
||||
if (Abs(dx)>40 && vx) dy += (Abs(10*dx/vx)**2)*GetGravity()/200;
|
||||
var v2 = Max(vx*vx+vy*vy, 1);
|
||||
var d2 = dx*dx+dy*dy;
|
||||
if (d2/v2 > 4)
|
||||
{
|
||||
// won't hit within the next 20 frames
|
||||
//obj->Message("ZZZ");
|
||||
continue;
|
||||
}
|
||||
//obj->Message("###%d", Sqrt(100*d2/v2));
|
||||
// Distance at which projectile will pass Clonk should be larger than Clonk size (erroneously assumes Clonk is a sphere)
|
||||
var l = dx*vx+dy*vy;
|
||||
//Log("%s l=%d d=%d r=%d gravcorr=%d", obj->GetName(), l, Sqrt(d2), Sqrt(d2-l*l/v2), (Abs(10*dx/vx)**2)*GetGravity()/200);
|
||||
if (l<0 && Sqrt(d2-l*l/v2)<=GetCon()/8)
|
||||
{
|
||||
// Not if there's a wall between
|
||||
if (!PathFree(GetX(),GetY(),obj->GetX(),obj->GetY())) continue;
|
||||
// This might hit :o
|
||||
fx.alert=fx.time;
|
||||
// do we have a shield?
|
||||
if (fx.shield)
|
||||
{
|
||||
// use it!
|
||||
if (fx.aim_weapon == fx.shield)
|
||||
{
|
||||
// continue to hold shield
|
||||
//Log("shield HOLD %d %d", dx,dy);
|
||||
fx.shield->ControlUseHolding(this, dx,dy);
|
||||
}
|
||||
else
|
||||
{
|
||||
// start holding shield
|
||||
if (fx.aim_weapon) CancelAiming(fx);
|
||||
if (!CheckHandsAction(fx)) return true;
|
||||
if (!fx.shield->ControlUseStart(this, dx,dy)) return false; // something's broken :(
|
||||
//Log("shield START %d %d", dx,dy);
|
||||
fx.shield->ControlUseHolding(this, dx,dy);
|
||||
fx.aim_weapon = fx.shield;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// no shield. try to jump away
|
||||
if (dx<0) SetComDir(COMD_Right); else SetComDir(COMD_Left);
|
||||
if (ExecuteJump()) return true;
|
||||
// Can only try to evade one projectile
|
||||
break;
|
||||
}
|
||||
}
|
||||
//Log("OK");
|
||||
// stay alert if there's a target. Otherwise alert state may wear off
|
||||
if (fx.target) fx.alert=fx.time; else if (fx.time-fx.alert > S2AI_AlertTime) fx.alert=nil;
|
||||
// nothing to do
|
||||
return false;
|
||||
}
|
||||
|
||||
private func CheckTargetInGuardRange(fx)
|
||||
{
|
||||
// if target is not in guard range, reset it and return false
|
||||
if (!Inside(fx.target->GetX()-fx.guard_range.x, -10, fx.guard_range.wdt+9)
|
||||
||!Inside(fx.target->GetY()-fx.guard_range.y, -10, fx.guard_range.hgt+9))
|
||||
{ fx.target=nil; return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
private func ExecuteVehicle(fx)
|
||||
{
|
||||
// only knows how to use catapult
|
||||
if (!fx.vehicle || fx.vehicle->GetID() != Catapult) { fx.vehicle = nil; return false; }
|
||||
// still pushing it?
|
||||
if (GetProcedure() != "PUSH" || GetActionTarget() != fx.vehicle)
|
||||
{
|
||||
if (!GetCommand() || !Random(4)) SetCommand("Grab", fx.vehicle);
|
||||
return true;
|
||||
}
|
||||
// Target still in guard range?
|
||||
if (!CheckTargetInGuardRange(fx)) return false;
|
||||
// turn in correct direction
|
||||
var x=GetX(), y=GetY(), tx=fx.target->GetX(), ty=fx.target->GetY()-4;
|
||||
if (tx>x && !fx.vehicle.dir) { fx.vehicle->ControlRight(this); return true; }
|
||||
if (tx<x && fx.vehicle.dir) { fx.vehicle->ControlLeft (this); return true; }
|
||||
// make sure we're aiming
|
||||
if (!fx.aim_weapon)
|
||||
{
|
||||
if (!fx.vehicle->~ControlUseStart(this)) return false;
|
||||
fx.aim_weapon = fx.vehicle;
|
||||
fx.aim_time = fx.time;
|
||||
return true;
|
||||
}
|
||||
// update catapult animation
|
||||
fx.vehicle->~ControlUseHolding(this, tx-x, ty-y);
|
||||
// project target position
|
||||
var d = Distance(x,y,tx,ty);
|
||||
fx.projectile_speed = fx.vehicle->DefinePower(tx-x, ty-y);
|
||||
var dt = d * 10 / fx.projectile_speed; // projected travel time of the object
|
||||
tx += fx.target->GetXDir(dt);
|
||||
ty += fx.target->GetYDir(dt);
|
||||
if (!fx.target->GetContact(-1)) ty += GetGravity()*dt*dt/200;
|
||||
// Can shoot now?
|
||||
if (fx.time >= fx.aim_time + fx.aim_wait) if (PathFree(x,y,tx,ty))
|
||||
{
|
||||
fx.aim_weapon->~ControlUseStop(this, tx-x,ty-y);
|
||||
fx.aim_weapon = nil;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private func CancelAiming(fx)
|
||||
{
|
||||
if (fx.aim_weapon)
|
||||
{
|
||||
//if (fx.aim_weapon==fx.shield) Log("cancel shield");
|
||||
fx.aim_weapon->~ControlUseCancel(this);
|
||||
fx.aim_weapon = nil;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private func IsAimingOrLoading() { return !!GetEffect("IntAim*", this); }
|
||||
|
||||
private func ExecuteRanged(fx)
|
||||
{
|
||||
// Still carrying the bow?
|
||||
if (fx.weapon->Contained() != this) { fx.weapon=nil; return false; }
|
||||
// Target still in guard range?
|
||||
if (!CheckTargetInGuardRange(fx)) return false;
|
||||
// Look at target
|
||||
ExecuteLookAtTarget(fx);
|
||||
// Make sure we can shoot
|
||||
if (!IsAimingOrLoading() || !fx.aim_weapon)
|
||||
{
|
||||
CancelAiming(fx);
|
||||
if (!CheckHandsAction(fx)) return true;
|
||||
// Start aiming
|
||||
if (!fx.weapon->ControlUseStart(this, fx.target->GetX()-GetX(), ty=fx.target->GetY()-GetY())) return false; // something's broken :(
|
||||
fx.aim_weapon = fx.weapon;
|
||||
fx.aim_time = fx.time;
|
||||
// Enough for now
|
||||
return;
|
||||
}
|
||||
// Stuck in aim procedure check?
|
||||
if (GetEffect("IntAimCheckProcedure", this) && !this->ReadyToAction()) return ExecuteStand(fx);
|
||||
// Calculate offset to target. Take movement into account
|
||||
// Also aim for the head (y-4) so it's harder to evade by jumping
|
||||
var x=GetX(), y=GetY(), tx=fx.target->GetX(), ty=fx.target->GetY()-4;
|
||||
var d = Distance(x,y,tx,ty);
|
||||
var dt = d * 10 / fx.projectile_speed; // projected travel time of the arrow
|
||||
tx += fx.target->GetXDir(dt);
|
||||
ty += fx.target->GetYDir(dt);
|
||||
if (!fx.target->GetContact(-1)) ty += GetGravity()*dt*dt/200;
|
||||
// Path to target free?
|
||||
if (PathFree(x,y,tx,ty))
|
||||
{
|
||||
// Get shooting angle
|
||||
var shooting_angle = GetBallisticAngle(tx-x, ty-y, fx.projectile_speed, 160);
|
||||
if (GetType(shooting_angle) != C4V_Nil)
|
||||
{
|
||||
// No ally on path?
|
||||
var ally = FindObject(Find_OnLine(0,0,tx-x,ty-y), Find_Exclude(this), Find_OCF(OCF_Alive), Find_Owner(GetOwner()));
|
||||
if (ally)
|
||||
{
|
||||
if (ExecuteJump()) return true;
|
||||
// can't jump and ally is in the way. just wait.
|
||||
}
|
||||
else
|
||||
{
|
||||
//Message("Bow @ %d!!!", shooting_angle);
|
||||
// Aim/Shoot there
|
||||
x = Sin(shooting_angle,100);
|
||||
y = -Cos(shooting_angle,100);
|
||||
fx.aim_weapon->ControlUseHolding(this, x,y);
|
||||
if (this->IsAiming() && fx.time >= fx.aim_time + fx.aim_wait)
|
||||
{
|
||||
//Log("Throw angle %v speed %v to reach %d %d", shooting_angle, fx.projectile_speed, tx-GetX(), ty-GetY());
|
||||
fx.aim_weapon->ControlUseStop(this, x,y);
|
||||
fx.aim_weapon = nil;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Path not free or out of range. Just wait for enemy to come...
|
||||
//Message("Bow @ %s!!!", fx.target->GetName());
|
||||
fx.aim_weapon->ControlUseHolding(this,tx-x,ty-y);
|
||||
// Might also change target if current is unreachable
|
||||
var new_target;
|
||||
if (!Random(3)) if (new_target = FindTarget(fx)) fx.target = new_target;
|
||||
return true;
|
||||
}
|
||||
|
||||
private func ExecuteLookAtTarget(fx)
|
||||
{
|
||||
// set direction to look at target. can assume this is instantanuous
|
||||
var dir;
|
||||
if (fx.target->GetX() > GetX()) dir = DIR_Right; else dir = DIR_Left;
|
||||
SetDir(dir);
|
||||
return true;
|
||||
}
|
||||
|
||||
private func ExecuteThrow(fx)
|
||||
{
|
||||
// Still carrying the weapon to throw?
|
||||
if (fx.weapon->Contained() != this) { fx.weapon=nil; return false; }
|
||||
// Path to target free?
|
||||
var x=GetX(), y=GetY(), tx=fx.target->GetX(), ty=fx.target->GetY();
|
||||
if (PathFree(x,y,tx,ty))
|
||||
{
|
||||
var throw_speed = this.ThrowSpeed;
|
||||
if (fx.weapon->GetID() == Javelin) throw_speed *= 2;
|
||||
var rx = (throw_speed*throw_speed)/(100*GetGravity()); // horizontal range for 45 degree throw if enemy is on same height as we are
|
||||
var ry = throw_speed*7/(GetGravity()*10); // vertical range of 45 degree throw
|
||||
var dx = tx-x, dy = ty-y+15*GetCon()/100; // distance to target. Reduce vertical distance a bit because throwing exit point is not at center
|
||||
// Check range
|
||||
// Could calculate the optimal parabulum here, but that's actually not very reliable on moving targets
|
||||
// It's usually better to throw straight at the target and only throw upwards a bit if the target stands on high ground or is far away
|
||||
// Also ignoring speed added by own velocity, etc...
|
||||
if (Abs(dx)*ry-Min(dy)*rx <= rx*ry)
|
||||
{
|
||||
// We're in range. Can throw?
|
||||
if (!CheckHandsAction(fx)) return true;
|
||||
// OK. Calc throwing direction
|
||||
dy -= dx*dx/rx; // big math!
|
||||
// And throw!
|
||||
//Message("Throw!");
|
||||
SetCommand("None"); SetComDir(COMD_Stop);
|
||||
return this->ControlThrow(fx.weapon, dx, dy);
|
||||
}
|
||||
}
|
||||
// Can't reach target yet. Walk towards it.
|
||||
if (!GetCommand() || !Random(3)) SetCommand("MoveTo", fx.target);
|
||||
//Message("Throw %s @ %s!!!", fx.weapon->GetName(), fx.target->GetName());
|
||||
return true;
|
||||
}
|
||||
|
||||
private func CheckHandsAction(fx)
|
||||
{
|
||||
// can use hands?
|
||||
if (this->~HasHandAction()) return true;
|
||||
// Can't throw: Is it because e.g. we're scaling?
|
||||
if (!this->HasActionProcedure()) { ExecuteStand(fx); return false; }
|
||||
// Probably hands busy. Just wait.
|
||||
//Message("HandsBusy");
|
||||
return false;
|
||||
}
|
||||
|
||||
private func ExecuteStand(fx)
|
||||
{
|
||||
//Message("Stand");
|
||||
SetCommand("None");
|
||||
if (GetProcedure() == "SCALE")
|
||||
{
|
||||
if (GetDir()==DIR_Left)
|
||||
ObjectControlMovement(GetOwner(), CON_Right, 100);
|
||||
else
|
||||
ObjectControlMovement(GetOwner(), CON_Left, 100);
|
||||
}
|
||||
else if (GetProcedure() == "HANGLE")
|
||||
{
|
||||
ObjectControlMovement(GetOwner(), CON_Down, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hm. What could it be? Let's just hope it resolves itself somehow...
|
||||
SetComDir(COMD_Stop);
|
||||
//Message("???");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private func ExecuteMelee(fx)
|
||||
{
|
||||
// Still carrying the melee weapon?
|
||||
if (fx.weapon->Contained() != this) { fx.weapon=nil; return false; }
|
||||
// Are we in range?
|
||||
var x=GetX(), y=GetY(), tx=fx.target->GetX(), ty=fx.target->GetY();
|
||||
var dx = tx-x, dy = ty-y;
|
||||
if (Abs(dx) <= 10 && PathFree(x,y,tx,ty))
|
||||
{
|
||||
if (dy >= -15)
|
||||
{
|
||||
// target is under us - sword slash downwards!
|
||||
if (!CheckHandsAction(fx)) return true;
|
||||
// Stop here
|
||||
SetCommand("None"); SetComDir(COMD_None);
|
||||
// cooldown?
|
||||
if (!fx.weapon->CanStrikeWithWeapon(this))
|
||||
{
|
||||
//Message("MeleeWAIT %s @ %s!!!", fx.weapon->GetName(), fx.target->GetName());
|
||||
// While waiting for the cooldown, we try to evade...
|
||||
ExecuteEvade(fx,dx,dy);
|
||||
return true;
|
||||
}
|
||||
// OK, slash!
|
||||
//Message("MeleeSLASH %s @ %s!!!", fx.weapon->GetName(), fx.target->GetName());
|
||||
return fx.weapon->ControlUse(this, tx,ty);
|
||||
}
|
||||
// Clonk is above us - jump there
|
||||
//Message("MeleeJump %s @ %s!!!", fx.weapon->GetName(), fx.target->GetName());
|
||||
this->ControlJump();
|
||||
if (dx<-5) SetComDir(COMD_Left); else if (dx>5) SetComDir(COMD_Right); else SetComDir(COMD_None);
|
||||
}
|
||||
// Not in range. Walk there.
|
||||
if (!GetCommand() || !Random(3)) SetCommand("MoveTo", fx.target);
|
||||
//Message("Melee %s @ %s!!!", fx.weapon->GetName(), fx.target->GetName());
|
||||
return true;
|
||||
}
|
||||
|
||||
private func ExecuteEvade(fx,int threat_dx,int threat_dy)
|
||||
{
|
||||
// Evade from threat at position delta threat_*
|
||||
if (threat_dx < 0) SetComDir(COMD_Left); else SetComDir(COMD_Right);
|
||||
if (threat_dy >= -5 && !Random(2)) if (ExecuteJump(fx)) return true;
|
||||
// shield? todo
|
||||
return true;
|
||||
}
|
||||
|
||||
private func ExecuteJump(fx)
|
||||
{
|
||||
// Jump if standing on floor
|
||||
if (GetProcedure() == "WALK")
|
||||
//if (GetContact(-1, CNAT_Bottom)) - implied by walk
|
||||
return this->ControlJump();
|
||||
return false;
|
||||
}
|
||||
|
||||
private func ExecuteArm(fx)
|
||||
{
|
||||
// Find shield
|
||||
if (fx.shield = FindContents(Shield)) this->SetHandItemPos(1, this->GetItemPos(fx.shield));
|
||||
// Find a weapon. For now, just search own inventory
|
||||
if (FindInventoryWeapon(fx) && fx.weapon->Contained()==this)
|
||||
{
|
||||
this->SetHandItemPos(0, this->GetItemPos(fx.weapon));
|
||||
return true;
|
||||
}
|
||||
// no weapon :(
|
||||
return false;
|
||||
}
|
||||
|
||||
private func FindInventoryWeapon(fx)
|
||||
{
|
||||
fx.ammo_check = nil; fx.ranged = false;
|
||||
// Find weapon in inventory, mark it as equipped and set according strategy, etc.
|
||||
if (fx.weapon = fx.vehicle)
|
||||
if (CheckVehicleAmmo(fx, fx.weapon))
|
||||
{ fx.strategy = S2AI.ExecuteVehicle; fx.ranged=true; fx.aim_wait = 20; fx.ammo_check = S2AI.CheckVehicleAmmo; return true; }
|
||||
else
|
||||
fx.weapon = nil;
|
||||
if (fx.weapon = FindContents(Bow))
|
||||
if (HasArrows(fx, fx.weapon))
|
||||
{ fx.strategy = S2AI.ExecuteRanged; fx.projectile_speed = 100; fx.aim_wait = 0; fx.ammo_check = S2AI.HasArrows; fx.ranged=true; return true; }
|
||||
else
|
||||
fx.weapon = nil;
|
||||
if (fx.weapon = FindContents(Javelin)) { fx.strategy = S2AI.ExecuteRanged; fx.projectile_speed = this.ThrowSpeed*21/100; fx.aim_wait = 16; fx.ranged=true; return true; }
|
||||
if (fx.weapon = FindContents(Firestone)) { fx.strategy = S2AI.ExecuteThrow; return true; }
|
||||
if (fx.weapon = FindContents(Rock)) { fx.strategy = S2AI.ExecuteThrow; return true; }
|
||||
if (fx.weapon = FindContents(Sword)) { fx.strategy = S2AI.ExecuteMelee; return true; }
|
||||
//if (fx.weapon = Contents(0)) { fx.strategy = S2AI.ExecuteThrow; return true; } - don't throw empty bow, etc.
|
||||
// no weapon :(
|
||||
return false;
|
||||
}
|
||||
|
||||
private func HasArrows(fx, object weapon)
|
||||
{
|
||||
if (weapon->Contents(0)) return true;
|
||||
if (FindObject(Find_Container(this), Find_Func("IsArrow"))) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private func CheckVehicleAmmo(fx, object catapult)
|
||||
{
|
||||
if (catapult->ContentsCount()) return true;
|
||||
// Vehicle out of ammo: Can't really be refilled. Stop using that weapon.
|
||||
fx.vehicle = nil;
|
||||
this->ObjectCommand("UnGrab");
|
||||
return false;
|
||||
}
|
||||
|
||||
private func ExecuteIdle(fx)
|
||||
{
|
||||
if (!Inside(GetX()-fx.home_x, -5,5) || !Inside(GetY()-fx.home_y, -15,15))
|
||||
{
|
||||
SetCommand("MoveTo", nil, fx.home_x, fx.home_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCommand("None"); SetComDir(COMD_Stop); SetDir(fx.home_dir);
|
||||
}
|
||||
//Message("zZz");
|
||||
return true;
|
||||
}
|
||||
|
||||
private func FindTarget(fx)
|
||||
{
|
||||
// could search for hostile...for now, just search for all other players
|
||||
for (var target in FindObjects(fx.guard_range_check, Find_OCF(OCF_Alive), Find_Not(Find_Owner(GetOwner())), Sort_Random()))
|
||||
if (PathFree(GetX(),GetY(),target->GetX(),target->GetY()))
|
||||
return target;
|
||||
// nothing found
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Helper function: Convert target cordinates and bow out speed to desired shooting angle
|
||||
// Because http://en.wikipedia.org/wiki/Trajectory_of_a_projectile says so
|
||||
// No SimFlight checks to check upper angle (as that is really easy to evade anyway)
|
||||
// just always shoot the lower angle if sight is free
|
||||
private func GetBallisticAngle(int dx, int dy, int v, int max_angle)
|
||||
{
|
||||
// v is in 1/10 pix/frame
|
||||
// gravity is in 1/100 pix/frame^2
|
||||
var g = GetGravity();
|
||||
// correct vertical distance to account for integration error
|
||||
// engine adds gravity after movement, so targets fly higher than they should
|
||||
// thus, we aim lower. we don't know the travel time yet, so we assume some 90% of v is horizontal
|
||||
// (it's ~2px correction for 200px shooting distance)
|
||||
dy += Abs(dx)*q*10/(v*180);
|
||||
//Log("Correction: Aiming %d lower!", Abs(dx)*q*10/(v*180));
|
||||
// q is in 1/10000 (pix/frame)^4
|
||||
var q = v**4 - g*(g*dx*dx-2*dy*v*v); // dy is negative up
|
||||
if (q<0) return nil; // out of range
|
||||
var a = (Angle(0,0,g*dx,Sqrt(q)-v*v)+180)%360-180;
|
||||
// Check bounds
|
||||
if(!Inside(a, -max_angle, max_angle)) return nil;
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
/* Editor display */
|
||||
|
||||
// called in clonk context
|
||||
func UpdateDebugDisplay(fx)
|
||||
{
|
||||
if (fx.debug) { EditCursorDeselection(fx); EditCursorSelection(fx); }
|
||||
return true;
|
||||
}
|
||||
|
||||
// called in clonk context
|
||||
func EditCursorSelection(fx)
|
||||
{
|
||||
// clear previous
|
||||
if (fx.debug) EditCursorDeselection(fx);
|
||||
// encounter message
|
||||
var msg = "";
|
||||
if (fx.encounter_cb) msg = Format("%s%v", msg, fx.encounter_cb);
|
||||
// contents message
|
||||
for (var i=0; i<ContentsCount(); ++i)
|
||||
msg = Format("%s{{%i}}", msg, Contents(i)->GetID());
|
||||
Message("@AI %s", msg);
|
||||
// draw ally alert range. draw as square, although a circle would be more appropriate
|
||||
fx.debug = {};
|
||||
var clr;
|
||||
var x=GetX(), y=GetY();
|
||||
if (fx.ally_alert_range)
|
||||
{
|
||||
clr = 0xffffff00;
|
||||
fx.debug.a1 = DebugLine->Create(x,y-fx.ally_alert_range,x+fx.ally_alert_range,y,clr);
|
||||
fx.debug.a2 = DebugLine->Create(x+fx.ally_alert_range,y,x,y+fx.ally_alert_range,clr);
|
||||
fx.debug.a3 = DebugLine->Create(x,y+fx.ally_alert_range,x-fx.ally_alert_range,y,clr);
|
||||
fx.debug.a4 = DebugLine->Create(x-fx.ally_alert_range,y,x,y-fx.ally_alert_range,clr);
|
||||
}
|
||||
// draw guard range
|
||||
if (fx.guard_range.wdt && fx.guard_range.hgt)
|
||||
{
|
||||
clr = 0xffff0000;
|
||||
fx.debug.r1 = DebugLine->Create(fx.guard_range.x,fx.guard_range.y,fx.guard_range.x+fx.guard_range.wdt,fx.guard_range.y,clr);
|
||||
fx.debug.r2 = DebugLine->Create(fx.guard_range.x+fx.guard_range.wdt,fx.guard_range.y,fx.guard_range.x+fx.guard_range.wdt,fx.guard_range.y+fx.guard_range.hgt,clr);
|
||||
fx.debug.r3 = DebugLine->Create(fx.guard_range.x+fx.guard_range.wdt,fx.guard_range.y+fx.guard_range.hgt,fx.guard_range.x,fx.guard_range.y+fx.guard_range.hgt,clr);
|
||||
fx.debug.r4 = DebugLine->Create(fx.guard_range.x,fx.guard_range.y+fx.guard_range.hgt,fx.guard_range.x,fx.guard_range.y,clr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// called in clonk context
|
||||
func EditCursorDeselection(fx)
|
||||
{
|
||||
if (fx.debug)
|
||||
{
|
||||
if (fx.debug.r1) fx.debug.r1->RemoveObject();
|
||||
if (fx.debug.r2) fx.debug.r2->RemoveObject();
|
||||
if (fx.debug.r3) fx.debug.r3->RemoveObject();
|
||||
if (fx.debug.r4) fx.debug.r4->RemoveObject();
|
||||
if (fx.debug.a1) fx.debug.a1->RemoveObject();
|
||||
if (fx.debug.a2) fx.debug.a2->RemoveObject();
|
||||
if (fx.debug.a3) fx.debug.a3->RemoveObject();
|
||||
if (fx.debug.a4) fx.debug.a4->RemoveObject();
|
||||
Message("");
|
||||
}
|
||||
fx.debug = nil;
|
||||
return true;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
// Editor tweak
|
||||
|
||||
#appendto Clonk
|
||||
|
||||
func EditCursorSelection()
|
||||
{
|
||||
var ai = S2AI->GetAI(this);
|
||||
if (ai) Call(S2AI.EditCursorSelection, ai);
|
||||
return _inherited(...);
|
||||
}
|
||||
|
||||
func EditCursorDeselection()
|
||||
{
|
||||
var ai = S2AI->GetAI(this);
|
||||
if (ai) Call(S2AI.EditCursorDeselection, ai);
|
||||
return _inherited(...);
|
||||
}
|
|
@ -1,26 +1,26 @@
|
|||
{\rtf1\ansi\deff0\adeflang1025
|
||||
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset1 Times New Roman;}{\f4\froman\fprq0\fcharset1 Times New Roman;}{\f5\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f6\fnil\fprq2\fcharset0 Mangal;}{\f7\fnil\fprq0\fcharset1 Mangal;}}
|
||||
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
|
||||
{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043 Normal;}
|
||||
{\s15\sbasedon0\snext16\sb240\sa120\keepn\dbch\af5\dbch\af6\afs28\loch\f2\fs28 Heading;}
|
||||
{\s16\sbasedon0\snext16\sb0\sa120 Text body;}
|
||||
{\s17\sbasedon16\snext17\sb0\sa120\dbch\af7 List;}
|
||||
{\s18\sbasedon0\snext18\sb120\sa120\noline\i\dbch\af7\afs24\ai\fs24 Caption;}
|
||||
{\s19\sbasedon0\snext19\noline\dbch\af7 Index;}
|
||||
}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern3600}}\deftab720
|
||||
\viewscale100
|
||||
{\*\pgdsctbl
|
||||
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Default;}}
|
||||
\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\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar{\b\kerning1\rtlch \ltrch\loch\fs20\lang1033\loch\f4
|
||||
Arena}
|
||||
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar\b\kerning1\rtlch \ltrch\loch\fs20\lang1033\loch\f4
|
||||
|
||||
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
Dieser Rundenordner enth\u228\'e4lt }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
experimentale }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
Runden }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
und Runden zum Zwecke von entwicklen}{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
. }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
Diese Runden k\u246\'f6nnen einfach gespielt werden und wir freuen uns \u252\'fcber Kommentar in das Forum }
|
||||
{\rtf1\ansi\deff0\adeflang1025
|
||||
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset1 Times New Roman;}{\f4\froman\fprq0\fcharset1 Times New Roman;}{\f5\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f6\fnil\fprq2\fcharset0 Mangal;}{\f7\fnil\fprq0\fcharset1 Mangal;}}
|
||||
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
|
||||
{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043 Normal;}
|
||||
{\s15\sbasedon0\snext16\sb240\sa120\keepn\dbch\af5\dbch\af6\afs28\loch\f2\fs28 Heading;}
|
||||
{\s16\sbasedon0\snext16\sb0\sa120 Text body;}
|
||||
{\s17\sbasedon16\snext17\sb0\sa120\dbch\af7 List;}
|
||||
{\s18\sbasedon0\snext18\sb120\sa120\noline\i\dbch\af7\afs24\ai\fs24 Caption;}
|
||||
{\s19\sbasedon0\snext19\noline\dbch\af7 Index;}
|
||||
}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern3600}}\deftab720
|
||||
\viewscale100
|
||||
{\*\pgdsctbl
|
||||
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Default;}}
|
||||
\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\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar{\b\kerning1\rtlch \ltrch\loch\fs20\lang1033\loch\f4
|
||||
Arena}
|
||||
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar\b\kerning1\rtlch \ltrch\loch\fs20\lang1033\loch\f4
|
||||
|
||||
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
Dieser Rundenordner enth\u228\'e4lt }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
experimentale }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
Runden }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
und Runden zum Zwecke von entwicklen}{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
. }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
Diese Runden k\u246\'f6nnen einfach gespielt werden und wir freuen uns \u252\'fcber Kommentar in das Forum }
|
||||
\par }
|
|
@ -1,22 +1,22 @@
|
|||
{\rtf1\ansi\deff0\adeflang1025
|
||||
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset1 Times New Roman;}{\f4\froman\fprq0\fcharset1 Times New Roman;}{\f5\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f6\fnil\fprq2\fcharset0 Mangal;}{\f7\fnil\fprq0\fcharset1 Mangal;}}
|
||||
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
|
||||
{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043 Normal;}
|
||||
{\s15\sbasedon0\snext16\sb240\sa120\keepn\dbch\af5\dbch\af6\afs28\loch\f2\fs28 Heading;}
|
||||
{\s16\sbasedon0\snext16\sb0\sa120 Text body;}
|
||||
{\s17\sbasedon16\snext17\sb0\sa120\dbch\af7 List;}
|
||||
{\s18\sbasedon0\snext18\sb120\sa120\noline\i\dbch\af7\afs24\ai\fs24 Caption;}
|
||||
{\s19\sbasedon0\snext19\noline\dbch\af7 Index;}
|
||||
}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern3600}}\deftab720
|
||||
\viewscale100
|
||||
{\*\pgdsctbl
|
||||
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Default;}}
|
||||
\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\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar{\b\kerning1\rtlch \ltrch\loch\fs20\lang1033\loch\f4
|
||||
Experimental}
|
||||
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar\b\kerning1\rtlch \ltrch\loch\fs20\lang1033\loch\f4
|
||||
|
||||
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar{{\*\bkmkstart __DdeLink__2_537781242}\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
This scenario folder contains }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4{\*\bkmkend __DdeLink__2_537781242}
|
||||
experimental scenarios and scenarios for testing purposes. Feel free to play them and post any feedback in our forums.}
|
||||
{\rtf1\ansi\deff0\adeflang1025
|
||||
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset1 Times New Roman;}{\f4\froman\fprq0\fcharset1 Times New Roman;}{\f5\fnil\fprq2\fcharset0 Microsoft YaHei;}{\f6\fnil\fprq2\fcharset0 Mangal;}{\f7\fnil\fprq0\fcharset1 Mangal;}}
|
||||
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
|
||||
{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043 Normal;}
|
||||
{\s15\sbasedon0\snext16\sb240\sa120\keepn\dbch\af5\dbch\af6\afs28\loch\f2\fs28 Heading;}
|
||||
{\s16\sbasedon0\snext16\sb0\sa120 Text body;}
|
||||
{\s17\sbasedon16\snext17\sb0\sa120\dbch\af7 List;}
|
||||
{\s18\sbasedon0\snext18\sb120\sa120\noline\i\dbch\af7\afs24\ai\fs24 Caption;}
|
||||
{\s19\sbasedon0\snext19\noline\dbch\af7 Index;}
|
||||
}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern3600}}\deftab720
|
||||
\viewscale100
|
||||
{\*\pgdsctbl
|
||||
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Default;}}
|
||||
\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\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar{\b\kerning1\rtlch \ltrch\loch\fs20\lang1033\loch\f4
|
||||
Experimental}
|
||||
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar\b\kerning1\rtlch \ltrch\loch\fs20\lang1033\loch\f4
|
||||
|
||||
\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af8\langfe2052\dbch\af6\afs24\alang1081\loch\f0\fs24\lang1043\nowidctlpar{{\*\bkmkstart __DdeLink__2_537781242}\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4
|
||||
This scenario folder contains }{\b0\kerning1\rtlch \ltrch\loch\fs16\lang1043\loch\f4{\*\bkmkend __DdeLink__2_537781242}
|
||||
experimental scenarios and scenarios for testing purposes. Feel free to play them and post any feedback in our forums.}
|
||||
\par }
|
|
@ -0,0 +1,5 @@
|
|||
[DefCore]
|
||||
id=Goal_Assassination
|
||||
Version=5,2,0,1
|
||||
Category=C4D_StaticBack|C4D_Goal
|
||||
Picture=0,0,128,128
|
After Width: | Height: | Size: 22 KiB |
|
@ -0,0 +1,66 @@
|
|||
/*--
|
||||
Assassination goal
|
||||
Author: Sven2
|
||||
|
||||
Target object must die.
|
||||
--*/
|
||||
|
||||
|
||||
#include Library_Goal
|
||||
|
||||
local victim, victim_name;
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
return inherited(...);
|
||||
}
|
||||
|
||||
func SetVictim(object to_victim)
|
||||
{
|
||||
victim = to_victim;
|
||||
if (victim) victim_name = victim->GetName(); else victim_name = "???";
|
||||
SetName(Format("$Name2$", victim_name));
|
||||
return true;
|
||||
}
|
||||
|
||||
public func IsFulfilled()
|
||||
{
|
||||
if (!victim) return true; // pushed out of landscape?
|
||||
return !victim->GetAlive();
|
||||
}
|
||||
|
||||
public func Activate(int byplr)
|
||||
{
|
||||
if (IsFulfilled())
|
||||
ToggleGoalMessage(Format("$MsgGoalFulfilled$", victim_name), byplr);
|
||||
else
|
||||
ToggleGoalMessage(Format("$MsgGoalUnFulfilled$", victim_name), 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$";
|
|
@ -0,0 +1,4 @@
|
|||
Name=Toeten!
|
||||
Name2=Toete %s!
|
||||
MsgGoalFulfilled=%s ist tot.
|
||||
MsgGoalUnFulfilled=Toete %s!
|
|
@ -0,0 +1,4 @@
|
|||
Name=Kill!
|
||||
Name2=Kill %s!
|
||||
MsgGoalFulfilled=%s is dead.
|
||||
MsgGoalUnFulfilled=Kill %s!
|
|
@ -0,0 +1,10 @@
|
|||
[DefCore]
|
||||
id=Dialogue
|
||||
Version=5,2,0,1
|
||||
Category=C4D_StaticBack
|
||||
Picture=0,0,64,64
|
||||
Width=1
|
||||
Height=1
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 8.2 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.2 KiB |
|
@ -0,0 +1,42 @@
|
|||
/* Nachrichten fuers Intro */
|
||||
|
||||
func MessageBoxAll(string message, object talker, bool permanent)
|
||||
{
|
||||
if (permanent) permanent = "@"; else permanent = "";
|
||||
message = Format("%s<c %x>%s:</c> %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 Dialogue;
|
||||
// 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(Dialogue);
|
||||
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"
|
||||
}
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
[DefCore]
|
||||
id=LargeCaveMushroomPoison
|
||||
Version=5,2,0,1
|
||||
Category=C4D_Vehicle
|
||||
Width=2
|
||||
Height=2
|
||||
Offset=0,-1
|
||||
Vertices=1
|
||||
VertexFriction=1
|
||||
Mass=1
|
||||
Oversize=1
|
||||
Float=1
|
||||
StretchGrowth=1
|
After Width: | Height: | Size: 923 B |
|
@ -0,0 +1,46 @@
|
|||
/*-- LargeCaveMushroomPoison --*/
|
||||
|
||||
func LaunchPoison(int x, int y, int vx, int vy, int owner)
|
||||
{
|
||||
var poison = CreateObject(LargeCaveMushroomPoison, x,y, owner);
|
||||
if (poison) poison->Launch(vx,vy);
|
||||
return poison;
|
||||
}
|
||||
|
||||
func Launch(int vx, int vy)
|
||||
{
|
||||
SetXDir(vx); SetYDir(vy);
|
||||
SetRDir(Random(21)-10);
|
||||
var fx = AddEffect("Move", this, 1, 2, this);
|
||||
fx.lifetime = 100+Random(50);
|
||||
return true;
|
||||
}
|
||||
|
||||
func ContactBottom()
|
||||
{
|
||||
// bouncy bouncy!
|
||||
SetXDir(Random(11)-5);
|
||||
SetYDir(-5-Random(10));
|
||||
SetRDir(Random(21)-10);
|
||||
return true;
|
||||
}
|
||||
|
||||
public func FxMoveTimer(object target, fx, int time)
|
||||
{
|
||||
// lifetime
|
||||
if (time > fx.lifetime || Stuck() || GBackLiquid()) { RemoveObject(); return FX_Execute_Kill; }
|
||||
// Search victim to poison
|
||||
var victim = FindObject(Find_AtRect(-5,-5,11,11), Find_OCF(OCF_Alive), Find_Layer(GetObjectLayer()));
|
||||
if (victim)
|
||||
{
|
||||
var dx=victim->GetX()-GetX(), dy=victim->GetY()-GetY();
|
||||
var d=Max(Distance(dx,dy),1);
|
||||
dx=dx*20/d; dy=dy*20/d;
|
||||
SetXDir(dx); SetYDir(dy-5);
|
||||
victim->DoEnergy(-1, false, FX_Call_EngCorrosion, GetOwner());
|
||||
}
|
||||
// gfx effect
|
||||
Smoke(Random(3)-1,-Random(3),5+Random(10),0xffa0ff80);
|
||||
}
|
||||
|
||||
local Plane = 550;
|
|
@ -0,0 +1 @@
|
|||
Name=Gift
|
|
@ -0,0 +1 @@
|
|||
Name=Poison
|
After Width: | Height: | Size: 40 KiB |
|
@ -0,0 +1,74 @@
|
|||
# Static Map Material/Texture Table
|
||||
# Index +128 for underground materials
|
||||
8=Tunnel-brickback3
|
||||
9=Tunnel-brickback2
|
||||
10=Tunnel-tunnel
|
||||
11=Tunnel-tunnel
|
||||
12=Tunnel-brickback
|
||||
13=BrickSoft-brick1
|
||||
19=DuroLava-lava_red
|
||||
20=Water-water1-water2-water3-water1-water3-water2
|
||||
#21=Oil-Liquid
|
||||
22=Acid-acid
|
||||
23=Lava-lava_red
|
||||
24=DuroLava-lava_red
|
||||
25=Water-water
|
||||
#26=Oil-Smooth
|
||||
27=Acid-acid
|
||||
28=Lava-lava_red
|
||||
29=Earth-earth_dry
|
||||
30=Earth-earth_rough
|
||||
31=Earth-earth_topsoil
|
||||
32=Earth-earth_midsoil
|
||||
33=Ashes-ashes
|
||||
#34=Ashes-Rough
|
||||
#35=Ashes-Ridge
|
||||
|
||||
36=Ore-ore
|
||||
37=Ore-ore
|
||||
38=Ore-ore
|
||||
|
||||
40=Granite-granite
|
||||
41=Granite-granite
|
||||
42=Granite-rock
|
||||
|
||||
45=Gold-gold
|
||||
|
||||
50=Rock-rock
|
||||
51=Rock-rock_cracked
|
||||
52=Rock-rock
|
||||
|
||||
53=Sulphur-sulphur
|
||||
|
||||
54=Coal-coal
|
||||
|
||||
55=Sand-sand_rough
|
||||
56=Sand-sand_smooth
|
||||
#57=Sand-Smooth3
|
||||
|
||||
|
||||
|
||||
#59=FlyAshes-Smooth
|
||||
|
||||
#60=Crystal-Flare
|
||||
#61=Crystal-Structure
|
||||
#62=Crystal-Structure2
|
||||
|
||||
65=Ice-ice2
|
||||
66=Ice-ice2
|
||||
67=Ice-ice3
|
||||
68=Ice-ice3
|
||||
|
||||
70=Snow-snow1
|
||||
71=Snow-snow1
|
||||
72=Snow-snow1
|
||||
73=Brick-brick1
|
||||
74=Brick-brick2
|
||||
|
||||
#80=FlySand-Smooth2
|
||||
#81=FlySand-Smooth3
|
||||
#82=FlySand-Smooth
|
||||
|
||||
|
||||
OverloadMaterials
|
||||
OverloadTextures
|
After Width: | Height: | Size: 540 KiB |
After Width: | Height: | Size: 489 KiB |
After Width: | Height: | Size: 425 KiB |
|
@ -0,0 +1,15 @@
|
|||
[DefCore]
|
||||
id=Ruin1
|
||||
Version=5,2,0,1
|
||||
Category=C4D_Structure
|
||||
Width=94
|
||||
Height=43
|
||||
Offset=-47,-23
|
||||
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
|
After Width: | Height: | Size: 54 KiB |
|
@ -0,0 +1,6 @@
|
|||
/*-- Ruin --*/
|
||||
|
||||
local Name = "$Name$";
|
||||
local Description ="$Description$";
|
||||
local BlastIncinerate = 100;
|
||||
local HitPoints = 70;
|
|
@ -0,0 +1,2 @@
|
|||
Name=Ruine
|
||||
Description=Relikt vergangener Siedlungen.
|
|
@ -0,0 +1,2 @@
|
|||
Name=Ruin
|
||||
Description=Relic of past settlements.
|
|
@ -0,0 +1,14 @@
|
|||
[DefCore]
|
||||
id=Ruin2
|
||||
Version=5,2,0,1
|
||||
Category=C4D_Structure
|
||||
Width=80
|
||||
Height=96
|
||||
Offset=-40,-48
|
||||
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;
|
After Width: | Height: | Size: 88 KiB |
|
@ -0,0 +1,6 @@
|
|||
/*-- Ruin --*/
|
||||
|
||||
local Name = "$Name$";
|
||||
local Description ="$Description$";
|
||||
local BlastIncinerate = 100;
|
||||
local HitPoints = 70;
|
|
@ -0,0 +1,2 @@
|
|||
Name=Ruine
|
||||
Description=Relikt vergangener Siedlungen.
|
|
@ -0,0 +1,2 @@
|
|||
Name=Ruin
|
||||
Description=Relic of past settlements.
|
|
@ -0,0 +1,14 @@
|
|||
[DefCore]
|
||||
id=Ruin3
|
||||
Version=5,2,90,21
|
||||
Category=C4D_Structure
|
||||
Width=50
|
||||
Height=52
|
||||
Offset=-25,-26
|
||||
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
|
After Width: | Height: | Size: 42 KiB |
|
@ -0,0 +1,6 @@
|
|||
/*-- Ruin --*/
|
||||
|
||||
local Name = "$Name$";
|
||||
local Description ="$Description$";
|
||||
local BlastIncinerate = 100;
|
||||
local HitPoints = 70;
|
|
@ -0,0 +1,2 @@
|
|||
Name=Ruine
|
||||
Description=Relikt vergangener Siedlungen.
|
|
@ -0,0 +1,2 @@
|
|||
Name=Ruin
|
||||
Description=Relic of past settlements.
|
|
@ -0,0 +1,36 @@
|
|||
[Head]
|
||||
Icon=36
|
||||
Title=EvilCastle
|
||||
Version=5,3,90
|
||||
Difficulty=30
|
||||
NoInitialize=true
|
||||
|
||||
[Definitions]
|
||||
Definition2=Experimental.ocd\EnemyAI.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;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Loam=1;Bucket=1;Sword=1;Metal=1;GoldBar=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;
|
||||
|
||||
[Player2]
|
||||
Knowledge=ToolsWorkshop=1;Foundry=1;Flagpole=1;Elevator=1;Armory=1;ChemicalLab=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Loam=1;Bucket=1;Sword=1;Metal=1;GoldBar=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;
|
||||
|
||||
[Player3]
|
||||
Knowledge=ToolsWorkshop=1;Foundry=1;Flagpole=1;Elevator=1;Armory=1;ChemicalLab=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Loam=1;Bucket=1;Sword=1;Metal=1;GoldBar=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;
|
||||
|
||||
[Player4]
|
||||
Knowledge=ToolsWorkshop=1;Foundry=1;Flagpole=1;Elevator=1;Armory=1;ChemicalLab=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;ToolsWorkshop_SplitFirestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;Loam=1;Bucket=1;Sword=1;Metal=1;GoldBar=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;
|
||||
|
||||
[Landscape]
|
||||
Sky=Clouds2
|
||||
MapWidth=200,0,64,10000
|
||||
MapHeight=200,0,40,10000
|
||||
NoScan=true
|
||||
FlatChunkShapes=0
|
||||
|
||||
[Weather]
|
||||
Climate=0,10,0,100
|
||||
YearSpeed=0,0,0,100
|
||||
Wind=0,100,-100,100
|
|
@ -0,0 +1,122 @@
|
|||
/**
|
||||
Evil Castle
|
||||
Desc
|
||||
|
||||
@authors Sven2
|
||||
*/
|
||||
|
||||
static const S2DD_InitialRelaunchs = 0;
|
||||
|
||||
static g_is_initialized;
|
||||
|
||||
func DoInit(int first_player)
|
||||
{
|
||||
// Goal
|
||||
var goal = CreateObject(Goal_Assassination);
|
||||
if (goal) goal->SetVictim(Object(3816));
|
||||
// Elevators
|
||||
// Top
|
||||
Object(332)->SetNoPowerNeed(true);
|
||||
Object(331)->CreateShaft(470);
|
||||
// Left
|
||||
Object(420)->CreateShaft(100);
|
||||
// Shrooms
|
||||
Object(2318)->AddPoisonEffect(0,0); // floor left
|
||||
Object(2369)->AddPoisonEffect(0,0); // ceiling left
|
||||
Object(2375)->AddPoisonEffect(-20,0); // floor right
|
||||
Object(2398)->AddPoisonEffect(10,-10); // ceiling right
|
||||
// Scorching village
|
||||
Object(343)->AddScorch(-20,-10, -45, 50, 1500);
|
||||
Object(344)->AddScorch(-15,42, 90, 50, 1200);
|
||||
Object(346)->AddScorch(-12,18, 130, 80, 1300);
|
||||
// Rules
|
||||
CreateObject(Rule_TeamAccount);
|
||||
CreateObject(Rule_NoPowerNeed);
|
||||
// Horax
|
||||
Object(3816).JumpSpeed = 200;
|
||||
// Update AI stuff
|
||||
var fx;
|
||||
for (var enemy in FindObjects(Find_ID(Clonk), Find_Owner(NO_OWNER)))
|
||||
if (fx = S2AI->GetAI(enemy))
|
||||
{
|
||||
fx.weapon = fx.target = nil;
|
||||
S2AI->BindInventory(enemy);
|
||||
enemy->DoEnergy(10000);
|
||||
enemy->AddEnergyBar();
|
||||
}
|
||||
// Intro. Message 250 frames + regular message time
|
||||
Dialogue->MessageBoxAll("$MsgIntro1$", Object(2648), true);
|
||||
Schedule(nil, "Dialogue->MessageBoxAll(\"$MsgIntro1$\", Object(2648))", 250, 1);
|
||||
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);
|
||||
// Initial join
|
||||
JoinPlayer(plr);
|
||||
return true;
|
||||
}
|
||||
|
||||
func RelaunchPlayer(int plr)
|
||||
{
|
||||
var clonk = CreateObject(Clonk, 50, 1000, plr);
|
||||
clonk->MakeCrewMember(plr);
|
||||
SetCursor(plr, clonk);
|
||||
JoinPlayer(plr);
|
||||
return true;
|
||||
}
|
||||
|
||||
func JoinPlayer(int plr)
|
||||
{
|
||||
// Place in village
|
||||
var crew;
|
||||
for(var index = 0; crew = GetCrew(plr, index); ++index)
|
||||
{
|
||||
var x = 35 + Random(10);
|
||||
var y = 1140;
|
||||
crew->SetPosition(x , y);
|
||||
crew->SetDir(DIR_Right);
|
||||
crew->DoEnergy(1000);
|
||||
// First crew member gets shovel and hammer. Try to get those items from the corpse if they still exist
|
||||
// so we don't end up with dozens of useless shovels
|
||||
if (!index)
|
||||
{
|
||||
for (var equip_id in [Shovel, Hammer])
|
||||
{
|
||||
var obj = FindObject(Find_ID(equip_id), Find_Owner(plr));
|
||||
if (obj) obj->Enter(crew); else crew->CreateContents(equip_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Enemy encounter messages */
|
||||
|
||||
func EncounterCave(object enemy, object player)
|
||||
{
|
||||
Dialogue->MessageBoxAll("$MsgEncounterCave$", enemy);
|
||||
return true;
|
||||
}
|
||||
|
||||
func EncounterOutpost(object enemy, object player)
|
||||
{
|
||||
Dialogue->MessageBoxAll("$MsgEncounterOutpost$", enemy);
|
||||
return true;
|
||||
}
|
||||
|
||||
func EncounterKing(object enemy, object player)
|
||||
{
|
||||
if (!player) player = enemy; // Leads to a funny message, but better than a null pointer.
|
||||
Dialogue->MessageBoxAll(Format("$MsgEncounterKing$", player->GetName()), enemy);
|
||||
return true;
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
MsgIntro1=Hilfe! King Horax hat unser Dorf zerstoert und wir sind alle zu feige, ihn anzugreifen. Koennt Ihr ihm Einhalt gebieten?
|
||||
MsgEncounterCave=Ein Eindringling klaut unser Gold! Schnappt ihn!
|
||||
MsgEncounterOutpost=Halt, im Namen des Koenigs!
|
||||
MsgEncounterKing=Ah, %s. Ich habe Euch bereits erwartet.
|
|
@ -0,0 +1,4 @@
|
|||
MsgIntro1=Help! Tyrant Horax has destroyed our village, drank all our beer and taken our women. We are too chicken to face him ourselves; can you please stop him?
|
||||
MsgEncounterCave=An intruder tries to steal out gold. Catch him!
|
||||
MsgEncounterOutpost=Stop, in the name of the king!
|
||||
MsgEncounterKing=Ah, %s. I have been awaiting you.
|
|
@ -0,0 +1,26 @@
|
|||
global func AddScorch(int x, int y, int r, int strength, int duration)
|
||||
{
|
||||
var scorch = CreateObject(Wood, x,y, NO_OWNER);
|
||||
if (!scorch) return nil;
|
||||
scorch->SetObjectLayer(scorch);
|
||||
scorch->SetR(r);
|
||||
scorch->SetClrModulation(0x80804000);
|
||||
scorch->SetCategory(C4D_StaticBack);
|
||||
scorch.Collectible = false; // SetObjectLayer is not enough...
|
||||
scorch.Plane = this.Plane+1;
|
||||
var fx = AddEffect("FireScorching", scorch, 1, 2, scorch);
|
||||
fx.strength = strength;
|
||||
fx.duration = duration;
|
||||
return scorch;
|
||||
}
|
||||
|
||||
global func FxFireScorchingTimer(object target, proplist effect, int time)
|
||||
{
|
||||
if (time >= effect.duration) { RemoveObject(); return FX_Execute_Kill; }
|
||||
// particles
|
||||
var wind = BoundBy(GetWind(), -5, 5);
|
||||
var smoke_color = RGBa(255,255,255, 50);
|
||||
var size = (50 + Random(200)) * effect.strength / 100;
|
||||
CreateParticle("ExploSmoke", RandomX(-5, 5), RandomX(-5, 5), wind, -effect.strength/8, size, smoke_color);
|
||||
return FX_OK;
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
/* Poison trigger on cave mushroom */
|
||||
// Adds a timer that checks for passing Clonks and sprays poison at them
|
||||
|
||||
#appendto LargeCaveMushroom
|
||||
|
||||
static const ShroomPoison_SprayOffY = -20,
|
||||
ShroomPoison_SearchWdt = 30,
|
||||
ShroomPoison_SearchHgt = 50,
|
||||
ShroomPoison_SearchOffY = 8;
|
||||
|
||||
func AddPoisonEffect(int off_x, int off_y)
|
||||
{
|
||||
// off_x and off_y is the offset of the cap of the unrotated mushroom from its regular position at GetX()/GetY()-20
|
||||
// set this to match offset caused by animation
|
||||
var fx = AddEffect("SearchPoisonTarget", this, 1, 12, this);
|
||||
if (fx)
|
||||
{
|
||||
fx.off_x = off_x;
|
||||
fx.off_y = off_y;
|
||||
}
|
||||
return fx;
|
||||
}
|
||||
|
||||
func FxSearchPoisonTargetTimer(object target, proplist fx)
|
||||
{
|
||||
// Currently on cooldown?
|
||||
if (fx.cooldown) if (--fx.cooldown) return FX_OK;
|
||||
// Find target to spray poison at
|
||||
var victim = FindObject(Find_AtRect(XY2TX(fx.off_x,fx.off_y+ShroomPoison_SearchOffY)-ShroomPoison_SearchWdt/2,XY2TY(fx.off_x,fx.off_y+ShroomPoison_SearchOffY)-ShroomPoison_SearchHgt/2,ShroomPoison_SearchWdt,ShroomPoison_SearchHgt), Find_OCF(OCF_Alive), Find_Layer(GetObjectLayer()));
|
||||
if (!victim) return FX_OK;
|
||||
// Target found. Spray!
|
||||
var src_x = GetX()+XY2TX(fx.off_x,fx.off_y);
|
||||
var src_y = GetY()+XY2TY(fx.off_x,fx.off_y+ShroomPoison_SprayOffY);
|
||||
var tx=victim->GetX()-src_x, ty=victim->GetY()-src_y;
|
||||
var d=Max(Distance(tx,ty),1);
|
||||
var vx=tx*30/d, vy=ty*30/d-15;
|
||||
for (var i=0; i<5; ++i)
|
||||
LargeCaveMushroomPoison->LaunchPoison(src_x+Random(11)-5,src_y+Random(11)-5,vx+Random(11)-5,vy+Random(11)-5, GetOwner());
|
||||
Sound("PoisonLaunch");
|
||||
// Don't spray again for a few seconds
|
||||
fx.cooldown=10;
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
// apply rotation and scale to x/y coordinates
|
||||
func XY2TX(int x, int y) { var r=GetR(); return (Cos(r,x)-Sin(r,y))*GetCon()/100; }
|
||||
func XY2TY(int x, int y) { var r=GetR(); return (Sin(r,x)+Cos(r,y))*GetCon()/100; }
|
||||
|
||||
|
||||
/* Debug display */
|
||||
|
||||
func DbgShowSprayRange(fx)
|
||||
{
|
||||
if (fx.dbg_rect) DbgHideSprayRange(fx);
|
||||
// Debug function to show search and spray range
|
||||
var x1=ShroomPoison_SearchWdt/-2+XY2TX(fx.off_x,fx.off_y+ShroomPoison_SearchOffY)+GetX(), y1=ShroomPoison_SearchHgt/-2+XY2TY(fx.off_x,fx.off_y+ShroomPoison_SearchOffY)+GetY();
|
||||
var x2=x1+ShroomPoison_SearchWdt, y2=y1+ShroomPoison_SearchHgt;
|
||||
fx.dbg_rect = DrawRect(x1,y1,x2,y2,0xff00ff00);
|
||||
fx.dbg_pos = CreateObject(Rock);
|
||||
if (fx.dbg_pos)
|
||||
{
|
||||
fx.dbg_pos->SetPosition(GetX()+XY2TX(fx.off_x,fx.off_y),GetY()+XY2TY(fx.off_x,fx.off_y+ShroomPoison_SprayOffY));
|
||||
fx.dbg_pos->SetCategory(1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
func DrawRect(int x1,int y1,int x2,int y2,int clr)
|
||||
{
|
||||
var r = {};
|
||||
r.t=DebugLine->Create(x1,y1,x2,y1,clr);
|
||||
r.r=DebugLine->Create(x2,y1,x2,y2,clr);
|
||||
r.b=DebugLine->Create(x2,y2,x1,y2,clr);
|
||||
r.l=DebugLine->Create(x1,y2,x1,y1,clr);
|
||||
return r;
|
||||
}
|
||||
|
||||
func ClearRect(r)
|
||||
{
|
||||
if (r.t) r.t->RemoveObject();
|
||||
if (r.r) r.r->RemoveObject();
|
||||
if (r.b) r.b->RemoveObject();
|
||||
if (r.l) r.l->RemoveObject();
|
||||
return true;
|
||||
}
|
||||
|
||||
func DbgHideSprayRange(fx)
|
||||
{
|
||||
if (fx.dbg_rect) { ClearRect(fx.dbg_rect); fx.dbg_rect = nil; }
|
||||
if (fx.dbg_pos) { fx.dbg_pos->RemoveObject(); fx.dbg_pos = nil; }
|
||||
return true;
|
||||
}
|
||||
|
||||
func EditCursorSelection()
|
||||
{
|
||||
var fx = GetEffect("SearchPoisonTarget", this);
|
||||
if (fx) DbgShowSprayRange(fx);
|
||||
return _inherited(...);
|
||||
}
|
||||
|
||||
func EditCursorDeselection()
|
||||
{
|
||||
var fx = GetEffect("SearchPoisonTarget", this);
|
||||
if (fx) DbgHideSprayRange(fx);
|
||||
return _inherited(...);
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
[Teams]
|
||||
Active=false
|
||||
Custom=false
|
||||
AutoGenerateTeams=true
|
|
@ -0,0 +1,2 @@
|
|||
DE:Finsterschloss
|
||||
US:Dark castle
|
|
@ -0,0 +1,31 @@
|
|||
/* Hot ice */
|
||||
|
||||
overlay Ice {
|
||||
mat=Ice; tex=ice2;
|
||||
overlay {
|
||||
algo=rndchecker; a=0;
|
||||
zoomX=-100; zoomY=-100;
|
||||
turbulence=100; lambda=3;
|
||||
mat=Ice; tex=ice3;
|
||||
};
|
||||
};
|
||||
|
||||
map HotIce {
|
||||
overlay { algo=sin; ox=21; oy=65; zoomX=-100; zoomY=-100; invert=1; turbulence=10; } &
|
||||
Ice { algo=poly;
|
||||
point {x=12%; y=58%; };
|
||||
point {x=88%; y=58%; };
|
||||
point {x=70%; y=68%; };
|
||||
point {x=30%; y=68%; };
|
||||
};
|
||||
|
||||
overlay { algo=random; a=50; } &
|
||||
Ice { algo=poly;
|
||||
point {x=30%; y=5%; };
|
||||
point {x=70%; y=5%; };
|
||||
point {x=88%; y=50%; };
|
||||
point {x=12%; y=50%; };
|
||||
};
|
||||
|
||||
overlay { mat=DuroLava; tex=lava_red; y=80; sub=0; };
|
||||
};
|
|
@ -0,0 +1,20 @@
|
|||
[Material]
|
||||
Name=Ice
|
||||
Shape=TopFlat
|
||||
Density=50
|
||||
Friction=15
|
||||
DigFree=1
|
||||
BlastFree=1
|
||||
Blast2Object=Ice
|
||||
Dig2Object=Ice
|
||||
Dig2ObjectRatio=200
|
||||
Blast2ObjectRatio=220
|
||||
MaxAirSpeed=100
|
||||
MaxSlide=1
|
||||
Corrode=60
|
||||
TempConvStrength=3
|
||||
AboveTempConvert=10
|
||||
AboveTempConvertDir=1
|
||||
AboveTempConvertTo=Water
|
||||
Placement=21
|
||||
TextureOverlay=ice3
|
|
@ -0,0 +1,72 @@
|
|||
OverloadMaterials
|
||||
OverloadTextures
|
||||
|
||||
# Static Map Material/Texture Table
|
||||
# Index +128 for underground materials
|
||||
10=Tunnel-tunnel
|
||||
11=Tunnel-tunnel
|
||||
12=Tunnel-brickback
|
||||
13=BrickSoft-brick1
|
||||
19=DuroLava-lava_red
|
||||
20=Water-water1-water2-water3-water1-water3-water2
|
||||
#21=Oil-Liquid
|
||||
22=Acid-acid
|
||||
23=Lava-lava_red
|
||||
24=DuroLava-lava_red
|
||||
25=Water-water
|
||||
#26=Oil-Smooth
|
||||
27=Acid-acid
|
||||
28=Lava-lava_red
|
||||
29=Earth-earth_dry
|
||||
30=Earth-earth_rough
|
||||
31=Earth-earth_topsoil
|
||||
32=Earth-earth_midsoil
|
||||
33=Ashes-ashes
|
||||
#34=Ashes-Rough
|
||||
#35=Ashes-Ridge
|
||||
|
||||
36=Ore-ore
|
||||
37=Ore-ore
|
||||
38=Ore-ore
|
||||
|
||||
40=Granite-granite
|
||||
41=Granite-granite
|
||||
42=Granite-rock
|
||||
|
||||
45=Gold-gold
|
||||
|
||||
50=Rock-rock
|
||||
51=Rock-rock_cracked
|
||||
52=Rock-rock
|
||||
|
||||
53=Sulphur-sulphur
|
||||
|
||||
54=Coal-coal
|
||||
|
||||
55=Sand-sand_rough
|
||||
56=Sand-sand_smooth
|
||||
#57=Sand-Smooth3
|
||||
|
||||
|
||||
|
||||
#59=FlyAshes-Smooth
|
||||
|
||||
#60=Crystal-Flare
|
||||
#61=Crystal-Structure
|
||||
#62=Crystal-Structure2
|
||||
|
||||
65=Ice-ice2
|
||||
66=Ice-ice2
|
||||
67=Ice-ice3
|
||||
68=Ice-ice3
|
||||
|
||||
70=Snow-snow1
|
||||
71=Snow-snow1
|
||||
72=Snow-snow1
|
||||
73=Brick-brick1
|
||||
|
||||
#80=FlySand-Smooth2
|
||||
#81=FlySand-Smooth3
|
||||
#82=FlySand-Smooth
|
||||
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
[Head]
|
||||
Title=HotIce
|
||||
Version=5,3,2
|
||||
MinPlayer=2
|
||||
MaxPlayer=20
|
||||
Icon=21
|
||||
|
||||
[Game]
|
||||
Goals=Goal_Melee=1;
|
||||
Rules=Rule_KillLogs=1;Rule_Gravestones=1;
|
||||
|
||||
[Landscape]
|
||||
MapWidth=20
|
||||
MapHeight=20
|
||||
TopOpen=1
|
||||
BottomOpen=0
|
||||
MapZoom=20,0,0,20
|
||||
|
||||
[Weather]
|
||||
Climate=0
|
|
@ -0,0 +1,48 @@
|
|||
/* Hot ice */
|
||||
|
||||
func Initialize()
|
||||
{
|
||||
// Materials: Chests
|
||||
var i,pos;
|
||||
var ls_wdt = LandscapeWidth(), ls_hgt = LandscapeHeight();
|
||||
for (i=0; i<6; ++i)
|
||||
if (pos=FindLocation(Loc_InRect(0,0,ls_wdt,ls_hgt/2-100), Loc_Wall(CNAT_Bottom))) // Loc_Wall adds us 100 pixels...
|
||||
{
|
||||
var chest = CreateObject(Chest,pos.x,pos.y);
|
||||
if (chest)
|
||||
{
|
||||
chest->CreateContents(Firestone,5);
|
||||
chest->CreateContents(Bread,2);
|
||||
var bonus = [[Bow,Arrow],[Shield,Sword]][Random(2)];
|
||||
for (var obj in bonus) chest->CreateContents(obj);
|
||||
}
|
||||
}
|
||||
// Materials: Firestones
|
||||
for (i=0; i<30; ++i)
|
||||
if (pos=FindLocation(Loc_InRect(0,0,ls_wdt,ls_hgt/2), Loc_Solid()))
|
||||
if (GBackSolid(pos.x,pos.y-1))
|
||||
CreateObject(Firestone,pos.x,pos.y-1);
|
||||
// Some firestones in lower half
|
||||
for (i=0; i<30; ++i)
|
||||
if (pos=FindLocation(Loc_InRect(0,ls_hgt/2,ls_wdt,ls_hgt/3), Loc_Solid()))
|
||||
if (GBackSolid(pos.x,pos.y-1))
|
||||
CreateObject(Firestone,pos.x,pos.y-1);
|
||||
return true;
|
||||
}
|
||||
|
||||
func InitializePlayer(int plr)
|
||||
{
|
||||
// player positioning
|
||||
var ls_wdt = LandscapeWidth(), ls_hgt = LandscapeHeight();
|
||||
var crew = GetCrew(plr);
|
||||
var start_pos = FindLocation(Loc_InRect(ls_wdt/5,ls_hgt/2,ls_wdt*3/5,ls_hgt/3), Loc_Wall(CNAT_Bottom), Loc_Space(20), Loc_Space(20,true));
|
||||
if (!start_pos) start_pos = {x=Random(ls_wdt*6/10)+ls_wdt*2/10, y=ls_hgt*58/100};
|
||||
crew->SetPosition(start_pos.x, start_pos.y-10);
|
||||
// initial material
|
||||
crew->CreateContents(Shovel);
|
||||
crew->CreateContents(Club);
|
||||
crew->CreateContents(Firestone);
|
||||
crew.MaxEnergy = 120000;
|
||||
crew->DoEnergy(1000);
|
||||
return true;
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
DE:Heißes Eis
|
||||
US:Hot ice
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |