Turok
 
Loading...
Searching...
No Matches
kPlayer Class Reference

Public Member Functions

const uint16 Buttons () const
 returns EnumPlayerButtons
 
uint ButtonHeldTime (const int btn)
 btn type is EnumInputActions
 
kPuppet Actor ()
 
void ConsumeAmmo (const int ammo, const bool preferredAmmo=true)
 
void ConsumeAltAmmo (const int ammo)
 
const int GetAmmo (const int weaponID) const
 
const int GetAltAmmo (const int weaponID) const
 
const bool HasAmmo (const int weaponID, const bool checkAlt=true) const
 if checkAlt is false only checks primary ammo
 
const bool HasAltAmmo (const int weaponID) const
 
const bool HasAltAmmo () const
 
const bool HasWeapon (const int weaponID) const
 
bool & UseAltAmmo ()
 
const int CurrentWeapon () const
 
bool GiveWeapon (const int weaponID, const int ammo, const bool switchNewWeapon=true)
 returns true if gave ammo else returns false because already has full primary ammo. if switchNewWeapon is false it will not auto switch to the weapon.
 
bool RemoveWeapon (const int weapon)
 
void Lock ()
 
void Unlock ()
 
int16 & Armor ()
 
void Victory (const int warpActorID=- 1, const int mapID=- 1)
 
const bool Locked () const
 
const int Lives () const
 
void SetLives (const int amount)
 
const int LifeForces ()
 
void SetLifeForces (const int amount)
 
bool & Backpack ()
 
bool & RunWalkToggle ()
 
bool & NoLandClearVel ()
 if true, when doing a hard landing you will not lose your velocity
 
bool GiveAmmo (const int weapon, const int amount, const bool altAmmo)
 set amount to negative values to take ammo
 
const int CurrentCheckPoint ()
 returns warpTID
 
const int CurrentCheckPointMap ()
 
void SetCheckPoint (const int warpTID, const int map)
 
const kVec3 GetButtonAngles () const
 
const kVec3 GetButtonMovement () const
 
const bool WeaponUsingAltAmmo (const int weapon) const
 
const bool SetWeaponUseAltAmmo (const int weapon, const bool bToggle)
 
const bool WeaponAllowUnderwater (const int weapon) const
 
void ChangeWeapon (const int weapon)
 
const int PendingWeapon () const
 
void CycleNextWeapon (const bool bCheckAmmo=false)
 
void CyclePrevWeapon (const bool bCheckAmmo=false)
 
kWeapon GetWeaponActor (const int weapon)
 
int16 & MaxHealth ()
 should be >= MaxExtraHealth and ExtraHealth
 
int16 & MaxExtraHealth ()
 should be <= MaxHealth
 
int16 & ExtraHealth ()
 should be <= MaxExtraHealth
 
bool GiveHealth (const int amount, const bool bMortalWound)
 Takes into account extra health, and max health values. 0 is full health, negative amounts gives extra health. if bMortalWound is true which is for 2 and ultra health then health goes up to maxExtraHealth.
 
void CancelSpiritualTime (float blendTime=1.0f)
 if in spirit mode then will set gamespeed back to 1.0f using the passed in blendTime
 
void SetSpiritualTime (const float time, const float blend)
 time = time until cancels the effect. Should SetGameSpeed after calling this.
 
const float GetSpiritualTime () const
 
const int GetWeaponGroup (const int weapon)
 
void SetWeaponGroup (const int weapon, const int group)
 Binds this weapon to another weapons index. Example: you made a new pistol weapon at index 14 and want to group it with default pistol that has the index 2. then set your new pistols(14) group to 2 and whenever the user presses the key assigned to the original pistol 2 it will cycle between them. instead of the user having to cycle to the new weapon with next/prev weapon inputs.
 
bool & SilentCheckPoints (void)
 if true won't show checkpoint message or play sound when on a checkpoint area. Gets set back to false when level starts.
 

Detailed Description

Definition at line 1774 of file t1_scriptAPI.cpp.

Member Function Documentation

◆ Actor()

kPuppet kPlayer::Actor ( )

◆ Armor()

int16 & kPlayer::Armor ( )

◆ Backpack()

bool & kPlayer::Backpack ( )

◆ ButtonHeldTime()

uint kPlayer::ButtonHeldTime ( const int btn)

btn type is EnumInputActions

◆ Buttons()

const uint16 kPlayer::Buttons ( ) const

◆ CancelSpiritualTime()

void kPlayer::CancelSpiritualTime ( float blendTime = 1.0f)

if in spirit mode then will set gamespeed back to 1.0f using the passed in blendTime

◆ ChangeWeapon()

void kPlayer::ChangeWeapon ( const int weapon)

◆ ConsumeAltAmmo()

void kPlayer::ConsumeAltAmmo ( const int ammo)

◆ ConsumeAmmo()

void kPlayer::ConsumeAmmo ( const int ammo,
const bool preferredAmmo = true )

◆ CurrentCheckPoint()

const int kPlayer::CurrentCheckPoint ( )

returns warpTID

◆ CurrentCheckPointMap()

const int kPlayer::CurrentCheckPointMap ( )

◆ CurrentWeapon()

const int kPlayer::CurrentWeapon ( ) const

◆ CycleNextWeapon()

void kPlayer::CycleNextWeapon ( const bool bCheckAmmo = false)

◆ CyclePrevWeapon()

void kPlayer::CyclePrevWeapon ( const bool bCheckAmmo = false)

◆ ExtraHealth()

int16 & kPlayer::ExtraHealth ( )

should be <= MaxExtraHealth

◆ GetAltAmmo()

const int kPlayer::GetAltAmmo ( const int weaponID) const

◆ GetAmmo()

const int kPlayer::GetAmmo ( const int weaponID) const

◆ GetButtonAngles()

const kVec3 kPlayer::GetButtonAngles ( ) const

◆ GetButtonMovement()

const kVec3 kPlayer::GetButtonMovement ( ) const

◆ GetSpiritualTime()

const float kPlayer::GetSpiritualTime ( ) const

◆ GetWeaponActor()

kWeapon kPlayer::GetWeaponActor ( const int weapon)

◆ GetWeaponGroup()

const int kPlayer::GetWeaponGroup ( const int weapon)

◆ GiveAmmo()

bool kPlayer::GiveAmmo ( const int weapon,
const int amount,
const bool altAmmo )

set amount to negative values to take ammo

◆ GiveHealth()

bool kPlayer::GiveHealth ( const int amount,
const bool bMortalWound )

Takes into account extra health, and max health values. 0 is full health, negative amounts gives extra health. if bMortalWound is true which is for 2 and ultra health then health goes up to maxExtraHealth.

◆ GiveWeapon()

bool kPlayer::GiveWeapon ( const int weaponID,
const int ammo,
const bool switchNewWeapon = true )

returns true if gave ammo else returns false because already has full primary ammo. if switchNewWeapon is false it will not auto switch to the weapon.

◆ HasAltAmmo() [1/2]

const bool kPlayer::HasAltAmmo ( ) const

◆ HasAltAmmo() [2/2]

const bool kPlayer::HasAltAmmo ( const int weaponID) const

◆ HasAmmo()

const bool kPlayer::HasAmmo ( const int weaponID,
const bool checkAlt = true ) const

if checkAlt is false only checks primary ammo

◆ HasWeapon()

const bool kPlayer::HasWeapon ( const int weaponID) const

◆ LifeForces()

const int kPlayer::LifeForces ( )

◆ Lives()

const int kPlayer::Lives ( ) const

◆ Lock()

void kPlayer::Lock ( )

◆ Locked()

const bool kPlayer::Locked ( ) const

◆ MaxExtraHealth()

int16 & kPlayer::MaxExtraHealth ( )

should be <= MaxHealth

◆ MaxHealth()

int16 & kPlayer::MaxHealth ( )

should be >= MaxExtraHealth and ExtraHealth

◆ NoLandClearVel()

bool & kPlayer::NoLandClearVel ( )

if true, when doing a hard landing you will not lose your velocity

◆ PendingWeapon()

const int kPlayer::PendingWeapon ( ) const

◆ RemoveWeapon()

bool kPlayer::RemoveWeapon ( const int weapon)

◆ RunWalkToggle()

bool & kPlayer::RunWalkToggle ( )

◆ SetCheckPoint()

void kPlayer::SetCheckPoint ( const int warpTID,
const int map )

◆ SetLifeForces()

void kPlayer::SetLifeForces ( const int amount)

◆ SetLives()

void kPlayer::SetLives ( const int amount)

◆ SetSpiritualTime()

void kPlayer::SetSpiritualTime ( const float time,
const float blend )

time = time until cancels the effect. Should SetGameSpeed after calling this.

◆ SetWeaponGroup()

void kPlayer::SetWeaponGroup ( const int weapon,
const int group )

Binds this weapon to another weapons index. Example: you made a new pistol weapon at index 14 and want to group it with default pistol that has the index 2. then set your new pistols(14) group to 2 and whenever the user presses the key assigned to the original pistol 2 it will cycle between them. instead of the user having to cycle to the new weapon with next/prev weapon inputs.

◆ SetWeaponUseAltAmmo()

const bool kPlayer::SetWeaponUseAltAmmo ( const int weapon,
const bool bToggle )

◆ SilentCheckPoints()

bool & kPlayer::SilentCheckPoints ( void )

if true won't show checkpoint message or play sound when on a checkpoint area. Gets set back to false when level starts.

◆ Unlock()

void kPlayer::Unlock ( )

◆ UseAltAmmo()

bool & kPlayer::UseAltAmmo ( )

◆ Victory()

void kPlayer::Victory ( const int warpActorID = - 1,
const int mapID = - 1 )

◆ WeaponAllowUnderwater()

const bool kPlayer::WeaponAllowUnderwater ( const int weapon) const

◆ WeaponUsingAltAmmo()

const bool kPlayer::WeaponUsingAltAmmo ( const int weapon) const