TempleOSCDV5.00.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:48:09 +02:00
1 parent 122df6338e
commit f6eacf7744
374 files changed
+11078 -11204

No files matched your search

+43 -43
View File
@@ -1,7 +1,7 @@
U0 PlayerIndirect()
{
Unit *tmpu=NULL;
I64 i,remaining=0,msg_code,a1,a2;
I64 i,remaining=0,msg_code,arg1,arg2;
F64 target_x,target_y;
ViewPlayerSet(cur_player);
for (i=0;i<MAX_UNITS;i++) {
@@ -12,16 +12,16 @@ U0 PlayerIndirect()
while (remaining) {
if (!alive_cnt[0] || !alive_cnt[1])
throw('GameOver',TRUE);
msg_code=GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN|1<<MSG_IP_L_UP|
1<<MSG_IP_R_UP);
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|
1<<MSG_MS_R_UP);
switch (msg_code) {
case MSG_KEY_DOWN:
CharDo(a1);
CharDo(arg1);
break;
case MSG_IP_L_DOWN:
if (CursorInWin(Fs,a1,a2)) {
a1-=x0; a2-=y0;
CursorUpdate(Fs,a1,a2);
case MSG_MS_L_DOWN:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
if (tmpu=UnitFind(cursor_row,cursor_col)) {
if (tmpu->player==enemy_player || tmpu->fired ||
!tmpu->indirect_fire)
@@ -33,10 +33,10 @@ U0 PlayerIndirect()
}
}
break;
case MSG_IP_L_UP:
if (CursorInWin(Fs,a1,a2)) {
a1-=x0; a2-=y0;
CursorUpdate(Fs,a1,a2);
case MSG_MS_L_UP:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
RowCol2XY(&target_x,&target_y,cursor_row,cursor_col);
if (!tmpu)
Beep;
@@ -53,8 +53,8 @@ U0 PlayerIndirect()
tmpu=NULL;
fire_radius=0;
break;
case MSG_IP_R_UP:
if (CursorInWin(Fs,a1,a2))
case MSG_MS_R_UP:
if (CursorInWin(Fs,arg1,arg2))
throw('PhaseOvr',TRUE);
break;
}
@@ -65,42 +65,42 @@ U0 PlayerIndirect()
U0 PlayerMove()
{
Unit *tmpu=NULL;
I64 msg_code,a1,a2;
I64 msg_code,arg1,arg2;
ViewPlayerSet(cur_player);
while (TRUE) {
if (!alive_cnt[0] || !alive_cnt[1])
throw('GameOver',TRUE);
msg_code=GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN|1<<MSG_IP_L_UP|
1<<MSG_IP_R_UP);
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|
1<<MSG_MS_R_UP);
switch (msg_code) {
case MSG_KEY_DOWN:
CharDo(a1);
CharDo(arg1);
break;
case MSG_IP_L_DOWN:
if (CursorInWin(Fs,a1,a2)) {
a1-=x0; a2-=y0;
CursorUpdate(Fs,a1,a2);
case MSG_MS_L_DOWN:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
if (tmpu=UnitFind(cursor_row,cursor_col)) {
if (tmpu->player==enemy_player || !tmpu->remaining_movement)
tmpu=NULL;
}
}
break;
case MSG_IP_L_UP:
if (CursorInWin(Fs,a1,a2)) {
a1-=x0; a2-=y0;
CursorUpdate(Fs,a1,a2);
case MSG_MS_L_UP:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
if (!tmpu)
Beep;
else {
UnitMove(tmpu,a1,a2);
UnitMove(tmpu,arg1,arg2);
break;
}
}
tmpu=NULL;
break;
case MSG_IP_R_UP:
if (CursorInWin(Fs,a1,a2))
case MSG_MS_R_UP:
if (CursorInWin(Fs,arg1,arg2))
throw('PhaseOvr',TRUE);
break;
}
@@ -110,21 +110,21 @@ U0 PlayerMove()
U0 PlayerDirect()
{
Unit *tmpu=NULL,*target;
I64 msg_code,a1,a2;
I64 msg_code,arg1,arg2;
ViewPlayerSet(cur_player);
while (TRUE) {
if (!alive_cnt[0] || !alive_cnt[1])
throw('GameOver',TRUE);
msg_code=GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN|1<<MSG_IP_L_UP|
1<<MSG_IP_R_UP);
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|
1<<MSG_MS_R_UP);
switch (msg_code) {
case MSG_KEY_DOWN:
CharDo(a1);
CharDo(arg1);
break;
case MSG_IP_L_DOWN:
if (CursorInWin(Fs,a1,a2)) {
a1-=x0; a2-=y0;
CursorUpdate(Fs,a1,a2);
case MSG_MS_L_DOWN:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
if (tmpu=UnitFind(cursor_row,cursor_col)) {
if (tmpu->player==enemy_player || tmpu->fired ||
tmpu->indirect_fire)
@@ -138,10 +138,10 @@ U0 PlayerDirect()
}
}
break;
case MSG_IP_L_UP:
if (CursorInWin(Fs,a1,a2)) {
a1-=x0; a2-=y0;
CursorUpdate(Fs,a1,a2);
case MSG_MS_L_UP:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
target=UnitFind(cursor_row,cursor_col);
if (!tmpu)
Beep;
@@ -157,8 +157,8 @@ U0 PlayerDirect()
tmpu=NULL;
fire_radius=0;
break;
case MSG_IP_R_UP:
if (CursorInWin(Fs,a1,a2))
case MSG_MS_R_UP:
if (CursorInWin(Fs,arg1,arg2))
throw('PhaseOvr',TRUE);
break;
}