mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
1.8 KiB
D
83 lines
1.8 KiB
D
/*
|
|
OpenMW - The completely unofficial reimplementation of Morrowind
|
|
Copyright (C) 2008 Nicolay Korslund
|
|
Email: < korslund@gmail.com >
|
|
WWW: http://openmw.snaptoad.com/
|
|
|
|
This file (loadrace.d) is part of the OpenMW package.
|
|
|
|
OpenMW is distributed as free software: you can redistribute it
|
|
and/or modify it under the terms of the GNU General Public License
|
|
version 3, as published by the Free Software Foundation.
|
|
|
|
This program 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
|
|
version 3 along with this program. If not, see
|
|
http://www.gnu.org/licenses/ .
|
|
|
|
*/
|
|
|
|
module esm.loadrace;
|
|
|
|
import esm.imports;
|
|
|
|
import esm.loadbsgn; // Defines PowerList
|
|
|
|
/*
|
|
* Race definition
|
|
*/
|
|
|
|
struct Race
|
|
{
|
|
align(1) struct SkillBonus
|
|
{
|
|
SkillEnum skill;
|
|
int bonus;
|
|
}
|
|
static assert(SkillBonus.sizeof == 8);
|
|
|
|
enum Flags
|
|
{
|
|
Playable = 0x01,
|
|
Beast = 0x02
|
|
}
|
|
|
|
align(1) struct RADTstruct
|
|
{
|
|
// List of skills that get a bonus
|
|
SkillBonus bonus[7];
|
|
|
|
// Attribute values for male/female
|
|
int[2] strength, intelligence, willpower, agility,
|
|
speed, endurance, personality, luck, height,
|
|
weight;
|
|
|
|
Flags flags; // 0x1 - playable, 0x2 - beast race
|
|
|
|
static assert(RADTstruct.sizeof == 140);
|
|
}
|
|
|
|
RADTstruct data;
|
|
|
|
LoadState state;
|
|
|
|
char[] id, name, description;
|
|
|
|
SpellList powers;
|
|
|
|
void load()
|
|
{with(esFile){
|
|
name = getHNString("FNAM");
|
|
readHNExact(&data, data.sizeof, "RADT");
|
|
|
|
powers.load();
|
|
|
|
description = getHNOString("DESC");
|
|
}}
|
|
}
|
|
ListID!(Race) races;
|