forked from Mirrors/openclonk
Merge the functions pointer branch
commit
dfea0914a9
|
@ -41,7 +41,7 @@ separate_arguments(OC_EXE_LINKER_FLAGS_DEBUG)
|
|||
############################################################################
|
||||
# User selectable options
|
||||
############################################################################
|
||||
option(PROJECT_FOLDERS "Put source files into subfolders in project file" ON)
|
||||
option(PROJECT_FOLDERS "Put source files into subfolders in project file" ON)
|
||||
option(USE_GL "Enable OpenGL support" ON)
|
||||
SET(INITIAL_USE_SDL_MAINLOOP_VALUE OFF)
|
||||
SET(INITIAL_USE_OPEN_AL OFF)
|
||||
|
@ -56,7 +56,7 @@ if(WIN32 AND FALSE) # disable DX option while it doesn't work anyway
|
|||
list(APPEND CMAKE_LIBRARY_PATH $ENV{DXSDK_DIR}/Lib/x86)
|
||||
endif()
|
||||
else()
|
||||
|
||||
|
||||
endif()
|
||||
else()
|
||||
SET(USE_DIRECTX OFF)
|
||||
|
@ -324,6 +324,8 @@ set(OC_CLONK_SOURCES
|
|||
src/gui/C4GameOptions.h
|
||||
src/gui/C4GameOverDlg.cpp
|
||||
src/gui/C4GameOverDlg.h
|
||||
src/gui/C4GfxErrorDlg.cpp
|
||||
src/gui/C4GfxErrorDlg.h
|
||||
src/gui/C4GuiButton.cpp
|
||||
src/gui/C4GuiCheckBox.cpp
|
||||
src/gui/C4GuiComboBox.cpp
|
||||
|
@ -874,14 +876,14 @@ if(APPLE)
|
|||
src/res/Ift_Trans.png
|
||||
src/res/NoIft_Trans.png
|
||||
)
|
||||
|
||||
|
||||
# Add icon resources
|
||||
set_source_files_properties(
|
||||
${OC_BUNDLE_RESOURCES}
|
||||
PROPERTIES MACOSX_PACKAGE_LOCATION Resources
|
||||
)
|
||||
list(APPEND OC_SYSTEM_SOURCES ${OC_BUNDLE_RESOURCES})
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
############################################################################
|
||||
|
@ -925,6 +927,7 @@ add_executable(netpuncher EXCLUDE_FROM_ALL
|
|||
)
|
||||
|
||||
add_executable(c4script
|
||||
include/c4script/c4script.h
|
||||
src/c4group/C4Group.cpp
|
||||
src/c4group/C4Group.h
|
||||
src/c4group/CStdFile.cpp
|
||||
|
@ -955,6 +958,7 @@ add_executable(c4script
|
|||
src/script/C4StringTable.cpp
|
||||
src/script/C4PropList.cpp
|
||||
src/script/C4ScriptHost.cpp
|
||||
src/script/C4ScriptStandalone.cpp
|
||||
src/script/C4ValueArray.cpp
|
||||
src/script/C4Value.cpp
|
||||
src/script/C4ValueMap.cpp
|
||||
|
@ -988,7 +992,7 @@ if(HAVE_PTHREAD)
|
|||
pthread
|
||||
)
|
||||
target_link_libraries(c4script
|
||||
pthread
|
||||
pthread
|
||||
)
|
||||
endif()
|
||||
if(USE_CONSOLE)
|
||||
|
@ -1018,7 +1022,7 @@ if (APPLE)
|
|||
SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++ objective-c++")
|
||||
endif()
|
||||
|
||||
# This expands some variables in Info.plist as a side-effect. XCode might then
|
||||
# This expands some variables in Info.plist as a side-effect. XCode might then
|
||||
# expand a second time, using the same syntax. Try not to get confused by this!
|
||||
set_target_properties(clonk PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/src/res/Info.plist")
|
||||
|
||||
|
@ -1274,11 +1278,11 @@ ENDIF()
|
|||
# TODO: Check for convert at configure step?
|
||||
install(DIRECTORY DESTINATION share/icons/hicolor/48x48/apps)
|
||||
install(CODE "
|
||||
EXECUTE_PROCESS(COMMAND \"convert\" \"${CMAKE_CURRENT_SOURCE_DIR}/src/res/oc.ico[2]\" \"${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps/clonk.png\" RESULT_VARIABLE CONVERT_RESULT)
|
||||
EXECUTE_PROCESS(COMMAND \"convert\" \"${CMAKE_CURRENT_SOURCE_DIR}/src/res/oc.ico[2]\" \"$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps/clonk.png\" RESULT_VARIABLE CONVERT_RESULT)
|
||||
IF(NOT \${CONVERT_RESULT} EQUAL 0)
|
||||
MESSAGE(SEND_ERROR \"Creating icon failed\")
|
||||
ENDIF()
|
||||
FILE(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/openclonk)
|
||||
FILE(MAKE_DIRECTORY $ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/share/openclonk)
|
||||
")
|
||||
|
||||
set(OC_C4GROUPS
|
||||
|
@ -1305,7 +1309,7 @@ foreach(group ${OC_C4GROUPS})
|
|||
else()
|
||||
INSTALL(CODE "
|
||||
MESSAGE(\"Packing and installing ${group}...\")
|
||||
EXECUTE_PROCESS(COMMAND \"${CMAKE_CURRENT_BINARY_DIR}/c4group\" \"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}\" -t \"${CMAKE_INSTALL_PREFIX}/share/openclonk/${group}\" RESULT_VARIABLE PACK_RESULT)
|
||||
EXECUTE_PROCESS(COMMAND \"${CMAKE_CURRENT_BINARY_DIR}/c4group\" \"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}\" -t \"$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/share/openclonk/${group}\" RESULT_VARIABLE PACK_RESULT)
|
||||
IF(NOT \${PACK_RESULT} EQUAL 0)
|
||||
MESSAGE(SEND_ERROR \"Packing ${group} failed\")
|
||||
ENDIF()
|
||||
|
|
|
@ -149,6 +149,7 @@ src/platform/StdRegistry.h \
|
|||
src/platform/StdScheduler.cpp \
|
||||
src/platform/StdScheduler.h \
|
||||
src/zlib/gzio.c \
|
||||
src/zlib/gzio.h \
|
||||
src/zlib/zutil.h
|
||||
|
||||
clonk_SOURCES = \
|
||||
|
@ -318,6 +319,8 @@ src/gui/C4GameOptions.cpp \
|
|||
src/gui/C4GameOptions.h \
|
||||
src/gui/C4GameOverDlg.cpp \
|
||||
src/gui/C4GameOverDlg.h \
|
||||
src/gui/C4GfxErrorDlg.cpp \
|
||||
src/gui/C4GfxErrorDlg.h \
|
||||
src/gui/C4GuiButton.cpp \
|
||||
src/gui/C4GuiCheckBox.cpp \
|
||||
src/gui/C4GuiComboBox.cpp \
|
||||
|
@ -534,6 +537,7 @@ src/script/C4Value.cpp \
|
|||
src/script/C4Value.h \
|
||||
src/script/C4ValueMap.cpp \
|
||||
src/script/C4ValueMap.h \
|
||||
thirdparty/timsort/sort.h \
|
||||
thirdparty/tinyxml/tinystr.cpp \
|
||||
thirdparty/tinyxml/tinystr.h \
|
||||
thirdparty/tinyxml/tinyxml.cpp \
|
||||
|
@ -687,6 +691,7 @@ endif
|
|||
|
||||
## c4script shell
|
||||
c4script_SOURCES = \
|
||||
include/c4script/c4script.h \
|
||||
src/lib/C4SimpleLog.cpp \
|
||||
src/lib/C4Real.cpp \
|
||||
src/lib/C4Random.cpp \
|
||||
|
@ -698,6 +703,7 @@ src/script/C4AulParse.cpp \
|
|||
src/script/C4StringTable.cpp \
|
||||
src/script/C4PropList.cpp \
|
||||
src/script/C4ScriptHost.cpp \
|
||||
src/script/C4ScriptStandalone.cpp \
|
||||
src/script/C4ValueArray.cpp \
|
||||
src/script/C4Value.cpp \
|
||||
src/script/C4ValueMap.cpp \
|
||||
|
|
|
@ -15375,7 +15375,7 @@ msgstr "int/array"
|
|||
|
||||
#: sdk/definition/properties.xml:56(col)
|
||||
msgid "Controls the visibility of the object. See the <emlink href=\"definition/visibility.html\">detailed documentation of possible values</emlink>."
|
||||
msgstr "Steuert die Sichtbarkeit des Objekts. <emlink href=\"./visibility.xml\">Detailierte Dokumentation möglicher Werte</emlink>"
|
||||
msgstr "Steuert die Sichtbarkeit des Objekts. <emlink href=\"definition/visibility.html\">Detailierte Dokumentation möglicher Werte</emlink>"
|
||||
|
||||
#: sdk/definition/properties.xml:110(col)
|
||||
#: sdk/definition/properties.xml:115(col)
|
||||
|
|
|
@ -35,14 +35,9 @@
|
|||
<name>map_name</name>
|
||||
<desc>Name of the map to be used from Landscape.txt.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>ignore_sky</name>
|
||||
<desc>If true, the old material is retained whenever Sky would be drawn.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Draws a dynamic map within the specified rectangle using a given map specification from Landscape.txt.</desc>
|
||||
<desc>Draws a dynamic map within the specified rectangle over the old landscape using a given map specification from Landscape.txt.</desc>
|
||||
<remark>The Landscape.txt component is usually removed from memory after scenario initialization. To keep it in memory for later use by this command you should specify the option KeepMapCreator=1 in Scenario.txt section [Landscape].</remark>
|
||||
<examples>
|
||||
<example>
|
||||
|
|
|
@ -35,19 +35,14 @@
|
|||
<name>map</name>
|
||||
<desc>Definition of the dynamic map. The enclosing map { ... } tag must be present.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>ignore_sky</name>
|
||||
<desc>If true, the old material is retained whenever Sky would be drawn.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Draws a dynamic map within the specified rectangle. This is done using the same evaluation as with Landscape.txt components.</desc>
|
||||
<desc>Draws a dynamic map within the specified rectangle over the old landscape. This is done using the same evaluation as with Landscape.txt components.</desc>
|
||||
<remark>As maximum string length in C4Script is limited by internal buffers you should use <funclink>DrawDefMap</funclink> for very complex maps.</remark>
|
||||
<examples>
|
||||
<example>
|
||||
<code>DrawMap(0,0,<funclink>LandscapeWidth</funclink>(), <funclink>LandscapeHeight</funclink>()/2, "map Empty{}");</code>
|
||||
<text>Empties the top half of the map.</text>
|
||||
<code>DrawMap(0,0,<funclink>LandscapeWidth</funclink>(), <funclink>LandscapeHeight</funclink>()/2, "map Earth{overlay{mat = Earth;};};");</code>
|
||||
<text>Fills the top half of the map with earth.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related><funclink>DrawDefMap</funclink></related>
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* OpenClonk, http://www.openclonk.org
|
||||
*
|
||||
* Copyright (c) 2012 Günther Brammer
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef C4SCRIPTSTANDALONE_H
|
||||
#define C4SCRIPTSTANDALONE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int c4s_runscript(const char * filename);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // C4SCRIPTSTANDALONE_H
|
|
@ -11,5 +11,5 @@ protected func RejectCollect(id objid, object obj)
|
|||
|
||||
public func MaxContentsCount()
|
||||
{
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Value=25
|
||||
Mass=2
|
||||
Rotate=1
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Value=25
|
||||
Mass=2
|
||||
Rotate=1
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Value=25
|
||||
Mass=2
|
||||
Rotate=1
|
||||
|
|
|
@ -27,7 +27,6 @@ func DoStrike(clonk, angle)
|
|||
var damage=5*1000;
|
||||
if (king_size)
|
||||
damage+=3000;
|
||||
var f=ApplyShieldFactor(clonk, obj, damage);
|
||||
ApplyWeaponBash(obj, 400, angle);
|
||||
obj->DoEnergy(-damage, true, FX_Call_EngGetPunched, clonk->GetOwner());
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Value=25
|
||||
Mass=2
|
||||
Rotate=1
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Value=25
|
||||
Mass=2
|
||||
Rotate=1
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Value=25
|
||||
Mass=2
|
||||
Rotate=1
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Value=25
|
||||
Mass=2
|
||||
Rotate=1
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Value=25
|
||||
Mass=2
|
||||
Rotate=1
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Value=25
|
||||
Mass=2
|
||||
Rotate=1
|
||||
|
|
|
@ -62,6 +62,8 @@ map Goldmine {
|
|||
};
|
||||
RandomMat & overlay { mat=Earth; tex=earth_rough; };
|
||||
RandomMat & overlay { mat=Earth; tex=earth_dry; };
|
||||
RandomSpots & overlay { mat=Earth; tex=earth_topsoil; };
|
||||
RandomSpots & overlay { mat=Earth; tex=earth_midsoil; };
|
||||
RandomSpots & overlay { mat=Coal; tex=coal; };
|
||||
RandomSpots & overlay { mat=Sulphur; tex=sulphur; };
|
||||
RandomSpots & overlay { mat=Ore; tex=Ore; };
|
||||
|
@ -71,6 +73,7 @@ map Goldmine {
|
|||
x=0; y=58; wdt=100; hgt=12;
|
||||
turbulence=10; lambda=3;
|
||||
loosebounds=1; mask=1;
|
||||
RandomMat & overlay { mat=Earth; tex=earth_topsoil; };
|
||||
RandomMat & overlay { mat=Coal; tex=coal; };
|
||||
RandomMat & overlay { mat=Sulphur; tex=sulphur; };
|
||||
};
|
||||
|
@ -79,11 +82,13 @@ map Goldmine {
|
|||
x=0; y=72; wdt=100; hgt=12;
|
||||
turbulence=10; lambda=3;
|
||||
loosebounds=1; mask=1;
|
||||
RandomMat & overlay { mat=Earth; tex=earth_midsoil; };
|
||||
RandomMat & overlay { mat=Rock; tex=rock; };
|
||||
RandomMat & overlay { mat=Ore; tex=ore; };
|
||||
RandomSpots & overlay { mat=Rock; tex=rock_cracked; };
|
||||
RandomSpots & overlay { mat=Rock; tex=rock_cracked; };
|
||||
RandomSpots & overlay { mat=Rock; tex=rock_cracked; };
|
||||
RandomSpots & overlay { mat=Rock; tex=rock_cracked; };
|
||||
};
|
||||
// Bottom layer with gold.
|
||||
overlay {
|
||||
|
@ -96,6 +101,7 @@ map Goldmine {
|
|||
RandomSpots & overlay { mat=Gold; tex=gold; };
|
||||
RandomSpots & overlay { mat=Gold; tex=gold; };
|
||||
RandomMat & overlay { mat=Gold; tex=gold; };
|
||||
RandomMat & overlay { mat=Gold; tex=gold; };
|
||||
};
|
||||
// Border of earth and sand.
|
||||
overlay {
|
||||
|
|
|
@ -14,30 +14,30 @@ Rules=Rule_EnergyNeed=1;Rule_TeamAccount=1;
|
|||
[Player1]
|
||||
Wealth=10
|
||||
Crew=Clonk=2
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;CableReel=1;Dynamite=1;DynamiteBox=1;
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;
|
||||
HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;
|
||||
|
||||
[Player2]
|
||||
Wealth=10
|
||||
Crew=Clonk=2
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;CableReel=1;Dynamite=1;DynamiteBox=1;
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;
|
||||
HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;
|
||||
|
||||
[Player3]
|
||||
Wealth=10
|
||||
Crew=Clonk=2
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;CableReel=1;Dynamite=1;DynamiteBox=1;
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;
|
||||
HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;
|
||||
|
||||
[Player4]
|
||||
Wealth=10
|
||||
Crew=Clonk=2
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;CableReel=1;Dynamite=1;DynamiteBox=1;
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;
|
||||
HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;
|
||||
|
||||
[Landscape]
|
||||
InEarth=Rock=1;Firestone=3;Loam=2
|
||||
InEarthLevel=30,0,0,100
|
||||
InEarthLevel=40
|
||||
Sky=Clouds2
|
||||
MapWidth=100
|
||||
MapHeight=75
|
||||
|
@ -45,5 +45,5 @@ MapHeight=75
|
|||
[Weather]
|
||||
Climate=0
|
||||
YearSpeed=0
|
||||
Wind=1,100,-100,100
|
||||
Wind=0,100,-100,100
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ protected func Initialize()
|
|||
goal->SetWealthGoal(400);
|
||||
|
||||
// Place some trees.
|
||||
for (var i = 0; i < 12 + Random(4); i++)
|
||||
for (var i = 0; i < 16 + Random(4); i++)
|
||||
PlaceVegetation(Tree_Coniferous, 0, LandscapeHeight() / 3, LandscapeWidth(), LandscapeHeight(), 1000 * (61 + Random(40)));
|
||||
|
||||
// place some sprout berries
|
||||
|
@ -29,34 +29,6 @@ protected func Initialize()
|
|||
var time = CreateObject(Environment_Time);
|
||||
time->SetTime(600);
|
||||
time->SetCycleSpeed(12);
|
||||
|
||||
// Create a small settlement to test stuff.
|
||||
/*
|
||||
var foundry = CreateConstruction(Foundry, 300, FindHeight(300), NO_OWNER, 100, true);
|
||||
CreateObject(Barrel, 300, FindHeight(300), NO_OWNER)->PutLiquid("Water", 300);
|
||||
foundry->CreateContents(Coal,3);
|
||||
foundry->CreateContents(Ore,3);
|
||||
var flag = CreateConstruction(Flagpole, 360, FindHeight(360), NO_OWNER, 100, true);
|
||||
var workshop = CreateConstruction(ToolsWorkshop, 420, FindHeight(420), NO_OWNER, 100, true);
|
||||
workshop->CreateContents(Wood, 10);
|
||||
workshop->CreateContents(Metal, 10);
|
||||
workshop->CreateContents(Coal, 10);
|
||||
workshop->CreateContents(Sulphur, 10);
|
||||
var wind = CreateConstruction(WindGenerator, 480, FindHeight(480), NO_OWNER, 100, true);
|
||||
var line = CreateObject(PowerLine);
|
||||
line->SetActionTargets(wind, workshop);
|
||||
var sawmill = CreateConstruction(Sawmill, 520, FindHeight(520), NO_OWNER, 100, true);
|
||||
var line = CreateObject(PowerLine);
|
||||
line->SetActionTargets(wind, sawmill);
|
||||
CreateConstruction(Elevator, 220, FindHeight(220), NO_OWNER, 100, true)->CreateShaft(100);
|
||||
|
||||
// Create a lorry with necessary equipment to start a settlement.
|
||||
var lorry = CreateObject(Lorry, 300, FindHeight(300));
|
||||
lorry->CreateContents(Wood, 6);
|
||||
lorry->CreateContents(Metal, 4);
|
||||
lorry->CreateContents(Dynamite, 3);
|
||||
lorry->CreateContents(Loam, 3);
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -70,13 +42,6 @@ private func FindHeight(int x)
|
|||
|
||||
protected func InitializePlayer(int plr)
|
||||
{
|
||||
// first player gets the base to test.
|
||||
/*
|
||||
var flagpole = FindObject(Find_ID(Flagpole));
|
||||
if (flagpole && !GetPlayerName(flagpole->GetOwner()))
|
||||
flagpole->SetOwner(plr);
|
||||
*/
|
||||
|
||||
// Increase wealth goal per player.
|
||||
var goal = FindObject(Find_ID(Goal_Wealth));
|
||||
if (goal)
|
||||
|
@ -91,15 +56,9 @@ protected func InitializePlayer(int plr)
|
|||
crew->CreateContents(Shovel);
|
||||
// First clonk can construct, others can mine.
|
||||
if (index == 0)
|
||||
{
|
||||
crew->CreateContents(Hammer);
|
||||
crew->CreateContents(CableReel);
|
||||
}
|
||||
else
|
||||
{
|
||||
crew->CreateContents(Axe);
|
||||
crew->CreateContents(CableReel);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -14,25 +14,25 @@ Rules=Rule_EnergyNeed=1;Rule_TeamAccount=1;
|
|||
[Player1]
|
||||
Wealth=40
|
||||
Crew=Clonk=2
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;CableReel=1;Dynamite=1;DynamiteBox=1;
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;
|
||||
HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;
|
||||
|
||||
[Player2]
|
||||
Wealth=40
|
||||
Crew=Clonk=2
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;CableReel=1;Dynamite=1;DynamiteBox=1;
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;
|
||||
HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;
|
||||
|
||||
[Player3]
|
||||
Wealth=40
|
||||
Crew=Clonk=2
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;CableReel=1;Dynamite=1;DynamiteBox=1;
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;
|
||||
HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;
|
||||
|
||||
[Player4]
|
||||
Wealth=40
|
||||
Crew=Clonk=2
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;CableReel=1;Dynamite=1;DynamiteBox=1;
|
||||
Knowledge=Idol=1;Foundry=1;SteamEngine=1;ToolsWorkshop=1;WindGenerator=1;Flagpole=1;Sawmill=1;Elevator=1;Lorry=1;Pickaxe=1;Axe=1;Hammer=1;Shovel=1;Firestone=1;Barrel=1;Dynamite=1;DynamiteBox=1;
|
||||
HomeBaseMaterial=Shovel=2;Pickaxe=2;Axe=2;Hammer=2;Dynamite=10;Loam=10;Wood=20;Metal=10;Clonk=2;Lorry=1;
|
||||
|
||||
[Landscape]
|
||||
|
@ -47,4 +47,5 @@ BottomOpen=1
|
|||
Climate=100
|
||||
YearSpeed=0
|
||||
Wind=1,100,-100,100
|
||||
Rain=40
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ protected func Initialize()
|
|||
//lorry->CreateContents(Wood, 16);
|
||||
//lorry->CreateContents(Metal, 4);
|
||||
//lorry->CreateContents(Dynamite, 3);
|
||||
//lorry->CreateContents(CableReel, 3);
|
||||
// TODO: Make sure lorry stays on mountains.
|
||||
|
||||
// Place some coniferous trees, but only up to 2/3 of the mountain.
|
||||
|
@ -58,7 +57,7 @@ protected func Initialize()
|
|||
SetGamma(RGB(0,0,blue), RGB(128-blue,128-blue,128+blue), RGB(255-blue,255-blue,255));
|
||||
|
||||
// Some natural disasters.
|
||||
var earthquakes = CreateObject(Earthquake);
|
||||
//var earthquakes = CreateObject(Earthquake);
|
||||
// earthquakes->SetChance(30);
|
||||
// TODO: Rockfall.
|
||||
|
||||
|
@ -163,8 +162,7 @@ protected func InitializePlayer(int plr)
|
|||
{
|
||||
crew->CreateContents(Hammer);
|
||||
crew->CreateContents(Axe);
|
||||
crew->CreateContents(CableReel);
|
||||
crew->CreateContents(Dynamite);
|
||||
crew->CreateContents(Dynamite, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -12,7 +12,6 @@ VertexCNAT=0,4,8,1,2,1,2
|
|||
VertexFriction=300,300,100,300,300,300,300
|
||||
Value=25
|
||||
Mass=50
|
||||
Picture=192,100,32,40
|
||||
Collection=-8,-10,16,27
|
||||
ContactIncinerate=10
|
||||
CrewMember=1
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
|
@ -0,0 +1,11 @@
|
|||
[Particle]
|
||||
Name=ExploSmokeFastFade
|
||||
MaxCount=800
|
||||
InitFn=StdInit
|
||||
ExecFn=StdExec
|
||||
DrawFn=Std
|
||||
Face=0,0,64,64,-32,-32
|
||||
Delay=0
|
||||
Repeats=1
|
||||
AlphaFade=2
|
||||
FadeDelay=1
|
Binary file not shown.
After Width: | Height: | Size: 828 B |
|
@ -0,0 +1,17 @@
|
|||
[Particle]
|
||||
Name=StarSpark
|
||||
MaxCount=1500
|
||||
InitFn=StdInit
|
||||
ExecFn=StdExec
|
||||
CollisionFn=Die
|
||||
DrawFn=Std
|
||||
Face=0,0,32,32,-16,-16
|
||||
Delay=0
|
||||
Repeats=1
|
||||
GravityAcc=50
|
||||
VertexCount=1
|
||||
VertexY=0
|
||||
AlphaFade=8
|
||||
Additive=1
|
||||
RByV=3
|
||||
Attach=1
|
|
@ -1,9 +0,0 @@
|
|||
[DefCore]
|
||||
id=Environment_AcidRain
|
||||
Version=5,2,0,1
|
||||
Category=C4D_StaticBack|C4D_Environment
|
||||
Width=1
|
||||
Height=1
|
||||
Value=1
|
||||
Picture=0,0,64,64
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB |
|
@ -1 +0,0 @@
|
|||
local Name = "$Name$";
|
|
@ -1 +0,0 @@
|
|||
Name=Säureregen
|
|
@ -1 +0,0 @@
|
|||
Name=Acid Rain
|
|
@ -1,9 +1,7 @@
|
|||
[DefCore]
|
||||
id=Cloud
|
||||
Version=5,2,0,1
|
||||
Category=C4D_Vehicle|C4D_Background
|
||||
Timer=25
|
||||
TimerCall=TimedEvents
|
||||
Category=C4D_Vehicle | C4D_Background
|
||||
Width=512
|
||||
Height=350
|
||||
Offset=-256,-175
|
||||
|
|
|
@ -1,21 +1,43 @@
|
|||
/*--- Cloud ---*/
|
||||
/**
|
||||
Cloud
|
||||
Generic cloud, features: rain (water, acid) and thunder.
|
||||
The clouds have periods of condensing, idle and raining.
|
||||
Different types of rain (water, acid) are hardcoded.
|
||||
|
||||
TODO: Make dependent on scenario setting.
|
||||
TODO: Make for all material types.
|
||||
|
||||
@authors Ringwaul, Maikel
|
||||
*/
|
||||
|
||||
|
||||
// Cloud modes: idle, raining, condensing.
|
||||
static const CLOUD_ModeIdle = 0;
|
||||
static const CLOUD_ModeRaining = 1;
|
||||
static const CLOUD_ModeCondensing = 2;
|
||||
local mode;
|
||||
// The time a cloud is in this mode.
|
||||
local mode_time;
|
||||
|
||||
local water; // number of water pixels the cloud contains.
|
||||
local acid; // number of acid pixels the cloud contains.
|
||||
local lightning_chance; // chance of lightning strikes 0-100.
|
||||
local evap_x; // x coordinate for evaporation
|
||||
|
||||
local szMat, iSize, iCondensing;
|
||||
local iSearchY;
|
||||
local iWaitTime;
|
||||
local iAcidity;
|
||||
local iStrikeChance;
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
//Cloud defaults and modifiers
|
||||
iCondensing = 0;
|
||||
iSize = RandomX(300,500);
|
||||
SetClrModulation(RGB(255,255,255));
|
||||
iSearchY = 0;
|
||||
iAcidity=0;
|
||||
iWaitTime = RandomX(130,190);
|
||||
var iGraphics = RandomX(1,3);
|
||||
// Clouds start idle.
|
||||
mode = CLOUD_ModeIdle;
|
||||
mode_time = 360 + RandomX(-60, 60);
|
||||
|
||||
// Default values for rain.
|
||||
water = RandomX(200, 300);
|
||||
acid = 0;
|
||||
|
||||
// Cloud defaults
|
||||
lightning_chance = 0;
|
||||
evap_x = 0;
|
||||
|
||||
DoCon(Random(75));
|
||||
|
||||
|
@ -31,145 +53,226 @@ protected func Initialize()
|
|||
|
||||
//Failsafe for stupid grounded clouds
|
||||
if(GetMaterial(0,30)!=Material("Sky")) SetPosition(GetX(), GetY()-180);
|
||||
|
||||
}
|
||||
|
||||
public func Precipitation()
|
||||
{
|
||||
var iLaunch;
|
||||
|
||||
if (GetTemperature() < 0 && iAcidity == 0) szMat = "Snow";
|
||||
if (GetTemperature() >= 1 && iAcidity == 0) szMat = "Water";
|
||||
if (iAcidity >= 1) szMat="Acid";
|
||||
|
||||
//Reroute function to Evaporation if cloud is growing
|
||||
if(iCondensing == 1) return(Evaporation());
|
||||
if(iSize <= 50 && iAcidity==0) iCondensing = 1;
|
||||
|
||||
//water-snow precipitation
|
||||
if(iWaitTime == 0 && szMat != "Acid")
|
||||
{
|
||||
RainDrop();
|
||||
iSize = --iSize;
|
||||
}
|
||||
|
||||
//acid precipitation
|
||||
if(iWaitTime == 0 && szMat == "Acid")
|
||||
{
|
||||
RainDrop();
|
||||
iAcidity = --iAcidity;
|
||||
}
|
||||
//Lightning Strike; only during rain
|
||||
if(iWaitTime <= 0 && iSize >= 650 && Random(100) >= 100-(iStrikeChance/16) && szMat=="Water") LaunchLightning(GetX(), GetY(), RandomX(60, 100), 0, 100, 100, 10, true);
|
||||
}
|
||||
|
||||
public func TimedEvents()
|
||||
{
|
||||
var iRight = LandscapeWidth() - 10;
|
||||
|
||||
if(iWaitTime != 0) (iWaitTime = --iWaitTime);
|
||||
if(iWaitTime == 0) Precipitation();
|
||||
WindDirection();
|
||||
CloudShade();
|
||||
//Makes clouds loop around map;
|
||||
if(GetX() >= iRight) SetPosition(12, GetY());
|
||||
if(GetX() <= 10) SetPosition(LandscapeWidth()-12, GetY());
|
||||
if(GetY() <= 5) SetPosition(0,6);
|
||||
if(GetYDir()!=0) SetYDir(0);
|
||||
|
||||
while(Stuck()) SetPosition(GetX(),GetY()-5);
|
||||
}
|
||||
|
||||
protected func Evaporation() //Creates a search line every x-amount(currently five) of pixels to check for water beneath the cloud
|
||||
{
|
||||
var iSearchX = GetX();
|
||||
var iPrecision = 5;
|
||||
|
||||
if(iSize >= 700 || iAcidity >= 100)
|
||||
{
|
||||
iCondensing = 0;
|
||||
iSearchY = 0;
|
||||
iWaitTime = RandomX(130,190);
|
||||
}
|
||||
//line below prevents clouds evaporating through solids
|
||||
if(GetMaterial(0, iSearchY) != Material("Water") && GetMaterial(0, iSearchY) != Material("Acid") && GetMaterial(0, iSearchY) != Material("Sky")) return(iSearchY=0);
|
||||
if(GetMaterial(0, iSearchY) == Material("Water"))
|
||||
{
|
||||
ExtractMaterialAmount(0, iSearchY,Material("Water"), 3);
|
||||
iSize = iSize+3;
|
||||
}
|
||||
if(ObjectCount(Find_ID(Environment_AcidRain))>=1 && GetMaterial(0, iSearchY) == Material("Acid")) {
|
||||
ExtractMaterialAmount(0, iSearchY,Material("Acid"), 3);
|
||||
iAcidity = iAcidity+3;
|
||||
}
|
||||
//advance search point
|
||||
if(GetMaterial(0, iSearchY) != Material("Water") && GetMaterial(0, iSearchY) != Material("Acid"))
|
||||
iSearchY += iPrecision;
|
||||
|
||||
if(iSearchY + GetY() >= LandscapeHeight()) (iSearchY = 0);
|
||||
// Add effect to process all cloud features.
|
||||
AddEffect("ProcessCloud", this, 100, 5, this);
|
||||
return;
|
||||
}
|
||||
|
||||
private func CloudShade()
|
||||
protected func FxProcessCloudStart(object target, proplist effect, int temporary)
|
||||
{
|
||||
//Shades the clouds based on iSize: the water density value of the cloud.
|
||||
var iShade = iSize*425/1000;
|
||||
var iShade2 = iSize-600;
|
||||
var iShade3 = (iAcidity*255/100)/2;
|
||||
|
||||
if(iSize <= 600) SetObjAlpha(iShade);
|
||||
if(iSize > 600) SetObjAlpha(255);
|
||||
if(iSize > 600 && szMat=="Water") SetClrModulation(RGBa(255-iShade2,255-iShade2,255-iShade2, 255));
|
||||
if(iAcidity >= 1) SetClrModulation(RGBa(255-iShade3,255,255-iShade3, 255-iShade));
|
||||
// Make sure the effect interval is 5.
|
||||
if (!temporary)
|
||||
effect.Interval = 5;
|
||||
return 1;
|
||||
}
|
||||
|
||||
public func RainDrop()
|
||||
protected func FxProcessCloudTimer()
|
||||
{
|
||||
var angle = RandomX(0,359);
|
||||
// Move clouds.
|
||||
MoveCloud();
|
||||
// Update mode time.
|
||||
mode_time--;
|
||||
if (mode_time <= 0)
|
||||
{
|
||||
// Change mode, reset timer.
|
||||
mode = (mode + 1) % 3;
|
||||
mode_time = 360 + RandomX(-60, 60);
|
||||
}
|
||||
// Process modes.
|
||||
if (mode == CLOUD_ModeIdle)
|
||||
{
|
||||
/* Empty */
|
||||
}
|
||||
else if (mode == CLOUD_ModeRaining)
|
||||
{
|
||||
Precipitation();
|
||||
ThunderStrike();
|
||||
}
|
||||
else if (mode == CLOUD_ModeCondensing)
|
||||
{
|
||||
Evaporation();
|
||||
}
|
||||
// Update cloud appearance.
|
||||
ShadeCloud();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
private func MoveCloud()
|
||||
{
|
||||
// Move according to wind.
|
||||
var wind = GetWind();
|
||||
if (wind >= 7)
|
||||
SetXDir(Random(355), 1000);
|
||||
else if (wind <= -7)
|
||||
SetXDir(-Random(355), 1000);
|
||||
else
|
||||
SetXDir();
|
||||
// Loop clouds around the map.
|
||||
if (GetX() >= LandscapeWidth() - 10)
|
||||
SetPosition(12, GetY());
|
||||
if (GetX() <= 10)
|
||||
SetPosition(LandscapeWidth()-12, GetY());
|
||||
// Some other safety.
|
||||
if (GetY() <= 5)
|
||||
SetPosition(0, 6);
|
||||
if (GetYDir()!=0)
|
||||
SetYDir(0);
|
||||
while (Stuck())
|
||||
SetPosition(GetX(), GetY() - 5);
|
||||
return;
|
||||
}
|
||||
|
||||
private func Precipitation()
|
||||
{
|
||||
// Precipitaion: water or snow.
|
||||
if (water > 0)
|
||||
{
|
||||
if (GetTemperature() > 0)
|
||||
RainDrop("Water");
|
||||
else
|
||||
RainDrop("Snow");
|
||||
water--;
|
||||
}
|
||||
|
||||
// Precipitation: acid.
|
||||
if (acid > 0)
|
||||
{
|
||||
RainDrop("Acid");
|
||||
acid--;
|
||||
}
|
||||
// If out of liquids, skip mode.
|
||||
if (water == 0 && acid == 0)
|
||||
mode_time = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Raindrop somewhere from the cloud.
|
||||
private func RainDrop(string mat)
|
||||
{
|
||||
var angle = RandomX(0, 359);
|
||||
var dist = Random(51);
|
||||
CastPXS(szMat, 1, 1, Sin(angle,dist),Cos(angle,dist));
|
||||
CastPXS(mat, 1, 1, Sin(angle,dist),Cos(angle,dist));
|
||||
}
|
||||
|
||||
// Launches possibly one thunder strike from the cloud.
|
||||
private func ThunderStrike()
|
||||
{
|
||||
// Determine whether to launch a strike.
|
||||
if (water < 100)
|
||||
return;
|
||||
if (Random(100) >= lightning_chance || Random(5))
|
||||
return;
|
||||
|
||||
// Find random position in the cloud.
|
||||
var con = GetCon();
|
||||
var wdt = GetDefWidth() * con / 250;
|
||||
var hgt = GetDefHeight() * con / 350;
|
||||
var x = GetX() + RandomX(-wdt, wdt);
|
||||
var y = GetY() + RandomX(-hgt, hgt);
|
||||
var str = con + RandomX(-20, 20);
|
||||
// Launch lightning.
|
||||
return LaunchLightning(x, y, str, 0, str / 5, str / 10, str / 10, true);
|
||||
}
|
||||
|
||||
// Tries to evaporate liquids from the surface.
|
||||
protected func Evaporation()
|
||||
{
|
||||
var prec = 5;
|
||||
|
||||
// Found enough water/acid, skip condensing phase.
|
||||
if (water >= 700 || acid >= 100)
|
||||
{
|
||||
mode_time = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// determine new x coordinate from the cloud to test for liquids.
|
||||
var wdt = GetDefWidth() * GetCon() * 3 / 4;
|
||||
evap_x += prec;
|
||||
if (evap_x > wdt)
|
||||
evap_x = - wdt;
|
||||
|
||||
// Test the line downwards from this coordinate.
|
||||
var y = 0;
|
||||
while (!GBackSemiSolid(evap_x, y) && y < LandscapeHeight())
|
||||
y += prec;
|
||||
|
||||
// Try to extract water.
|
||||
if(GetMaterial(evap_x, y) == Material("Water"))
|
||||
{
|
||||
ExtractMaterialAmount(evap_x, y, Material("Water"), 3);
|
||||
water += 3;
|
||||
}
|
||||
|
||||
// Try to extract acid.
|
||||
if(GetMaterial(evap_x, y) == Material("Acid"))
|
||||
{
|
||||
ExtractMaterialAmount(evap_x, y, Material("Acid"), 3);
|
||||
acid += 3;
|
||||
}
|
||||
|
||||
// Also add some rain by scenario value.
|
||||
var mat = GetScenarioVal("Precipitation");
|
||||
if (Random(100) < GetScenarioVal("Rain"))
|
||||
{
|
||||
if (mat == "Water")
|
||||
water++;
|
||||
if (mat == "Acid")
|
||||
acid++;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//Shades the clouds based on iSize: the water density value of the cloud.
|
||||
private func ShadeCloud()
|
||||
{
|
||||
var shade = Min(water*425/1000, 255);
|
||||
var shade2 = Min(water-600, 255);
|
||||
var shade3 = (acid*255/100)/2;
|
||||
|
||||
if (water <= 600)
|
||||
SetObjAlpha(shade);
|
||||
if (water > 600)
|
||||
SetClrModulation(RGBa(255-shade2, 255-shade2, 255-shade2, 255));
|
||||
if (acid > 0)
|
||||
SetClrModulation(RGBa(255-shade3, 255, 255-shade3, 255-shade));
|
||||
return;
|
||||
}
|
||||
|
||||
//For use as scenario setting. Can work after initialize, if you really want to.
|
||||
global func AdjustLightningFrequency(int iFreq)
|
||||
global func AdjustLightningFrequency(int freq)
|
||||
{
|
||||
for(var Cloud in FindObjects(Find_ID(Cloud)))
|
||||
Cloud->SetLightningFrequency(iFreq);
|
||||
return(iFreq);
|
||||
for (var cloud in FindObjects(Find_ID(Cloud)))
|
||||
cloud->SetLightningFrequency(freq);
|
||||
return;
|
||||
}
|
||||
|
||||
//Routes the global adjust function's variable to the clouds.
|
||||
public func SetLightningFrequency(int iFreq)
|
||||
public func SetLightningFrequency(int freq)
|
||||
{
|
||||
iStrikeChance=iFreq;
|
||||
lightning_chance = freq;
|
||||
}
|
||||
|
||||
private func WindDirection()
|
||||
{
|
||||
var iWind = GetWind();
|
||||
|
||||
if(iWind >= 7) SetXDir(Random(355),1000);
|
||||
if(iWind <= -7) SetXDir(-Random(355),1000);
|
||||
if(iWind < 6 && iWind > -6) SetXDir();
|
||||
}
|
||||
|
||||
func Definition(def) {
|
||||
SetProperty("ActMap", {
|
||||
Fly = {
|
||||
Prototype = Action,
|
||||
Name = "Fly",
|
||||
Procedure = DFA_FLOAT,
|
||||
Speed = 20,
|
||||
Accel = 16,
|
||||
Decel = 16,
|
||||
X = 0,
|
||||
Y = 0,
|
||||
Wdt = 512,
|
||||
Hgt = 350,
|
||||
Length = 16,
|
||||
Delay = 0,
|
||||
NextAction = "Fly",
|
||||
TurnAction = "Turn",
|
||||
},
|
||||
}, def);
|
||||
}
|
||||
local ActMap = {
|
||||
Fly = {
|
||||
Prototype = Action,
|
||||
Name = "Fly",
|
||||
Procedure = DFA_FLOAT,
|
||||
Speed = 20,
|
||||
Accel = 16,
|
||||
Decel = 16,
|
||||
X = 0,
|
||||
Y = 0,
|
||||
Wdt = 512,
|
||||
Hgt = 350,
|
||||
Length = 16,
|
||||
Delay = 0,
|
||||
NextAction = "Fly",
|
||||
TurnAction = "Turn",
|
||||
},
|
||||
};
|
||||
local Name = "Cloud";
|
||||
|
|
|
@ -100,13 +100,13 @@ protected func FxIntEarthquakeTimer(object target, effect, int time)
|
|||
return FX_OK;
|
||||
// Get strength.
|
||||
var str = effect.strength;
|
||||
// Shake viewport.
|
||||
if (!Random(10))
|
||||
ShakeViewPort(str, x, y);
|
||||
// Get quake coordinates.
|
||||
var x = effect.x;
|
||||
var y = effect.y;
|
||||
var l = 4 * str;
|
||||
// Shake viewport.
|
||||
if (!Random(10))
|
||||
ShakeViewPort(str, x, y);
|
||||
// Shake ground & objects.
|
||||
ShakeFree(x, y, Random(str / 2) + str / 5 + 5);
|
||||
for (var obj in FindObjects(Find_NoContainer(), Find_OCF(OCF_Alive), Find_InRect(x - l, y - l, l, l)))
|
||||
|
|
|
@ -69,7 +69,7 @@ protected func Initialize()
|
|||
// Create moon and stars.
|
||||
if (FindObject(Find_ID(Environment_Celestial)))
|
||||
{
|
||||
var moon=CreateObject(Moon, LandscapeWidth() / 2, LandscapeHeight() / 6);
|
||||
CreateObject(Moon, LandscapeWidth() / 2, LandscapeHeight() / 6);
|
||||
PlaceStars();
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -18,6 +18,17 @@ static const SproutBerryBush_water_per_berry = 10;
|
|||
static const SproutBerryBush_max_sprouts = 8;
|
||||
static const SproutBerryBush_evolve_steps_per_new_sprout = 2;
|
||||
|
||||
// static function
|
||||
func Place(int amount)
|
||||
{
|
||||
// place some sprout berries
|
||||
var bush = PlaceVegetation(SproutBerryBush, 0, LandscapeHeight() / 3, LandscapeWidth(), LandscapeHeight(), 100000);
|
||||
if(bush)
|
||||
for (var i = 1; i < amount; i++)
|
||||
PlaceVegetation(SproutBerryBush, bush->GetX() - 200, bush->GetY() - 200, 400, 400, 100000);
|
||||
return true;
|
||||
}
|
||||
|
||||
func Construction()
|
||||
{
|
||||
SetCon(100);
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
#include Library_Plant
|
||||
|
||||
private func SeedAreaSize() { return 400; }
|
||||
private func SeedChance() { return 50; }
|
||||
private func SeedAmount() { return 12; }
|
||||
|
||||
func Construction()
|
||||
{
|
||||
StartGrowth(1);
|
||||
StartGrowth(5);
|
||||
inherited(...);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,6 @@ protected func JoinPlayer(int plr)
|
|||
{
|
||||
var clonk = GetCrew(plr);
|
||||
clonk->DoEnergy(100000);
|
||||
var x, y;
|
||||
var pos = FindRelaunchPos(plr);
|
||||
clonk->SetPosition(pos[0], pos[1]);
|
||||
return;
|
||||
|
|
|
@ -142,7 +142,7 @@ func CreateStarCircle()
|
|||
|
||||
if(GetType(stars) != C4V_Array)
|
||||
stars=[];
|
||||
for(star in stars) star->RemoveObject();
|
||||
for(var star in stars) star->RemoveObject();
|
||||
stars=[];
|
||||
var amount=radius / 15;
|
||||
|
||||
|
|
|
@ -274,9 +274,6 @@ func RefreshScoreboard()
|
|||
SetScoreboardData(SBRD_Caption,SBRD_Points,Format("{{Sword}} / %d", GetPointLimit()),SBRD_Caption);
|
||||
SetScoreboardData(SBRD_Caption,SBRD_Deaths,"{{Clonk}}",SBRD_Caption);
|
||||
|
||||
|
||||
var points=GetTeamPoints();
|
||||
|
||||
for(var cnt=0;cnt<GetPlayerCount();cnt++)
|
||||
{
|
||||
var plr=GetPlayerByIndex(cnt);
|
||||
|
|
|
@ -100,7 +100,6 @@ protected func JoinPlayer(int plr)
|
|||
{
|
||||
var clonk = GetCrew(plr);
|
||||
clonk->DoEnergy(100000);
|
||||
var x, y;
|
||||
var pos = FindRelaunchPos(plr);
|
||||
clonk->SetPosition(pos[0], pos[1]);
|
||||
return;
|
||||
|
|
|
@ -426,7 +426,7 @@ protected func FxIntDirNextCPTimer(object target, effect)
|
|||
// Find nearest CP.
|
||||
var nextcp;
|
||||
for (var cp in FindObjects(Find_ID(ParkourCheckpoint), Find_Func("FindCPMode", PARKOUR_CP_Check | PARKOUR_CP_Finish), Sort_Distance(target->GetX() - GetX(), target->GetY() - GetY())))
|
||||
if (!cp->ClearedByPlayer(plr) && (cp->IsActiveForPlayer(plr) || cp->IsActiveForTeam(GetPlayerTeam(plr))))
|
||||
if (!cp->ClearedByPlayer(plr) && (cp->IsActiveForPlayer(plr) || cp->IsActiveForTeam(team)))
|
||||
{
|
||||
nextcp = cp;
|
||||
break;
|
||||
|
|
|
@ -4,9 +4,15 @@
|
|||
@author Newton, Maikel
|
||||
*/
|
||||
|
||||
// this array contains all the menus
|
||||
// index 0 = calling object
|
||||
// index >0 = first crew, then containers
|
||||
local circ_menus;
|
||||
local menu_object;
|
||||
|
||||
local crew_count;
|
||||
local container_count;
|
||||
|
||||
/** Creates a content menu for the calling object. This is supposed to be a crew member,
|
||||
controlled by a player.
|
||||
@return a pointer to the created menu, or \c nil if failed.
|
||||
|
@ -23,10 +29,21 @@ global func CreateContentsMenus()
|
|||
controller->SetMenuObject(this);
|
||||
this->SetMenu(controller);
|
||||
|
||||
var index = 0;
|
||||
|
||||
// add the clonk itself
|
||||
controller->AddContentMenu(this, index, true);
|
||||
|
||||
// add all nearby crewmembers
|
||||
var teammates = FindObjects(Find_Distance(20), Find_OCF(OCF_CrewMember), Find_Owner(GetOwner()), Find_Exclude(this));
|
||||
index = 1;
|
||||
for(var t in teammates)
|
||||
controller->AddContentMenu(t, index++, true);
|
||||
|
||||
// Add content menus for all containers at the position of the caller.
|
||||
var containers = FindObjects(Find_Or(Find_Not(Find_Exclude(this)), Find_And(Find_AtPoint(), Find_NoContainer(), Find_Func("IsContainer"))), Sort_Func("SortInventoryObjs"));
|
||||
for(var index = 0; index < GetLength(containers); index++)
|
||||
controller->AddContentMenu(containers[index], index, GetLength(containers));
|
||||
var containers = FindObjects(Find_AtPoint(), Find_NoContainer(), Find_OCF(OCF_Fullcon), Find_Func("IsContainer"), Sort_Func("SortInventoryObjs"));
|
||||
for(var c in containers)
|
||||
controller->AddContentMenu(c, index++, false);
|
||||
|
||||
// Show and return content menu.
|
||||
controller->Show();
|
||||
|
@ -81,7 +98,7 @@ func Hide()
|
|||
prop.Menu->Hide();
|
||||
}
|
||||
|
||||
func AddContentMenu(object container, int pos, int length)
|
||||
func AddContentMenu(object container, int pos, bool isCrew)
|
||||
{
|
||||
var menu = CreateObject(GUI_Menu, 0, 0, GetOwner());
|
||||
|
||||
|
@ -91,7 +108,12 @@ func AddContentMenu(object container, int pos, int length)
|
|||
menu->SetDragDropMenu(true);
|
||||
|
||||
PutContentsIntoMenu(menu, container);
|
||||
circ_menus[pos] = {Object = container, Menu = menu};
|
||||
circ_menus[pos] = {Object = container, Menu = menu, IsCrew = isCrew};
|
||||
|
||||
if(isCrew)
|
||||
crew_count++;
|
||||
else
|
||||
container_count++;
|
||||
|
||||
// Track external changes in containers.
|
||||
AddEffect("ContainerTracker", container, 100, 1, this, nil, menu);
|
||||
|
@ -103,18 +125,41 @@ func AddContentMenu(object container, int pos, int length)
|
|||
// Draws the contents menus to the right positions.
|
||||
private func UpdateContentMenus()
|
||||
{
|
||||
var menu_count = GetLength(circ_menus);
|
||||
for (var index = 0; index < menu_count; index++)
|
||||
// for positioning to the left
|
||||
var index_crew = 0;
|
||||
// for positioning to the right
|
||||
var index_containers = 1; // containers start with an offset of 1
|
||||
|
||||
// calculate left edge
|
||||
var r = 160;
|
||||
var d = 2*r/3;
|
||||
var dx = Sqrt(r**2 - d**2);
|
||||
var x_base = 800 - dx*(container_count-1);
|
||||
var y_base = 320;
|
||||
|
||||
for(var prop in circ_menus)
|
||||
{
|
||||
var menu = circ_menus[index].Menu;
|
||||
var r = 160;
|
||||
var d = 2*r/3;
|
||||
var dx = Sqrt(r**2 - d**2);
|
||||
var menu = prop.Menu;
|
||||
|
||||
// Determine x-position.
|
||||
var x = 800 + dx * (2*index - menu_count + 1);
|
||||
// Alternate y-position.
|
||||
var y = 320 + (-1)**index * d;
|
||||
var x,y;
|
||||
|
||||
if(prop.IsCrew)
|
||||
{
|
||||
x = x_base - dx * (2*index_crew);
|
||||
y = y_base + 2*d - (-1)**index_crew * d;
|
||||
|
||||
index_crew++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Determine x-position.
|
||||
//x = 800 + dx * (2*index_containers - container_count + 1);
|
||||
x = x_base + dx*(2*index_containers);
|
||||
// Alternate y-position.
|
||||
y = y_base + (-1)**(index_containers) * d;
|
||||
|
||||
index_containers++;
|
||||
}
|
||||
// TODO: reduce size of menus to fit more into screen.
|
||||
menu->SetPosition(x, y);
|
||||
}
|
||||
|
@ -125,7 +170,12 @@ private func PutContentsIntoMenu(object menu, object container)
|
|||
{
|
||||
if (container->~ NoStackedContentMenu())
|
||||
{
|
||||
var contents = FindObjects(Find_Container(container));
|
||||
var contents;
|
||||
// get contents in special order if possible
|
||||
if(!(contents = (container->~GetItems())))
|
||||
// else just take everything we find.
|
||||
contents = FindObjects(Find_Container(container));
|
||||
|
||||
for (var content in contents)
|
||||
if (!AddContentsMenuItem(content, menu))
|
||||
return;
|
||||
|
@ -278,7 +328,12 @@ public func OnExternalContentChange(object menu, object container)
|
|||
}
|
||||
|
||||
// Reopen the changed menu.
|
||||
AddContentMenu(container, index, length);
|
||||
var isCrew = container->GetOCF() & OCF_CrewMember;
|
||||
if(isCrew)
|
||||
crew_count--;
|
||||
else
|
||||
container_count--;
|
||||
AddContentMenu(container, index, isCrew);
|
||||
Show();
|
||||
return;
|
||||
}
|
||||
|
@ -386,7 +441,8 @@ private func UpdateAfterTakenObjects(proplist p_source, object menuItem)
|
|||
// otherwise, update
|
||||
|
||||
// repair "holes"
|
||||
var remaining_objects = RemoveHoles(objects);
|
||||
var remaining_objects = objects[:];
|
||||
RemoveHoles(remaining_objects);
|
||||
//Log("%v",remaining_objects);
|
||||
|
||||
menuItem->SetData(remaining_objects);
|
||||
|
|
|
@ -52,7 +52,6 @@ public func MouseSelectionAlt(int plr)
|
|||
// Called to determine which object is dragged.
|
||||
public func MouseDrag(int plr)
|
||||
{
|
||||
//Log("%s->MouseDrag(%d) for owner: %d, menu: %s, dd: %v", GetName(), plr, GetOwner(), item_menu->GetName(), item_menu->IsDragDropMenu());
|
||||
// Check if the owners match.
|
||||
if (plr != GetOwner()) return;
|
||||
|
||||
|
@ -91,6 +90,31 @@ public func MouseDragDone(self, object target)
|
|||
return item_menu->OnItemDragDone(self, target);
|
||||
}
|
||||
|
||||
// Called if the mouse cursor starts hovering over this item.
|
||||
public func OnMouseOver(int plr, object dragged)
|
||||
{
|
||||
if (plr != GetOwner()) return;
|
||||
|
||||
// make it appear bigger
|
||||
SetObjDrawTransform(1100, 0, 0, 0, 1100, 0, 1);
|
||||
|
||||
|
||||
// Forward command to menu.
|
||||
return item_menu->OnMouseOverItem(this, dragged);
|
||||
}
|
||||
|
||||
// Called if the mouse cursor stops hovering over this item.
|
||||
public func OnMouseOut(int plr, object dragged)
|
||||
{
|
||||
if (plr != GetOwner()) return;
|
||||
|
||||
// standard size again
|
||||
SetObjDrawTransform(1000, 0, 0, 0, 1000, 0, 1);
|
||||
|
||||
// Forward command to menu.
|
||||
return item_menu->OnMouseOutItem(this, dragged);
|
||||
}
|
||||
|
||||
/* Menu item properties */
|
||||
|
||||
public func SetMenu(object menu)
|
||||
|
|
|
@ -165,12 +165,12 @@ private func GetItemPosition(int n, int total)
|
|||
// Packing 7 or less circles.
|
||||
if (total <= 7)
|
||||
{
|
||||
if (n == 1)
|
||||
if (n == 7)
|
||||
return [0, 0];
|
||||
else
|
||||
{
|
||||
var x = Cos(60 * (n-1), 2 * MENU_Radius / 3);
|
||||
var y = -Sin(60 * (n-1), 2 * MENU_Radius / 3);
|
||||
var x = -Cos(60 * (n+1), 2 * MENU_Radius / 3);
|
||||
var y = -Sin(60 * (n+1), 2 * MENU_Radius / 3);
|
||||
return [x, y];
|
||||
}
|
||||
}
|
||||
|
@ -178,18 +178,18 @@ private func GetItemPosition(int n, int total)
|
|||
// Packing 19 or less circles.
|
||||
if (total <= 19)
|
||||
{
|
||||
if (n == 1)
|
||||
if (n == 7)
|
||||
return [0, 0];
|
||||
else if (n <= 7)
|
||||
else if (n < 7)
|
||||
{
|
||||
var x = Cos(60 * (n-1), 2 * MENU_Radius / 5);
|
||||
var y = -Sin(60 * (n-1), 2 * MENU_Radius / 5);
|
||||
var x = -Cos(60 * (n+1), 2 * MENU_Radius / 5);
|
||||
var y = -Sin(60 * (n+1), 2 * MENU_Radius / 5);
|
||||
return [x, y];
|
||||
}
|
||||
else
|
||||
{
|
||||
var x = Cos(30 * (n-7) + 15, 31 * MENU_Radius / 40);
|
||||
var y = -Sin(30 * (n-7) + 15, 31 * MENU_Radius / 40);
|
||||
var x = -Cos(30 * (n-5) + 15, 31 * MENU_Radius / 40);
|
||||
var y = -Sin(30 * (n-5) + 15, 31 * MENU_Radius / 40);
|
||||
return [x, y];
|
||||
}
|
||||
}
|
||||
|
@ -197,24 +197,24 @@ private func GetItemPosition(int n, int total)
|
|||
// Packing 37 or less circles.
|
||||
if (total <= 37)
|
||||
{
|
||||
if (n == 1)
|
||||
if (n == 7)
|
||||
return [0, 0];
|
||||
else if (n <= 7)
|
||||
else if (n < 7)
|
||||
{
|
||||
var x = Cos(60 * (n-1), 2 * MENU_Radius / 7);
|
||||
var y = -Sin(60 * (n-1), 2 * MENU_Radius / 7);
|
||||
var x = -Cos(60 * (n+1), 2 * MENU_Radius / 7);
|
||||
var y = -Sin(60 * (n+1), 2 * MENU_Radius / 7);
|
||||
return [x, y];
|
||||
}
|
||||
else if (n <= 19)
|
||||
{
|
||||
var x = Cos(30 * (n-7) + 15, 31 * MENU_Radius / 56);
|
||||
var y = -Sin(30 * (n-7) + 15, 31 * MENU_Radius / 56);
|
||||
var x = -Cos(30 * (n-5) + 15, 31 * MENU_Radius / 56);
|
||||
var y = -Sin(30 * (n-5) + 15, 31 * MENU_Radius / 56);
|
||||
return [x, y];
|
||||
}
|
||||
else
|
||||
{
|
||||
var x = Cos(30 * (n-19), 61 * MENU_Radius / 72);
|
||||
var y = -Sin(30 * (n-19), 61 * MENU_Radius / 72);
|
||||
var x = -Cos(30 * (n-17), 61 * MENU_Radius / 72);
|
||||
var y = -Sin(30 * (n-17), 61 * MENU_Radius / 72);
|
||||
return [x, y];
|
||||
}
|
||||
}
|
||||
|
@ -333,7 +333,6 @@ public func OnItemDropped(object drop_item, object on_item)
|
|||
if (!menu_commander) return;
|
||||
|
||||
// Forward to commander.
|
||||
// Log("Item dropped %s", drop_item->GetName());
|
||||
return menu_commander->~OnItemDropped(this, drop_item, on_item);
|
||||
}
|
||||
|
||||
|
@ -342,7 +341,24 @@ public func OnItemDragDone(object drag_item, object on_item)
|
|||
{
|
||||
if (!menu_commander) return;
|
||||
|
||||
// Log("Item dragged %s", drag_item->GetName());
|
||||
// Forward to commander.
|
||||
return menu_commander->~OnItemDragDone(this, drag_item, on_item);
|
||||
}
|
||||
|
||||
// Called if the mouse cursor enters hovering over an item.
|
||||
public func OnMouseOverItem(object over_item, object dragged_item)
|
||||
{
|
||||
if (!menu_commander) return;
|
||||
|
||||
// Forward to commander.
|
||||
return menu_commander->~OnMouseOverItem(this, over_item, dragged_item);
|
||||
}
|
||||
|
||||
// Called if the mouse cursor exits hovering over an item.
|
||||
public func OnMouseOutItem(object out_item, object dragged_item)
|
||||
{
|
||||
if (!menu_commander) return;
|
||||
|
||||
// Forward to commander.
|
||||
return menu_commander->~OnMouseOutItem(this, out_item, dragged_item);
|
||||
}
|
||||
|
|
|
@ -42,8 +42,8 @@ func FadeOut(int speed, step)
|
|||
|
||||
func FxFadeOutTimer(target, effect)
|
||||
{
|
||||
if(alpha < 5) return RemoveObject();
|
||||
alpha -= effect.step;
|
||||
if(alpha < 5) return RemoveObject();
|
||||
Update();
|
||||
return 1;
|
||||
}
|
||||
|
@ -60,7 +60,8 @@ func SetColor(int r2, g2, b2, a)
|
|||
|
||||
func Update()
|
||||
{
|
||||
this->Message(Format("@<c %x>%s</c>", RGBa(r, g, b, alpha), msg));
|
||||
// the lacking </c> is on purpose
|
||||
this->Message(Format("@<c %x><c %x>%s</c>", RGBa(255, 255, 255, alpha), RGBa(r, g, b, alpha), msg));
|
||||
}
|
||||
|
||||
public func Initialize()
|
||||
|
@ -69,5 +70,8 @@ public func Initialize()
|
|||
SetComDir(COMD_None);
|
||||
SetSpeed(0, -20);
|
||||
alpha=255;
|
||||
r = 255;
|
||||
g = 255;
|
||||
b = 255;
|
||||
return true;
|
||||
}
|
|
@ -102,7 +102,7 @@ func FxCheckStuckTimer(_, effect)
|
|||
|
||||
func FxSparkleTimer(_, effect)
|
||||
{
|
||||
var x=RandomX(-4, 4);
|
||||
//var x=RandomX(-4, 4);
|
||||
//var p="ItemSpark";
|
||||
//if(Random(2)) p="ItemSparkA";
|
||||
//CreateParticle(p, x, (4-Abs(x))/2, -x/2, -3, 40, RGBa(50,50,150+Random(100), 200), nil);
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
[DefCore]
|
||||
id=StatusSymbol
|
||||
Version=4,10,0,0
|
||||
Category=C4D_Vehicle | C4D_MouseIgnore
|
||||
Width=1
|
||||
Height=1
|
||||
Offset=-1,-1
|
||||
Vertices=1
|
||||
VertexY=14
|
||||
NoGet=1
|
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
|
@ -0,0 +1,139 @@
|
|||
/**
|
||||
StatusSymbol.ocd
|
||||
Shows a certain state of an object.
|
||||
*/
|
||||
|
||||
local Name = "$Name$";
|
||||
local Description = "$Description$";
|
||||
|
||||
local symbols;
|
||||
local message;
|
||||
|
||||
local ActMap=
|
||||
{
|
||||
Be =
|
||||
{
|
||||
Prototype = Action,
|
||||
Name="Be",
|
||||
Procedure=DFA_ATTACH,
|
||||
NextAction="Be",
|
||||
Length=1,
|
||||
FacetBase=1,
|
||||
AbortCall = "AttachTargetLost"
|
||||
}
|
||||
};
|
||||
|
||||
func AttachTargetLost(){return RemoveObject();}
|
||||
|
||||
func Init(to)
|
||||
{
|
||||
symbols=[];
|
||||
SetAction("Be", to);
|
||||
|
||||
// above the object
|
||||
var hgt = to->GetDefCoreVal("Height", "DefCore") / 2;
|
||||
SetVertex(0, VTX_Y, hgt);
|
||||
var x = to->GetVertex(0, VTX_X);
|
||||
SetVertex(0, VTX_X, x);
|
||||
}
|
||||
|
||||
public func GetStatusSymbolHelper(to)
|
||||
{
|
||||
var obj = FindObject(Find_ID(StatusSymbol), Find_ActionTarget(to));
|
||||
if(obj) return obj;
|
||||
obj = CreateObject(StatusSymbol, 0, 0, to->GetOwner());
|
||||
obj->Init(to);
|
||||
return obj;
|
||||
}
|
||||
|
||||
global func AddStatusSymbol(ID)
|
||||
{
|
||||
if(!this) return false;
|
||||
var h = StatusSymbol->GetStatusSymbolHelper(this);
|
||||
if(!h) return false;
|
||||
|
||||
h->Add(ID);
|
||||
return true;
|
||||
}
|
||||
|
||||
global func RemoveStatusSymbol(ID)
|
||||
{
|
||||
if(!this) return false;
|
||||
var h = StatusSymbol->GetStatusSymbolHelper(this);
|
||||
if(!h) return false;
|
||||
h->Remove(ID);
|
||||
return true;
|
||||
}
|
||||
|
||||
func Add(what)
|
||||
{
|
||||
Blink();
|
||||
var e = -1;
|
||||
for(var i=0;i<GetLength(symbols);++i)
|
||||
{
|
||||
if(symbols[i] == nil) {e = i; continue;}
|
||||
if(symbols[i].ID != what) continue;
|
||||
++symbols[i].cnt;
|
||||
Update();
|
||||
return;
|
||||
}
|
||||
|
||||
if(e == -1)
|
||||
e = GetLength(symbols);
|
||||
|
||||
symbols[e] = {ID=what, cnt=1};
|
||||
Update();
|
||||
}
|
||||
|
||||
func Remove(what)
|
||||
{
|
||||
Blink();
|
||||
for(var i=0;i<GetLength(symbols);++i)
|
||||
{
|
||||
if(symbols[i] == nil) continue;
|
||||
if(symbols[i].ID != what) continue;
|
||||
--symbols[i].cnt;
|
||||
|
||||
if(symbols[i].cnt <= 0)
|
||||
symbols[i] = nil;
|
||||
}
|
||||
Update();
|
||||
}
|
||||
|
||||
func Update()
|
||||
{
|
||||
message = "@";
|
||||
for(var i=0;i<GetLength(symbols);++i)
|
||||
{
|
||||
if(symbols[i] == nil) continue;
|
||||
message = Format("%s{{%i}}", message, symbols[i].ID);
|
||||
}
|
||||
this->Message(message);
|
||||
}
|
||||
|
||||
func Blink()
|
||||
{
|
||||
if(GetEffect("Blinking", this))
|
||||
RemoveEffect("Blinking", this);
|
||||
AddEffect("Blinking", this, 1, 36, this);
|
||||
}
|
||||
|
||||
func FxBlinkingStart(target, effect, temp)
|
||||
{
|
||||
if(temp) return;
|
||||
effect.cycle = 1;
|
||||
}
|
||||
|
||||
func FxBlinkingTimer(target, effect)
|
||||
{
|
||||
this.Visibility = this->GetActionTarget().Visibility;
|
||||
|
||||
if(((++effect.cycle) % 2) == 0)
|
||||
{
|
||||
this->Message("");
|
||||
return 1;
|
||||
}
|
||||
this->Message(message);
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Name=StatusSymbol.ocd
|
||||
Description=Shows a certain state of an object.
|
|
@ -0,0 +1,2 @@
|
|||
Name=StatusSymbol.ocd
|
||||
Description=Shows a certain state of an object.
|
|
@ -2,7 +2,7 @@
|
|||
id=Icon_SlimNumber
|
||||
Version=5,2,0,1
|
||||
Category=C4D_StaticBack
|
||||
Picture=0,0,64,64
|
||||
Picture=0,0,32,64
|
||||
Width=32
|
||||
Height=64
|
||||
Offset=-16,-32
|
||||
|
|
|
@ -12,4 +12,4 @@ VertexFriction=50,100,100
|
|||
Value=10
|
||||
Mass=2
|
||||
Components=Flour=1
|
||||
Picture=8,0,16,16
|
||||
Picture=32,0,64,64
|
||||
|
|
|
@ -5,7 +5,7 @@ Category=C4D_Object
|
|||
Width=8
|
||||
Height=8
|
||||
Offset=-4,-4
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Vertices=3
|
||||
VertexX=0,2,-2
|
||||
VertexY=1,-1,-1
|
||||
|
|
|
@ -14,7 +14,7 @@ protected func Hit(x, y)
|
|||
}
|
||||
|
||||
public func IsFuel() { return true; }
|
||||
public func GetFuelAmount() { return 100; }
|
||||
public func GetFuelAmount() { return 30; }
|
||||
|
||||
local Collectible = 1;
|
||||
local Name = "$Name$";
|
||||
|
|
|
@ -12,6 +12,6 @@ VertexCNAT=1,2,16
|
|||
VertexFriction=30,30,30
|
||||
Value=25
|
||||
Mass=16
|
||||
Picture=0,4,13,13
|
||||
Picture=0,20,64,64
|
||||
Components=Nugget=3
|
||||
Rotate=1
|
||||
|
|
|
@ -7,7 +7,7 @@ TimerCall=Check
|
|||
Width=8
|
||||
Height=8
|
||||
Offset=-4,-4
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Vertices=3
|
||||
VertexX=0,2,-2
|
||||
VertexY=1,-1,-1
|
||||
|
|
|
@ -5,7 +5,7 @@ Category=C4D_Object
|
|||
Width=8
|
||||
Height=8
|
||||
Offset=-4,-4
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Vertices=2
|
||||
VertexX=0,0
|
||||
VertexY=3,-3
|
||||
|
|
|
@ -60,6 +60,8 @@ func FxIntBridgeTimer(clonk, effect)
|
|||
|
||||
// clonk faces bridge direction
|
||||
var tdir = 0;
|
||||
// get global drawing coordinates
|
||||
var x = target_x + GetX(), y = target_y + GetY();
|
||||
if (x > 0) ++tdir;
|
||||
clonk->SetDir(tdir);
|
||||
|
||||
|
@ -67,9 +69,6 @@ func FxIntBridgeTimer(clonk, effect)
|
|||
var min_dt = 3;
|
||||
if (target_y < -20 && !Abs(target_x*5/target_y)) min_dt=2;
|
||||
|
||||
// get global drawing coordinates
|
||||
var x = target_x + GetX(), y = target_y + GetY();
|
||||
|
||||
// bridge speed by dig physical
|
||||
var speed = clonk.ActMap.Dig.Speed/6;
|
||||
|
||||
|
|
|
@ -14,4 +14,4 @@ Value=8
|
|||
Mass=12
|
||||
Components=Ore=1
|
||||
Rotate=1
|
||||
Picture=0,4,13,13
|
||||
Picture=0,20,64,64
|
||||
|
|
|
@ -5,7 +5,7 @@ Category=C4D_Object
|
|||
Width=8
|
||||
Height=8
|
||||
Offset=-4,-4
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Vertices=3
|
||||
VertexX=0,2,-2
|
||||
VertexY=1,-1,-1
|
||||
|
|
|
@ -7,7 +7,7 @@ TimerCall=Check
|
|||
Width=8
|
||||
Height=8
|
||||
Offset=-4,-4
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Vertices=3
|
||||
VertexX=0,2,-2
|
||||
VertexY=1,-1,-1
|
||||
|
|
|
@ -5,7 +5,7 @@ Category=C4D_Object
|
|||
Width=8
|
||||
Height=8
|
||||
Offset=-4,-4
|
||||
Picture=0,0,8,8
|
||||
Picture=0,0,64,64
|
||||
Vertices=3
|
||||
VertexX=0,2,-2
|
||||
VertexY=1,-1,-1
|
||||
|
|
|
@ -12,7 +12,7 @@ func Incineration()
|
|||
}
|
||||
|
||||
public func IsFuel() { return true; }
|
||||
public func GetFuelAmount() { return 50; }
|
||||
public func GetFuelAmount() { return 15; }
|
||||
public func IsSawmillProduct() { return true; }
|
||||
|
||||
local Collectible = 1;
|
||||
|
|
|
@ -116,8 +116,8 @@ public func ControlUseStart(object clonk, int iX, int iY)
|
|||
return true;
|
||||
|
||||
var rand = Random(2)+1;
|
||||
var animation = Format("SwordSlash%d.%s", rand, arm);
|
||||
var arm = "R";
|
||||
var animation = Format("SwordSlash%d.%s", rand, arm);
|
||||
var length = 15;
|
||||
carry_bone = "pos_hand2";
|
||||
|
||||
|
@ -306,7 +306,6 @@ func CheckStrike(iTime)
|
|||
|
||||
var width=10;
|
||||
var height=20;
|
||||
var angle=0;
|
||||
|
||||
for(var obj in FindObjects(Find_AtRect(offset_x - width/2, offset_y - height/2, width, height),
|
||||
Find_NoContainer(),
|
||||
|
|
|
@ -9,7 +9,6 @@ Vertices=4
|
|||
VertexX=0,0,-4,4
|
||||
VertexY=3,-6,10,10
|
||||
VertexFriction=80,60,60
|
||||
Picture=0,0,16,16
|
||||
Value=12
|
||||
Mass=20
|
||||
Components=Blackpowder=3;Wood=1;Metal=1;
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
[DefCore]
|
||||
id=CableReel
|
||||
Version=5,2,0,1
|
||||
Category=C4D_Object
|
||||
Width=8
|
||||
Height=6
|
||||
Offset=-4,-3
|
||||
Vertices=3
|
||||
VertexX=0,2,-2
|
||||
VertexY=1,-1,-1
|
||||
VertexFriction=50,50,50
|
||||
Value=10
|
||||
Mass=15
|
||||
Components=Metal=1
|
||||
Picture=0,6,64,64
|
Binary file not shown.
Before Width: | Height: | Size: 6.8 KiB |
|
@ -1,6 +0,0 @@
|
|||
[DefCore]
|
||||
id=PowerLine
|
||||
Version=5,2,0,1
|
||||
Category=C4D_StaticBack
|
||||
Vertices=2
|
||||
Line=1
|
Binary file not shown.
Before Width: | Height: | Size: 141 B |
|
@ -1,62 +0,0 @@
|
|||
/*-- Power line --*/
|
||||
|
||||
protected func Initialize()
|
||||
{
|
||||
SetAction("Connect");
|
||||
SetVertexXY(0, GetX(), GetY());
|
||||
SetVertexXY(1, GetX(), GetY());
|
||||
SetProperty("LineColors", [RGB(80,80,80), RGB(80,80,80)]);
|
||||
return;
|
||||
}
|
||||
|
||||
// Returns true if this object is a functioning power line.
|
||||
public func IsPowerLine()
|
||||
{
|
||||
return GetAction() == "Connect";
|
||||
}
|
||||
|
||||
// Returns whether this power line is connected to an object.
|
||||
public func IsConnectedTo(object obj)
|
||||
{
|
||||
return GetActionTarget(0) == obj || GetActionTarget(1) == obj;
|
||||
}
|
||||
|
||||
// Returns the object which is connected to obj through this power line.
|
||||
public func GetConnectedObject(object obj)
|
||||
{
|
||||
if (GetActionTarget(0) == obj)
|
||||
return GetActionTarget(1);
|
||||
if (GetActionTarget(1) == obj)
|
||||
return GetActionTarget(0);
|
||||
return;
|
||||
}
|
||||
|
||||
protected func LineBreak(bool no_msg)
|
||||
{
|
||||
Sound("LineBreak");
|
||||
if (!no_msg)
|
||||
BreakMessage();
|
||||
return;
|
||||
}
|
||||
|
||||
private func BreakMessage()
|
||||
{
|
||||
var line_end = GetActionTarget(0);
|
||||
if (line_end->GetID() != CableReel)
|
||||
line_end = GetActionTarget(1);
|
||||
|
||||
line_end->Message("$TxtLinebroke$");
|
||||
return;
|
||||
}
|
||||
|
||||
local ActMap = {
|
||||
Connect = {
|
||||
Prototype = Action,
|
||||
Name = "Connect",
|
||||
Procedure = DFA_CONNECT,
|
||||
NextAction = "Connect",
|
||||
},
|
||||
};
|
||||
|
||||
local Name = "$Name$";
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
TxtLinebroke=Leitung gerissen
|
||||
Name=Stromleitung
|
|
@ -1,2 +0,0 @@
|
|||
TxtLinebroke=Line broke
|
||||
Name=Power line
|
|
@ -1,70 +0,0 @@
|
|||
/*-- Cable reel --*/
|
||||
|
||||
protected func Hit()
|
||||
{
|
||||
Sound("RockHit?");
|
||||
}
|
||||
|
||||
public func IsToolProduct() { return true; }
|
||||
|
||||
/*-- Line connection --*/
|
||||
|
||||
// Use will connect power line to building at the clonk's position.
|
||||
protected func ControlUse(object clonk, int x, int y)
|
||||
{
|
||||
// Is there an object which accepts power lines?
|
||||
var obj = FindObject(Find_AtPoint(), Find_Func("CanPowerConnect"));
|
||||
// No such object -> message.
|
||||
if (!obj)
|
||||
return clonk->Message("$TxtNoNewLine$");
|
||||
// Is there a power line connected to this wire roll?
|
||||
var line = FindObject(Find_PowerLine());
|
||||
// There already is a power line.
|
||||
if (line)
|
||||
{
|
||||
if (obj == line->GetActionTarget(0) || obj == line->GetActionTarget(1))
|
||||
{
|
||||
// Power line is already connected to obj -> remove line.
|
||||
line->RemoveObject();
|
||||
Sound("Connect");
|
||||
clonk->Message("$TxtLineRemoval$");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Connect existing power line to obj.
|
||||
if(line->GetActionTarget(0) == this)
|
||||
line->SetActionTargets(obj, line->GetActionTarget(1));
|
||||
else if(line->GetActionTarget(1) == this)
|
||||
line->SetActionTargets(line->GetActionTarget(0), obj);
|
||||
else
|
||||
return;
|
||||
Sound("Connect");
|
||||
clonk->Message("$TxtConnect$", obj->GetName());
|
||||
RemoveObject();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else // A new power line needs to be created.
|
||||
{
|
||||
line = CreateObject(PowerLine, 0, 0, NO_OWNER);
|
||||
line->SetActionTargets(this, obj);
|
||||
Sound("Connect");
|
||||
clonk->Message("$TxtConnect$", obj->GetName());
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Finds all power lines connected to obj (can be nil in local calls).
|
||||
private func Find_PowerLine(object obj)
|
||||
{
|
||||
if (!obj)
|
||||
obj = this;
|
||||
return [C4FO_Func, "IsConnectedTo", obj];
|
||||
}
|
||||
|
||||
local Name = "$Name$";
|
||||
local Description = "$Description$";
|
||||
local Collectible = 1;
|
||||
local Rebuy = true;
|
|
@ -1,6 +0,0 @@
|
|||
TxtConnectLine=Leitung verbinden
|
||||
TxtNoNewLine=Hier kann keine neue Leitung verlegt werden.
|
||||
TxtLineRemoval=Stromleitung abgenommen.
|
||||
TxtConnect=Stromleitung verbunden|mit %s
|
||||
Name=Kabelspule
|
||||
Description=Drücke [Benutzen] vor einem Gebäude und ein weiteres Mal vor einem anderen Gebäude, um diese beiden mit einem Stromkabel zu verbinden.
|
|
@ -1,6 +0,0 @@
|
|||
TxtConnectLine=Connect line
|
||||
TxtNoNewLine=Cannot create a new line here.
|
||||
TxtLineRemoval=Power line disconnected.
|
||||
TxtConnect=Power line connected|to %s
|
||||
Name=Cable reel
|
||||
Description=Press [Use] in front of a structure and another time in front of another structure to connect both with a power line.
|
|
@ -5,7 +5,7 @@ Category=C4D_Object
|
|||
Width=3
|
||||
Height=10
|
||||
Offset=-2,-5
|
||||
Picture=4,0,16,16
|
||||
Picture=16,0,64,64
|
||||
Vertices=3
|
||||
VertexX=-2,+2,0
|
||||
VertexY=5,5,-5
|
||||
|
|
|
@ -76,7 +76,6 @@ private func UpdatePicture()
|
|||
var s = 400;
|
||||
var yoffs = 14000;
|
||||
var xoffs = 22000;
|
||||
var spacing = 14000;
|
||||
|
||||
SetGraphics(Format("%d", iCount), Icon_Number, 12, GFXOV_MODE_Picture);
|
||||
SetObjDrawTransform(s, 0, xoffs, 0, s, yoffs, 12);
|
||||
|
|
|
@ -319,7 +319,7 @@ public func FxIntGrappleControlTimer(object target, fxnum, int time)
|
|||
var angle = rope->GetClonkAngle();
|
||||
var off = rope->GetClonkOff();
|
||||
// off = [0,0];
|
||||
var pos = rope->GetClonkPos();
|
||||
//var pos = rope->GetClonkPos();
|
||||
//target->SetPosition(pos[0], pos[1], nil, Rope_Precision);
|
||||
target.MyAngle = angle;
|
||||
//angle = 0;
|
||||
|
|
|
@ -159,7 +159,6 @@ local last_point;
|
|||
|
||||
func UpdateLines()
|
||||
{
|
||||
var fTimeStep = 1;
|
||||
var oldangle;
|
||||
for(var i=1; i < ParticleCount; i++)
|
||||
{
|
||||
|
@ -240,18 +239,6 @@ func GetClonkPos()
|
|||
func GetClonkOff()
|
||||
{
|
||||
return Vec_Sub(particles[-1][0],last_point);
|
||||
var clonk = objects[1][0];
|
||||
var speed = [clonk->GetXDir(Rope_Precision), clonk->GetYDir(Rope_Precision)];
|
||||
var offset = speed;
|
||||
offset[0] = offset[0]*1000/Rope_Precision;
|
||||
offset[1] = offset[1]*1000/Rope_Precision;
|
||||
if(!ClonkOldSpeed)
|
||||
{
|
||||
ClonkOldSpeed = offset;
|
||||
}
|
||||
var ret = ClonkOldSpeed;
|
||||
ClonkOldSpeed = offset;
|
||||
return ret;
|
||||
}
|
||||
|
||||
func SetLineTransform(obj, int r, int xoff, int yoff, int length, int layer, int MirrorSegments) {
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=4
|
|||
VertexX=-1,3,-1,-5
|
||||
VertexY=-4,0,4,0
|
||||
VertexFriction=50,50,50,50
|
||||
Picture=0,1,9,9
|
||||
Picture=0,0,64,64
|
||||
Value=14
|
||||
Mass=15
|
||||
Components=Rock=6;Metal=1;
|
||||
|
|
|
@ -117,22 +117,22 @@ private func FireWeapon(object pClonk,iX,iY)
|
|||
for(var i=10; i<32; i++)
|
||||
{
|
||||
var R = RandomX(-20,20);
|
||||
var SX = Sin(180 - Angle(0,0,iX,iY) + R,i);
|
||||
var SY = Cos(180 - Angle(0,0,iX,iY) + R,i);
|
||||
var SX = Sin(180 - iAngle + R,i);
|
||||
var SY = Cos(180 - iAngle + R,i);
|
||||
|
||||
if(!GBackSolid(SX,SY))
|
||||
{
|
||||
CreateParticle("Air",
|
||||
SX,SY,
|
||||
Sin(180 - Angle(0,0,iX,iY) + (R),(Amount / 2) + 25),
|
||||
Cos(180 - Angle(0,0,iX,iY) + (R),(Amount / 2) + 25),
|
||||
Sin(180 - iAngle + (R),(Amount / 2) + 25),
|
||||
Cos(180 - iAngle + (R),(Amount / 2) + 25),
|
||||
Max(i + 30, 90) + 75,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var sinspeed = Sin(180 - Angle(0,0,iX,iY) + (R / 2),(Amount) + 15);
|
||||
var cosspeed = Cos(180 - Angle(0,0,iX,iY) + (R / 2),(Amount) + 15);
|
||||
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
|
||||
|
@ -144,9 +144,9 @@ private func FireWeapon(object pClonk,iX,iY)
|
|||
|
||||
for( var obj in FindObjects(
|
||||
Find_Or(
|
||||
Find_Distance(10,Sin(180 - Angle(0,0,iX,iY),20),Cos(180 - Angle(0,0,iX,iY),20)),
|
||||
Find_Distance(18,Sin(180 - Angle(0,0,iX,iY),40),Cos(180 - Angle(0,0,iX,iY),40)),
|
||||
Find_Distance(25,Sin(180 - Angle(0,0,iX,iY),70),Cos(180 - Angle(0,0,iX,iY),70))
|
||||
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("NoWindjarForce")),
|
||||
|
|
|
@ -9,7 +9,6 @@ Vertices=4
|
|||
VertexX=0,-4,4,0
|
||||
VertexY=-4,-3,-3,4
|
||||
VertexFriction=50,100,100,40
|
||||
Picture=10,0,64,64
|
||||
Value=10
|
||||
Mass=20
|
||||
Components=Wood=1;Metal=1;
|
||||
|
|
|
@ -89,8 +89,6 @@ protected func DoSwing(object clonk, int ix, int iy)
|
|||
++iDist;
|
||||
}
|
||||
|
||||
var x = Sin(180-angle,iDist-8);
|
||||
var y = Cos(180-angle,iDist-8);
|
||||
var x2 = Sin(180-angle,iDist);
|
||||
var y2 = Cos(180-angle,iDist);
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
id=Ropebridge_Post
|
||||
Version=5,2,0,1
|
||||
Category=C4D_Structure
|
||||
Picture=20,0,64,64
|
||||
Picture=0,0,96,128
|
||||
Width=12
|
||||
Height=16
|
||||
Offset=-6,-10
|
||||
Vertices=2
|
||||
VertexY=5,5
|
||||
VertexX=-2,2
|
||||
Rotate=0
|
||||
Rotate=0
|
||||
|
|
|
@ -75,10 +75,6 @@ public func MakeBridge(obj1, obj2)
|
|||
func FxIntHangTimer()
|
||||
{
|
||||
TimeStep();
|
||||
var iLeft = objects[0][0]->GetX()-GetX();
|
||||
var iRight = objects[1][0]->GetX()-GetX();
|
||||
var iTop = Min(objects[0][0]->GetY(),objects[1][0]->GetY())-GetY();
|
||||
var iDown = segments[GetLength(segments)/2]->GetY()-GetY();
|
||||
for(var i = 1; i < ParticleCount-1; i++)
|
||||
particles[i][2] = [0,segments[i]->~GetLoadWeight()];
|
||||
}
|
||||
|
@ -138,7 +134,6 @@ func DrawRopeLine2(start, end, i, int index)
|
|||
|
||||
func UpdateLines()
|
||||
{
|
||||
var fTimeStep = 1;
|
||||
var oldangle = Angle(particles[1][0][0], particles[1][0][1], particles[0][0][0], particles[0][0][1]);
|
||||
for(var i=1; i < ParticleCount; i++)
|
||||
{
|
||||
|
|
|
@ -8,4 +8,4 @@ Offset=-3,-7
|
|||
Vertices=2
|
||||
VertexX=0,0
|
||||
VertexY=-5,5
|
||||
Picture=0,0,36,32
|
||||
Picture=0,0,50,80
|
||||
|
|
|
@ -278,7 +278,6 @@ private func RopeRemoved()
|
|||
/* --------------------- Graphics of segments ---------------------- */
|
||||
func UpdateLines()
|
||||
{
|
||||
var fTimeStep = 1;
|
||||
var oldangle;
|
||||
for(var i=1; i < ParticleCount; i++)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,6 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=-3,2,2
|
||||
VertexFriction=40,40,40
|
||||
Picture=0,0,8,8
|
||||
Value=20
|
||||
Mass=7
|
||||
Components=Metal=2;Crystal=2;
|
||||
|
|
|
@ -144,6 +144,7 @@ public func ControlUseHolding(object clonk, ix, iy)
|
|||
CreateParticle("Spark1", Sin(xp, Random(distp)), -Cos(yp, Random(distp)), Sin(xp, 10), -Cos(yp, 10), RandomX(30,90), RGB(185,250,250));
|
||||
}
|
||||
|
||||
var target;
|
||||
if(target_object)
|
||||
{
|
||||
radiusparticle = 30;
|
||||
|
@ -160,7 +161,7 @@ public func ControlUseHolding(object clonk, ix, iy)
|
|||
{
|
||||
radiusparticle = 60;
|
||||
|
||||
var target = FindObject(Find_Exclude(this),
|
||||
target = FindObject(Find_Exclude(this),
|
||||
Find_NoContainer(),
|
||||
Find_Category(C4D_Object),
|
||||
Find_And(Find_Distance(radius, ix, iy),
|
||||
|
|
|
@ -11,6 +11,6 @@ VertexFriction=120,120,120
|
|||
Value=15
|
||||
Mass=8
|
||||
Components=Wood=3
|
||||
Picture=4,0,21,21
|
||||
Picture=12,0,64,64
|
||||
Rotate=1
|
||||
Float=1
|
||||
|
|
|
@ -11,6 +11,5 @@ VertexFriction=120,120,120
|
|||
Value=15
|
||||
Mass=15
|
||||
Components=Wood=5
|
||||
Picture=4,0,21,21
|
||||
Rotate=1
|
||||
Float=1
|
||||
|
|
|
@ -9,7 +9,6 @@ Vertices=2
|
|||
VertexX=0,0
|
||||
VertexY=-7,7
|
||||
VertexFriction=50,50
|
||||
Picture=10,10,54,54
|
||||
Value=10
|
||||
Mass=20
|
||||
Components=Wood=1;Metal=1;
|
||||
|
|
|
@ -194,7 +194,6 @@ func DoStrike(clonk, angle)
|
|||
if(obj->GetOCF() & OCF_Alive)
|
||||
{
|
||||
var damage=5*1000;
|
||||
var f=ApplyShieldFactor(clonk, obj, damage);
|
||||
ApplyWeaponBash(obj, 400, angle);
|
||||
obj->DoEnergy(-damage, true, FX_Call_EngGetPunched, clonk->GetOwner());
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ Category=C4D_Object
|
|||
Width=6
|
||||
Height=6
|
||||
Offset=-3,-3
|
||||
Picture=6,0,16,16
|
||||
Picture=24,0,64,64
|
||||
Vertices=3
|
||||
VertexX=0,3,-3
|
||||
VertexY=-2,2,2
|
||||
|
|
|
@ -9,7 +9,7 @@ Vertices=3
|
|||
VertexX=0,-3,3
|
||||
VertexY=0,1,1
|
||||
VertexFriction=50
|
||||
Picture=8,0,8,8
|
||||
Picture=64,0,64,64
|
||||
Value=10
|
||||
Mass=5
|
||||
Components=Metal=1;Blackpowder=1;
|
||||
|
|
|
@ -317,9 +317,7 @@ func UpdateClonkSellMenus()
|
|||
func OpenSellMenu(object pClonk, int iSelection, bool fNoListUpdate)
|
||||
{
|
||||
// Filled with [idDef, iCount, pObj] arrays
|
||||
var aList = [];
|
||||
var aArray;
|
||||
var pObj;
|
||||
var iIndex;
|
||||
if(!fNoListUpdate)
|
||||
UpdateSellList();
|
||||
|
|
|
@ -44,7 +44,6 @@ public func FxMoveTimer()
|
|||
|
||||
var angle_diff = Normalize(target_angle - angle, -1800, 10);
|
||||
if (angle_diff == 0) angle_diff = 1;
|
||||
var dir = angle_diff / Abs(angle_diff);
|
||||
|
||||
angle = angle + angle_diff * analog_strength / 100 / 8;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue