mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
a9d45373e0
Added proper object size calculations. Removed old objectDistance code. Added current task support, allows easy creation of player tasks that cannot duplicate.
81 lines
1.5 KiB
Java
81 lines
1.5 KiB
Java
package redone.game.objects;
|
|
|
|
import redone.world.clip.ObjectDef;
|
|
|
|
public class Objects {
|
|
|
|
public long delay, oDelay;
|
|
public int xp, item, owner, target, times;
|
|
public boolean bait;
|
|
public String belongsTo;
|
|
public int objectId;
|
|
public int objectX;
|
|
public int objectY;
|
|
public int objectHeight;
|
|
public int objectFace;
|
|
public int objectType;
|
|
public int objectTicks;
|
|
|
|
public int getObjectId() {
|
|
return objectId;
|
|
}
|
|
|
|
public int getObjectX() {
|
|
return objectX;
|
|
}
|
|
|
|
public int getObjectY() {
|
|
return objectY;
|
|
}
|
|
|
|
public Objects(int id, int x, int y, int height, int face, int type, int ticks) {
|
|
objectId = id;
|
|
objectX = x;
|
|
objectY = y;
|
|
objectHeight = height;
|
|
objectFace = face;
|
|
objectType = type;
|
|
objectTicks = ticks;
|
|
}
|
|
|
|
public int[] getObjectSize() {
|
|
ObjectDef def = ObjectDef.getObjectDef(objectId);
|
|
if (def == null)
|
|
return new int[] {1, 1};
|
|
int xLength;
|
|
int yLength;
|
|
if (objectFace != 1 && objectFace != 3) {
|
|
xLength = def.xLength();
|
|
yLength = def.yLength();
|
|
} else {
|
|
xLength = def.yLength();
|
|
yLength = def.xLength();
|
|
}
|
|
|
|
return new int[] {xLength, yLength};
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Objects{" +
|
|
"objectId=" + objectId +
|
|
", objectX=" + objectX +
|
|
", objectY=" + objectY +
|
|
", objectHeight=" + objectHeight +
|
|
'}';
|
|
}
|
|
|
|
public int getObjectHeight() {
|
|
return objectHeight;
|
|
}
|
|
|
|
public int getObjectFace() {
|
|
return objectFace;
|
|
}
|
|
|
|
public int getObjectType() {
|
|
return objectType;
|
|
}
|
|
|
|
}
|