Overview | Package | Class | Source | Class tree | Glossary | Deus Ex UnrealScript Documentation |
previous class next class | frames no frames |
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 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 |
//============================================================================= // Keypad. //============================================================================= class Keypad extends HackableDevices abstract; var() string validCode; var() sound successSound; var() sound failureSound; var() name FailEvent; var() bool bToggleLock; // if True, toggle the lock state instead of triggering var HUDKeypadWindow keypadwindow; // ---------------------------------------------------------------------- // Network Replication // ---------------------------------------------------------------------- replication { //server to client variables reliable if ( Role == ROLE_Authority ) bToggleLock, FailEvent, validCode; } // ---------------------------------------------------------------------- // HackAction() // ---------------------------------------------------------------------- function HackAction(Actor Hacker, bool bHacked) { local DeusExPlayer Player; // if we're already using this keypad, get out if (keypadwindow != None) return; Player = DeusExPlayer(Hacker); if (Player != None) { // DEUS_EX AMSD if we are in multiplayer, just act based on bHacked // if you want keypad windows to work in multiplayer, just get rid of this // if statement. I've already got the windows working, they're just disabled. if (Level.NetMode != NM_Standalone) { if (bHacked) { ToggleLocks(Player); RunEvents(Player,True); RunUntriggers(Player); } return; } //DEUS_EX AMSD Must call in player for replication to work. Player.ActivateKeypadWindow(Self, bHacked); } } // ---------------------------------------------------------------------- // ActivateKeypadWindow // DEUS_EX AMSD Bounce back call from player so function rep works right. // ---------------------------------------------------------------------- simulated function ActivateKeypadWindow(DeusExPlayer Hacker, bool bHacked) { local DeusExRootWindow root; root = DeusExRootWindow(Hacker.rootWindow); if (root != None) { keypadwindow = HUDKeypadWindow(root.InvokeUIScreen(Class'HUDKeypadWindow', True)); root.MaskBackground(True); // copy the tag data to the actual class if (keypadwindow != None) { keypadwindow.keypadOwner = Self; keypadwindow.player = Hacker; keypadwindow.bInstantSuccess = bHacked; keypadwindow.InitData(); } } } // ---------------------------------------------------------------------- // RunUntriggers() // DEUS_EX AMSD Bounce back call from player so function rep works right. // ---------------------------------------------------------------------- function RunUntriggers(DeusExPlayer Player) { local Actor A; local int i; for (i=0; i<ArrayCount(UnTriggerEvent); i++) { if (UnTriggerEvent[i] != '') { foreach AllActors(class 'Actor', A, UnTriggerEvent[i]) { A.UnTrigger(Self, Player); } } } } // ---------------------------------------------------------------------- // RunEvents() // ---------------------------------------------------------------------- function RunEvents(DeusExPlayer Player, bool bSuccess) { local Actor A; if ((bSuccess) && (Event != '')) { foreach AllActors(class 'Actor', A, Event) A.Trigger(Self, Player); } else if ((!bSuccess) && (FailEvent != '')) { foreach AllActors(class 'Actor', A, FailEvent) A.Trigger(Self, Player); } } // ---------------------------------------------------------------------- // ToggleLocks() // ---------------------------------------------------------------------- function ToggleLocks(DeusExPlayer Player) { local Actor A; if (bToggleLock) { foreach AllActors(class 'Actor', A, Event) if (A.IsA('DeusExMover')) DeusExMover(A).bLocked = !DeusExMover(A).bLocked; } } // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- defaultproperties { validCode="1234" successSound=Sound'DeusExSounds.Generic.Beep2' failureSound=Sound'DeusExSounds.Generic.Buzz1' bToggleLock=True ItemName="Security Keypad" Mass=10.000000 Buoyancy=5.000000 } |
Overview | Package | Class | Source | Class tree | Glossary | Deus Ex UnrealScript Documentation |
previous class next class | frames no frames |