shithub: choc

Download patch

ref: e93890502ea653c49f358dfb79008e47310c464c
parent: 0ac04776267a1a84724fcccfada12f769f4c315a
author: Samuel Villareal <svkaiser@gmail.com>
date: Wed Sep 15 21:21:58 EDT 2010

+ EV_DoLockedDoor completed

Subversion-branch: /branches/strife-branch
Subversion-revision: 2090

--- a/src/strife/doomdef.h
+++ b/src/strife/doomdef.h
@@ -107,35 +107,35 @@
 // villsa [STRIFE]
 typedef enum
 {
-    key_BaseKey,
-    key_GovsKey,
-    key_Passcard,
-    key_IDBadge,
-    key_PrisonKey,
-    key_SeveredHand,
-    key_Power1Key,
-    key_Power2Key,
-    key_Power3Key,
-    key_GoldKey,
-    key_IDCard,
-    key_SilverKey,
-    key_OracleKey,
-    key_MilitaryID,
-    key_OrderKey,
-    key_WarehouseKey,
-    key_BrassKey,
-    key_RedCrystalKey,
-    key_BlueCrystalKey,
-    key_ChapelKey,
-    key_CatacombKey,
-    key_SecurityKey,
-    key_CoreKey,
-    key_MaulerKey,
-    key_FactoryKey,
-    key_MineKey,
-    key_NewKey5,
+    key_BaseKey,        // 0
+    key_GovsKey,        // 1
+    key_Passcard,       // 2
+    key_IDCard,         // 3
+    key_PrisonKey,      // 4
+    key_SeveredHand,    // 5
+    key_Power1Key,      // 6
+    key_Power2Key,      // 7
+    key_Power3Key,      // 8
+    key_GoldKey,        // 9
+    key_IDBadge,        // 10
+    key_SilverKey,      // 11
+    key_OracleKey,      // 12
+    key_MilitaryID,     // 13
+    key_OrderKey,       // 14
+    key_WarehouseKey,   // 15
+    key_BrassKey,       // 16
+    key_RedCrystalKey,  // 17
+    key_BlueCrystalKey, // 18
+    key_ChapelKey,      // 19
+    key_CatacombKey,    // 20
+    key_SecurityKey,    // 21
+    key_CoreKey,        // 22
+    key_MaulerKey,      // 23
+    key_FactoryKey,     // 24
+    key_MineKey,        // 25
+    key_NewKey5,        // 26
 
-    NUMCARDS
+    NUMCARDS            // 27
 } card_t;
 
 
--- a/src/strife/p_doors.c
+++ b/src/strife/p_doors.c
@@ -215,62 +215,167 @@
 // Move a locked door up/down
 //
 
-int
-EV_DoLockedDoor
-( line_t*	line,
-  vldoor_e	type,
-  mobj_t*	thing )
+int EV_DoLockedDoor(line_t* line, vldoor_e type, mobj_t* thing)
 {
-    player_t*	p;
-	
+    player_t* p;
+
     p = thing->player;
-	
-    if (!p)
-	return 0;
-		
-/*    switch(line->special)
+
+    if(!p)
+        return 0;
+
+    switch(line->special)
     {
-      case 99:	// Blue Lock
-      case 133:
-	if ( !p )
-	    return 0;
-	if (!p->cards[it_bluecard] && !p->cards[it_blueskull])
-	{
-	    p->message = DEH_String(PD_BLUEO);
-	    S_StartSound(NULL,sfx_oof);
-	    return 0;
-	}
-	break;
-	
-      case 134: // Red Lock
-      case 135:
-	if ( !p )
-	    return 0;
-	if (!p->cards[it_redcard] && !p->cards[it_redskull])
-	{
-	    p->message = DEH_String(PD_REDO);
-	    S_StartSound(NULL,sfx_oof);
-	    return 0;
-	}
-	break;
-	
-      case 136:	// Yellow Lock
-      case 137:
-	if ( !p )
-	    return 0;
-	if (!p->cards[it_yellowcard] &&
-	    !p->cards[it_yellowskull])
-	{
-	    p->message = DEH_String(PD_YELLOWO);
-	    S_StartSound(NULL,sfx_oof);
-	    return 0;
-	}
-	break;	
-    }*/
+    case 99:
+    case 133:
+        if(!p->cards[key_IDCard])
+        {
+            p->message = DEH_String("You need an id card");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
 
+    case 134:
+    case 135:
+        if(!p->cards[key_IDBadge])
+        {
+            p->message = DEH_String("You need an id badge");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 136:
+    case 137:
+        if(!p->cards[key_Passcard])
+        {
+            p->message = DEH_String("You need a pass card");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 151:
+    case 164:
+        if(!p->cards[key_GoldKey])
+        {
+            p->message = DEH_String("You need a gold key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 153:
+    case 163:
+        if(!p->cards[key_SilverKey])
+        {
+            p->message = DEH_String("You need a silver key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 152:
+    case 162:
+        if(!p->cards[key_BrassKey])
+        {
+            p->message = DEH_String("You need a brass key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 167:
+    case 168:
+        if(!p->cards[key_SeveredHand])
+        {
+            p->message = DEH_String("Hand print not on file");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 171:
+        if(!p->cards[key_PrisonKey])
+        {
+            p->message = DEH_String("You don't have the key to the prison");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 172:
+        if(!p->cards[key_Power1Key])
+        {
+            p->message = DEH_String("You don't have the key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 173:
+        if(!p->cards[key_Power2Key])
+        {
+            p->message = DEH_String("You don't have the key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 176:
+        if(!p->cards[key_Power3Key])
+        {
+            p->message = DEH_String("You don't have the key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 189:
+        if(!p->cards[key_OracleKey])
+        {
+            p->message = DEH_String("You don't have the key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 191:
+        if(!p->cards[key_MilitaryID])
+        {
+            p->message = DEH_String("You don't have the key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 192:
+        if(!p->cards[key_WarehouseKey])
+        {
+            p->message = DEH_String("You don't have the key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+
+    case 223:
+        if(!p->cards[key_MineKey])
+        {
+            p->message = DEH_String("You don't have the key");
+            S_StartSound(NULL, sfx_oof);
+            return 0;
+        }
+        break;
+    }
+
     return EV_DoDoor(line,type);
 }
 
+
+//
+// EV_DoDoor
+//
 
 int EV_DoDoor(line_t* line, vldoor_e type)
 {