📄 play.java
字号:
RecStore rs;
Scroller sc;
public Play(int i, int j, MultiOutPut multioutput, GameScreen gamescreen, Scroller scroller, boolean flag)
{
cheat = false;
_$500 = false;
_$206 = false;
_$540 = 23;
_$541 = 11;
_$542 = 12;
bWon = false;
bMonsterKilled = new boolean[90];
iMonsterType = new int[90];
iMonsterSave = new int[90];
iMonsterImage = new int[90];
iMonsterXPix = new int[90];
iMonsterYPix = new int[90];
ItShopItem = new Item[5];
iShopXPix = new int[2];
iShopYPix = new int[2];
iShopNr = new int[2];
iShopNofItemsInShop = new int[2];
iShopItemInShop = new int[2];
bShopCanIBuy = true;
bShopCanISell = false;
bShopHeal = new boolean[2];
iShopItem = 0;
bTreasureTaken = new boolean[61];
iTreasureLevel = new int[60];
iTreasureXPix = new int[60];
iTreasureYPix = new int[60];
iTreasureSave = new int[60];
bTreasureVisible = new boolean[60];
iTreasureKill = 0;
ItSacItems = new Item[5];
ItPlayerSword = new Item[3];
ItPlayerArmor = new Item[3];
ItFound = new Item(random);
iActive_ControlsNr = new int[80];
iActive_ControlsXPixPos = new int[80];
iActive_ControlsYPixPos = new int[80];
iBlockTileXTilePos = new int[20];
iBlockTileYTilePos = new int[20];
iBlockTileSaveNr = new int[20];
I2Player = null;
I2MVBS = null;
I2PNJ = null;
I2ExtraRoof = null;
bDrawTalk = false;
bDrawShop = false;
bDrawTeleport = false;
I2Signs = null;
I2DialogBox = null;
iPlayerDir = 1;
iPlayerFrame = 0;
dirx = (new int[] {
0, 0, -SPEED, SPEED, -SPEED, SPEED, SPEED, -SPEED
});
diry = (new int[] {
SPEED, -SPEED, 0, 0, -SPEED, -SPEED, SPEED, SPEED
});
bMoving = false;
iEquipePotions = 5;
iEquipeGold = 0;
_$654 = 0;
bPause = false;
bAttackPhase = false;
bDrawAttack = false;
dontrun = false;
rs = null;
bRecstoreDisasterReady = false;
_$681 = false;
_$665 = false;
fight = null;
bDrawing = false;
BOXSTARTX = 4;
BOXSTARTY = 4;
fight = new Fight();
Item.mu = multioutput;
SCREENWIDTH = i;
SCREENHEIGHT = j;
mu = multioutput;
cGscr = gamescreen;
sc = scroller;
_$366 = scroller.iTileSize;
bNextLevelDialog = false;
random = new Random();
for(int k = 0; k < 5; k++)
ItShopItem[k] = new Item(random);
multioutput.stopMusic();
I2Player = new Image2("/gfx/player.png", 2, 4, false);
I2PNJ = new Image2("/gfx/people.png", 5, 1, false);
I2MVBS = new Image2("/gfx/MVBS.png", 1, 1, false);
I2King = new Image2("/gfx/king.png", 1, 1, false);
I2Signs = new Image2("/gfx/signs.png", 1, 2, false);
I2DialogBox = new Image2("/gfx/cadre.png", 3, 3, false);
I2Sword = new Image2("/gfx/swords.png", 4, 1, false);
I2Armor = new Image2("/gfx/armour.png", 4, 1, false);
I2Treasure = new Image2("/gfx/coffre.png", 1, 1, false);
for(int l = 0; l < 5; l++)
ItSacItems[l] = new Item(random);
iSacItem = 0;
for(int i1 = 0; i1 < 3; i1++)
{
ItPlayerSword[i1] = new Item(random);
ItPlayerArmor[i1] = new Item(random);
}
if(!flag)
loadQuest();
else
load();
save(true);
updateBonus();
dontrun = false;
}
int XP(int i)
{
return i * (i + 1) * 20 - 10;
}
void centerMap()
{
int i = iPlayerXPix - (sc.PIXELWIDTH >> 1);
int j = iPlayerYPix - (sc.PIXELHEIGHT >> 1);
if(i < 0)
i = 0;
if(j < 0)
j = 0;
if(i >= sc.iMapTileWi * _$366 - sc.PIXELWIDTH)
i = sc.iMapTileWi * _$366 - sc.PIXELWIDTH - 1;
if(j >= sc.iMapTileHe * _$366 - sc.PIXELHEIGHT)
j = sc.iMapTileHe * _$366 - sc.PIXELHEIGHT - 1;
sc.setScrollerPos(i, j);
}
void checkNextExperienceLevel()
{
boolean flag = false;
int i = 0;
for(int j = 2; j >= 0; j--)
if(iEquipeXP[j] >= XP(iEquipeExperienceLevel[j]))
{
i = j;
flag = true;
}
bNextLevelDialog = flag;
iNextLevelPlayer = i;
if(flag)
iEquipeExperienceLevel[i]++;
}
void drawBox(Graphics g, int i, int j)
{
g.setClip(0, 0, SCREENWIDTH, SCREENHEIGHT);
g.setColor(0, 0, 0);
g.fillRect(BOXSTARTX, BOXSTARTY, i * I2DialogBox.dx, j * I2DialogBox.dy);
I2DialogBox.drawFrame(g, BOXSTARTX, BOXSTARTY, 0);
I2DialogBox.drawFrame(g, BOXSTARTX + (i - 1) * I2DialogBox.dx, BOXSTARTY, 2);
I2DialogBox.drawFrame(g, BOXSTARTX, BOXSTARTY + (j - 1) * I2DialogBox.dy, 6);
I2DialogBox.drawFrame(g, BOXSTARTX + (i - 1) * I2DialogBox.dx, BOXSTARTY + (j - 1) * I2DialogBox.dy, 8);
for(int k = 1; k < i - 1; k++)
{
I2DialogBox.drawFrame(g, k * I2DialogBox.dx + BOXSTARTX, BOXSTARTY, 1);
I2DialogBox.drawFrame(g, k * I2DialogBox.dx + BOXSTARTX, BOXSTARTY + (j - 1) * I2DialogBox.dy, 7);
}
for(int l = 1; l < j - 1; l++)
{
I2DialogBox.drawFrame(g, BOXSTARTX, l * I2DialogBox.dy + BOXSTARTY, 3);
I2DialogBox.drawFrame(g, BOXSTARTX + (i - 1) * I2DialogBox.dx, l * I2DialogBox.dy + BOXSTARTY, 5);
}
}
void drawDialogBox(Graphics g, int i)
{
int j = cTextsLastLine[i] - cTextsFirstLine[i];
drawBox(g, 12, 12);
for(int k = 0; k < 8; k++)
if(k + _$679 <= j)
mu.print(g, (BOXSTARTX + I2DialogBox.dx) - 4, BOXSTARTY + I2DialogBox.dy + k * 12, cTextsFirstLine[i] + k + _$679 + 2);
}
private void _$714(Graphics g, Item item)
{
item.print(g, 0, 10);
switch(item.iWhat)
{
case 3: // '\003'
Graphics _tmp = g;
mu.printValue(g, 0, 60, item.iGold, 2);
break;
case 2: // '\002'
Graphics _tmp1 = g;
I2Armor.drawFrame(g, 30, -(I2Armor.dy >> 1) + 13, item.iMaterial, 1);
break;
case 1: // '\001'
Graphics _tmp2 = g;
I2Sword.drawFrame(g, 31, -(I2Sword.dy >> 1) + 14, item.iMaterial, 1);
break;
}
}
void drawPlayer(Graphics g)
{
if(I2Player != null)
{
int i = iPlayerDir;
int j = 0;
if(!bMoving)
{
if(i > 3)
if(i == 5 || i == 6)
i = 3;
else
i = 2;
j = i * 2;
} else
{
if(i > 3)
if(i < 6)
i = 1;
else
i = 0;
j = (i << 1) + (iPlayerFrame & 0x1);
}
I2Player.drawFrame(g, iPlayerXPix - iMapXPixelPos - (I2Player.dx >> 1), ((iPlayerYPix - iMapYPixelPos - I2Player.dy) + (_$366 >> 1)) - 2, j);
}
}
void drawPlayerInfo(Graphics g, int i)
{
if(i < 0 || i > 2)
return;
if(i == 0)
I2Player.drawFrame(g, BOXSTARTX + I2DialogBox.dx, BOXSTARTY + I2DialogBox.dy, 1);
else
I2PNJ.drawFrame(g, (BOXSTARTX + I2DialogBox.dx) - 7, (BOXSTARTY + I2DialogBox.dy) - 7, i - 1);
byte byte0 = 40;
byte byte1 = -80;
int j = (SCREENHEIGHT >> 1) - 10;
Graphics _tmp = g;
mu.print(g, byte1, j, 282, 8);
mu.printValue(g, byte0 + 11, j, iEquipeLife[i]);
mu.cheatPrint(g, byte0 + 28, j, "/");
mu.printValue(g, byte0 + 40, j, iEquipeTotalLifeMax[i]);
Graphics _tmp1 = g;
mu.print(g, byte1, j + mu.iCharSizeY, 283, 8);
mu.printValue(g, byte0 + 40, j + mu.iCharSizeY, iEquipeTotalSpeed[i]);
Graphics _tmp2 = g;
mu.print(g, byte1, j + (mu.iCharSizeY << 1), 284, 8);
mu.printValue(g, byte0 + 40, j + (mu.iCharSizeY << 1), iEquipeTotalDamage[i]);
Graphics _tmp3 = g;
mu.print(g, byte1, j + mu.iCharSizeY * 3, 285, 8);
mu.printValue(g, byte0 + 40, j + mu.iCharSizeY * 3, iEquipeTotalArmor[i]);
if(i == 0)
{
Graphics _tmp4 = g;
mu.print(g, byte1, j + mu.iCharSizeY * 4, 370, 8);
mu.printValue(g, byte0 + 40, j + mu.iCharSizeY * 4, iEquipeGold);
}
Graphics _tmp5 = g;
mu.print(g, -byte0 - 5, 7, 289, 8);
Graphics _tmp6 = g;
mu.printValue(g, -32, 7, iEquipeExperienceLevel[i], 8);
Graphics _tmp7 = g;
mu.print(g, -byte0 + 5, 20, 291, 8);
Graphics _tmp8 = g;
mu.printValue(g, -7, 20, iEquipeXP[i], 8);
Graphics _tmp9 = g;
mu.print(g, 0, 30, 290, 2);
Graphics _tmp10 = g;
mu.printValue(g, byte1, 30 + mu.iCharSizeY, XP(iEquipeExperienceLevel[i]), 8);
mu.print(g, byte0 + mu.iCharSizeX * 3, 30 + mu.iCharSizeY, 292);
if(ItPlayerSword[i].iWhat == 1)
I2Sword.drawFrame(g, 32, 14, ItPlayerSword[i].iMaterial);
if(ItPlayerArmor[i].iWhat == 2)
I2Armor.drawFrame(g, 41, 18, ItPlayerArmor[i].iMaterial);
}
void drawPlayersNControls(Graphics g)
{
bDrawTalk = false;
bDrawShop = false;
bDrawTeleport = false;
_$681 = false;
bTeleportControlOn = false;
boolean flag = false;
for(int i = 0; i < iActive_ControlsNof; i++)
{
if(cControlWhat[iActive_ControlsNr[i]] == '\003' && bSaves[cControlSaves[iActive_ControlsNr[i]]])
{
char c = cControlVal1[iActive_ControlsNr[i]];
if(!flag && iActive_ControlsYPixPos[i] > iPlayerYPix)
{
flag = true;
drawPlayer(g);
}
if(c < '\017')
{
byte byte0 = 3;
if(c == '\004')
byte0 = 4;
if(c == '\005')
byte0 = 0;
if(c == '\006')
byte0 = 1;
if(c == '\f')
byte0 = 2;
I2PNJ.drawFrame(g, iActive_ControlsXPixPos[i] - iMapXPixelPos - (I2PNJ.dx >> 1), (iActive_ControlsYPixPos[i] - iMapYPixelPos - I2PNJ.dy) + (_$366 >> 1), byte0);
} else
if(c <= '\021' || c == 'c')
{
if(c == '\021')
I2ExtraSign.draw(g, iActive_ControlsXPixPos[i] - iMapXPixelPos - (I2ExtraSign.dx >> 1), iActive_ControlsYPixPos[i] - iMapYPixelPos - I2ExtraSign.dy);
if(c == 'c')
I2King.draw(g, iActive_ControlsXPixPos[i] - iMapXPixelPos - (I2King.dx >> 1), iActive_ControlsYPixPos[i] - iMapYPixelPos - I2King.dy);
}
}
if(cControlWhat[iActive_ControlsNr[i]] == 0 && iPlayerXPix >= iActive_ControlsXPixPos[i] - 15 && iPlayerXPix <= iActive_ControlsXPixPos[i] + 15 && iPlayerYPix >= iActive_ControlsYPixPos[i] - 15 && iPlayerYPix <= iActive_ControlsYPixPos[i] + 15 && bSaves[cControlSaves[iActive_ControlsNr[i]]])
{
bDrawTalk = true;
_$681 = true;
_$682 = iActive_ControlsNr[i];
_$680 = cControlVal1[iActive_ControlsNr[i]];
}
if((cControlWhat[iActive_ControlsNr[i]] == '\001' || cControlWhat[iActive_ControlsNr[i]] == '\007') && iPlayerXPix >= iActive_ControlsXPixPos[i] - 18 && iPlayerXPix <= iActive_ControlsXPixPos[i] + 18 && iPlayerYPix >= iActive_ControlsYPixPos[i] - 18 && iPlayerYPix <= iActive_ControlsYPixPos[i] + 18 && bSaves[cControlSaves[iActive_ControlsNr[i]]])
if(cControlWhat[iActive_ControlsNr[i]] == '\001')
{
bDrawTeleport = true;
bTeleportControlOn = true;
iTeleportiActive_Control = i;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -