底比斯天堂
瘋天堂私服發佈網站廣告欄位!
害怕天堂私服倒閉嗎?快使用天堂分析師!
天堂私服抽獎扭蛋物品及機率測試器
天堂私服稱號顏色製造器
瘋天堂私服發佈網站教您註冊推文收藏私服!
天堂私服血量魔力計算器
瘋天堂私服發布網站廣告贊助及爆料私服客服
教您如何不用註冊也可以推文天堂私服!
天堂私服270怪物查詢掉落資料庫
天堂私服盟徽製造器
test0428
2010-12-27 03:12

天堂怪物不穿門的java寫法!


怪物穿門的問題,其實改起來蠻容易的...
主要是isPassable少了對door的辨識...

L1V1Map.java
搜尋public boolean isPassable(int x, int y, int heading) {

==============原始=====================
if (heading == 0) {
tile2 = accessTile(x, y - 1);
}
else if (heading == 1) {
tile2 = accessTile(x + 1, y - 1);
}
else if (heading == 2) {
tile2 = accessTile(x + 1, y);
newX = x + 1;
newY = y;
}
else if (heading == 3) {
tile2 = accessTile(x + 1, y + 1);
newX = x + 1;
newY = y + 1;
}
else if (heading == 4) {
tile2 = accessTile(x, y + 1);
}
else if (heading == 5) {
tile2 = accessTile(x - 1, y + 1);
}
else if (heading == 6) {
tile2 = accessTile(x - 1, y);
}
else if (heading == 7) {
tile2 = accessTile(x - 1, y - 1);
}
else {
return false;
}
==============替換以下===================
int newX;
int newY;

if (heading == 0) {
tile2 = accessTile(x, y - 1);
newX = x;
newY = y - 1;
}
else if (heading == 1) {
tile2 = accessTile(x + 1, y - 1);
newX = x + 1;
newY = y - 1;
}
else if (heading == 2) {
tile2 = accessTile(x + 1, y);
newX = x + 1;
newY = y;
}
else if (heading == 3) {
tile2 = accessTile(x + 1, y + 1);
newX = x + 1;
newY = y + 1;
}
else if (heading == 4) {
tile2 = accessTile(x, y + 1);
newX = x;
newY = y + 1;
}
else if (heading == 5) {
tile2 = accessTile(x - 1, y + 1);
newX = x - 1;
newY = y + 1;
}
else if (heading == 6) {
tile2 = accessTile(x - 1, y);
newX = x - 1;
newY = y;
}
else if (heading == 7) {
tile2 = accessTile(x - 1, y - 1);
newX = x - 1;
newY = y - 1;
}
else {
return false;
}

if (isExistDoor(newX, newY)) {
return false;
}

==============完畢=====================



上一篇文章:天堂新增6~10級魔法卷軸的java寫法!
下一篇文章:天堂龍騎士死騎鎖鏈劍一格攻擊的java寫法!

分享文章:分享到微博! 分享到臉書! 分享到噗浪! 分享到維特! 分享到Google+! 分享到LINE!