void DirControl::AllocateAc() { InitDirectivesStruct(); AircraftAlreadyUsed(-1, false); InitAc(); for (char i = 0; i < (MAXDIRECTIVES - 1); i++) { FindTargets(i); if (directives[i].targets > MAXMISSIONS) directives[i].targets = MAXMISSIONS; directives[i].missionsset = 0; if ( (directives[i].strikeac != 0) || (directives[i].type == SupplyTree::D_AIRSUPERIORITY) ) { //DEADCODE RDH 12/06/99 if (!AllocateTargets(i, UNDECIDEDSTRIKE, true)) //DEADCODE RDH 12/06/99 //nomissions were set and so try unescorted //RDH 10/06/99 AllocateTargets(i, UNDECIDEDSTRIKE, true); }else { directives[i].missions[0].note = SupplyTree::M_NOACALLOC; } } }
void BasicAttackClass::Execute(AgentClass* source, std::list <AgentClass*> enemies, int targetx, int targety){ // Execute this ability from the source/executing Agent, affecting all // legitimate targets of those provided when targeting the provided // coordinates // NOTE: Proof of Concept //first calcuate attack strength based on source stats std::list<AgentClass*> targets; std::list<AgentClass*>::iterator target; int baseDamage; // Proof of Concept, Base Damage is Attacking Agent's 'Strength' baseDamage = source->GetStrength(); //second find all targets in range of attack targets = FindTargets(targetx, targety, enemies); // Attack all valid targets for (target = targets.begin(); target != targets.end(); ++target){ (*target)->TakeDamage(baseDamage); } }