public int mode=0;
public int sType=0;
public int sRank=0;
public Graphics g;
private GameData gData=null;
public int[] cursorX=new int[60];
public int[] cursorY=new int[60];
public int[] cursorPos=new int[60];
public int[] cursorMax=new int[60];
public int[] timer=new int[2];
public boolean shopEnd=false;
private ItemDataSet idSet=null;
public ItemData[] siData=null;
public GraphicSet gSet=null;
public int siCount=0;
public boolean infoDisp=false;
public String infoWord="";
private int modeChange=0;
public int count=0;
public void eventStart(GameData gdt) { int cursorPlus=0; int pushKey=0; int cPlus=0; if (gData.pPlatform.keyPush[4]) { gData.pPlatform.keyPush[4]=false; pushKey=1; } if (gData.pPlatform.keyPush[5]) { gData.pPlatform.keyPush[5]=false; pushKey=2; }
if (gData.pPlatform.keyPush[0]) { gData.pPlatform.keyPush[0]=false; cPlus=-1; } if (gData.pPlatform.keyPush[1]) { gData.pPlatform.keyPush[1]=false; cPlus=1; } if (gData.pPlatform.keyPush[2]) { gData.pPlatform.keyPush[2]=false; cPlus=-20; if (mode==9 || mode==11) cPlus=-10;
} if (gData.pPlatform.keyPush[3]) { gData.pPlatform.keyPush[3]=false; cPlus=20; if (mode==9 || mode==11) cPlus=10; } cursorPos[mode]+=cPlus; if (cursorPos[mode] > cursorMax[mode]) cursorPos[mode]=0; if (cursorPos[mode] < 0) cursorPos[mode]=cursorMax[mode];
int cpos=cursorPos[mode]; if (sType==1) { //宿屋のみ動作が違う。 if (mode==1) {//総合メニュー if (pushKey==1) { if (cpos==0) modeChange=2; if (cpos==1) shopEnd=true; } if (pushKey==2) shopEnd=true; } if (mode==2) { if (count==0) { count++; timerSet(30); infoDisp=true; infoWord="全回復した!"; //全回復する。トータル値をマックスと同じ値にする。当然liveがあるユニットのみ。空欄は無視
for (int i=0;i<=3;i++) { if (gData.unitLiveCheck(i)) { for (int j=0;j<=2;j++) { gData.uData[i].vst_total[i]=gData.uData[i].vst_max_total[i]; } } } } if (timer[0]>=timer[1]) { shopEnd=true; } } } else { //武器屋、防具屋、装具屋、アイテム屋は全て共通の流れになる。
if (mode==1) {//総合メニュー
if (pushKey==2) shopEnd=true; } } if (timer[1]>=1 && timer[0] if (modeChange>=1) { infoDisp=false; mode=modeChange; modeChange=0; count=0; timerSet(0); }
}
public void paint(Graphics gr) { g=gr; int sx=76; int sy=108; gSet.rectSet2(g,sx-22,sy-22,144,100,0,0); String[] word1= {"","買う","売る","戻る"}; //0番目には店のカテゴリー名が入る if (sType==1) { String[] me= {"[宿屋]","休む","戻る",""}; word1=me; } for (int i=0;i<=word1.length-1;i++) {
gSet.wordDisp_short(gr,word1[i],sx,sy+i*22); gSet.wordDisp_short2(g,"→",cursorX[1],cursorY[1]+cursorPos[1]*22,2); } if (infoDisp) infoPaint();
}
public void infoPaint() { int sx=100; int sy=300; gSet.rectSet2(g,sx-22,sy-22,144,100,0,0); gSet.wordDisp_short(g,infoWord,sx,sy);
}