forked from Mirrors/openclonk
Sandbox: Added object removing tool and feedback for invincibility tweak
parent
b7297c1358
commit
a7c139bb68
|
@ -0,0 +1,7 @@
|
|||
[DefCore]
|
||||
id=DevilsHand
|
||||
Version=5,2,0,1
|
||||
Category=C4D_Object
|
||||
Width=64
|
||||
Height=64
|
||||
Offset=-32,-32
|
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
|
@ -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());
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
Name=Teufelshand
|
||||
Description=Entfernt zeugs. Was du willst, wo du willst.
|
|
@ -0,0 +1,2 @@
|
|||
Name=Devil's Hand
|
||||
Description=Removes things. What you want, where you want.
|
|
@ -20,6 +20,7 @@ func InitializePlayer(int plr)
|
|||
crew->ShowSandboxUI();
|
||||
|
||||
crew->CreateContents(GodsHand);
|
||||
crew->CreateContents(DevilsHand);
|
||||
crew->CreateContents(SprayCan);
|
||||
crew->CreateContents(Teleporter);
|
||||
|
||||
|
|
|
@ -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"),
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue