RandomAction.js 398 B

1234567891011121314
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. Object.defineProperty(i, "__esModule", {value: !0});
  5. const s = t("Actions"),
  6. o = t("constants"),
  7. a = t("Condition");
  8. class n extends a.default {
  9. tick(t) {
  10. var e = Math.random() < this.properties.rate;
  11. return this.log(this.properties.rate, e), e ? o.SUCCESS : o.FAILURE;
  12. }
  13. }
  14. (i.default = n), s.register(n, "Random");