-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbattle.c
78 lines (63 loc) · 1.22 KB
/
battle.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
#include "struct.h"
#include <stdio.h>
#include"linkop.h"
#include"show.h"
#include "draw.h"
#include"tools.h"
#pragma warning(disable:4996)
struct enemyList* enemyhead;
enemy enemy1;
int roundnum;
int roomx;
int roomy;
int curline;
int isinput;
char RoomLine[15][30];
void battlePanel();
void battleThread();
void battlePanel() {
char str[100];
//int exist = 0;
//int money = 0;
strcpy(str, RoomLine[curline]);
int ID = StringTOnumber(str);
struct enemyList* node = enemyhead;
struct enemyList* purpose = NULL;
while (node != NULL)
{
if (node->enemy.ID == ID) {
purpose = node;
break;
}
node = node->next;
}
enemy1 = purpose->enemy;
showEnemyInfomation(enemy1);
curline = 1;
battleThread();
}
void battleThread()
{
roundnum++;
if (roundnum == 1)
cleanroom();
setxy(roomx + 3, roomy + 1);
strcpy(RoomLine[0], "========Õ½¶·»úÖÆ========");
printf("%s", RoomLine[0]);
if (curline <= 13)
{
setxy(roomx + 3, roomy + 1 + curline);
sprintf(RoomLine[curline], "µÚ%d»ØºÏ", roundnum);
printf("%s", RoomLine[curline]);
curline++;
isinput = 1;
fflush(stdin);
}
else {
sprintf(RoomLine[curline], "µÚ%d»ØºÏ", roundnum);
refeshmessage();
isinput = 1;
fflush(stdin);
}
Saveinfomation('k');
}