diff --git a/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/DefCore.txt b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/DefCore.txt new file mode 100644 index 000000000..9c7945470 --- /dev/null +++ b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=DevilsHand +Version=5,2,0,1 +Category=C4D_Object +Width=64 +Height=64 +Offset=-32,-32 \ No newline at end of file diff --git a/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Graphics.png b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Graphics.png new file mode 100644 index 000000000..bff0a9427 Binary files /dev/null and b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Graphics.png differ diff --git a/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Script.c b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Script.c new file mode 100644 index 000000000..ae573ce43 --- /dev/null +++ b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Script.c @@ -0,0 +1,34 @@ + +/* + + Devils's Hand, a tool to remove objects. + + @author: K-Pone + +*/ + + +local Name = "$Name$"; +local Description = "$Description$"; + +func Initialize() +{ + +} + +func ControlUse(object clonk, x, y) +{ + var dummy = clonk->CreateObject(Dummy, x, y); // Dummy is only needed to have a reference point for Find_Distance + var remobj = dummy->FindObject(Find_Distance(5), Find_NoContainer(), Find_Not(Find_ID(Clonk))); + dummy->RemoveObject(); + + if (!remobj) + { + Sound("UI::Error"); + return; + } + + remobj->RemoveObject(); + + Sound("UI::Click", true, nil, clonk->GetOwner()); +} \ No newline at end of file diff --git a/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/StringTblDE.txt b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/StringTblDE.txt new file mode 100644 index 000000000..b70af1ed7 --- /dev/null +++ b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/StringTblDE.txt @@ -0,0 +1,2 @@ +Name=Teufelshand +Description=Entfernt zeugs. Was du willst, wo du willst. \ No newline at end of file diff --git a/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/StringTblUS.txt b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/StringTblUS.txt new file mode 100644 index 000000000..e89270f5a --- /dev/null +++ b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/StringTblUS.txt @@ -0,0 +1,2 @@ +Name=Devil's Hand +Description=Removes things. What you want, where you want. \ No newline at end of file diff --git a/planet/Tutorials.ocf/Sandbox.ocs/Script.c b/planet/Tutorials.ocf/Sandbox.ocs/Script.c index f007fbd10..b90ac3707 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/Script.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/Script.c @@ -20,6 +20,7 @@ func InitializePlayer(int plr) crew->ShowSandboxUI(); crew->CreateContents(GodsHand); + crew->CreateContents(DevilsHand); crew->CreateContents(SprayCan); crew->CreateContents(Teleporter); diff --git a/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/Clonk_SandboxUI.c b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/Clonk_SandboxUI.c index 20baf5eeb..a7983578f 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/Clonk_SandboxUI.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/Clonk_SandboxUI.c @@ -288,7 +288,7 @@ local ObjectSpawnMenuOpts = Priority = 99, Caption = "$OSCatGodTools$", Icon = GodsHand, - Items = [GodsHand, SprayCan, Teleporter, Marker] + Items = [GodsHand, DevilsHand, SprayCan, Teleporter, Marker] } }; @@ -1256,7 +1256,7 @@ func ShowTweaksUI() Style = GUI_TextVCenter, }, - OnClick = GuiAction_Call(this, "SetInvincibility", true), + OnClick = GuiAction_Call(this, "TweaksUI_SetInvincibility", true), OnMouseIn = GuiAction_SetTag("Hover"), OnMouseOut = GuiAction_SetTag("Std"), }, @@ -1281,7 +1281,7 @@ func ShowTweaksUI() Style = GUI_TextVCenter, }, - OnClick = GuiAction_Call(this, "SetInvincibility", false), + OnClick = GuiAction_Call(this, "TweaksUI_SetInvincibility", false), OnMouseIn = GuiAction_SetTag("Hover"), OnMouseOut = GuiAction_SetTag("Std"), }, diff --git a/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/StringTblDE.txt b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/StringTblDE.txt index cdbff25a2..5c957bfba 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/StringTblDE.txt +++ b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/StringTblDE.txt @@ -83,6 +83,8 @@ MapGenTPCaves=Höhlen TweakInvincible=Unverwundbarkeit (Gott-Modus) OptActivate=Aktivieren OptDeactivate=Deaktivieren +TweakInvincible_Activated=%s ist jetzt unverwundbar +TweakInvincible_Deactivated=%s ist jetzt nicht mehr unverwundbar TweakSkinChoose=Skin wechseln OptSkin1=Abenteurer diff --git a/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/TweaksUIFuncs.c b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/TweaksUIFuncs.c new file mode 100644 index 000000000..43a47a73a --- /dev/null +++ b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/TweaksUIFuncs.c @@ -0,0 +1,12 @@ + +#appendto Clonk + +func TweaksUI_SetInvincibility(newValue) +{ + if (newValue == true) + Log("$TweakInvincible_Activated$", this->GetName()); + else + Log("$TweakInvincible_Deactivated$", this->GetName()); + + return this->SetInvincibility(newValue); +} \ No newline at end of file