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;
}
Binary file not shown.
+11 -11
View File
@@ -65,7 +65,7 @@ Bool DamageDo(Unit *target,F64 damage)
"%3d Life - %3f Damage\t=",target->life,damage;
if (damage>=target->life) {
"$$RED$$Killed$$FG$$\n";
Noise(1000*animation_delay,1000,4000);
Noise(1000*animation_delay,74,98);
Sleep(1000*animation_delay);
target->life=0;
VisRecalc(VR_FRIENDLY_UNIT_DIED,target);
@@ -140,13 +140,13 @@ U0 UnitDirectFire(Unit *tmpu,Unit *target)
if (d>=0) {
"+%5.2f Hit\n",d;
target_hit=TRUE;
Noise(500*animation_delay,100,150);
Noise(500*animation_delay,34,41);
Sleep(500*animation_delay);
Line(NULL,x1,y1,0,x2,y2,0,&BulletPlot);
} else {
"-%5.2f Miss\n",-d;
target_hit=FALSE;
Noise(1000*animation_delay,750,1000);
Noise(1000*animation_delay,69,74);
Sleep(1000*animation_delay);
a=ã*2*Rand;
d=(0.5-d/100)*HEX_SIDE;
@@ -162,7 +162,7 @@ U0 UnitDirectFire(Unit *tmpu,Unit *target)
facing=0;
DamageDo(target,HitDamage(tmpu,target,facing,range_factor));
}
while (snd.freq) //see $LK,"Snd",A="MN:Snd"$()
while (snd.ona!=ONA_REST) //see $LK,"Snd",A="MN:Snd"$()
Yield;
target_unit=NULL;
}
@@ -177,7 +177,7 @@ Bool HexOccupy(Bool overrun,Unit *tmpu,Unit *target)
AttackHeader(tmpu,"OverRun",target);
else
AttackHeader(tmpu,"CloseAssault",target);
Noise(500*animation_delay,100,150);
Noise(500*animation_delay,34,41);
Sleep(500*animation_delay);
tmpu->fired=TRUE;
target->fired=TRUE;
@@ -195,7 +195,7 @@ Bool HexOccupy(Bool overrun,Unit *tmpu,Unit *target)
}
if (DamageDo(target,Round(damage))) {
"$$RED$$Success$$FG$$\n";
while (snd.freq) //see $LK,"Snd",A="MN:Snd"$()
while (snd.ona!=ONA_REST) //see $LK,"Snd",A="MN:Snd"$()
Yield;
return TRUE;
} else {
@@ -203,7 +203,7 @@ Bool HexOccupy(Bool overrun,Unit *tmpu,Unit *target)
VisRecalc(VR_FRIENDLY_UNIT_DIED,tmpu);
alive_cnt[tmpu->player]--;
"$$RED$$Failure$$FG$$\n";
while (snd.freq) //see $LK,"Snd",A="MN:Snd"$()
while (snd.ona!=ONA_REST) //see $LK,"Snd",A="MN:Snd"$()
Yield;
return FALSE;
}
@@ -233,11 +233,11 @@ U0 IndirectResolveAll()
if (d>=0) {
"+%5.2f Hit\n",d;
Noise(500*animation_delay,100,150);
Noise(500*animation_delay,34,41);
Sleep(500*animation_delay);
} else {
"-%5.2f Miss\n",-d;
Noise(1000*animation_delay,750,1000);
Noise(1000*animation_delay,69,74);
Sleep(1000*animation_delay);
i=RandU16%6;
if (tmpi->row&1)
@@ -265,9 +265,9 @@ U0 IndirectResolveAll()
DamageDo(target,HitDamage(tmpu,target));
}
}
Noise(2000*animation_delay,800,1000);
Noise(2000*animation_delay,70,74);
Sleep(2000*animation_delay);
while (snd.freq) //see $LK,"Snd",A="MN:Snd"$()
while (snd.ona!=ONA_REST) //see $LK,"Snd",A="MN:Snd"$()
Yield;
indirect_explosion=FALSE;
+4 -4
View File
@@ -64,10 +64,10 @@ U0 UnitMoveAnimation(Unit *tmpu,I64 r,I64 c,I64 facing)
move_x=x1; move_y=y1;
moving=TRUE;
if (tmpu->infantry)
Snd(300);
Snd(53);
else {
move_facing=tmpu->facing*60.0*ã/180.0;
Snd(150);
Snd(41);
while (Wrap(f-move_facing,-ã)<=0) {
move_facing-=0.03;
Sleep(5*animation_delay);
@@ -76,12 +76,12 @@ U0 UnitMoveAnimation(Unit *tmpu,I64 r,I64 c,I64 facing)
move_facing+=0.03;
Sleep(5*animation_delay);
}
Snd(100);
Snd(34);
}
move_facing=f;
RowCol2XY(&x2,&y2,r,c);
Line(NULL,x1,y1,0,x2,y2,0,&UnitMovePlot);
Snd(0);
Snd;
moving_unit=NULL;
moving=FALSE;
}
+2 -2
View File
@@ -144,7 +144,7 @@ stk size, so don't get in the habit.
$LK,"MAlloc",A="MN:MAlloc"$() would probably be the better choice.
*/
MPCtrl1 job[mp_cnt];
CSrvCmd *cmd[mp_cnt];
CJob *cmd[mp_cnt];
if (mode==VR_FRIENDLY_UNIT_DIED) {
MemSet((&vis_unit_bitmap[enemy_player])(U8 *)+
@@ -200,7 +200,7 @@ U0 VisRecalcMap(I64 row,I64 col)
{
I64 i,hi,k,cnt;
MPCtrl2 job[mp_cnt];
CSrvCmd *cmd[mp_cnt];
CJob *cmd[mp_cnt];
cnt=mp_cnt; //Cores
hi=map_rows;
+5 -5
View File
@@ -16,7 +16,7 @@ U0 TurnNew()
SleepUntil(msg_off_timeout);
msg_off_timeout=cnts.jiffies+JIFFY_FREQ*2*animation_delay+1;
Snd(1000);
Snd(74);
StrPrint(msg_buf,"Turn %d",++turn);
VRSetUp(0);
VRSetUp(1);
@@ -36,7 +36,7 @@ U0 PhaseNew()
SleepUntil(msg_off_timeout);
msg_off_timeout=cnts.jiffies+JIFFY_FREQ*2*animation_delay+1;
Snd(1000);
Snd(74);
switch (phase) {
case PHASE_INDIRECT0:
case PHASE_INDIRECT1:
@@ -102,7 +102,7 @@ U0 UserChk()
U0 TaskEndCB()
{
Snd(0);
Snd;
progress4=progress4_max=progress1=progress1_max=0;
Exit;
}
@@ -132,7 +132,7 @@ U0 ToTheFront()
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
Cd(__DIR__);
Fs->win_inhibit|=WIF_SELF_IP_L|WIF_SELF_IP_R|WIG_DBL_CLICK;
Fs->win_inhibit|=WIF_SELF_MS_L|WIF_SELF_MS_R|WIG_DBL_CLICK;
MenuPush(
"File {"
@@ -181,7 +181,7 @@ U0 ToTheFront()
while (TRUE) {
msg_off_timeout=0;
StrCpy(msg_buf,"Game Over");
Snd(0);
Snd;
ch=GetChar(,FALSE);
if (ch=='\n') {
CleanUp;