// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: Hitobuf.java
package applet;
import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.Graphics;
import java.io.PrintStream;
// Referenced classes of package applet:
// Gocha, Fq_1, Grand, YaManeger
class TeamManeger extends Applet {
public int Hito_X(int hito_toosinum) {
return hito[hito_toosinum].X;
}
public int Hito_Y(int hito_toosinum) {
return hito[hito_toosinum].Y;
}
public int Hito_XMOKU(int hito_toosinum) {
return hito[hito_toosinum].XMOKU;
}
public int Hito_YMOKU(int hito_toosinum) {
return hito[hito_toosinum].YMOKU;
}
public int Hito_DIR(int hito_toosinum) {
return hito[hito_toosinum].DIR;
}
public void MapItemtSet(int map_num) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 4; j++) {
if (MapItemPoint_10[i][j] < 0)
return;
fq_1.MAP_ITEM[i * 4 + j] = MapItemPoint_10[i][j];
}
}
}
public void flg_cls() {
if (fq_1.Total_Hito == 0)
return;
for (int i = 0; i < fq_1.Total_Hito; i++)
if ((hito[i].FL & 0xf) == 0) {
hito[i].T_NERAWARE = 0;
hito[i].T_KAKOMARE = 0;
}
for (int i = 0; i < TotalTeam; i++)
TEKI[i] &= 0xffffffc3;
}
public boolean hagure_set(int mem) {
if (mem < 0)
return false;
for (int i = 0; i < 20; i++)
if (fq_1.MEMBER_HAGURE[i] < 0) {
fq_1.MEMBER_HAGURE[i] = mem;
return true;
}
return false;
}
public void Team_MapOut(int flug) {
int mx = hito[fq_1.Control_Hito].X;
int my = hito[fq_1.Control_Hito].Y;
if (flug == 1) {
int teamnum = 1;
if (fq_1.Control_Team == 1)
teamnum = 0;
int tnin = GetNINZU(teamnum);
if (tnin != 0) {
fq_1.MT_KeikokuCont = 3;
fq_1.MT_KeikokuNum = 10;
return;
}
}
for (int i = 0; i < fq_1.Total_Hito; i++)
if ((hito[i].FL & 0xf) == 0 && hito[i].TM_NUM == fq_1.Control_Team
&& i != fq_1.Control_Hito)
if ((hito[i].FLG1 & 4) != 0 || (hito[i].FL & 0x30) != 0) {
int aite = hito[i].AITE_D;
if (aite >= 0 && (hito[aite].MTOK & 0x40) == 0)
hagure_set(i + 100);
} else {
int len = fq_1.kyori(mx, my, hito[i].X, hito[i].Y);
if (len >= 128)
hagure_set(i);
else if (len >= 64 && fq_1.random((128 - len) / 8 + 1) == 0)
hagure_set(i);
}
fq_1.i_Pouse = 5;
fq_1.b_YN_MODE = true;
}
public void Team_MapPointKaijyo(int team_num) {
for (int i = 0; i < fq_1.Total_Hito; i++)
if ((hito[i].FL & 0xf) == 0 && hito[i].TM_NUM == team_num) {
hito[i].FLG2 &= 0xffffffef;
hito[i].FLG3 &= -5;
}
}
public void Team_MapPointSet(int team_num, int data_num) {
if (data_num > 2)
return;
int suu = 0;
for (int i = 0; i < fq_1.Total_Hito; i++)
if ((hito[i].FL & 0xf) == 0 && hito[i].TM_NUM == team_num) {
hito[i].X = MapSetPoint[data_num][suu * 2 + 0];
hito[i].Y = MapSetPoint[data_num][suu * 2 + 1];
hito[i].XO = hito[i].X;
hito[i].YO = hito[i].Y;
hito[i].XO2 = hito[i].X;
hito[i].YO2 = hito[i].Y;
hito[i].XNE = hito[i].X;
hito[i].YNE = hito[i].Y;
hito[i].XMOKU = hito[i].X;
hito[i].YMOKU = hito[i].Y;
hito[i].FLG2 |= 0x10;
hito[i].FLG3 |= 4;
if (++suu >= 20)
return;
}
}
public void hito_command() {
for (int m_num = 0; m_num < fq_1.Total_Hito; m_num++)
if ((hito[m_num].FL & 8) == 0
&& fq_1.Control_Team == hito[m_num].TM_NUM)
switch (fq_1.CommandCode) {
case 0: // '\0'
hito[m_num].FLG3 &= -5;
hito[m_num].FLG1 &= 0xffffffbd;
hito[m_num].FLG2 &= 0xffffffef;
break;
case 1: // '\001'
hito[m_num].FLG3 &= -5;
hito[m_num].FLG1 |= 0x40;
hito[m_num].FLG1 &= -3;
hito[m_num].FLG2 &= 0xffffffef;
break;
case 2: // '\002'
hito[m_num].FLG3 &= -5;
hito[m_num].FLG1 &= 0xffffffbf;
hito[m_num].FLG2 &= 0xffffffef;
break;
case 3: // '\003'
hito[m_num].FLG3 |= 4;
hito[m_num].FLG1 &= 0xffffffbd;
break;
}
}
public void form_tuibi_in(int x, int y) {
if (Formation_abs[0] == x && Formation_abs[1] == y)
return;
for (int i = 59; i > 0; i--) {
Formation_abs[i * 2] = Formation_abs[(i - 1) * 2];
Formation_abs[i * 2 + 1] = Formation_abs[(i - 1) * 2 + 1];
}
Formation_abs[0] = x;
Formation_abs[1] = y;
}
public void form_tuibi_cls(int x, int y) {
for (int i = 0; i < 80; i++) {
Formation_abs[i * 2] = x;
Formation_abs[i * 2 + 1] = y;
}
}
public void form_change(int team_num, int form_num) {
if (fq_1.Total_Hito == 0)
return;
if (form_num > 16)
return;
FORM[team_num] = form_num;
int pos = -1;
for (int i = 0; i < fq_1.Total_Hito; i++)
if ((hito[i].FL & 0xf) == 0 && hito[i].TM_NUM == team_num) {
if (pos < 0) {
hito[i].XFOR = 0;
hito[i].YFOR = 0;
} else {
hito[i].XFOR = Formation[FORM[team_num]][pos * 2];
hito[i].YFOR = Formation[FORM[team_num]][pos * 2 + 1];
}
if (pos < 20)
pos++;
}
}
public int onfire_line(int hito_toosinum, int mx, int my, int maxlen) {
int zoku = hito[hito_toosinum].ZOKUJ;
int minlen = maxlen;
int nowdir = -1;
for (int i = 0; i < fq_1.Total_Hito; i++)
if ((hito[i].FL & 0xf) == 0 && (hito[i].FLG2 & 0x10) == 0
&& i != hito_toosinum) {
int zoku_t = hito[i].ZOKUJ;
int dx = hito[i].X - mx;
int dy = hito[i].Y - my;
if (zoku_t != zoku) {
if (dy < 0 && -dy < maxlen && (dx == 0 || dx == 1)) {
int len = -dy;
if (len < minlen) {
minlen = len;
nowdir = 0;
}
}
if (dx < 0 && -dx < maxlen && (dy == 0 || dy == 1)) {
int len = -dx;
if (len < minlen) {
minlen = len;
nowdir = 1;
}
}
if (dy > 0 && dy < maxlen && (dx == 0 || dx == 1)) {
int len = dy;
if (len < minlen) {
minlen = len;
nowdir = 2;
}
}
if (dx > 0 && dx < maxlen && (dy == 0 || dy == 1)) {
int len = dx;
if (len < minlen) {
minlen = len;
nowdir = 3;
}
}
}
}
return nowdir;
}
public int teki_iruka(int hito_toosinum, int mx, int my, int maxlen) {
int zoku = hito[hito_toosinum].ZOKUJ;
for (int i = 0; i < fq_1.Total_Hito; i++)
if ((hito[i].FL & 8) == 0 && (hito[i].FLG2 & 0x10) == 0
&& i != hito_toosinum) {
int zoku_t = hito[i].ZOKUJ;
if (zoku_t != zoku
&& fq_1.kyori(mx, my, hito[i].X, hito[i].Y) < maxlen)
return i;
}
return -1;
}
public int teki_search(int hito_toosinum, int mx, int my, int maxlen,
int gamennai, int kakomisuu) {
int zoku = hito[hito_toosinum].ZOKUJ;
int mini = maxlen;
int teki = -1;
for (int i = 0; i < fq_1.Total_Hito; i++)
if ((hito[i].FL & 0xf) == 0 && (hito[i].FLG2 & 0x10) == 0
&& i != hito_toosinum) {
int zoku_t = hito[i].ZOKUJ;
if (zoku_t != zoku && hito[i].T_KAKOMARE < kakomisuu
&& (gamennai == 0 || (hito[i].FL & 0x80) != 0)) {
int tx = hito[i].X;
int ty = hito[i].Y;
int len = fq_1.kyori(mx, my, tx, ty);
if (len < mini) {
mini = len;
teki = i;
}
}
}
if (teki >= 0) {
hito[hito_toosinum].AITE_A = teki;
hito[hito_toosinum].AITE_D = teki;
hito[hito_toosinum].XNE = hito[teki].X;
hito[hito_toosinum].YNE = hito[teki].Y;
hito[hito_toosinum].TEKI_LEN = mini;
hito[teki].T_NERAWARE++;
return teki;
} else {
return -1;
}
}
public int teki_search_op1(int hito_toosinum, int mx, int my, int maxlen,
int gamennai, int kakomisuu) {
int zoku = hito[hito_toosinum].ZOKUJ;
int mini = maxlen;
int teki = -1;
for (int i = 0; i < fq_1.Total_Hito; i++)