Commit Graph

67 Commits (bce903ee0434ffae24bf02c898ab456adee9ffdf)

Author SHA1 Message Date
Maikel de Vries df098d2840 pump only activates when drain is free or accepts liquid 2016-08-07 21:26:23 +02:00
Clonkonaut b6ca10d11a Constructor library: Changed to search through all available knowledge and filter using an overloadable function.
The hammer will now only construct definitions that have the callback "IsHammerBuidable". This will exclude all C4D_Structure objects that are not buildings and can't be build in a meaningful way.
Also, with the carry heavy branch I want to test adhoc built lorries (lorries as construction sites). Sven suggested this.
2016-06-18 19:45:45 +02:00
Maikel de Vries 2a731b2545 implement Components as a property lookup table 2016-05-21 13:34:34 +02:00
Maikel de Vries 1df322b7ff adapt objects and scenarios to new component implementation 2016-05-21 13:34:34 +02:00
Mark 52884fb685 Removed liquid container logic from pump.
Previously, sharing the logic made sense, because both objects used variables to store the liquid. Now, the liquid container stores liquid in an object - this is not desirable in the pump because it would create and remove objects for no good reason (only so that it has a virtual liquid storage) every time it pumps. Consequently, liquid objects cannot enter a pump anymore.
2016-02-26 23:17:38 +01:00
Mark fa0af84686 Fixed pump 2016-02-26 23:03:52 +01:00
Mark e2689ad1c3 Prototype: Liquid objects as menu icon
It seems that real objects would be nicer.
2016-02-16 21:08:23 +01:00
Mark be8fd0833c Oil-burning steam engine
The steam engine can burn oil as fuel now. Added test to power system unit test. Still needs support for actually getting oil into the engine.
Fixed a bug in LiquidContainer that would return no liquid if the entire contents are removed. Added unit test for said bug.
Fixed overspilling of connected liquid containers. Pump no longer counts as a liquid container/tank, so that it still spills liquid if no drain is connected.
2016-02-16 21:04:06 +01:00
Mark e985ffbd45 Changed pipe interface
- connect / disconnect callbacks do not include the line anymore
- the drain and source pipes are set to the pipe now, instead of the line
2016-02-16 21:03:43 +01:00
Mark e99ab4471a Refactoring: Completely remodeled pipe interface
Pipes can connect to nearly anything now. The connecting object is responsible for rejecting the connection.
2016-02-16 21:03:20 +01:00
Mark 5c83545900 Refactoring: Replaced pump internal liquid storage with library function calls
The pump actually stores liquid until it can pump. This may not be desired, but it was like that before my changes already. This probably is better than having it drop excess material at the pump.
2016-02-16 21:03:10 +01:00
Mark 30352e422e Refactoring: Replaced pump pipe variables with library function calls 2016-02-16 21:03:06 +01:00
Mark 9c28cb978a Analysis for refactoring 2016-02-16 21:03:01 +01:00
Mark 371fdaeaa6 Refactoring: Pump interface names
The pump uses the same function names as the liquid tank now. This is a preparation for the consolidation of the two.
2016-02-16 21:02:56 +01:00
Mark e1627a2619 Pump liquids to liquid containers
The pump can transfer liquids to and from liquid containers now. Changed the material storage from material index to material name now, because liquid containers may contain fantasy liquids, too. The pipe cannot output such imaginary liquids though, so only transfer between compatible containers is possible.
2016-02-16 21:02:51 +01:00
Mark 427cacfbba Bugfix: Insert at wrong object 2016-02-16 21:02:46 +01:00
Mark 7b573691a4 Bugfix: Wrong menu entry in pump 2016-02-16 21:02:41 +01:00
Mark 97bdd342fc Refactoring: Pump, pipe, better menu handling
The pipe can be connected from the interaction menu now, too. Expanded the disconnection logic, because more problems arise when the pipe can still be connected to other structures - it would be sufficient to remove the line, but that could be annoying:
- if the pipe is connected to a container, then you can disconnect the pipe from that liquid tank and it will still be connected to the pump
- if you disconnect the pipe from the pump, then it will disconnect from the liquid tank as well

Maybe this is confusing to the user, we can still kick that out later again.
2016-02-16 21:02:32 +01:00
Mark 94d47aa2ba Pump: Menu action constants
Replaced the hardcoded strings in the pump interaction menu with constants.
2016-02-16 21:02:18 +01:00
Mark 35604ec1ac Pump interface:
The pump gets the interfaces ExtractMaterialFromSource and InsertMaterialAtDrain that allow for overloading the pumping process
2016-02-16 21:01:46 +01:00
Sven Eberhardt 1bb78ecd4f Remove some unnecessery animation weights.
These overwrite the animations in their slots while there are no other references to existing animations in the slot.
2016-01-28 23:47:53 -05: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
David Dormagen 95285c6f9e pump: added info about state to interaction menu
The pump is rather complex. This should allow for (new) players to figure out faster whether e.g. the drain pipe is clogged (as opposed to them doing anything wrong).
2015-11-25 12:05:26 +01:00
David Dormagen f333df2c73 always show interaction menu for pump & structures in general
The HasInteractionMenu callback of the pump was eaten by the merge. I checked.
2015-09-10 18:23:44 +02:00
David Dormagen cc3452bd0d custom guis: properly scale with font size now
Previously, the em <-> pixels conversion was a hardcoded value. Now the GUI scales with the font size that can be selected in the options.
Sadly, all scales were off since the hardcoded value was too low.
2015-09-06 19:02:31 +02:00
Sven Eberhardt dd690e62b9 Added anti-clogging mechanism to pump.
Now pipes cycle through several offsets before giving up on the pumping.
2015-09-05 13:10:55 -04:00
David Dormagen 196f528201 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/HUD.ocd/FancyGridMenu.ocd/DefCore.txt
	planet/Objects.ocd/HUD.ocd/GridMenu.ocd/DefCore.txt
	planet/Objects.ocd/Helpers.ocd/Dummy.ocd/Graphics.png
	planet/Objects.ocd/Items.ocd/Tools.ocd/WindBag.ocd/Script.c
	planet/Objects.ocd/Items.ocd/Weapons.ocd/Javelin.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Flag.ocd/Marker.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Flagpole.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Pump.ocd/Script.c
	src/game/C4Game.cpp
	src/gamescript/C4GameScript.cpp
	src/gui/C4GameMessage.cpp
	src/landscape/C4Landscape.cpp
2015-06-03 22:32:36 +02:00
Maikel de Vries 8a297766b3 fix pump power consumption (#1309) 2015-05-13 21:18:15 +02:00
Sven Eberhardt 21500a81a9 Fix pump to clear the last row of pixels (#1057) and allow pumping from pump without source pipe.
ExtractMaterial has been changed to be able to slurp in from the most distant horizontal position rather than the closest to the extraction top center.

Also speed up ExtractMaterial for the common case of no required horizontal shifts.
2015-05-01 18:13:41 +02:00
David Dormagen ebcc397221 add proper support (inventory & interaction-menu contents) for extra slot library
Also fix bug with GuiScriptWindow where scrollbars would not be hidden in some cases (f.e. no-crop parent and negative-top child).
2015-03-19 16:22:06 +01:00
Maikel de Vries 0ed8c2faa5 fix pumping downwards after source emptyness 2015-03-05 20:40:10 +01:00
David Dormagen 6466c6d45b adapted flagpole to the interaction menu; moved some frequent checks (completion/hostility) to the interaction menu; the flag is no longer static back 2015-03-01 11:20:33 +01:00
David Dormagen f169640713 interaction menu: improved support/updating of custom entries; adapted pump & producer to interaction menu
Also fooled around with the layout of the interaction menu. Far from final though.
2015-03-01 10:27:29 +01:00
David Dormagen 047bafaa6a improved support for custom interaction menus; made pump control use the new interaction menu 2015-02-27 11:23:20 +01:00
Maikel de Vries ce37dc181e clean up of the flag library
This might have fixed the appearance of flag markers at the flag's center.
2015-02-08 13:07:56 +01:00
Maikel de Vries a5155f6d88 fixed no power need rule 2015-02-04 12:40:29 +01:00
Maikel de Vries c0ff94eb75 normalize power values to multiples of ten
This makes it easier for internal calculations and that value of 10 now represents a single light bulb. It is advisable to only use multiples of 10 for production and consumption values.
2015-02-04 10:35:15 +01:00
Maikel de Vries 2d00588dff new power system (work in progress) 2015-02-04 10:35:14 +01:00
Maikel de Vries 2d1647ea77 improved prioritizing of power consumers 2014-12-19 21:47:08 +01:00
Maikel de Vries c6d87151d4 allow to cut the pump's source and drain (#1144) 2014-10-18 19:12:55 +02:00
Sven Eberhardt 5094cc5c1b Reworked "Save as scenario" option in editor to write a script file instead of Game.txt. 2013-12-27 17:10:09 +01:00
Clonkonaut 57eb53e298 Sound added to the pump. 2013-11-27 22:23:21 +01:00
Tobias Zwick ddd2db94e0 remove debug log and messages 2013-06-04 20:11:09 +02:00
Tobias Zwick e30d5b9ec5 final fixes and refactorings for the pump 2013-06-04 20:10:51 +02:00
Tobias Zwick 416d49db99 adapt pump to use CanInsertMaterial to determine pump height 2013-06-04 20:09:09 +02:00
David Dormagen 81629cd691 the pump now behaves correctly in regards to the power usage 2013-05-31 22:34:17 +02:00
Tobias Zwick 131ec86b98 refactor pump done. Remaining problem: power system (usage) 2013-05-30 22:11:39 +02:00
Tobias Zwick c4a957a6b1 Merge branch 'master' into pumpstuff
Conflicts:
	planet/Objects.ocd/Structures.ocd/Pump.ocd/Script.c
2013-05-28 22:47:37 +02:00
Tobias Zwick 855ba27d6f tried to refactor pump 2013-05-27 21:51:26 +02:00
Matthias de75275f61 Changed pump to use mesh and script animations 2013-05-27 13:24:42 +02:00