Compare commits
80 Commits
master
...
stable-6.1
Author | SHA1 | Date |
---|---|---|
Nicolas Hake | 652c7e43e2 | |
Nicolas Hake | 07f02800ef | |
Nicolas Hake | 8786b7ab82 | |
Sven Eberhardt | 6b27635bf3 | |
Nicolas Hake | cc46f0a388 | |
Nicolas Hake | bc624176e7 | |
Nicolas Hake | b3b30e1631 | |
Nicolas Hake | 88ee2f7db8 | |
Nicolas Hake | 0c5e0c131a | |
Nicolas Hake | 0f2f936de3 | |
Nicolas Hake | a44bb14c1c | |
Nicolas Hake | b583f708db | |
Maikel de Vries | 9cf08594cf | |
Maikel de Vries | 2dd4b50313 | |
Maikel de Vries | 939888e9d2 | |
Maikel de Vries | a73b432cac | |
Maikel de Vries | 95fe966cd1 | |
Maikel de Vries | f86495da89 | |
Maikel de Vries | bfa6e7fbac | |
Maikel de Vries | 097ddd9ae1 | |
Maikel de Vries | b17d0bccb6 | |
Maikel de Vries | 71db4010da | |
Maikel de Vries | de185e7937 | |
Maikel de Vries | 02252b31bd | |
Nicolas Hake | d141f1a39f | |
Sven Eberhardt | d6697a1f74 | |
Sven Eberhardt | 4da413b6ae | |
Sven Eberhardt | afd1dcba7f | |
Sven Eberhardt | 9349498f3f | |
Sven Eberhardt | 05dba4cadc | |
Sven Eberhardt | b424838158 | |
Sven Eberhardt | 1d66dd426e | |
Sven Eberhardt | 6699cd3712 | |
Sven Eberhardt | b1b8fedb25 | |
Maikel de Vries | e9b076f6d3 | |
Maikel de Vries | 1cf1e309ea | |
Maikel de Vries | 871873b9bc | |
Maikel de Vries | e9e6fd9dba | |
Maikel de Vries | cc9e0ea9f2 | |
Maikel de Vries | ea2799fa28 | |
Maikel de Vries | 807ba20922 | |
Maikel de Vries | 6772f2da86 | |
Maikel de Vries | 24b164cd37 | |
Maikel de Vries | c25d463a91 | |
Maikel de Vries | f67f8d0d11 | |
Maikel de Vries | 7ff5478142 | |
Nicolas Hake | e2a42de2f2 | |
Martin Plicht | 5deb01fff9 | |
Misty De Meo | 2f08800709 | |
Maikel de Vries | 6e129f0535 | |
Maikel de Vries | 89ccec58ae | |
Maikel de Vries | c5de5ab487 | |
Maikel de Vries | 8b34b89f24 | |
Maikel de Vries | ba1aa81c6a | |
Nicolas Hake | a03283d9e1 | |
Peter Wortmann | ccc7382ab9 | |
Peter Wortmann | 5d505a5751 | |
Nicolas Hake | 80b1cb397d | |
hasufell | 955f22b26d | |
Maikel de Vries | 6d9cb0c411 | |
Maikel de Vries | 0843c29f42 | |
Maikel de Vries | ee3f3594db | |
Maikel de Vries | 23accab0de | |
Maikel de Vries | d19f75a5b9 | |
Martin Plicht | 39d6cc2c2c | |
Martin Plicht | b357f7cd1e | |
Maikel de Vries | f7ce5f7b2a | |
David Dormagen | 569e0d0cb3 | |
David Dormagen | 2a112b1d00 | |
David Dormagen | a9f4ee88d3 | |
Maikel de Vries | fca649707a | |
Maikel de Vries | ad88923cbe | |
Maikel de Vries | b94893f17a | |
Maikel de Vries | e7d66139eb | |
Nicolas Hake | 61ffb0fb28 | |
Nicolas Hake | 65cf1081ee | |
Nicolas Hake | e87c486545 | |
Nicolas Hake | 7c7aaece30 | |
Kevin Zheng | 4674c82cdf | |
Nicolas Hake | 98cd37f3d6 |
|
@ -22,7 +22,7 @@ endif()
|
|||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
include(Version.txt)
|
||||
include(Version)
|
||||
|
||||
set(CMAKE_ADDITIONAL_DEPS_PATH "${CMAKE_CURRENT_BINARY_DIR}/deps" CACHE PATH "Additional directory to search for libraries and headers")
|
||||
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_ADDITIONAL_DEPS_PATH})
|
||||
|
@ -491,6 +491,7 @@ set(OC_CLONK_SOURCES
|
|||
src/script/C4AulDebug.cpp
|
||||
src/script/C4AulDebug.h
|
||||
thirdparty/timsort/sort.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/C4Version.h
|
||||
)
|
||||
|
||||
set(MAPE_BASE_SOURCES
|
||||
|
@ -912,7 +913,6 @@ if(USE_SDL_MAINLOOP OR (Audio_TK STREQUAL "SDL_Mixer"))
|
|||
find_package(SDL)
|
||||
SET(HAVE_SDL ${SDL_FOUND})
|
||||
include_directories(${SDL_INCLUDE_DIR})
|
||||
target_link_libraries(openclonk ${SDL_LIBRARY})
|
||||
endif()
|
||||
|
||||
############################################################################
|
||||
|
@ -996,6 +996,7 @@ endif()
|
|||
|
||||
add_executable(c4group
|
||||
src/c4group/C4GroupMain.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/C4Version.h
|
||||
)
|
||||
|
||||
add_executable(netpuncher EXCLUDE_FROM_ALL
|
||||
|
@ -1094,6 +1095,10 @@ target_link_libraries(openclonk
|
|||
libmisc
|
||||
)
|
||||
|
||||
if (SDL_FOUND)
|
||||
target_link_libraries(openclonk ${SDL_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(Audio_FOUND)
|
||||
target_link_libraries(openclonk ${Audio_LIBRARIES})
|
||||
include_directories(${Audio_INCLUDE_DIRS})
|
||||
|
@ -1164,6 +1169,15 @@ endif()
|
|||
|
||||
# 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!
|
||||
if (APPLE AND NOT CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
# If cross-compiling for OS X, EXECUTABLE_NAME needs to be set so it's
|
||||
# expanded inside the Info.plist file. Otherwise you cannot rename the app
|
||||
# bundle later.
|
||||
# XXX: Make sure to fix this once we have more than one app bundle. No, I
|
||||
# have no idea how.
|
||||
set(EXECUTABLE_NAME openclonk)
|
||||
endif()
|
||||
|
||||
set_target_properties(openclonk PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/src/res/Info.plist")
|
||||
|
||||
if(MSVC)
|
||||
|
@ -1306,9 +1320,9 @@ endif()
|
|||
CHECK_INCLUDE_FILE_CXX(getopt.h HAVE_GETOPT_H)
|
||||
|
||||
# TinyXML
|
||||
if(WITH_SYSTEM_TINYXML)
|
||||
pkg_search_module(TINYXML REQUIRED tinyxml)
|
||||
target_link_libraries(openclonk ${TINYXML_LIBRARIES})
|
||||
if(USE_SYSTEM_TINYXML)
|
||||
find_package(TinyXML REQUIRED)
|
||||
target_link_libraries(openclonk ${TinyXML_LIBRARIES})
|
||||
else()
|
||||
add_subdirectory(thirdparty/tinyxml)
|
||||
include_directories(SYSTEM thirdparty/tinyxml)
|
||||
|
|
2
COPYING
|
@ -13,6 +13,8 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
(This is the ISC license. <http://opensource.org/licenses/ISC>)
|
||||
|
||||
Portions of the code have been contributed by other authors:
|
||||
Copyright (c) 2006-2007 Alexander Post
|
||||
Copyright (c) 2004-2013 Armin Burgmeier
|
||||
|
|
77
Version.txt
|
@ -1,3 +1,15 @@
|
|||
# OpenClonk, http://www.openclonk.org
|
||||
#
|
||||
# Copyright (c) 2009-2015, The OpenClonk Team and contributors
|
||||
#
|
||||
# Distributed under the terms of the ISC license; see accompanying file
|
||||
# "COPYING" for details.
|
||||
#
|
||||
# "Clonk" is a registered trademark of Matthes Bender, used with permission.
|
||||
# See accompanying file "TRADEMARK" for details.
|
||||
#
|
||||
# To redistribute this file separately, substitute the full license texts
|
||||
# for the above references.
|
||||
|
||||
############################################################################
|
||||
# Project version information
|
||||
|
@ -9,68 +21,15 @@ SET(C4PROJECT_TLD "org")
|
|||
SET(C4PROJECT_URL "http://${C4PROJECT_DOMAIN}.${C4PROJECT_TLD}")
|
||||
SET(C4ENGINENAME "OpenClonk")
|
||||
SET(C4ENGINENICK "openclonk")
|
||||
SET(C4ENGINEID "${C4PROJECT_TLD}.${C4PROJECT_DOMAIN}.${C4ENGINENICK}")
|
||||
|
||||
SET(C4XVER1 6)
|
||||
SET(C4XVER2 0)
|
||||
SET(C4XVER2 1)
|
||||
|
||||
# Set this variable to any string for pre-release versions, like "alpha" or
|
||||
# "rc1". Don't supply a value for release versions.
|
||||
SET(C4VERSIONEXTRA)
|
||||
|
||||
# C4VERSIONBUILDNAME should be witty and somewhat frequently changing
|
||||
# for alpha and beta releases, and meaningful and stable for stable releases.
|
||||
# Both variables need to start with a space if they aren't empty.
|
||||
# This variable needs to start with a space if it isn't empty.
|
||||
SET(C4VERSIONBUILDNAME "")
|
||||
SET(C4VERSIONEXTRA "")
|
||||
|
||||
############################################################################
|
||||
# Get revision from Git
|
||||
############################################################################
|
||||
include(GitGetChangesetID)
|
||||
git_get_changeset_id(C4REVISION)
|
||||
|
||||
############################################################################
|
||||
# Get year
|
||||
############################################################################
|
||||
|
||||
IF(CMAKE_HOST_UNIX)
|
||||
EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE DATE)
|
||||
ELSEIF(CMAKE_HOST_WIN32)
|
||||
EXECUTE_PROCESS(COMMAND "cscript.exe" "//nologo" "${CMAKE_CURRENT_SOURCE_DIR}/tools/get_current_year.vbs" OUTPUT_VARIABLE DATE)
|
||||
ENDIF()
|
||||
STRING(REGEX REPLACE "(.+)\n" "\\1" YEARFIXED "${DATE}")
|
||||
SET(C4COPYRIGHT_YEAR ${YEARFIXED})
|
||||
|
||||
############################################################################
|
||||
# Build version strings
|
||||
############################################################################
|
||||
|
||||
SET(C4ENGINECAPTION "${C4ENGINENAME}{$C4VERSIONBUILDNAME}")
|
||||
set(C4ENGINEINFO "${C4ENGINENAME}")
|
||||
|
||||
set(C4VERSION "${C4XVER1}.${C4XVER2}")
|
||||
|
||||
if(C4XVER4 LESS 10)
|
||||
set(C4VERSION "${C4VERSION} [00${C4XVER4}]")
|
||||
elseif(C4XVERBUILD LESS 100)
|
||||
set(C4VERSION "${C4VERSION} [0${C4XVER4}]")
|
||||
else()
|
||||
set(C4VERSION "${C4VERSION} [${C4XVER4}]")
|
||||
endif()
|
||||
|
||||
if(NOT ${C4VERSIONEXTRA} STREQUAL "")
|
||||
set(C4ENGINEINFO "${C4ENGINENAME} ${C4VERSIONEXTRA}")
|
||||
set(C4VERSION "${C4VERSION} ${C4VERSIONEXTRA}")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(C4VERSION "${C4VERSION} win")
|
||||
elseif(APPLE)
|
||||
set(C4VERSION "${C4VERSION} mac")
|
||||
elseif(UNIX)
|
||||
set(C4VERSION "${C4VERSION} unix")
|
||||
else()
|
||||
set(C4VERSION "${C4VERSION} strange")
|
||||
endif()
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/C4Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/C4Version.h ESCAPE_QUOTES)
|
||||
if(WIN32)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/res/WindowsGamesExplorer.xml.in ${CMAKE_CURRENT_BINARY_DIR}/WindowsGamesExplorer.xml ESCAPE_QUOTES)
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
##################################################################################################
|
||||
#
|
||||
# Copyright (c) 2013, Open Source Robotics Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
#
|
||||
# Redistributions in binary form must reproduce the above copyright notice, this
|
||||
# list of conditions and the following disclaimer in the documentation and/or
|
||||
# other materials provided with the distribution.
|
||||
#
|
||||
# Neither the name of the {organization} nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##################################################################################################
|
||||
|
||||
# CMake script for finding TinyXML.
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - TinyXML_ROOT_DIR (optional): When specified, header files and libraries will be searched for in
|
||||
# ${TinyXML_ROOT_DIR}/include
|
||||
# ${TinyXML_ROOT_DIR}/libs
|
||||
# respectively, and the default CMake search order will be ignored. When unspecified, the default
|
||||
# CMake search order is used.
|
||||
# This variable can be specified either as a CMake or environment variable. If both are set,
|
||||
# preference is given to the CMake variable.
|
||||
# Use this variable for finding packages installed in a nonstandard location, or for enforcing
|
||||
# that one of multiple package installations is picked up.
|
||||
#
|
||||
#
|
||||
# Cache variables (not intended to be used in CMakeLists.txt files)
|
||||
#
|
||||
# - TinyXML_INCLUDE_DIR: Absolute path to package headers.
|
||||
# - TinyXML_LIBRARY: Absolute path to library.
|
||||
#
|
||||
#
|
||||
# Output variables:
|
||||
#
|
||||
# - TinyXML_FOUND: Boolean that indicates if the package was found
|
||||
# - TinyXML_INCLUDE_DIRS: Paths to the necessary header files
|
||||
# - TinyXML_LIBRARIES: Package libraries
|
||||
#
|
||||
#
|
||||
# Example usage:
|
||||
#
|
||||
# find_package(TinyXML)
|
||||
# if(NOT TinyXML_FOUND)
|
||||
# # Error handling
|
||||
# endif()
|
||||
# ...
|
||||
# include_directories(${TinyXML_INCLUDE_DIRS} ...)
|
||||
# ...
|
||||
# target_link_libraries(my_target ${TinyXML_LIBRARIES})
|
||||
#
|
||||
##################################################################################################
|
||||
|
||||
# Get package location hint from environment variable (if any)
|
||||
if(NOT TinyXML_ROOT_DIR AND DEFINED ENV{TinyXML_ROOT_DIR})
|
||||
set(TinyXML_ROOT_DIR "$ENV{TinyXML_ROOT_DIR}" CACHE PATH
|
||||
"TinyXML base directory location (optional, used for nonstandard installation paths)")
|
||||
endif()
|
||||
|
||||
# Search path for nonstandard package locations
|
||||
if(TinyXML_ROOT_DIR)
|
||||
set(TinyXML_INCLUDE_PATH PATHS "${TinyXML_ROOT_DIR}/include" NO_DEFAULT_PATH)
|
||||
set(TinyXML_LIBRARY_PATH PATHS "${TinyXML_ROOT_DIR}/lib" NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Find headers and libraries
|
||||
find_path(TinyXML_INCLUDE_DIR NAMES tinyxml.h PATH_SUFFIXES "tinyxml" ${TinyXML_INCLUDE_PATH})
|
||||
find_library(TinyXML_LIBRARY NAMES tinyxml PATH_SUFFIXES "tinyxml" ${TinyXML_LIBRARY_PATH})
|
||||
|
||||
mark_as_advanced(TinyXML_INCLUDE_DIR
|
||||
TinyXML_LIBRARY)
|
||||
|
||||
# Output variables generation
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(TinyXML DEFAULT_MSG TinyXML_LIBRARY
|
||||
TinyXML_INCLUDE_DIR)
|
||||
|
||||
set(TinyXML_FOUND ${TINYXML_FOUND}) # Enforce case-correctness: Set appropriately cased variable...
|
||||
unset(TINYXML_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args
|
||||
|
||||
if(TinyXML_FOUND)
|
||||
set(TinyXML_INCLUDE_DIRS ${TinyXML_INCLUDE_DIR})
|
||||
set(TinyXML_LIBRARIES ${TinyXML_LIBRARY})
|
||||
endif()
|
|
@ -0,0 +1,64 @@
|
|||
# OpenClonk, http://www.openclonk.org
|
||||
#
|
||||
# Copyright (c) 2009-2015, The OpenClonk Team and contributors
|
||||
#
|
||||
# Distributed under the terms of the ISC license; see accompanying file
|
||||
# "COPYING" for details.
|
||||
#
|
||||
# "Clonk" is a registered trademark of Matthes Bender, used with permission.
|
||||
# See accompanying file "TRADEMARK" for details.
|
||||
#
|
||||
# To redistribute this file separately, substitute the full license texts
|
||||
# for the above references.
|
||||
|
||||
include(Version.txt)
|
||||
|
||||
############################################################################
|
||||
# Get revision from Git
|
||||
############################################################################
|
||||
include(GitGetChangesetID)
|
||||
git_get_changeset_id(C4REVISION)
|
||||
|
||||
############################################################################
|
||||
# Get year
|
||||
############################################################################
|
||||
|
||||
IF(CMAKE_HOST_UNIX)
|
||||
EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE DATE)
|
||||
ELSEIF(CMAKE_HOST_WIN32)
|
||||
EXECUTE_PROCESS(COMMAND "cscript.exe" "//nologo" "${CMAKE_CURRENT_SOURCE_DIR}/tools/get_current_year.vbs" OUTPUT_VARIABLE DATE)
|
||||
ENDIF()
|
||||
STRING(REGEX REPLACE "(.+)\n" "\\1" YEARFIXED "${DATE}")
|
||||
SET(C4COPYRIGHT_YEAR ${YEARFIXED})
|
||||
|
||||
############################################################################
|
||||
# Build version strings
|
||||
############################################################################
|
||||
SET(C4ENGINEID "${C4PROJECT_TLD}.${C4PROJECT_DOMAIN}.${C4ENGINENICK}")
|
||||
set(C4ENGINEINFO "${C4ENGINENAME}")
|
||||
set(C4ENGINECAPTION "${C4ENGINENAME}")
|
||||
|
||||
set(C4VERSION "${C4XVER1}.${C4XVER2}")
|
||||
|
||||
if(C4VERSIONEXTRA)
|
||||
set(C4VERSION "${C4VERSION}-${C4VERSIONEXTRA}")
|
||||
endif()
|
||||
|
||||
if(C4VERSIONBUILDNAME)
|
||||
set(C4ENGINECAPTION "${C4ENGINECAPTION} ${C4VERSIONBUILDNAME}")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(C4VERSION "${C4VERSION} win")
|
||||
elseif(APPLE)
|
||||
set(C4VERSION "${C4VERSION} mac")
|
||||
elseif(UNIX)
|
||||
set(C4VERSION "${C4VERSION} unix")
|
||||
else()
|
||||
set(C4VERSION "${C4VERSION} strange")
|
||||
endif()
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/C4Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/C4Version.h ESCAPE_QUOTES)
|
||||
if(WIN32)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/res/WindowsGamesExplorer.xml.in ${CMAKE_CURRENT_BINARY_DIR}/WindowsGamesExplorer.xml ESCAPE_QUOTES)
|
||||
endif()
|
|
@ -18634,9 +18634,6 @@ msgstr "Dieses Kommandozeilen-Programm dient zum Bearbeiten von Gruppendateien.
|
|||
#~ msgid "Fragile"
|
||||
#~ msgstr "Fragile"
|
||||
|
||||
#~ msgid "ConstructTo"
|
||||
#~ msgstr "ConstructTo"
|
||||
|
||||
#~ msgid "CheckSlide"
|
||||
#~ msgstr "CheckSlide"
|
||||
|
||||
|
|
|
@ -145,11 +145,6 @@
|
|||
<col>Integer</col>
|
||||
<col>0 or 1. Determines whether the object can be built.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ConstructTo</literal_col>
|
||||
<col>C4ID</col>
|
||||
<col>Definition change upon building.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>GrabPutGet</literal_col>
|
||||
<col>Integer</col>
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
<name>amount</name>
|
||||
<desc>Maximum amount to be extracted.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>distant_x</name>
|
||||
<desc>If true, material will be extracted at the most distant horizontal position of the top row of the material body, to a maximum of the material's MaxSlide parameter. If used on liquids, this mode ensures that level pools of 1px height can be extracted by extracting from anywhere horizontally.</desc>
|
||||
<optional />
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Extracts a certain amount of material at the specified position. The return value is the amount actually extracted.</desc>
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
<funclink>Find_Func</funclink>
|
||||
<funclink>Find_Hostile</funclink>
|
||||
<funclink>Find_ID</funclink>
|
||||
<funclink>Find_InArray</funclink>
|
||||
<funclink>Find_InRect</funclink>
|
||||
<funclink>Find_NoContainer</funclink>
|
||||
<funclink>Find_Not</funclink>
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
<funclink>Find_Func</funclink>
|
||||
<funclink>Find_Hostile</funclink>
|
||||
<funclink>Find_ID</funclink>
|
||||
<funclink>Find_InArray</funclink>
|
||||
<funclink>Find_InRect</funclink>
|
||||
<funclink>Find_NoContainer</funclink>
|
||||
<funclink>Find_Not</funclink>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<?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>Find_InArray</title>
|
||||
<category>Objects</category>
|
||||
<subcat>Search</subcat>
|
||||
<version>6.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>array</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>array</type>
|
||||
<name>search_array</name>
|
||||
<desc>Array in which the object must be.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Search criterion: Finds only objects in the array.</desc>
|
||||
<remark>The implementation just checks for every object whether it is contained in the array. The object search is not reduced by checking only objects in the given array, so the criterion should not be used as an optimization to speed up object search. To perform such an optimization, a simple loop over the array should be used.</remark>
|
||||
<examples>
|
||||
<example>
|
||||
<code>// A kind of healing spell for which people have to stay within a distance and cannot gain the healing effect if they are not present in Fx*Start
|
||||
|
||||
func FxHealingStart(object target, proplist effect, bool temp)
|
||||
{
|
||||
<funclink>if</funclink> (!temp) effect.targets = <funclink>FindObjects</funclink>(<funclink>Find_OCF</funclink>(<funclink>OCF_Alive</funclink>), <funclink>Find_Distance</funclink>(200));
|
||||
}
|
||||
|
||||
func FxHealingTimer(object target, proplist effect)
|
||||
{
|
||||
<funclink>for</funclink> (var target in <funclink>Find_Objects</funclink>(<funclink>Find_Distance</funclink>(200), Find_InArray(effect.targets)));
|
||||
target-><funclink>DoEnergy</funclink>(+1);
|
||||
}
|
||||
</code>
|
||||
<text>Objects are healed by the effect and need to stay within 200 range to keep being healed. The Find_InArray criterion ensures that only objects that were initially in the range retrieve healing.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related><funclink>FindObjects</funclink></related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2015-04</date>
|
||||
</funcs>
|
|
@ -46,6 +46,7 @@
|
|||
<funclink>Find_Func</funclink>
|
||||
<funclink>Find_Hostile</funclink>
|
||||
<funclink>Find_ID</funclink>
|
||||
<funclink>Find_InArray</funclink>
|
||||
<funclink>Find_InRect</funclink>
|
||||
<funclink>Find_NoContainer</funclink>
|
||||
<funclink>Find_Not</funclink>
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
{\rtf1\ansi\deff3\adeflang1025
|
||||
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq0\fcharset128 Times New Roman;}{\f5\froman\fprq0\fcharset128 Liberation Serif{\*\falt Times New Roman};}{\f6\fswiss\fprq0\fcharset128 Liberation Sans{\*\falt Arial};}{\f7\fnil\fprq0\fcharset128 FreeSans;}{\f8\fnil\fprq2\fcharset0 FreeSans;}{\f9\fswiss\fprq0\fcharset128 FreeSans;}{\f10\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}}
|
||||
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq0\fcharset128 Times New Roman;}{\f5\froman\fprq0\fcharset128 Liberation Serif{\*\falt Times New Roman};}{\f6\fswiss\fprq0\fcharset128 Liberation Sans{\*\falt Arial};}{\f7\fnil\fprq0\fcharset128 Liberation Serif{\*\falt Times New Roman};}{\f8\fnil\fprq0\fcharset128 FreeSans;}{\f9\fnil\fprq2\fcharset0 FreeSans;}{\f10\fswiss\fprq0\fcharset128 FreeSans;}{\f11\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}}
|
||||
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
|
||||
{\stylesheet{\s0\snext0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033 Normal;}
|
||||
{\s15\sbasedon0\snext16\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af8\afs28\alang1081\loch\f6\fs28\lang1033 Heading;}
|
||||
{\s16\sbasedon0\snext16\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033 Text Body;}
|
||||
{\s17\sbasedon16\snext17\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af9\afs24\alang1081\loch\f5\fs24\lang1033 List;}
|
||||
{\s18\sbasedon0\snext18\ql\nowidctlpar\sb120\sa120\noline\ltrpar\cf1\i\kerning1\dbch\af7\langfe2052\dbch\af9\afs24\alang1081\ai\loch\f5\fs24\lang1033 Caption;}
|
||||
{\s19\sbasedon0\snext19\ql\nowidctlpar\noline\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af9\afs24\alang1081\loch\f5\fs24\lang1033 Index;}
|
||||
{\stylesheet{\s0\snext0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033 Normal;}
|
||||
{\s15\sbasedon0\snext16\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af8\langfe2052\dbch\af9\afs28\alang1081\loch\f6\fs28\lang1033 Heading;}
|
||||
{\s16\sbasedon0\snext16\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033 Text Body;}
|
||||
{\s17\sbasedon16\snext17\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af8\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033 List;}
|
||||
{\s18\sbasedon0\snext18\ql\nowidctlpar\sb120\sa120\noline\ltrpar\cf1\i\kerning1\dbch\af8\langfe2052\dbch\af10\afs24\alang1081\ai\loch\f5\fs24\lang1033 Caption;}
|
||||
{\s19\sbasedon0\snext19\ql\nowidctlpar\noline\ltrpar\cf1\kerning1\dbch\af8\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033 Index;}
|
||||
}{\info{\author Martin Plicht}{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern67241730}}\deftab720
|
||||
\viewscale150
|
||||
{\*\pgdsctbl
|
||||
{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\pgdscnxt0 Default Style;}}
|
||||
\formshade{\*\pgdscno0}\paperh16838\paperw11906\margl1440\margr1440\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
|
||||
\pgndec\pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b\afs20\rtlch \ltrch\loch\fs20\loch\f4
|
||||
\pgndec\pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b\afs20\rtlch \ltrch\loch\fs20\loch\f4
|
||||
Dunkle Mine}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
You find yourself in an abandoned mine with competitors, the last one standing can claim all the gold. The mines are dark because all torches }{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
have been burned up}{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
, but they left their lorries with valuable explosives and other mining equipment. Use these to deceive, trap and eliminate your opponents.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
You find yourself in an abandoned mine with competitors, the last one standing can claim all the gold. The mines are dark because all torches have been burned up, but they left their lorries with valuable explosives and other mining equipment. Use these to deceive, trap and eliminate your opponents.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
Goal: Last Man Standing (Be the last one alive to win)}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
- You don't have any relaunches.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
- You don't have any relaunches }{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
(can be changed)}{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
- Use the dark caves to your advantage.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
- The lorries contain explosives, mining tools and more.}
|
||||
\par }
|
|
@ -1,35 +1,36 @@
|
|||
{\rtf1\ansi\deff3\adeflang1025
|
||||
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq0\fcharset128 Times New Roman;}{\f5\froman\fprq0\fcharset128 Liberation Serif{\*\falt Times New Roman};}{\f6\fswiss\fprq0\fcharset128 Liberation Sans{\*\falt Arial};}{\f7\fnil\fprq0\fcharset128 FreeSans;}{\f8\fnil\fprq2\fcharset0 FreeSans;}{\f9\fswiss\fprq0\fcharset128 FreeSans;}{\f10\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}}
|
||||
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq0\fcharset128 Times New Roman;}{\f5\froman\fprq0\fcharset128 Liberation Serif{\*\falt Times New Roman};}{\f6\fswiss\fprq0\fcharset128 Liberation Sans{\*\falt Arial};}{\f7\fnil\fprq0\fcharset128 Liberation Serif{\*\falt Times New Roman};}{\f8\fnil\fprq0\fcharset128 FreeSans;}{\f9\fnil\fprq2\fcharset0 FreeSans;}{\f10\fswiss\fprq0\fcharset128 FreeSans;}{\f11\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}}
|
||||
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
|
||||
{\stylesheet{\s0\snext0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033 Normal;}
|
||||
{\s15\sbasedon0\snext16\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af8\afs28\alang1081\loch\f6\fs28\lang1033 Heading;}
|
||||
{\s16\sbasedon0\snext16\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033 Text Body;}
|
||||
{\s17\sbasedon16\snext17\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af9\afs24\alang1081\loch\f5\fs24\lang1033 List;}
|
||||
{\s18\sbasedon0\snext18\ql\nowidctlpar\sb120\sa120\noline\ltrpar\cf1\i\kerning1\dbch\af7\langfe2052\dbch\af9\afs24\alang1081\ai\loch\f5\fs24\lang1033 Caption;}
|
||||
{\s19\sbasedon0\snext19\ql\nowidctlpar\noline\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af9\afs24\alang1081\loch\f5\fs24\lang1033 Index;}
|
||||
{\stylesheet{\s0\snext0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033 Normal;}
|
||||
{\s15\sbasedon0\snext16\ql\nowidctlpar\sb240\sa120\keepn\ltrpar\cf1\kerning1\dbch\af8\langfe2052\dbch\af9\afs28\alang1081\loch\f6\fs28\lang1033 Heading;}
|
||||
{\s16\sbasedon0\snext16\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033 Text Body;}
|
||||
{\s17\sbasedon16\snext17\sl288\slmult1\ql\nowidctlpar\sb0\sa140\ltrpar\cf1\kerning1\dbch\af8\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033 List;}
|
||||
{\s18\sbasedon0\snext18\ql\nowidctlpar\sb120\sa120\noline\ltrpar\cf1\i\kerning1\dbch\af8\langfe2052\dbch\af10\afs24\alang1081\ai\loch\f5\fs24\lang1033 Caption;}
|
||||
{\s19\sbasedon0\snext19\ql\nowidctlpar\noline\ltrpar\cf1\kerning1\dbch\af8\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033 Index;}
|
||||
}{\info{\author Martin Plicht}{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern67241730}}\deftab720
|
||||
\viewscale150
|
||||
{\*\pgdsctbl
|
||||
{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\pgdscnxt0 Default Style;}}
|
||||
\formshade{\*\pgdscno0}\paperh16838\paperw11906\margl1440\margr1440\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
|
||||
\pgndec\pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b\afs20\rtlch \ltrch\loch\fs20\loch\f4
|
||||
\pgndec\pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b\afs20\rtlch \ltrch\loch\fs20\loch\f4
|
||||
Dark Mine}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{{\*\bkmkstart __DdeLink__6_377675131}\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
You find yourself in an abandoned mine with competitors, the last one standing can claim all the gold. The mines are dark because all torches }{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
have been burned up}{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4{\*\bkmkend __DdeLink__6_377675131}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{{\*\bkmkstart __DdeLink__6_377675131}\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
You find yourself in an abandoned mine with competitors, the last one standing can claim all the gold. The mines are dark because all torches have been burned up}{{\*\bkmkend __DdeLink__6_377675131}\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
, but they left their lorries with valuable explosives and other mining equipment. Use these to deceive, trap and eliminate your opponents.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
Goal: Last Man Standing (Be the last one alive to win)}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\cf1\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
- You don't have any relaunches.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
- You don't have any relaunches }{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
(can be changed)}{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
- Use the dark caves to your advantage.}
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af10\afs24\alang1081\loch\f5\fs24\lang1033\ql\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af7\langfe2052\dbch\af11\afs24\alang1081\loch\f5\fs24\lang1033\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803{\cf1\b0\afs16\rtlch \ltrch\loch\fs16\loch\f4
|
||||
- The lorries contain explosives, mining tools and more.}
|
||||
\par }
|
|
@ -71,9 +71,14 @@ protected func OnPlayerRelaunch(int plr, int relaunch_cnt)
|
|||
clonk->CreateContents(Torch);
|
||||
// Better weapons after relaunching.
|
||||
if (!is_relaunch)
|
||||
{
|
||||
clonk->CreateContents(Firestone, 2);
|
||||
}
|
||||
else
|
||||
clonk->CreateContents(Bow)->CreateContents(BombArrow);
|
||||
{
|
||||
clonk->CreateContents(Javelin);
|
||||
clonk->CreateContents(BombArrow);
|
||||
}
|
||||
|
||||
// Set the zoom range to be standard low, but allow for zooming out
|
||||
// such that light sources a bit further away can be spotted.
|
||||
|
@ -164,12 +169,12 @@ private func InitMaterials(int map_size)
|
|||
PlaceObjects(PowderKeg, map_size / 10, "Rock");
|
||||
|
||||
// Some pickaxes, shovels in the tunnels.
|
||||
for (var i = 0; i < map_size / 6; i++)
|
||||
for (var i = 0; i < map_size / 5; i++)
|
||||
{
|
||||
var loc = FindLocation(Loc_Tunnel(), Loc_Wall(CNAT_Bottom));
|
||||
if (!loc)
|
||||
continue;
|
||||
CreateObjectAbove([Shovel, Pickaxe][Random(2)], loc.x, loc.y)->SetR(Random(360));
|
||||
CreateObjectAbove([Shovel, Pickaxe, GoldBar][Random(3)], loc.x, loc.y)->SetR(Random(360));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ protected func Initialize()
|
|||
{
|
||||
// Environment
|
||||
CreateObject(Rule_ObjectFade)->DoFadeTime(10 * 36);
|
||||
CreateObject(Environment_Celestial);
|
||||
var time=CreateObject(Environment_Time);
|
||||
time->SetTime();
|
||||
time->SetCycleSpeed();
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
/* 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,46 @@
|
|||
/**
|
||||
Hot Ice
|
||||
Ice islands above a lava lake
|
||||
|
||||
@authors Sven2
|
||||
*/
|
||||
|
||||
// Called be the engine: draw the complete map here.
|
||||
public func InitializeMap(proplist map)
|
||||
{
|
||||
// Map type 0: One big island; more small islands above
|
||||
// Map type 1: Only many small islands
|
||||
var t = SCENPAR_MapType;
|
||||
var w = map.Wdt, h=map.Hgt;
|
||||
|
||||
// Bottom lava lake
|
||||
map->Draw("^DuroLava", nil, [0,h*4/5,w,h/5]);
|
||||
|
||||
// Big island
|
||||
if (t == 0)
|
||||
{
|
||||
var island = { Algo=MAPALGO_Polygon, X=[0,w,w*6/8,w*2/8], Y=[h*4/10,h*4/10,h*7/10,h*7/10] };
|
||||
island = { Algo=MAPALGO_Turbulence, Op=island, Amplitude=[0, 8] };
|
||||
map->Draw("^Ice-ice2", island, [w/10,h*13/20,w*8/10,h*3/20]);
|
||||
}
|
||||
|
||||
// Small islands
|
||||
var n_islands = [12,37][t];
|
||||
while(n_islands--)
|
||||
{
|
||||
var y = h*2/10 + Random(h*(3+t*2)/10);
|
||||
var x = w*1/10 + Random(w*8/10);
|
||||
var szx = t*Random(3);
|
||||
var szy = 1+t*Random(Random(2));
|
||||
map->Draw("^Ice-ice2", nil, [x-szx,y,1+2*szx,szy]);
|
||||
}
|
||||
|
||||
// Alternate texctures
|
||||
var icealt_tex = { Algo=MAPALGO_RndChecker, Wdt=2, Hgt=3 };
|
||||
icealt_tex = { Algo=MAPALGO_Turbulence, Op=icealt_tex };
|
||||
icealt_tex = { Algo=MAPALGO_And, Op=[Duplicate("Ice"), icealt_tex]};
|
||||
map->Draw("^Ice-ice3", icealt_tex);
|
||||
|
||||
// Return true to tell the engine a map has been successfully created.
|
||||
return true;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
[ParameterDef]
|
||||
Name=$MapType$
|
||||
Description=$DescMapType$
|
||||
ID=MapType
|
||||
Default=0
|
||||
|
||||
[Options]
|
||||
|
||||
[Option]
|
||||
Name=$MapTypeBigIsland$
|
||||
Description=$DescMapTypeBigIsland$
|
||||
Value=0
|
||||
|
||||
[Option]
|
||||
Name=$MapTypeSpots$
|
||||
Description=$DescMapTypeSpots$
|
||||
Value=1
|
|
@ -10,8 +10,8 @@ Goals=Goal_Melee=1;
|
|||
Rules=Rule_KillLogs=1;Rule_Gravestones=1;
|
||||
|
||||
[Landscape]
|
||||
MapWidth=20
|
||||
MapHeight=20
|
||||
MapWidth=64
|
||||
MapHeight=40
|
||||
TopOpen=1
|
||||
BottomOpen=1
|
||||
MapZoom=18,0,0,18
|
||||
|
|
|
@ -5,8 +5,9 @@ func Initialize()
|
|||
// Materials: Chests
|
||||
var i,pos;
|
||||
var ls_wdt = LandscapeWidth(), ls_hgt = LandscapeHeight();
|
||||
var top_area_hgt = ls_hgt*[50,80][SCENPAR_MapType]/100;
|
||||
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...
|
||||
if (pos=FindLocation(Loc_InRect(0,0,ls_wdt,top_area_hgt-100), Loc_Wall(CNAT_Bottom))) // Loc_Wall adds us 100 pixels...
|
||||
{
|
||||
var chest = CreateObjectAbove(Chest,pos.x,pos.y);
|
||||
if (chest)
|
||||
|
@ -23,13 +24,13 @@ func Initialize()
|
|||
}
|
||||
// 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))
|
||||
if (pos=FindLocation(Loc_InRect(0,0,ls_wdt,top_area_hgt), Loc_Solid()))
|
||||
if (IsFirestoneSpot(pos.x,pos.y))
|
||||
CreateObjectAbove(Firestone,pos.x,pos.y-1);
|
||||
// Some firestones in lower half
|
||||
// Some firestones in lower half. For ap type 1, more firestones in lower than upper 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))
|
||||
if (IsFirestoneSpot(pos.x,pos.y))
|
||||
CreateObjectAbove(Firestone,pos.x,pos.y-1);
|
||||
return true;
|
||||
}
|
||||
|
@ -38,10 +39,11 @@ func InitializePlayer(int plr)
|
|||
{
|
||||
// everything visible
|
||||
SetFoW(false, plr);
|
||||
// player positioning
|
||||
// player positioning. In lower area for both maps becuase starting high is an an advantage.
|
||||
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));
|
||||
var start_pos = FindLocation(Loc_InRect(ls_wdt/5,ls_hgt/2,ls_wdt*3/5,ls_hgt/3), Loc_Wall(CNAT_Bottom), Loc_Func(Scenario.IsStartSpot));
|
||||
if (!start_pos) start_pos = FindLocation(Loc_InRect(ls_wdt/10,0,ls_wdt*8/10,ls_hgt*4/5), Loc_Wall(CNAT_Bottom), Loc_Func(Scenario.IsStartSpot));
|
||||
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
|
||||
|
@ -53,3 +55,19 @@ func InitializePlayer(int plr)
|
|||
crew->DoEnergy(1000);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Horizontal Loc_Space doesn't work with Loc_Wall because it checks inside the ground.
|
||||
func IsStartSpot(int x, int y)
|
||||
{
|
||||
// Don't spawn just at the border of an island.
|
||||
if (!GBackSolid(x-3,y+2)) return false;
|
||||
if (!GBackSolid(x+3,y+2)) return false;
|
||||
// Spawn with some space.
|
||||
return PathFree(x-5, y, x+5, y) && PathFree(x, y-21, x, y-1);
|
||||
}
|
||||
|
||||
func IsFirestoneSpot(int x, int y)
|
||||
{
|
||||
// Very thorough ice surrounding check so they don't explode right away or when the first layer of ice melts
|
||||
return GBackSolid(x,y-1) && GBackSolid(x,y+4) && GBackSolid(x-2,y) && GBackSolid(x+2,y);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
MapType=Karte
|
||||
DescMapType=Definiert die Landschaftsform.
|
||||
MapTypeBigIsland=Große Insel
|
||||
DescMapTypeBigIsland=Eine zentrale Hauptinsel mit einigen Eisflecken in der Luft.
|
||||
MapTypeSpots=Kleine inseln
|
||||
DescMapTypeSpots=Viele kleine Eisflecken in der Luft.
|
|
@ -0,0 +1,6 @@
|
|||
MapType=Map
|
||||
DescMapType=Defines the shape of the landscape.
|
||||
MapTypeBigIsland=Big island
|
||||
DescMapTypeBigIsland=One central main island with small spots of ice in the air above.
|
||||
MapTypeSpots=Small islands
|
||||
DescMapTypeSpots=Many small spots of ice in the air.
|
|
@ -37,6 +37,6 @@ public func DoThrow(object clonk, int angle)
|
|||
|
||||
Sound("ThrowJavelin?");
|
||||
|
||||
fAiming = -1;
|
||||
aiming = -1;
|
||||
clonk->UpdateAttach();
|
||||
}
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
[DefCore]
|
||||
id=Grass
|
||||
Version=6,0
|
||||
Category=C4D_StaticBack|C4D_Background
|
||||
Width=12
|
||||
Height=7
|
||||
Offset=-6,-3
|
||||
Vertices=1
|
||||
VertexY=1
|
||||
Mass=1
|
||||
Rotate=1
|
||||
StretchGrowth=1
|
||||
Oversize=1
|
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 9.3 KiB |
|
@ -1,57 +0,0 @@
|
|||
/*-- Grass --*/
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
DoCon(Random(50));
|
||||
if (Random(2))
|
||||
SetGraphics("1");
|
||||
}
|
||||
|
||||
|
||||
public func CanBeHitByShockwaves() { return true; }
|
||||
|
||||
protected func Damage()
|
||||
{
|
||||
if (GetDamage() > 80 && !Random(5))
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
private func Destroy()
|
||||
{
|
||||
var particles =
|
||||
{
|
||||
Prototype = Particles_Straw(),
|
||||
R = 200,
|
||||
G = 50,
|
||||
B = 50
|
||||
};
|
||||
CreateParticle("Grass", 0, 0, PV_Random(-20, 20), PV_Random(-20, 10), PV_Random(30, 100), particles, 30);
|
||||
RemoveObject();
|
||||
}
|
||||
|
||||
global func PlaceGrass(int amount, int start, int end)
|
||||
{
|
||||
if (!start)
|
||||
start = 0;
|
||||
if (!end)
|
||||
end = LandscapeWidth();
|
||||
|
||||
var x = start, y;
|
||||
while (x < end)
|
||||
{
|
||||
y = 0;
|
||||
while (y < LandscapeHeight())
|
||||
{
|
||||
if (GetMaterial(AbsX(x), AbsY(y)) == Material("Sky"))
|
||||
if (GetMaterial(AbsX(x), AbsY(y + 3)) == Material("Earth"))
|
||||
if (Random(100) < amount)
|
||||
CreateObjectAbove(Grass, AbsX(x), AbsY(y + 4), NO_OWNER);
|
||||
y += 3;
|
||||
}
|
||||
x += 9;
|
||||
}
|
||||
}
|
||||
|
||||
local Name = "Grass";
|
Before Width: | Height: | Size: 5.5 KiB |
|
@ -0,0 +1,17 @@
|
|||
[ParameterDef]
|
||||
Name=$GoalType$
|
||||
Description=$DescGoalType$
|
||||
ID=GoalType
|
||||
Default=0
|
||||
|
||||
[Options]
|
||||
|
||||
[Option]
|
||||
Name=$GoalTypeLMS$
|
||||
Description=$DescGoalTypeLMS$
|
||||
Value=0
|
||||
|
||||
[Option]
|
||||
Name=$GoalTypeDM$
|
||||
Description=$DescGoalTypeDM$
|
||||
Value=1
|
|
@ -24,10 +24,3 @@ Crew=Clonk=1
|
|||
|
||||
[Landscape]
|
||||
Sky=Clouds1
|
||||
|
||||
[Weather]
|
||||
Climate=00,0,0,00
|
||||
StartSeason=0,0,0,00
|
||||
YearSpeed=0,0,0,000
|
||||
Wind=1,100,-100,100
|
||||
|
||||
|
|
|
@ -1,29 +1,31 @@
|
|||
/*--
|
||||
/**
|
||||
Scorches Gardens
|
||||
Author: Mimmo_O
|
||||
|
||||
A melee in a fiery setting.
|
||||
--*/
|
||||
|
||||
@author Mimmo_O
|
||||
*/
|
||||
|
||||
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
SetMatAdjust(RGB(255,150,128));
|
||||
|
||||
// Goal.
|
||||
CreateObject(Goal_DeathMatch, 0, 0, NO_OWNER);
|
||||
if (SCENPAR_GoalType == 0)
|
||||
CreateObject(Goal_LastManStanding);
|
||||
else if (SCENPAR_GoalType == 1)
|
||||
CreateObject(Goal_DeathMatch);
|
||||
CreateObject(Rule_KillLogs);
|
||||
CreateObject(Rule_Gravestones);
|
||||
|
||||
//Enviroment.
|
||||
// Enviroment.
|
||||
CreateObject(Rule_ObjectFade)->DoFadeTime(10 * 36);
|
||||
SetSkyAdjust(RGB(255,128,0));
|
||||
SetSkyParallax(1, 20,20, 0,0, nil, nil);
|
||||
CreateObjectAbove(Column,160,304)->SetClrModulation(RGB(255,100,80));
|
||||
CreateObjectAbove(Column,448,272)->SetClrModulation(RGB(255,100,80));
|
||||
SetSkyAdjust(RGB(255, 128, 0));
|
||||
SetSkyParallax(1, 20, 20, 0, 0, nil, nil);
|
||||
CreateObjectAbove(Column, 160, 304)->SetClrModulation(RGB(255, 100, 80));
|
||||
CreateObjectAbove(Column, 448, 272)->SetClrModulation(RGB(255, 100, 80));
|
||||
SetMatAdjust(RGB(255, 150, 128));
|
||||
|
||||
AddEffect("RandomMeteor", nil, 100, 36-Min(GetPlayerCount()*3,20));
|
||||
AddEffect("RandomMeteor", nil, 100, 20);
|
||||
AddEffect("DangerousLava", nil, 100, 1);
|
||||
// Smooth brick edges.
|
||||
PlaceEdges();
|
||||
|
@ -31,21 +33,19 @@ protected func Initialize()
|
|||
return;
|
||||
}
|
||||
|
||||
// Lava hurts a lot.
|
||||
global func FxDangerousLavaTimer()
|
||||
{
|
||||
//uber effect abuse
|
||||
|
||||
for(var burning in FindObjects(Find_ID(Clonk),Find_OCF(OCF_OnFire)))
|
||||
{
|
||||
burning->DoEnergy(-3); //lava hurts a lot
|
||||
}
|
||||
|
||||
for (var burning in FindObjects(Find_ID(Clonk),Find_OCF(OCF_OnFire)))
|
||||
burning->DoEnergy(-3);
|
||||
}
|
||||
|
||||
global func FxRandomMeteorTimer()
|
||||
{
|
||||
if(!Random(10)) return ;
|
||||
LaunchMeteor(50+Random(LandscapeWidth()-100),-10, 40 + Random(40), RandomX(-20,20), 0);
|
||||
if (!Random(GetPlayerCount() + 2))
|
||||
return FX_OK;
|
||||
LaunchMeteor(50 + Random(LandscapeWidth() - 100), -10, 40 + Random(40), RandomX(-20, 20), 0);
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
private func PlaceEdges()
|
||||
|
@ -64,7 +64,7 @@ private func PlaceEdges()
|
|||
return;
|
||||
}
|
||||
|
||||
global func PlaceGras()
|
||||
private func PlaceGras()
|
||||
{
|
||||
var x=[502,468,530,525,548,560,555,551,461,483,354,425,348,343,338,420,412,405,300,315,310,305,290,193,198,169,181,176,127,137,142,133,122,147,35,45,41,30,122];
|
||||
var y=[225,221,201,206,191,178,181,185,228,220,190,234,190,188,188,231,226,221,229,218,221,228,229,262,260,261,261,259,227,227,230,228,237,240,221,221,219,222,224];
|
||||
|
@ -76,10 +76,10 @@ global func PlaceGras()
|
|||
edge->SetCategory(C4D_StaticBack);
|
||||
edge->SetR(r[i]);
|
||||
edge->Initialize();
|
||||
edge->SetClrModulation(RGB(200+Random(50),100+Random(60),100+Random(60)));
|
||||
edge->SetClrModulation(RGB(225+Random(30), Random(30), Random(30)));
|
||||
|
||||
}
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
|
||||
protected func OnPlayerRelaunch(int plr)
|
||||
|
@ -97,13 +97,21 @@ protected func OnPlayerRelaunch(int plr)
|
|||
return;
|
||||
}
|
||||
|
||||
func OnClonkLeftRelaunch(object clonk)
|
||||
public func OnClonkLeftRelaunch(object clonk)
|
||||
{
|
||||
clonk->CreateParticle("Fire", 0, 0, PV_Random(-20, 20), PV_Random(-40, 5), PV_Random(20, 90), Particles_Glimmer(), 30);
|
||||
clonk->SetYDir(-5);
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove contents of clonks on their death.
|
||||
public func OnClonkDeath(object clonk)
|
||||
{
|
||||
while (clonk->Contents())
|
||||
clonk->Contents()->RemoveObject();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
func WinKillCount() { return 5; }
|
||||
// Settings for LMS and DM.
|
||||
public func RelaunchCount() { return 5; }
|
||||
public func WinKillCount() { return 5; }
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
GoalType=Goal
|
||||
DescGoalType=Definiert das Ziel.
|
||||
GoalTypeLMS=Last Man Standing
|
||||
DescGoalTypeLMS=Bleibe als Letzter am Leben und gewinne.
|
||||
GoalTypeDM=Deathmatch
|
||||
DescGoalTypeDM=Erziele eine gewisse Menge an Kills und gewinne.
|
|
@ -0,0 +1,6 @@
|
|||
GoalType=Goal
|
||||
DescGoalType=Defines the goal of this round.
|
||||
GoalTypeLMS=Last Man Standing
|
||||
DescGoalTypeLMS=Be the last one alive to win.
|
||||
GoalTypeDM=Deathmatch
|
||||
DescGoalTypeDM=Score a given amount of kills to win.
|
|
@ -1,12 +0,0 @@
|
|||
#appendto Clonk
|
||||
// Lose all items on death.
|
||||
func StartDead()
|
||||
{
|
||||
PlayAnimation("Dead", 5, Anim_Linear(0, 0, GetAnimationLength("Dead"), 20, ANIM_Hold), Anim_Linear(0, 0, 1000, 5, ANIM_Remove));
|
||||
// Update carried items
|
||||
UpdateAttach();
|
||||
if(Contents(1))Contents(1)->RemoveObject();
|
||||
if(Contents(0))Contents(0)->RemoveObject();
|
||||
// Set proper turn type
|
||||
SetTurnType(1);
|
||||
}
|
|
@ -1,2 +1,2 @@
|
|||
DE:Versengte Gärten
|
||||
DE:Versengte Gärten
|
||||
US:Scorched Gardens
|
|
@ -95,7 +95,6 @@ private func Execute()
|
|||
var i=GetPlayerCount(C4PT_User);
|
||||
exec_counter += !(i%3);
|
||||
while (i--) if (!(++exec_counter % 3)) ExecutePlayer(GetPlayerByIndex(i, C4PT_User));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,48 @@
|
|||
/*
|
||||
* OpenClonk, http://www.openclonk.org
|
||||
*
|
||||
* Copyright (c) 2015, The OpenClonk Team and contributors
|
||||
*
|
||||
* Distributed under the terms of the ISC license; see accompanying file
|
||||
* "COPYING" for details.
|
||||
*
|
||||
* "Clonk" is a registered trademark of Matthes Bender, used with permission.
|
||||
* See accompanying file "TRADEMARK" for details.
|
||||
*
|
||||
* To redistribute this file separately, substitute the full license texts
|
||||
* for the above references.
|
||||
*/
|
||||
|
||||
// Default Vertex Shader for mesh-based objects.
|
||||
|
||||
// Input uniforms, if OC_WA_LOW_MAX_VERTEX_UNIFORM_COMPONENTS is NOT defined:
|
||||
// bones: array of 4x3 bone transformation matrices.
|
||||
|
||||
// Input uniforms, if OC_WA_LOW_MAX_VERTEX_UNIFORM_COMPONENTS is defined:
|
||||
// bones: array of 3x4 transposed bone transformation matrices.
|
||||
|
||||
// Input vertex attributes:
|
||||
// oc_BoneWeights0 and oc_BoneWeight1: vectors of bone influence weights.
|
||||
// The sum of weights must be 1. Each component of these vectors will be
|
||||
// matched up with its corresponding component of the oc_BoneIndices0 or
|
||||
// oc_BoneIndices1 vectors to specify a vertex bone assignment.
|
||||
// oc_BoneIndices0 and oc_BoneIndices1: vectors of bone influence indices.
|
||||
// The integer part of every component of these vectors selects one of the
|
||||
// bones from the bone matrix array to influence the current vertex.
|
||||
|
||||
// If the vertex is not influenced by any bones, it must use a dummy entry
|
||||
// inside the bone matrix array that contains the identity matrix, with a bone
|
||||
// weight of 1.0.
|
||||
|
||||
#define MAX_BONE_COUNT 80
|
||||
|
||||
varying vec3 normalDir;
|
||||
uniform mat4 bones[128];
|
||||
|
||||
#ifndef OC_WA_LOW_MAX_VERTEX_UNIFORM_COMPONENTS
|
||||
uniform mat4x3 bones[MAX_BONE_COUNT];
|
||||
#else
|
||||
uniform mat3x4 bones[MAX_BONE_COUNT];
|
||||
#endif
|
||||
|
||||
// For more performance, this should be set by the engine, and this shader
|
||||
// should be compiled three times: with BONE_COUNT set to 0, 4, and 8,
|
||||
|
@ -14,10 +57,17 @@ attribute vec4 oc_BoneIndices1;
|
|||
attribute vec4 oc_BoneWeights1;
|
||||
#endif
|
||||
|
||||
vec4 merge_bone(vec4 vertex, vec4 original, mat4 bone, float weight)
|
||||
#ifndef OC_WA_LOW_MAX_VERTEX_UNIFORM_COMPONENTS
|
||||
vec4 merge_bone(vec4 vertex, vec4 original, mat4x3 bone, float weight)
|
||||
{
|
||||
return (bone * original) * weight + vertex;
|
||||
return (mat4(bone) * original) * weight + vertex;
|
||||
}
|
||||
#else
|
||||
vec4 merge_bone(vec4 vertex, vec4 original, mat3x4 bone, float weight)
|
||||
{
|
||||
return (mat4(transpose(bone)) * original) * weight + vertex;
|
||||
}
|
||||
#endif
|
||||
|
||||
slice(position)
|
||||
{
|
||||
|
@ -50,7 +100,7 @@ slice(normal)
|
|||
normalDir = normalize(gl_NormalMatrix * gl_Normal);
|
||||
#else
|
||||
vec4 base_normal = vec4(gl_Normal, 0.0);
|
||||
vec4 normal = base_normal;
|
||||
vec4 normal = vec4(0, 0, 0, 0);
|
||||
normal = merge_bone(normal, base_normal, bones[int(oc_BoneIndices0.x)], oc_BoneWeights0.x);
|
||||
normal = merge_bone(normal, base_normal, bones[int(oc_BoneIndices0.y)], oc_BoneWeights0.y);
|
||||
normal = merge_bone(normal, base_normal, bones[int(oc_BoneIndices0.z)], oc_BoneWeights0.z);
|
||||
|
|
|
@ -68,6 +68,7 @@ func InitializeObjects()
|
|||
var Chest001 = CreateObjectAbove(Chest, 264, 1287);
|
||||
|
||||
var WoodenCabin001 = CreateObjectAbove(WoodenCabin, 62, 870);
|
||||
WoodenCabin001->MakeInvincible();
|
||||
|
||||
CreateObjectAbove(Idol, 102, 871);
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ func DoInit(int first_player)
|
|||
|
||||
// Set time of day to evening and create some clouds and celestials.
|
||||
Cloud->Place(20);
|
||||
CreateObject(Environment_Celestial);
|
||||
var time = CreateObject(Environment_Time);
|
||||
time->SetTime(600);
|
||||
time->SetCycleSpeed(20);
|
||||
|
|
|
@ -16,7 +16,6 @@ func DoInit(int first_player)
|
|||
{
|
||||
// Set time of day to morning and create some clouds and celestials.
|
||||
Cloud->Place(20);
|
||||
CreateObject(Environment_Celestial);
|
||||
var time = CreateObject(Environment_Time);
|
||||
time->SetTime(400);
|
||||
time->SetCycleSpeed(6);
|
||||
|
|
|
@ -6,8 +6,8 @@ func InitializeObjects()
|
|||
|
||||
CreateObject(Rule_BuyAtFlagpole, 50, 50);
|
||||
|
||||
CreateObjectAbove(Tree_Coniferous, 962, 839);
|
||||
CreateObjectAbove(Tree_Coniferous, 774, 951);
|
||||
CreateObjectAbove(Tree_SmallConiferous, 962, 839);
|
||||
CreateObjectAbove(Tree_SmallConiferous, 774, 951);
|
||||
|
||||
CreateObjectAbove(Tree_SmallConiferous, 46, 441);
|
||||
var Tree_SmallConiferous0015 = CreateObjectAbove(Tree_SmallConiferous, 320, 312);
|
||||
|
|
|
@ -14,7 +14,6 @@ func DoInit(int first_player)
|
|||
//CreateObjectAbove(LiftTower, 178,405, first_player);
|
||||
// Set time of day to evening and create some clouds and celestials.
|
||||
Cloud->Place(15);
|
||||
EnsureObject(Environment_Celestial,0,0,-1);
|
||||
EnsureObject(Rule_BuyAtFlagpole,0,0,-1);
|
||||
SetSkyAdjust(0xff000000);
|
||||
var storm = EnsureObject(Storm,0,0,NO_OWNER);
|
||||
|
|
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 34 KiB |
|
@ -1,45 +1,3 @@
|
|||
material CrashedAirplane
|
||||
{
|
||||
receive_shadows on
|
||||
technique
|
||||
{
|
||||
pass
|
||||
{
|
||||
cull_hardware none
|
||||
scene_blend alpha_blend
|
||||
ambient 0.500000 0.500000 0.500000 1.000000
|
||||
diffuse 0.800000 0.800000 0.800000 1.000000
|
||||
specular 0.000000 0.000000 0.000000 1.000000 3.500000
|
||||
emissive 0.000000 0.000000 0.000000 1.000000
|
||||
|
||||
texture_unit Overlay
|
||||
{
|
||||
texture CrashedPaint.png
|
||||
tex_address_mode wrap
|
||||
filtering trilinear
|
||||
colour_op_ex modulate src_texture src_player_colour
|
||||
// take alpha from texture only, ignore player alpha
|
||||
alpha_op_ex source1 src_texture src_player_colour
|
||||
}
|
||||
texture_unit Plane
|
||||
{
|
||||
texture Crashedairplane.jpg
|
||||
tex_address_mode wrap
|
||||
filtering trilinear
|
||||
colour_op_ex blend_current_alpha src_current src_texture
|
||||
// Don't blend alpha, to make sure we have full intensity at the base/overlay border region
|
||||
alpha_op_ex add src_current src_texture
|
||||
}
|
||||
texture_unit Light
|
||||
{
|
||||
// apply lighting
|
||||
colour_op_ex modulate src_current src_diffuse
|
||||
alpha_op_ex modulate src_current src_diffuse
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
material GoldenShovel
|
||||
{
|
||||
receive_shadows on
|
||||
|
|
|
@ -890,36 +890,73 @@ func FxIntHangleTimer(pTarget, effect, iTime)
|
|||
|
||||
func StartSwim()
|
||||
{
|
||||
/* if(Clonk_SwimStates == nil)
|
||||
Clonk_SwimStates = ["SwimStand", "Swim", "SwimDive", "SwimTurn", "SwimDiveTurn", "SwimDiveUp", "SwimDiveDown"];*/
|
||||
if(!InLiquid()) return;
|
||||
if(!GetEffect("IntSwim", this))
|
||||
if (!InLiquid())
|
||||
return;
|
||||
if (!GetEffect("IntSwim", this))
|
||||
AddEffect("IntSwim", this, 1, 1, this);
|
||||
|
||||
return SetSwimmingVertices(true);
|
||||
SetSwimmingVertices(true);
|
||||
return;
|
||||
}
|
||||
|
||||
func StopSwim()
|
||||
{
|
||||
if(GetAction() != "Swim") RemoveEffect("IntSwim", this);
|
||||
|
||||
return SetSwimmingVertices(false);
|
||||
if (GetAction() != "Swim")
|
||||
RemoveEffect("IntSwim", this);
|
||||
SetSwimmingVertices(false);
|
||||
return;
|
||||
}
|
||||
|
||||
func SetSwimmingVertices(bool is_swimming)
|
||||
{
|
||||
var vtx_list = [[0,2,0], [0,-7,4], [0,9,11], [-2,-3,1], [2,-3,2], [-4,2,1], [4,2,2], [-2,6,1], [2,6,2]];
|
||||
var vtx_list = [[0,2,0,300], [0,-7,4,300], [0,9,11,300], [-2,-3,1,300], [2,-3,2,300], [-4,2,1,300], [4,2,2,300], [-2,6,1,300], [2,6,2,300]];
|
||||
if (is_swimming)
|
||||
vtx_list = [[0,3,0], [0,-2,4], [0,7,11], [-4,0,1], [4,0,2], [-5,3,1], [5,3,2], [-4,4,1], [4,4,2]];
|
||||
vtx_list = [[0,2,0,50], [0,-2,4,50], [0,7,11,50], [-4,-1,1,50], [4,-1,2,50], [-4,2,1,50], [4,2,2,50], [-4,4,1,50], [4,4,2,50]];
|
||||
for (var i = 0; i < GetVertexNum(); i++)
|
||||
{
|
||||
var x = GetVertex(i, VTX_X);
|
||||
var y = GetVertex(i, VTX_Y);
|
||||
var cnat = GetVertex(i, VTX_CNAT);
|
||||
var friction = GetVertex(i, VTX_Friction);
|
||||
SetVertex(i, VTX_X, vtx_list[i][0], 2);
|
||||
SetVertex(i, VTX_Y, vtx_list[i][1], 2);
|
||||
SetVertex(i, VTX_CNAT, vtx_list[i][2], 2);
|
||||
SetVertex(i, VTX_Friction, vtx_list[i][3], 2);
|
||||
// Don't do the update if that would stuck the clonk.
|
||||
if (Stuck())
|
||||
{
|
||||
SetVertex(i, VTX_X, x, 2);
|
||||
SetVertex(i, VTX_Y, y, 2);
|
||||
SetVertex(i, VTX_CNAT, cnat, 2);
|
||||
SetVertex(i, VTX_Friction, friction, 2);
|
||||
// But add an effect which does this delayed.
|
||||
var effect = AddEffect("IntDelayedVertex", this, 100, 1, this);
|
||||
effect.vertex = i;
|
||||
effect.old_vertex = [x, y, cnat, friction];
|
||||
effect.new_vertex = vtx_list[i];
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
protected func FxIntDelayedVertexTimer(object target, proplist effect, int time)
|
||||
{
|
||||
if (time > 8)
|
||||
return FX_Execute_Kill;
|
||||
|
||||
SetVertex(effect.vertex, VTX_X, effect.new_vertex[0], 2);
|
||||
SetVertex(effect.vertex, VTX_Y, effect.new_vertex[1], 2);
|
||||
SetVertex(effect.vertex, VTX_CNAT, effect.new_vertex[2], 2);
|
||||
SetVertex(effect.vertex, VTX_Friction, effect.new_vertex[3], 2);
|
||||
if (!Stuck())
|
||||
return FX_Execute_Kill;
|
||||
|
||||
SetVertex(effect.vertex, VTX_X, effect.old_vertex[0], 2);
|
||||
SetVertex(effect.vertex, VTX_Y, effect.old_vertex[1], 2);
|
||||
SetVertex(effect.vertex, VTX_CNAT, effect.old_vertex[2], 2);
|
||||
SetVertex(effect.vertex, VTX_Friction, effect.old_vertex[3], 2);
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
func FxIntSwimStart(pTarget, effect, fTmp)
|
||||
{
|
||||
if(fTmp) return;
|
||||
|
|
|
@ -8,7 +8,6 @@ Offset=-7,-10
|
|||
Vertices=3
|
||||
VertexX=0,5,-5
|
||||
VertexY=10,8,8
|
||||
VertexFriction=60, 60, 60
|
||||
VertexFriction=60,60,60
|
||||
NoGet=1
|
||||
StretchGrowth=1
|
||||
|
||||
|
|
Before Width: | Height: | Size: 106 B |
|
@ -1,32 +1,43 @@
|
|||
local Name = "$Name$";
|
||||
local Description = "$Description$";
|
||||
/**
|
||||
Flame
|
||||
Spreads fire.
|
||||
|
||||
@author Maikel
|
||||
*/
|
||||
|
||||
public func Initialize()
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
Incinerate();
|
||||
AddTimer("Burning");
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
func Burning()
|
||||
public func Burning()
|
||||
{
|
||||
if(GetCon() > 50)
|
||||
if(!Random(3))
|
||||
// Split the flame if it is large enough.
|
||||
if (GetCon() > 50 && !Random(3))
|
||||
{
|
||||
var x = Random(15);
|
||||
var o = CreateObjectAbove(GetID(), 0, 0, GetOwner());
|
||||
o->SetSpeed(x, -7);
|
||||
o->SetCon(GetCon()/2);
|
||||
var new_flame = CreateObjectAbove(GetID(), 0, 0, GetOwner());
|
||||
new_flame->SetSpeed(x, -7);
|
||||
new_flame->SetCon(GetCon() / 2);
|
||||
SetSpeed(-x, -7);
|
||||
SetCon(GetCon()/2);
|
||||
|
||||
SetCon(GetCon() / 2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't incinerate twice in saved scenarios
|
||||
// Don't incinerate twice in saved scenarios.
|
||||
func SaveScenarioObject(props)
|
||||
{
|
||||
if (!inherited(props, ...)) return false;
|
||||
props->Remove("Fire");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*-- Properties --*/
|
||||
|
||||
local Name = "$Name$";
|
||||
local Description = "$Description$";
|
|
@ -6,17 +6,18 @@ local Name = "$Name$";
|
|||
// Light types to be used for light_type parameter in CreateLight
|
||||
local LGT_Constant = 0;
|
||||
local LGT_Blast = 1; // light up and remove again after some time
|
||||
local LGT_Temp = 2; // light up and remove again after some time
|
||||
local range, ltype, t;
|
||||
|
||||
global func CreateLight(int x, int y, int range, int light_type, player)
|
||||
global func CreateLight(int x, int y, int range, int light_type, player, int fadeout, int time)
|
||||
{
|
||||
// create light object. player may be nil
|
||||
var light = CreateObjectAbove(Fx_Light, x, y, player);
|
||||
if (light) light->Init(range, light_type);
|
||||
if (light) light->Init(range, light_type, fadeout, time);
|
||||
return light;
|
||||
}
|
||||
|
||||
func Init(int lrange, int light_type)
|
||||
func Init(int lrange, int light_type, int fadeout, int time)
|
||||
{
|
||||
// Init depending on type
|
||||
range = lrange;
|
||||
|
@ -30,7 +31,12 @@ func Init(int lrange, int light_type)
|
|||
else if (ltype == LGT_Blast)
|
||||
{
|
||||
SetLightRange(range);
|
||||
var time = Sqrt(range)+10;
|
||||
time = Sqrt(range)+10;
|
||||
ScheduleCall(this, Global.RemoveObject, time, 1);
|
||||
}
|
||||
else if (ltype == LGT_Temp)
|
||||
{
|
||||
SetLightRange(range, fadeout);
|
||||
ScheduleCall(this, Global.RemoveObject, time, 1);
|
||||
}
|
||||
else
|
||||
|
|
After Width: | Height: | Size: 74 KiB |
|
@ -0,0 +1,3 @@
|
|||
[Particle]
|
||||
Name=FireBorder
|
||||
Face=0,0,128,128,-64,-64
|
After Width: | Height: | Size: 66 KiB |
|
@ -0,0 +1,3 @@
|
|||
[Particle]
|
||||
Name=FireSharp
|
||||
Face=0,0,100,150,-40,-75
|
|
@ -1,9 +0,0 @@
|
|||
[DefCore]
|
||||
id=Environment_Celestial
|
||||
Version=6,0
|
||||
Category=C4D_Environment|C4D_StaticBack
|
||||
Width=1
|
||||
Height=1
|
||||
Vertices=1
|
||||
VertexY=0
|
||||
Mass=1
|
Before Width: | Height: | Size: 16 KiB |
|
@ -2,8 +2,4 @@
|
|||
id=Environment_Time
|
||||
Version=6,0
|
||||
Category=C4D_StaticBack|C4D_Environment
|
||||
Width=1
|
||||
Height=1
|
||||
Vertices=1
|
||||
VertexY=0
|
||||
Mass=1
|
||||
Picture=0,0,128,128
|
||||
|
|
|
@ -5,7 +5,3 @@ Category=C4D_StaticBack|C4D_Background|C4D_Parallax
|
|||
Width=128
|
||||
Height=128
|
||||
Offset=-64,-64
|
||||
Vertices=1
|
||||
VertexY=0
|
||||
Mass=1
|
||||
StretchGrowth=1
|
||||
|
|
|
@ -1,23 +1,31 @@
|
|||
/*-- Moon --*/
|
||||
/**
|
||||
Moon
|
||||
Moon which are shown in the night sky.
|
||||
*/
|
||||
|
||||
local phase;
|
||||
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
var alpha=0;
|
||||
if(GetTime() < 300 || GetTime() > 1140) alpha=255;
|
||||
SetClrModulation(RGBa(255,255,255,alpha));
|
||||
var alpha = 0;
|
||||
var time = FindObject(Find_ID(Environment_Time));
|
||||
if (time && time->IsNight())
|
||||
alpha = 255;
|
||||
SetClrModulation(RGBa(255, 255, 255, alpha));
|
||||
|
||||
SetAction("Be");
|
||||
Update();
|
||||
this["Parallaxity"] = [30,30];
|
||||
this.Parallaxity = [30, 30];
|
||||
return;
|
||||
}
|
||||
|
||||
public func NextMoonPhase()
|
||||
{
|
||||
SetMoonPhase(phase+1);
|
||||
SetMoonPhase(phase + 1);
|
||||
}
|
||||
|
||||
/** @return values from 0..100, depending on the full-ness of the moon */
|
||||
// Return values from 0 to 100, depending on the full-ness of the moon
|
||||
public func GetMoonLightness()
|
||||
{
|
||||
return 100 - Abs(100 * phase / this.ActMap.Be.Length - 50);
|
||||
|
@ -27,43 +35,48 @@ public func GetMoonPhase()
|
|||
{
|
||||
return phase;
|
||||
}
|
||||
public func SetMoonPhase(int iphase)
|
||||
|
||||
public func SetMoonPhase(int to_phase)
|
||||
{
|
||||
phase = iphase % this.ActMap.Be.Length;
|
||||
phase = to_phase % this.ActMap.Be.Length;
|
||||
Update();
|
||||
return;
|
||||
}
|
||||
|
||||
private func Update() {
|
||||
private func Update()
|
||||
{
|
||||
SetPhase(phase);
|
||||
|
||||
var phases = this.ActMap.Be.Length;
|
||||
|
||||
var x = phase - phases/2;
|
||||
var height = LandscapeHeight() / (6 - (x*x)/phases);
|
||||
var width = 100 + phase * (LandscapeWidth()-200) / phases;
|
||||
var x = phase - phases / 2;
|
||||
var height = LandscapeHeight() / (6 - (x * x) / phases);
|
||||
var width = 100 + phase * (LandscapeWidth() - 200) / phases;
|
||||
|
||||
SetPosition(width,height);
|
||||
SetPosition(width, height);
|
||||
return;
|
||||
}
|
||||
|
||||
// only appears during the night
|
||||
// Only appears during the night.
|
||||
public func IsCelestial() { return true; }
|
||||
|
||||
// Not stored by itself because it's created by the time environment
|
||||
func SaveScenarioObject() { return false; }
|
||||
public func SaveScenarioObject() { return false; }
|
||||
|
||||
|
||||
/*-- Properties --*/
|
||||
|
||||
local ActMap = {
|
||||
|
||||
Be = {
|
||||
Prototype = Action,
|
||||
Name = "Be",
|
||||
Procedure = DFA_FLOAT,
|
||||
Length = 8,
|
||||
Delay = 0,
|
||||
X = 0,
|
||||
Y = 0,
|
||||
Wdt = 128,
|
||||
Hgt = 128,
|
||||
NextAction = "Hold"
|
||||
}
|
||||
Be = {
|
||||
Prototype = Action,
|
||||
Name = "Be",
|
||||
Procedure = DFA_FLOAT,
|
||||
Length = 8,
|
||||
Delay = 0,
|
||||
X = 0,
|
||||
Y = 0,
|
||||
Wdt = 128,
|
||||
Hgt = 128,
|
||||
NextAction = "Hold"
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,71 +1,74 @@
|
|||
/**--
|
||||
/**
|
||||
Time Controller
|
||||
Author:Ringwall
|
||||
|
||||
Creates time based on the 24-hour time scheme.
|
||||
Time is computed in minutes, which are by default
|
||||
1/2 a second in real life (18 frames). This will
|
||||
make each complete day/night cycle last 12 minutes
|
||||
in real life.
|
||||
--*/
|
||||
|
||||
@author Ringwall, Maikel
|
||||
*/
|
||||
|
||||
local time_set;
|
||||
local time;
|
||||
local advance_seconds_per_tick;
|
||||
|
||||
/** Sets the current time using a 24*60 minute clock scheme. */
|
||||
|
||||
/*-- Interface --*/
|
||||
|
||||
// Sets the current time using a 24*60 minute clock scheme.
|
||||
public func SetTime(int to_time)
|
||||
{
|
||||
// Set time.
|
||||
time = (to_time*60) % (24 * 60 * 60);
|
||||
// hide celestials during day
|
||||
if(Inside(time, time_set["SunriseEnd"], time_set["SunsetStart"]))
|
||||
time = (to_time * 60) % (24 * 60 * 60);
|
||||
// Hide celestials during day.
|
||||
if (Inside(time, time_set.sunrise_end, time_set.sunset_start))
|
||||
HideCelestials();
|
||||
else
|
||||
ShowCelestials();
|
||||
|
||||
// Adjust to time.
|
||||
AdjustToTime();
|
||||
return;
|
||||
}
|
||||
|
||||
/** Returns the time in minutes. */
|
||||
// Returns the time in minutes.
|
||||
public func GetTime()
|
||||
{
|
||||
return time / 60;
|
||||
}
|
||||
|
||||
/** Sets the number of seconds the day will advance each tick (10 frames).
|
||||
Setting to 0 will stop day-night cycle. Default is 30 seconds. */
|
||||
// Sets the number of seconds the day will advance each tick (10 frames).
|
||||
// Setting to 0 will stop day-night cycle. Default is 30 seconds.
|
||||
public func SetCycleSpeed(int seconds_per_tick)
|
||||
{
|
||||
advance_seconds_per_tick = seconds_per_tick;
|
||||
}
|
||||
|
||||
/** Returns the number of seconds the day advances each tick (10 frames). */
|
||||
// Returns the number of seconds the day advances each tick (10 frames).
|
||||
public func GetCycleSpeed()
|
||||
{
|
||||
return advance_seconds_per_tick;
|
||||
}
|
||||
|
||||
local time_set;
|
||||
|
||||
/*-- Code -- */
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
// Only one time control object.
|
||||
if (ObjectCount(Find_ID(Environment_Time)) > 1)
|
||||
return RemoveObject();
|
||||
|
||||
|
||||
// Determine the frame times for day and night events.
|
||||
time_set = {
|
||||
SunriseStart = 10800, // 3:00
|
||||
SunriseEnd = 32400, // 9:00
|
||||
SunsetStart = 54000, // 15:00
|
||||
SunsetEnd = 75600, // 21:00
|
||||
sunrise_start = 3 * 60 * 60, // 3:00
|
||||
sunrise_end = 9 * 60 * 60, // 9:00
|
||||
sunset_start = 15 * 60 * 60, // 15:00
|
||||
sunset_end = 21 * 60 * 60, // 21:00
|
||||
};
|
||||
|
||||
// Create moon and stars.
|
||||
if (FindObject(Find_ID(Environment_Celestial)))
|
||||
// Create moon and stars if celestial objects are not blocked by the scenario.
|
||||
if (!GameCall("HasNoCelestials"))
|
||||
{
|
||||
PlaceStars();
|
||||
CreateObjectAbove(Moon, LandscapeWidth() / 2, LandscapeHeight() / 6);
|
||||
|
@ -77,12 +80,13 @@ protected func Initialize()
|
|||
// Add effect that controls time cycle.
|
||||
SetCycleSpeed(30);
|
||||
AddEffect("IntTimeCycle", this, 100, 10, this);
|
||||
return;
|
||||
}
|
||||
|
||||
public func IsDay()
|
||||
{
|
||||
var day_start = (time_set["SunriseStart"] + time_set["SunriseEnd"]) / 2;
|
||||
var day_end = (time_set["SunsetStart"] + time_set["SunsetEnd"]) / 2;
|
||||
var day_start = (time_set.sunrise_start + time_set.sunrise_end) / 2;
|
||||
var day_end = (time_set.sunset_start + time_set.sunset_end) / 2;
|
||||
if (Inside(time, day_start, day_end))
|
||||
return true;
|
||||
return false;
|
||||
|
@ -90,8 +94,8 @@ public func IsDay()
|
|||
|
||||
public func IsNight()
|
||||
{
|
||||
var night_start = (time_set["SunsetStart"] + time_set["SunsetEnd"]) / 2;
|
||||
var night_end = (time_set["SunriseStart"] + time_set["SunriseEnd"]) / 2;
|
||||
var night_start = (time_set.sunset_start + time_set.sunset_end) / 2;
|
||||
var night_end = (time_set.sunrise_start + time_set.sunrise_end) / 2;
|
||||
if (Inside(time, night_start, night_end))
|
||||
return true;
|
||||
return false;
|
||||
|
@ -99,68 +103,66 @@ public func IsNight()
|
|||
|
||||
private func PlaceStars()
|
||||
{
|
||||
// since stars are almost completely parallax (=in screen coordinates), we only need
|
||||
// to place stars for max. a reasonable maximum resolution. Lets say 1600x1200
|
||||
var lw = Min(LandscapeWidth(), 1600);
|
||||
var lh = Min(LandscapeHeight(),1200);
|
||||
// Since stars are almost completely parallax (=in screen coordinates), we only need
|
||||
// to place stars for max. a reasonable maximum resolution, let's say 1920x1200.
|
||||
var lw = Min(LandscapeWidth(), 1920);
|
||||
var lh = Min(LandscapeHeight(), 1200);
|
||||
|
||||
//Star Creation
|
||||
// Star Creation.
|
||||
var maxfailedtries = lw * lh / 40000;
|
||||
var failed = 0;
|
||||
|
||||
while (failed != maxfailedtries)
|
||||
{
|
||||
var pos = [Random(lw), Random(lh)];
|
||||
if(!FindObject(Find_ID(Stars),Find_AtPoint(pos[0],pos[1])))
|
||||
if (!FindObject(Find_ID(Stars), Find_AtPoint(pos[0], pos[1])))
|
||||
{
|
||||
CreateObjectAbove(Stars, pos[0], pos[1]);
|
||||
continue;
|
||||
}
|
||||
failed++;
|
||||
}
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Cycles through day and night.
|
||||
protected func FxIntTimeCycleTimer(object target)
|
||||
protected func FxIntTimeCycleTimer(object target, proplist effect)
|
||||
{
|
||||
// Adjust to time.
|
||||
AdjustToTime();
|
||||
|
||||
// Advance time.
|
||||
time += advance_seconds_per_tick;
|
||||
time += Max(advance_seconds_per_tick * effect.Interval / 10, 1);
|
||||
time %= (24 * 60 * 60);
|
||||
|
||||
return 1;
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
private func HideCelestials()
|
||||
{
|
||||
// hide celestial objects, they will not be drawn during the day
|
||||
// Hide celestial objects, they will not be drawn during the day.
|
||||
for (var celestial in FindObjects(Find_Func("IsCelestial")))
|
||||
{
|
||||
celestial.Visibility = VIS_None;
|
||||
celestial->SetObjAlpha(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private func ShowCelestials()
|
||||
{
|
||||
// show celestial objects
|
||||
// Show celestial objects.
|
||||
for (var celestial in FindObjects(Find_Func("IsCelestial")))
|
||||
{
|
||||
celestial.Visibility = VIS_All;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private func OnSunriseEnd()
|
||||
{
|
||||
// next moon phase
|
||||
var satellite = FindObject(Find_ID(Moon));
|
||||
if(satellite)
|
||||
satellite->NextMoonPhase();
|
||||
|
||||
// Next moon phase.
|
||||
var moon = FindObject(Find_ID(Moon));
|
||||
if (moon)
|
||||
moon->NextMoonPhase();
|
||||
HideCelestials();
|
||||
}
|
||||
|
||||
|
@ -169,30 +171,42 @@ private func OnSunsetStart()
|
|||
ShowCelestials();
|
||||
}
|
||||
|
||||
// Adjusts the sky, celestial and others to the current time. Use SetTime() at runtime, not this.
|
||||
private func AdjustToTime()
|
||||
{
|
||||
if (time >= time_set.sunrise_end && time < time_set.sunrise_end + advance_seconds_per_tick)
|
||||
OnSunriseEnd();
|
||||
else if (time >= time_set.sunset_start && time < time_set.sunset_start + advance_seconds_per_tick)
|
||||
OnSunsetStart();
|
||||
DoSkyShade();
|
||||
return;
|
||||
}
|
||||
|
||||
private func DoSkyShade()
|
||||
{
|
||||
// first determine the time phase we are in
|
||||
// First determine the time phase we are in.
|
||||
var sunrise, sunset, night, day;
|
||||
sunrise = sunset = night = day = false;
|
||||
|
||||
if (Inside(time, time_set["SunriseStart"], time_set["SunriseEnd"]))
|
||||
if (Inside(time, time_set.sunrise_start, time_set.sunrise_end))
|
||||
sunrise = true;
|
||||
else if(Inside(time, time_set["SunriseEnd"], time_set["SunsetStart"]))
|
||||
else if(Inside(time, time_set.sunrise_end, time_set.sunset_start))
|
||||
day = true;
|
||||
else if(Inside(time, time_set["SunsetStart"], time_set["SunsetEnd"]))
|
||||
else if(Inside(time, time_set.sunset_start, time_set.sunset_end))
|
||||
sunset = true;
|
||||
else
|
||||
night = true;
|
||||
|
||||
var skyshade = [0,0,0,0]; //R,G,B,A
|
||||
var nightcolour = [10,25,40]; // default darkest-night colour
|
||||
var daycolour = [255,255,255];
|
||||
var sunsetcolour = [140,45,10];
|
||||
var sunrisecolour = [140,100,70];
|
||||
// Specify colors in terms of R, G, B, A arrays.
|
||||
var skyshade = [0, 0, 0, 0];
|
||||
var nightcolour = [10, 25, 40];
|
||||
var daycolour = [255, 255, 255];
|
||||
var sunsetcolour = [140, 45, 10];
|
||||
var sunrisecolour = [140, 100, 70];
|
||||
|
||||
// Darkness of night dependent on the moon-phase.
|
||||
if (!day)
|
||||
{
|
||||
// Darkness of night dependent on the moon-phase
|
||||
var satellite = FindObject(Find_ID(Moon));
|
||||
if(satellite)
|
||||
{
|
||||
|
@ -201,114 +215,85 @@ private func DoSkyShade()
|
|||
}
|
||||
}
|
||||
|
||||
// Sunrise
|
||||
// Sunrise.
|
||||
if (sunrise)
|
||||
{
|
||||
var time_since_sunrise = time - time_set["SunriseStart"];
|
||||
var time_since_sunrise = time - time_set.sunrise_start;
|
||||
// progress in 0..1800
|
||||
var progress = time_since_sunrise * 1800 / (time_set["SunriseEnd"] - time_set["SunriseStart"]);
|
||||
var progress = time_since_sunrise * 1800 / (time_set.sunrise_end - time_set.sunrise_start);
|
||||
|
||||
for(var i=0; i<3; ++i)
|
||||
for (var i = 0; i < 3; ++i)
|
||||
{
|
||||
var nightfade = Cos(progress/2, nightcolour[i],10);
|
||||
var dayfade = daycolour[i] - Cos(progress/2, daycolour[i],10);
|
||||
var sunrisefade = Sin(progress, sunrisecolour[i],10);
|
||||
|
||||
skyshade[i] = Min(255,dayfade + nightfade + sunrisefade);
|
||||
var nightfade = Cos(progress / 2, nightcolour[i], 10);
|
||||
var dayfade = daycolour[i] - Cos(progress / 2, daycolour[i], 10);
|
||||
var sunrisefade = Sin(progress, sunrisecolour[i], 10);
|
||||
skyshade[i] = Min(255, dayfade + nightfade + sunrisefade);
|
||||
}
|
||||
|
||||
skyshade[3] = Min(255,progress/2);
|
||||
skyshade[3] = Min(255, progress / 2);
|
||||
}
|
||||
// Day
|
||||
// Day.
|
||||
else if (day)
|
||||
{
|
||||
skyshade[0] = 255;
|
||||
skyshade[1] = 255;
|
||||
skyshade[2] = 255;
|
||||
|
||||
skyshade[3] = 255;
|
||||
skyshade = [255, 255, 255, 255];
|
||||
}
|
||||
// Sunset
|
||||
// Sunset.
|
||||
else if (sunset)
|
||||
{
|
||||
var time_since_sunset = time - time_set["SunsetStart"];
|
||||
var time_since_sunset = time - time_set.sunset_start;
|
||||
// progress in 0..1800
|
||||
var progress = time_since_sunset * 1800 / (time_set["SunsetEnd"] - time_set["SunsetStart"]);
|
||||
var progress = time_since_sunset * 1800 / (time_set.sunset_end - time_set.sunset_start);
|
||||
|
||||
for(var i=0; i<3; ++i)
|
||||
for (var i = 0; i < 3; ++i)
|
||||
{
|
||||
var dayfade = Cos(progress/2, daycolour[i],10);
|
||||
var nightfade = nightcolour[i] - Cos(progress/2, nightcolour[i],10);
|
||||
var sunsetfade = Sin(progress, sunsetcolour[i],10);
|
||||
|
||||
skyshade[i] = Min(255,dayfade + nightfade + sunsetfade);
|
||||
}
|
||||
|
||||
skyshade[3] = Min(255,900-progress/2);
|
||||
var dayfade = Cos(progress / 2, daycolour[i], 10);
|
||||
var nightfade = nightcolour[i] - Cos(progress / 2, nightcolour[i], 10);
|
||||
var sunsetfade = Sin(progress, sunsetcolour[i], 10);
|
||||
skyshade[i] = Min(255, dayfade + nightfade + sunsetfade);
|
||||
}
|
||||
skyshade[3] = Min(255, 900 - progress / 2);
|
||||
}
|
||||
// Night
|
||||
// Night.
|
||||
else if (night)
|
||||
{
|
||||
skyshade[0] = nightcolour[0];
|
||||
skyshade[1] = nightcolour[1];
|
||||
skyshade[2] = nightcolour[2];
|
||||
|
||||
skyshade = nightcolour;
|
||||
skyshade[3] = 0;
|
||||
}
|
||||
|
||||
// Shade sky.
|
||||
// Shade the sky using sky adjust.
|
||||
SetSkyAdjust(RGB(skyshade[0], skyshade[1], skyshade[2]));
|
||||
|
||||
// Shade landscape.
|
||||
var gamma = [0,0,0];
|
||||
var min_gamma = [30,75,120];
|
||||
gamma[0] = BoundBy(skyshade[0], min_gamma[0], 128);
|
||||
gamma[1] = BoundBy(skyshade[1], min_gamma[1], 128);
|
||||
gamma[2] = BoundBy(skyshade[2], min_gamma[2], 128);
|
||||
// Shade the landscape and the general feeling by reducing the ambient light.
|
||||
var new_ambient = 100 * skyshade[2] / 255;
|
||||
if (GetAmbientBrightness() != new_ambient)
|
||||
SetAmbientBrightness(new_ambient);
|
||||
|
||||
//SetGamma(0, RGB(gamma[0], gamma[1], gamma[2]), RGB(127+gamma[0], 127+gamma[1], 127+gamma[2]), 3);
|
||||
|
||||
if(!day && !night)
|
||||
// Adjust celestial objects and clouds.
|
||||
if (!day && !night)
|
||||
{
|
||||
// Adjust celestial objects.
|
||||
for (var celestial in FindObjects(Find_Func("IsCelestial")))
|
||||
celestial->SetObjAlpha(255 - skyshade[3]);
|
||||
|
||||
// Adjust clouds
|
||||
for(var cloud in FindObjects(Find_ID(Cloud))){
|
||||
for (var cloud in FindObjects(Find_ID(Cloud)))
|
||||
cloud->SetLightingShade(255 - skyshade[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Adjusts the sky, celestial and others to the current time. Use SetTime() at runtime, not this.
|
||||
private func AdjustToTime()
|
||||
{
|
||||
if (Abs(time - time_set["SunriseEnd"]) <= advance_seconds_per_tick)
|
||||
OnSunriseEnd();
|
||||
else if (Abs(time - time_set["SunsetStart"]) <= advance_seconds_per_tick)
|
||||
OnSunsetStart();
|
||||
|
||||
DoSkyShade();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Scenario saving */
|
||||
/*-- Scenario saving --*/
|
||||
|
||||
func SaveScenarioObject(props)
|
||||
public func SaveScenarioObject(props)
|
||||
{
|
||||
if (!inherited(props, ...)) return false;
|
||||
// Initialize function depends on this object implicitely
|
||||
// So make sure it's created before this
|
||||
var celestial_env = FindObject(Find_ID(Environment_Celestial));
|
||||
if (celestial_env) celestial_env->MakeScenarioSaveName();
|
||||
// Save time props
|
||||
if (GetTime() != 43200) props->AddCall("Time", this, "SetTime", GetTime());
|
||||
if (GetCycleSpeed() != 30) props->AddCall("CycleSpeed", this, "SetCycleSpeed", GetCycleSpeed());
|
||||
if (!inherited(props, ...))
|
||||
return false;
|
||||
// Save time props.
|
||||
if (GetTime() != 43200)
|
||||
props->AddCall("Time", this, "SetTime", GetTime());
|
||||
if (GetCycleSpeed() != 30)
|
||||
props->AddCall("CycleSpeed", this, "SetCycleSpeed", GetCycleSpeed());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* Properties */
|
||||
/*-- Properties --*/
|
||||
|
||||
local Name = "Time";
|
||||
|
|
|
@ -1,21 +1,29 @@
|
|||
/*-- Stars --*/
|
||||
/**
|
||||
Stars
|
||||
Stars which are shown in the night sky.
|
||||
*/
|
||||
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
var alpha=0;
|
||||
if(GetTime()<300 || GetTime()>1140) alpha=255;
|
||||
var g = RandomX(1,9);
|
||||
if(g > 1) SetGraphics(Format("%d",g));
|
||||
SetClrModulation(RGBa(255,255,255,alpha));
|
||||
var g = RandomX(1, 9);
|
||||
if (g > 1)
|
||||
SetGraphics(Format("%d", g));
|
||||
|
||||
var alpha = 0;
|
||||
var time = FindObject(Find_ID(Environment_Time));
|
||||
if (time && time->IsNight())
|
||||
alpha = 255;
|
||||
SetClrModulation(RGBa(255, 255, 255, alpha));
|
||||
SetObjectBlitMode(GFX_BLIT_Additive);
|
||||
|
||||
var parallax = RandomX(8,12);
|
||||
this["Parallaxity"] = [parallax,parallax];
|
||||
this.Parallaxity = [parallax, parallax];
|
||||
return;
|
||||
}
|
||||
|
||||
// Only appears during the night.
|
||||
public func IsCelestial() { return true; }
|
||||
|
||||
// Not stored by itself because it's created by the time environment
|
||||
// (Also, a million stars in Objects.c would suck)
|
||||
func SaveScenarioObject() { return false; }
|
||||
|
||||
local Name = "Stars";
|
||||
// Not stored by itself because it's created by the time environment.
|
||||
public func SaveScenarioObject() { return false; }
|
||||
|
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 18 KiB |
|
@ -383,7 +383,7 @@ protected func InitializePlayer(int plr, int x, int y, object base, int team)
|
|||
DoScoreboardShow(1, plr + 1);
|
||||
JoinPlayer(plr);
|
||||
// Scenario script callback.
|
||||
GameCall("OnPlayerRespawn", plr, respawn_list[plr]);
|
||||
GameCall("OnPlayerRespawn", plr, FindRespawnCP(plr));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -395,7 +395,7 @@ protected func RelaunchPlayer(int plr)
|
|||
SetCursor(plr, clonk);
|
||||
JoinPlayer(plr);
|
||||
// Scenario script callback.
|
||||
GameCall("OnPlayerRespawn", plr, respawn_list[plr]);
|
||||
GameCall("OnPlayerRespawn", plr, FindRespawnCP(plr));
|
||||
// Log message.
|
||||
Log(RndRespawnMsg(), GetPlayerName(plr));
|
||||
return;
|
||||
|
@ -416,9 +416,30 @@ protected func JoinPlayer(int plr)
|
|||
return;
|
||||
}
|
||||
|
||||
private func FindRespawnCP(int plr)
|
||||
{
|
||||
var best_cp = respawn_list[plr];
|
||||
var team = GetPlayerTeam(plr);
|
||||
if (!team)
|
||||
return best_cp;
|
||||
// Loop over team members to find a better checkpoint.
|
||||
for (var i = 0; i < GetPlayerCount(); i++)
|
||||
{
|
||||
var test_plr = GetPlayerByIndex(i);
|
||||
if (GetPlayerTeam(test_plr) == team)
|
||||
{
|
||||
var test_cp = respawn_list[test_plr];
|
||||
if (test_cp->GetCPNumber() && test_cp->GetCPNumber() > best_cp->GetCPNumber())
|
||||
best_cp = test_cp;
|
||||
}
|
||||
}
|
||||
return best_cp;
|
||||
}
|
||||
|
||||
private func FindRespawnPos(int plr)
|
||||
{
|
||||
return [respawn_list[plr]->GetX(), respawn_list[plr]->GetY()];
|
||||
var cp = FindRespawnCP(plr);
|
||||
return [cp->GetX(), cp->GetY()];
|
||||
}
|
||||
|
||||
protected func RemovePlayer(int plr)
|
||||
|
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 21 KiB |
|
@ -418,6 +418,7 @@ public func UpdateSelectionStatus()
|
|||
// script...
|
||||
else if(actiontype == ACTIONTYPE_SCRIPT)
|
||||
{
|
||||
this.Tooltip = nil;
|
||||
var metainfo = myobject->~GetInteractionMetaInfo(crew, modus);
|
||||
if(metainfo)
|
||||
{
|
||||
|
@ -425,7 +426,8 @@ public func UpdateSelectionStatus()
|
|||
SetObjDrawTransform(IconSize(),0,-16000,0,IconSize(),20000, 2);
|
||||
|
||||
var desc = metainfo["Description"];
|
||||
if(desc) this.Tooltip = desc;
|
||||
if(desc)
|
||||
this.Tooltip = desc;
|
||||
|
||||
if(metainfo["Selected"])
|
||||
SetObjDrawTransform(1200,0,0,0,1200,0,1);
|
||||
|
@ -449,8 +451,7 @@ public func UpdateSelectionStatus()
|
|||
sel += 1;
|
||||
if(1 == position)
|
||||
sel += 2;
|
||||
}
|
||||
|
||||
}
|
||||
selected = sel;
|
||||
|
||||
// and set the icon...
|
||||
|
|
|
@ -87,11 +87,21 @@ public func InitDialogue(string name, object target, bool attention)
|
|||
// Update dialogue to target.
|
||||
UpdateDialogue();
|
||||
|
||||
// Effect on targets to remove the dialogue when target dies or is removed
|
||||
AddEffect("IntDialogue", target, 1, 0, this);
|
||||
|
||||
// Custom dialogue initialization
|
||||
if (!Call(Format("~Dlg_%s_Init", dlg_name), dlg_target))
|
||||
GameCall(Format("~Dlg_%s_Init", dlg_name), this, dlg_target);
|
||||
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
private func FxIntDialogueStop(object target, proplist fx, int reason, bool temp)
|
||||
{
|
||||
// Target removed or died: Remove dialogue
|
||||
if (!temp) RemoveObject();
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
public func AddAttention()
|
||||
|
|
|
@ -12,7 +12,7 @@ protected func ControlUse(object clonk, int iX, int iY)
|
|||
clonk->Eat(this);
|
||||
}
|
||||
|
||||
public func NutritionalValue() { return 15; }
|
||||
public func NutritionalValue() { return 25; }
|
||||
|
||||
public func IsKitchenProduct() { return true; }
|
||||
public func GetFuelNeed() { return 50; }
|
||||
|
|
|
@ -14,7 +14,12 @@ protected func Hit(x, y)
|
|||
}
|
||||
|
||||
public func IsFuel() { return true; }
|
||||
public func GetFuelAmount() { return GetCon(); }
|
||||
public func GetFuelAmount(bool get_partial)
|
||||
{
|
||||
if (get_partial)
|
||||
return GetCon();
|
||||
return 100;
|
||||
}
|
||||
|
||||
local Collectible = 1;
|
||||
local Name = "$Name$";
|
||||
|
|
|
@ -40,7 +40,7 @@ func FxIntBridgeStart(object clonk, proplist effect, int temp, int x, int y)
|
|||
effect.Last = 0;
|
||||
// Last bridge coordinates.
|
||||
effect.LastX = GetX();
|
||||
effect.LastY = clonk->GetDefBottom() + 3;
|
||||
effect.LastY = clonk->GetDefBottom() + 4;
|
||||
// Target coordinates.
|
||||
effect.TargetX = x;
|
||||
effect.TargetY = y;
|
||||
|
@ -83,7 +83,7 @@ func FxIntBridgeTimer(object clonk, proplist effect, int time)
|
|||
var last_x = effect.LastX;
|
||||
var last_y = effect.LastY;
|
||||
var dx = x-last_x, dy=y-last_y, d=Distance(dx, dy);
|
||||
// Quantize angle as a multiple of 45 degrees.
|
||||
// Quantize angle as a multiple of 30 degrees.
|
||||
var quant = 30;
|
||||
var angle = Angle(0, 0, dx, dy);
|
||||
angle = angle + quant/2 - Sign(angle-quant/2)*((angle-quant/2) % quant);
|
||||
|
|
|
@ -113,7 +113,7 @@ private func FindNearWater()
|
|||
/*-- Status --*/
|
||||
|
||||
public func IsFuel() { return !wetness; }
|
||||
public func GetFuelAmount() { return 100; }
|
||||
public func GetFuelAmount(bool get_partial) { return 100; }
|
||||
|
||||
local Collectible = 1;
|
||||
local Name = "$Name$";
|
||||
|
|
|
@ -8,11 +8,16 @@ protected func Hit()
|
|||
|
||||
func Incineration()
|
||||
{
|
||||
SetClrModulation (RGB(48, 32, 32));
|
||||
SetClrModulation(RGB(48, 32, 32));
|
||||
}
|
||||
|
||||
public func IsFuel() { return true; }
|
||||
public func GetFuelAmount() { return 50; }
|
||||
public func GetFuelAmount(bool get_partial)
|
||||
{
|
||||
if (get_partial)
|
||||
return GetCon() / 2;
|
||||
return 50;
|
||||
}
|
||||
public func IsSawmillProduct() { return true; }
|
||||
|
||||
local Collectible = 1;
|
||||
|
|
|
@ -98,7 +98,12 @@ private func GetWall(int angle)
|
|||
|
||||
protected func Hit() { Sound("GeneralHit?"); }
|
||||
|
||||
protected func Incineration() { Extinguish(); Fuse(); }
|
||||
protected func Incineration(int caused_by)
|
||||
{
|
||||
Extinguish();
|
||||
Fuse();
|
||||
SetController(caused_by);
|
||||
}
|
||||
|
||||
protected func RejectEntrance()
|
||||
{
|
||||
|
|
|
@ -97,16 +97,18 @@ public func DoExplode()
|
|||
Explode(Sqrt(18**2*count));
|
||||
}
|
||||
|
||||
protected func Incineration()
|
||||
protected func Incineration(int caused_by)
|
||||
{
|
||||
AddEffect("Fuse", this, 100, 1, this);
|
||||
Sound("Fuse");
|
||||
SetController(caused_by);
|
||||
return;
|
||||
}
|
||||
|
||||
protected func Damage()
|
||||
protected func Damage(int change, int type, int by_player)
|
||||
{
|
||||
Incinerate();
|
||||
Incinerate(nil, by_player);
|
||||
return;
|
||||
}
|
||||
|
||||
public func FxFuseTimer(object target, effect, int timer)
|
||||
|
|
|
@ -8,6 +8,7 @@ local Description = "$Description$";
|
|||
local UsageHelp = "$UsageHelp$";
|
||||
local Collectible = 1;
|
||||
local Rebuy = true;
|
||||
local ApertureOffsetY = 3; // pump from bottom vertex
|
||||
|
||||
protected func Hit()
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ func Incineration()
|
|||
}
|
||||
|
||||
public func IsFuel() { return true; }
|
||||
public func GetFuelAmount() { return 30; }
|
||||
public func GetFuelAmount(bool get_partial) { return 30; }
|
||||
|
||||
// Main bridge object is saved
|
||||
func SaveScenarioObject() { return false; }
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*-- WallKit preview --*/
|
||||
|
||||
// definition call: create line
|
||||
func Create(int x1,int y1,int x2,int y2,int clr)
|
||||
func Create(int x1, int y1, int x2, int y2, int clr)
|
||||
{
|
||||
var obj = CreateObjectAbove(WallKit_Preview);
|
||||
obj->Set(x1,y1,x2,y2,clr);
|
||||
obj->Set(x1, y1, x2, y2, clr);
|
||||
return obj;
|
||||
}
|
||||
|
||||
func Set(int x1,int y1,int x2,int y2,int clr)
|
||||
{
|
||||
SetVertexXY(0, x1,y1);
|
||||
SetVertexXY(1, x2,y2);
|
||||
SetVertexXY(0, x1, y1);
|
||||
SetVertexXY(1, x2, y2);
|
||||
this.LineColors = [clr, clr];
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -43,8 +43,9 @@ public func ControlUseCancel(object clonk, int x, int y)
|
|||
private func CreateBridge(object clonk, int x, int y)
|
||||
{
|
||||
var c = Offset2BridgeCoords(clonk, x, y);
|
||||
x=clonk->GetX(); y=clonk->GetY();
|
||||
DrawMaterialQuad("Granite-granite", x+c.x1-c.dx,y+c.y1-c.dy, x+c.x1+c.dx,y+c.y1+c.dy, x+c.x2+c.dx,y+c.y2+c.dy, x+c.x2-c.dx,y+c.y2-c.dy, DMQ_Bridge);
|
||||
x = clonk->GetX();
|
||||
y = clonk->GetY();
|
||||
DrawMaterialQuad("Granite-granite", x + c.x1 - c.dxm, y + c.y1 - c.dym, x + c.x1 + c.dxp, y + c.y1 + c.dyp, x + c.x2 + c.dxp, y + c.y2 + c.dyp, x + c.x2 - c.dxm, y + c.y2 - c.dym, DMQ_Bridge);
|
||||
clonk->Sound("WallKitLock");
|
||||
return true;
|
||||
}
|
||||
|
@ -55,18 +56,23 @@ private func CreateBridge(object clonk, int x, int y)
|
|||
private func Offset2BridgeCoords(object clonk, int x, int y)
|
||||
{
|
||||
// Returns starting and end point offset of bridge to be built as player points to offset x/y
|
||||
var dx=clonk->GetDefWidth(), dy=clonk->GetDefHeight(), ox,oy,rx,ry,l=BridgeLength;
|
||||
ox=x*2/Abs(y+!y); oy=y*2/Abs(x+!x);
|
||||
ry=ox/=Abs(ox)+!ox;
|
||||
rx=oy/=Abs(oy)+!oy;
|
||||
ox*=dx/2+2*!oy;
|
||||
oy*=dy/2+2*!ox;
|
||||
l-=l*3*Abs(rx*ry)/10;
|
||||
return { dx=ry*BridgeThickness, dy=rx*BridgeThickness, x1=ox+(rx*=l), y1=oy-(ry*=l), x2=ox-rx, y2=oy+ry };
|
||||
var dx = clonk->GetDefWidth(), dy = clonk->GetDefHeight(), ox, oy, rx, ry;
|
||||
var l = BridgeLength;
|
||||
var d = BridgeThickness;
|
||||
ox = x * 2 / Abs(y + !y);
|
||||
oy = y * 2 / Abs(x + !x);
|
||||
ry = ox /= Abs(ox) + !ox;
|
||||
rx = oy /= Abs(oy) + !oy;
|
||||
// Offset of the bridge: more for vertical and horizontal bridges.
|
||||
ox *= dx / 2 + 3 * !oy;
|
||||
oy *= dy / 2 + 3 * !ox;
|
||||
// Reduce thickness and length for diagonal bridges.
|
||||
l -= l * 3 * Abs(rx * ry) / 10;
|
||||
d -= d * 3 * Abs(rx * ry) / 10;
|
||||
return { dxp = ry * d / 2, dyp = rx * d / 2, dxm = ry * (d + 1) / 2, dym = rx * (d + 1) / 2, x1 = ox + rx * l, y1 = oy - ry * l, x2 = ox - rx * l, y2 = oy + ry * l };
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Preview */
|
||||
|
||||
local preview;
|
||||
|
@ -115,4 +121,4 @@ local Description = "$Description$";
|
|||
local UsageHelp = "$UsageHelp$";
|
||||
local Rebuy = true;
|
||||
local BridgeLength = 20;
|
||||
local BridgeThickness = 1;
|
||||
local BridgeThickness = 5;
|
||||
|
|
|
@ -1,172 +1,234 @@
|
|||
/*--
|
||||
Windbag (aka Jar of Winds)
|
||||
Author: MimmoO
|
||||
/**
|
||||
Windbag
|
||||
Automatically collects air when it is full which can be released into a blast.
|
||||
|
||||
@author MimmoO, Maikel
|
||||
*/
|
||||
|
||||
Collect air until you're full, then release it with a blast.
|
||||
--*/
|
||||
local fill_amount;
|
||||
|
||||
local Amount;
|
||||
local MaxCap;
|
||||
local sound;
|
||||
|
||||
func Hit()
|
||||
{
|
||||
Sound("GeneralHit?");
|
||||
}
|
||||
|
||||
public func GetCarryMode(clonk) { return CARRY_Musket; }
|
||||
public func GetCarryTransform()
|
||||
{
|
||||
return Trans_Mul(Trans_Rotate(220,0,0,1),Trans_Rotate(-30,1,0,0),Trans_Rotate(26,0,1,0));
|
||||
}
|
||||
public func GetCarryPhase() { return 600; }
|
||||
|
||||
public func FxJarReloadTimer(object target, effect, int time)
|
||||
{
|
||||
target->Load();
|
||||
}
|
||||
|
||||
public func DoFullLoad()
|
||||
{
|
||||
Amount = MaxCap;
|
||||
return;
|
||||
}
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
MaxCap = 60; //Changes duration and power
|
||||
SetR(-45);
|
||||
AddEffect("JarReload",this,100,2,this);
|
||||
sound=false;
|
||||
AddEffect("IntReload", this, 100, 1, this);
|
||||
return;
|
||||
}
|
||||
|
||||
protected func ControlUse(object pClonk, iX, iY)
|
||||
protected func Hit()
|
||||
{
|
||||
if (pClonk->GetProcedure() == "ATTACH")
|
||||
Sound("GeneralHit?");
|
||||
return;
|
||||
}
|
||||
|
||||
public func GetCarryMode(clonk) { return CARRY_Musket; }
|
||||
|
||||
public func GetCarryTransform()
|
||||
{
|
||||
return Trans_Mul(Trans_Rotate(220, 0, 0, 1), Trans_Rotate(-30, 1, 0, 0), Trans_Rotate(26, 0, 1, 0));
|
||||
}
|
||||
|
||||
public func GetCarryPhase() { return 600; }
|
||||
|
||||
public func IsInventorProduct() { return true; }
|
||||
|
||||
|
||||
/*-- Usage --*/
|
||||
|
||||
protected func ControlUse(object clonk, x, y)
|
||||
{
|
||||
if (clonk->GetProcedure() == "ATTACH")
|
||||
return true;
|
||||
if(!GetEffect("JarReload",this))
|
||||
if (!GetEffect("IntReload", this) && !GetEffect("IntBurstWind", this))
|
||||
{
|
||||
if(!GBackLiquid())
|
||||
{
|
||||
FireWeapon(pClonk, iX, iY);
|
||||
Amount=0;
|
||||
AddEffect("JarReload",this,100,1,this);
|
||||
Sound("WindCharge",false,nil,nil,1);
|
||||
sound=true;
|
||||
}
|
||||
|
||||
if (!GBackLiquid())
|
||||
BlastWind(clonk, x, y);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pClonk->Message("Reloading!");
|
||||
return true;
|
||||
}
|
||||
// ChargeSoundStop();
|
||||
clonk->Message("$MsgReloading$");
|
||||
return true;
|
||||
}
|
||||
|
||||
protected func Load()
|
||||
|
||||
/*-- Loading --*/
|
||||
|
||||
public func DoFullLoad()
|
||||
{
|
||||
|
||||
if(Amount <= MaxCap)
|
||||
{
|
||||
var R=RandomX(-25,25);
|
||||
var D=RandomX(19,50);
|
||||
var A=Random(360);
|
||||
var SX=Sin(A + R,D);
|
||||
var SY=Cos(A + R,D);
|
||||
fill_amount = MaxIntake;
|
||||
return;
|
||||
}
|
||||
|
||||
public func FxIntReloadStart(object target, proplist effect, int temp)
|
||||
{
|
||||
if (temp)
|
||||
return FX_OK;
|
||||
effect.Interval = 1;
|
||||
effect.sound = false;
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
public func FxIntReloadTimer(object target, proplist effect, int time)
|
||||
{
|
||||
if (fill_amount > MaxIntake)
|
||||
return FX_Execute_Kill;
|
||||
|
||||
if(!GBackSolid(SX,SY) && !GBackLiquid(SX,SY) && !GBackSolid(0,0) && !GBackLiquid(0,0)) //when on a random spot in front is air...
|
||||
{
|
||||
if(!sound)
|
||||
{
|
||||
Sound("WindCharge",false,nil,nil,1);
|
||||
sound=true;
|
||||
}
|
||||
Amount += 2; //Air is sucked in.
|
||||
CreateParticle("Air", SX, SY, Sin(A + R,-D / 2), Cos(A + R,-D / 2), 18, {Prototype = Particles_Air(), Size = PV_KeyFrames(0, 0, 0, 250, 3, 1000, 0)});
|
||||
}
|
||||
else if(GBackSolid(0,0) || GBackLiquid(0,0))
|
||||
{
|
||||
if(sound)
|
||||
ChargeSoundStop();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
if (GBackSolid(0,0) || GBackLiquid(0,0))
|
||||
{
|
||||
RemoveEffect("JarReload",this);
|
||||
ChargeSoundStop();
|
||||
|
||||
if (effect.sound)
|
||||
{
|
||||
Sound("WindCharge", false, nil, nil, -1);
|
||||
Sound("WindChargeStop");
|
||||
effect.sound = false;
|
||||
}
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
var radius = RandomX(12, 24);
|
||||
var angle = Random(360);
|
||||
var angle_var = RandomX(-25, 25);
|
||||
var x = Sin(angle + angle_var, radius);
|
||||
var y = Cos(angle + angle_var, radius);
|
||||
// Check for a spot of air from which to take the air in.
|
||||
if (!GBackSolid(x, y) && !GBackLiquid(x, y) && !GBackSolid(0, 0) && !GBackLiquid(0, 0))
|
||||
{
|
||||
if (!effect.sound)
|
||||
{
|
||||
Sound("WindCharge", false, nil, nil, 1);
|
||||
effect.sound = true;
|
||||
}
|
||||
|
||||
// Particles from the point where the air is sucked in.
|
||||
var air = {
|
||||
Prototype = Particles_Air(),
|
||||
Size = PV_KeyFrames(0, 0, 0, 250, 3, 1000, 0)
|
||||
};
|
||||
CreateParticle("Air", x, y, -2 * x / 3, -2 * y / 3, 15, air);
|
||||
|
||||
// Increase the fill amount proportional to the number of frames.
|
||||
fill_amount += effect.Interval;
|
||||
}
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
protected func ChargeSoundStop()
|
||||
public func FxIntReloadStop(object target, proplist effect, int reason, bool temp)
|
||||
{
|
||||
Sound("WindCharge",false,nil,nil,-1);
|
||||
Sound("WindChargeStop");
|
||||
sound=false;
|
||||
if (temp)
|
||||
return FX_OK;
|
||||
if (effect.sound)
|
||||
{
|
||||
Sound("WindCharge", false, nil, nil, -1);
|
||||
Sound("WindChargeStop");
|
||||
}
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
private func FireWeapon(object pClonk,iX,iY)
|
||||
|
||||
/*-- Blasting --*/
|
||||
|
||||
private func BlastWind(object clonk, int x, int y)
|
||||
{
|
||||
var iAngle=Angle(0,0,iX,iY);
|
||||
|
||||
ChargeSoundStop();
|
||||
if (fill_amount <= 0)
|
||||
{
|
||||
fill_amount = 0;
|
||||
AddEffect("IntReload", this, 100, 1, this);
|
||||
return;
|
||||
}
|
||||
// The blast is handled by an effect.
|
||||
AddEffect("IntBurstWind", this, 100, 1, this, nil, clonk, x, y);
|
||||
return;
|
||||
}
|
||||
|
||||
public func FxIntBurstWindStart(object target, proplist effect, int temp, object clonk, int x, int y)
|
||||
{
|
||||
if (temp)
|
||||
return FX_OK;
|
||||
effect.Interval = 1;
|
||||
effect.clonk = clonk;
|
||||
effect.x = clonk->GetX();
|
||||
effect.y = clonk->GetY();
|
||||
effect.angle = Angle(0, 0, x, y);
|
||||
// Sound effect.
|
||||
Sound("WindGust");
|
||||
|
||||
//Find Victims to push
|
||||
for(var i=10; i<32; i++)
|
||||
// Particle effect.
|
||||
for (var dr = 12; dr < 32; dr++)
|
||||
{
|
||||
var R = RandomX(-20,20);
|
||||
var SX = Sin(180 - iAngle + R,i);
|
||||
var SY = Cos(180 - iAngle + R,i);
|
||||
|
||||
if(!GBackSolid(SX,SY))
|
||||
{
|
||||
CreateParticle("Air", SX, SY, Sin(180 - iAngle + (R),(Amount / 2) + 25), Cos(180 - iAngle + (R),(Amount / 2) + 25), 36, Particles_Air());
|
||||
}
|
||||
}
|
||||
|
||||
var sinspeed = Sin(180 - iAngle + (R / 2),(Amount) + 15);
|
||||
var cosspeed = Cos(180 - iAngle + (R / 2),(Amount) + 15);
|
||||
|
||||
if(pClonk->GetAction() != "Walk")
|
||||
{ //Makes the clonk firing it be pushed backwards a bit
|
||||
var x = pClonk->GetXDir();
|
||||
var y = pClonk->GetYDir();
|
||||
pClonk->SetXDir((x) - (sinspeed / 3));
|
||||
pClonk->SetYDir((y) - (cosspeed / 3));
|
||||
}
|
||||
|
||||
for( var obj in FindObjects(
|
||||
Find_Or(
|
||||
Find_Distance(10,Sin(180 - iAngle,20),Cos(180 - iAngle,20)),
|
||||
Find_Distance(18,Sin(180 - iAngle,40),Cos(180 - iAngle,40)),
|
||||
Find_Distance(25,Sin(180 - iAngle,70),Cos(180 - iAngle,70))
|
||||
),
|
||||
Find_Not(Find_Category(C4D_Structure)),
|
||||
Find_Not(Find_Func("IsEnvironment")),
|
||||
Find_Not(Find_Func("NoWindbagForce")),
|
||||
Find_Layer(GetObjectLayer()), Find_NoContainer()
|
||||
)
|
||||
)
|
||||
{
|
||||
if(obj != pClonk && PathFree(pClonk->GetX(),pClonk->GetY(),obj->GetX(),obj->GetY()))
|
||||
{
|
||||
//enemys are pushed back
|
||||
var x = obj->GetXDir();
|
||||
var y = obj->GetYDir();
|
||||
obj->SetXDir((x) + sinspeed);
|
||||
obj->SetYDir((y) + cosspeed);
|
||||
}
|
||||
var r = RandomX(-20, 20);
|
||||
var sx = Sin(effect.angle + r, dr / 2);
|
||||
var sy = -Cos(effect.angle + r, dr / 2);
|
||||
var vx = Sin(effect.angle + r, 2 * fill_amount / 3 + 12);
|
||||
var vy = -Cos(effect.angle + r, 2 * fill_amount / 3 + 12);
|
||||
if (!GBackSolid(sx, sy))
|
||||
CreateParticle("Air", sx, sy, vx, vy, 36, Particles_Air());
|
||||
}
|
||||
// Make a timer call for the instant movement effect.
|
||||
FxIntBurstWindTimer(target, effect, 0);
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
func IsInventorProduct() { return true; }
|
||||
public func FxIntBurstWindTimer(object target, proplist effect, int time)
|
||||
{
|
||||
var real_time = time + 1;
|
||||
if (real_time > 8)
|
||||
return FX_Execute_Kill;
|
||||
|
||||
// Determine blast strength.
|
||||
var vx = Sin(effect.angle, 20 * fill_amount + 150);
|
||||
var vy = -Cos(effect.angle, 20 * fill_amount + 150);
|
||||
|
||||
// Change the velocity of the shooter.
|
||||
if (effect.clonk && effect.clonk->GetAction() != "Walk")
|
||||
{
|
||||
var cx = effect.clonk->GetXDir(100);
|
||||
var cy = effect.clonk->GetYDir(100);
|
||||
effect.clonk->SetXDir(cx - vx / (8 * real_time), 100);
|
||||
effect.clonk->SetYDir(cy - vy / (8 * real_time), 100);
|
||||
}
|
||||
|
||||
// Move other objects in a cone around the burst direction.
|
||||
var criteria = Find_And(Find_Not(Find_Category(C4D_Structure)), Find_Not(Find_Func("IsEnvironment")), Find_Not(Find_Func("NoWindbagForce")),
|
||||
Find_Layer(GetObjectLayer()), Find_NoContainer(), Find_Exclude(effect.clonk), Find_PathFree(effect.clonk));
|
||||
var dist = 14 + 9 * real_time / 2;
|
||||
var rad = 8 + 8 * real_time / 3;
|
||||
var cone_x = Sin(effect.angle, dist);
|
||||
var cone_y = -Cos(effect.angle, dist);
|
||||
var vx_cone = vx / 6;
|
||||
var vy_cone = vy / 6;
|
||||
//DrawParticleRing(rad, cone_x + AbsX(effect.x), cone_y + AbsY(effect.y));
|
||||
for (var obj in FindObjects(Find_Distance(rad, cone_x + AbsX(effect.x), cone_y + AbsY(effect.y)), criteria))
|
||||
{
|
||||
var ox = obj->GetXDir(100);
|
||||
var oy = obj->GetYDir(100);
|
||||
var vx_cone_reduced = vx_cone / 2 + vx_cone / (2 * Max(1, obj->GetMass() / 4));
|
||||
var vy_cone_reduced = vy_cone / 2 + vy_cone / (2 * Max(1, obj->GetMass() / 4));
|
||||
obj->SetXDir(ox + vx_cone_reduced, 100);
|
||||
obj->SetYDir(oy + vy_cone_reduced, 100);
|
||||
}
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
func Definition(def) {
|
||||
SetProperty("PictureTransformation",Trans_Mul(Trans_Scale(1500),Trans_Rotate(150,0,0,1),Trans_Rotate(-170,1,0,0),Trans_Rotate(10,0,1,0)),def);
|
||||
public func FxIntBurstWindStop(object target, proplist effect, int reason, bool temp)
|
||||
{
|
||||
if (temp)
|
||||
return FX_OK;
|
||||
// Reset the fill amount and start reloading.
|
||||
fill_amount = 0;
|
||||
AddEffect("IntReload", target, 100, 1, target);
|
||||
return FX_OK;
|
||||
}
|
||||
|
||||
public func DrawParticleRing(int r, int x, int y)
|
||||
{
|
||||
for (var angle = 0; angle < 360; angle += 15)
|
||||
CreateParticle("SphereSpark", x + Cos(angle, r), y + Sin(angle, r), 0, 0, 36, { Size = 2 });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*-- Properties --*/
|
||||
|
||||
protected func Definition(def)
|
||||
{
|
||||
SetProperty("PictureTransformation", Trans_Mul(Trans_Scale(1500), Trans_Rotate(150, 0, 0, 1), Trans_Rotate(-170, 1, 0, 0), Trans_Rotate(10, 0, 1, 0)), def);
|
||||
}
|
||||
|
||||
local Name = "$Name$";
|
||||
|
@ -174,3 +236,4 @@ local Description = "$Description$";
|
|||
local UsageHelp = "$UsageHelp$";
|
||||
local Collectible = 1;
|
||||
local Rebuy = true;
|
||||
local MaxIntake = 30;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
Name=Windbeutel
|
||||
Description=Enthält komprimierten Wind der in einem Stoß entfesselt werden kann.
|
||||
UsageHelp=Ziele und drücke [Benutzen], um einen Windstoß in diese Richtung zu entfesseln.
|
||||
Description=Enthält komprimierten Wind der in einem Stoß entfesselt werden kann.
|
||||
UsageHelp=Ziele und drücke [Benutzen], um einen Windstoß in diese Richtung zu entfesseln.
|
||||
|
||||
MsgReloading=Lädt nach!
|
|
@ -1,3 +1,5 @@
|
|||
Name=Wind bag
|
||||
Description=Contains compressed wind that can be released in one gust.
|
||||
UsageHelp=Aim and press [Use] to release a gust of wind in the direction specified.
|
||||
UsageHelp=Aim and press [Use] to release a gust of wind in the direction specified.
|
||||
|
||||
MsgReloading=Reloading!
|
|
@ -125,7 +125,7 @@ protected func ControlUseStop(object clonk, ix, iy)
|
|||
{
|
||||
holding = false;
|
||||
clonk->StopAim();
|
||||
return -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Callback from the clonk, when he actually has stopped aiming
|
||||
|
@ -160,6 +160,7 @@ private func FireWeapon(object clonk, int angle)
|
|||
|
||||
shot->LaunchProjectile(angle, 0, 75, IX, IY);
|
||||
shot->~Fuse(true);
|
||||
shot->SetController(clonk->GetController());
|
||||
|
||||
loaded = false;
|
||||
SetProperty("PictureTransformation",Trans_Mul(Trans_Translate(1500,0,-1500),Trans_Rotate(170,0,1,0),Trans_Rotate(30,0,0,1)));
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
local armed; // If true, explodes on contact
|
||||
|
||||
public func ControlUse(object clonk, int x, int y, bool box)
|
||||
public func ControlUse(object clonk, int x, int y)
|
||||
{
|
||||
// if already activated, nothing (so, throw)
|
||||
if(GetEffect("FuseBurn", this))
|
||||
|
@ -63,13 +63,18 @@ func DoExplode()
|
|||
Explode(30);
|
||||
}
|
||||
|
||||
protected func Hit(x, y)
|
||||
protected func Hit(int x, int y)
|
||||
{
|
||||
if (armed) return DoExplode();
|
||||
StonyObjectHit(x,y);
|
||||
}
|
||||
|
||||
protected func Incineration() { Extinguish(); Fuse(); }
|
||||
protected func Incineration(int caused_by)
|
||||
{
|
||||
Extinguish();
|
||||
Fuse();
|
||||
SetController(caused_by);
|
||||
}
|
||||
|
||||
protected func RejectEntrance()
|
||||
{
|
||||
|
|
|
@ -98,15 +98,18 @@ func Reposition(int x, int y)
|
|||
var found = false;
|
||||
if (structure->~ConstructionCombineWith())
|
||||
{
|
||||
var stick_dir = structure->~ConstructionCombineDirection();
|
||||
var find_rect = Find_InRect(AbsX(clonk->GetX() + x - dimension_x/2 - 10), AbsY(clonk->GetY() + y - dimension_y/2 - 10), dimension_x + 20, dimension_y + 20);
|
||||
if ((stick_dir & CONSTRUCTION_STICK_Bottom))
|
||||
find_rect = Find_AtPoint(AbsX(clonk->GetX() + x), AbsY(clonk->GetY() + y));
|
||||
var other = FindObject(Find_Func(structure->ConstructionCombineWith(), this),
|
||||
Find_InRect(AbsX(clonk->GetX() + x - dimension_x/2 - 10), AbsY(clonk->GetY() + y - dimension_y/2 - 10), dimension_x + 20, dimension_y + 20),
|
||||
find_rect,
|
||||
Find_OCF(OCF_Fullcon),
|
||||
Find_Layer(clonk->GetObjectLayer()),
|
||||
Find_Allied(clonk->GetOwner()),
|
||||
Find_NoContainer());
|
||||
if (other)
|
||||
{
|
||||
var stick_dir = structure->~ConstructionCombineDirection();
|
||||
x = other->GetX();
|
||||
y = other->GetY();
|
||||
// Combine to different directions.
|
||||
|
|
|
@ -51,9 +51,17 @@ public func Set(id def, int dir, object stick)
|
|||
// Draw the building with a wired frame and large alpha unless site graphics is overloaded by definition
|
||||
if (!def->~SetConstructionSiteOverlay(this, direction, stick_to))
|
||||
{
|
||||
SetGraphics(nil, nil, 0);
|
||||
SetGraphics(nil, def, 1, GFXOV_MODE_Base);
|
||||
SetClrModulation(RGBa(255,255,255,50), 1);
|
||||
SetGraphics(nil, def, 2, GFXOV_MODE_Base, nil, GFX_BLIT_Wireframe);
|
||||
SetClrModulation(RGBa(255, 255, 255, 128), 1);
|
||||
// If the structure is a mesh, use wire frame mode to show the site.
|
||||
// TODO: use def->IsMesh() once this becomes available.
|
||||
if (def->GetMeshMaterial())
|
||||
{
|
||||
SetClrModulation(RGBa(255, 255, 255, 50), 1);
|
||||
SetGraphics(nil, def, 2, GFXOV_MODE_Base, nil, GFX_BLIT_Wireframe);
|
||||
}
|
||||
SetGraphics("", GetID(), 3, GFXOV_MODE_ExtraGraphics);
|
||||
}
|
||||
SetObjDrawTransform(xw,0,0,0,1000, -h*500,1);
|
||||
SetObjDrawTransform(xw,0,0,0,1000, -h*500,2);
|
||||
|
|
|
@ -110,8 +110,8 @@ public func Seed()
|
|||
// the chance of seeding is improved, if there are much the chance is reduced.
|
||||
var chance = SeedChance();
|
||||
var chance = chance / Max(1, amount - plant_cnt) + chance * Max(0, plant_cnt - amount);
|
||||
// Place a plant if we are lucky, in principle there can be more than seed amount.
|
||||
if (!Random(chance))
|
||||
// Place a plant if we are lucky, but no more than seed amount.
|
||||
if (plant_cnt < amount && !Random(chance))
|
||||
{
|
||||
// Place the plant but check if it is not close to another one.
|
||||
var plant = PlaceVegetation(GetID(), area.x, area.y, area.w, area.h, 3);
|
||||
|
|
|
@ -411,7 +411,7 @@ public func CheckFuel(id product, bool remove)
|
|||
var fuel_amount = 0;
|
||||
// Find fuel in this producer.
|
||||
for (var fuel in FindObjects(Find_Container(this), Find_Func("IsFuel")))
|
||||
fuel_amount += fuel->~GetFuelAmount();
|
||||
fuel_amount += fuel->~GetFuelAmount(false);
|
||||
if (fuel_amount < FuelNeed(product))
|
||||
return false;
|
||||
else if (remove)
|
||||
|
@ -420,7 +420,7 @@ public func CheckFuel(id product, bool remove)
|
|||
fuel_amount = 0;
|
||||
for (var fuel in FindObjects(Find_Container(this), Find_Func("IsFuel")))
|
||||
{
|
||||
fuel_amount += fuel->~GetFuelAmount();
|
||||
fuel_amount += fuel->~GetFuelAmount(false);
|
||||
fuel->RemoveObject();
|
||||
if (fuel_amount >= FuelNeed(product))
|
||||
break;
|
||||
|
|
|
@ -3,12 +3,23 @@
|
|||
Basic library for structures, handles:
|
||||
* Damage
|
||||
* Energy bar if rule active
|
||||
* Basements
|
||||
|
||||
@author Maikel
|
||||
*/
|
||||
|
||||
func Initialize()
|
||||
// All structure related local variables are stored in a single proplist.
|
||||
// This reduces the chances of clashing local variables. See Initialize
|
||||
// for which variables are being used.
|
||||
local lib_structure;
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
// Initialize the single proplist for the structure library.
|
||||
if (lib_structure == nil)
|
||||
lib_structure = {};
|
||||
lib_structure.basement = nil;
|
||||
// Add energy bars if the rule is active.
|
||||
if (FindObject(Find_ID(Rule_StructureHPBars)))
|
||||
if (this.HitPoints != nil)
|
||||
AddEnergyBar();
|
||||
|
@ -28,4 +39,17 @@ public func Damage(int change, int cause, int cause_plr)
|
|||
}
|
||||
|
||||
// This object is a structure.
|
||||
public func IsStructure() { return true; }
|
||||
public func IsStructure() { return true; }
|
||||
|
||||
|
||||
/*-- Basement Handling --*/
|
||||
|
||||
public func SetBasement(object to_basement)
|
||||
{
|
||||
lib_structure.basement = to_basement;
|
||||
return;
|
||||
}
|
||||
|
||||
public func GetBasement() { return lib_structure.basement; }
|
||||
|
||||
public func IsStructureWithoutBasement() { return IsStructure() && !lib_structure.basement; }
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include Library_Structure
|
||||
|
||||
local parent;
|
||||
local width;
|
||||
|
||||
protected func Construction()
|
||||
{
|
||||
|
@ -37,37 +38,51 @@ protected func Destruction()
|
|||
// Set the width of the basement.
|
||||
public func SetWidth(int wdt)
|
||||
{
|
||||
width = wdt;
|
||||
SetShape(-wdt / 2, -4, wdt, 8);
|
||||
SetSolidMask(0, 0, wdt, 8, 20 - wdt / 2, 0);
|
||||
SetObjDrawTransform(1000 * wdt / 40, 0, 0, 0, 1000, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
public func GetWidth() { return width; }
|
||||
|
||||
// Set the parent if the basement is attached to a structure.
|
||||
public func CombineWith(object stick_to)
|
||||
{
|
||||
parent = stick_to;
|
||||
SetParent(stick_to);
|
||||
return;
|
||||
}
|
||||
|
||||
public func SetParent(object to_parent)
|
||||
{
|
||||
parent = to_parent;
|
||||
SetWidth(BoundBy(parent->GetObjWidth(), 8, 120));
|
||||
// Notify the parent.
|
||||
parent->~SetBasement(this);
|
||||
return;
|
||||
}
|
||||
|
||||
public func GetParent() { return parent; }
|
||||
|
||||
// Move objects out of the basement.
|
||||
private func MoveOutOfBasement()
|
||||
{
|
||||
// Find all objects inside the basement which are stuck.
|
||||
var wdt = GetObjWidth();
|
||||
var hgt = GetObjHeight();
|
||||
var lying_around = FindObjects(Find_Or(Find_Category(C4D_Vehicle), Find_Category(C4D_Object), Find_Category(C4D_Living)), Find_InRect(-wdt / 2, -hgt / 2 - 2, wdt, hgt + 4));
|
||||
var lying_around = FindObjects(Find_Or(Find_Category(C4D_Vehicle), Find_Category(C4D_Object), Find_Category(C4D_Living)), Find_InRect(-wdt / 2 - 1, -hgt / 2 - 2, wdt + 2, hgt + 4));
|
||||
// Move up these objects.
|
||||
for (var obj in lying_around)
|
||||
{
|
||||
var x = obj->GetX();
|
||||
var y = obj->GetY();
|
||||
var dif = 0;
|
||||
//
|
||||
// Move up object until it is not stuck any more.
|
||||
while (obj->Stuck() || obj->GetContact(-1, CNAT_Bottom))
|
||||
{
|
||||
// Only up to 20 pixels.
|
||||
if (dif > 20)
|
||||
// Only up to 32 pixels.
|
||||
if (dif > 32)
|
||||
{
|
||||
obj->SetPosition(x, y);
|
||||
break;
|
||||
|
@ -76,13 +91,14 @@ private func MoveOutOfBasement()
|
|||
obj->SetPosition(x, y - dif);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Is a construction that is built just below the surface.
|
||||
public func IsBelowSurfaceConstruction() { return true; }
|
||||
|
||||
// Sticking to other structures, at the bottom of that structure.
|
||||
public func ConstructionCombineWith() { return "IsStructure"; }
|
||||
public func ConstructionCombineWith() { return "IsStructureWithoutBasement"; }
|
||||
public func ConstructionCombineDirection() { return CONSTRUCTION_STICK_Bottom; }
|
||||
|
||||
public func NoConstructionFlip() { return true; }
|
||||
|
@ -91,6 +107,20 @@ public func NoConstructionFlip() { return true; }
|
|||
public func IsStructure() { return false; }
|
||||
|
||||
|
||||
/*-- Saving --*/
|
||||
|
||||
public func SaveScenarioObject(proplist props)
|
||||
{
|
||||
if (!inherited(props, ...))
|
||||
return false;
|
||||
if (parent)
|
||||
props->AddCall("BasementParent", this, "SetParent", parent);
|
||||
else if (width)
|
||||
props->AddCall("BasementWidth", this, "SetWidth", width);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*-- Proplist --*/
|
||||
|
||||
local Name = "$Name$";
|
||||
|
|
|
@ -28,6 +28,12 @@ private func MaxContentsCount()
|
|||
return 50;
|
||||
}
|
||||
|
||||
public func GetInteractionMetaInfo(object clonk, int num)
|
||||
{
|
||||
if (!is_open)
|
||||
return { Description = "$MsgOpen$" };
|
||||
return { Description = "$MsgClose$" };
|
||||
}
|
||||
|
||||
// Open contentsmenu via interaction
|
||||
public func Interact(object clonk, int mode)
|
||||
|
@ -80,5 +86,6 @@ protected func Definition(def)
|
|||
}
|
||||
|
||||
local Name = "$Name$";
|
||||
local Description = "$Description$";
|
||||
local ContainBlast = true;
|
||||
local HitPoints = 50;
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
Name=Truhe
|
||||
Name=Truhe
|
||||
Description=Speicherplatz für allerhand Objekte.
|
||||
MsgOpen=Truhe öffnen
|
||||
MsgClose=Truhe schließen
|
|
@ -1 +1,4 @@
|
|||
Name=Chest
|
||||
Name=Chest
|
||||
Description=Storage location for all kinds of items.
|
||||
MsgOpen=Open chest
|
||||
MsgClose=Close chest
|
|
@ -22,6 +22,8 @@ private func GetCaseSpeed() { return 20; }
|
|||
private func GetAutoSpeed() { return GetCaseSpeed() * 2; }
|
||||
private func GetDrillSpeed() { return GetCaseSpeed() / 2; }
|
||||
|
||||
// Case is not a structure, but uses the library.
|
||||
public func IsStructure() { return false; }
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include Library_Ownable
|
||||
|
||||
local Name = "$Name$";
|
||||
local Description = "$Description$";
|
||||
local Touchable = 1;
|
||||
|
||||
public func NoConstructionFlip() { return true; }
|
|
@ -1 +1,2 @@
|
|||
Name=Goldene Statue
|
||||
Name=Goldene Statue
|
||||
Description=Ein wertvolles Kunststück
|
|
@ -1 +1,2 @@
|
|||
Name=Golden statue
|
||||
Name=Golden statue
|
||||
Description=A valuable piece of art.
|
|
@ -167,7 +167,8 @@ protected func Pumping()
|
|||
if (!stored_material_amount)
|
||||
{
|
||||
// get new materials
|
||||
var mat = GetSourceObject()->ExtractLiquidAmount(0, 0, GetPumpSpeed() / 10);
|
||||
var source_obj = GetSourceObject();
|
||||
var mat = source_obj->ExtractLiquidAmount(source_obj.ApertureOffsetX, source_obj.ApertureOffsetY, GetPumpSpeed() / 10, true);
|
||||
|
||||
// no material to pump?
|
||||
if (mat)
|
||||
|
@ -185,7 +186,8 @@ protected func Pumping()
|
|||
var i = stored_material_amount;
|
||||
while (i > 0)
|
||||
{
|
||||
if (GetDrainObject()->InsertMaterial(stored_material_index))
|
||||
var drain_obj = GetDrainObject();
|
||||
if (GetDrainObject()->InsertMaterial(stored_material_index, drain_obj.ApertureOffsetX, drain_obj.ApertureOffsetY))
|
||||
{
|
||||
i--;
|
||||
}
|
||||
|
@ -250,17 +252,20 @@ private func GetPumpHeight()
|
|||
// compare each the surfaces of the bodies of liquid pumped
|
||||
|
||||
// find Y position of surface of liquid that is pumped to target
|
||||
var source_y = 0;
|
||||
if (GetSourceObject()->GBackLiquid())
|
||||
var source_obj = GetSourceObject();
|
||||
var source_x = source_obj.ApertureOffsetX;
|
||||
var source_y = source_obj.ApertureOffsetY;
|
||||
if (source_obj->GBackLiquid(source_x, source_y))
|
||||
{
|
||||
var src_mat = GetSourceObject()->GetMaterial();
|
||||
while (src_mat == GetSourceObject()->GetMaterial(0, source_y - 1))
|
||||
var src_mat = source_obj->GetMaterial(source_x, source_y);
|
||||
while (src_mat == source_obj->GetMaterial(source_x, source_y - 1))
|
||||
--source_y;
|
||||
}
|
||||
// same for target (use same function as if inserting)
|
||||
var target_pos = {X = 0, Y = 0};
|
||||
GetDrainObject()->CanInsertMaterial(Material("Water"), 0, 0, target_pos);
|
||||
return GetSourceObject()->GetY() + source_y - target_pos.Y;
|
||||
var drain_obj = GetDrainObject();
|
||||
drain_obj->CanInsertMaterial(Material("Water"), drain_obj.ApertureOffsetX, drain_obj.ApertureOffsetY, target_pos);
|
||||
return source_obj->GetY() + source_y - target_pos.Y;
|
||||
}
|
||||
|
||||
/** Recheck power usage/production for current pump height
|
||||
|
@ -328,27 +333,26 @@ private func PumpHeight2Power(int pump_height)
|
|||
var max_power = 60;
|
||||
// Calculate the used power in steps of ten, every 60 pixels represents ten units.
|
||||
var used_power = pump_height / 60 * 10;
|
||||
// If the power is positive then add the minimum energy.
|
||||
if (used_power > 0)
|
||||
// If the pump height is positive then add the minimum energy.
|
||||
if (pump_height >= 0)
|
||||
used_power = Min(used_power + 10, max_power);
|
||||
// Pumping power downwards never costs energy, but only brings something if offset is overcome.
|
||||
else
|
||||
used_power = Min(used_power + power_offset - 10, 0);
|
||||
used_power = BoundBy(used_power + power_offset - 10, -max_power, 0);
|
||||
return used_power;
|
||||
}
|
||||
|
||||
/** Returns whether there is liquid at the source pipe to pump */
|
||||
// Returns whether there is liquid at the source pipe to pump.
|
||||
private func HasLiquidToPump()
|
||||
{
|
||||
if (!source_pipe)
|
||||
return false;
|
||||
|
||||
// source
|
||||
if(!GetSourceObject()->GBackLiquid())
|
||||
var source_obj = GetSourceObject();
|
||||
if(!source_obj->GBackLiquid(source_obj.ApertureOffsetX, source_obj.ApertureOffsetY))
|
||||
return false;
|
||||
|
||||
// target (test with the very popular liquid "water")
|
||||
if(!GetDrainObject()->CanInsertMaterial(Material("Water"),0,0))
|
||||
var drain_obj = GetDrainObject();
|
||||
if(!drain_obj->CanInsertMaterial(Material("Water"),drain_obj.ApertureOffsetX, drain_obj.ApertureOffsetY))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|