-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNormal Ranger Cateye Effect
More file actions
48 lines (40 loc) · 2.36 KB
/
Normal Ranger Cateye Effect
File metadata and controls
48 lines (40 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
scn 0DurielNormalRangerCateyeEffect
;Declare short variables to store boolean values
short bIsNPressed
short bControlVar
short bEquipped
;Begin the script effect when equipping the item
begin OnEquip
set bEquipped to 1
end
;Gamemode will launch the script effect after equipping or unequipping item
Begin GameMode
if bIsNPressed != IsKeyPressed 49 ;if function to properly detect if N - for Nighteye - letter is pressed or not
set bIsNPressed to IsKeyPressed 49 ;setting the key 49 pressed to the right state of the key
if bIsNPressed ;when pressing N code tests for equipped item
if bEquipped ;if function to control if helmet is equipped or not
if bControlVar == 0 ;if control variable is zero it activates the nighteye
ApplyImageSpaceModifier AAADurielNormalRangerCatEyeISFX ;ISM applied
player.setav Nighteye 1 ;applies nighteye effect
PlaySound UIPipBoyMode ;plays a little sound effect
set bControlVar to 1 ;puts the control variable to one
elseif bControlVar == 1 ;if control variable is one it deactivates the nighteye
RemoveImageSpaceModifier AAADurielNormalRangerCatEyeISFX ;ISM removed
player.setav Nighteye 0 ;removes nighteye
PlaySound UIPipBoyLightOff ;plays little sound effect
set bControlVar to 0 ;resets control variable to zero
endif
else
showMessage AAADurielNoNightVision ;if helmet unequipped a message is shown to tell player that they need to equip it
endif
endif
endif
End
;Shuts down script effect if unequipping the item
begin OnUnEquip
RemoveImageSpaceModifier AAADurielNormalRangerCatEyeISFX
player.setav Nighteye 0
set bEquipped to 0
PlaySound UIPipBoyLightOff ;plays little sound effect when equipping
set bControlVar to 0 ;automagically resets control variable simulating you switching off before unequipping
end