85 lines
2.3 KiB
Plaintext
85 lines
2.3 KiB
Plaintext
/////////////////////////////////////////////////////////
|
|
// powres_h - sounds and messages for Power Reservoir
|
|
// By Deva Winblood.
|
|
/////////////////////////////////////////////////////////
|
|
#include "header_sounds"
|
|
|
|
void fnSoundMessage(string sMsg,string sTeam="NA",string sSound="NA")
|
|
{ // display a message to players NA = not specific team
|
|
object oPC=GetFirstPC();
|
|
float fDelay=0.1;
|
|
while(GetIsObjectValid(oPC))
|
|
{ // traverse PCs
|
|
if (GetLocalString(oPC,"sTeamID")==sTeam||sTeam=="NA")
|
|
{ // message
|
|
DelayCommand(fDelay,SendMessageToPC(oPC,sMsg));
|
|
if (sSound!="NA") DelayCommand(fDelay,AssignCommand(oPC,fnSoundAlert(sSound)));
|
|
fDelay=fDelay+0.5;
|
|
} // message
|
|
oPC=GetNextPC();
|
|
} // traverse PCs
|
|
} // fnSoundMessage()
|
|
|
|
void fnPowerNotify(int nMessage,string sMsg="")
|
|
{ // PURPOSE: send power reservoir message
|
|
object oPC=GetFirstPC();
|
|
string sID;
|
|
while(GetIsObjectValid(oPC))
|
|
{ // message
|
|
sID=GetLocalString(oPC,"sTeamID");
|
|
AssignCommand(oPC,fnTeamVoiceOver(sID,nMessage));
|
|
if (GetStringLength(sMsg)>0) SendMessageToPC(oPC,sMsg);
|
|
oPC=GetNextPC();
|
|
} // message
|
|
} // fnPowerNotify()
|
|
|
|
|
|
int fnUnitCost(string sTeamID,int nParm)
|
|
{ // return cost in points for the unit
|
|
if (sTeamID=="DWF")
|
|
{
|
|
if (nParm==1) return 4;
|
|
else if (nParm==2) return 6;
|
|
else if (nParm==3) return 18;
|
|
else if (nParm==4) return 24;
|
|
else if (nParm==5) return 26;
|
|
else if (nParm==6) return 28;
|
|
}
|
|
else if (sTeamID=="SPID")
|
|
{
|
|
if (nParm==1) return 6;
|
|
else if (nParm==2) return 12;
|
|
else if (nParm==3) return 14;
|
|
else if (nParm==4) return 22;
|
|
else if (nParm==5) return 24;
|
|
else if (nParm==6) return 30;
|
|
}
|
|
else if (sTeamID=="UND")
|
|
{
|
|
if (nParm==1) return 6;
|
|
else if (nParm==2) return 10;
|
|
else if (nParm==3) return 12;
|
|
else if (nParm==4) return 20;
|
|
else if (nParm==5) return 26;
|
|
else if (nParm==6) return 36;
|
|
}
|
|
else if (sTeamID=="UNC")
|
|
{
|
|
if (nParm==1) return 1;
|
|
else if (nParm==2) return 8;
|
|
else if (nParm==3) return 10;
|
|
else if (nParm==4) return 14;
|
|
else if (nParm==5) return 18;
|
|
else if (nParm==6) return 20;
|
|
}
|
|
return 100;
|
|
} // fnUnitCost()
|
|
|
|
string fnUnitRes(string sTeamID,int nParm)
|
|
{ // return resref
|
|
string sRet=sTeamID+"pr"+IntToString(nParm);
|
|
return sRet;
|
|
} // fnUnitRes()
|
|
|
|
//void main(){}
|