reasonable

This commit is contained in:
INeedBots 2020-10-02 19:10:37 -06:00
parent cfd1d6e8e3
commit c35d7147c8

View File

@ -316,11 +316,12 @@ getKillstreaks()
/* /*
bots chooses a random perk bots chooses a random perk
*/ */
chooseRandomPerk(perkkind) chooseRandomPerk(perkkind, primary)
{ {
perks = getPerks(perkkind); perks = getPerks(perkkind);
rank = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData("experience") ); rank = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData("experience") );
allowOp = (getDvarInt("bots_loadout_allow_op") >= 1); allowOp = (getDvarInt("bots_loadout_allow_op") >= 1);
reasonable = getDvarInt("bots_loadout_reasonable");
while (true) while (true)
{ {
@ -335,6 +336,59 @@ chooseRandomPerk(perkkind)
continue; continue;
} }
if (reasonable)
{
if (perk == "specialty_onemanarmy")
continue;
if (perk == "specialty_bling")
continue;
if (perk == "specialty_explosivedamage")
continue;
if (perk == "specialty_localjammer")
continue;
if (perk == "throwingknife_mp")
continue;
if (perk == "specialty_blastshield")
continue;
if (perk == "c4_mp")
continue;
if (perk == "frag_grenade_mp")
continue;
if (perk == "specialty_copycat")
continue;
if (perkkind == "perk2")
{
if (perk != "specialty_bulletdamage")
{
if (primary == "cheytac")
continue;
if (primary == "rpd")
continue;
if (primary == "ak47" && randomInt(100) < 80)
continue;
if (primary == "aug")
continue;
if (primary == "barrett" && randomInt(100) < 80)
continue;
if (primary == "tavor" && randomInt(100) < 80)
continue;
if (primary == "scar")
continue;
if (primary == "masada" && randomInt(100) < 60)
continue;
if (primary == "m4" && randomInt(100) < 80)
continue;
if (primary == "m16")
continue;
if (primary == "fal")
continue;
if (primary == "famas")
continue;
}
}
}
if (perk == "specialty_null") if (perk == "specialty_null")
continue; continue;
@ -373,6 +427,7 @@ chooseRandomPrimary()
{ {
primaries = getPrimaries(); primaries = getPrimaries();
allowOp = (getDvarInt("bots_loadout_allow_op") >= 1); allowOp = (getDvarInt("bots_loadout_allow_op") >= 1);
reasonable = getDvarInt("bots_loadout_reasonable");
while (true) while (true)
{ {
@ -384,6 +439,24 @@ chooseRandomPrimary()
continue; continue;
} }
if (reasonable)
{
if (primary == "riotshield")
continue;
if (primary == "wa2000")
continue;
if (primary == "uzi")
continue;
if (primary == "sa80")
continue;
if (primary == "fn2000")
continue;
if (primary == "m240")
continue;
if (primary == "mg4")
continue;
}
if (!self isItemUnlocked(primary)) if (!self isItemUnlocked(primary))
continue; continue;
@ -401,6 +474,7 @@ chooseRandomSecondary(perk1)
secondaries = getSecondaries(); secondaries = getSecondaries();
allowOp = (getDvarInt("bots_loadout_allow_op") >= 1); allowOp = (getDvarInt("bots_loadout_allow_op") >= 1);
reasonable = getDvarInt("bots_loadout_reasonable");
while (true) while (true)
{ {
@ -412,6 +486,14 @@ chooseRandomSecondary(perk1)
continue; continue;
} }
if (reasonable)
{
if (secondary == "ranger")
continue;
if (secondary == "model1887")
continue;
}
if (!self isItemUnlocked(secondary)) if (!self isItemUnlocked(secondary))
continue; continue;
@ -429,6 +511,7 @@ chooseRandomAttachmentComboForGun(gun)
{ {
atts = getAttachmentsForGun(gun); atts = getAttachmentsForGun(gun);
allowOp = (getDvarInt("bots_loadout_allow_op") >= 1); allowOp = (getDvarInt("bots_loadout_allow_op") >= 1);
reasonable = getDvarInt("bots_loadout_reasonable");
while (true) while (true)
{ {
@ -444,6 +527,26 @@ chooseRandomAttachmentComboForGun(gun)
continue; continue;
} }
if (reasonable)
{
if (att1 == "shotgun" || att2 == "shotgun")
continue;
if ((att1 == "akimbo" || att2 == "akimbo") && gun != "ranger" && gun != "model1887")
continue;
if (att1 == "acog" || att2 == "acog")
continue;
if (att1 == "thermal" || att2 == "thermal")
continue;
if (att1 == "rof" || att2 == "rof")
continue;
if (att1 == "silencer" || att2 == "silencer")
{
if (gun == "spas12" || gun == "aa12" || gun == "striker" || gun == "rpd" || gun == "m1014" || gun == "cheytac" || gun == "barrett" || gun == "aug" || gun == "m240" || gun == "mg4" || gun == "sa80" || gun == "wa2000")
continue;
}
}
retAtts = []; retAtts = [];
retAtts[0] = att1; retAtts[0] = att1;
retAtts[1] = att2; retAtts[1] = att2;
@ -458,11 +561,18 @@ chooseRandomAttachmentComboForGun(gun)
chooseRandomTactical() chooseRandomTactical()
{ {
tacts = strTok("flash_grenade,smoke_grenade,concussion_grenade", ","); tacts = strTok("flash_grenade,smoke_grenade,concussion_grenade", ",");
reasonable = getDvarInt("bots_loadout_reasonable");
while (true) while (true)
{ {
tact = random(tacts); tact = random(tacts);
if (reasonable)
{
if (tact == "smoke_grenade")
continue;
}
return tact; return tact;
} }
} }
@ -481,11 +591,11 @@ setClasses()
{ {
equipment = chooseRandomPerk("equipment"); equipment = chooseRandomPerk("equipment");
perk1 = chooseRandomPerk("perk1"); perk1 = chooseRandomPerk("perk1");
perk2 = chooseRandomPerk("perk2");
perk3 = chooseRandomPerk("perk3"); perk3 = chooseRandomPerk("perk3");
deathstreak = chooseRandomPerk("perk4"); deathstreak = chooseRandomPerk("perk4");
tactical = chooseRandomTactical(); tactical = chooseRandomTactical();
primary = chooseRandomPrimary(); primary = chooseRandomPrimary();
perk2 = chooseRandomPerk("perk2", primary);
primaryAtts = chooseRandomAttachmentComboForGun(primary); primaryAtts = chooseRandomAttachmentComboForGun(primary);
primaryCamo = chooseRandomCamo(); primaryCamo = chooseRandomCamo();
secondary = chooseRandomSecondary(perk1); secondary = chooseRandomSecondary(perk1);
@ -562,6 +672,8 @@ setKillstreaks()
if (rankId >= 22) if (rankId >= 22)
chooseableStreaks++; chooseableStreaks++;
reasonable = getDvarInt("bots_loadout_reasonable");
i = 0; i = 0;
while (i < chooseableStreaks) while (i < chooseableStreaks)
{ {
@ -575,6 +687,24 @@ setKillstreaks()
if (isColidingKillstreak(killstreaks, streak)) if (isColidingKillstreak(killstreaks, streak))
continue; continue;
if (reasonable)
{
if (streak == "stealth_airstrike")
continue;
if (streak == "airdrop_mega")
continue;
if (streak == "emp")
continue;
if (streak == "airdrop_sentry_minigun")
continue;
if (streak == "airdrop")
continue;
if (streak == "precision_airstrike")
continue;
if (streak == "helicopter")
continue;
}
killstreaks[slot] = streak; killstreaks[slot] = streak;
i++; i++;
} }
@ -775,9 +905,10 @@ classWatch()
wait 0.5; wait 0.5;
reasonable = getDvarInt("bots_loadout_reasonable");
class = ""; class = "";
rank = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData( "experience" ) ) + 1; rank = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData( "experience" ) ) + 1;
if(rank < 4 || randomInt(100) < 2) if(rank < 4 || (randomInt(100) < 2 && !reasonable))
{ {
while(class == "") while(class == "")
{ {