laser quest! to incorperate laser blocking o.o i need a cog that replaces an existing feature that makes you invincible for about 1 sec. and randomly selects one of 3 keys each time . ill have the keys my self.
This is the static archive of the Massassi Forums. The forums are
closed indefinitely. Thanks for all the memories!
You can also download
Super Old Archived Message Boards
from when Massassi first started.
"View" counts are as of the day the forums were archived, and will no longer increase.
# Jedi Knight Cog Script
#
# WEAP_STRIFLE.COG
#
# WEAPON 3 script - Stormtrooper Rifle
#
# The standard rifle used by the stormtroopers. Not as accurate as the Bryar Pistol.
# This weapon has only one type of fire.
#
# - Affected by MagSealed sectors/surfaces.
#
# [YB & CYW]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
model povModel=strv.3do local
model weaponMesh=strg.3do local
keyframe mountAnim=StrVmnt.key local
keyframe dismountAnim=StrVdis.key local
keyframe povfireAnim=StrVpst1.key local
keyframe holsterAnim=kyhlstr.key local
sound mountSound=df_rif_ready.wav local
sound dismountSound=PutWeaponAway01.wav local
sound fireSound=laser.wav local
sound outSound=rte.wav local
template projectile=+laser local
template projectile2=+laserg local
thing player local
flex fireWait=0.6 local
flex holsterWait local
flex powerBoost local
flex autoAimFOV=25 local
flex autoAimMaxDist=5 local
int dummy local
int trackID=-1 local
int fireChannel=-1 local
int holsterTrack local
int mode local
int team=1 local
message activated
message deactivated
message selected
message deselected
message autoselect
message fire
message timer
end
# ========================================================================================
code
fire:
player = GetSourceRef();
mode = GetSenderRef();
// Check that the player is still alive.
if(GetThingHealth(player) <= 0) Return;
// Check Ammo - If we are out, autoselect best weapon.
// It should always use two energy cells, but -- as in DF --
// allow the last fire if there is only one left...
if(GetInv(player, 11) < 1.0)
{
PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80);
if((GetAutoSwitch() & 1))
SelectWeapon(player, AutoSelectWeapon(player, 1));
Return;
}
If(GetPlayerTeam(player) > 1) team = 2; // If team is not red or neutral, it fires a green laser
Else team = 1;
SetPOVShake('0.0 -.003 0.0', '1.5 0.0 0.0', .05, 80.0);
dummy = FireProjectile(player, projectile[team-1], fireSound, 8, '0.0168 0.1896 0.00', '0 0 0', 1.0, 0x30, autoAimFOV, autoAimFOV*2);
ChangeInv( player, 11, -1.0 );
jkPlayPOVKey( player, povfireAnim, 1, 0x38 );
powerBoost = GetInv(player, 63);
ChangeFireRate(player, fireWait/powerBoost);
Return;
# ........................................................................................
activated:
player = GetSourceRef();
mode = GetSenderRef();
jkSetWaggle(player, '0.0 0.0 0.0', 0);
powerBoost = GetInv(player, 63);
ActivateWeapon(player, fireWait/powerBoost, mode);
Return;
# ........................................................................................
deactivated:
player = GetSourceRef();
jkSetWaggle(player, '10.0 7.0 0.0', 350);
DeactivateWeapon(player, mode);
Return;
# ........................................................................................
selected:
player = GetSourceRef();
PlayMode(player, 41);
PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80);
jkSetPOVModel(player, povModel);
SetArmedMode(player, 1);
jkSetWeaponMesh(player, weaponMesh);
jkSetWaggle(player, '10.0 7.0 0.0', 350);
trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
SetMountWait(player, GetKeyLen(mountAnim));
jkClearFlags(player, 0x5);
SetCurWeapon(player, 3);
Return;
# ........................................................................................
deselected:
player = GetSourceRef();
PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);
jkPlayPOVKey(player, dismountAnim, 0, 0x18);
holsterWait = GetKeyLen(holsterAnim);
SetMountWait(player, holsterWait);
holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
SetTimerEx(holsterWait, 2, 0.0, 0.0);
if (trackID != -1)
{
jkStopPOVKey(player, trackID, 0);
trackID = -1;
}
jkSetWaggle(player, '0.0 0.0 0.0', 0);
Return;
# ........................................................................................
autoselect:
player = GetSourceRef();
// If the player has the weapon
if(GetInv(player, 3) != 0.0)
{
// If the player has ammo
if(GetInv(player, 11) != 0.0)
{
ReturnEx(600.0);
}
else
{
ReturnEx(-1.0);
}
}
else
{
ReturnEx(-1.0);
}
Return;
# ........................................................................................
timer:
StopKey(player, holsterTrack, 0.0);
Return;
end