-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPersonnage.cpp
70 lines (58 loc) · 1.26 KB
/
Personnage.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
#include "Personnage.h"
Weapon::Weapon(std::string name, int dam, int poi, int bleed) : m_damage(dam), m_poison(poi), m_bleed(bleed)
{
m_name = name;
}
wind_t::wind_t() : window(sf::VideoMode(1920, 1080), "My window", sf::Style::Default), text(), game_state(0), textInput(), main_character("Jack", 50, 50, 1, 1, 1)
{
return;
}
void wind_t::Dialogue_set(std::string sentence)
{
m_sentence = sentence;
}
void wind_t::Display_text()
{
for (int i = 0; m_sentence[i] != '\0'; i++) {
wait_sec();
beDisplay += m_sentence[i];
toDisplay.setString(beDisplay);
window.draw(toDisplay);
window.display();
}
}
Character::Character(std::string name, int mana, int life, int str, int wis, int agi) : m_name(name), m_mana(mana), m_str(str), m_wis(wis), m_agi(agi)
{
return;
}
Character::changeName(std::string name)
{
m_name = name;
}
Character::changeMana(int mana)
{
m_mana += mana;
}
Character::changeLife(int life)
{
m_life += life;
}
Character::changeStr(int str)
{
m_str += str;
}
Character::changeWis(int wis)
{
m_wis += wis;
}
Character::changeAgi(int agi)
{
m_agi += agi;
}
void wind_t::draw_menu()
{
for (int i = 0; i< 3 && game_state == 0; i++) {
window.draw(text[i]);
}
return;
}