forked from Mirrors/openclonk
Added Foundry structure
parent
742b5ae855
commit
1b1cad0cd6
|
@ -12,6 +12,9 @@ protected func Hit()
|
|||
Sound("RockHit*");
|
||||
}
|
||||
|
||||
public func IsFuel() { return 1; }
|
||||
public func GetFuelAmount() { return 80; }
|
||||
|
||||
local Collectible = 1;
|
||||
local Name = "$Name$";
|
||||
local Description = "$Description$";
|
||||
|
|
|
@ -7,7 +7,7 @@ Height=4
|
|||
Offset=-6,-2
|
||||
Vertices=3
|
||||
VertexX=-5,5,0
|
||||
VertexY=2,-2,0
|
||||
VertexY=0,0,0
|
||||
VertexCNAT=1,2,16
|
||||
VertexFriction=30,30,30
|
||||
Value=8
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Furnace sounds - Dynamicell
|
||||
Sizzle (cast) - Mirors_
|
||||
Pop - Traveler
|
||||
Clonk - Stickinthemud
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,20 @@
|
|||
[DefCore]
|
||||
id=Foundry
|
||||
Version=4,10,0,0
|
||||
Category=C4D_Structure
|
||||
Width=52
|
||||
Height=40
|
||||
Offset=-26,-20
|
||||
Vertices=4
|
||||
VertexX=0,20,-22,23
|
||||
VertexY=-15,-15,19,19
|
||||
VertexFriction=50,50,100,100
|
||||
Value=200
|
||||
Mass=4500
|
||||
GrabPutGet=3
|
||||
Components=Rock=6;Wood=2;
|
||||
Collection=16,-4,17,17
|
||||
Exclusive=1
|
||||
BlastIncinerate=100
|
||||
Construction=1
|
||||
ContainBlast=1
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 408 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
|
@ -0,0 +1,56 @@
|
|||
material Metal
|
||||
{
|
||||
receive_shadows on
|
||||
technique
|
||||
{
|
||||
pass
|
||||
{
|
||||
ambient 1.500000 1.500000 1.500000 1.000000
|
||||
diffuse 1.000000 1.000000 1.000000 1.000000
|
||||
specular 0.000000 0.000000 0.000000 1.000000 12.500000
|
||||
emissive 0.000000 0.000000 0.000000 1.000000
|
||||
scene_blend alpha_blend
|
||||
texture_unit
|
||||
{
|
||||
texture MoltenMetal.png
|
||||
tex_address_mode wrap
|
||||
filtering trilinear
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
material MetalFlow : Metal
|
||||
{
|
||||
technique 0
|
||||
{
|
||||
pass 0
|
||||
{
|
||||
texture_unit 0
|
||||
{
|
||||
scroll_anim 0 -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
material Foundry
|
||||
{
|
||||
receive_shadows on
|
||||
technique
|
||||
{
|
||||
pass
|
||||
{
|
||||
ambient 0.500000 0.500000 0.500000 1.000000
|
||||
diffuse 1.000000 1.000000 1.000000 1.000000
|
||||
specular 0.000000 0.000000 0.000000 1.000000 12.500000
|
||||
emissive 0.000000 0.000000 0.000000 1.000000
|
||||
texture_unit
|
||||
{
|
||||
texture Foundry.png
|
||||
tex_address_mode wrap
|
||||
filtering trilinear
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
/*-- Foundry --*/
|
||||
|
||||
public func Initialize()
|
||||
{
|
||||
AddEffect("SmeltCheck", this, 1, 12, this);
|
||||
}
|
||||
|
||||
local exit_x = -20;
|
||||
local exit_y = 16;
|
||||
local cast = 0;
|
||||
|
||||
public func RejectCollect(id def, object obj)
|
||||
{
|
||||
if(obj->GetID() != Ore && obj->~IsFuel() != true) return true;
|
||||
else
|
||||
{
|
||||
Sound("Clonk.ogg");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public func FoundryEject(object target)
|
||||
{
|
||||
target->Exit(-20 + exit_x,exit_y,-1,0);
|
||||
//sound;
|
||||
}
|
||||
|
||||
public func FxSmeltCheckTimer(object target, int num, int timer)
|
||||
{
|
||||
if(ContentsCount(Wood) >= 2 || FindContents(Coal))
|
||||
if(FindContents(Ore))
|
||||
{
|
||||
if(!GetEffect("Smelting",this) && cast == 0)
|
||||
{
|
||||
AddEffect("Smelting",this,1,1,this);
|
||||
Sound("FurnaceStart.ogg");
|
||||
AddEffect("IntSoundDelay",this,1,1,this);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public func FxSmeltingStart(object target, int num, int temporary)
|
||||
{
|
||||
FindContents(Ore)->RemoveObject();
|
||||
|
||||
//Use coal as firing material
|
||||
var coal = FindContents(Coal);
|
||||
if(coal)
|
||||
{
|
||||
coal->RemoveObject();
|
||||
return;
|
||||
}
|
||||
|
||||
//Use wood as firing material
|
||||
if(ContentsCount(Wood) >= 2)
|
||||
{
|
||||
FindContents(Wood)->RemoveObject();
|
||||
FindContents(Wood)->RemoveObject();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public func FxSmeltingTimer(object target, int num, int timer)
|
||||
{
|
||||
Message(Format("Smelting %d",timer));
|
||||
//Visuals
|
||||
//Fire
|
||||
CreateParticle("Fire",10,14,RandomX(-1,1),RandomX(-1,1),RandomX(25,50),RGB(255,255,255));
|
||||
|
||||
//Smoke
|
||||
CreateParticle("ExploSmoke",9,-35,RandomX(-2,2),-7 + RandomX(-2,2),RandomX(100,400),RGBa(255,255,255,50));
|
||||
|
||||
|
||||
if(timer == 244)
|
||||
{
|
||||
//Pour
|
||||
SetMeshMaterial("MetalFlow",1);
|
||||
}
|
||||
|
||||
//Molten metal hits cast... Sizzling sound
|
||||
if(timer == 256) Sound("Cast.ogg");
|
||||
|
||||
if(timer > 244 && timer < 290)
|
||||
{
|
||||
CreateParticle("Fire",-17,14,-1 + RandomX(-1,1), 2+ RandomX(-1,1),RandomX(5,15),RGB(255,255,255));
|
||||
}
|
||||
|
||||
if(timer == 290)
|
||||
{
|
||||
SetMeshMaterial("Metal",1);
|
||||
cast = 1;
|
||||
AddEffect("EjectMetal",this, 1, 1, this);
|
||||
Sound("FurnaceLoop.ogg",false,100,nil,-1);
|
||||
Sound("FurnaceStop.ogg");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public func FxEjectMetalTimer(object target, int num, int timer)
|
||||
{
|
||||
if(timer > 24)
|
||||
{
|
||||
var metal = CreateObject(Metal, exit_x, exit_y);
|
||||
metal->SetSpeed(0,-17);
|
||||
metal->SetR(30 - Random(59));
|
||||
Sound("Pop.ogg");
|
||||
cast = 0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public func FxIntSoundDelayTimer(object target, int num, int timer)
|
||||
{
|
||||
if(timer >= 100)
|
||||
{
|
||||
Sound("FurnaceLoop.ogg",false,100,nil,+1);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
func Definition(def) {
|
||||
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(2000,0,7000),Trans_Rotate(-20,1,0,0),Trans_Rotate(30,0,1,0)), def);
|
||||
}
|
||||
|
||||
local Touchable = 1;
|
||||
local Name = "$Name$";
|
|
@ -0,0 +1 @@
|
|||
Name=Hochofen
|
|
@ -0,0 +1 @@
|
|||
Name=Foundry
|
|
@ -12,7 +12,7 @@ Rules=Rule_EnergyNeed=1
|
|||
[Player1]
|
||||
Wealth=250
|
||||
Crew=Clonk=2
|
||||
Buildings=ToolsWorkshop=1;WindGenerator=2;SteamEngine=1;WoodenCabin=1;Pump=1
|
||||
Buildings=ToolsWorkshop=1;WindGenerator=2;SteamEngine=1;WoodenCabin=1;Pump=1;Foundry=1;
|
||||
|
||||
[Player2]
|
||||
Wealth=50,0,0,250
|
||||
|
|
Loading…
Reference in New Issue