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

KFMod.KFMeleeGun


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
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
class KFMeleeGun extends KFWeapon;

//var name TPAnim;
//var name TPAnim2;
var bool btryHit ;
var float THMax, THMin, dmg ;
var class<damageType> hitDamType ;
var float weaponRange ;
var vector momOffset ;
var Actor HitObject ;
var byte MeleeHitVolume ;

var float hitTimeout ;
var bool bCanHit ;//, bAnimating ;

var float ChopSlowRate; // percentage your speed gets reduced to when chopping

// Bloody Weapons. By Alex.
// Gibby, when you re-do the melee code, you may have to move the code I put in Tick.

var Material BloodyMaterial; // When you slash someone and draw blood, switch to this skin.
var int BloodSkinSwitchArray; // In case the material array number varies between weapons, switch this num in defprops. (usually it's "2")
var bool bDoCombos; // DISABLE FOR NOW

var string BloodyMaterialRef;

static function PreloadAssets(Inventory Inv, optional bool bSkipRefCount)
{
	super.PreloadAssets(Inv, bSkipRefCount);

	default.BloodyMaterial = Combiner(DynamicLoadObject(default.BloodyMaterialRef, class'combiner', true));

	if ( KFMeleeGun(Inv) != none )
	{
		KFMeleeGun(Inv).BloodyMaterial = default.BloodyMaterial;
	}
}

static function bool UnloadAssets()
{
	if ( super.UnloadAssets() )
	{
		default.BloodyMaterial = none;
	}

	return true;
}

function DoReflectEffect(int Drain)
{
}

simulated function BringUp(optional Weapon PrevWeapon)
{
	if(BloodyMaterial!=none && Skins[BloodSkinSwitchArray] == BloodyMaterial )
	{
		Skins[BloodSkinSwitchArray] = default.Skins[BloodSkinSwitchArray];
		Texture = default.Texture;
	}
	super.BringUp(PrevWeapon);
}

simulated function bool HasAmmo()
{
	return true;
}

simulated function DisplayDebug(Canvas Canvas, out float YL, out float YPos)
{
	local vector boxscreenloc,endpoint,eyepoint;

	boxscreenloc = Canvas.WorldToScreen( GetBoneCoords('tip').Origin );
	Canvas.SetDrawColor(0,255,0,255);
	Canvas.SetPos(boxscreenloc.X-10,boxscreenloc.Y-10);
	Canvas.DrawBox(Canvas,20,20);

	eyepoint = Instigator.Location;
	eyepoint.Z += Instigator.Eyeheight;
	endpoint = (Normal(GetBoneCoords('tip').Origin-eyepoint)*1000)+eyepoint;
	boxscreenloc = Canvas.WorldToScreen(endpoint);
	Canvas.SetDrawColor(255,0,0,255);
	Canvas.SetPos(boxscreenloc.X-10,boxscreenloc.Y-10);
	Canvas.DrawBox(Canvas,20,20);

	boxscreenloc = Canvas.WorldToScreen(eyepoint);
	Canvas.SetDrawColor(0,0,255,255);
	Canvas.SetPos(boxscreenloc.X-10,boxscreenloc.Y-10);
	Canvas.DrawBox(Canvas,20,20);
	Super.DisplayDebug(Canvas,YL,YPos);
}

function byte BestMode()
{
	return 0;
}

function float GetAIRating()
{
	if( Instigator.Controller==None || PlayerController(Instigator.Controller)!=None || Instigator.Controller.Target==None )
		Return AIRating;
	if( VSize(Instigator.Controller.Target.Location-Instigator.Location)<120 )
		return AIRating*2;
	return AIRating/2;
}

function float SuggestAttackStyle()
{
    return 1;
}

function float SuggestDefenseStyle()
{
    return -1;
}

defaultproperties
{
     weaponRange=70.000000
     MeleeHitVolume=255
     ChopSlowRate=0.500000
     BloodSkinSwitchArray=2
     PutDownAnim="PutDown"
     AIRating=0.100000
     bMeleeWeapon=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fri 13-10-2023 03:17:26.000 - Creation time: Fri 13-10-2023 03:19:03.704 - Created with UnCodeX