@@ -461,7 +461,17 @@ const int Const_MaxWaypoints = 2048;
461
461
const int Const_MaxWeapons = 32 ;
462
462
const int Const_NumWeapons = 26 ;
463
463
464
- const bool AntiBlock = false ;
464
+ // A* Stuff
465
+ enum class State { Open, Closed, New };
466
+
467
+ struct AStar_t
468
+ {
469
+ float g;
470
+ float f;
471
+ int parent;
472
+
473
+ State state;
474
+ };
465
475
466
476
// weapon masks
467
477
const int WeaponBits_Primary = ((1 << WEAPON_XM1014) | (1 << WEAPON_M3) | (1 << WEAPON_MAC10) | (1 << WEAPON_UMP45) | (1 << WEAPON_MP5) | (1 << WEAPON_TMP) | (1 << WEAPON_P90) | (1 << WEAPON_AUG) | (1 << WEAPON_M4A1) | (1 << WEAPON_SG552) | (1 << WEAPON_AK47) | (1 << WEAPON_SCOUT) | (1 << WEAPON_SG550) | (1 << WEAPON_AWP) | (1 << WEAPON_G3SG1) | (1 << WEAPON_M249) | (1 << WEAPON_FAMAS) | (1 << WEAPON_GALIL));
@@ -590,7 +600,7 @@ struct MenuText
590
600
};
591
601
592
602
// array of clients struct
593
- struct Client_old
603
+ struct Clients
594
604
{
595
605
MenuText* menu; // pointer to opened bot menu
596
606
edict_t * ent; // pointer to actual edict
@@ -600,6 +610,8 @@ struct Client_old
600
610
int flags; // client flags
601
611
float hearingDistance; // distance this sound is heared
602
612
float timeSoundLasting; // time sound is played/heared
613
+ int ping; // when bot latency is enabled, client ping stored here
614
+ bool pingUpdate; // update ping if true
603
615
604
616
int wpIndex;
605
617
int wpIndex2;
@@ -700,9 +712,9 @@ class Bot
700
712
bool m_isLeader; // bot is leader of his team
701
713
bool m_checkTerrain; // check for terrain
702
714
bool m_moveToC4; // ct is moving to bomb
703
-
715
+
704
716
bool m_checkFall; // check bot fall
705
- Vector m_checkFallPoint[2 ];
717
+ Vector m_checkFallPoint[2 ]; // idk why...
706
718
float m_prevTime; // time previously checked movement speed
707
719
float m_prevSpeed; // speed some frames before
708
720
Vector m_prevOrigin; // origin some frames before
@@ -729,8 +741,7 @@ class Bot
729
741
float m_knifeAttackTime; // time to rush with knife (at the beginning of the round)
730
742
bool m_defendedBomb; // defend action issued
731
743
732
- float m_damageTime;
733
-
744
+ float m_damageTime; // tweak for zombie bots
734
745
float m_askCheckTime; // time to ask team
735
746
float m_collideTime; // time last collision
736
747
float m_firstCollideTime; // time of first collision
@@ -776,15 +787,15 @@ class Bot
776
787
edict_t * m_targetEntity; // the entity that the bot is trying to reach
777
788
edict_t * m_hostages[Const_MaxHostages]; // pointer to used hostage entities
778
789
779
- Vector m_moveTargetOrigin;
790
+ Vector m_moveTargetOrigin; // ...
780
791
781
792
bool m_isStuck; // bot is stuck
782
793
bool m_isReloading; // bot is reloading a gun
783
794
int m_reloadState; // current reload state
784
795
int m_voicePitch; // bot voice pitch
785
796
bool m_isZombieBot; // checks bot if zombie
786
797
bool m_isBomber; // checks bot has C4
787
- int m_team; // team
798
+ int m_team; // team OOOOOOOOOOHHHHHHHHHHH!!!!!!!!!!!!!
788
799
789
800
bool m_duckDefuse; // should or not bot duck to defuse bomb
790
801
float m_duckDefuseCheckTime; // time to check for ducking for defuse
@@ -793,7 +804,7 @@ class Bot
793
804
794
805
int m_msecBuiltin; // random msec method for this bot
795
806
// uint8_t m_msecVal; // calculated msec value
796
- float m_msecVal;
807
+ float m_msecVal; // same
797
808
float m_msecDel; // used for msec calculation
798
809
float m_msecNum; // also used for mseccalculation
799
810
float m_msecInterval; // used for leon hartwig's method for msec calculation
@@ -840,11 +851,11 @@ class Bot
840
851
float m_randomizeAnglesTime; // time last randomized location
841
852
float m_playerTargetTime; // time last targeting
842
853
843
- float m_checkCampPointTime;
844
- int m_zhCampPointIndex;
854
+ float m_checkCampPointTime; // zombie stuff
855
+ int m_zhCampPointIndex; // zombie stuff index
845
856
846
- Vector m_moveAnglesForRunMove;
847
- float m_moveSpeedForRunMove, m_strafeSpeedForRunMove;
857
+ Vector m_moveAnglesForRunMove; // angles while running
858
+ float m_moveSpeedForRunMove, m_strafeSpeedForRunMove; // for run
848
859
849
860
void SwitchChatterIcon (bool show);
850
861
void BotAI (void );
@@ -998,6 +1009,7 @@ class Bot
998
1009
999
1010
public:
1000
1011
entvars_t * pev;
1012
+ AStar_t waypoints[Const_MaxWaypoints];
1001
1013
1002
1014
// SyPB Pro P.30 - AMXX API
1003
1015
edict_t * m_enemyAPI;
@@ -1018,6 +1030,8 @@ class Bot
1018
1030
1019
1031
int m_wantedTeam; // player team bot wants select
1020
1032
int m_wantedClass; // player model bot wants to select
1033
+ int m_difficulty; // bot difficulty
1034
+ int m_basePingLevel; // base ping level for randomizing
1021
1035
1022
1036
int m_skill; // bots play skill
1023
1037
int m_moneyAmount; // amount of money in bot's bank
@@ -1096,8 +1110,8 @@ class Bot
1096
1110
float m_enemyReachableTimer; // time to recheck if Enemy reachable
1097
1111
bool m_isEnemyReachable; // direct line to enemy
1098
1112
1099
- edict_t * m_moveTargetEntity;
1100
- float m_blockCheckEnemyTime;
1113
+ edict_t * m_moveTargetEntity; // target entity for move
1114
+ float m_blockCheckEnemyTime; // block time for entity check (useless)
1101
1115
1102
1116
float m_seeEnemyTime; // time bot sees enemy
1103
1117
float m_enemySurpriseTime; // time of surprise
@@ -1189,7 +1203,7 @@ class Bot
1189
1203
void PushTask (BotTask taskID, float desire, int data, float time, bool canContinue);
1190
1204
void DiscardWeaponForUser (edict_t * user, bool discardC4);
1191
1205
1192
- void ChatSay (bool teamSay, const char * text);
1206
+ void ChatSay (bool teamSay, const char * text, ... );
1193
1207
1194
1208
void ChatMessage (int type, bool isTeamSay = false );
1195
1209
void RadioMessage (int message);
@@ -1454,7 +1468,6 @@ class Waypoint : public Singleton <Waypoint>
1454
1468
Vector GetBombPosition (void ) { return m_foundBombOrigin; }
1455
1469
void SetBombPosition (bool shouldReset = false );
1456
1470
String CheckSubfolderFile (void );
1457
- String CheckSubfolderFileOld (void );
1458
1471
1459
1472
int * GetWaypointPath () { return m_pathMatrix; }
1460
1473
int * GetWaypointDist () { return m_distMatrix; }
0 commit comments