hello i got the idea, player skills and augmentations, you can only have one active skill, what is your opinion??
- fast shoot
- speed enhancement
- regeneration
- environmental resistance
@coders
i think it is not so hard to implement, so far i have a few problems with compilator errors and i have no idea what is going on the new ability class compiles without any problems but error occurs just after including the class in player.h and player.cpp >.>
ok, this is what i have written:
CPlayerAbilities.h -> http://www.copypastecode.com/33092/
CPlayerAbilities.cpp -> http://www.copypastecode.com/33096/
and now in shotgun.cpp change:
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.75;to:
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75;
[quote]
if( m_pPlayer->GetPlayerAbilities().HasEnabledAbility( FAST_SHOOT ) )
{
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.75 / 2;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75 / 2;
}else
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.75;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75;
[/quote]i have also added in player.h, under float m_flNextChatTime;
[quote]
CPlayerAbilities& GetPlayerAbilities( void ) { return m_playerAbilities; }
private:
CPlayerAbilities m_playerAbilities;
[/quote]there are a few things more...
errors:
-------------------Configuration: hl - Win32 Profile-------------------
Compiling...
player.cpp
D:\Half Life SDK\Single-Player Source\dlls\player.h(318) : error C2079: 'm_playerAbilities' uses undefined class 'CPlayerAbilities'
D:\Half Life SDK\Single-Player Source\dlls\player.cpp(2870) : error C2228: left of '.SetPlayer' must have class/struct/union type
D:\Half Life SDK\Single-Player Source\dlls\player.cpp(2871) : error C2228: left of '.EnableAbility' must have class/struct/union type
Error executing cl.exe.
player.obj - 3 error(s), 0 warning(s)