Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Gameplay.Burner


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
class Burner extends Weapon;

var() float energyUsage			"The amount of energy to use when fired";

var Shader dialShader;
var ControllableTexturePanner dialTexPanner;
var() int dialMaterialIndex;

var bool bControllableSkinSet;

simulated function buildControllableSkins()
{
	local Combiner dialCombiner;

	// Build a controllable texture panner for the dial shader
	dialShader = Shader(ShallowCopyMaterial(GetMaterial(dialMaterialIndex), self));

	if (dialShader != None)
	{
		dialCombiner = Combiner(ShallowCopyMaterial(dialShader.SelfIllumination, self));

		if (dialCombiner != None)
		{
			dialTexPanner = new class'ControllableTexturePanner';
			dialTexPanner.PanDirection = Vector(TexPanner(dialCombiner.Material2).PanDirection);
			dialTexPanner.Material = TexPanner(dialCombiner.Material2).Material;

			dialCombiner.Material2 = dialTexPanner;
			dialCombiner.Mask = dialTexPanner;

			dialShader.SelfIllumination = dialCombiner;
		}
	}

	// If succeeded set the shader as the skin for the weapon
	if (dialTexPanner != None)
		setControllableSkins();
}

simulated function bool canFire()
{
	return Character(rookOwner).energy > energyUsage;
}

function useAmmo()
{
	Character(rookOwner).weaponUseEnergy(energyUsage);
}

simulated function bool hasAmmo()
{
	return true;
}

simulated function Tick(float DeltaTime)
{
	Super.Tick(DeltaTime);

	if (bIsFirstPerson && equipped)
	{
		if (bControllableSkinSet)
			dialTexPanner.Scale = FMax(0.0, Character(rookOwner).energy / Character(rookOwner).energyMaximum - 0.09);
		else
			buildControllableSkins();
	}
}

simulated function setControllableSkins()
{
	local int i;

	if (Skins.Length <= dialMaterialIndex)
		Skins.Length = dialMaterialIndex + 1;

	for (i = 0; i < dialMaterialIndex; ++i)
	{
		Skins[i] = None;
	}

	Skins[dialMaterialIndex] = dialShader;

	bControllableSkinSet = true;
}

simulated function setHasAmmoSkins()
{
	// Always has ammo
}

defaultproperties
{
	dialMaterialIndex = 3

	firstPersonMesh = Mesh'Weapons.Blaster'
	firstPersonOffset = (X=-33,Y=22,Z=-15)

	roundsPerSecond = 1.0
	energyUsage = 20
	ammoUsage = 0

	projectileClass = class'BurnerProjectile'
	projectileVelocity = 3000
	projectileInheritedVelFactor = 1.0

	aimClass = class'AimProjectileWeapons'
	animClass = class'CharacterEquippableAnimator'

	animPrefix = "Burner"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 15:53:10.000 - Creation time: st 23.5.2018 00:10:42.590 - Created with UnCodeX