How to Create the Concussion Rifle Mutator:

The full source code for these four files is presented here:


//=========================================================================
//  ConcussionRifle.uc
//=========================================================================

class ConcussionRifle extends ShockRifle;

defaultproperties
{
    ItemName="Concussion Rifle"
    FireModeClass(0)=ConcussionRifleFire
    PickupClass=class'ConcussionRiflePickUp'
}

//=========================================================================
//  ConcussionRifleFire.uc
//=========================================================================

class ConcussionRifleFire extends ShockBeamFire;

defaultproperties
{
    Momentum=+1000000.0   // sixteen times further than usual.
    DamageMin=5
    DamageMax=5
}

//=========================================================================
//  ConcussionRiflePickup.uc
//=========================================================================

class ConcussionRiflePickup extends ShockRiflePickup;

defaultproperties
{
    InventoryType=class'ConcussionRifle'
    PickupMessage="You have obtained the Concussion Rifle!"
}

//=========================================================================
//  MutConcuss.uc - replaces shock rifle
//=========================================================================

class MutConcuss extends Mutator;

function bool CheckReplacement ( Actor Other, out byte bSuperRelevant )
// Return true if item should be left alone.
// Return false iff item is a shock rifle (on a base or on the ground)
{
    if (xWeaponBase(Other) != None)
    {
        if (xWeaponBase(Other).WeaponType == class'ShockRifle')
            xWeaponBase(Other).WeaponType = class'ConcussionRifle';
        else
            return true;
    }
    else if (WeaponPickup(Other) != None)
    {
        if (string(Other.Class) == "xWeapons.ShockRiflePickup")
            ReplaceWith( Other, "ConcussionRifle.ConcussionRiflePickup");
        else
            return true;
    }
    else
    {
        return true;
    }
    return false;
}

defaultproperties
{
    Description="Main fire causes little damage but flicks the victim far, 
     far away||Alt fire is a normal shock rifle plasma ball"
    FriendlyName="Concussion Rifle"
}

[Public]
Object=(Name=ConcussionRifle.MutConcuss,Class=Class,MetaClass=Engine.Mutator,
Description="Concussion Rifle")
Object=(Name=ConcussionRifle.ConcussionRifle,Class=Class,MetaClass=Engine.Weapon,
Description="Main fire causes little damage but flicks the victim far, far away||
Alt fire is a normal shock rifle plasma ball")


Doctor Evil, Stardate 2004235.

Return to Doctor Evil's UT2004 Page   [Return to Doctor Evil’s UT2004 Page]
Return to your previous page   [Return to your previous page]

Created 2004 08 22 and most recently modified 2004 08 24 by Doctor Evil.