Removed reference to ST-DDT in the tank library, since his code was completely removed. Moved functions in steam engine. Fixed typo in DefCore.txt
liquid_container
Mark 2016-02-08 17:52:19 +01:00
parent cc113a560b
commit b0153fbc51
4 changed files with 39 additions and 87 deletions

View File

@ -6,7 +6,7 @@
--*/
#include Library_CarryHeavy
#include Libary_LiquidContainer
#include Library_LiquidContainer
public func GetCarryTransform(clonk)
{

View File

@ -1,4 +1,4 @@
[DefCore]
id=Libary_LiquidContainer
id=Library_LiquidContainer
Version=6,0
Category=C4D_StaticBack

View File

@ -1,13 +1,19 @@
/* --- Tank --- */
/* --- Tank ---
#include Libary_LiquidContainer
A structure that can contain liquids. Connecting pipes to the
structure can be allowed, but this has to be implemented by the
object.
This is controlled with the callbacks
- QueryConnectPipe
- OnPipeConnect
- OnPipeDisconnect
in that structure.
Author: Marky
*/
#include Library_LiquidContainer
/*
Author: ST-DDT, Marky
Import this to allow the structures to
-fill liquids which has been pumped into the building into the internal contained
-extract liquids from internal contained and pump it somewhere else
*/
static const LIBRARY_TANK_Menu_Action_Add_Drain = "adddrain";
static const LIBRARY_TANK_Menu_Action_Add_Source = "addsource";
@ -18,51 +24,6 @@ static const LIBRARY_TANK_Menu_Action_Cut_Neutral = "cutneutral";
static const LIBRARY_TANK_Menu_Action_Description = "description";
///**
//Extract liquid from this
//@param sznMaterial: Material to extract
//@param inMaxAmount: Max Amount of Material being extracted
//@param pnPump: Object which extracts the liquid
//@param pnPipe: Pipe which extracts the liquid (connected to pnPump)
//@param bnWildcard: Usefull to extract random liquids; use '*' for sznMaterial for all Materials
//@return [irMaterial,irAmount]
// -irMaterial: Material being extracted
// -irAmount: Amount being extracted
//*/
//public func LiquidOutput(string sznMaterial, int inMaxAmount, object pnPump, object pnPipe, bool bnWildcard)
//{
// //Search liquid to pump
// if (bnWildcard)
// {
// if (WildcardMatch(szLiquid, sznMaterial))
// sznMaterial = szLiquid;
// }
// //Wrong material?
// if (szLiquid != sznMaterial)
// return ["", 0];
// inMaxAmount = Min(inMaxAmount, iLiquidAmount);
// iLiquidAmount -= inMaxAmount;
// return [szLiquid, inMaxAmount];
//}
//
///**
//Insert liquid to this
// @param sznMaterial: Material to insert
// @param inMaxAmount: Max Amount of Material being inserted
// @param pnPump: Object which inserts the liquid
// @param pnPipe: Pipe which inserts the liquid (connected to pnPump)
// @return irAmount: The inserted amount
//*/
//public func LiquidInput(string sznMaterial, int inMaxAmount, object pnPump, object pnPipe)
//{
// //wrong material?
// if (szLiquid != sznMaterial)
// return 0;
// inMaxAmount = Min(MaxFillLevel() - iLiquidAmount, inMaxAmount);
// iLiquidAmount += inMaxAmount;
// return inMaxAmount;
//}
local lib_tank; // proplist for local variables
/* ---------- Callbacks ---------- */

View File

@ -208,7 +208,30 @@ func GetLiquidContainerMaxFillLevel()
return 300; // can store one barrel - this should be enough, so that the pump does not fill too much oil into the engine
}
func QueryConnectPipe(object pipe)
{
if (GetNeutralPipe())
{
pipe->Report("$MsgHasPipes$");
return true;
}
if (pipe->IsDrainPipe() || pipe->IsNeutralPipe())
{
return false;
}
else
{
pipe->Report("$MsgPipeProhibited$");
return true;
}
}
func OnPipeConnect(object pipe, string specific_pipe_state)
{
SetNeutralPipe(pipe);
pipe->Report("$MsgConnectedPipe$");
}
/*-- Properties --*/
@ -253,35 +276,3 @@ local BlastIncinerate = 130;
local HitPoints = 100;
local Name = "$Name$";
local Description = "$Description$";
func QueryConnectPipe(object pipe)
{
if (GetNeutralPipe())
{
pipe->Report("$MsgHasPipes$");
return true;
}
if (pipe->IsDrainPipe() || pipe->IsNeutralPipe())
{
return false;
}
else
{
pipe->Report("$MsgPipeProhibited$");
return true;
}
}
func OnPipeConnect(object pipe, string specific_pipe_state)
{
SetNeutralPipe(pipe);
pipe->Report("$MsgConnectedPipe$");
}