HoS_PRC8/_mod/_module/nss/adv_report.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

47 lines
2.5 KiB
Plaintext

////////////////////////////////////////////////////////////////////
// Advisor Report
// By Deva Bryson Winblood. 12/04/2003
////////////////////////////////////////////////////////////////////
#include "rtsh_multiplay"
#include "advisor_header"
void main()
{
object oPC=GetPCSpeaker();
string sReport;
int nC;
int nLvl=fnLevel(oPC);
int nHighestLvl=nLvl;
int nMana=fnGetTeamMana(oPC);
int nGold=GetGold(oPC);
int nUnits=fnCountUnits(oPC);
int nSouls=fnGetTeamSouls(oPC);
object oH=GetFirstPC();
sReport="Your current mana is "+IntToString(nMana)+", and you are carrying "+IntToString(nGold)+".";
sReport=sReport+" You have "+IntToString(nSouls)+" souls in your soul receptacle. Your unit power is "+IntToString(nUnits)+".";
while(oH!=OBJECT_INVALID)
{ // test levels
if (fnLevel(oH)>nHighestLvl) nHighestLvl=fnLevel(oH);
oH=GetNextPC();
} // test levels
sReport=sReport+" Your current Level is "+IntToString(nLvl)+" while the highest level player is "+IntToString(nHighestLvl)+".";
if (nHighestLvl>nLvl) sReport=sReport+"You might want to strive to catch up to that player in terms of level.";
else if (nHighestLvl==nLvl) sReport=sReport+"So, you are doing good in terms of level.";
nC=30*nLvl;
if (nC>nMana) sReport=sReport+"You really need to improve your mana income or at least conserve what you have and not spend it too rapidly, the really big and powerful units often take more mana.";
if (nC<=nMana) sReport=sReport+"You are faring well in terms of mana based on your level.";
nC=50*nHighestLvl;
if (nC<=nMana) sReport=sReport+"In fact, you have a good store of mana considering the highest level players needs.";
nC=250*nLvl;
if (nC>nGold) sReport=sReport+"You need more gold. Create units that produce taxes or go adventuring for more.";
else if (nC<=nGold) sReport=sReport+"Your gold stores are good.";
nC=3*nLvl;
if (nC>nUnits) sReport=sReport+"You need to seriously focus on increasing your army size.";
else if (nC<=nUnits) sReport=sReport+"You are keeping up well in terms of army size for your level.";
nC=3*nHighestLvl;
if (nC>nUnits) sReport=sReport+"If the highest level player is keeping up with unit contruction to match their level then your army is in trouble if faced with theirs!";
else if (nC<=nUnits) sReport=sReport+"You are even doing fairly well for a situation against an army of the strongest player.";
sReport=sReport+"That is my report.";
SetCustomToken(90000,sReport);
}