27 lines
860 B
Plaintext
27 lines
860 B
Plaintext
#include "uc_h"
|
|
|
|
int StartingConditional()
|
|
{
|
|
object oPC=GetPCSpeaker();
|
|
int nNumber=GetLocalInt(oPC,"nUCNumber");
|
|
int nQty;
|
|
int nRun=GetLocalInt(oPC,"nUCRun");
|
|
int nCurrent=GetLocalInt(GetModule(),GetLocalString(oPC,"sTeamID")+"_UnitCount");
|
|
int nMax=GetLocalInt(GetModule(),"nMaxUnits");
|
|
SetLocalInt(oPC,"nUCRun",nRun+1);
|
|
nQty=1;
|
|
if (nRun==1) nQty=2;
|
|
else if (nRun==2) nQty=3;
|
|
else if (nRun==3) nQty=4;
|
|
else if (nRun==4) nQty=5;
|
|
else if (nRun==5) nQty=10;
|
|
else if (nRun==6) nQty=15;
|
|
else if (nRun==7) nQty=20;
|
|
else if (nRun==8) nQty=30;
|
|
else if (nRun==9) nQty=40;
|
|
if (nCurrent+nQty>nMax) return FALSE;
|
|
if (!HasSufficientResources(oPC,nNumber,nQty)) return FALSE;
|
|
SetCustomToken(1011+nRun,GetUnitDescription(GetLocalString(oPC,"sTeamID"),nNumber,nQty,-1,oPC));
|
|
return TRUE;
|
|
}
|