File: PersonType.cpp

package info (click to toggle)
lugaru 1.2-7.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 39,748 kB
  • sloc: cpp: 29,640; ansic: 537; sh: 34; xml: 28; makefile: 14
file content (125 lines) | stat: -rw-r--r-- 5,196 bytes parent folder | download | duplicates (5)
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
115
116
117
118
119
120
121
122
123
124
125
/*
Copyright (C) 2016-2017 - Lugaru contributors (see AUTHORS file)

This file is part of Lugaru.

Lugaru is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Lugaru is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "Objects/PersonType.hpp"

std::vector<PersonType> PersonType::types;

PersonType::PersonType()
{
    animTalkIdle = tempanim;
}

bool PersonType::hasAnimTalkIdle()
{
    return (animTalkIdle != tempanim);
}

void PersonType::Load()
{
    types.resize(2);

    /* Wolf */
    types[wolftype].proportions[0] = 1.1;
    types[wolftype].proportions[1] = 1.1;
    types[wolftype].proportions[2] = 1.1;
    types[wolftype].proportions[3] = 1.1;

    types[wolftype].animRun = wolfrunanim;
    types[wolftype].animRunning = wolfrunninganim;
    types[wolftype].animCrouch = wolfcrouchanim;
    types[wolftype].animStop = wolfstopanim;
    types[wolftype].animLanding = wolflandanim;
    types[wolftype].animLandingHard = wolflandhardanim;
    types[wolftype].animFightIdle = wolfidle;
    types[wolftype].animBounceIdle = wolfidle;

    types[wolftype].soundsAttack[0] = barksound;
    types[wolftype].soundsAttack[1] = bark2sound;
    types[wolftype].soundsAttack[2] = bark3sound;
    types[wolftype].soundsAttack[3] = barkgrowlsound;
    types[wolftype].soundsTalk[0] = growlsound;
    types[wolftype].soundsTalk[1] = growl2sound;

    types[wolftype].figureFileName = "Skeleton/BasicFigureWolf";
    types[wolftype].lowFigureFileName = "Skeleton/BasicFigureWolfLow";
    types[wolftype].clothesFileName = "Skeleton/RabbitBelt";
    types[wolftype].modelFileNames[0] = "Models/Wolf.solid";
    types[wolftype].modelFileNames[1] = "Models/Wolf2.solid";
    types[wolftype].modelFileNames[2] = "Models/Wolf3.solid";
    types[wolftype].modelFileNames[3] = "Models/Wolf4.solid";
    types[wolftype].modelFileNames[4] = "Models/Wolf5.solid";
    types[wolftype].modelFileNames[5] = "Models/Wolf6.solid";
    types[wolftype].modelFileNames[6] = "Models/Wolf7.solid";
    types[wolftype].lowModelFileName = "Models/WolfLow.solid";
    types[wolftype].modelClothesFileName = "Models/Belt.solid";

    types[wolftype].skins.resize(3);
    types[wolftype].skins[0] = "Textures/FurWolfGrey.jpg";
    types[wolftype].skins[1] = "Textures/FurWolfDark.jpg";
    types[wolftype].skins[2] = "Textures/FurWolfSnow.jpg";

    /* Rabbit */
    types[rabbittype].proportions[0] = 1.2;
    types[rabbittype].proportions[1] = 1.05;
    types[rabbittype].proportions[2] = 1;
    types[rabbittype].proportions[3] = 1.1;
    types[rabbittype].proportions[3].y = 1.05;

    types[rabbittype].animRun = runanim;
    types[rabbittype].animRunning = rabbitrunninganim;
    types[rabbittype].animCrouch = crouchanim;
    types[rabbittype].animStop = stopanim;
    types[rabbittype].animLanding = landanim;
    types[rabbittype].animLandingHard = landhardanim;
    types[rabbittype].animFightIdle = fightidleanim;
    types[rabbittype].animBounceIdle = bounceidleanim;

    types[rabbittype].soundsAttack[0] = rabbitattacksound;
    types[rabbittype].soundsAttack[1] = rabbitattack2sound;
    types[rabbittype].soundsAttack[2] = rabbitattack3sound;
    types[rabbittype].soundsAttack[3] = rabbitattack4sound;
    types[rabbittype].soundsTalk[0] = rabbitchitter;
    types[rabbittype].soundsTalk[1] = rabbitchitter2;

    types[rabbittype].figureFileName = "Skeleton/BasicFigure";
    types[rabbittype].lowFigureFileName = "Skeleton/BasicFigureLow";
    types[rabbittype].clothesFileName = "Skeleton/RabbitBelt";
    types[rabbittype].modelFileNames[0] = "Models/Body.solid";
    types[rabbittype].modelFileNames[1] = "Models/Body2.solid";
    types[rabbittype].modelFileNames[2] = "Models/Body3.solid";
    types[rabbittype].modelFileNames[3] = "Models/Body4.solid";
    types[rabbittype].modelFileNames[4] = "Models/Body5.solid";
    types[rabbittype].modelFileNames[5] = "Models/Body6.solid";
    types[rabbittype].modelFileNames[6] = "Models/Body7.solid";
    types[rabbittype].lowModelFileName = "Models/BodyLow.solid";
    types[rabbittype].modelClothesFileName = "Models/Belt.solid";

    types[rabbittype].skins.resize(10);
    types[rabbittype].skins[0] = "Textures/FurBrown.jpg";
    types[rabbittype].skins[1] = "Textures/FurWhite.jpg";
    types[rabbittype].skins[2] = "Textures/FurBlack.jpg";
    types[rabbittype].skins[3] = "Textures/FurLynx.jpg";
    types[rabbittype].skins[4] = "Textures/FurOtter.jpg";
    types[rabbittype].skins[5] = "Textures/FurOpal.jpg";
    types[rabbittype].skins[6] = "Textures/FurSable.jpg";
    types[rabbittype].skins[7] = "Textures/FurChocolate.jpg";
    types[rabbittype].skins[8] = "Textures/FurBlackWhite.jpg";
    types[rabbittype].skins[9] = "Textures/FurBrownWhite.jpg";
}