Check this.
Code:
using maddox.game;
using maddox.game.world;
using part;
using System;
using System.IO;
using System.Collections.Generic;
using maddox.GP;
public class Mission : AMission {
private string SEPARATOR = " "; // NOT a space char
public override void OnBattleStarted()
{
GamePlay.gpLogServer(null, "OnBattleStarted", new object[] { });
}
public override void OnBuildingKilled(string title, Point3d pos, AiDamageInitiator initiator, int eventArgInt)
{
string[] parts = title.Split(new string[] { SEPARATOR }, StringSplitOptions.None);
GamePlay.gpLogServer(null, "Building Destroyed " + parts[2], new object[] { });
}
public override void OnStationaryKilled(int intWhat0, GroundStationary stationary, AiDamageInitiator initiator, int intWhat1)
{
string[] parts = stationary.Title.Split(new string[] { SEPARATOR }, StringSplitOptions.None);
GamePlay.gpLogServer(null, "Stationary Destroyed " + parts[2], new object[] { });
}
public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
{
if (actor is AiAircraft) {
GamePlay.gpLogServer(null, "Aircraft Destroyed " + shortName + " " + actor.Name(), new object[] { });
return;
}
if (actor is AiGroundActor) {
AiGroundActor groundActor = actor as AiGroundActor;
if (typeString.Contains("Ship")) {
GamePlay.gpLogServer(null, "Ship Destroyed " + shortName + " " + actor.Name(), new object[] { });
} else {
GamePlay.gpLogServer(null, "Ground Vehicle Destroyed " + shortName + " " + actor.Name(), new object[] { });
}
}
}
}
Bookmarks