(function () {
var p = adventurejs.Asset.prototype;
p.hasVerbMaxConnections = function Asset_hasMaxVerbConnections(verb, to_ov) {
if (
!verb ||
!this.game.dictionary.verbs[verb] ||
!this.game.dictionary.verbs[verb].makes_connections ||
(!this.dov[verb] && !this.iov[verb]) ||
!this.is.connected_by
) {
return true;
}
if (
"undefined" ===
typeof this.game.dictionary.verbs[verb].with_params.max_connections
) {
return false;
}
if (!this.is.connected_by[verb]) {
return false;
}
if (to_ov === "dov" && this.isIOV(verb)) to_ov = "to_dov";
if (to_ov === "iov" && this.isDOV(verb)) to_ov = "to_iov";
if (to_ov !== "to_dov" && to_ov !== "to_iov") {
if (this.isDOV(verb)) to_ov = "to_iov";
else if (this.isIOV(verb)) to_ov = "to_dov";
}
if (to_ov === "to_dov") {
if (this.iov[verb].with_params.max_connections === -1) return false;
if (this.is.connected_by[verb].to_dov) {
return (
this.is.connected_by[verb].to_dov.length >=
this.iov[verb].with_params.max_connections
);
} else return true;
}
if (to_ov === "to_iov") {
if (this.dov[verb].with_params.max_connections === -1) return false;
if (this.is.connected_by[verb].to_iov) {
return (
this.is.connected_by[verb].to_iov.length >=
this.dov[verb].with_params.max_connections
);
} else return true;
}
return true;
};
})();