forked from Mirrors/openclonk
Add user action evaluator: Object exists
parent
a01c6d4db9
commit
8bc310c52a
|
@ -156,6 +156,7 @@ func Definition(def)
|
|||
] },
|
||||
RightOperand = new Evaluator.Player { Name="$RightOperand$", EditorHelp="$RightOperandHelp$" }
|
||||
} } );
|
||||
AddEvaluator("Boolean", nil, "$ObjectExists$", "$ObjectExistsHelp$", "object_exists", [def, def.EvalBool_ObjectExists], { }, new Evaluator.Object { }, "Object");
|
||||
// Integer evaluators
|
||||
AddEvaluator("Integer", nil, ["$Constant$", ""], "$ConstantHelp$", "int_constant", [def, def.EvalConstant], { Value=0 }, { Type="int", Name="$Value$" });
|
||||
AddEvaluator("Integer", nil, "$Random$", "$RandomIntHelp$", "int_random", [def, def.EvalIntRandom], { Min={Function="int_constant", Value=0}, Max={Function="int_constant", Value=99} }, { Type="proplist", Display="Rnd({{Min}}..{{Max}})", EditorProps = {
|
||||
|
@ -418,6 +419,8 @@ private func EvalComparison(proplist props, proplist context, data_type)
|
|||
return left >= right;
|
||||
}
|
||||
|
||||
private func EvalBool_ObjectExists(proplist props, proplist context) { return !!EvaluateValue("Object", props.Object, context); }
|
||||
|
||||
private func EvalAct_Sequence(proplist props, proplist context)
|
||||
{
|
||||
// Sequence execution: Iterate over actions until one action puts the context on hold
|
||||
|
|
|
@ -173,3 +173,5 @@ CompareObject=Vergleiche Objekte
|
|||
CompareString=Vergleiche Texte
|
||||
CompareDefinition=Vergleiche Objekttypen
|
||||
ComparePlayer=Vergleiche Spieler
|
||||
ObjectExists=Objekt existiert
|
||||
ObjectExistsHelp=Wahr, wenn das die Funktion ein Objekt zurueckgibt.
|
||||
|
|
|
@ -173,3 +173,5 @@ CompareObject=Compare objects
|
|||
CompareString=Compare texts
|
||||
CompareDefinition=Compare object types
|
||||
ComparePlayer=Compare players
|
||||
ObjectExists=Object exists
|
||||
ObjectExistsHelp=True if the function returns an object.
|
||||
|
|
Loading…
Reference in New Issue