Commit Graph

42 Commits (master)

Author SHA1 Message Date
Maikel de Vries ea72e2e542 clean up library vendor script
Also set up buy all available on shift + click for testing
2018-01-24 17:44:42 +01:00
Maikel de Vries 723a7767f6 add damage indication in interaction menu for destructible library 2017-11-28 15:20:39 +01:00
Lukas Werling afa348ab21 Add comment next to all documented functions in System.ocg
Many functions in System.ocg have proper documentation, but not next to
the code. When changing these functions, it is easy to forget updating
the docs. Nobody likes outdated documentation!
2017-10-21 00:10:42 +02:00
Mark e20d5e87ae Library: Edible items
All the functionality for food is bundled in one library now
2017-07-13 21:48:36 +02:00
Mark 2553f5a388 Object: Variable placement for plants
RootSurface() does not yield good results for all objects, so I think the function should have a parameter for movement range. Re-declarated the variable "i" in the second if-block; I always thought we had scoped variables, it surprises me that the previous version worked.
2017-06-20 21:55:01 +02:00
Maikel de Vries 2b88e77254 adapt System.ocg headers to style guidelines and small clean ups 2017-06-02 17:15:08 +02:00
Maikel de Vries 9e9e664581 only show entering interaction if actually standing at the entrance of an object 2017-05-13 15:04:02 +02:00
Maikel de Vries ae31a1fa96 fix SetVelocity script function for zero angle or speed 2017-03-06 18:52:04 +01:00
Maikel de Vries 59961f3a17 remove base library
* remove library itself
* remove GetBase()
* change flagpole, etc.
* move basematerial library to vendor
2016-12-28 18:19:10 +01:00
Mark f2870dfa16 Object.c: New functions
Needed AddSpeed() in a project and thought that it would be a good addition. AddVelocity() is not used so far, maybe we should remove it again.
2016-11-19 19:05:27 +01:00
David Dormagen 4dd9be0e46 chippies: fix unintended growth through animal library
Inclusion of the library buffed the damage wild chippies do by 100%. This is unintended. Chippies grow (and get stronger) through sucking blood.
A commit that changes this behavior should address this directly. (This commit also makes chippies gain size a bit faster - as a compromise.)

The additional check in StartGrowth reduces overhead in the animals (and possibly plants) library. It is kept in this commit to give reviewers an example case for the check.
2016-09-02 09:34:19 +02: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
Maikel de Vries 18f2b4831a add max size option to StartGrowth 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
Nicolas Hake 8e18a3fc96 Change (int)0 to nil where deprecated 2016-05-13 17:13:34 +02:00
Sven Eberhardt 4e7df72c4c Editor Props: Invincibility and player color. 2016-04-16 22:05:38 -04: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
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
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 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
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
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
Maikel de Vries 80c7dbe674 add functions to correctly retrieve the object's current shape 2015-06-08 21:06:18 +02:00
Mark f9369f9eb4 Different implementation of CreateObject() (#1214)
CreateObject() now does not reposition an object after it has been created, but rather grows it around the center of said object.
To that end a new parameter has been added to DoCon() and SetCon() and the documentation has been updated.
2015-01-13 21:03:27 +01:00
Mark 850bf1b9d4 CreateObject/CreateObjectAbove (#1214)
Renamed CreateObject() to CreateObjectAbove() and replaced all occurrences in script files.
Added CreateObject(), the function may need a rewrite though, see comment in code.
Updated documentation
2015-01-11 19:02:03 +01:00
Nicolas Hake 6c2995fe41 Squelch varargs warnings in System.ocg
The engine (extra)warns whenever you use Par() or ... inside of a
function that is not declared as taking a variable number of arguments.
Change the declaration of all System.ocg varargs functions so it is
immediately obvious.
2014-12-12 23:27:17 +01:00
Sven Eberhardt 5cd9b915b0 Added some dialogue functions and speaker portraits. UpdatedAddMenuItem and CustomMessage to allow more customization for picture graphics.
I would prefer to render the models for speaker portraits directly. However, it seems like it's not currently possible to clip or render models to offscreen surfaces.
2014-07-05 15:25:30 +02:00
David Dormagen ae0a364587 Musket shots now exit at the correct position
Launch() of the bullet now has offset parameters
LaunchProjectile() now only calculates own offset if none was passed to the function
2013-05-24 20:45:32 +02:00
Charles Spurrill 6ea36b5efb GetObjAlpha function added, to be consistent with SetObjAlpha 2012-11-11 12:43:20 -08:00
Charles Spurrill e019cd5655 Added missing 'MoveTowards' function in Math.c and upgraded LaunchProjectile func 2012-08-09 17:37:53 -07:00
David Dormagen 80d94966bc added better documentation to some System.ocg functions 2012-06-05 22:51:09 +02:00
Bernhard Bonigl c87d5d4435 Fixed incorrect GetPosition parameters 2012-05-06 18:10:36 +02:00
Bernhard Bonigl dce8e579d3 Added InFrontOf(object). Returns if the midpoint of the calling object is in front of the other object. 2012-05-06 18:10:16 +02:00
Bernhard Bonigl 4c38caaf27 Merged default into Controls 2012-04-17 17:37:52 +02:00
Bernhard Bonigl 657782cfb6 Fixed Conifers changing rotation on 100 Con instead on construction
StartGrowth now applies a random time-offset so trees don't grow simultanously.
2012-04-17 14:06:40 +02:00
Bernhard Bonigl 1dfc41042a Added helper function GetPosition 2012-04-15 16:14:29 +02:00
Bernhard Bonigl 219bceefcd Added Helper-Functions returning the left/right/top/bottom Edge of an object 2012-04-14 23:36:54 +02:00
Felix Wagner bf795164f2 Resolved all warnings due to global function in included scripts. 2012-04-03 02:12:44 +01:00
Felix Wagner 6e303c4e2c Resorted the functions from C4.c, Commits.c amd Helpers.c 2012-04-03 01:55:55 +01:00