Compare commits

...

166 Commits

Author SHA1 Message Date
Armin Burgmeier 5dd2d45502 Pre-compute Z values before face ordering (#984)
Pre-computed floating point numbers can be safely used in the comparison
function, whereas recomputation every time the sort function is called might
lead to a crash when the computed number is slightly differently every time,
because the sort function would return different results for the same faces.
2013-12-16 12:44:44 +01:00
Armin Burgmeier fa68227e6e Make sure we never create mesh instances with 0 faces 2013-12-16 12:44:36 +01:00
Günther Brammer 518a1b741a win32: Installer always creates Start Menu entries
Apparently, the Games Explorer is a failed experiment. Players don't expect
a game to only appear there, lots of games do not bother with it, and
future windows versions don't include it.
2013-05-18 00:06:25 +02:00
Günther Brammer c765822fc3 Remove some superflouos output from the dedicated server 2013-05-03 20:45:12 +02:00
Günther Brammer b05aac2a79 The dedicated server command line can now start a scenario
I don't know how useful that is without control over other options, but at
least its something instead of nothing.
2013-05-03 20:45:06 +02:00
Günther Brammer d5d72344ef Make network lobby command line processing available to the editor and dedi
Most of the processing was already done by C4MessageInput::ProcessInput and
C4MessageInput::ProcessCommand. Simply move the Lobby-only commands there,
too, and make them work without a Lobby MainDlg. This required almost only
cosmetic changes.
2013-05-03 20:45:01 +02:00
Günther Brammer acc37860ed Move CStdInProc to its own source file
It should be usable without USE_CONSOLE, even though only the dedicated server
uses it at the moment.
2013-05-03 20:44:55 +02:00
Günther Brammer 21432d997b editor: Fix USE_CONSOLE 2013-05-03 20:44:02 +02:00
Günther Brammer 07f1b75488 win32: Make USE_CONSOLE compile again
There's even a plausible implementation of CStdInProc::GetEvent.
2013-05-03 20:43:55 +02:00
Günther Brammer f9f784a285 Fix some BSD portability issues
Thanks to mdg on the forum and the Debian buildd.
2013-03-16 02:47:21 +01:00
Peter Wortmann b78664b43c Ignore "would block" errors from UDP sendto
Given that SimpleUDP makes no promises on delivering data anyway, it's okay
to just drop packets silently.

While I'm at it, it's probably a good idea for non-Windows system to
set sockets as non-blocking too, as well as C4NetIOUDP to be more
consistent with its handling of errors along these lines.
2013-03-09 13:24:05 +01:00
Peter Wortmann cd5c5fe30c Close connection if a packet can't be sent
I am still completely mystified why this seems to happen so often in
practice. Hopefully the extra logging will give us some clues in
future. And closing the connection immediately gives us a small chance
at recovering from this situation.
2013-03-09 13:23:41 +01:00
Nicolas Hake eabd15469f Win32: Fix build without -fpermissive 2013-03-02 21:46:36 +01:00
Nicolas Hake b73bb9cfaa Win32: optionally embed a build ID into crash dumps/minidump files
In order to get an embedded build ID, add a new CMake cache variable
named OC_BUILD_ID. This variable can contain an arbitrary string, but
it is suggested that you use a hierarchical string starting with your
DNS domain, reversed, as in "com.example.openclonk.arbitrarystring"
(think java packages).
2013-03-02 21:10:31 +01:00
Nicolas Hake f1062fe1a0 Win32: clean up crash handler pointer string format selection 2013-03-02 21:10:30 +01:00
Nicolas Hake 3c937c51a7 Win32: Make crash handler show the full EFLAGS register 2013-03-02 21:10:29 +01:00
Nicolas Hake 1e05480625 Win32: Make crash handler properly show modules in stack traces 2013-03-02 21:10:27 +01:00
Tobias Zwick d314d9d338 disable gamepad controls in the options for stable because they do not work 2013-03-02 18:37:43 +01:00
Tobias Zwick 60cb601618 version 3.3 2013-03-02 16:52:56 +01:00
Günther Brammer cfe2bb1f37 Fix missing mouse cursor in fullscreen without resolution change
The mouse cursor was about the only thing affected by fZoom, and fZoom
should have been always 1 at the moment anyway.
2013-03-02 16:30:06 +01:00
Günther Brammer c481ecde97 gtk: Make the window fullscreen even when not changing the resolution 2013-03-02 16:29:58 +01:00
Günther Brammer 44efec3c22 gtk: GDK_KEY_* constants require at least GTK+ 2.21.8
Conflicts:
	src/mape/diskview.c
2013-03-02 16:28:29 +01:00
Günther Brammer efc77ba125 Fix #including a definition that has local variables with proplists
The missing break meant that the freshly created copy of the proplist would
get overwritten by the original, which was thankfully caught and announced
with "internal error: constant proplist has the wrong parent".

Thanks to Zapper for the testcase.
2013-03-02 16:28:02 +01:00
Günther Brammer 9f3489c053 Script: continue in a do-while loop jumps to test instead of start of loop
This matches C and other languages.
2013-03-02 16:27:51 +01:00
Armin Burgmeier 6c531abbfe Draw particles with subpixel precision 2013-03-02 16:27:39 +01:00
David Dormagen b70d1f7e06 do not pass controls to disabled cursor anymore (i.e. via SetCrewEnabled) 2013-03-02 16:27:31 +01:00
Günther Brammer cfd99b09a4 Make dedicated server compile with fmod 2013-03-02 16:27:20 +01:00
Maikel de Vries 19955fd03d Adapted stone door to open for all players if set team == 0 2013-03-02 16:27:12 +01:00
Günther Brammer ce49a25d20 update: Log an error message when extracting the update program fails 2013-03-02 16:27:04 +01:00
Sven Eberhardt 8602298f0d oops. remove superfluous debug log. 2013-03-02 15:43:02 +01:00
Sven Eberhardt 4ced5be9c4 Fix sound volume when using OpenAL 2013-03-02 15:42:53 +01:00
Sven Eberhardt 59d8ef0bde Fix SIGFPE exception on INT_MIN/-1 and INT_MIN%-1 in C4Script 2013-03-02 15:42:42 +01:00
Günther Brammer 4ff7d3c8c9 Hold a reference to the temporary proplist used in case of script errors
The parser does not know whether the constant proplist it is about to fill
is missing because it was overwritten by a later local/constant, or because
the preparser was interrupted by a script error and didn't store its
proplist. Thus, the parser cannot simply give up at that point, and in
order to keep things simple it creates a throwaway proplist. This proplist
was thrown away too soon, though.

Thanks to Zapper for the testcase.

Conflicts:
	src/script/C4AulParse.cpp
2013-03-02 15:38:11 +01:00
Sven Eberhardt 14f52ac5ce Cleanup main texture map. Remove unused and duplicate entries. Added Earth-earth.
Only one scenario (Arena.ocf\Ruins.ocs) was using any of the duplicate entries.

The missing earth definition caused earth borders to liquid to be rectangular sometimes.
2013-03-02 15:34:58 +01:00
Martin Plicht da27e5aa5b mac: Change type of K_* constants from int to C4KeyCode (int <-> long discrepancy) 2013-03-02 15:27:33 +01:00
Tobias Zwick b1e323b49b comment out assertion on cleaning up script engine after a round
see http://forum.openclonk.org/topic_show.pl?pid=22432#pid22432
2013-03-02 15:09:54 +01:00
Oliver Schneider c38cd59a28 Fixed a typo in Tutorial01 2013-02-04 23:51:06 +01:00
Sven Eberhardt d3634334a2 fix typo in catapult script 2013-02-04 23:36:39 +01:00
Sven Eberhardt 4864b2252f Fix SolidMasks not moving objects if the top left of the landscape was solid
A missing fixed conversion let the shape check happen at or around position 1/1 instead of at the actual object position.

Also removed a redundant contact check.
2013-02-04 23:34:12 +01:00
Sven Eberhardt 57b8e5c17d fix material conversion on insertion into converting liquid 2013-02-04 23:34:11 +01:00
Sven Eberhardt 30a7348ce6 Fix snow melting in lava/durolava 2013-02-04 23:34:10 +01:00
Sven Eberhardt 0b6126c384 Fix C4Command::Jump, i.e. jumping as part of pathfinder. 2013-02-04 23:34:09 +01:00
Sven Eberhardt 486d6a33be Attached objects with SolidMask (slave elevator case) can carry objects 2013-02-04 23:34:08 +01:00
Nicolas Hake faf0303dd4 Fix incorrect reloading of animations (#837)
Animation nodes accidentally did not have the correct
animation parent set when they were deserialized.

Closes #837, #872, #916.
2013-02-04 23:06:18 +01:00
Sven Eberhardt 28fd57fbed Fix Call() in global context (required for ScheduleCall) 2013-02-04 23:06:05 +01:00
Nicolas Hake d0acabd816 Abort SimFlight if no more movement can occur (#914)
In no-gravity situations, SimFlight would enter an endless
loop when trying to project an unmoving object, waiting for
a collision that would never happen.

Similarly, in negative gravity, SimFlight would continue
calculating objects that left the top boundary of the land-
scape, only aborting the simulation once the coordinates
underflowed to values below the landscape.
2013-02-04 23:05:49 +01:00
Armin Burgmeier 043a1c6966 map creator: don't crash when using a template within itself (#534) 2013-02-04 23:03:49 +01:00
Martin Plicht ca1c4538ee StdStrBuf::AppendFormatV: Pass copied va_list to vsnprintf so the second iteration of the while loop does not crash 2013-02-04 23:03:35 +01:00
Nicolas Hake a202001564 c4group: Fix incorrect swprintf usage 2013-02-04 23:03:21 +01:00
Günther Brammer ce164830a7 Use _snwprintf instead of swprintf
Apparently the C standard committee and Microsoft couldn't agree on how
swprintf should work.
We previously tried to work around the resulting breakage, but I just got
the following compilation error. It's really better to avoid that function
entirely. Since we only used it in windows-specific code, the
windows-specific _snwprintf is a nicely compiler-independent replacement.

src/platform/PlatformAbstraction.h: In function ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’:
src/platform/PlatformAbstraction.h:243:12: error: redefinition of ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/swprintf.inl:30:5: error: ‘int swprintf(wchar_t*, size_t, const wchar_t*, ...)’ previously defined here
2013-02-04 23:02:45 +01:00
Günther Brammer 77480b08da Don't crash on Call() 2013-02-04 23:02:14 +01:00
Günther Brammer 1472824d70 Make StdSync.h compile with neither windows nor pthreads again 2013-02-04 23:02:13 +01:00
Nicolas Hake a3721c64e1 Win32: Mark OC "DPI aware" (#891)
Technically this mark is incorrect; we do not handle things differently
on high DPI settings. On the other hand, marking OC DPI aware means that
Windows won't try to scale our drawing, clipping menus and rendering in
the process.

Somewhere in the future, OpenClonk should also add proper DPI awareness
and change the default zoom and menu scaling to match.
2013-02-04 22:58:17 +01:00
Nicolas Hake f53cdfb286 Producers: consume required material (#885)
Instead of just checking whether the material is available, also
consume it.

I'm not quite certain whether we should return the removed material
along with the amount removed (to match the return value of the barrel's
GetLiquid), but since the bucket is not currently accepting wildcards
I don't think it's necessary.
2013-02-04 22:57:35 +01:00
Nicolas Hake df4275ed0f Fix walking animation with xdir=0 (#887)
When trying to get the sign of the horizontal velocity, a calculation
erroneously assumed that it could never be 0. When it did, a #DE was
raised. This changeset replaces the calculation with the Sign() function
from Math.c, which handles a zero argument correctly.
2013-02-04 22:57:24 +01:00
Julius Michaelis 920b69ee03 Fix error condition in cmake's git_get_changeset_id 2013-02-04 22:56:23 +01:00
Armin Burgmeier 52a0ab8d05 Fix xrandr version check for gamma ramp modification
SaveDefaultGammaRamp: Don't crash if primary output is not connected

Instead, use the first connected output from the list of all outputs.
This happens on my computer, probably because the desktop environment
does not set the correct primary output.

SaveDefaultGammaRamp: Return true if everything worked correctly
2013-02-04 22:55:02 +01:00
Armin Burgmeier bf6e701ad7 Initialize all variables in C4X11AppImpl 2013-02-04 22:54:07 +01:00
Günther Brammer 3c83efe426 X11: Remove support for the xf86vidmode extension
In practice, only the xrandr code path received any testing. Since Clonk
works fine without changing the resolution, this will not terribly
inconvenience anybody still stuck on old systems without xrandr.

Also only minimize the window when the resolution was changed.
The minimization is there to prevent accidental focus restoration
resulting in unwanted resolution switching.
2013-02-04 22:52:39 +01:00
Nicolas Hake 66c3c41d5d FindUpnp: Look for threadutil lib too
In case we're linking statically, libthreadutil needs to be linked
in when libupnp gets linked, or else undefined references will ensue.
2013-02-04 22:31:45 +01:00
Günther Brammer fda45b1b29 Prevent git from changing line endings in the game data
These files need to be the same everywhere to allow the network code to
check that they are in fact the same.
2013-02-04 22:24:40 +01:00
Nicolas Hake 6344a2ea87 Prepare build for Git repository
This includes fetching the build revision from git instead of hg
and adding a file to store the revision hash in archives.
2013-02-04 22:24:16 +01:00
Günther Brammer 48ae8d2eef autotools: Sync with CMakeLists.txt 2013-01-28 22:38:14 +01:00
Günther Brammer d72b0ac4b0 autotools: Exclude C4UpdateDlg.cpp from build when autoupdates are disabled 2012-11-24 18:42:43 +01:00
Nicolas Hake e2f18d8b16 Added tag release-5.3.2 for changeset a3e9cf2b0d46 2012-11-18 13:19:25 +01:00
Nicolas Hake 7a13be20e8 Don't assume char to be unsigned when generating packet header
OR'ing an enum value and a char with its highest bit set sign-extends the char.
On compilers with signed chars, this means you end up with a negative integer,
which can't be narrowed to uint8_t at initialization (which is what PacketHdr's
first member is).
2012-11-17 22:53:56 +01:00
Sven Eberhardt ed971eba46 Fix sync loss and missing landscape or objects when joining two consecutive games without restarting the engine inbetween
Caused by an outdated cache of the DirectoryIterator in the main scenario group
2012-11-17 19:44:04 +01:00
Peter Wortmann 4a3a6e5260 Use uint8_t consistently for UDP status packet byte
Thanks to pkern for spotting this.
2012-11-17 17:40:00 +00:00
Sven Eberhardt 18839efc23 Fix elevator case to properly carry lorries (#844) 2012-11-10 17:46:38 +01:00
David Dormagen 2a0365ef26 the elevator forcefully takes pushable objects with it now until the SolidMask bug is fixed 2012-11-10 13:31:21 +01:00
Maikel de Vries d53fadfbeb Added dummy object to fix script error 2012-11-15 22:07:21 +01:00
Charles Spurrill 34bf221354 Nicer smoke for chemlab 2012-11-11 16:51:22 -08:00
Charles Spurrill f6b3790fed Airship: modules delete themselves when airship is removed 2012-11-12 18:09:58 -08:00
David Dormagen 08246163b7 fixed possible zero pointer error 2012-11-12 18:58:39 +01:00
Sven Eberhardt 2ee7f54d2a ScorchedGardens Scenario.txt title fix 2012-11-10 14:24:06 +01:00
David Dormagen 3d3cd1866b elevator now catches fire when case is destroyed (#822) 2012-11-10 13:06:26 +01:00
Charles Spurrill 275629bac5 Added untextured Inventor's Lab 3D graphics (uv-map ready to paint) 2012-11-07 23:04:41 -08:00
Maikel de Vries 71043f39de Correctly direct player from tutorial 4 to 5 2012-11-07 18:39:33 +01:00
Charles Spurrill fca93c0b11 updated StartupScenSelIcons.png again 2012-11-06 19:40:27 -08:00
Charles Spurrill 1e9af1577f Updated shovel graphics 2012-11-06 18:59:45 -08:00
Charles Spurrill ea1de6bf28 Tutorial 4 leads to Tutorial 5 on completion, as per the others 2012-11-06 16:38:12 -08:00
Charles Spurrill 8a2ac6091b Waterfall actually uses the mat defined in the CreateWaterfall function 2012-11-06 16:37:19 -08:00
Charles Spurrill 974073b728 Allow PlaceGrass function to limit vertical area of grass placement 2012-11-04 22:48:46 -08:00
Maikel de Vries b92b83a01f Removed cannon debug message 2012-11-04 16:01:46 +01:00
Maikel de Vries 151f275618 Never do this again
This really is the last warning, after this I'll just revert!
2012-11-04 15:03:41 +01:00
Maikel de Vries 3529769011 Fixed a c4script runtime error in tutorial 3 2012-11-04 14:03:36 +01:00
Maikel de Vries ff47339e80 Objects: Added a waterfall and drain 2012-11-03 22:07:14 +01:00
Maikel de Vries 9c73e68871 Fixed time of day in tutorial 4 2012-10-31 18:43:16 +01:00
Charles Spurrill 8e90011bca Tweaked shield animation 2012-11-10 16:45:05 -08:00
Tobias Zwick c8b4c52d7e fix hide stars and moon during day 2012-10-30 22:01:57 +01:00
Tobias Zwick 374f398ad4 dont draw stars and moon at all during the day, only fade all celestial objects and cloud on dawn and dusk (performance optimization) 2012-10-30 00:48:50 +01:00
Tobias Zwick d2bd18b7d8 made the night sky more beautiful with stars 2012-10-30 00:10:00 +01:00
Tobias Zwick 0d37166baf adapt cycle speed to new meaning 2012-10-30 00:08:01 +01:00
Tobias Zwick dc25e52c9c make day->night->day fading smoother,
add sunset/dawn fade in between,
clouds don't turn invisible in the night
2012-10-28 18:48:02 +01:00
Sven Eberhardt c9afadbe00 Fix sequence combo key assignments so they don't break when mouse movment is assigned to a control 2012-10-28 17:47:02 +01:00
Sven Eberhardt 8e086e7ce7 Editor: Fix handling of erronous map indices by material picker 2012-10-28 15:23:45 +01:00
Armin Burgmeier f19caa12f1 Use floating point numbers for C4Facet coordinates
This fixes the lightbulb symbol from floundering around back and forth when
zoomed in and scrolling. Since C4Facets can be used to specify a target area
to draw into (such as in C4DefGraphics::Draw), and since this area can be
zoomed, sub-pixel precision can be achieved this way in such drawing
operations.
2012-10-28 15:33:58 +01:00
Tobias Zwick d0cf12192a make sky background in gold rush parallax 2012-10-28 18:16:22 +01:00
Tobias Zwick c784efa2b5 update credits 2012-10-18 21:57:33 +02:00
Charles Spurrill ef72fb651d new uv for coniferous tree 2012-10-23 21:18:22 -07:00
Andriel 64202e2aef Improved chemlab's graphics 2012-11-08 19:33:24 -08:00
Charles Spurrill 1ffc6c5318 Nicer wood graphics 2012-11-10 20:00:18 -08:00
Charles Spurrill 4843b6bfdc Shipyard texture 2012-11-13 20:18:46 -08:00
Charles Spurrill 34288e6c63 Temporary fix for "826: Can't dig out of sand if you're trapped in it" 2012-11-11 01:03:27 -08:00
Charles Spurrill f95cf01016 Balloon: fixed "jump" when deploying 2012-11-11 18:49:06 -08:00
Charles Spurrill 43beaca4ba #374 Missing graphics: Scoreboard of Parkour and LastManStanding - Finished 2012-11-11 16:08:48 -08:00
Charles Spurrill 6d20c9b053 Fix sword rotation on clonk's back 2012-11-11 11:39:08 -08:00
Charles Spurrill 88251bd737 Pickaxe: Only hold the pickaxe in hand when swinging 2012-11-11 11:17:14 -08:00
Charles Spurrill e42161b8a7 Fixed shield clipping through clonk's backpack 2012-11-11 11:15:01 -08:00
Charles Spurrill 7f28ead26d Fixed rotation offset of secondary tool when using shield in primary hand 2012-11-11 10:56:37 -08:00
Maikel de Vries e922a1cf5d Remove debug log from airship 2012-11-04 15:14:03 +01:00
Charles Spurrill 9ffe48b335 Clonk.skeleton: Accidentally exported at the wrong animation rate 2012-11-05 00:02:38 -08:00
Charles Spurrill cd23eb17e9 Clonk.skeleton: Fixed bow aim animation being incorrectly rotated 180° 2012-11-04 21:06:21 -08:00
Charles Spurrill 49af589f6a Clonk: All skins share Clonk.ocd directory and Clonk.skeleton. Nicer looking pickaxe animation. 2012-11-01 01:20:26 -07:00
Charles Spurrill 8d3ae71290 Fixed Boompack components - 1 PowderKeg, 1 Sulphur 2012-10-30 23:00:17 -07:00
Charles Spurrill 229a9c59fb #858: Palm trees no longer drop coconuts after being chopped down 2012-11-05 18:09:21 -08:00
Charles Spurrill af644f6965 Fixed shield acting as though it was always pointing up. 2012-11-10 15:56:37 -08:00
Günther Brammer 1ccc75f5eb Do not clip parallax objects (fix disappearing moon, #575) 2012-10-30 22:18:27 +01:00
Günther Brammer 0e80440c29 Move the elevator case behind airships
Mostly so that moves them, and so that the airship doesn't appear to be
between the elevator and the elevator case. To prevent other objects from
doing that in the future, move the elevator itself to just behind the
elevator case.
2012-11-10 18:41:11 +01:00
David Dormagen 85d720f88e removing and adding Rule_NoPowerNeed while consumers are active has now the expected behavior (#828) 2012-11-10 14:19:59 +01:00
David Dormagen f509d052e3 rewritten elevator case to be less hacky and adjusted its power-consumption-behavior 2012-11-03 16:17:30 +01:00
David Dormagen b985dcc931 fix attachment position of the CTF-flag (fixes not being able to score points in CTF) 2012-10-28 22:43:31 +01:00
David Dormagen fcba3e9a0e fixed the shield always force-turning the Clonk 2012-11-05 21:30:34 +01:00
Peter Wortmann 4dfa3f9309 Reset default material zoom level to 4
Due to popular demand
2012-11-07 22:14:07 +00:00
Peter Wortmann 114bfb6365 Fixed CompileFunc entry for MaterialZoom
oops.
2012-11-05 19:16:33 +00:00
Peter Wortmann 75a404090d Officially make BROKEN_ARRAYS_WORKAROUND the default
Pretty awkward compromise, but the array version seems to confuse a lot of
drivers, without causing an actual error. So this is probably better in
practice until better drivers are more common.
2012-11-05 16:57:33 +00:00
Peter Wortmann 8dcf8d1552 Made material zoom configurable
Also set default to 8. This might be a pretty controversial change, but
the amounts of screenshots we have at zoom levels beyond 4 just calls for
a more high-res approach.
2012-11-05 17:17:12 +00:00
Maikel de Vries b3fb126124 Fixed Hideout doors again 2012-11-01 21:49:53 +01:00
Maikel de Vries 4b31ac8a72 Fixed production menus: show knowledge of accessor (#850) 2012-10-30 21:15:51 +01:00
Maikel de Vries aace5eb55a Fixed volcano lava chunks 2012-10-30 21:01:04 +01:00
Tobias Zwick 210f798913 fix tree chopping 2012-10-28 14:18:12 +01:00
Armin Burgmeier 5daf87bed0 Drop all but first texture coordinate set from mesh files
The second set is not used in any mesh, and it is not implemented engine-wise
anyway. This gets rid of the FIXMEs message when a mesh with more than one
texture coordinate set is being loaded.
2012-10-28 12:18:18 +01:00
Charles Spurrill d9498a022b Fixed flag markers not fading out 2012-10-27 22:05:23 -07:00
Charles Spurrill 881816a3ca Fixed wooden cabin collecting objects dropped from a contained clonk 2012-10-27 21:27:11 -07:00
Tobias Zwick 0e823cb38d fix possible problems with several monitors on windows 2012-10-28 02:35:29 +02:00
Tobias Zwick 7ee8a3eda4 fix odd cursor jumping on mousewheel use on windows (#439) 2012-10-28 02:11:03 +02:00
Charles Spurrill 3ba7c3477f Fixed carry heavies attaching at wrong point whilst scaling/hangling etc. 2012-10-27 13:07:32 -07:00
Tobias Zwick 67e11130cd rule fade out idle objects: only remove unstuck objects (#773/#841) 2012-10-27 20:21:54 +02:00
Tobias Zwick 3747393b49 make script function GetMaterialVal work as documented in the reference 2012-10-27 19:35:25 +02:00
Tobias Zwick 299a53eb86 icon button text shall not overlap with icon image (#767) 2012-10-27 18:55:21 +02:00
Charles Spurrill f42a2933dc Collision vertex cleanup for axe, pickaxe, and sickle 2012-10-27 09:39:02 -07:00
David Dormagen b694edd92d Clonks do not collect stuff when inside a container (f.e. a respawn-helper-object) 2012-10-27 16:34:19 +02:00
Tobias Zwick 0fb880d7aa fix #436: throw objects into walls 2012-10-22 00:11:24 +02:00
David Dormagen 41e56f6a01 re-added Place() function for sprout berry bushes again, it never inherited from Library_Plant and uses a bit more sophisticated placement that is in sync with some of its behavior 2012-10-25 21:02:21 +02:00
David Dormagen b830d15280 fixed the pump's irritating power consumption 2012-10-25 20:14:13 +02:00
David Dormagen dfc942a08e power system's light bulbs are now in front of game-objects (f.e. trees) 2012-10-24 22:21:24 +02:00
David Dormagen b710623186 burning objects do not incinerate in or into containers anymore; adjusted fire spreading a bit 2012-10-24 00:42:05 +02:00
David Dormagen 9ca16d2965 fixed sproutberry harvesting 2012-10-24 00:41:15 +02:00
David Dormagen acb9e7aaa9 weakened the stone doors in FrozenFortress to standard maxdamage (300 -> 180 = ~9 flints) 2012-10-23 23:35:11 +02:00
David Dormagen d69bb6b378 removed some completely arbitrary MaxPlayer entries 2012-10-23 23:28:18 +02:00
Russell 1d9d8002a3 Clonk. Now with 65% better grammar. 2012-10-22 18:35:06 +01:00
Maikel de Vries 1d1ad7252e Fixed gravestone c&p failure 2012-10-22 20:51:46 +02:00
Maikel de Vries 930505ee0d Fixed a few C4Script runtime errors 2012-10-22 20:24:57 +02:00
Maikel de Vries be410432a8 Fixed gravestone rule and added it to the arenas 2012-10-22 20:05:23 +02:00
Charles Spurrill 5663bd2c4d #809 Coal is more visible in menus 2012-10-16 21:36:27 -07:00
Maikel de Vries 1af30d25ff Hideout: fixed stuck stone doors 2012-10-21 23:14:37 +02:00
Tobias Zwick 1cbca0b0a4 fix #821: Can't release lorry 2012-10-21 21:49:37 +02:00
Maikel de Vries b94fd27a09 Removed debug log in construction site 2012-10-21 12:54:19 +02:00
Philipp Kern 0a3098a496 Fix format string use
C4Aul's Warn uses the format attribute to check for format string correctness.
Passing a dynamic string buffer from FormatString to it will break the build
with -Werror=format-string. Given that Warn already does the formatting itself,
just drop the use of FormatString
(transplanted from 95d5a2fecb11e642d14ccbedda35040e53b643ba)
2012-10-21 11:21:49 +02:00
Tobias Zwick 95a5afe82f clonk can drop items in the water, similarly to how it worked in CR 2012-10-20 19:32:16 +02:00
Tobias Zwick 84cd06ce3c remove description from goal in the game over dialog 2012-10-20 18:07:43 +02:00
Maikel de Vries 70b63f6765 Reduce rain in Goldrush
Oh and yes Ringwall don't mess up the clean scripts I wrote and read the code style guidelines
2012-10-20 13:54:00 +02:00
Tobias Zwick 17a17c0df9 fix update system - can now update from 3.0 to 3.1 2012-10-18 23:30:12 +02:00
Maikel de Vries f4368d7bff Fixed c4script runtime error in Scorched Gardens 2012-10-18 22:55:01 +02:00
Maikel de Vries f4c3e5f0ea Fixed Scorched Garden weapon list message 2012-10-18 22:34:01 +02:00
Armin Burgmeier 161cea8f9e Post-release bump to 5.3.2
in stable branch
2012-10-17 21:40:20 +02:00
358 changed files with 2967 additions and 2023 deletions

1
.git_archival 100644
View File

@ -0,0 +1 @@
node: $Format:%H$

3
.gitattributes vendored 100644
View File

@ -0,0 +1,3 @@
.git_archival export-subst
.gitattributes export-ignore
.gitignore export-ignore

View File

@ -1,5 +1,3 @@
syntax: glob
autom4te.cache
*~
*.bak

3
.hgeol
View File

@ -1,3 +0,0 @@
[patterns]
planet/** = LF
** = native

View File

@ -488,7 +488,6 @@ set(OC_CLONK_SOURCES
src/object/C4Shape.h
src/platform/C4App.cpp
src/platform/C4App.h
src/platform/C4AppT.cpp
src/platform/C4AppWin32Impl.h
src/platform/C4FileMonitor.cpp
src/platform/C4FileMonitor.h
@ -502,6 +501,8 @@ set(OC_CLONK_SOURCES
src/platform/C4SoundLoaders.h
src/platform/C4SoundSystem.cpp
src/platform/C4SoundSystem.h
src/platform/C4StdInProc.cpp
src/platform/C4StdInProc.h
src/platform/C4Video.cpp
src/platform/C4Video.h
src/platform/C4Window.h
@ -633,6 +634,10 @@ elseif(USE_SDL_MAINLOOP)
src/platform/C4AppSDL.cpp
src/platform/C4WindowSDL.cpp
)
elseif(USE_CONSOLE)
list(APPEND OC_SYSTEM_SOURCES
src/platform/C4AppT.cpp
)
elseif(WIN32)
list(APPEND OC_SYSTEM_SOURCES
src/editor/C4ConsoleWin32.cpp
@ -734,10 +739,8 @@ CHECK_INCLUDE_FILE_CXX(natupnp.h HAVE_NATUPNP_H)
# 'Bool' and 'Window' to be defined. Unfortunately, this doesn't exist
# as a CXX version (yet?).
include(CheckIncludeFiles)
CHECK_INCLUDE_FILES(X11/Xlib.h X11/extensions/xf86vmode.h HAVE_X11_EXTENSIONS_XF86VMODE_H)
CHECK_INCLUDE_FILES(X11/Xlib.h X11/extensions/Xrandr.h HAVE_X11_EXTENSIONS_XRANDR_H)
CHECK_INCLUDE_FILES(X11/Xlib.h X11/keysym.h HAVE_X11_KEYSYM_H)
CHECK_INCLUDE_FILES(X11/Xlib.h X11/xpm.h HAVE_X11_XPM_H)
CHECK_INCLUDE_FILE_CXX(iconv.h HAVE_ICONV)
if(HAVE_ICONV)
@ -1234,13 +1237,9 @@ if(USE_GTK)
endif()
if(USE_X11)
FINDLIB(X11_LIBRARIES X11)
FINDLIB(XPM_LIBRARIES Xpm)
FINDLIB(XXF86VM_LIBRARIES Xxf86vm)
FINDLIB(XRANDR_LIBRARIES Xrandr)
target_link_libraries(clonk
${X11_LIBRARIES}
${XPM_LIBRARIES}
${XXF86VM_LIBRARIES}
${XRANDR_LIBRARIES}
)
endif()

View File

@ -22,4 +22,4 @@ David Dormagen (Zapper)
Tobias Zwick (Newton)
<Thanks to Contributors>
Benjamin Herr (Loriel), Matthias Rottländer (Matthi), Felix Riese (Fungiform), Manuel Riecke (MrBeast), Benedict Etzel (B_E), Carl-Philip Hänsch (Carli), Alexander Semeniuk (AlteredARMOR), Florian Graier (Nachtfalter), ST-DDT, Asmageddon, Merten Ehmig (Pluto), Mark Haßelbusch (Marky), Luchs, Peewee, Lauri Niskanen (Ape), Dominik Bayerl (Kanibal), Faby, Checkmaty, Gurkenglas, Clonkine, mizipzor, mixi, RedWolf Design GmbH and all those who contributed to previous Clonk titles for the passion they put into the game and for agreeing to make Clonk open source.
Benjamin Herr (Loriel), Matthias Rottländer (Matthi), Felix Riese (Fungiform), Manuel Riecke (MrBeast), Benedict Etzel (B_E), Carl-Philip Hänsch (Carli), Alexander Semeniuk (AlteredARMOR), Florian Graier (Nachtfalter), Daniel Theuke (ST-DDT), Asmageddon, Merten Ehmig (Pluto), Mark Haßelbusch (Marky), Luchs, Peewee, Lauri Niskanen (Ape), Dominik Bayerl (Kanibal), Faby, Checkmaty, Gurkenglas, Clonkine, mizipzor, mixi, Pyrit, grgecko, Koronis, RedWolf Design GmbH and all those who contributed to previous Clonk titles for the passion they put into the game and for agreeing to make Clonk open source.

View File

@ -76,7 +76,8 @@ do_subst = sed -e 's,[@]C4PROJECT[@],'"$$(sed -n 's/SET(C4PROJECT\s\+"\(.\+\)")/
-e 's,[@]C4XVER3[@],'"$$(sed -n 's/SET(C4XVER3\s\+\(.\+\))/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4XVER4[@],'"$$(sed -n 's/SET(C4XVER4\s\+\(.\+\))/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4VERSIONBUILDNAME[@],'"$$(sed -n 's/SET(C4VERSIONBUILDNAME\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4VERSIONEXTRA[@],'"$$(sed -n 's/SET(C4VERSIONEXTRA\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g'
-e 's,[@]C4VERSIONEXTRA[@],'"$$(sed -n 's/SET(C4VERSIONEXTRA\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]OC_BUILD_ID[@],,g'
C4Version.h: $(srcdir)/src/C4Version.h.in $(srcdir)/Version.txt
$(do_subst) < $< > $@
@ -203,7 +204,6 @@ src/game/C4GraphicsSystem.h \
src/game/C4Physics.h \
src/game/C4Viewport.cpp \
src/game/C4Viewport.h \
src/game/ClonkMain.cpp \
src/gamescript/C4Effect.cpp \
src/gamescript/C4Effects.h \
src/gamescript/C4FindObject.cpp \
@ -304,8 +304,6 @@ src/gui/C4StartupPlrSelDlg.cpp \
src/gui/C4StartupPlrSelDlg.h \
src/gui/C4StartupScenSelDlg.cpp \
src/gui/C4StartupScenSelDlg.h \
src/gui/C4UpdateDlg.cpp \
src/gui/C4UpdateDlg.h \
src/gui/C4UpperBoard.cpp \
src/gui/C4UpperBoard.h \
src/landscape/C4Landscape.cpp \
@ -452,7 +450,6 @@ src/object/C4Shape.cpp \
src/object/C4Shape.h \
src/platform/C4App.cpp \
src/platform/C4App.h \
src/platform/C4AppT.cpp \
src/platform/C4AppWin32Impl.h \
src/platform/C4FileMonitor.cpp \
src/platform/C4FileMonitor.h \
@ -466,6 +463,8 @@ src/platform/C4SoundLoaders.cpp \
src/platform/C4SoundLoaders.h \
src/platform/C4SoundSystem.cpp \
src/platform/C4SoundSystem.h \
src/platform/C4StdInProc.cpp \
src/platform/C4StdInProc.h \
src/platform/C4Video.cpp \
src/platform/C4Video.h \
src/platform/C4Window.h \
@ -537,6 +536,16 @@ src/res/engine.rc \
src/res/resource.h
endif
if MACOSX
clonk_SOURCES += \
src/platform/C4AppDelegate.h \
src/platform/C4AppDelegate.mm \
src/platform/C4FileMonitorMac.mm
else
clonk_SOURCES += \
src/game/ClonkMain.cpp
endif
if SDL_MAIN_LOOP
clonk_SOURCES += \
src/platform/C4AppSDL.cpp \
@ -551,6 +560,10 @@ src/platform/C4AppGTK.cpp \
src/platform/C4AppGTKImpl.h \
src/platform/C4WindowGTK.cpp
else
if CONSOLE
clonk_SOURCES += \
src/platform/C4AppT.cpp
else
if WIN32
clonk_SOURCES += \
src/editor/C4ConsoleWin32.cpp \
@ -561,23 +574,28 @@ endif
if MACOSX
clonk_SOURCES += \
src/editor/C4ConsoleCocoa.mm \
src/editor/C4EditorWindowController.h \
src/editor/C4EditorWindowController.mm \
src/graphics/C4DrawGLMac.h \
src/graphics/C4DrawGLMac.mm \
src/platform/C4AppDelegate+MainMenuActions.h \
src/platform/C4AppDelegate+MainMenuActions.mm \
src/platform/C4AppMac.mm \
src/platform/C4FileMonitorMac.mm \
src/platform/C4WindowController.h \
src/platform/C4WindowController.mm \
src/platform/C4WindowMac.mm \
src/platform/ClonkAppDelegate.h \
src/platform/ClonkAppDelegate.mm \
src/platform/ConsoleWindowController.h \
src/platform/ConsoleWindowController.mm \
src/platform/ClonkWindowController.h \
src/platform/ClonkWindowController.mm \
src/platform/ClonkOpenGLView.h \
src/platform/ClonkOpenGLView.mm \
src/platform/CocoaKeycodeMap.h \
src/platform/ClonkMainMenuActions.h \
src/platform/ClonkMainMenuActions.mm
src/platform/ObjectiveCAssociated.h
endif
endif
endif
endif
if AUTOUPDATE
clonk_SOURCES += \
src/gui/C4UpdateDlg.cpp \
src/gui/C4UpdateDlg.h
endif
if LIBUPNP
clonk_SOURCES += src/network/C4Network2UPnPLinux.cpp
@ -718,7 +736,9 @@ c4groups = \
Sound.ocg \
System.ocg \
Objects.ocd \
BackToTheRocks.ocf \
Arena.ocf \
Parkour.ocf \
Settlement.ocf \
Tutorial.ocf
CLEANFILES += $(c4groups)

View File

@ -13,8 +13,8 @@ SET(C4ENGINEID "${C4PROJECT_TLD}.${C4PROJECT_DOMAIN}.${C4ENGINENICK}")
SET(C4XVER1 5)
SET(C4XVER2 3)
SET(C4XVER3 1)
SET(C4XVER4 23)
SET(C4XVER3 3)
SET(C4XVER4 25)
# C4VERSIONBUILDNAME should be witty and somewhat frequently changing
# for alpha and beta releases, and meaningful and stable for stable releases.
@ -23,22 +23,10 @@ SET(C4VERSIONBUILDNAME " Beyond the Rocks")
SET(C4VERSIONEXTRA " Delta")
############################################################################
# Get revision from Mercurial
# Get revision from Git
############################################################################
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg_archival.txt")
# Archives generated by hg archive
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/.hg_archival.txt" C4REVISION
LIMIT_COUNT 1
REGEX "node: [0-9a-f]+"
)
string(SUBSTRING "${C4REVISION}" 6 12 C4REVISION)
else()
# Working copies
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND "hg" "id" "--id"
OUTPUT_VARIABLE C4REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
include(GitGetChangesetID)
git_get_changeset_id(C4REVISION)
############################################################################
# Get year

View File

@ -24,15 +24,17 @@
find_path(UPNP_INCLUDE_DIR NAMES upnp.h PATH_SUFFIXES upnp)
set(UPNP_NAMES ${UPNP_NAMES} upnp)
set(THREADUTIL_NAMES ${THREADUTIL_NAMES} threadutil)
set(IXML_NAMES ${IXML_NAMES} ixml)
find_library(UPNP_LIBRARY NAMES ${UPNP_NAMES})
find_library(THREADUTIL_LIBRARY NAMES ${THREADUTIL_NAMES})
find_library(IXML_LIBRARY NAMES ${IXML_NAMES})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UPNP DEFAULT_MSG UPNP_LIBRARY IXML_LIBRARY UPNP_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UPNP DEFAULT_MSG UPNP_LIBRARY THREADUTIL_LIBRARY IXML_LIBRARY UPNP_INCLUDE_DIR)
if(UPNP_FOUND)
set(UPNP_LIBRARIES ${UPNP_LIBRARY} ${IXML_LIBRARY})
set(UPNP_LIBRARIES ${UPNP_LIBRARY} ${THREADUTIL_LIBRARY} ${IXML_LIBRARY})
set(UPNP_INCLUDE_DIR ${UPNP_INCLUDE_DIR})
endif()

View File

@ -0,0 +1,39 @@
function(git_get_changeset_id VAR)
find_package(Git QUIET)
if (GIT_FOUND)
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "rev-parse" "HEAD"
RESULT_VARIABLE GIT_RESULT
OUTPUT_VARIABLE C4REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(GIT_RESULT EQUAL 0)
string(SUBSTRING "${C4REVISION}" 0 12 C4REVISION)
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "status" "--porcelain"
OUTPUT_VARIABLE GIT_STATUS
)
string(REGEX MATCH "^[MADRC ][MD ]" WORKDIR_DIRTY "${GIT_STATUS}")
endif()
endif()
if (NOT C4REVISION)
# Git not found or not a git workdir
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/.git_archival" C4REVISION
LIMIT_COUNT 1
REGEX "node: [0-9a-f]+"
)
string(LENGTH "${C4REVISION}" revlength)
if(revlength LESS 18)
set(C4REVISION "unknown")
message(WARNING "Could not retrieve git revision. Please set GIT_EXECUTABLE!")
else()
string(SUBSTRING "${C4REVISION}" 6 12 C4REVISION)
endif()
unset(revlength)
endif()
if(WORKDIR_DIRTY)
set(C4REVISION "${C4REVISION}+")
endif()
set(${VAR} "${C4REVISION}" PARENT_SCOPE)
endfunction()

View File

@ -111,18 +111,12 @@
#cmakedefine HAVE_VFW32
/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
#cmakedefine HAVE_X11_EXTENSIONS_XF86VMODE_H 1
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
#cmakedefine HAVE_X11_EXTENSIONS_XRANDR_H 1
/* Define to 1 if you have the <X11/keysym.h> header file. */
#cmakedefine HAVE_X11_KEYSYM_H 1
/* Define to 1 if you have the <X11/xpm.h> header file. */
#cmakedefine HAVE_X11_XPM_H 1
/* Define as const if the declaration of iconv() needs const. */
#cmakedefine ICONV_CONST

View File

@ -120,18 +120,12 @@
/* */
#undef HAVE_VFW32
/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
#undef HAVE_X11_EXTENSIONS_XF86VMODE_H
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
#undef HAVE_X11_EXTENSIONS_XRANDR_H
/* Define to 1 if you have the <X11/keysym.h> header file. */
#undef HAVE_X11_KEYSYM_H
/* Define to 1 if you have the <X11/xpm.h> header file. */
#undef HAVE_X11_XPM_H
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST

View File

@ -147,7 +147,7 @@ AC_ARG_WITH([openal],
[AS_HELP_STRING([--with-openal],[compile with openal support [default=no]])],
, [with_openal=no])
if test $with_openal = yes; then
PKG_CHECK_MODULES(OPENAL, [vorbis vorbisfile openal])
PKG_CHECK_MODULES(OPENAL, [vorbis vorbisfile openal freealut])
AC_DEFINE([USE_OPEN_AL], 1, [OpenAL sound])
if test $enable_sound = no; then
AC_MSG_ERROR([--with-openal cannot be used with --disable-sound.])
@ -208,6 +208,7 @@ else
enable_sdlmainloop=no
VL_LIB_READLINE
fi
AM_CONDITIONAL([CONSOLE], [test $enable_console = yes])
# Check for boost
AX_BOOST_BASE([1.40.0], [], [
@ -256,19 +257,15 @@ if test $enable_console = no; then
AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have FreeType2.])
fi
# X11, Xpm, Xrandr
# X11, Xrandr
AC_PATH_XTRA
if test $have_x = yes; then
AC_DEFINE(USE_X11, 1, [Define to 1 if the X Window System is used])
CLONK_LIBS="$X_LIBS $CLONK_LIBS"
AC_CHECK_HEADERS([X11/keysym.h X11/extensions/xf86vmode.h X11/xpm.h X11/extensions/Xrandr.h], ,
AC_CHECK_HEADERS([X11/keysym.h X11/extensions/Xrandr.h], ,
[AC_MSG_ERROR([A required X11 header was not found.])], [[#include <X11/Xlib.h>]])
AC_CHECK_LIB(X11, XOpenDisplay, [CLONK_LIBS="-lX11 $CLONK_LIBS"],
[AC_MSG_ERROR([libX11 not found.])], [$X_LIBS])
AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [CLONK_LIBS="-lXpm $CLONK_LIBS"],
[AC_MSG_ERROR([libXpm not found.])], [$X_LIBS])
AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, [CLONK_LIBS="-lXxf86vm $CLONK_LIBS"],
[AC_MSG_ERROR([XF86VidMode not found.])], [$X_LIBS])
AC_CHECK_LIB(Xrandr, XRRQueryExtension, [CLONK_LIBS="-lXrandr $CLONK_LIBS"],
[AC_MSG_ERROR([libXrandr not found.])], [$X_LIBS])
fi

View File

@ -140,6 +140,17 @@ if ($link && $db) {
$version = $row['new_version'];
if ($version) {
$message .= 'Version=' . $version . PHP_EOL;
// strip build version from client request
$n = 0;
for($i=0;$i<strlen($client_version);$i++){
if($client_version[$i]=='.'){
$n++;
if($n>=3){
break;
}
}
}
$client_version = substr($client_version,0,$i);
if (version_compare($client_version, $version) < 0) { //We need to update
$result = mysql_query('SELECT `file` FROM `' . $prefix . 'update` WHERE `old_version` = \'' . $client_version . '\' AND `platform` = \'' . $platform . '\'');
$row = mysql_fetch_assoc($result);

2
planet/.gitattributes vendored 100644
View File

@ -0,0 +1,2 @@
* -crlf

View File

@ -3,7 +3,6 @@ Icon=13
Title=FrozenFortress
Version=5,2,0,1
MinPlayer=2
MaxPlayer=8
Difficulty=80
[Definitions]

View File

@ -20,8 +20,8 @@ protected func Initialize()
// Goal: Capture the flag, with bases in both hideouts.
var goal = CreateObject(Goal_CaptureTheFlag, 0, 0, NO_OWNER);
goal->SetFlagBase(1, 135, 264);
goal->SetFlagBase(2, LandscapeWidth() - 135, 264);
goal->SetFlagBase(1, 135, 266);
goal->SetFlagBase(2, LandscapeWidth() - 135, 266);
CreateObject(Rule_KillLogs);
var gate = CreateObject(StoneDoor, 345, 272, NO_OWNER);

View File

@ -45,7 +45,9 @@ public func FxFrostboltTimer(pTarget, effect, iEffectTime)
)
{
CreateObject(Dynamite,x,y,effect.owner)->BlueExplode();
CreateObject(Star,x,y,-1)->Sound("GlassShatter");
var dummy = CreateObject(Dummy,x,y,-1);
dummy->Sound("GlassShatter");
ScheduleCall(dummy, "RemoveObject", 36);
for(var i=0; i<=60;i++)
{
var r=Random(10)+Random(18);

View File

@ -2,8 +2,6 @@
#appendto StoneDoor
private func GetStrength() { return 300; }
protected func Damage()
{
// Destroy if damage above strength.

View File

@ -3,7 +3,6 @@ Icon=13
Title=Hideout
Version=5,2,0,1
MinPlayer=2
MaxPlayer=8
Difficulty=90
[Definitions]

View File

@ -14,34 +14,43 @@ protected func Initialize()
// Goal: Capture the flag, with bases in both hideouts.
var goal = CreateObject(Goal_CaptureTheFlag, 0, 0, NO_OWNER);
goal->SetFlagBase(1, 120, 504);
goal->SetFlagBase(2, LandscapeWidth() - 120, 504);
goal->SetFlagBase(1, 120, 506);
goal->SetFlagBase(2, LandscapeWidth() - 120, 506);
// Rules
CreateObject(Rule_Restart);
CreateObject(Rule_ObjectFade)->DoFadeTime(5 * 36);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
var lwidth = LandscapeWidth();
// Doors and spinwheels.
var gate, wheel;
gate = CreateObject(StoneDoor, 365, 448, NO_OWNER);
gate = CreateObject(StoneDoor, 364, 448, NO_OWNER);
DrawMaterialQuad("Tunnel-brickback", 360, 446, 360, 448, 368, 448, 368, 446);
gate->DoDamage(50); // Upper doors are easier to destroy
gate->SetAutoControl(1);
gate = CreateObject(StoneDoor, 341, 584, NO_OWNER);
gate = CreateObject(StoneDoor, 340, 584, NO_OWNER);
DrawMaterialQuad("Tunnel-brickback", 336, 582, 336, 584, 344, 584, 344, 582);
gate->SetAutoControl(1);
gate = CreateObject(StoneDoor, 693, 544, NO_OWNER);
gate = CreateObject(StoneDoor, 692, 544, NO_OWNER);
DrawMaterialQuad("Tunnel-brickback", 688, 542, 688, 544, 696, 544, 696, 542);
gate->DoDamage(80); // Middle doors even easier
wheel = CreateObject(SpinWheel, 660, 552, NO_OWNER);
wheel->SetStoneDoor(gate);
gate = CreateObject(StoneDoor, LandscapeWidth() - 364, 448, NO_OWNER);
gate = CreateObject(StoneDoor, lwidth - 364, 448, NO_OWNER);
DrawMaterialQuad("Tunnel-brickback", lwidth - 361, 446, lwidth - 361, 448, lwidth - 365, 448, lwidth - 365, 446);
gate->DoDamage(50); // Upper doors are easier to destroy
gate->SetAutoControl(2);
gate = CreateObject(StoneDoor, LandscapeWidth() - 340, 584, NO_OWNER);
gate = CreateObject(StoneDoor, lwidth - 340, 584, NO_OWNER);
DrawMaterialQuad("Tunnel-brickback", lwidth - 337, 582, lwidth - 337, 584, lwidth - 345, 584, lwidth - 345, 582);
gate->SetAutoControl(2);
gate = CreateObject(StoneDoor, LandscapeWidth() - 692, 544, NO_OWNER);
gate = CreateObject(StoneDoor, lwidth - 692, 544, NO_OWNER);
DrawMaterialQuad("Tunnel-brickback", lwidth - 689, 542, lwidth - 689, 544, lwidth - 697, 544, lwidth - 697, 542);
gate->DoDamage(80); // Middle doors even easier
wheel = CreateObject(SpinWheel, LandscapeWidth() - 660, 552, NO_OWNER);
wheel = CreateObject(SpinWheel, lwidth - 660, 552, NO_OWNER);
wheel->SetStoneDoor(gate);
// Chests with weapons.
@ -55,16 +64,16 @@ protected func Initialize()
chest = CreateObject(Chest, 730, 408, NO_OWNER);
chest->MakeInvincible();
AddEffect("FillOtherChest", chest, 100, 6 * 36);
chest = CreateObject(Chest, LandscapeWidth() - 110, 592, NO_OWNER);
chest = CreateObject(Chest, lwidth - 110, 592, NO_OWNER);
chest->MakeInvincible();
AddEffect("FillBaseChest", chest, 100, 6 * 36,nil,nil,true);
chest = CreateObject(Chest, LandscapeWidth() - 25, 464, NO_OWNER);
chest = CreateObject(Chest, lwidth - 25, 464, NO_OWNER);
chest->MakeInvincible();
AddEffect("FillBaseChest", chest, 100, 6 * 36,nil,nil,false);
chest = CreateObject(Chest, LandscapeWidth() - 730, 408, NO_OWNER);
chest = CreateObject(Chest, lwidth - 730, 408, NO_OWNER);
chest->MakeInvincible();
AddEffect("FillOtherChest", chest, 100, 6 * 36);
chest = CreateObject(Chest, LandscapeWidth()/2, 512, NO_OWNER);
chest = CreateObject(Chest, lwidth/2, 512, NO_OWNER);
chest->MakeInvincible();
AddEffect("FillSpecialChest", chest, 100, 4 * 36);
@ -76,7 +85,7 @@ protected func Initialize()
cannon->SetDir(DIR_Right);
cannon->SetR(15);
cannon->CreateContents(PowderKeg);
cannon = CreateObject(Cannon, LandscapeWidth() - 429, 444, NO_OWNER);
cannon = CreateObject(Cannon, lwidth - 429, 444, NO_OWNER);
cannon->SetDir(DIR_Left);
cannon->SetR(-15);
cannon->CreateContents(PowderKeg);

View File

@ -3,7 +3,6 @@ Title=MoltenMonarch
Version=5,2,0,1
Icon=23
MinPlayer=2
MaxPlayer=8
Difficulty=70
[Definitions]

View File

@ -17,6 +17,7 @@ protected func Initialize()
// Objects fade after 7 seconds.
CreateObject(Rule_ObjectFade)->DoFadeTime(7 * 36);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//make lava collapse
CreateObject(Firestone,625,480);

View File

@ -12,6 +12,7 @@ protected func Initialize()
// Goal.
CreateObject(Goal_LastManStanding);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//Enviroment.
Cloud->Place(25);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -2,7 +2,6 @@
Title=Bottom
Version=5,2,0,1
MinPlayer=2
MaxPlayer=4
Difficulty=20
[Definitions]

View File

@ -11,6 +11,7 @@ protected func Initialize()
// Goal.
CreateObject(Goal_LastManStanding, 0, 0, NO_OWNER);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
// Chests with weapons.
CreateObject(Chest, 108, 248, NO_OWNER)->MakeInvincible();
@ -18,17 +19,47 @@ protected func Initialize()
// Objects fade after 5 seconds.
CreateObject(Rule_ObjectFade)->DoFadeTime(7 * 36);
// Some decoration trunks ranks and a waterfall.
var trunk = CreateObject(Trunk, 76, 324);
trunk->SetR(60); trunk.Plane = 510;
trunk.MeshTransformation = [-731, 0, 682, 0, 0, 1000, 0, 0, -682, 0, -731, 0];
trunk = CreateObject(Trunk, 123, 68);
trunk->SetR(115); trunk.Plane = 510;
trunk.MeshTransformation = [469, 0, 883, 0, 0, 1000, 0, 0, -883, 0, 469, 0];
trunk = CreateObject(Trunk, 172, 134);
trunk->SetR(-110); trunk.Plane = 510;
trunk.MeshTransformation = [-545, 0, -839, 0, 0, 1000, 0, 0, 839, 0, -545, 0];
var waterfall;
waterfall = CreateWaterfall(130, 53, 2, "Water");
waterfall->SetDirection(4, 0, 3, 6);
waterfall = CreateWaterfall(144, 50, 8, "Water");
waterfall->SetDirection(6, 0, 5, 6);
CreateLiquidDrain(100, 315, 10);
CreateLiquidDrain(130, 315, 10);
CreateLiquidDrain(160, 315, 10);
CreateObject(Fern, 48, 114);
CreateObject(Fern, 284, 128);
CreateObject(Lorry, 294, 128)->SetR(20);
CreateObject(Pickaxe, 260, 128)->SetR(-45);
CreateObject(Mushroom, 271, 136);
CreateObject(Rank, 146, 302)->SetR(180);
CreateObject(Rank, 198, 190)->SetR(225);
CreateObject(Rank, 54, 66)->SetR(180);
CreateObject(Rank, 42, 232)->SetR(120);
CreateObject(Rank, 269, 230)->SetR(-120);
for (var i = 0; i < 2 + Random(6); i++)
CreateObject(Rank, 114, 10 + Random(140))->SetR(RandomX(60, 120));
for (var i = 0; i < 2 + Random(6); i++)
CreateObject(Rank, 190, 10 + Random(140))->SetR(-RandomX(60, 120));
//Water needs to be OK
AddEffect("Refiller",nil,100,6);
return;
}
global func FxRefillerTimer(object pTarget, effect, int timer)
{
for(var i=0; i<10; i++) if(!GBackLiquid(100,315)) InsertMaterial(Material("Water"),135,385);
}
// Gamecall from LastManStanding goal, on respawning.
protected func OnPlayerRelaunch(int plr)
{

View File

@ -7,7 +7,7 @@ private func OpenWeaponMenu(object clonk)
var weapons = WeaponList();
if(weapons)
{
menu = clonk->CreateRingMenu(Clonk, this);
menu = clonk->CreateRingMenu(this, this);
for (var weapon in weapons)
{
if(weapon == Firestone) menu->AddItem(weapon,2);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -2,7 +2,6 @@
Title=Ruins
Version=5,2,0,1
MinPlayer=2
MaxPlayer=6
Difficulty=30
[Definitions]

View File

@ -12,6 +12,7 @@ protected func Initialize()
// Goal.
CreateObject(Goal_LastManStanding, 0, 0, NO_OWNER);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
// Mood.
SetSkyAdjust(RGBa(255, 255, 255, 127), RGB(255, 200, 150));

View File

@ -1,5 +1,5 @@
[Head]
Title=Overcast
Title=ScorchedGardens
Version=5,2,0,1
MinPlayer=2
Difficulty=40

View File

@ -14,6 +14,7 @@ protected func Initialize()
// Goal.
CreateObject(Goal_DeathMatch, 0, 0, NO_OWNER);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//Enviroment.
CreateObject(Rule_ObjectFade)->DoFadeTime(10 * 36);
@ -64,24 +65,37 @@ public func FxMeteorSparkleStart(obj, effect, iTemp, natural)
global func FxMeteorsparkleTimer(obj, effect, time)
{
if (!obj)
return -1;
var x=obj->GetX(), y=obj->GetY();
CreateParticle("FireballSmoke",x,y,Sin(Random(360),2),Cos(Random(360),2),RandomX(120,180),RGBa(100,100,100,70));
for(var i=0; i<6; i++) CreateParticle("MagicFire",x,y,Sin(Random(360),RandomX(5,6)),Cos(Random(360),RandomX(5,6)),RandomX(50,90),HSL(Random(50), 200+Random(25), Random(100)));
CreateParticle("MagicSpark",x,y,Sin(Random(360),RandomX(15,33)),Cos(Random(360),RandomX(15,33)),RandomX(30,70),RGB(255,255,255));
if(obj->Contained()) obj->Hit();
if(Abs(obj->GetXDir())<3 && Abs(obj->GetYDir())<3) effect.count++;
if (obj->Contained())
{
obj->Hit();
return -1;
}
if (Abs(obj->GetXDir())<3 && Abs(obj->GetYDir())<3)
effect.count++;
else effect.count=0;
if(obj) // meteor not yet destroyed by Hit() above?
if(effect.count>10) obj->Hit();
if (effect.count>10)
{
obj->Hit();
return -1;
}
return 1;
}
global func FxMeteorsparkleStop (obj, effect, reason, iTemp)
{
if(iTemp) return;
for(var i=0; i<30; i++) CreateParticle("MagicSpark",obj->GetX(),obj->GetY(),Sin(Random(360),RandomX(15,33)),Cos(Random(360),RandomX(15,33)),RandomX(30,70),RGB(255,255,255));
return ;
if (iTemp)
return;
if (!obj)
return;
for (var i = 0; i < 30; i++)
CreateParticle("MagicSpark",obj->GetX(),obj->GetY(),Sin(Random(360),RandomX(15,33)),Cos(Random(360),RandomX(15,33)),RandomX(30,70),RGB(255,255,255));
return;
}
private func PlaceEdges()
@ -143,4 +157,3 @@ func OnClonkLeftRelaunch(object clonk)
func WinKillCount() { return 5; }
func RelaunchWeaponList() { return []; }

View File

@ -16,6 +16,7 @@ protected func Initialize()
goal->SetPointLimit(5);
AddEffect("BlessTheKing",goal,100,1,nil);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//Enviroment.
//SetSkyAdjust(RGBa(250,250,255,128),RGB(200,200,220));

View File

@ -2,7 +2,6 @@
Icon=39
Title=Windmill
Version=5,2,0,1
MaxPlayer=8
Difficulty=10
[Definitions]

View File

@ -9,19 +9,14 @@ uniform sampler3D materialTex;
// Resolution of the landscape texture
uniform vec2 resolution;
// Use sampler if the GPU doesn't support enough uniforms to
// get the matMap as an array
#if MAX_FRAGMENT_UNIFORM_COMPONENTS < 259
#define BROKEN_ARRAYS_WORKAROUND
#endif
// Texture map
#ifdef BROKEN_ARRAYS_WORKAROUND
#ifndef NO_BROKEN_ARRAYS_WORKAROUND
uniform sampler1D matMapTex;
#else
uniform float matMap[256];
#endif
uniform int materialDepth;
uniform vec2 materialSize;
// Expected parameters for the scaler
const vec2 scalerStepX = vec2(1.0 / 8.0, 0.0);
@ -41,7 +36,7 @@ int f2i(float x) {
float queryMatMap(int pix)
{
#ifdef BROKEN_ARRAYS_WORKAROUND
#ifndef NO_BROKEN_ARRAYS_WORKAROUND
int idx = f2i(texture1D(matMapTex, float(pix) / 256.0 + 0.5 / 256.0).r);
return float(idx) / 256.0 + 0.5 / float(materialDepth);
#else
@ -104,10 +99,11 @@ void main()
vec4 lopx = texture2D(landscapeTex[0], otherCoo);
// Get material pixels
vec2 tcoo = gl_TexCoord[0].st * resolution / materialSize;
float mi = queryMatMap(f2i(lpx.r));
vec4 mpx = texture3D(materialTex, vec3(gl_TexCoord[0].st * resolution / vec2(512.0, 512.0) * vec2(4.0, 4.0), mi));
vec4 mpx = texture3D(materialTex, vec3(tcoo, mi));
float omi = queryMatMap(f2i(lopx.r));
vec4 ompx = texture3D(materialTex, vec3(gl_TexCoord[0].st * resolution / vec2(512.0, 512.0) * vec2(4.0, 4.0), omi));
vec4 ompx = texture3D(materialTex, vec3(tcoo, omi));
// Brightness
float ambientBright = 1.0, shadeBright = 0.8;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -26,6 +26,6 @@ Dig2Object=Snow
Dig2ObjectRatio=400
[Reaction]
Type=Convert
Type=Poof
TargetSpec=Incindiary
ConvertMat=Water

View File

@ -1,40 +1,33 @@
# Static Map Material/Texture Table
# Index +128 for underground materials
10=Tunnel-tunnel
11=Tunnel-tunnel
12=Tunnel-brickback
13=BrickSoft-brick1
19=DuroLava-lava_red
20=Water-water1-water2-water3-water1-water3-water2
#21=Oil-Liquid
22=Acid-acid
23=Lava-lava_red
24=DuroLava-lava_red
25=Water-water
#26=Oil-Smooth
27=Acid-acid
28=Lava-lava_red
28=Earth-earth
29=Earth-earth_dry
30=Earth-earth_rough
31=Earth-earth_topsoil
32=Earth-earth_midsoil
33=Ashes-ashes
#34=Ashes-Rough
#35=Ashes-Ridge
36=Ore-ore
37=Ore-ore
38=Ore-ore
40=Granite-granite
41=Granite-granite
42=Granite-rock
45=Gold-gold
50=Rock-rock
51=Rock-rock_cracked
52=Rock-rock
53=Sulphur-sulphur
@ -42,28 +35,10 @@
55=Sand-sand_rough
56=Sand-sand_smooth
#57=Sand-Smooth3
#59=FlyAshes-Smooth
#60=Crystal-Flare
#61=Crystal-Structure
#62=Crystal-Structure2
65=Ice-ice2
66=Ice-ice2
67=Ice-ice3
68=Ice-ice3
70=Snow-snow1
71=Snow-snow1
72=Snow-snow1
73=Brick-brick1
#80=FlySand-Smooth2
#81=FlySand-Smooth3
#82=FlySand-Smooth

View File

@ -1,4 +0,0 @@
[DefCore]
id=Skin_Alchemist
Version=5,2,0,1
Category=C4D_StaticBack

View File

@ -383,7 +383,7 @@ func Footstep()
Sound("StepHard?");
else
{
var dir = GetXDir() / Abs(GetXDir());
var dir = Sign(GetXDir());
var clr = GetAverageTextureColor(GetTexture(0,10));
CreateParticle("Dust2", dir*-4, 8, dir*-2, -2, 25+Random(5), DoRGBaValue(clr,-150,0));
CreateParticle("Dust2", dir*-4, 8, dir*-3, -3, 25+Random(5), DoRGBaValue(clr,-150,0));

View File

@ -1,4 +0,0 @@
[DefCore]
id=Skin_Farmer
Version=5,2,0,1
Category=C4D_StaticBack

View File

@ -153,37 +153,10 @@ protected func Death(int killed_by)
Sound("FDie");
CloseEyes(1);
//Are gravestones used in the scenario?
if(FindObject(Find_ID(Rule_Gravestones)))
AddEffect("GravestoneAdd", this, 1, 1, this);
DeathAnnounce();
return;
}
func FxGravestoneAddTimer(object target, proplist effect, int timer)
{
//is the death animation over?
if(timer >= 20){
AddEffect("Gravestone",this, 1, nil, this);
return -1;
}
}
func FxGravestoneStart(object clonk, proplist effect){
effect.grave = CreateObject(Clonk_Grave,0,0,clonk->GetController());
this->Enter(effect.grave);
//smoke effect
CastParticles("ExploSmoke", RandomX(10,15), 0, 0, 6, 200, 250, HSLa(0,0,255,64), HSLa(0,0,255,64));
}
func FxGravestoneStop(object clonk, proplist effect){
clonk->Exit();
effect.grave->RemoveObject();
}
protected func Destruction()
{
_inherited(...);
@ -562,17 +535,17 @@ func SetSkin(int skin)
//Steampunk
if(skin == 1)
{ SetGraphics(nil, Skin_Steampunk);
{ SetGraphics("Steampunk");
gender = 1; }
//Alchemist
if(skin == 2)
{ SetGraphics(nil, Skin_Alchemist);
{ SetGraphics("Alchemist");
gender = 0; }
//Farmer
if(skin == 3)
{ SetGraphics(nil, Skin_Farmer);
{ SetGraphics("Farmer");
gender = 1; }
RemoveBackpack(); //add a backpack

View File

@ -1,4 +0,0 @@
[DefCore]
id=Skin_Steampunk
Version=5,2,0,1
Category=C4D_StaticBack

View File

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 182 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 282 KiB

After

Width:  |  Height:  |  Size: 282 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -47,14 +47,15 @@ protected func Initialize()
SetComDir(COMD_None);
SetPhase(RandomX(1,16));
//Push low flying clouds up to proper height
while(MaterialDepthCheck(GetX(),GetY(),"Sky",150)!=true)
// Push low flying clouds up to proper height
while (MaterialDepthCheck(GetX(), GetY(), "Sky", 150) != true)
{
SetPosition(GetX(),GetY()-1);
SetPosition(GetX(), GetY()-1);
}
//Failsafe for stupid grounded clouds
if (GetMaterial(0,30)!=Material("Sky")) SetPosition(GetX(), GetY()-180);
// Failsafe for stupid grounded clouds
if (GetMaterial(0, 30) != Material("Sky"))
SetPosition(GetX(), GetY() - 180);
// Add effect to process all cloud features.
AddEffect("ProcessCloud", this, 100, 5, this);
@ -280,29 +281,18 @@ protected func Evaporation()
//Shades the clouds based on iSize: the water density value of the cloud.
private func ShadeCloud()
{
var cloudAlpha = Min((rain+50)*425/1000, 255);
if(rain > 600) cloudAlpha = 255;
//from RequestAlpha function
if(requestAlpha != nil){
cloudAlpha = cloudAlpha - (255 - requestAlpha);
if(cloudAlpha < 0) cloudAlpha = 0;
}
var shade2 = Min(rain-600, 255);
if (rain <= 600)
SetObjAlpha(cloudAlpha);
if (rain > 600)
SetClrModulation(RGBa(255-shade2, 255-shade2, 255-shade2, cloudAlpha));
return;
var cloud_alpha = Min((rain+50)*425/1000, 255);
var shade2 = BoundBy(Max(0,rain-600) + lighting_shade, 0, 255);
SetClrModulation(RGBa(255-shade2, 255-shade2, 255-shade2, cloud_alpha));
}
//Utilized by time to make clouds invisible at night
local requestAlpha;
// Utilized by time to make clouds invisible at night
local lighting_shade;
public func RequestAlpha(int alpha){
requestAlpha = alpha;
public func SetLightingShade(int darkness)
{
lighting_shade = darkness;
}
local ActMap = {

View File

@ -9,7 +9,7 @@ protected func Initialize()
SetClrModulation(RGBa(255,255,255,alpha));
SetAction("Be");
Update();
this["Parallaxity"] = [40,40];
this["Parallaxity"] = [30,30];
}
public func NextMoonPhase()

View File

@ -11,37 +11,41 @@
local time;
local advance_seconds_per_tick;
// Sets the current time using a 24*60 minute clock scheme.
/** Sets the current time using a 24*60 minute clock scheme. */
public func SetTime(int to_time)
{
// Set time.
time = to_time % (24 * 60);
time = (to_time*60) % (24 * 60 * 60);
// hide celestials during day
if(Inside(time, time_set["SunriseEnd"], time_set["SunsetStart"]))
HideCelestials();
else
ShowCelestials();
// Adjust to time.
AdjustToTime();
return;
}
// Returns the time in minutes.
/** Returns the time in minutes. */
public func GetTime()
{
return time;
return time / 60;
}
// Sets the number of frames per clonk-minute.
// Standard is 18 frames per minute, making a day-night cycle of 12 minutes.
// Setting minute lenght to 0 will stop day-night cycle.
public func SetCycleSpeed(int speed)
/** 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)
{
//GetEffect("IntTimeCycle", this).Interval = Max(0, speed);
RemoveEffect("IntTimeCycle", this);
AddEffect("IntTimeCycle", this, 100, Max(0, speed), this);
return;
advance_seconds_per_tick = seconds_per_tick;
}
/** Returns the number of seconds the day advances each tick (10 frames). */
public func GetCycleSpeed()
{
return GetEffect("IntTimeCycle", this).Interval;
return advance_seconds_per_tick;
}
local time_set;
@ -54,25 +58,25 @@ protected func Initialize()
return RemoveObject();
time_set = {
SunriseStart = 180,
SunriseEnd = 540,
SunsetStart = 900,
SunsetEnd = 1260,
SunriseStart = 10800, // 3:00
SunriseEnd = 32400, // 9:00
SunsetStart = 54000, // 15:00
SunsetEnd = 75600, // 21:00
};
// Add effect that controls time cycle.
AddEffect("IntTimeCycle", this, 100, 18, this);
// Set the time to midday (12:00).
time = 720;
// Create moon and stars.
if (FindObject(Find_ID(Environment_Celestial)))
{
CreateObject(Moon, LandscapeWidth() / 2, LandscapeHeight() / 6);
PlaceStars();
CreateObject(Moon, LandscapeWidth() / 2, LandscapeHeight() / 6);
}
return;
// Set the time to midday (12:00).
SetTime(43200);
// Add effect that controls time cycle.
SetCycleSpeed(30);
AddEffect("IntTimeCycle", this, 100, 10, this);
}
public func IsDay()
@ -95,17 +99,26 @@ 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);
//Star Creation
var maxamount = LandscapeWidth() * LandscapeHeight() / 40000;
var amount = 0;
var maxfailedtries = lw * lh / 40000;
var failed = 0;
while (amount != maxamount)
while (failed != maxfailedtries)
{
var pos;
if (pos = FindPosInMat("Sky", 0, 0, LandscapeWidth(), LandscapeHeight()))
CreateObject(Star, pos[0], pos[1]);
amount++;
var pos = [Random(lw), Random(lh)];
if(!FindObject(Find_ID(Stars),Find_AtPoint(pos[0],pos[1])))
{
CreateObject(Stars, pos[0], pos[1]);
continue;
}
failed++;
}
return;
}
@ -116,41 +129,98 @@ protected func FxIntTimeCycleTimer(object target)
AdjustToTime();
// Advance time.
time++;
time %= (24 * 60);
time += advance_seconds_per_tick;
time %= (24 * 60 * 60);
return 1;
}
// Adjusts the sky, celestial and others to the current time. Use SetTime() at runtime, not this.
private func AdjustToTime()
private func HideCelestials()
{
var skyshade = [0,0,0,0]; //R,G,B,A
var nightcolour = [10,25,40]; //default darkest-night colour
// 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);
}
}
private func ShowCelestials()
{
// show celestial objects
for (var celestial in FindObjects(Find_Func("IsCelestial")))
{
celestial.Visibility = VIS_All;
}
}
private func OnSunriseEnd()
{
// next moon phase
var satellite = FindObject(Find_ID(Moon));
if(satellite)
satellite->NextMoonPhase();
//Darkness of night dependant on moon-phase
var satellite = FindObject(Find_ID(Moon)); //pointer to the moon
if(satellite){
var lightness = satellite->GetMoonLightness();
nightcolour = [ 6 * lightness / 100, 25 * lightness / 100, 40 * lightness / 100 ];
HideCelestials();
}
private func OnSunsetStart()
{
ShowCelestials();
}
private func DoSkyShade()
{
// 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"]))
sunrise = true;
else if(Inside(time, time_set["SunriseEnd"], time_set["SunsetStart"]))
day = true;
else if(Inside(time, time_set["SunsetStart"], time_set["SunsetEnd"]))
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];
if (!day)
{
// Darkness of night dependent on the moon-phase
var satellite = FindObject(Find_ID(Moon));
if(satellite)
{
var lightness = satellite->GetMoonLightness();
nightcolour = [ 6 * lightness / 100, 8 + 25 * lightness / 100, 15 + 60 * lightness / 100 ];
}
}
// Sunrise
if (Inside(time, time_set["SunriseStart"], time_set["SunriseEnd"]))
if (sunrise)
{
skyshade[0] = Sin((GetTime() - time_set["SunriseStart"]) / 4, 255 - nightcolour[0]) + nightcolour[0];
skyshade[1] = Sin((GetTime() - time_set["SunriseStart"]) / 4, 255 - nightcolour[1]) + nightcolour[1];
skyshade[2] = Sin((GetTime() - time_set["SunriseStart"]) / 4, 255 - nightcolour[2]) + nightcolour[2];
var time_since_sunrise = time - time_set["SunriseStart"];
// progress in 0..1800
var progress = time_since_sunrise * 1800 / (time_set["SunriseEnd"] - time_set["SunriseStart"]);
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);
}
skyshade[3] = Sin((GetTime() - time_set["SunriseStart"]) / 4, 255);
if (time == 540)
if (satellite)
satellite->NextMoonPhase();
skyshade[3] = Min(255,progress/2);
}
// Day
else if (Inside(time, time_set["SunriseEnd"], time_set["SunsetStart"]))
else if (day)
{
skyshade[0] = 255;
skyshade[1] = 255;
@ -158,17 +228,26 @@ private func AdjustToTime()
skyshade[3] = 255;
}
//Sunset
else if (Inside(time, time_set["SunsetStart"], time_set["SunsetEnd"]))
// Sunset
else if (sunset)
{
skyshade[0] = 255 - Sin((GetTime() - time_set["SunsetStart"]) / 4, 255 - nightcolour[0]);
skyshade[1] = 255 - Sin((GetTime() - time_set["SunsetStart"]) / 4, 255 - nightcolour[1]);
skyshade[2] = 255 - Sin((GetTime() - time_set["SunsetStart"]) / 4, 255 - nightcolour[2]);
var time_since_sunset = time - time_set["SunsetStart"];
// progress in 0..1800
var progress = time_since_sunset * 1800 / (time_set["SunsetEnd"] - time_set["SunsetStart"]);
skyshade[3] = 255 - Sin((GetTime() - time_set["SunsetStart"]) / 4, 255);
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);
}
// Night
else if (time > time_set["SunsetEnd"] || time < time_set["SunriseStart"])
else if (night)
{
skyshade[0] = nightcolour[0];
skyshade[1] = nightcolour[1];
@ -180,16 +259,28 @@ private func AdjustToTime()
// Shade sky.
SetSkyAdjust(RGB(skyshade[0], skyshade[1], skyshade[2]));
// Adjust celestial objects.
for (var celestial in FindObjects(Find_Func("IsCelestial")))
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))){
cloud->RequestAlpha(skyshade[3]);
// Adjust clouds
for(var cloud in FindObjects(Find_ID(Cloud))){
cloud->SetLightingShade(255 - skyshade[2]);
}
}
return;
}
// 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();
}
local Name = "Time";

View File

@ -1,11 +0,0 @@
[DefCore]
id=Star
Version=5,2,0,1
Category=C4D_StaticBack|C4D_Background
Width=2
Height=2
Offset=-1,1
Vertices=1
VertexY=0
Mass=1
StretchGrowth=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

View File

@ -1,17 +0,0 @@
/*-- Star --*/
protected func Initialize()
{
DoCon(-30+Random(50));
SetR(Random(359));
var alpha=0;
if(GetTime()<300 || GetTime()>1140) alpha=255;
SetClrModulation(RGBa(255,255,255,alpha));
this["Parallaxity"] = [10,10];
SetCategory(GetCategory() | C4D_Parallax | C4D_Background);
}
public func IsCelestial() { return true; }
local Name = "$Name$";

View File

@ -0,0 +1,7 @@
[DefCore]
id=Stars
Version=5,2,0,1
Category=C4D_StaticBack|C4D_Background|C4D_Parallax
Width=128
Height=128
Offset=-64,64

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,17 @@
/*-- Stars --*/
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));
SetObjectBlitMode(GFX_BLIT_Additive);
var parallax = RandomX(8,12);
this["Parallaxity"] = [parallax,parallax];
}
public func IsCelestial() { return true; }
local Name = "Stars";

View File

@ -154,7 +154,8 @@ private func Erupt()
// Cast other particles (lava chunks, ashes, ashclouds).
if (!Random(6))
CastObjects(LavaChunk, 1, 60, 0, 0, 0, 40);
if (WildcardMatch(MaterialName(mat), "*Lava*"))
CastObjects(LavaChunk, 1, 60, 0, 0, 0, 40);
// Reduce strength.
if(!Random(3))

View File

@ -0,0 +1,4 @@
[DefCore]
id=Waterfall
Version=5,2,0,1
Category=C4D_StaticBack

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

View File

@ -0,0 +1,118 @@
/*--
Waterfall
Author: Maikel
Waterfall object, use to place waterfalls in the landscape.
--*/
protected func Initialize()
{
return;
}
/*-- Waterfall --*/
global func CreateWaterfall(int x, int y, int strength, string mat)
{
var fall = CreateObject(Waterfall, x, y, NO_OWNER);
if(!mat) mat = "Water";
AddEffect("IntWaterfall", fall, 100, 1, fall, nil, x, y, strength, mat);
return fall;
}
protected func FxIntWaterfallStart(object target, proplist effect, int temporary, int x, int y, int strength, string mat)
{
if (temporary)
return 1;
effect.X = x;
effect.Y = y;
effect.Strength = strength;
effect.Material = mat;
// Start sound.
target->Sound("Waterfall", false, 10 * effect.Strength, nil, 1);
return 1;
}
protected func FxIntWaterfallTimer(object target, proplist effect)
{
// Insert liquid at location every frame.
for (var i = 0; i < effect.Strength / 2; i++)
InsertMaterial(Material(effect.Material), AbsX(effect.X), AbsY(effect.Y), effect.XDir + Random(effect.XVar), effect.YDir + Random(effect.YVar));
return 1;
}
protected func FxIntWaterfallStop(object target, proplist effect, bool temporary)
{
if (temporary)
return 1;
// Stop sound.
target->Sound("Waterfall", false, 10 * effect.Strength, nil, -1);
return 1;
}
public func SetStrength(int strength)
{
var effect = GetEffect("IntWaterfall", this);
if (effect)
effect.Strength = BoundBy(strength, 0, 100);
return;
}
public func SetMaterial(int material)
{
return;
}
public func SetDirection(int xdir, int ydir, int xvar, int yvar)
{
var effect = GetEffect("IntWaterfall", this);
if (effect)
{
effect.XDir = xdir;
effect.YDir = ydir;
effect.XVar = xvar;
effect.YVar = yvar;
}
return;
}
public func SetSoundLocation(int x, int y)
{
SetPosition(x, y);
return;
}
/*-- Liquid Drain --*/
global func CreateLiquidDrain(int x, int y, int strength)
{
var drain = CreateObject(Waterfall, x, y, NO_OWNER);
AddEffect("IntLiquidDrain", drain, 100, 1, drain, nil, x, y, strength);
return drain;
}
protected func FxIntLiquidDrainStart(object target, proplist effect, int temporary, int x, int y, int strength)
{
if (temporary)
return 1;
effect.X = x;
effect.Y = y;
effect.Strength = strength;
return 1;
}
protected func FxIntLiquidDrainTimer(object target, proplist effect)
{
for (var i = 0; i < effect.Strength / 2; i++)
ExtractLiquid(AbsX(effect.X), AbsY(effect.Y));
return 1;
}
local Name = "$Name$";

View File

@ -0,0 +1 @@
Name=Wasserfall

View File

@ -0,0 +1 @@
Name=Waterfall

View File

@ -0,0 +1 @@
Waterfall.wav by volivieri CC-BY-3.0 (http://www.freesound.org/people/volivieri/sounds/38390/)

View File

@ -5,7 +5,8 @@ Category=C4D_Vehicle
Width=16
Height=26
Offset=-5,-13
# note: the fifth vertex is used to attach the flag to the Clonk
Vertices=5
VertexX=-5,-6,-7,7
VertexY=13,0,-13,-6
VertexFriction=100,100,100,50
VertexX=-5,-6,-7,7, 0
VertexY=13,0,-13,-6, 0
VertexFriction=100,100,100,50, 0

View File

@ -198,6 +198,19 @@ private func BeamFlag(bool msg)
return;
}
func StartAttachCarrier()
{
// attach fourth vertex of the flag to third vertex of Clonk
// this results in the best overlapping of the shapes
SetActionData((4 << 8) + 3);
}
func StartAttachBase()
{
// reset possible action data
SetActionData(0);
}
local Name = "$Name$";
local ActMap = {
AttachCarrier = {
@ -206,8 +219,9 @@ local ActMap = {
Procedure = DFA_ATTACH,
Length = 1,
Delay = 0,
NextAction = "Attach",
NextAction = "AttachCarrier",
Animation = "Wave",
StartCall = "StartAttachCarrier"
},
AttachBase = {
Prototype = Action,
@ -215,8 +229,9 @@ local ActMap = {
Procedure = DFA_ATTACH,
Length = 1,
Delay = 0,
NextAction = "Attach",
NextAction = "AttachBase",
Animation = "Wave",
StartCall = "StartAttachBase"
},
};

View File

@ -3,3 +3,4 @@ id=RelaunchContainer
Version=5,2,0,1
Category=C4D_StaticBack
ClosedContainer=2
Picture=0,0,92,92

Some files were not shown because too many files have changed in this diff Show More