Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 3c4224c6 authored by deuce's avatar deuce

Fix getters.

I'm not sure why I still run this service though...
parent ef157713
......@@ -11,16 +11,16 @@ function Building()
this.size=0;
this.sizeleft=0;
this.region=null; // TODO: Added
this.id getter=function() { return(this.name+' ('+this.no+')'); };
this.owner getter=function() {
var u;
this.__defineGetter__("id", function() { return(this.name+' ('+this.no+')'); });
this.__defineGetter__("owner", function() {
var u;
for(u in this.region.units)
if(this.region.units[u].building.no==this.no)
return(this.region.units[u]);
return(null);
};
});
this.mayenter=function(u) {
var u2=this.owner;
......
......@@ -35,8 +35,8 @@ function Faction()
this.nunits=0;
this.number=0;
this.money=0;
this.id getter=function() { return(this.name+' ('+this.no+')'); };
this.magicians getter=function() {
this.__defineGetter__("id", function() { return(this.name+' ('+this.no+')'); });
this.__defineGetter__("magicians", function() {
var n,r,u;
n = 0;
......@@ -47,7 +47,7 @@ function Faction()
n += regions[r].units[u].number;
return n;
};
});
this.ispresent=function(region) {
var unit;
......
......@@ -26,9 +26,9 @@ function Region()
this.ships=new Array();
this.units=new Array();
this.immigrants=0;
this.id getter=function() { return(this.name+' ('+this.x+','+this.y+')'); };
this.__defineGetter__("id", function() { return(this.name+' ('+this.x+','+this.y+')'); });
this.iscoast getter=function()
this.__defineGetter__("iscoast", function()
{
var i;
......@@ -39,7 +39,7 @@ function Region()
if(this.connect[i]!=null && this.connect[i].terrain==T_OCEAN)
return(true);
return(false);
};
});
this.movewhere=function(keyword) {
var r2;
......
......@@ -11,8 +11,8 @@ function Ship()
this.type=0;
this.left=0;
this.region=null; // TODO: Added
this.id getter=function() { return(this.name+' ('+this.no+')'); };
this.cansail getter=function() {
this.__defineGetter__("id", function() { return(this.name+' ('+this.no+')'); });
this.__defineGetter__("cansail", function() {
var n,u;
n = 0;
......@@ -22,8 +22,8 @@ function Ship()
n += this.region.units[u].itemweight + this.region.units[u].horseweight + (this.region.units[u].number * 10);
return n <= shiptypes[this.type].capacity;
};
this.owner getter=function() {
});
this.__defineGetter__("owner", function() {
var u;
for(u in this.region.units)
......@@ -31,7 +31,7 @@ function Ship()
return(this.region.units[u]);
return(null);
};
});
this.mayboard=function(u) {
var u2=this.owner;
......
......@@ -49,8 +49,8 @@ function Unit(region)
this.litems=new Array();
this.side=0;
this.isnew=false;
this.id getter=function() { return(this.name+' ('+this.no+')'); };
this.itemweight getter=function() {
this.__defineGetter__("id", function() { return(this.name+' ('+this.no+')'); });
this.__defineGetter__("itemweight", function() {
var i,n;
n = 0;
......@@ -70,8 +70,8 @@ function Unit(region)
}
return n;
};
this.horseweight getter=function () {
});
this.__defineGetter__("horseweight", function () {
var i,n;
n = 0;
......@@ -85,14 +85,14 @@ function Unit(region)
}
return n;
};
this.canmove getter=function() {
});
this.__defineGetter__("canmove", function() {
return this.itemweight - this.horseweight - (this.number * 5) <= 0;
};
this.canride getter=function() {
});
this.__defineGetter__("canride", function() {
return this.itemweight - this.horseweight + (this.number * 10) <= 0;
};
this.armedmen getter=function() {
});
this.__defineGetter__("armedmen", function() {
var n=0;
if (this.effskill (SK_SWORD))
......@@ -102,7 +102,7 @@ function Unit(region)
if (this.effskill (SK_LONGBOW))
n += this.items[I_LONGBOW];
return Math.min(n,this.number);
};
});
this.effskill=function(skill) {
var n,j,result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment