Commit Graph

547 Commits (master)

Author SHA1 Message Date
Sven Eberhardt e39b314239 Add property to auto-save EditorProps in scenarios 2016-08-06 14:49:48 -04:00
Sven Eberhardt fc24969899 Add EditorPlacementLimit property
Limits the number of object instances that can be placed of a given def.
2016-08-06 02:36:53 -04:00
Sven Eberhardt 9bcef15b99 Add AddScenarioSaveDependency for scenario saving: Adds a dependency without forcing a name 2016-08-05 00:30:43 -04:00
Clonkonaut 89be1da072 Changed quick switch slot selection to Number + Q.
As suggested by Zapper in this posting: http://forum.openclonk.org/topic_show.pl?pid=31073#pid31073.
This way is probably the only way item usage will ever work on Q. For now, this reverses the previous changes. Q will again react on key down.
2016-08-02 17:49:34 +02:00
Clonkonaut faf3add7e7 Quick Switch slot is now selectable using Q + number key.
This makes a very fundamental change with quick switch: The switching action is now performed on the key release instead of the key press. Let's see if this performs badly for players.
2016-08-02 00:37:40 +02:00
Sven Eberhardt 11b317808f Qt Editor: Add toggle help button to "?" menu 2016-07-25 21:39:35 -04:00
Sven Eberhardt 35a5df6c9b Revert accidental commit from master merge 2016-07-25 01:08:49 -04:00
Sven Eberhardt 534e4cc745 Merge branch 'master' into qteditor
Conflicts:
	src/script/C4AulParse.cpp
2016-07-24 10:23:57 -04:00
Sven Eberhardt 4245f60e83 Qt Editor: Add help/description label for current selection 2016-07-24 10:12:38 -04:00
Sven Eberhardt 8d6a7058c6 Fix possible user action sequence id conflict when saving scenario after testing a sequence 2016-07-13 17:39:36 -04:00
Sven Eberhardt 22328365fa Escape \ and " characters when scenario saving names and strings within proplists 2016-07-13 02:13:23 -04:00
Sven Eberhardt 279d89393c SaveScenario: Correctly save object pointers within proplist 2016-07-13 01:45:29 -04:00
Sven Eberhardt 63c9bd78e7 Qt Editor: Fix crash and prop list/array display problems when switching prop lists.
Storing the pointer in QModelIndex could sometimes keep invalid memory on the persistent model indices. Because re-organizing these memory locations would be a nightmare and we only go two levels deep anyway, just store the parent index in the internal pointer and look up the actual property on the fly.
2016-07-05 22:53:41 -04:00
Sven Eberhardt a7aa89f168 Merge branch 'master' into qteditor
Conflicts:
	planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c
	src/platform/C4WindowSDL.cpp
	src/script/C4AulParse.cpp
	src/script/C4Effect.cpp
2016-06-20 22:27:03 -04:00
Sven Eberhardt 44d94d5043 Improve editor duplicate function to duplicate properties and object connections.
It serializes objects using a selective SaveScenarioObjects script callback and then just executes the generated script. This automatically saves important properties, connects switches and doors, etc.

This change also solves the problem that duplicating an elevator plus case would create two elevator cases.

If execution fails (e.g. because of script errors or because a non-saveable object was duplicated), the method falls back to the legacy duplication method of creating objects with the same prototypes at the same position.
2016-06-20 01:45:26 -04:00
Sven Eberhardt e7be7d6acd Qt Editor: Add viewport context menu 2016-06-19 22:45:12 -04:00
Sven Eberhardt 25fa57cabf Qt Editor: Add "Static Flat" landscape mode 2016-06-17 18:44:59 -04:00
Sven Eberhardt 2f22a3a8fe Qt Editor: Add property delegate type "object" 2016-06-16 14:59:04 -04:00
Sven Eberhardt 16e31098b4 Qt Editor: Improve proplist and array display/editing
* Add/Remove element buttons
* Display customization of user delegates
2016-06-06 01:54:05 -04:00
Maikel de Vries 695680cb6c objects on fire inflame inflammable materials 2016-06-03 22:08:14 +02:00
Sven Eberhardt b10da0629d Qt Editor: More EditorProps types (string, array) and attributes (EditOnSelection, DefaultEditorProp) 2016-06-03 01:20:43 -04:00
Sven Eberhardt af2a74b6ec Qt Editor: Array editing 2016-05-28 09:30:54 -04:00
David Dormagen 2df2946016 OnInIncendiaryMaterial: check for object removal after energy loss 2016-05-27 22:19:41 +02:00
Sven Eberhardt d304b17028 Qt Editor: Editing of child proplists 2016-05-24 23:06:00 -04:00
Maikel de Vries 3455fa24f9 add some variation to the maximum size of trees 2016-05-21 13:34:34 +02:00
Maikel de Vries 18f2b4831a add max size option to StartGrowth 2016-05-21 13:34:34 +02:00
Maikel de Vries 6c8c4c9c19 allow more components than def for Oversize objects 2016-05-21 13:34:34 +02:00
Maikel de Vries 2a731b2545 implement Components as a property lookup table 2016-05-21 13:34:34 +02:00
Maikel de Vries 62ad9eb53b reimplement components scaling with object completion 2016-05-21 13:34:34 +02:00
Maikel de Vries a81ccaab22 add function to make properties writable
Thanks to Guenther for the implementation details, documentation will follow when it is considered a stable solution.
2016-05-21 13:34:34 +02:00
Maikel de Vries 4833f839d2 script implementation of GetComponent and SetComponent
This allows to remove the engine functionality and is based on the property Components = [[def1, amount1], [def2, amount2], ...]. Follow up commits will remove the engine functionality.
2016-05-21 13:34:33 +02:00
Maikel de Vries accd897b91 rename NoComponentMass to NoMassFromContents
This had nothing to with components, and risk of backwards compatibility is minor.
2016-05-21 13:34:33 +02:00
Maikel de Vries 183ab4c4a0 remove unused function ComposeContents 2016-05-21 13:34:33 +02:00
Maikel de Vries 5841b55f7e remove unused function GetNeededMatStr 2016-05-21 13:34:33 +02:00
Günther Brammer d23ffde361 Merge script branch 2016-05-15 19:21:26 +02:00
Günther Brammer ef515cc3c7 Script: Prototypes for CreateEffect should inherit from Effect
This makes the special effect properties useable without the "this." prefix,
makes the various useful global functions available as well as
effect-specific functions.
2016-05-15 15:22:42 +02:00
Nicolas Hake 8e18a3fc96 Change (int)0 to nil where deprecated 2016-05-13 17:13:34 +02:00
Lukas Werling 9fa16c5e14 SDL: Enable multisampling
Unfortunately, there doesn't seem to be an easy way to apply
multisampling changes in SDL. As a workaround, a message requesting the
player to restart the game is shown.
2016-05-07 12:25:11 +02:00
Lukas Werling c9aa07ee60 Add more documentation for Mod() (#1735) 2016-05-01 19:52:22 +02:00
Lukas Werling dd48a759d7 Add mathematical modulo helper function Mod(a, b) 2016-05-01 19:25:12 +02:00
Maikel de Vries f4ae76454b rename player control callback for specified id's to silence warning
It is better to have different names for different callbacks.
2016-04-29 21:51:58 +02:00
Günther Brammer b00b8554ab Merge branch script 2016-04-28 03:25:44 +02:00
Maikel de Vries 92334f5f4c take into account container velocity in shockwaves
This ensures reliable flint jumping when using dynamite, ironbomb, powderkeg, etc.
2016-04-24 20:33:44 +02:00
Günther Brammer c167e990a5 Add GetName function to Actions 2016-04-24 19:40:29 +02:00
Sven Eberhardt 4e7df72c4c Editor Props: Invincibility and player color. 2016-04-16 22:05:38 -04:00
Sven Eberhardt c0228be4e7 Qt Editor: More editor property types and functionality 2016-04-16 22:05:35 -04:00
Maikel de Vries 100b87af1a add leaf particle 2016-04-12 23:53:46 +02:00
Nicolas Hake 9dddf289db Merge branch 'master' into qteditor 2016-04-03 21:06:32 +02:00
Sven Eberhardt dc7259bb1e Qt Editor: Allow opening of user path from welcome page 2016-03-26 14:02:40 -04:00
Sven Eberhardt b3712ace97 qt editor: Add "Editor" button to startup main menu 2016-03-26 02:15:15 -04:00
Sven Eberhardt f2daa51fa7 Qt Editor: Add "Welcome" dock widget 2016-03-26 01:36:40 -04:00
Lukas Werling 7661b13ba6 Move particle proplist definitions to global Particles.c 2016-03-23 13:24:18 +01:00
Sven Eberhardt b1ac208249 Qt Editor: Add "File->New" menu entry 2016-03-22 23:08:05 -04:00
Lukas Werling b30860112a Use regular Use instead of UseDelayed for gamepads 2016-03-21 18:45:42 +01:00
Lukas Werling f63f4b9ab3 Use regular Throw instead of ThrowDelayed for gamepads
There is no need to delay throwing as aiming is now possible at any time
using the analog stick.
2016-03-21 18:45:42 +01:00
Lukas Werling b8c8bf825c Crosshair: Use analog stick input properly
- Crosshair doesn't work with a dpad anymore. Supporting dpads adds
   unnecessary complexity, as a gamepad user with dpad will never be
   competitive with mouse users.

 - Crosshair isn't bound to item usage anymore, but will always show
   when the analog stick is outside of a deadzone.

Future planned feature: Also use the actual strength to allow
distance input in addition to direction. This is used heavily by
Knüppeln.c4s.
2016-03-21 18:45:42 +01:00
Lukas Werling 93dcb1d729 Improve gamepad assignments
- Add assignments for switching interaction and pickup targets (just
   like the keyboard control).

 - Remove double assignments of the sticks for walking and aiming. The
   left stick is now exclusively for walking and the right stick
   exclusively for aiming.
2016-03-21 18:45:42 +01:00
Lukas Werling 0afa589286 Replace all usage of "bool released" with "int status" 2016-03-21 18:45:42 +01:00
Lukas Werling 19caa65b7b Merge branch 'sdl-gamecontroller' (pull request GH-17) 2016-03-21 16:39:28 +01:00
Maikel de Vries 8d2ab69d03 make GetDefinition work on string parameter
This can be useful to check if a definition is loaded, ideally the implementation is moved to the engine.
2016-03-20 09:15:35 +01:00
Sven Eberhardt 80549ca2cc Qt Editor: Add object creator 2016-03-06 13:06:29 -05:00
Maikel de Vries 9b39f2b18c fix ShuffleArray
When taking a random element from the copy, also consider the last element.
2016-03-05 17:27:20 +01:00
Lukas Werling aa42d1deb7 Make controller button strings nicer
This also removes the controller id from the control definitions,
instead defaulting to 0. This doesn't change anything for now as we only
had definitions for controller 0 anyways.
2016-02-21 18:27:01 +01:00
Lukas Werling 8dd1450e94 Implement "gamepad stick moved" events for analog input
Analog moved events are only sent once per control frame.
2016-02-21 18:26:18 +01:00
Sven Eberhardt e0e09133d6 Qt Editor: Add some string translations. 2016-02-18 00:10:30 -05:00
Lukas Werling 937ddaf722 Update key code strings for game controllers
With the SDL_GameController interface, buttons and axes have actual
names we can refer to. This also allows for advanced mappings using both
sticks (this probably needs script changes) as well as the triggers.
2016-02-13 23:28:00 +01:00
Lukas Werling 4ca5d2bb40 Add variants of Sound(At) taking a proplist for options 2016-02-10 13:14:06 +01:00
Sven Eberhardt 35fcc0ff51 Fix scenario saving of array-typed visibility. Fix ItemSpawn saving and spawn def re-setting. 2016-02-07 13:21:01 -05:00
Maikel de Vries 17fae9c77b add GetSpeed counterpart to SetSpeed 2016-02-03 14:49:05 +01:00
Mark 93ba7c5954 Vendor Library
Extracted the buy menu of the flagpole to a library, so that other objects can implement a buy menu without having to duplicate the code. An overview of the changes follows:

Library_Base:
- Moved auto-sell functionality to Library_Vendor
- Moved buy and sell functionality to Library_Vendor
- Removed the old engine menu for buying and selling

Library_Vendor:
- Added proplist for accessing local variables, avoiding variable clashes
- Added interfaces GetBuyValue, GetBuyableItems, GetBuyableAmount, ChangeBuyableAmount, GetSellValue
- Changed DoBuy: it uses the interface functions, instead of hardcoded base material
- Changed / merged the existing sell functionality and the flagpole sell functionality in DoSell:
   * does not sell items if QueryOnSell returns true
   * sell sound only audible to seller
   * the sold object tries selling its contents first (for example a bow, if it ever were sellable. This may not hold in the settlement games, but adventures would allow it)
   * the sold object ejects any contents before it is removed. These are usually unsellable objects. Previously they would just be removed together with the object. It has to be tested whether this places the items on the ground or at the center of the sold object
   * removed the "sell all" functionality on right-click for the moment.
- Still has some functions from the old base selling: CanStack and GetSellableContents, for the auto-sell functionality
- Fixed a logical error in AllowBuyMenuEntries
- Distinguish between buyer/seller and payer more, so that the logic can easily be changed in one line later
- Allow for runtime overloads of interface functions
- Changed inconsistent variable naming to a more consistent one
- Added namespaces to all sounds, the "UnCash" sound still does not exist
- Added localization strings for insufficient wealth
- Fixed property name error (missing 'e')
- Buy menu is active by default

Flagpole:
- Replaced the custom sell functionality (how many of these do we have actually??) with the sell functionality from Library_Vendor
- Buying menu is allowed if the rule is active

System.ocg/Object.c
- global functions Buy and Sell ask the target if it is a vendor, instead of whether it is a base, and do the callback there.
- renamed the argument so that it is no longer called "base", but "vendor"
2016-01-24 20:11:27 +01:00
Sven Eberhardt d9b8de9ea2 Win32: Fix file deletion from scenario selection dialogue 2016-01-24 00:43:09 -05:00
Sven Eberhardt 28e794654c Add network option to disable UPnP.
Also add some more UPnP failure messages to log.
2016-01-24 00:11:14 -05:00
Nicolas Hake 4b68d82380 planet: Remove Array(Min,Max) in favor of Min,Max
Since the native functions now accept array parameters, we don't need a
C4Script implementation anymore.
2016-01-23 13:49:11 +01:00
Maikel de Vries cfe8008f32 Array.c: add functions to get minimum and maximum of an array (with ints) 2016-01-22 20:54:18 +01:00
Sven Eberhardt b3c0afd521 Add missing string table entries for CON_FallThrough(_Desc). 2016-01-20 21:35:37 -05:00
Julius Michaelis 711df05e1a Add button X to fade through half solidmasks.
Enabled on the elevator case for testing.
2016-01-20 18:58:11 +01:00
Armin Burgmeier 190b4bbae3 Instruct to start a network game when starting a round with >=2 MinPlayers
Instead of asking the user to activate more players, which is no longer
possible as of #1529.
2016-01-11 18:40:59 -08:00
Sven Eberhardt 3dad1c6d81 Turn MaxContentsCount and HandObjects into properties instead of callbacks (Possibly fixes #1553) 2016-01-10 10:41:34 -05:00
Sven Eberhardt dd25f85e6d Warn when assigning duplicate keys #1170 2016-01-09 17:00:21 -04:00
Günther Brammer 7d0990baf9 editor: Don't try to insert manual newlines into error messages 2016-01-08 04:25:26 +01:00
Sven Eberhardt 1933deec44 Fix GUI name and description of interact key #1540 2016-01-07 20:47:18 -04:00
Maikel de Vries 21dead533c killtracing: pass owner and controller correctly in CastObjects 2016-01-03 09:57:06 +01:00
David Dormagen a3e4b620b9 reworked interactions (grabbing etc.)
The player interface is now similar to how picking up works. This should increase acceptance. Also it was pretty fucked up before. The action bar is gone.
The script logic is now outsourced into a new library similar to the other stuff.
Objects can overload the selector for the new interaction (see "call elevator case").

Additional issues hit and resolved when working on this:
Shifting a cursor did not cancel certain actions (and there was no callback for that). This is now solved by adding two new callbacks.

Issues hit and not resolved:
Certain interactions (calling an elevator case, flipping a construction) are in some control library. They should be in the respective objects (and shown via callbacks etc.). Meh.
The internal interface (declaring interactions etc) has a few places where proplists are just translated because the properties are called differently. This is also a fuckup (i.e. a.interaction_object = b.Object) where the properties should just have been called the same in all places from the beginning.
The name "Action Bar" is pretty misleading now as it is no bar. But that's not something visible to the players. todo: cleanup.
2016-01-02 13:02:45 +01:00
Günther Brammer 00a4c6c428 Replace BorderBound DefCore value with BorderBound object property 2016-01-01 22:18:41 +01:00
David Dormagen 9d947c7fb2 make IsProjectileTarget default to true for living beings
..which eliminates the || GetOCF() & OCF_Alive everywhere. It also allows living things to explicitely disable being projectile targets.
This is a lot cleaner imo.
2015-12-28 11:20:11 +01:00
Maikel de Vries 3f7e05caa6 add a global function to draw material triangles 2015-12-28 10:21:49 +01:00
Sven Eberhardt 4d7033718b Fix nil pointer in hit check if shooter gets deleted during no-selfkill-check.
Also rewrite the check using Find_InArray.
2015-12-22 15:15:40 -05:00
Maikel de Vries 8247839455 remove obsolete function GetDefGrab 2015-12-19 10:42:30 +01:00
Maikel de Vries 01dd5fcc27 fix explosion shockwave for vehicles which can be grabbed and pushed
This broke when DefCore Grab was replaced with property Touchable.
2015-12-19 10:42:30 +01:00
Clonkonaut 0108c6667c Made invincible beings (MakeInvincible) immune from shockwaves, windbags and throwing stuff at them. 2015-12-16 23:15:22 +01:00
David Dormagen dcfb986e34 moved sounds into subfolders
This completes http://forum.openclonk.org/topic_show.pl?tid=3215
2015-12-13 22:14:55 +01:00
Sven Eberhardt 1deb7e8176 Add range parameter to ShakeViewport.
Controls the falloff distance, so you can create more localized (or more global) shakes.
2015-12-13 11:11:01 -05:00
Sven Eberhardt 1dca9cf1b5 FightForGidl: No friendly fire and some AI fixes. 2015-12-12 00:02:31 -05:00
David Dormagen cd0e1ef219 cottons: when a fruit pops without being shot, it doesn't drop CottonSeed but directly spawns a plant
This reduces the amount of cotton seeds that lie all over the map. It also eliminates the possibility of being struck dead by falling cotton.
2015-12-09 20:15:05 +01:00
Sven Eberhardt 019cc0d583 Enable immediate tooltips on mouse-over-event for unlabeled icons in lobby and scenario selection (#1132). 2015-12-06 21:03:54 -05:00
David Dormagen 178a91f338 moved some functions that depend on Object.ocd from the global System.ocg to Objects.ocd/System.ocg (#1473)
The global System.ocg should not cause any errors even if Objects.ocd is not loaded. This means that any functions that depend on certain definitions (e.g. FindLocation) will just not be available.
2015-12-02 12:46:02 +01:00
dylanstrategie d284f49b6b Add "ready" button for clients in game lobby.
Signed-off-by: Sven Eberhardt <sven2@goldwipf.de>
2015-11-18 22:49:59 -05:00
David Dormagen eb2b18457e roll: only roll while direction key is held down
This means that you start a roll currently with walking left/right and tapping [down]. OR falling a great height and just holding left/right when landing. When you let go of left/right, you will instantly walk again. This reduces the possibility of the players rolling into an abyss.
2015-11-14 14:58:02 +01:00
Armin cb4dbc3609 Foodstuff heals the Clonk over time. 2015-10-29 11:33:31 +01:00
Julius Michaelis f356c9053a Invert the functionality of CNAT_CollideHalfVehicle 2015-10-21 22:15:33 +02:00
David Dormagen 1bd3354086 contents menu: changed stacking logic (#1424)
Objects now stack iff CanBeStackedWith returns true. The displayed symbol is now the first object of the stack (instead of the definition).
Also fixed barrel to not overwrite the custom name just after setting it.
2015-10-17 12:09:35 +02:00
David Dormagen fcf1d0d843 script guis: added tooltip for default "close" button 2015-10-14 11:22:06 +02:00
David Dormagen 4964fb11ce shift+click support: used undocumented GetPlayerControlState instead of own memory for key state
One of Sven's private functions. I also renamed the control to CON_ModifierMenu1 (from CON_ModifierInventory1), because it's actually supposed to be the menu modifier in general - even if it's mapped on the inventory key.
2015-10-10 00:52:43 +02:00
Sven Eberhardt d136dc22c0 Implement landscape inflammation.
It used to create the non-existent FLAM objects from the engine. Use a script callback to a global function that creates Flame objects instead.
2015-10-09 16:24:16 -04:00
David Dormagen b9420ce68c added shift+click support for menus
Or more generally: added support for any modifier key for any other command without the requirement to define a new command based on the old one plus the key. This can be helpful in situations where the player commands are decoupled from the script engine control handling (e.g. with menus).
Currently Shift+Click is only used by the inventory menu to transfer all items of a certain kind.
2015-10-09 13:14:27 +02:00
Clonkonaut acec73dd51 New global const FIRE_LIGHT_COLOR. Added fire light color to various objects. 2015-10-07 23:26:03 +02:00
David Dormagen 1354c0fd91 split ProjectileHit up into three functions
This better reflects what the function does. "ProjectileHit" was never used solely for projectiles. Neither was everything of that callback ever needed in all places, which resulted in weird flag-parameter hacking and OnStrike-callbacks. Splitting this up also allows customizing different parts of the behavior further (i.e. tumbling) without adding a hundred parameters or flags to the original function.
2015-10-07 07:25:24 +02:00
Sven Eberhardt cc5d43d0b0 Localize loading message for scenario local player control definitions. 2015-10-05 22:38:45 -04:00
Sven Eberhardt 737b1fd8fd Save screenshots in background thread (#998, #1104).
Also ensure music keeps streaming while collecting data for full map screenshot.
2015-09-29 20:48:34 -04:00
Sven Eberhardt ad6a1dfda6 Fix script error on explosion with size zero. 2015-09-26 17:19:24 -04:00
Maikel de Vries 4c66cc4ad7 change time interface to remove connection between System.ocg and Objects.ocd 2015-09-22 23:31:17 +02:00
David Dormagen 745f452afb inventory: allow dropping the hand item on Shift+Throw 2015-09-21 14:21:57 +02:00
David Dormagen 0409f03a17 inventory control: allow picking up all items on shift+up 2015-09-20 18:27:19 +02:00
Sven Eberhardt 95da770892 Move GetDefWidth and GetDefHeight script functions to engine.
They started to appear in script profiler runs and the GetDefVal-implementation is very inefficient.
2015-09-19 21:22:55 -04:00
Clonkonaut 6a9ef8b961 New: Cotton, Cotton Seed, Cloth, Seed Library 2015-09-18 19:44:49 +02:00
Sven Eberhardt 410e570b94 Add localized strings for ToolsDlg foreground and background labels. 2015-09-17 22:30:22 -04:00
Clonkonaut aadbe20f5c Fixed null pointer error in growth effect.
When using negative values for growing (shrinking).
2015-09-17 23:56:44 +02:00
Sven Eberhardt 30a8ef7f0e Store allow_fire parameter of invincibility effect. 2015-09-16 23:30:23 -04:00
Sven Eberhardt aaf5693ecc Remove unnamed controls from control config dialogue. 2015-09-15 20:04:08 -04:00
Sven Eberhardt d1862e0531 Incinerate returns false when effect could not be created.
Happens e.g. if object has a NonFlammable or Invincible effect.
2015-09-14 22:31:51 -04:00
Sven Eberhardt 188b79cd7a MakeInvincible includes MakeNonFlammable by default.
It was always either used in conjunction or forgotten. If someone wants invincibility while still allowing fire (e.g. an unkillable fire golem), there's now a parameter to allow it.
2015-09-14 22:25:27 -04:00
Mark 722a5ad448 Explode: DoShockwave
Added the global function DoShockwave. Updated documentation. Changed the way explosions deal damage: Every object at the center of the explosion gets full damage. Every object inside the explosion radius gets half damage.

(cherry picked from commit 22298a6d1389b5344ebe7aea56f3c371b5ad845f)

Conflicts:
	planet/System.ocg/Explode.c
2015-09-13 13:01:28 +02:00
Mark 15056b823f Explode: Damage override
Added damage override parameter to the explosion functions. Updated the documentation as well.

(cherry picked from commit 59f802c2d3f269d54c12489ac9659ee3ca57a857)

Conflicts:
	planet/System.ocg/Explode.c
2015-09-13 13:01:24 +02:00
Mark 055196155f Explode: if-order
Merged the three if-blocks in DoExplosion() into one if-block. If there was no container in the first if, there should be no container in the following calls.

(cherry picked from commit d504b1109de115f507a09e9e895104bd9552ac53)
2015-09-13 13:01:20 +02:00
Maikel de Vries ad95a39a1c prevent bubble from growing infinitely large 2015-09-11 23:15:23 +02:00
David Dormagen 51bc8dd54d made CastObjects not throw an error when an object removes itself in Construction
It obviously does not throw the object either, though.
2015-09-11 19:08:10 +02:00
Sven Eberhardt 3723024e2f Added implicit layer check to local calls of FindObjects-family functions (#1383).
Also fixed some docs links. Note that GetObjectLayer and SetObjectLayer are still not documented.
2015-09-09 20:19:45 -04:00
Maikel de Vries 01fb44fd49 fix script error when shifting cursor with zero crew members 2015-09-07 16:55:08 +02:00
Maikel de Vries b20ec03832 prevent script error for Loc_Area(nil) call 2015-09-06 11:24:43 +02:00
David Dormagen fa40cfd64d put zooming on Ctrl+MouseWheel (from Shift+MouseWheel)
Shift is now the inventory key. Shift+MouseWheel sounds like it does have some potential, too. (F.e. scrolling through the ammunition in a bow?)
2015-09-05 11:36:27 +02:00
Sven Eberhardt 84fbff95a8 Add Find_Property. 2015-09-02 23:55:45 -04:00
David Dormagen c3c243d31e collection: utilize new key combination functionality; also put collection on shift
Shift instead of Ctrl is more consistent with dropping items, which is on Shift+Number. Incidentally you can now also decide to drop an item to make space for a new one DURING the collection process. Really rather rad.
2015-09-02 23:21:06 +02:00
David Dormagen ac738735b2 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Vehicles.ocd/Airplane.ocd/Script.c
	src/game/C4Game.cpp
	src/game/C4GraphicsSystem.cpp
	src/gamescript/C4GameScript.cpp
2015-09-02 08:19:34 +02:00
David Dormagen e9a69c4252 collect objects solely via CTRL now
The player can also choose which object to collect by holding CTRL and navigating left/right.
2015-08-30 20:39:50 +02:00
Julius Michaelis 2a9b481087 Add a new variant of vehicle that can be passed from below but be walked on from above. 2015-08-30 22:19:36 +09:00
Sven Eberhardt 44a396497c Fix tree growth in skylands scenario (#750) and rework alt tree texture.
Tree growth now implemented using an overload of the grwoth function. Also made the alternate tree skin in skylands a bit more colorful
2015-08-27 23:29:06 -04:00
David Dormagen 0d102d2184 explosion: fix nil-pointer when object removes itself on death
After doing damage to an object, you cannot be sure that the object persists. It might have been blown to smithereens. So, catch that case.
2015-08-20 13:47:27 +02:00
David Dormagen b3f81ef3ed increased lava damage
The lava now does not only do the damage via the fire system but also does some direct damage. Further increasing it might be good. Test it now.
2015-08-16 23:14:16 +02:00
David Dormagen a27888a623 the Clonk now performs a roll when pressing [down] (even when walking)
People have complained that the implicit roll (if you don't know how it worked) could lead to death and severe injury. The roll is now explicit. Always and everywhere.
It doesn't have any other effect though; todo: reduce hit area and/or squash vertices of Clonk during roll
2015-08-07 16:12:41 +02:00
David Dormagen 36544bd56c Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Foundry.ocd/Script.c
	planet/Objects.ocd/Vegetation.ocd/Branch.ocd/Script.c
	planet/Objects.ocd/Vegetation.ocd/Trunk.ocd/Script.c
	planet/System.ocg/FindLocation.c
2015-08-02 19:24:04 +02:00
Sven Eberhardt ed2e56c3fa Fix Loc_Space and allow direction parameter instead of just horizontal/vertical.
The old implementation was buggy as it would disallow the location if it had too much space (and PathFree2 returns nil). It also doesn't make sense to ask for a location that has space in either direction of a dimension because the location is not automatically adjusted to lie at the center of that space. For example, it would effectively cause fish to spawn directly at walls sometimes.
2015-07-31 00:42:01 -04:00
Sven Eberhardt 0d48105b46 Added shape library.
Also fixed some coconut tree reproduction issues.
2015-07-31 00:42:01 -04:00
Clonkonaut cdb4a1b153 Convenient wrapper for Environment_Time: HasDayNightCycle, SetTime, GetTime, IsDay, IsNight 2015-07-23 12:58:19 +02:00
Maikel de Vries 73fb8cf5e1 add RandomElement function to get a random element from an array 2015-07-20 18:11:16 +02:00
Sven Eberhardt 00e2e10e33 Fix GetSurfaceVector when called near a surface.
Parts of the function still assumed the old proplist result format.
2015-07-18 20:45:39 -04:00
Clonkonaut c7c970822d Added Rectangle_IsInside
Checks whether a given position is inside a given rectangle.
2015-07-14 23:26:26 +02:00
Maikel de Vries f492aa5e71 FindLocation: implement material val check and wall check conditions 2015-07-12 22:18:43 +02:00
Mark ecb24dc927 CastObjects: Array
CastObjects returns an array now, so that further function calls can be issued on the created objects.

(cherry picked from commit 184943fe6f720ba26402764bb3b182d550370e74)
2015-07-11 17:48:14 +02:00
Mark a6bab72499 Vector Library conformity
GetSurfaceVector() and the Coral object now use the array format of the vector library for vectors, instead of proplists.

(cherry picked from commit 03f644e56cdc99a84df57451ed1bac361c0c896d)
2015-07-11 17:47:56 +02:00
Sven Eberhardt 9042450399 Fix DoExplosion from global context.
Avoid null pointer and do play sounds.
2015-07-09 01:03:34 -04:00