-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInventory.cpp
114 lines (75 loc) · 2.71 KB
/
Inventory.cpp
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
#include "Header.h"
void Inventory_sell::add_invent_items() {
_pictures.clear();
_circles.clear();
_text.clear();
_frames.clear();
add_grid_els(player->loot_inventory);
add_srats();
}
void Inventory_sell::sell() {
player->money += player->loot_inventory[selected_el].cost;
player->loot_to_the_musium(player->loot_inventory[selected_el]);
player->loot_inventory.erase(player->loot_inventory.begin() + selected_el);
something_changed = true;
if (player->musium_items.size() >= 9) {
congrats_you_won();
}
}
void Inventory_sell::select_actions() {
if (selected_el < player->loot_inventory.size()) {
show_text_and_pic("this is " + player->loot_inventory[selected_el].name + ", it costs " + std::to_string(player->loot_inventory[selected_el].cost), _pictures[selected_el]);
while (!GetAsyncKeyState(VK_SPACE)) {}
if (yes_no_choice("do you whant to sell " + player->loot_inventory[selected_el].name + " to the musium?")) {
sell();
}
add_invent_items();
something_changed = true;
}
}
void Inventory_sell::congrats_you_won() {
text_seq_render({ text_squere("congrandilations, you've found and sold to the musium all the loot I've added to the game, so that means that you won!!!!!!!!!!!!!!!!!!!!", 55), text_squere("congrandilations!!!!!!!!!!!!!", 0), text_squere("thank y so so much for playing", 0), text_squere("if you want, you can continue playing", 0) });
}
void Inventory_return::add_invent_items() {
_pictures.clear();
_circles.clear();
_text.clear();
_frames.clear();
add_grid_els(player->eqip_inventory);
add_srats();
}
void Inventory_return::select_actions() {
show_text_and_pic("this is " + player->eqip_inventory[selected_el].name, player->eqip_inventory[selected_el]);
while (!GetAsyncKeyState(VK_SPACE)) {}
if (yes_no_choice("do you whant to use " + player->eqip_inventory[selected_el].name + " for this mission?")) {
to_return = player->eqip_inventory[selected_el].for_what_mission;
if (player->eqip_inventory[selected_el].name != "your hand") {
(player->eqip_inventory).erase((player->eqip_inventory).begin() + selected_el);
}
is_quit = true;
}
add_invent_items();
something_changed = true;
}
int Inventory_return::get_to_return() {
return to_return;
}
void Inventory_tools::add_invent_items() {
_pictures.clear();
_circles.clear();
_text.clear();
_frames.clear();
add_grid_els(player->eqip_inventory);
add_srats();
}
void Inventory_tools::select_actions() {
if (selected_el < player->eqip_inventory.size()) {
show_text_and_pic("this is " + player->eqip_inventory[selected_el].name, _pictures[selected_el]);
add_invent_items();
for (int i = 0; i < _pictures.size(); i++) {
_frames[i].is_big = i == selected_el;
}
something_changed = true;
render();
}
}