]> git.jsancho.org Git - lugaru.git/blob - Source/Objects/PersonType.cpp
Moved hurtidle anim to PersonType to avoid hardcoded wolftype test
[lugaru.git] / Source / Objects / PersonType.cpp
1 /*
2 Copyright (C) 2016-2017 - Lugaru contributors (see AUTHORS file)
3
4 This file is part of Lugaru.
5
6 Lugaru is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 Lugaru is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "Objects/PersonType.hpp"
21
22 std::vector<PersonType> PersonType::types;
23
24 PersonType::PersonType()
25 {
26     animTalkIdle = tempanim;
27     animHurtIdle = tempanim;
28 }
29
30 bool PersonType::hasAnimTalkIdle()
31 {
32     return (animTalkIdle != tempanim);
33 }
34
35 bool PersonType::hasAnimHurtIdle()
36 {
37     return (animHurtIdle != tempanim);
38 }
39
40 void PersonType::Load()
41 {
42     types.resize(2);
43
44     /* Wolf */
45     types[wolftype].proportions[0] = 1.1;
46     types[wolftype].proportions[1] = 1.1;
47     types[wolftype].proportions[2] = 1.1;
48     types[wolftype].proportions[3] = 1.1;
49
50     types[wolftype].animRun = wolfrunanim;
51     types[wolftype].animRunning = wolfrunninganim;
52     types[wolftype].animCrouch = wolfcrouchanim;
53     types[wolftype].animStop = wolfstopanim;
54     types[wolftype].animLanding = wolflandanim;
55     types[wolftype].animLandingHard = wolflandhardanim;
56     types[wolftype].animFightIdle = wolfidle;
57     types[wolftype].animBounceIdle = wolfidle;
58
59     types[wolftype].soundsAttack[0] = barksound;
60     types[wolftype].soundsAttack[1] = bark2sound;
61     types[wolftype].soundsAttack[2] = bark3sound;
62     types[wolftype].soundsAttack[3] = barkgrowlsound;
63     types[wolftype].soundsTalk[0] = growlsound;
64     types[wolftype].soundsTalk[1] = growl2sound;
65
66     types[wolftype].figureFileName = "Skeleton/BasicFigureWolf";
67     types[wolftype].lowFigureFileName = "Skeleton/BasicFigureWolfLow";
68     types[wolftype].clothesFileName = "Skeleton/RabbitBelt";
69     types[wolftype].modelFileNames[0] = "Models/Wolf.solid";
70     types[wolftype].modelFileNames[1] = "Models/Wolf2.solid";
71     types[wolftype].modelFileNames[2] = "Models/Wolf3.solid";
72     types[wolftype].modelFileNames[3] = "Models/Wolf4.solid";
73     types[wolftype].modelFileNames[4] = "Models/Wolf5.solid";
74     types[wolftype].modelFileNames[5] = "Models/Wolf6.solid";
75     types[wolftype].modelFileNames[6] = "Models/Wolf7.solid";
76     types[wolftype].lowModelFileName = "Models/WolfLow.solid";
77     types[wolftype].modelClothesFileName = "Models/Belt.solid";
78
79     types[wolftype].skins.resize(3);
80     types[wolftype].skins[0] = "Textures/FurWolfGrey.jpg";
81     types[wolftype].skins[1] = "Textures/FurWolfDark.jpg";
82     types[wolftype].skins[2] = "Textures/FurWolfSnow.jpg";
83
84     types[wolftype].power = 2.5;
85     types[wolftype].defaultDamageTolerance = 300;
86     types[wolftype].defaultScale = .23;
87     types[wolftype].hasClaws = true;
88     types[wolftype].clothes = false;
89     types[wolftype].maxRunSpeed = 75;
90     types[wolftype].knifeCatchingType = 1;
91
92     /* Rabbit */
93     types[rabbittype].proportions[0] = 1.2;
94     types[rabbittype].proportions[1] = 1.05;
95     types[rabbittype].proportions[2] = 1;
96     types[rabbittype].proportions[3] = 1.1;
97     types[rabbittype].proportions[3].y = 1.05;
98
99     types[rabbittype].animRun = runanim;
100     types[rabbittype].animRunning = rabbitrunninganim;
101     types[rabbittype].animCrouch = crouchanim;
102     types[rabbittype].animStop = stopanim;
103     types[rabbittype].animLanding = landanim;
104     types[rabbittype].animLandingHard = landhardanim;
105     types[rabbittype].animFightIdle = fightidleanim;
106     types[rabbittype].animBounceIdle = bounceidleanim;
107     types[rabbittype].animTalkIdle = talkidleanim;
108     types[rabbittype].animHurtIdle = hurtidleanim;
109
110     types[rabbittype].soundsAttack[0] = rabbitattacksound;
111     types[rabbittype].soundsAttack[1] = rabbitattack2sound;
112     types[rabbittype].soundsAttack[2] = rabbitattack3sound;
113     types[rabbittype].soundsAttack[3] = rabbitattack4sound;
114     types[rabbittype].soundsTalk[0] = rabbitchitter;
115     types[rabbittype].soundsTalk[1] = rabbitchitter2;
116
117     types[rabbittype].figureFileName = "Skeleton/BasicFigure";
118     types[rabbittype].lowFigureFileName = "Skeleton/BasicFigureLow";
119     types[rabbittype].clothesFileName = "Skeleton/RabbitBelt";
120     types[rabbittype].modelFileNames[0] = "Models/Body.solid";
121     types[rabbittype].modelFileNames[1] = "Models/Body2.solid";
122     types[rabbittype].modelFileNames[2] = "Models/Body3.solid";
123     types[rabbittype].modelFileNames[3] = "Models/Body4.solid";
124     types[rabbittype].modelFileNames[4] = "Models/Body5.solid";
125     types[rabbittype].modelFileNames[5] = "Models/Body6.solid";
126     types[rabbittype].modelFileNames[6] = "Models/Body7.solid";
127     types[rabbittype].lowModelFileName = "Models/BodyLow.solid";
128     types[rabbittype].modelClothesFileName = "Models/Belt.solid";
129
130     types[rabbittype].skins.resize(10);
131     types[rabbittype].skins[0] = "Textures/FurBrown.jpg";
132     types[rabbittype].skins[1] = "Textures/FurWhite.jpg";
133     types[rabbittype].skins[2] = "Textures/FurBlack.jpg";
134     types[rabbittype].skins[3] = "Textures/FurLynx.jpg";
135     types[rabbittype].skins[4] = "Textures/FurOtter.jpg";
136     types[rabbittype].skins[5] = "Textures/FurOpal.jpg";
137     types[rabbittype].skins[6] = "Textures/FurSable.jpg";
138     types[rabbittype].skins[7] = "Textures/FurChocolate.jpg";
139     types[rabbittype].skins[8] = "Textures/FurBlackWhite.jpg";
140     types[rabbittype].skins[9] = "Textures/FurBrownWhite.jpg";
141
142     types[rabbittype].power = 1;
143     types[rabbittype].defaultDamageTolerance = 200;
144     types[rabbittype].defaultScale = .2;
145     types[rabbittype].hasClaws = false;
146     types[rabbittype].clothes = true;
147     types[rabbittype].maxRunSpeed = 55;
148     types[rabbittype].knifeCatchingType = 0;
149 }