Tank base class
Type: Reference type
Declaration | Description |
---|---|
CBaseEntity@ opImplCast() | Implicitly casts to base type. |
const Vector& GetOrigin() const | Gets the entity's (absolute) origin. |
void SetOrigin(const Vector& in vecOrigin) | Sets this entity's (absolute) origin |
bool KeyValue(const string& in szKeyName, const string& in szValue) | Sets keyvalue data on this entity |
void TraceAttack(entvars_t@ pevAttacker, float flDamage, const Vector& in vecDir, TraceResult& in traceResult, int bitsDamageType) | Traces an attack by the given entity to this entity. |
void TraceBleed(float flDamage, const Vector& in vecDir, TraceResult& in traceResult, int bitsDamageType) | Traces entity bleed event. |
int GiveAmmo(int iAmount, const string& in szName, int iMax, const bool fFromWeapon = true) | Gives ammo to this entity. |
bool HasTarget(const string& in szTarget) | Returns whether this entity has the given target. |
string TeamID() | Returns this entity's team ID. |
string GetClassname() const | Returns this entity's class name. |
string GetTargetname() const | Returns this entity's target name. |
bool FVisibleFromPos(const Vector& in vecTarget, const Vector& in vecStart) | Returns whether this entity is visible from the given position. |
string SOUNDREPLACEMENT_Find(const string& in szFilename) | Find sound replacement for the given file. |
int FindMonstersInWorld(array<CBaseEntity@>@ pArray, int flagMask) | Finds monsters in the world |
bool IsPlayerAlly() const | Returns whether this entity is allied to players. |
void SetPlayerAlly(bool fState) | Sets this entity's player ally status. |
void SetPlayerAllyDirect(bool fState) | Sets this entity's player ally status. Use this only if you need the setting to be exactly what you give it (e.g. when copying from another monster) |
bool opEquals(CBaseEntity@ pOther) | Compares 2 entities for equality. |
void Precache() | Precaches the entity. Do not call directly. |
int ObjectCaps() | Gets this entity's objects caps. See the FCAP enum. |
void SetObjectCollisionBox() | Sets up the object collision box. |
int GetClassification(int cl) | Gets this entity's classification. Returns the given value if none is set. See the CLASSIFICATION enum. |
const string& GetClassificationTag() | Gets this entity's classification tag. |
const string& GetClassificationName() | Gets this entity's classification name. |
void SetClassification(int cl) | Sets this entity's classification override. Can override the entity's player ally setting. |
void SetClassificationFromEntity(CBaseEntity@ pEntity) | Sets this entity's classification override to the classification override set on the given entity. Can override the entity's player ally setting. |
void ClearClassification() | Clears this entity's classification override. |
int IRelationship(CBaseEntity@ other, bool ignoreNoTarget = false) | Gets the relationship between this entity and the given entity. See the RELATIONSHIP enum. |
int IRelationshipByClass(CLASS iClass) | Gets the relationship between this entity and the given entity classification. See the RELATIONSHIP enum. |
int Classify() | Gets this entity's classification. |
int TakeDamage(entvars_t@ pevInflictor, entvars_t@ pevAttacker, float flDamage, int bitsDamageType) | Causes this entity to take damage. Returns 1 if it took damage, 0 otherwise. |
bool TakeHealth(float flHealth, int bitsDamageType, int health_cap = 0) | Takes health from this entity. Note: flHealth is added to entity health. Use negative values to subtract.If health_cap is non-zero, won't add more than health_cap. Returns true if it took damage, false otherwise. |
bool TakeArmor(float flArmor, int bitsDamageType, int armor_cap = 0) | Takes armor from this entity. Note: flArmor is added to entity armor. Use negative values to subtract.If armor_cap is non-zero, won't add more than armor_cap. Returns 1 if it took damage, 0 otherwise. |
void Killed(entvars_t@pevAtttacker, int iGibbed) | Tells this entity it's been killed. See the GIB enum for possible values. |
int BloodColor() | Returns the blood color. See the BLOOD_COLOR enum. |
bool IsTriggered(CBaseEntity@ pActivator) | Returns whether this entity is triggered by the given entity. |
CBaseMonster@ MyMonsterPointer() | Returns this entity as its monster entity, if it is a monster. |
CustomKeyvalues@ GetCustomKeyvalues() | Gets this entity's custom keyvalues. |
bool BlockedByEntity(CBaseEntity@ pOther, float flDamage) | Returns true if you should be blocked by the entity, false otherwise. Also deals blocking damage to the entity, if applicable. |
void SUB_Remove() | Think function. Delay-removes this entity. |
void SUB_DoNothing() | Think function. Explicitly does nothing. |
void SUB_StartFadeOut() | Think function. Starts fading this entity. |
void SUB_FadeOut() | Think function. Fades this entity. |
void SUB_CallUseToggle() | Think function. Calls use toggle on this entity. |
bool ShouldToggle(USE_TYPE useType, const bool currentState) | Returns whether this entity should toggle. |
void FireBullets(uint cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread,float flDistance, Bullet iBulletType, int iTracerFreq = 4, int iDamage = 0, entvars_t@ pevAttacker = null, FireBulletsDrawMode fDraw = FBDM_DRAW) | Fires bullets. Must call CMath::MakeAimVectors with an angle vector first. |
void SUB_UseTargets(CBaseEntity@ pActivator, USE_TYPE useType, float flValue) | Calls use on targets. |
bool Intersects(CBaseEntity@ pOther) | Returns whether this entity intersects with the given entity. |
void MakeDormant() | Makes this entity dormant. |
bool IsDormant() | Returns whether this entity is dormant. |
bool IsLockedByMaster() | Returns whether this entity is locked by its master. |
edict_t@ edict() | Returns this entity's edict. |
int entindex() | Returns this entity's index. |
bool SetupModel() | Sets up the model. |
int GetToggleState() | Gets the toggle state. See the TOGGLE_STATE enum. |
void AddPoints(int score, const bool bAllowNegativeScore) | Adds points to this entity. |
void AddPointsToTeam(int score, const bool bAllowNegativeScore) | Adds points to this entity's team. |
AddPlayerItemResult AddPlayerItem(CBasePlayerItem@ pItem) | Adds the given player item to this entity. |
bool RemovePlayerItem(CBasePlayerItem@ pItem) | Removes the given player item to this entity. |
float GetDelay() | Gets this entity's trigger delay. |
bool IsMoving() | Returns whether this entity is moving. |
void OverrideReset() | Resets this entity. |
int DamageDecal(int bitsDamageType) | Returns the damage decal See decal_e. |
void SetToggleState(int state) | Sets this entity's toggle state. |
void StartSneaking() | Starts sneaking. |
void StopSneaking() | Stops sneaking. |
bool OnControls(entvars_t@ pev) | Reacts to controls set on the pev. |
bool IsSneaking() | Returns whether this entity is sneaking. |
bool IsAlive() | Returns whether this entity is alive. |
bool IsBSPModel() | Returns whether this entity is a BSP model. |
bool ReflectGauss() | Returns whether this entity reflects gauss shots. |
bool IsInWorld() | Returns whether this entity is in the world. |
bool IsMonster() | Returns whether this entity is a monster. |
bool IsPlayer() | Returns whether this entity is a player. |
bool IsNetClient() | Returns whether this is a net client. |
bool IsPointEnt() | Returns whether this is a point entity. |
bool IsBreakable() | Returns whether this is a breakable brush entity. |
bool IsMachine() | Returns whether this is a machine. |
bool CriticalRemove() | Removes this entity in critical situations. |
CBaseEntity@ GetNextTarget() | Gets the next target to trigger. |
void Think() | Makes this entity think. Do not call directly. |
void Touch(CBaseEntity@ pOther) | Triggers this entity's touch function. |
void Use(CBaseEntity@ pActivator, CBaseEntity@ pCaller, USE_TYPE useType, float flValue = 0.0f) | Trigger's this entity's use function. |
void Blocked(CBaseEntity@ pOther) | Triggers this entity's blocked function. |
void UpdateOnRemove() | Updates this entity when removed. |
CBaseEntity@ Respawn() | Respawns this entity. |
bool FBecomeProne(CBaseEntity@ pOther) | Makes this entity become prone. |
Vector Center() | Returns this entity's center. |
Vector EyePosition() | Returns this entity's eye position. |
Vector EarPosition() | Returns this entity's ear position. |
Vector BodyTarget(const Vector& in posSrc) | Returns this entity's body target for shooting. |
int Illumination() | Returns this entity's illumination. |
bool FVisible(CBaseEntity@ pEntity, bool fIgnoreGlass) | Returns whether this entity is visible to the given entity. |
bool FVisible(const Vector& in vecOrigin) | Returns whether this entity is visible from the given origin. |
bool IsFacing(entvars_t@ pevTest, float flDotProduct = VIEW_FIELD_ULTRA_NARROW) | Returns whether this entity is facing the given entity, within the given view field. |
float GetPointsForDamage(float flDamage) | Returns the points received for damage done. |
void GetDamagePoints(entvars_t@ pevAttacker, entvars_t@ pevInflictor, float flDamage) | Adds damage points to the inflicting entity. |
void OnCreate() | Entity constructor. |
void OnDestroy() | Entity destructor. |
bool IsRevivable() | Returns whether this entity is revivable at this time. |
void BeginRevive(float flTimeUntilRevive) | Prepares this entity for revival. flTimeUntilRevive is the time until the revive action completes. |
void EndRevive(float flTimeUntilRevive) | Called when this entity should be revived. flTimeUntilRevive is the time until the revival should start. |
dictionary@ GetUserData() | Gets the user data on this entity. Do not keep references to this data, the object might be removed from this entity. Only map scripts can use this. |
dictionaryValue& GetUserData(const string& in szKey) | Gets the user data stored under the specified key on this entity. Do not keep references to this data, the object might be removed from this entity. Only map scripts can use this. |
void ClearUserData() | Clears the user data on this entity. WARNING: clears all data. Only map scripts can use this. |
void TrackTarget() | Updates the tank's angles to match either its controlling player, or its current target.Accounts for rotation speed. Will fire at the target if it's automated. |
bool PointAt(const Vector& in vecDestination) | Points the tank at the target location. |
void Fire(const Vector& in vecBarrelEnd, const Vector& in vecForward, entvars_t@ pevAttacker) | Fires the tank. Barrel end position, aiming direction and attacker entvars_t must be given. |
void Fire() | Fires the tank. Uses this tank's settings to fire, does not determine if it is targeting anything. |
Vector UpdateTargetPosition(CBaseEntity@ pTargetEntity) | Gets the updated position of the given target. Target must be valid. |
void StartRotSound() | Start playing the rotating sound, if defined. |
void StopRotSound() | Stop playing the rotating sound. |
bool IsActive() const | Returns whether the tank is active. Active tanks are AI controlled. |
void TankActivate() | Activates the tank. Active tanks are AI controlled. |
void TankDeactivate() | Deactivates the tank. Active tanks are AI controlled. |
bool CanFire() const | Returns whether this tank is able to fire. |
bool InRange(float flRange) | Returns whether the given range is within the minimum and maximum range of this tank. |
CBaseEntity@ FindTarget() | Finds a target to attack, if any. |
void MonsterStartup(CBaseMonster@ pMonster) | Makes the given monster begin controlling this tank, if no other monster had control before. |
void TankTrace(const Vector& in vecStart, const Vector& in vecForward, const Vector& in vecSpread, TraceResult& out tr) | Performs a traceline using a random spread based on the given spread amount. |
Vector BarrelPosition() | Returns the barrel position. |
int BulletCount() | Gets the bullet count at this time. |
Vector AdjustAnglesForBarrel(const Vector& in vecInAngles, float flDistance) | Adjusts the given angles to point at the target. |
bool StartControl(CBasePlayer@ pController) | Makes the given player start controlling this tank. |
void StopControl() | If a player is controlling this tank, makes the player stop controlling the tank. |
void MonsterStopControl() | If a monster is controlling this tank, makes the monster stop controlling the tank. |
void Look(int iDistance) | Looks around itself in a box that is iDistance * 2 in width and height for possible targets and stores the list in m_pLink. The target stores the next target in the list in its m_pLink, and so on. |
const CBasePlayer@ GetController() | Gets the current player controlling this tank, if any. |
Declaration | Description |
---|---|
entvars_t@ pev | Entity variables |
bool m_fOverrideClass | Whether this entity overrides the classification. |
int m_iClassSelection | The overridden classification. |
float m_flMaximumFadeWait | Maximum fade wait time. |
float m_flMaximumFadeWaitB | Maximum fade wait time B. |
bool m_fCanFadeStart | Whether fading can start. |
bool m_fCustomModel | Whether a custom model is used. |
Vector m_vecLastOrigin | Last origin vector |
string_t targetnameOutFilterType | Target name out filter type. |
string_t classnameOutFilterType | Class name out filter type. |
string_t targetnameInFilterType | Target name in filter type. |
string_t classnameInFilterType | Class name in filter type. |
int m_iOriginalRenderMode | Original render model. |
int m_iOriginalRenderFX | Original render FX. |
float m_flOriginalRenderAmount | Original render amount. |
Vector m_vecOriginalRenderColor | Original render color. |
Vector m_vecControllerUsePos | Start origin of the player that is currently controlling this tank. Used to determine when a player has moved too far to continue controlling this tank. |
float m_flNextAttack | Next attack time |
float m_yawCenter | "Center" yaw |
float m_yawRate | Max turn rate to track targets |
float m_yawRange | Range of turning motion (one-sided: 30 is +/- 30 degress from center) Zero is full rotation |
float m_yawTolerance | Tolerance angle |
float m_pitchCenter | "Center" pitch |
float m_pitchRate | Max turn rate on pitch |
float m_pitchRange | Range of pitch motion as above |
float m_pitchTolerance | Tolerance angle |
float m_fireLast | Last time I fired |
float m_fireRate | How many rounds/second |
float m_lastSightTime | Last time I saw target |
float m_persist | Persistence of firing (how long do I shoot when I can't see) |
float m_minRange | Minimum range to aim/track |
float m_maxRange | Max range to aim/track |
Vector m_barrelPos | Length of the freakin barrel |
float m_spriteScale | Scale of any sprites we shoot |
TANKBULLET m_bulletType | Bullet type |
int m_iBulletDamage | 0 means use Bullet type's default damage |
Vector m_sightOrigin | Last sight of target |
int m_spread | firing spread |
string_t m_iszMaster | Master entity (game_team_master or multisource) |