All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.conditions.attribute.js Maven / Gradle / Ivy

The newest version!
//@Condition()

// load("plugins/Pouvoir/scripts/core/basic.js");

Coerce = static("Coerce");

key = "attribute";
names = ["需要(?.*)属性: (?\\d+)"];

function parameters(matcher, text) {
  const name = matcher.group("name");
  const value = Coerce.toDouble(matcher.group("value"));
  return mapOf({ name: name, value: value });
}

function condition(entity, map) {
  if (entity == null) return true;
  var name = map.get("name");
  var value = map.get("value");
  const compound = AttrAPI.getAttrData(entity);
  return compound == null || compound.getAttrValue(name, "total") >= value;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy