📄 play.java
字号:
iTeleportControlActive_Controle = iActive_ControlsNr[i];
} else
if(!bAttackPhase)
{
teleport(i);
if(cControlT[i] != 0)
bSaves[cControlT[i]] = true;
if(cControlF[i] != 0)
bSaves[cControlF[i]] = false;
}
}
for(int j = 0; j < iShops; j++)
if(iPlayerXPix >= iShopXPix[j] - _$542 && iPlayerXPix <= iShopXPix[j] + _$542 && iPlayerYPix >= iShopYPix[j] - _$542 && iPlayerYPix <= iShopYPix[j] + _$542)
{
bDrawShop = true;
iShopWhichOne = j;
iShopControlTile = iShopNr[j];
}
for(int k = 0; k < iMonsters; k++)
if(!bMonsterKilled[k] && bMonsterVisible[iMonsterType[k]])
I2MVBS.draw(g, iMonsterXPix[k] - iMapXPixelPos - (I2MVBS.dx >> 1), iMonsterYPix[k] - iMapYPixelPos - I2MVBS.dy);
for(int l = 0; l < iTreasures; l++)
if(!bTreasureTaken[l] && bSaves[cControlSaves[iTreasureSave[l]]] && bTreasureVisible[l])
I2Treasure.draw(g, iTreasureXPix[l] - iMapXPixelPos - (I2Treasure.dx >> 1), iTreasureYPix[l] - iMapYPixelPos - I2Treasure.dy);
if(!flag)
drawPlayer(g);
for(int i1 = 0; i1 < iActive_ControlsNof; i1++)
if(cControlWhat[iActive_ControlsNr[i1]] == '\003')
{
char c1 = cControlVal1[iActive_ControlsNr[i1]];
if(c1 == '\020')
I2ExtraRoof.draw(g, iActive_ControlsXPixPos[i1] - iMapXPixelPos - 4, iActive_ControlsYPixPos[i1] - iMapYPixelPos - I2ExtraRoof.dy);
if(c1 == '\017')
I2ExtraLeafs.draw(g, iActive_ControlsXPixPos[i1] - iMapXPixelPos - (I2ExtraLeafs.dx >> 1), iActive_ControlsYPixPos[i1] - iMapYPixelPos - I2ExtraLeafs.dy);
}
}
void load()
{
cGscr.drawLoading(10);
if(bRecstoreDisasterReady)
{
bRecstoreDisasterReady = false;
rs = null;
}
int i = 1;
int j = 1;
if(rs == null)
rs = new RecStore();
cGscr.drawLoading(20);
if(rs.loadInt(i++) != 1971)
{
loadQuest();
rs = null;
return;
}
if(rs.loadInt(i++) != 0);
String s = rs.loadString(j++);
cGscr.drawLoading(41);
int k = rs.loadInt(i++);
cGscr.drawLoading(42);
loadMap(k);
cGscr.drawLoading(50);
iPlayerXPix = rs.loadInt(i++);
iPlayerYPix = rs.loadInt(i++);
int i2 = 0;
for(int l = 0; l < iMonsters; l++)
if(s.charAt(i2++) == 'T')
bMonsterKilled[l] = true;
else
bMonsterKilled[l] = false;
cGscr.drawLoading(60);
for(int i1 = 0; i1 < bSaves.length; i1++)
if(s.charAt(i2++) == 'T')
bSaves[i1] = true;
else
bSaves[i1] = false;
cGscr.drawLoading(70);
for(int j1 = 0; j1 < 3; j1++)
{
iEquipeLife[j1] = rs.loadInt(i++);
iEquipeLifeMax[j1] = rs.loadInt(i++);
iEquipeDamage[j1] = rs.loadInt(i++);
iEquipeArmor[j1] = rs.loadInt(i++);
iEquipeSpeed[j1] = rs.loadInt(i++);
iEquipeXP[j1] = rs.loadInt(i++);
iEquipeExperienceLevel[j1] = rs.loadInt(i++);
iEquipePotions = rs.loadInt(i++);
iEquipeGold = rs.loadInt(i++);
}
cGscr.drawLoading(80);
for(int k1 = 0; k1 < 3; k1++)
{
ItPlayerArmor[k1].set(rs.loadString(j++));
ItPlayerSword[k1].set(rs.loadString(j++));
}
cGscr.drawLoading(85);
for(int l1 = 0; l1 < 5; l1++)
ItSacItems[l1].set(rs.loadString(j++));
cGscr.drawLoading(90);
j++;
cGscr.drawLoading(95);
sc.setScrollerPos(0, 0);
centerMap();
}
void loadMap(int i)
{
_$500 = true;
cGscr.repaint();
cGscr.sleep(80);
int j = 1;
SPEED = iMapSpeed[i] * j;
dirx[2] = -iMapSpeed[i] * j;
dirx[3] = iMapSpeed[i] * j;
diry[0] = iMapSpeed[i] * j;
diry[1] = -iMapSpeed[i] * j;
dirx[4] = -(1 + (iMapSpeed[i] * j + 1) / 2);
diry[4] = -(1 + (iMapSpeed[i] * j + 1) / 2);
dirx[5] = 1 + (iMapSpeed[i] * j + 1) / 2;
diry[5] = -(1 + (iMapSpeed[i] * j + 1) / 2);
dirx[6] = 1 + (iMapSpeed[i] * j + 1) / 2;
diry[6] = 1 + (iMapSpeed[i] * j + 1) / 2;
dirx[7] = -(1 + (iMapSpeed[i] * j + 1) / 2);
diry[7] = 1 + (iMapSpeed[i] * j + 1) / 2;
if(iMapSpeed[i] == 2)
_$540 = 14;
else
_$540 = 17;
iMonsters = 0;
iTreasures = 0;
iShops = 0;
if(i >= _$545.length)
System.out.println("Out of bound: iTilesetsForMaps[]");
sc.loadTileSet(_$545[i - 1]);
iTileWalkable = _$546[_$545[i - 1] - 1];
sc.loadMap(i);
int l = 0;
iActive_ControlsNof = 0;
iBlockTiles = 0;
for(int k = 0; k < sc.iNofLayer1; k++)
if(cControlWhat[sc.sLayer1[l + 2]] == '\004')
{
iBlockTileXTilePos[iBlockTiles] = sc.sLayer1[l++];
iBlockTileYTilePos[iBlockTiles] = sc.sLayer1[l++];
iBlockTileSaveNr[iBlockTiles++] = cControlSaves[sc.sLayer1[l++]];
} else
if(cControlWhat[sc.sLayer1[l + 2]] == '\005')
{
bMonsterKilled[iMonsters] = false;
iMonsterXPix[iMonsters] = sc.sLayer1[l++] * _$366 + _$366 / 2;
iMonsterYPix[iMonsters] = sc.sLayer1[l++] * _$366;
iMonsterType[iMonsters] = cControlVal1[sc.sLayer1[l]];
iMonsterSave[iMonsters] = sc.sLayer1[l];
iMonsterImage[iMonsters] = cControlVal2[sc.sLayer1[l++]];
iMonsters++;
} else
if(cControlWhat[sc.sLayer1[l + 2]] == '\006')
{
bTreasureTaken[iTreasures] = false;
iTreasureXPix[iTreasures] = sc.sLayer1[l++] * _$366 + (_$366 >> 1);
iTreasureYPix[iTreasures] = (sc.sLayer1[l++] * _$366 + _$366) - 7;
iTreasureLevel[iTreasures] = cControlVal1[sc.sLayer1[l]];
bTreasureVisible[iTreasures] = true;
if(cControlVal2[sc.sLayer1[l]] != 0)
bTreasureVisible[iTreasures] = false;
iTreasureSave[iTreasures] = sc.sLayer1[l++];
iTreasures++;
} else
if(cControlWhat[sc.sLayer1[l + 2]] == '\b')
{
iShopXPix[iShops] = sc.sLayer1[l++] * _$366;
iShopYPix[iShops] = sc.sLayer1[l++] * _$366;
iShopNr[iShops] = sc.sLayer1[l++];
char c = cControlVal1[iShopNr[iShops]];
if(c == 0)
{
bShopHeal[iShops] = true;
iShops++;
} else
{
iShopNofItemsInShop[iShops] = 0;
iShopItemInShop[iShops] = 0;
for(int i1 = 0; i1 < 5; i1++)
if(i1 < 3)
{
while(ItShopItem[i1].iWhat != 1 && ItShopItem[i1].iWhat != 2)
ItShopItem[i1].newItem(c);
iShopNofItemsInShop[iShops]++;
} else
{
ItShopItem[i1].iWhat = 0;
}
iShops++;
}
} else
{
iActive_ControlsXPixPos[iActive_ControlsNof] = sc.sLayer1[l++] * _$366 + (_$366 >> 1);
iActive_ControlsYPixPos[iActive_ControlsNof] = sc.sLayer1[l++] * _$366;
iActive_ControlsNr[iActive_ControlsNof++] = sc.sLayer1[l++];
}
_$500 = false;
}
void loadQuest()
{
if(!cheat)
{
loadMap(1);
sc.setScrollerPos(50, 50);
iPlayerXPix = 100;
iPlayerYPix = 80;
} else
{
loadMap(12);
sc.setScrollerPos(0, 0);
iPlayerXPix = 96;
iPlayerYPix = 256;
centerMap();
}
save(true);
}
boolean movePlayer(int i, int j)
{
int k = i + iPlayerXPix;
int l = j + iPlayerYPix;
if(k < 10)
return false;
if(l < 10)
return false;
if(l >= (sc.iMapTileHe - 0) * _$366 - 15)
return false;
k /= _$366;
l = (l + 4) / _$366;
if(k < 0 || l < 0)
return false;
if(k >= sc.iMapTileWi - 0)
return false;
if(sc.map[k][l] > iTileWalkable)
return false;
if(iBlockTiles != 0)
{
for(int i1 = 0; i1 < iBlockTiles; i1++)
if(iBlockTileXTilePos[i1] == k && iBlockTileYTilePos[i1] == l && bSaves[iBlockTileSaveNr[i1]])
return false;
}
iPlayerXPix += i;
iPlayerYPix += j;
return true;
}
public void paint(Graphics g)
{
if(_$500)
{
cGscr.drawLoading(50);
return;
}
if(!_$206)
return;
bDrawing = true;
if(bAttackPhase)
{
if(sc != null)
sc.paint(g, 0, 0);
g.setColor(0, 0, 0);
byte byte0 = 96;
g.setClip(0, byte0, SCREENWIDTH, SCREENHEIGHT - byte0);
g.fillRect(0, byte0, SCREENWIDTH, SCREENHEIGHT - byte0);
for(int l1 = 0; l1 < SCREENWIDTH / I2DialogBox.dx; l1++)
{
I2DialogBox.drawFrame(g, I2DialogBox.dx * (l1 + 1), byte0, 1);
Graphics _tmp = g;
I2DialogBox.drawFrame(g, I2DialogBox.dx * (l1 + 1), 0, 7, 32);
}
for(int k2 = 0; k2 < (SCREENHEIGHT - byte0) / I2DialogBox.dy; k2++)
{
I2DialogBox.drawFrame(g, 0, byte0 + I2DialogBox.dy * (k2 + 1), 3);
Graphics _tmp1 = g;
I2DialogBox.drawFrame(g, 0, byte0 + I2DialogBox.dy * (k2 + 1), 5, 8);
}
I2DialogBox.drawFrame(g, 0, byte0, 0);
Graphics _tmp2 = g;
I2DialogBox.drawFrame(g, 0, byte0, 2, 8);
Graphics _tmp3 = g;
I2DialogBox.drawFrame(g, 0, 0, 6, 32);
Graphics _tmp4 = g;
Graphics _tmp5 = g;
I2DialogBox.drawFrame(g, 0, 0, 8, 0x8 | 0x20);
fight.paint(g);
} else
{
if(!_$665 && !bNextLevelDialog && sc != null)
{
sc.paint(g, 0, 0);
if(bDrawAttack)
{
Graphics _tmp6 = g;
mu.print(g, 0, 20, 391, 2);
}
}
drawPlayersNControls(g);
g.setClip(0, 0, 128, 128);
g.setColor(0, 0, 0);
g.fillRect(0, 96, 128, 32);
if(_$665)
drawDialogBox(g, _$680);
if(bNextLevelDialog)
{
drawBox(g, 12, 12);
drawPlayerInfo(g, iNextLevelPlayer);
mu.print(g, 22, 110, 288);
Graphics _tmp7 = g;
mu.print(g, -6, (SCREENHEIGHT >> 1) - 10, 297, 8);
Graphics _tmp8 = g;
mu.print(g, -6, ((SCREENHEIGHT >> 1) - 10) + mu.iCharSizeY, 286, 8);
Graphics _tmp9 = g;
mu.print(g, -6, ((SCREENHEIGHT >> 1) - 10) + (mu.iCharSizeY << 1), 287, 8);
}
}
if(bPause)
{
if(iPauseMenu == 0)
{
Graphics _tmp10 = g;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -