-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.c
106 lines (80 loc) · 2.46 KB
/
main.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
#include <stdio.h>
#include "player.h"
int main () {
struct player p;
card_t attacker, attacker2, attacker3;
card_t defender, defender2, defender3;
init_card(&attacker, "The Almighty Joe", 10, 12, 1);
init_card(&defender, "The Weirdo", 6, 3, 1);
init_card(&attacker2, "Goat poop", 6, 3, 1);
init_card(&defender2, "Cow poop", 10, 12, 1);
init_card(&attacker3, "Mexican immigrant", 10, 3, 1);
init_card(&defender3, "American redneck", 10, 3, 1);
init_deck(&p.deck);
push_card(attacker, &p.deck);
push_card(defender, &p.deck);
push_card(attacker2, &p.deck);
push_card(defender2, &p.deck);
push_card(attacker3, &p.deck);
push_card(defender3, &p.deck);
printf("--- PRINTING THE CONTENTS OF THE DECK ---\n");
print_deck(p.deck);
printf("--- TESTING TOP AND POP --- \n");
struct deck_t temp_deck = p.deck;
look_card(temp_deck);
printf("\n");
draw_card(&temp_deck);
look_card(temp_deck);
printf("\n");
draw_card(&temp_deck);
look_card(temp_deck);
printf("\n");
draw_card(&temp_deck);
look_card(temp_deck);
printf("--- TESTING THE MANA SYSTEM --- \n");
manapool_t temp_mana;
mana_init(&temp_mana);
print_mana(temp_mana);
put_card(attacker, &temp_mana, &temp_deck);
print_mana(temp_mana);
put_card(defender, &temp_mana, &temp_deck);
print_mana(temp_mana);
// to init a player there has to be a working deck first
init_player(&p);
printf("--- DEMONSTRATING THE BATTLE SYSTEM --- \n");
printf("Attacker: \n");
print_card(attacker);
printf("Defender: \n");
print_card(defender);
print_winner(attacker, defender);
printf("--- --- --- --- ---\n");
printf("Attacker: \n");
print_card(attacker2);
printf("Defender: \n");
print_card(defender2);
print_winner(attacker2, defender2);
printf("--- --- --- --- ---\n");
printf("Attacker: \n");
print_card(attacker3);
printf("Defender: \n");
print_card(defender3);
print_winner(attacker3, defender3);
printf("--- DEMONSTRATING THE CHANGE HEALTH FUNCTION ---\n");
print_health(p);
change_health(&p, 30, DECREASE);
print_health(p);
change_health(&p, 30, INCREASE);
print_health(p);
printf("--- PRINTING THE CONTENTS OF THE HAND ---\n");
print_hand(p);
printf("--- PLAYING A CARD FROM THE HAND ---\n");
play_card_from_hand(&p, "Cow poop");
printf("--- PRINTING THE CONTENTS OF THE HAND AGAIN ---\n");
print_hand(p);
printf("--- DEMONSTRATING THE TURN BEGIN FUNCTION ---\n");
turn_begin(&p);
printf("--- PRINTING THE CONTENTS OF THE HAND AGAIN ---\n");
print_hand(p);
turn_begin(&p);
return 0;
}