Browse Source

yet another attachment code overhaul, some graphics edits, added a new attachment for the shotgun

Alison Watson 5 years ago
parent
commit
61337dd24a

+ 9
- 2
pk7/DECORATE.dec View File

@@ -1,6 +1,7 @@
1 1
 const int GV_PSTF1 = 1;
2 2
 const int GV_PSTF2 = 2;
3 3
 const int GV_SHTF1 = 3;
4
+const int GV_SHTP1 = 4;
4 5
 
5 6
 DamageType NoDam {Factor 0}
6 7
 
@@ -22,12 +23,16 @@ actor mod : dummy {Inventory.MaxAmount 2}
22 23
 
23 24
 /* TO - DO:
24 25
  * Bayonet
25
- * Explosive Ammo
26
+ * Explosive ammo
26 27
  * Better silencer for the shotgun
28
+ * "ACOG" scope2
29
+ * Improved pump mechanism
30
+ * Make the laser sight alert monsters, give it a trail, and make it toggle
27 31
  */
28 32
 // Attachments
29 33
 actor Laz : dummy {}
30 34
 actor LTrig : dummy {}
35
+actor PumpMech : dummy {}
31 36
 
32 37
 actor Attachment : CustomInventory replaces BlurSphere
33 38
 {
@@ -56,6 +61,7 @@ actor PistolLTrig : dummy {}
56 61
 
57 62
 actor ShotgunSil : dummy {}
58 63
 actor ShotgunLaz : dummy {}
64
+actor ShotgunPump : dummy {}
59 65
 actor ShotgunLTrig : dummy {}
60 66
 
61 67
 // Modifier items
@@ -63,11 +69,12 @@ actor PistolFSpeedMod : mod {}
63 69
 actor PistolAccuracyMod : mod {}
64 70
 
65 71
 actor ShotgunFSpeedMod : mod {}
72
+actor ShotgunPSpeedMod : mod {}
66 73
 
67 74
 // Action items
68 75
 actor CMenu : dummy {}
69 76
 actor DNS : dummy {}
70
-actor CMenuNext : dummy {}
77
+actor CMenuNext : mod {}
71 78
 
72 79
 actor LaserPointer : BulletPuff
73 80
 {

+ 37
- 67
pk7/acs/CWAtchMenu.h View File

@@ -1,20 +1,16 @@
1 1
 #library "CWAtchMenu"
2 2
 
3
-str atchnames[2][2] =
4
-{
5
-	{"PistolLTrig", "ShotgunLTrig"},
6
-	{"PistolLaz", "ShotgunLaz"},
7
-};
8
-
9 3
 script "CW_MENUOPEN" (int arg1)
10 4
 {
11 5
 	/* id index
12
-	 * 65 - active attachment 2
13
-	 * 66 - active attachment 1
14
-	 * 67 - how to use text
15
-	 * 68 - selected box
16
-	 * 69 - attachment 1
17
-	 * 70 - attachment 2
6
+	 * 30 - selected box
7
+	 * 31 - attachment 1
8
+	 * 32 - attachment 2
9
+	 * 33 - attachment 3
10
+	 * 44 - active attachment 1
11
+	 * 45 - active attachment 2
12
+	 * 46 - active attachment 3
13
+	 * 68 - how to use text
18 14
 	 * 71 - c-menu
19 15
 	 */
20 16
 	
@@ -23,21 +19,13 @@ script "CW_MENUOPEN" (int arg1)
23 19
 	HudMessage(s:"Reload:Attach\nFire:Switch"; 0,67,0,160.0,15.0,1.0);
24 20
 	int CMenuX, CMenuY, wep1;
25 21
 	int atch1 = 0;
26
-	int atch2 = 0;
27 22
 	
28
-	if(CheckInventory("Laz"))
29
-		atch1 = 0x10;
30 23
 	if(CheckInventory("LTrig"))
24
+		atch1 = 0x10;
25
+	if(CheckInventory("Laz"))
31 26
 		atch1 = atch1 + 0x20;
32
-	for(int i1 = 0; i1 < 1; i1++)
33
-		if(CheckInventory(atchnames[0][i1])&&!CheckInventory(atchnames[1][i1]))
34
-			atch2 = 0x10000;
35
-	for(int i2 = 0; i2 < 1; i2++)
36
-		if(CheckInventory(atchnames[1][i2])&&!CheckInventory(atchnames[0][i2]))
37
-			atch2 = 0x20000;
38
-	for(int i3 = 0; i3 < 1; i3++)
39
-		if(CheckInventory(atchnames[0][i3])&&CheckInventory(atchnames[1][i3]))
40
-			atch2 = 0x30000;
27
+	if(CheckInventory("PumpMech"))
28
+		atch1 = atch1 + 0x40;
41 29
 	
42 30
 	switch(arg1)
43 31
 	{
@@ -46,59 +34,42 @@ script "CW_MENUOPEN" (int arg1)
46 34
 		CMenuX = 185.0;
47 35
 		CMenuY = 106.0;
48 36
 		if(atch1 & 0x10)
49
-			SprPrint("CMENULAZ", 70, CMenuX, CMenuY);
37
+			SprPrint("CMENUTRG", 31, CMenuX, CMenuY);
50 38
 		if(atch1 & 0x20)
51
-			SprPrint("CMENUTRG", 69, CMenuX, CMenuY);
39
+			SprPrint("CMENULAZ", 32, CMenuX, CMenuY);
40
+		
41
+		if(CheckInventory("PistolLTrig"))
42
+			SprPrint("CMENU3", 44, CMenuX-1.0, CMenuY-30.0);
43
+		if(CheckInventory("PistolLaz"))
44
+			SprPrint("CMENU3", 45, CMenuX-1.0, CMenuY-23.0);
52 45
 	break;
53 46
 	
54 47
 	case 2: // SHOTGUN
55 48
 		wep1 = 0x20;
56 49
 		CMenuX = 128.0;
57 50
 		CMenuY = 102.0;
51
+		
58 52
 		if(atch1 & 0x10)
59
-			SprPrint("CMENULAZ", 70, CMenuX, CMenuY);
53
+			SprPrint("CMENUTRG", 31, CMenuX, CMenuY);
60 54
 		if(atch1 & 0x20)
61
-			SprPrint("CMENUTRG", 69, CMenuX, CMenuY);
62
-	break;
63
-	}
64
-	
65
-	switch(CheckInventory("CMenuNext") + wep1 + atch2)
66
-	{
67
-	// Offsets are 7 apart
68
-	case 0x10020:
69
-	case 0x10010:
70
-	case 0x20:
71
-	case 0x10:
72
-		SprPrint("CMENU2", 68, CMenuX-1.0, CMenuY-30.0);
73
-	break;
74
-	
75
-	case 0x20021:
76
-	case 0x20011:
77
-	case 0x21:
78
-	case 0x11:
79
-		SprPrint("CMENU2", 68, CMenuX-1.0, CMenuY-23.0);
80
-	break;
81
-	
82
-	case 0x30021:
83
-	case 0x30011:
84
-	case 0x10021:
85
-	case 0x10011:
86
-		SprPrint("CMENU3", 66, CMenuX-1.0, CMenuY-30.0);
87
-		SprPrint("CMENU2", 68, CMenuX-1.0, CMenuY-23.0);
88
-	break;
89
-	
90
-	case 0x30020:
91
-	case 0x30010:
92
-	case 0x20020:
93
-	case 0x20010:
94
-		SprPrint("CMENU2", 68, CMenuX-1.0, CMenuY-30.0);
95
-		SprPrint("CMENU3", 65, CMenuX-1.0, CMenuY-23.0);
55
+			SprPrint("CMENULAZ", 32, CMenuX, CMenuY);
56
+		if(atch1 & 0x40)
57
+			SprPrint("CMENUPMP", 33, CMenuX, CMenuY);
58
+		
59
+		if(CheckInventory("ShotgunLTrig"))
60
+			SprPrint("CMENU3", 44, CMenuX-1.0, CMenuY-30.0);
61
+		if(CheckInventory("ShotgunLaz"))
62
+			SprPrint("CMENU3", 45, CMenuX-1.0, CMenuY-23.0);
63
+		if(CheckInventory("ShotgunPump"))
64
+			SprPrint("CMENU3", 46, CMenuX-1.0, CMenuY-16.0);
96 65
 	break;
97 66
 	}
98 67
 	
68
+	int CMenu2Y = CMenuY - (30.0 - (7.0 * CheckInventory("CMenuNext")));
69
+	SprPrint("CMENU2", 30, CMenuX-1.0, CMenu2Y);
99 70
 	SprPrint("CMENU1", 71, CMenuX, CMenuY);
100
-	delay(2);
101
-	for(int i = 65; i < 71; i++)
71
+	delay(1);
72
+	for(int i = 30; i < 71; i++)
102 73
 		ClearMsg(i);
103 74
 	restart;
104 75
 }
@@ -106,7 +77,6 @@ script "CW_MENUOPEN" (int arg1)
106 77
 script "CW_MENUCLOSE" (void)
107 78
 {
108 79
 	ACS_NamedTerminate("CW_MENUOPEN",0);
109
-	for(int i = 65; i < 72; i++)
80
+	for(int i = 30; i < 72; i++)
110 81
 		ClearMsg(i);
111
-}
112
-
82
+}

+ 3
- 0
pk7/acs/CWAttach.h View File

@@ -28,6 +28,9 @@ script "CW_ATTACH" (int arg1)
28 28
 	case SHOG_TRG:
29 29
 		SItmFunc("ShotgunLTrig", "ShotgunFSpeedMod");
30 30
 	break;
31
+	case SHOG_PMP:
32
+		SItmFunc("ShotgunPump", "ShotgunPSpeedMod");
33
+	break;
31 34
 	case CM_SHTGN:
32 35
 		CWepFunc("CShotgun", "CShotgunCMenu");
33 36
 	break;

+ 4
- 0
pk7/acs/CWGetVal.h View File

@@ -5,6 +5,7 @@ script "CW_GETVAL" (int arg1)
5 5
 	int pis_spdmod = CheckInventory("PistolFSpeedMod");
6 6
 	int pis_accmod = CheckInventory("PistolAccuracyMod");
7 7
 	int sht_spdmod = CheckInventory("ShotgunFSpeedMod");
8
+	int sht_sp2mod = CheckInventory("ShotgunPSpeedMod");
8 9
 	switch(arg1)
9 10
 	{
10 11
 	default:
@@ -19,6 +20,9 @@ script "CW_GETVAL" (int arg1)
19 20
 	case GV_SHTF1:
20 21
 		SetResultValue(3-sht_spdmod);
21 22
 	break;
23
+	case GV_SHTP1:
24
+		SetResultValue(5-sht_sp2mod);
25
+	break;
22 26
 	}
23 27
 }
24 28
 

+ 4
- 0
pk7/acs/CWKeyFinder.h View File

@@ -49,6 +49,10 @@ script "CW_KEYFIND" ENTER
49 49
 					if(CheckInventory("Laz"))
50 50
 						ACS_NamedExecuteAlways("CW_ATTACH",0,SHOG_LAZ);
51 51
 				break;
52
+				case 2:
53
+					if(CheckInventory("PumpMech"))
54
+						ACS_NamedExecuteAlways("CW_ATTACH",0,SHOG_PMP);
55
+				break;
52 56
 				}
53 57
 			}
54 58
 			delay(10);

+ 4
- 1
pk7/acs/CWMain.c View File

@@ -5,14 +5,17 @@
5 5
 #define PIST_LAZ	2
6 6
 #define PIST_TRG	3
7 7
 #define CM_PISTL	4
8
+
8 9
 #define SHOG_SIL	5
9 10
 #define SHOG_LAZ	6
10 11
 #define SHOG_TRG	7
11
-#define CM_SHTGN	8
12
+#define SHOG_PMP	8
13
+#define CM_SHTGN	9
12 14
 
13 15
 #define GV_PSTF1	1
14 16
 #define GV_PSTF2	2
15 17
 #define GV_SHTF1	3
18
+#define GV_SHTP1	4
16 19
 
17 20
 #define INT_MAX		0x7FFFFFFF
18 21
 

BIN
pk7/acs/CWMain.o View File


+ 18
- 11
pk7/actors/CPistol.dec View File

@@ -45,29 +45,36 @@ actor CPistol : CWeapon replaces Pistol
45 45
 		TNT1 A 0 A_JumpIfInventory("PistolSil",1,"SilFire")
46 46
 		PISG A 9 A_SetTics(CallACS("CW_GETVAL",GV_PSTF1))
47 47
 		TNT1 A 0 A_AlertMonsters
48
-		TNT1 A 0 A_GunFlash
48
+		TNT1 A 0 A_GunFlash("Flash2")
49
+		TNT1 A 0 A_PlaySound("weapons/pistol",1)
49 50
 		PISG A 4 BRIGHT A_FireBullets(CallACS("CW_GETVAL",GV_PSTF2),0,1,5,"BulletPuff")
50 51
 		PISG DC 3
51 52
 		PISG A 5 A_Refire
52 53
 		goto Ready
53 54
 	SilFire:
54 55
 		PISS A 9 A_SetTics(CallACS("CW_GETVAL",GV_PSTF1))
55
-		PISS A 2 A_PlaySound("weapons/silpistol",1)
56
-		PISS A 2 A_FireBullets(CallACS("CW_GETVAL",GV_PSTF2),0,1,4,"BulletPuff")
56
+		TNT1 A 0 A_GunFlash
57
+		TNT1 A 0 A_PlaySound("weapons/silpistol",1)
58
+		PISS A 4 A_FireBullets(CallACS("CW_GETVAL",GV_PSTF2),0,1,4,"BulletPuff")
57 59
 		PISS DC 3
58 60
 		PISS A 5 A_Refire
59 61
 		goto Ready
60 62
 	
61 63
 	Flash:
64
+		TNT1 A 0 A_Quake(1, 2, 0, 16, "")
65
+		TNT1 A 1 A_SetPitch(pitch-0.1)
66
+		TNT1 A 1 A_SetPitch(pitch-0.2)
67
+		TNT1 A 1 A_SetPitch(pitch-0.1)
68
+		TNT1 A 2 A_SetPitch(pitch+0.4)
69
+		stop
70
+	Flash2:
71
+		TNT1 A 0 A_Quake(1, 2, 0, 16, "")
62 72
 		TNT1 A 0 A_SetBlend("99 00 00", 0.02, 4)
63
-		TNT1 A 0 A_SetPitch(pitch-0.5)
64
-		PISF Z 1 A_PlaySound
65
-		TNT1 A 0 A_SetPitch(pitch-0.5)
66
-		PISF Z 1 A_Light(3)
67
-		TNT1 A 0 A_SetPitch(pitch+0.5)
68
-		PISF Z 1 A_Light(2)
69
-		TNT1 A 0 A_SetPitch(pitch+0.5)
70
-		PISF Z 1 A_Light(1)
73
+		TNT1 A 0 A_SetPitch(pitch-0.1)
74
+		PISF Z 1 BRIGHT A_Light2
75
+		PISF Z 1 BRIGHT A_SetPitch(pitch-0.2)
76
+		TNT1 A 0 A_SetPitch(pitch+0.4)
77
+		PISF Z 2 BRIGHT A_Light1
71 78
 		goto LightDone
72 79
 	}
73 80
 }

+ 25
- 12
pk7/actors/CShotgun.dec View File

@@ -46,7 +46,8 @@ actor CShotgun : CWeapon replaces Shotgun
46 46
 		TNT1 A 0 A_JumpIfInventory("ShotgunSil",1,"SilFire")
47 47
 		SHTG A 9 A_SetTics(CallACS("CW_GETVAL",GV_PSTF1))
48 48
 		TNT1 A 0 A_AlertMonsters
49
-		TNT1 A 0 A_GunFlash
49
+		TNT1 A 0 A_GunFlash("Flash2")
50
+		TNT1 A 0 A_PlaySound("weapons/shotty",1)
50 51
 		SHTG A 7 BRIGHT A_FireBullets(5.6,0,7,5,"BulletPuff")
51 52
 		SHTG B 5
52 53
 		SHTG C 5 A_PlaySound("weapons/shogupg",5)
@@ -57,26 +58,37 @@ actor CShotgun : CWeapon replaces Shotgun
57 58
 		goto Ready
58 59
 	SilFire:
59 60
 		SHTS A 9 A_SetTics(CallACS("CW_GETVAL",GV_PSTF1))
60
-		SHTS A 2 A_PlaySound("weapons/silpistol",1)
61
-		SHTS A 5 BRIGHT A_FireBullets(5.6,0,7,4,"BulletPuff")
61
+		TNT1 A 0 A_GunFlash
62
+		TNT1 A 0 A_PlaySound("weapons/silpistol",1)
63
+		SHTS A 7 BRIGHT A_FireBullets(5.6,0,7,4,"BulletPuff")
62 64
 		SHTS B 5
63 65
 		SHTS C 5 A_PlaySound("weapons/shogupg",5)
64 66
 		SHTS D 4
65
-		SHTS CB 5
67
+		SHTS CB 9 A_SetTics(CallACS("CW_GETVAL",GV_SHTP1))
66 68
 		SHTS A 3
67 69
 		SHTS A 7 A_Refire
68 70
 		goto Ready
69 71
 	
70 72
 	Flash:
73
+		TNT1 A 0 A_Quake(2, 4, 0, 16, "")
74
+		TNT1 A 1 A_SetPitch(pitch-0.6)
75
+		TNT1 A 1 A_SetPitch(pitch-0.6)
76
+		TNT1 A 1 A_SetPitch(pitch-0.6)
77
+		TNT1 A 1 A_SetPitch(pitch+0.6)
78
+		TNT1 A 1 A_SetPitch(pitch+0.6)
79
+		TNT1 A 1 A_SetPitch(pitch+0.6)
80
+		stop
81
+	Flash2:
82
+		TNT1 A 0 A_Quake(2, 4, 0, 16, "")
71 83
 		TNT1 A 0 A_SetBlend("99 00 00", 0.02, 4)
72
-		TNT1 A 0 A_SetPitch(pitch-0.6)
73
-		SHTF A 1 A_PlaySound("weapons/shotty",1)
74
-		TNT1 A 0 A_SetPitch(pitch-0.6)
75
-		SHTF A 1 A_Light(3)
76
-		TNT1 A 0 A_SetPitch(pitch+0.6)
77
-		SHTF B 1 A_Light(2)
84
+		SHTF A 1 BRIGHT A_Light2
85
+		SHTF A 1 BRIGHT A_SetPitch(pitch-0.6)
86
+		SHTF A 1 BRIGHT A_SetPitch(pitch-0.6)
87
+		SHTF A 1 BRIGHT A_SetPitch(pitch-0.6)
78 88
 		TNT1 A 0 A_SetPitch(pitch+0.6)
79
-		SHTF B 1 A_Light(1)
89
+		SHTF B 1 BRIGHT A_Light1
90
+		SHTF B 1 BRIGHT A_SetPitch(pitch+0.6)
91
+		SHTF B 1 BRIGHT A_SetPitch(pitch+0.6)
80 92
 		goto LightDone
81 93
 	}
82 94
 }
@@ -143,6 +155,7 @@ actor CShotgunCMenu : Weapon
143 155
 		loop
144 156
 	
145 157
 	Deselect:
158
+		TNT1 A 0 A_Print("This shouldn't be printed. Please report this.")
146 159
 		TNT1 A 0 A_GiveInventory("DNS")
147 160
 		TNT1 A 0 A_JumpIfInventory("ShotgunSil",1,1)
148 161
 		goto DeselectLoop
@@ -178,7 +191,7 @@ actor CShotgunCMenu : Weapon
178 191
 	
179 192
 	// Fire //
180 193
 	Fire:
181
-		TNT1 "#" 0 A_JumpIfInventory("CMenuNext",1,"Fire2")
194
+		TNT1 "#" 0 A_JumpIfInventory("CMenuNext",2,"Fire2")
182 195
 		TNT1 "#" 0 A_GiveInventory("CMenuNext")
183 196
 		SHTC "#" 13 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
184 197
 		goto Ready

BIN
pk7/graphics/CMENULAZ.png View File


BIN
pk7/graphics/CMENUPMP.png View File


BIN
pk7/graphics/CMENUTRG.png View File


Loading…
Cancel
Save