2012-07-16 13:14:00 +00:00
|
|
|
/*-- Kitchen --*/
|
|
|
|
|
|
|
|
#include Library_Structure
|
|
|
|
#include Library_Ownable
|
|
|
|
#include Library_Producer
|
|
|
|
|
|
|
|
local hold_production;
|
|
|
|
|
|
|
|
func Construction(object creator)
|
|
|
|
{
|
|
|
|
SetAction("Default");
|
|
|
|
return _inherited(creator, ...);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-- Production --*/
|
|
|
|
|
|
|
|
func IsProduct(id product_id)
|
|
|
|
{
|
|
|
|
return product_id->~IsKitchenProduct();
|
|
|
|
}
|
|
|
|
|
2012-07-26 18:20:45 +00:00
|
|
|
private func ProductionTime(id toProduce) { return 500; }
|
2012-07-16 13:14:00 +00:00
|
|
|
private func PowerNeed() { return 0; }
|
|
|
|
|
2012-07-26 18:20:45 +00:00
|
|
|
public func NeedRawMaterial(id rawmat_id)
|
|
|
|
{
|
|
|
|
if (rawmat_id->~IsFuel() || rawmat_id == Flour)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-07-16 13:14:00 +00:00
|
|
|
public func OnProductionStart(id product)
|
|
|
|
{
|
|
|
|
AddEffect("Working", this, 100, 1, this);
|
|
|
|
hold_production = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public func OnProductionHold(id product)
|
|
|
|
{
|
|
|
|
hold_production = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public func OnProductionContinued(id product)
|
|
|
|
{
|
|
|
|
hold_production = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public func OnProductionFinish(id product)
|
|
|
|
{
|
|
|
|
RemoveEffect("Working", this);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected func FxWorkingTimer()
|
|
|
|
{
|
|
|
|
if(!hold_production)
|
|
|
|
Smoking();
|
|
|
|
}
|
|
|
|
|
|
|
|
private func Smoking()
|
|
|
|
{
|
|
|
|
if (!Random(4)) Smoke(16 * GetCalcDir(),-14,16);
|
|
|
|
if (!Random(6)) Smoke(10 * GetCalcDir(),-14,15+Random(3));
|
2012-07-26 18:20:45 +00:00
|
|
|
|
|
|
|
//Fire
|
2013-10-25 13:42:34 +00:00
|
|
|
CreateParticleEx("Fire", 13 * GetCalcDir(), 16, PV_Random(-1, 1), PV_Random(-1, 1), PV_Random(18, 36), Particles_Fire(), 2);
|
2012-07-16 13:14:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
local ActMap = {
|
|
|
|
Default = {
|
|
|
|
Prototype = Action,
|
|
|
|
Name = "Default",
|
|
|
|
Procedure = DFA_NONE,
|
|
|
|
Directions = 2,
|
|
|
|
FlipDir = 1,
|
|
|
|
Length = 1,
|
|
|
|
Delay = 0,
|
|
|
|
FacetBase=1,
|
|
|
|
NextAction = "Default",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
local Name = "$Name$";
|
|
|
|
local Description ="$Description$";
|
|
|
|
local BlastIncinerate = 100;
|
|
|
|
local HitPoints = 70;
|