forked from Mirrors/openclonk
Add earthquake user action
parent
bdb3118309
commit
b0429bdbcd
|
@ -132,3 +132,25 @@ protected func FxIntEarthquakeTimer(object target, effect, int time)
|
|||
/*-- Proplist --*/
|
||||
|
||||
local Name = "$Name$";
|
||||
|
||||
|
||||
/* Editor */
|
||||
|
||||
public func Definition(def, ...)
|
||||
{
|
||||
UserAction->AddEvaluator("Action", "Disasters", "$LaunchEarthquake$", "$LaunchEarthquakeHelp$", "launch_earthquake", [def, def.EvalAct_LaunchEarthquake], { Strength={Function="int_constant", Value=50} }, { Type="proplist", Display="{{Position}}, {{Strength}}", EditorProps = {
|
||||
Position = new UserAction.Evaluator.Position { EditorHelp="$PositionHelp$" },
|
||||
Strength = new UserAction.Evaluator.Integer { Name="$Strength$", EditorHelp="$StrengthHelp$" },
|
||||
} } );
|
||||
}
|
||||
|
||||
private func EvalAct_LaunchEarthquake(proplist props, proplist context)
|
||||
{
|
||||
// Earthquake through user action
|
||||
var position = UserAction->EvaluatePosition(props.Position, context);
|
||||
var strength = UserAction->EvaluateValue("Integer", props.Strength, context);
|
||||
if (strength > 0)
|
||||
{
|
||||
LaunchEarthquake(position[0], position[1], strength);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1,6 @@
|
|||
Name=Erdbeben
|
||||
LaunchEarthquake=Erdbeben
|
||||
LaunchEarthquakeHelp=Laesst die Erde wackeln, Objekte schleudern und lose Materialien herunter fallen.
|
||||
PositionHelp=Wo die Erde wackelt.
|
||||
Strength=Staerke
|
||||
StrengthHelp=Radius und Staerke des Wackelns.
|
||||
|
|
|
@ -1 +1,6 @@
|
|||
Name=Earthquake
|
||||
LaunchEarthquake=Earthquake
|
||||
LaunchEarthquakeHelp=Shakes the ground, flings objects and drops loose materials.
|
||||
PositionHelp=Where the earth shakes.
|
||||
Strength=Strength
|
||||
StrengthHelp=Radius and strength of the shaking.
|
|
@ -26,7 +26,7 @@ local EvaluatorDefs;
|
|||
local DefinitionPriority=99;
|
||||
|
||||
// Localized group names
|
||||
local GroupNames = { Structure="$Structure$", Game="$Game$", Ambience="$Ambience$" };
|
||||
local GroupNames = { Structure="$Structure$", Game="$Game$", Ambience="$Ambience$", Disasters="$Disasters$" };
|
||||
|
||||
// Storage for global user variables
|
||||
static g_UserAction_global_vars;
|
||||
|
|
|
@ -15,6 +15,7 @@ UserAny=Wert
|
|||
Default=Standard
|
||||
Structure=Gebaeude
|
||||
Game=Spiel
|
||||
Disasters=Katastrophen
|
||||
None=Nichts
|
||||
Noone=Niemand
|
||||
AllPlayers=Alle Spieler
|
||||
|
|
|
@ -15,6 +15,7 @@ UserAny=Value
|
|||
Default=Default
|
||||
Structure=Structure
|
||||
Game=Game
|
||||
Disasters=Disasters
|
||||
None=Nothing
|
||||
Noone=Noone
|
||||
AllPlayers=All players
|
||||
|
|
Loading…
Reference in New Issue