forked from Mirrors/openclonk
New decoration object: tunnel support (graphics by Ringwaul, from a long time ago).
Can be stretched using the Extend() function.alut-include-path
parent
ad6a986d10
commit
649c61cd2a
|
@ -0,0 +1,7 @@
|
|||
[DefCore]
|
||||
id=Deco_TunnelSupport
|
||||
Version=8,0
|
||||
Category=C4D_StaticBack
|
||||
Width=30
|
||||
Height=30
|
||||
Offset=-15,-15
|
Binary file not shown.
|
@ -0,0 +1,21 @@
|
|||
material TunnelSupport
|
||||
{
|
||||
receive_shadows on
|
||||
technique
|
||||
{
|
||||
pass
|
||||
{
|
||||
ambient 1.0 1.0 1.0 1.0
|
||||
diffuse 0.800000011920929 0.800000011920929 0.800000011920929 1.0
|
||||
specular 0.2638509273529053 0.2638509273529053 0.2638509273529053 1.0 5.0
|
||||
emissive 0.0 0.0 0.0 1.0
|
||||
|
||||
texture_unit
|
||||
{
|
||||
texture TunnelSupport.png
|
||||
tex_address_mode wrap
|
||||
filtering trilinear
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
Tunnel support
|
||||
Purely for decoration
|
||||
|
||||
@authors: Clonkonaut, Ringwaul (Graphics)
|
||||
*/
|
||||
|
||||
local extension = 0;
|
||||
|
||||
func Construction()
|
||||
{
|
||||
SetProperty("MeshTransformation", Trans_Rotate(RandomX(75, 105), 0,1,0));
|
||||
}
|
||||
|
||||
// Stretch the support beams
|
||||
// 0 equals standard height (~30 pixels)
|
||||
// 100 is about 85 pixels
|
||||
public func Extend(int percentage)
|
||||
{
|
||||
percentage = BoundBy(percentage, 0, 100);
|
||||
|
||||
extension = percentage;
|
||||
|
||||
percentage = 2500 * percentage / 100;
|
||||
PlayAnimation("extend", 1, Anim_Const(percentage));
|
||||
|
||||
var height = 30 + (55 * percentage / 100);
|
||||
SetShape(-15, -height/2, 30, height);
|
||||
}
|
||||
|
||||
public func SaveScenarioObject(props)
|
||||
{
|
||||
if (!inherited(props, ...))
|
||||
return false;
|
||||
|
||||
props->AddCall("Extension", this, "Extend", extension);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*-- Properties --*/
|
||||
|
||||
local Name = "$Name$";
|
||||
local Plane = 701;
|
|
@ -0,0 +1 @@
|
|||
Name=Tunnelstütze
|
|
@ -0,0 +1 @@
|
|||
Name=Tunnel support
|
Binary file not shown.
After Width: | Height: | Size: 84 KiB |
Binary file not shown.
Loading…
Reference in New Issue