Overview | Package | Class | Source | Class tree | Glossary | 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 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 |
//============================================================================= // JBPickupJailCard // Copyright 2007 by [GSF]JohnDoe <gsfjohndoe@hotmail.com> // Created 2004 by tarquin <tarquin@beyondunreal.com> // $Id: JBPickupJailCard.uc,v 1.6 2007-05-19 15:06:55 johndoe Exp $ // // Pickup class for the "Get out of jail free card" for the Jailbreak Addon // JailCard. // // CHANGELOG: // 14 jan 2007 - Fixed Drawtype defaultproperty // Added defaultproperties to make it show up properly // Added custom LocalMessage // Added pickup sound // Added mutator method for MyAddon // Added initial Touch() behaviour // 15 jan 2007 - Seperated Properties and class variable declarations // Added JBDecoSwitchBasket effect // 17 jan 2007 - Added DeleteDecoration in an attempt to fix replication and // have the emitter destroyed on clients; I failed :( // Changed decoration to custom class // 10 feb 2007 - Added code to the Touch() method store a players PRI in the // gamerules class // Moved code within the Touch() method // Added check in the Touch() method to see if a player already // has a JailCard // Adjusted the Broadcast- and ReceiveLocalisedMessage parameters //============================================================================= class JBPickupJailCard extends TournamentPickup; // ============================================================================ // Properties // ============================================================================ var Class<Decoration> MyDecoration; var class<LocalMessage> ConsoleMessageClass; // ============================================================================ // Variables // ============================================================================ var JBAddonJailCard MyAddon; var Decoration Decoration; //============================================================================= // setMyAddon // // MyAddon mutator method //============================================================================= function bool setMyAddon(JBAddonJailCard JC) { MyAddon = JC; return true; } // ============================================================================ // SpawnDeco // // Spawns the visible parts of the JailCard's decoration client-side. // ============================================================================ simulated function SpawnDeco() { if (Level.NetMode != NM_DedicatedServer) { Decoration = Spawn(MyDecoration, Self, , MyDecoration.Default.Location + Location, MyDecoration.Default.Rotation + Rotation); } } //============================================================================= // Touch // // When a player touches the JailCard: // Display a message // Destroy the decoration //============================================================================= auto state Pickup { function Touch( Actor Other ) { local Pawn P; local Controller C; if ( ValidTouch(Other) ) { P = Pawn(Other); if(P.Controller != none) { C = P.Controller; // Player touched the pickup, check if he already has a key y/m if(MyAddon.myGameRules.HasJailCard(C.PlayerReplicationInfo) < 0) { MyAddon.myGameRules.AddPRI(C.PlayerReplicationInfo); BroadcastLocalizedMessage(ConsoleMessageClass, 100, C.PlayerReplicationInfo); DeleteDecoration(Other, P); SetRespawn(); // send message if(PlayerController(C) != none) PlayerController(C).ReceiveLocalizedMessage(MessageClass, 100, C.PlayerReplicationInfo); } } } } function BeginState() { UntriggerEvent(Event, self, None); SpawnDeco(); } } //============================================================================= // DeleteDecoration // // Deletes the emitter decoration // Note: Does not work properly yet, as it does not get called yet on the // clients, only on the server. Why? Look into replication... remember that // RemoteRole=ROLE_DumbProxy atm // // I'm so confused :( //============================================================================ simulated function DeleteDecoration(Actor Other, Pawn P) { //log("DeleteDecoration1"); //show up in server log (not client) if ( Level.NetMode != NM_DedicatedServer ) { Decoration.Trigger(Other, P); //log("DeleteDecoration2"); //doesn't show up anywhere except on listen servers } } //============================================================================= // default properties //============================================================================= defaultproperties { // visuals DrawType = DT_StaticMesh; StaticMesh = StaticMesh'JBToolbox.SwitchMeshes.JBReleaseKey'; Skins(0) = Shader'JBToolbox.SwitchSkins.JBKeyFinalRed'; bAmbientGlow=true; Physics=PHYS_Rotating; RotationRate=(Yaw=24000); DrawScale=0.6; MyDecoration = Class'JBDecoJailCardBasket'; Style=STY_AlphaZ; ScaleGlow=0.6; CullDistance=+4500.0; // AI MaxDesireability=0.3; // pickup stuff MessageClass=class'JBJailCardMessageScreen'; ConsoleMessageClass=class'JBJailCardMessageConsole'; PickupSound=sound'2K4MenuSounds.msfxDrag'; CollisionRadius=24.0; } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |