Skip to content

Commit 776bfc9

Browse files
committed
games: resync Scott Adams and Brian Howarth games
1 parent fcc7054 commit 776bfc9

26 files changed

+130
-26
lines changed

Applications/games/adv01.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2303,6 +2303,10 @@ static int action_restore(void)
23032303
static void moveitem(uint8_t i, uint8_t l)
23042304
{
23052305
uint8_t *p = game.objloc + i;
2306+
if (*p == 255)
2307+
game.carried--;
2308+
if (l == 255)
2309+
game.carried++;
23062310
if (*p == game.location)
23072311
redraw |= REDRAW_MAYBE;
23082312
if (l == game.location)
@@ -2607,7 +2611,7 @@ void process_light(void)
26072611
return;
26082612
}
26092613
}
2610-
if (game.lighttime > 25)
2614+
if (game.lighttime > 25 || (l != 255 && l != game.location))
26112615
return;
26122616
strout_lower(lightoutin);
26132617
decout_lower(game.lighttime);

Applications/games/adv02.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2358,6 +2358,10 @@ static int action_restore(void)
23582358
static void moveitem(uint8_t i, uint8_t l)
23592359
{
23602360
uint8_t *p = game.objloc + i;
2361+
if (*p == 255)
2362+
game.carried--;
2363+
if (l == 255)
2364+
game.carried++;
23612365
if (*p == game.location)
23622366
redraw |= REDRAW_MAYBE;
23632367
if (l == game.location)
@@ -2662,7 +2666,7 @@ void process_light(void)
26622666
return;
26632667
}
26642668
}
2665-
if (game.lighttime > 25)
2669+
if (game.lighttime > 25 || (l != 255 && l != game.location))
26662670
return;
26672671
strout_lower(lightoutin);
26682672
decout_lower(game.lighttime);

Applications/games/adv03.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2189,6 +2189,10 @@ static int action_restore(void)
21892189
static void moveitem(uint8_t i, uint8_t l)
21902190
{
21912191
uint8_t *p = game.objloc + i;
2192+
if (*p == 255)
2193+
game.carried--;
2194+
if (l == 255)
2195+
game.carried++;
21922196
if (*p == game.location)
21932197
redraw |= REDRAW_MAYBE;
21942198
if (l == game.location)
@@ -2493,7 +2497,7 @@ void process_light(void)
24932497
return;
24942498
}
24952499
}
2496-
if (game.lighttime > 25)
2500+
if (game.lighttime > 25 || (l != 255 && l != game.location))
24972501
return;
24982502
strout_lower(lightoutin);
24992503
decout_lower(game.lighttime);

Applications/games/adv04.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2403,6 +2403,10 @@ static int action_restore(void)
24032403
static void moveitem(uint8_t i, uint8_t l)
24042404
{
24052405
uint8_t *p = game.objloc + i;
2406+
if (*p == 255)
2407+
game.carried--;
2408+
if (l == 255)
2409+
game.carried++;
24062410
if (*p == game.location)
24072411
redraw |= REDRAW_MAYBE;
24082412
if (l == game.location)
@@ -2707,7 +2711,7 @@ void process_light(void)
27072711
return;
27082712
}
27092713
}
2710-
if (game.lighttime > 25)
2714+
if (game.lighttime > 25 || (l != 255 && l != game.location))
27112715
return;
27122716
strout_lower(lightoutin);
27132717
decout_lower(game.lighttime);

Applications/games/adv05.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2480,6 +2480,10 @@ static int action_restore(void)
24802480
static void moveitem(uint8_t i, uint8_t l)
24812481
{
24822482
uint8_t *p = game.objloc + i;
2483+
if (*p == 255)
2484+
game.carried--;
2485+
if (l == 255)
2486+
game.carried++;
24832487
if (*p == game.location)
24842488
redraw |= REDRAW_MAYBE;
24852489
if (l == game.location)
@@ -2784,7 +2788,7 @@ void process_light(void)
27842788
return;
27852789
}
27862790
}
2787-
if (game.lighttime > 25)
2791+
if (game.lighttime > 25 || (l != 255 && l != game.location))
27882792
return;
27892793
strout_lower(lightoutin);
27902794
decout_lower(game.lighttime);

Applications/games/adv06.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2462,6 +2462,10 @@ static int action_restore(void)
24622462
static void moveitem(uint8_t i, uint8_t l)
24632463
{
24642464
uint8_t *p = game.objloc + i;
2465+
if (*p == 255)
2466+
game.carried--;
2467+
if (l == 255)
2468+
game.carried++;
24652469
if (*p == game.location)
24662470
redraw |= REDRAW_MAYBE;
24672471
if (l == game.location)
@@ -2766,7 +2770,7 @@ void process_light(void)
27662770
return;
27672771
}
27682772
}
2769-
if (game.lighttime > 25)
2773+
if (game.lighttime > 25 || (l != 255 && l != game.location))
27702774
return;
27712775
strout_lower(lightoutin);
27722776
decout_lower(game.lighttime);

Applications/games/adv07.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2489,6 +2489,10 @@ static int action_restore(void)
24892489
static void moveitem(uint8_t i, uint8_t l)
24902490
{
24912491
uint8_t *p = game.objloc + i;
2492+
if (*p == 255)
2493+
game.carried--;
2494+
if (l == 255)
2495+
game.carried++;
24922496
if (*p == game.location)
24932497
redraw |= REDRAW_MAYBE;
24942498
if (l == game.location)
@@ -2793,7 +2797,7 @@ void process_light(void)
27932797
return;
27942798
}
27952799
}
2796-
if (game.lighttime > 25)
2800+
if (game.lighttime > 25 || (l != 255 && l != game.location))
27972801
return;
27982802
strout_lower(lightoutin);
27992803
decout_lower(game.lighttime);

Applications/games/adv08.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2607,6 +2607,10 @@ static int action_restore(void)
26072607
static void moveitem(uint8_t i, uint8_t l)
26082608
{
26092609
uint8_t *p = game.objloc + i;
2610+
if (*p == 255)
2611+
game.carried--;
2612+
if (l == 255)
2613+
game.carried++;
26102614
if (*p == game.location)
26112615
redraw |= REDRAW_MAYBE;
26122616
if (l == game.location)
@@ -2911,7 +2915,7 @@ void process_light(void)
29112915
return;
29122916
}
29132917
}
2914-
if (game.lighttime > 25)
2918+
if (game.lighttime > 25 || (l != 255 && l != game.location))
29152919
return;
29162920
strout_lower(lightoutin);
29172921
decout_lower(game.lighttime);

Applications/games/adv09.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2671,6 +2671,10 @@ static int action_restore(void)
26712671
static void moveitem(uint8_t i, uint8_t l)
26722672
{
26732673
uint8_t *p = game.objloc + i;
2674+
if (*p == 255)
2675+
game.carried--;
2676+
if (l == 255)
2677+
game.carried++;
26742678
if (*p == game.location)
26752679
redraw |= REDRAW_MAYBE;
26762680
if (l == game.location)
@@ -2975,7 +2979,7 @@ void process_light(void)
29752979
return;
29762980
}
29772981
}
2978-
if (game.lighttime > 25)
2982+
if (game.lighttime > 25 || (l != 255 && l != game.location))
29792983
return;
29802984
strout_lower(lightoutin);
29812985
decout_lower(game.lighttime);

Applications/games/adv10.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2589,6 +2589,10 @@ static int action_restore(void)
25892589
static void moveitem(uint8_t i, uint8_t l)
25902590
{
25912591
uint8_t *p = game.objloc + i;
2592+
if (*p == 255)
2593+
game.carried--;
2594+
if (l == 255)
2595+
game.carried++;
25922596
if (*p == game.location)
25932597
redraw |= REDRAW_MAYBE;
25942598
if (l == game.location)
@@ -2893,7 +2897,7 @@ void process_light(void)
28932897
return;
28942898
}
28952899
}
2896-
if (game.lighttime > 25)
2900+
if (game.lighttime > 25 || (l != 255 && l != game.location))
28972901
return;
28982902
strout_lower(lightoutin);
28992903
decout_lower(game.lighttime);

0 commit comments

Comments
 (0)