forked from kastian/dictator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadvice.c
64 lines (60 loc) · 1.55 KB
/
advice.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
Display how this decision can change groups strength and your
popularity with them
Copyright (C) 1983 Don Priestley - original zx-basic code.
Copyright (C) 1983 DkTRONICS - original zx-basic code.
2015 #kstn - port to C.
*/
#include "advice.h"
void advice(data* DATA)
{
int x;
int y = 5; /* Start position for text */
int a; /* For cycles */
erase();
for (a = 1; a < 20; a++)
mvprintw(a, 24, " ? ADVICE ? ");
if (key_y())
{
erase();
mvprintw(1,24,"????????????????????????????????");
attron(A_BOLD);
mvprintw(3,24,"%s",DATA->text);
attroff(A_BOLD);
mvprintw(y++,24,"Your POPULARITY with ....");
y++;
for (a = 0; a < 8; a++)
{
if (DATA->popularity[a] != 'M')
{
x = DATA->popularity[a] - 'M';
if (DATA->author == &GROUP[a] )
attron(A_BOLD);
mvprintw(y++,24," %s", GROUP[a].name);
move(y-1,45);
(x > 0) ? attron(GREEN) : attron(RED);
(x > 0) ? printw("+%d",x) : printw("%d",x);
(x > 0) ? attroff(GREEN) : attroff(RED);
if (DATA->author == &GROUP[a])
attroff(A_BOLD);
}
}
y++;
mvprintw(y++,24,"The STRENGTH of ...");
y++;
for (a = 0; a < 6; a++)
{
if (DATA->strength[a] != 'M')
{
x = DATA->strength[a] - 'M';
mvprintw(y++,24," %s", GROUP[a].name);
move(y-1,45);
(x > 0) ? attron(GREEN) : attron(RED);
(x > 0) ? printw("+%d",x) : printw("%d",x);
(x > 0) ? attroff(GREEN) : attroff(RED);
}
}
key();
}
erase();
}