forked from sshipway/wanderer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
icon.c
120 lines (118 loc) · 3.68 KB
/
icon.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/* file icon.c */
#include "wand_head.h"
#include <curses.h>
#include <string.h>
/********************************************************
* draw_symbol *
*********************************************************/
void draw_symbol(int x, int y, char ch) /* this is where the pretty graphics are */
/* all defined - change them if you want.. */
{
char icon[2][4], (*iconrow)[4] = icon;
switch (ch)
{
case ' ': /* space */
strcpy(*iconrow++, " ");
strcpy(*iconrow, " ");
break;
case '#': /* rock */
strcpy(*iconrow++, "###");
strcpy(*iconrow, "###");
break;
case '<': /* arrows */
strcpy(*iconrow++, "<--");
strcpy(*iconrow, "<--");
break;
case '>':
strcpy(*iconrow++, "-->");
strcpy(*iconrow, "-->");
break;
case 'O': /* boulder */
strcpy(*iconrow++, "/^\\");
strcpy(*iconrow, "\\_/");
break;
case ':': /* earth */
strcpy(*iconrow++, ". .");
strcpy(*iconrow, " . ");
break;
case '/': /* slopes */
strcpy(*iconrow++, " _/");
strcpy(*iconrow, "/ ");
break;
case '\\':
strcpy(*iconrow++, "\\_ ");
strcpy(*iconrow, " \\");
break;
case '*': /* diamond */
strcpy(*iconrow++, "/$\\");
strcpy(*iconrow, "\\$/");
break;
case '=': /* rock */
strcpy(*iconrow++, "=-=");
strcpy(*iconrow, "-=-");
break;
case '@': /* YOU!!! */
strcpy(*iconrow++, " o ");
strcpy(*iconrow, "<|>");
break;
case '~': /* pushable thingy */
strcpy(*iconrow++, "\\|/");
strcpy(*iconrow, "/|\\");
break;
case 't':
case 'T': /* teleport */
strcpy(*iconrow++, "(*)");
strcpy(*iconrow, "(*)");
break;
case 'X': /* exits */
strcpy(*iconrow++, "Way");
strcpy(*iconrow, "Out");
break;
case '!': /* landmine */
strcpy(*iconrow++, " I ");
strcpy(*iconrow, " o ");
break;
case 'M': /* big monster */
strcpy(*iconrow++, "}o{");
strcpy(*iconrow, "/^\\");
break;
case 'S': /* baby monster */
strcpy(*iconrow++, "-o-");
strcpy(*iconrow, "/*\\");
break;
case '^': /* balloon */
strcpy(*iconrow++, "/~\\");
strcpy(*iconrow, "\\_X");
break;
case 'C': /* time capsule */
strcpy(*iconrow++, " ");
strcpy(*iconrow, "<O>");
break;
case '+': /* cage */
strcpy(*iconrow++, "TTT");
strcpy(*iconrow, "III");
break;
case '_': /* more wall characters */
strcpy(*iconrow++, "_|_");
strcpy(*iconrow, "_|_");
break;
case 'B': /* the bomb */
strcpy(*iconrow++, "/\\*");
strcpy(*iconrow, "\\/ ");
break;
case '%': /* the explosion */
strcpy(*iconrow++, "Ba\\");
strcpy(*iconrow, "\\ng");
break;
default: /* this is what it uses if it doesnt */
/* recognise the character */
strcpy(*iconrow++, "OoO");
strcpy(*iconrow, "oOo");
break;
};
move(y + 1, x + 1);
iconrow--;
addstr(*iconrow++);
move(y + 2, x + 1);
addstr(*iconrow);
}