//----------------------------------------------------------- // //----------------------------------------------------------- class GrudgePlayer extends xPlayer; // Data structure associating player names with damage. Could have // used a refenence to a Pawn instead of name, but when the player is // killed the Pawn is deleted, causing None access problems. struct GrudgeRecord { var string Enemy; var float Damage; }; var GrudgeRecord Grudges[64]; // Array of structures associating each // enemy player with the amount of damage // inflicted on this object. var int NumGrudges; // Number of enemies in Grudges[]. // This function is called the the Controller's Pawn body every time it is hit // by enemy fire. InstigatedBy is the enemy Pawn that fired the shot. function NotifyTakeHit(pawn InstigatedBy, vector HitLocation, int Damage, class damageType, vector Momentum) { // This object was just shot. Check to see if the shooter is in the // Grudges[] array. If not, add him to the array and record the amount // of damage done. If the shooter is in the array already, just update // the amount of damage caused. // You may have to perform other computations, depending on your implementation. // Call the superclasses handled function. super.NotifyTakeHit(InstigatedBy, HitLocation, Damage, damageType, Momentum); } DefaultProperties { }