예제 #1
0
void File::_initialize()
{
    if (_initialized) return;
    Dat::Item::_initialize();
    Dat::Item::setPosition(0);

    uint32(); // unknown 1

    // primary stats
    for (unsigned i = (unsigned)STAT::STRENGTH; i <= (unsigned)STAT::LUCK; i++)
    {
        setStat((STAT)i, uint32());
    }

    // secondary stats
    _hitPoints = uint32();
    _actionPoints = uint32();
    _armorClass = uint32();

    uint32(); // unknown 2

    _meleeDamage = uint32();
    _carryWeight = uint32();
    _sequence    = uint32();
    _healingRate = uint32();
    _criticalChance      = uint32();
    _criticalHitModifier = uint32();

    for (unsigned i = (unsigned)DAMAGE::NORMAL; i <= (unsigned)DAMAGE::EXPLOSIVE; i++)
    {
        setDamage((DAMAGE)i, uint32());
    }
    for (unsigned i = (unsigned)DAMAGE::NORMAL; i <= (unsigned)DAMAGE::EXPLOSIVE; i++)
    {
        setResistance((DAMAGE)i, uint32());
    }

    _radiationResistance = uint32();
    _poisonResistance    = uint32();
    _age    = uint32();
    _gender = (GENDER)uint32();

    // bonuses to primary stats
    for (unsigned i = (unsigned)STAT::STRENGTH; i <= (unsigned)STAT::LUCK; i++)
    {
        setStatBonus((STAT)i, uint32());
    }

    // bonuses to secondary stats
    _hitPointsBonus    = uint32();
    _actionPointsBonus = uint32();
    _armorClassBonus   = uint32();

    uint32(); // unknown 3

    _meleeDamageBonus = uint32();
    _carryWeightBonus = uint32();
    _sequenceBonus    = uint32();
    _healingRateBonus = uint32();
    _criticalChanceBonus      = uint32();
    _criticalHitModifierBonus = uint32();

    for (unsigned i = (unsigned)DAMAGE::NORMAL; i <= (unsigned)DAMAGE::EXPLOSIVE; i++)
    {
        setDamageBonus((DAMAGE)i, uint32());
    }
    for (unsigned i = (unsigned)DAMAGE::NORMAL; i <= (unsigned)DAMAGE::EXPLOSIVE; i++)
    {
        setResistanceBonus((DAMAGE)i, uint32());
    }

    _radiationResistanceBonus = uint32();
    _poisonResistanceBonus    = uint32();
    _ageBonus    = uint32();
    _genderBonus = uint32();

    //skills
    for (unsigned i = (unsigned)SKILL::SMALL_GUNS; i <= (unsigned)SKILL::OUTDOORSMAN; i++)
    {
        setSkill((SKILL)i, uint32());
    }

    // unknown
    uint32(); // unknown 4
    uint32(); // unknown 5
    uint32(); // unknown 6
    uint32(); // unknown 7

    // name
    char * name = new char[32]();
    this->readBytes(name, 32);
    setName(name);
    delete [] name;

    _firstTaggedSkill  = (SKILL)int32();
    _secondTaggedSkill = (SKILL)int32();
    _thirdTaggedSkill  = (SKILL)int32();
    _fourthTaggedSkill = (SKILL)int32();
    _firstTrait  = (TRAIT)int32();
    _secondTrait = (TRAIT)int32();
    _characterPoints = uint32();
}
예제 #2
0
void GcdFileType::_initialize()
{
    if (_initialized) return;
    DatFileItem::_initialize();
    DatFileItem::setPosition(0);

    unsigned int uint32;
    
    // unknown 1
    *this >> _unknown1;

    // primary stats
    for (unsigned int i = STATS_STRENGTH; i <= STATS_LUCK; i++)
    {
        *this >> uint32;
        setStat(i, uint32);
    }
    
    // secondary stats
    *this >> _hitPoints >> _actionPoints >> _armorClass;

    // unknown 2
    *this >> _unknown2;

    *this >> _meleeDamage >> _carryWeight >> _sequence >> _healingRate >> _criticalChance >> _criticalHitModifier;
    
    for (unsigned int i = DAMAGE_NORMAL; i <= DAMAGE_EXPLOSIVE; i++)
    {
        *this >> uint32;
        setDamage(i, uint32);
    }
    for (unsigned int i = DAMAGE_NORMAL; i <= DAMAGE_EXPLOSIVE; i++)
    {
        *this >> uint32;
        setResistance(i, uint32);
    }
    
    *this >> _radiationResistance >> _poisonResistance >> _age >> _gender;

    // bonuses to primary stats
    for (unsigned int i = STATS_STRENGTH; i <= STATS_LUCK; i++)
    {
        *this >> uint32;
        setStatBonus(i, uint32);
    }

    // bonuses to secondary stats
    *this >> _hitPointsBonus >> _actionPointsBonus >> _armorClassBonus;

    // unknown 3
    *this >> _unknown3;

    *this >> _meleeDamageBonus >> _carryWeightBonus >> _sequenceBonus >> _healingRateBonus
          >> _criticalChanceBonus >> _criticalHitModifierBonus;
    for (unsigned int i = DAMAGE_NORMAL; i <= DAMAGE_EXPLOSIVE; i++)
    {
        *this >> uint32;
        setDamageBonus(i, uint32);
    }
    for (unsigned int i = DAMAGE_NORMAL; i <= DAMAGE_EXPLOSIVE; i++)
    {
        *this >> uint32;
        setResistanceBonus(i, uint32);
    }
    *this >> _radiationResistanceBonus >> _poisonResistanceBonus >> _ageBonus >> _genderBonus;

    //skills
    for (unsigned int i = SKILLS_1; i <= SKILLS_18; i++)
    {
        *this >> uint32;
        setSkill(i, uint32);
    }

    // unknown
    *this >> _unknown4 >> _unknown5 >> _unknown6 >> _unknown7;

    // name
    char * name = new char[32]();
    this->readBytes(name, 32);
    setName(name);
    delete [] name;

    *this >> _firstTaggedSkill
          >> _secondTaggedSkill
          >> _thirdTaggedSkill
          >> _fourthTaggedSkill
          >> _firstTrait
          >> _secondTrait
          >> _characterPoints;
}