forked from Mirrors/openclonk
c4script: some fixes for style guidelines and typos
parent
b88e72c67a
commit
84063e1917
|
@ -94,8 +94,6 @@ func DoEat(object obj)
|
|||
obj->DoEnergy(-BiteStrength);
|
||||
hunger -= 20;
|
||||
if (hunger < 0) hunger = 0;
|
||||
//CastParticles("MaterialParticle", 10, 10, 0, 0, 10, 20, RGB(200, 5, 5), RGB(200, 5, 5));
|
||||
|
||||
DoEnergy(BiteStrength);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ public func GetExtraInteractions()
|
|||
var functions = _inherited(...);
|
||||
|
||||
// dropping carry heavy
|
||||
if(IsCarryingHeavy() && GetAction() == "Walk")
|
||||
if (IsCarryingHeavy() && GetAction() == "Walk")
|
||||
{
|
||||
var ch = GetCarryHeavy();
|
||||
PushBack(functions, {Fn = "DropCarryHeavy", Description=ch->GetDropDescription(), Object=this, IconName="", IconID=Icon_LetGo, Priority=1});
|
||||
|
@ -120,13 +120,13 @@ public func GetExtraInteractions()
|
|||
/** Tells the clonk that he is carrying the given carry heavy object */
|
||||
public func CarryHeavy(object target)
|
||||
{
|
||||
if(!target)
|
||||
if (!target)
|
||||
return;
|
||||
// actually.. is it a carry heavy object?
|
||||
if(!target->~IsCarryHeavy())
|
||||
if (!target->~IsCarryHeavy())
|
||||
return;
|
||||
// only if not carrying a heavy objcet already
|
||||
if(IsCarryingHeavy())
|
||||
// only if not carrying a heavy object already
|
||||
if (IsCarryingHeavy())
|
||||
return;
|
||||
|
||||
lib_carryheavy_obj = target;
|
||||
|
|
|
@ -110,7 +110,7 @@ protected func OnActionChanged(string oldaction)
|
|||
Description = A description of what the interaction does
|
||||
IconID = ID of the definition that contains the icon (like GetInteractionMetaInfo)
|
||||
IconName = Name of the graphic for the icon (like GetInteractionMetaInfo)
|
||||
Priority = Where to sort in in the interaction-list. 0=front, 10=after script, 20=after vehicles, 30=after structures, nil means no preverence
|
||||
Priority = Where to sort in in the interaction-list. 0=front, 10=after script, 20=after vehicles, 30=after structures, nil means no preference
|
||||
*/
|
||||
public func GetExtraInteractions()
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
local alpha;
|
||||
|
||||
func Initialize()
|
||||
public func Initialize()
|
||||
{
|
||||
// Set graphics to a random fragment.
|
||||
var graphic = Random(4);
|
||||
|
@ -20,7 +20,7 @@ func Initialize()
|
|||
AddTimer("ProcessFragment", 4);
|
||||
}
|
||||
|
||||
func ProcessFragment()
|
||||
public func ProcessFragment()
|
||||
{
|
||||
// Remove object if con is too small or when alpha is too high.
|
||||
if (GetCon() < 40 || alpha > 200)
|
||||
|
|
|
@ -17,7 +17,7 @@ local HitPoints = 0;
|
|||
// Don't override!
|
||||
local lib_destructible_is_damaged = false;
|
||||
|
||||
func Damage(int change, int cause, int by_player)
|
||||
public func Damage(int change, int cause, int by_player)
|
||||
{
|
||||
_inherited(change, cause, by_player, ...);
|
||||
|
||||
|
|
|
@ -238,8 +238,8 @@ public func TurnWheels()
|
|||
}
|
||||
}
|
||||
|
||||
// Custom fragments
|
||||
func OnDestruction(int change, int cause, int by_player)
|
||||
// Custom fragments on callback from destructible library.
|
||||
public func OnDestruction(int change, int cause, int by_player)
|
||||
{
|
||||
// Only exit objects and parts if this lorry is not contained.
|
||||
if (!Contained())
|
||||
|
|
Loading…
Reference in New Issue