Added a helmet by pluto. Wear and get 20% off damage*!

*: not all damage is reduced, does not help against explosions, fire, asphyxiation or corrosion. We assume no liability for any deaths or injuries occurred while wearing.
qteditor^2
Clonkonaut 2016-08-12 18:25:01 +02:00
parent 43117a53bd
commit 1036bad7fb
8 changed files with 143 additions and 0 deletions

View File

@ -0,0 +1,14 @@
[DefCore]
id=Helmet
Version=8,0
Category=C4D_Object
Width=10
Height=10
Offset=-5,-5
Vertices=2
VertexX=0,0
VertexY=-4,5
VertexFriction=50,50
Value=10
Mass=10
Rotate=1

View File

@ -0,0 +1,23 @@
material Helmet_Greek
{
receive_shadows on
technique
{
pass
{
cull_hardware none
ambient 0.8 0.8 0.8 1.0
diffuse 0.64 0.64 0.64 1.0
specular 0.16 0.16 0.16 1.0 12.5
emissive 0.0 0.0 0.0 1.0
texture_unit
{
texture helmet.jpg
tex_address_mode wrap
filtering trilinear
}
}
}
}

View File

@ -0,0 +1,102 @@
/**
Helmet
Protective head armor.
@author: pluto, Clonkonaut
*/
#include Library_Wearable
/*-- Engine Callbacks --*/
func Hit()
{
Sound("Hits::Materials::Metal::DullMetalHit?");
}
/*-- Usage --*/
public func ControlUse(object clonk)
{
if (IsWorn())
TakeOff();
else
PutOn(clonk);
return true;
}
// Helmet effect: 20% less damage
func OnDamage(int damage, int cause, int by_player)
{
// Do nothing on energy gained
if (damage > 0) return damage;
// Doesn't protect against all damage
if (cause == FX_Call_EngBlast || cause == FX_Call_EngFire || cause == FX_Call_EngAsphyxiation || cause == FX_Call_EngCorrosion)
return damage;
return damage - (damage*20/100);
}
/*-- Production --*/
public func IsWeapon() { return true; }
public func IsArmoryProduct() { return true; }
/*-- Display --*/
public func GetWearPlace()
{
return WEARABLE_Head;
}
public func GetWearBone()
{
return "Main";
}
public func GetWearTransform()
{
return Trans_Mul(Trans_Rotate(90, 0, 0, 1), Trans_Translate(0, -300));
}
public func GetCarryMode(object clonk, bool secondary)
{
if (IsWorn() || display_disabled)
return CARRY_None;
if (secondary || !clonk->~HasHandAction(false, true))
return CARRY_Back;
return CARRY_BothHands;
}
public func GetCarryPhase(object clonk)
{
return 550;
}
public func GetCarryBone(object clonk, bool secondary)
{
return "Main";
}
public func GetCarryTransform(object clonk, bool secondary, bool no_hand, bool on_back)
{
if (secondary)
return Trans_Mul(Trans_Rotate(180, 1), Trans_Rotate(0, 0, 1), Trans_Rotate(90, 0, 0, 1), Trans_Translate(-4000));
if (no_hand || on_back)
return Trans_Mul(Trans_Rotate(0, 1), Trans_Rotate(0, 0, 1), Trans_Rotate(90, 0, 0, 1), Trans_Translate(-4000));
return Trans_Mul(Trans_Rotate(80, 0, 0, 1), Trans_Rotate(-90, 0, 1), Trans_Rotate(-45, 0, 0, 1), Trans_Translate(-1000, 4000));
}
func Definition(def)
{
SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(45, 0, 1), Trans_Rotate(10, 0, 0, 1)),def);
}
/*-- Properties --*/
local Name = "$Name$";
local Description = "$Description$";
local Collectible = true;
local Components = {Wood = 1, Metal = 1};

View File

@ -0,0 +1,2 @@
Name=Helm
Description=Bietet dem Clonk einigen Schutz. Drücke [Benutzen] um den Helm auf- oder abzusetzen.

View File

@ -0,0 +1,2 @@
Name=Helmet
Description=Provides the clonk with some protection. Press [Use] to take the helmet on or off.

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB