diff --git a/planet/Objects.ocd/Helpers.ocd/EditorBase.ocd/DefCore.txt b/planet/Objects.ocd/Helpers.ocd/EditorBase.ocd/DefCore.txt new file mode 100644 index 000000000..97587915a --- /dev/null +++ b/planet/Objects.ocd/Helpers.ocd/EditorBase.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=EditorBase +Version=8,0 +Category=C4D_None +Width=8 +Height=8 +Offset=-4,-4 diff --git a/planet/Objects.ocd/Helpers.ocd/EditorBase.ocd/Script.c b/planet/Objects.ocd/Helpers.ocd/EditorBase.ocd/Script.c new file mode 100644 index 000000000..11d360c48 --- /dev/null +++ b/planet/Objects.ocd/Helpers.ocd/EditorBase.ocd/Script.c @@ -0,0 +1,8 @@ +/* Global editor props for all objects */ + +// Do not create +public func Construction() { RemoveObject(); } + +local EditorProp_Invincibility = { Type = "has_effect", Effect = "IntInvincible", Set = "SetInvincibility" }; +local EditorProp_PlayerColor = { Type = "color", AsyncGet = "GetColor", Set = "SetColor" }; +local Plane = 1; diff --git a/planet/System.ocg/Object.c b/planet/System.ocg/Object.c index 87b700f01..884d09b57 100644 --- a/planet/System.ocg/Object.c +++ b/planet/System.ocg/Object.c @@ -78,6 +78,15 @@ global func MakeInvincible(bool allow_fire) return true; } +global func SetInvincibility(bool to_val) +{ + // Turn invincibility on or off + if (to_val) + return MakeInvincible(false); + else + return ClearInvincible(); +} + global func FxIntInvincibleDamage(target) { // avert all damage