![]() |
|
|
|
#1
|
|||
|
|||
|
Quote:
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE Last edited by salmo; 04-02-2012 at 03:43 PM. |
|
#2
|
|||
|
|||
|
These?:
Code:
private void damageAiControlledPlane(AiActor actorMain)
{
foreach (AiActor actor in actorMain.Group().GetItems())
{
if (actor == null || !(actor is AiAircraft))
return;
AiAircraft aircraft = (actor as AiAircraft);
if (!isAiControlledPlane(aircraft))
return;
if (aircraft == null)
return;
aircraft.hitNamed(part.NamedDamageTypes.ControlsElevatorDisabled);
aircraft.hitNamed(part.NamedDamageTypes.ControlsAileronsDisabled);
aircraft.hitNamed(part.NamedDamageTypes.ControlsRudderDisabled);
aircraft.hitNamed(part.NamedDamageTypes.FuelPumpFailure);
int iNumOfEngines = (aircraft.Group() as AiAirGroup).aircraftEnginesNum();
for (int i = 0; i < iNumOfEngines; i++)
{
aircraft.hitNamed((part.NamedDamageTypes)Enum.Parse(typeof(part.NamedDamageTypes), "Eng" + i.ToString() + "TotalFailure"));
}
Timeout(300, () =>
{ destroyPlane(aircraft); }
);
}
}
|
|
#3
|
|||
|
|||
|
I think you might have to list the items in a list then random select an item(line by number) to use. This may however have a parse problem where you are transfering built in code to string types(listing) and back again.(am I sick of parsing problems yes I am)
might have some syntax errors in the following, but something like, (yes this came from Kodiak Code:
List<Damage> DamageList = new List<Damage>
{
new Damage ("ElecBatteryFailure"),
new Damage ("ElecGeneratorFailure")
// add each damage type(note add comma on preceeding line)
};
internal class Damage
{
public string EDamageType { get; set; }
public Damage(string eDamageType)
{
this.EDamageType = eDamageType;
}
}
//random selection
Random rand = new Random();
int i = 0;
if (DamageList.Count > 0)
i = rand.Next(0, DamageList.Count);
aircraft.hitNamed(part.NamedDamageTypes.DamageList[i].EDamageType);
});
Last edited by Smokeynz; 04-04-2012 at 03:29 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|