87 lines
1.4 KiB
Plaintext
87 lines
1.4 KiB
Plaintext
{$CLEO .cs}
|
|
0000:
|
|
var
|
|
0@ : Int // Old weapon
|
|
1@ : Int // Old ammo
|
|
2@ : Int // New weapon
|
|
3@ : Int // New ammo
|
|
4@ : Int // Camshake multiplier
|
|
end
|
|
|
|
0470: 0@ = actor $PLAYER_ACTOR armed_weapon
|
|
0419: 1@ = player $PLAYER_CHAR weapon 0@ ammo
|
|
|
|
:LOOP
|
|
wait 0
|
|
0470: 2@ = actor $PLAYER_ACTOR armed_weapon
|
|
0419: 3@ = player $PLAYER_CHAR weapon 2@ ammo
|
|
|
|
if
|
|
0@ <> 2@ // Weapon changed
|
|
then // Do not shake
|
|
jump @UPDATE
|
|
end
|
|
|
|
if
|
|
1@ > 3@ // Ammo decreased
|
|
then // Shake
|
|
jump @SHAKE
|
|
end
|
|
|
|
jump @UPDATE
|
|
|
|
:UPDATE
|
|
// Update old weapon/ammo
|
|
0@ = 2@
|
|
1@ = 3@
|
|
jump @LOOP
|
|
|
|
:SHAKE
|
|
4@ = 100
|
|
if or // Light weapons
|
|
2@ == 17 // Colt
|
|
2@ == 22 // Tec-9
|
|
2@ == 23 // Uzi
|
|
2@ == 24 // Ingram
|
|
2@ == 31 // Flame Thrower
|
|
then
|
|
4@ *= 0.5
|
|
jump @SHAKE2
|
|
end
|
|
|
|
if or // Medium weapons
|
|
2@ == 18 // Python
|
|
2@ == 25 // MP5
|
|
2@ == 26 // M4
|
|
2@ == 27 // Ruger
|
|
2@ == 28 // Sniper Rifle
|
|
2@ == 29 // Laser Sniper
|
|
then
|
|
4@ *= 1
|
|
jump @SHAKE2
|
|
end
|
|
|
|
if or // Medium-large weapons
|
|
2@ == 32 // M60
|
|
2@ == 33 // Minigun
|
|
then
|
|
4@ *= 1.5
|
|
jump @SHAKE2
|
|
end
|
|
|
|
if or // Large weapons
|
|
2@ == 19 // Shotgun
|
|
2@ == 20 // Spaz Shotgun
|
|
2@ == 21 // Stubby Shotgun
|
|
2@ == 30 // RPG
|
|
then
|
|
4@ *= 2
|
|
jump @SHAKE2
|
|
end
|
|
|
|
// Unlisted weapons
|
|
jump @UPDATE
|
|
|
|
:SHAKE2
|
|
0003: 4@
|
|
jump @UPDATE |