Merge default into heavy-resources

heavy-resources
Bernhard Bonigl 2012-04-08 02:17:07 +02:00
commit b938ca98fd
14 changed files with 83 additions and 17 deletions

View File

@ -5,7 +5,7 @@ Density=50
Friction=100
BlastFree=1
Blast2Object=Nugget
Blast2ObjectRatio=100
Blast2ObjectRatio=150
MaxAirSpeed=100
MaxSlide=1
Placement=50

View File

@ -526,6 +526,21 @@ func StartStand()
During scaling the clonk adjusts his rotation to the ground.. When he is a the top, he uses a extra animation. When the wall doesn't have a platform for the feet he just scales using his arms.
--*/
/* Renders the clonk unable to scale */
func DisableScale()
{
if (!this.ActMap.Scale) return;
this.Scale = this.ActMap.Scale;
this.ActMap.Scale = nil;
}
/* Reenabled hangling */
func EnableScale()
{
if (!this.Scale) return;
this.ActMap.Scale = this.Scale;
this.Scale = nil;
}
func StartScale()
{
if(!GetEffect("IntScale", this))
@ -759,11 +774,24 @@ func FxFallTimer(object target, effect, int timer)
Adjust the speed sinusoidal. Plays two different stand animations according to the position the clonk stops.
--*/
/* Renders the clonk unable to hangle */
func DisableHangle()
{
if (!this.ActMap.Hangle) return;
this.Hangle = this.ActMap.Hangle;
this.ActMap.Hangle = nil;
}
/* Reenabled hangling */
func EnableHangle()
{
if (!this.Hangle) return;
this.ActMap.Hangle = this.Hangle;
this.Hangle = nil;
}
/* Replaces the named action by an instance with a different speed */
func PushActionSpeed(string action, int n)
{
if (ActMap == this.Prototype.ActMap)
ActMap = { Prototype = this.Prototype.ActMap };
ActMap[action] = { Prototype = ActMap[action], Speed = n };
if (this.Action == ActMap[action].Prototype)
this.Action = ActMap[action];

View File

@ -32,6 +32,10 @@ protected func Construction()
{
_inherited(...);
// Modifiable ActMap
if (ActMap == this.Prototype.ActMap)
ActMap = { Prototype = this.Prototype.ActMap };
SetAction("Walk");
SetDir(Random(2));
// Broadcast for rules

View File

@ -2,12 +2,12 @@
id=Nugget
Version=4,10,0,0
Category=C4D_Object
Width=8
Height=8
Offset=-4,-4
Width=12
Height=12
Offset=-6,-6
Vertices=3
VertexX=0,2,-2
VertexY=1,-1,-1
VertexX=0,4,-4
VertexY=3,-3,-3
VertexFriction=40,40,40
Value=5
Mass=12

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -0,0 +1,14 @@
material GoldNugget
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 0.649770 0.594821 0.122168 1.000000
specular 0.652682 0.652682 0.652682 1.000000 18.000000
emissive 0.348690 0.319202 0.065559 1.000000
}
}
}

View File

@ -1,11 +1,9 @@
/*--- Nugget ---*/
protected func Construction()
{
var graphic = Random(5);
if(graphic)
SetGraphics(Format("%d",graphic));
}
#include Library_CarryHeavy
public func GetCarryMode(clonk) { return CARRY_BothHands; }
public func GetCarryPhase() { return 800; }
protected func Hit(x, y)
{
@ -16,7 +14,9 @@ protected func Hit(x, y)
public func IsFoundryIngredient() { return true; }
public func IsValuable(){ return true; }
local Collectible = 1;
func Definition(def) {
SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(30,0,0,1),Trans_Rotate(-30,1,0,0),Trans_Scale(1300)),def);
}
local Name = "$Name$";
local Description = "$Description$";
local Description = "$Description$";
local Touchable = 2;

View File

@ -125,12 +125,32 @@ func FxIntLiftHeavyStop(object clonk, proplist effect, int reason, bool tmp)
// -------------------
// Carrying the object
// -------------------
func FxIntCarryHeavyStart(object clonk, proplist effect, int temp)
{
if (temp) return;
clonk->DisableScale();
clonk->DisableHangle();
var throw = clonk.ThrowSpeed;
if (throw < 150) return; // I know this may be bad in some situations and result in normal throwing speed
// If so, see it as an easter egg exploit!
clonk.ThrowSpeed -= 150;
effect.throw = throw - clonk.ThrowSpeed;
}
func FxIntCarryHeavyTimer(object clonk, proplist effect, int timer)
{
//Delete this effect if not contained in the clonk anymore
if(Contained() != clonk) return -1;
}
func FxIntCarryHeavyStop(object clonk, proplist effect, int reason, bool temp)
{
if (temp) return;
clonk->EnableScale();
clonk->EnableHangle();
clonk.ThrowSpeed += effect.throw;
}
// ------------------
// Dropping the object
// ------------------