Browse Source

added shotgun cmenu, some other tweaks

Alison Watson 5 years ago
parent
commit
2d1a8bd2b0
10 changed files with 178 additions and 24 deletions
  1. 12
    4
      pk7/DECORATE.dec
  2. 14
    0
      pk7/TEXTURES.txt
  3. 15
    0
      pk7/acs/CWAtchMenu.h
  4. 10
    5
      pk7/acs/CWAttach.h
  5. 4
    0
      pk7/acs/CWGetVal.h
  6. 15
    0
      pk7/acs/CWKeyFinder.h
  7. 1
    1
      pk7/acs/CWLaser.h
  8. 35
    9
      pk7/acs/CWMain.c
  9. BIN
      pk7/acs/CWMain.o
  10. 72
    5
      pk7/actors/CShotgun.dec

+ 12
- 4
pk7/DECORATE.dec View File

@@ -1,5 +1,6 @@
1 1
 const int GV_PSTF1 = 1;
2 2
 const int GV_PSTF2 = 2;
3
+const int GV_SHTF1 = 3;
3 4
 
4 5
 DamageType NoDam
5 6
 {
@@ -19,18 +20,25 @@ actor CWeapon : Weapon
19 20
 #include "actors/CShotgun.dec"	// Shotgun
20 21
 
21 22
 actor dummy : Inventory {Inventory.MaxAmount 1}
23
+actor mod : dummy {Inventory.MaxAmount 2}
22 24
 
23 25
 // Attachments
26
+actor Laz : dummy {}
27
+actor LTrig : dummy {}
28
+
24 29
 actor PistolSil : dummy {}
25 30
 actor PistolLaz : dummy {}
26 31
 actor PistolLTrig : dummy {}
27
-actor Laz : dummy {}
28
-actor LTrig : dummy {}
29 32
 
30 33
 actor ShotgunSil : dummy {}
34
+actor ShotgunLaz : dummy {}
35
+actor ShotgunLTrig : dummy {}
36
+
31 37
 // Modifier items
32
-actor PistolFSpeedMod : dummy {Inventory.MaxAmount 2}
33
-actor PistolAccuracyMod : dummy {Inventory.MaxAmount 2}
38
+actor PistolFSpeedMod : mod {}
39
+actor PistolAccuracyMod : mod {}
40
+
41
+actor ShotgunFSpeedMod : mod {}
34 42
 
35 43
 // Action items
36 44
 actor CMenu : dummy {}

+ 14
- 0
pk7/TEXTURES.txt View File

@@ -70,4 +70,18 @@ Sprite SHTSD0, 320, 200
70 70
 	Patch SILENCR6, 29, 1
71 71
 	Patch SHTGD0, 0, 0
72 72
 	{UseOffsets}
73
+}
74
+
75
+Sprite SHTCA0, 320, 240
76
+{
77
+	Offset 0, 39
78
+	Patch SHTGC0, 0, 39
79
+	{UseOffsets}
80
+}
81
+
82
+Sprite SHTCB0, 320, 240
83
+{
84
+	Offset 0, 39
85
+	Patch SHTSC0, 0, 39
86
+	{UseOffsets}
73 87
 }

+ 15
- 0
pk7/acs/CWAtchMenu.h View File

@@ -22,6 +22,21 @@ script "CW_MENUOPEN" (int arg1)
22 22
 			HudMessage(s:"A"; HUDMSG_PLAIN|HUDMSG_ALPHA|HUDMSG_NOTWITHFULLMAP,69,0,CMenuX,CMenuY,1.0,1.0);
23 23
 		}
24 24
 	}
25
+	if(CheckWeapon("CShotgunCMenu"))
26
+	{
27
+		CMenuX = 185.0;
28
+		CMenuY = 106.0;
29
+		if(CheckInventory("ShotgunLaz"))
30
+		{
31
+			SetFont("CMENULAZ");
32
+			HudMessage(s:"A"; HUDMSG_PLAIN|HUDMSG_ALPHA|HUDMSG_NOTWITHFULLMAP,70,0,CMenuX,CMenuY,1.0,1.0);
33
+		}
34
+		if(CheckInventory("ShotgunLTrig"))
35
+		{
36
+			SetFont("CMENUTRG");
37
+			HudMessage(s:"A"; HUDMSG_PLAIN|HUDMSG_ALPHA|HUDMSG_NOTWITHFULLMAP,69,0,CMenuX,CMenuY,1.0,1.0);
38
+		}
39
+	}
25 40
 	if(CheckInventory("CMenuNext"))
26 41
 		SetFont("CMENU2");
27 42
 	else

+ 10
- 5
pk7/acs/CWAttach.h View File

@@ -17,15 +17,20 @@ script "CW_ATTACH" (int arg1)
17 17
 		SItmFunc("PistolLTrig", "PistolFSpeedMod");
18 18
 	break;
19 19
 	case CM_PISTL:
20
-		if(CheckWeapon("CPistol"))
21
-		{
22
-			GiveInventory("CPistolCMenu",1);
23
-			SetWeapon("CPistolCMenu");
24
-		}
20
+		CWepFunc("CPistol", "CPistolCMenu");
25 21
 	break;
26 22
 	case SHOG_SIL:
27 23
 		SWepFunc("ShotgunSil", "CShotgunToNorm", "CShotgunToSil");
28 24
 	break;
25
+	case SHOG_LAZ:
26
+		SItmFunc2("ShotgunLaz");
27
+	break;
28
+	case SHOG_TRG:
29
+		SItmFunc("ShotgunLTrig", "ShotgunFSpeedMod");
30
+	break;
31
+	case CM_SHTGN:
32
+		CWepFunc("CShotgun", "CShotgunCMenu");
33
+	break;
29 34
 	}
30 35
 }
31 36
 

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

@@ -4,6 +4,7 @@ script "CW_GETVAL" (int arg1)
4 4
 {
5 5
 	int pis_spdmod = CheckInventory("PistolFSpeedMod");
6 6
 	int pis_accmod = CheckInventory("PistolAccuracyMod");
7
+	int sht_spdmod = CheckInventory("ShotgunFSpeedMod");
7 8
 	switch(arg1)
8 9
 	{
9 10
 	default:
@@ -15,6 +16,9 @@ script "CW_GETVAL" (int arg1)
15 16
 	case GV_PSTF2:
16 17
 		SetResultValue(5-pis_accmod);
17 18
 	break;
19
+	case GV_SHTF1:
20
+		SetResultValue(3-sht_spdmod);
21
+	break;
18 22
 	}
19 23
 }
20 24
 

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

@@ -36,12 +36,27 @@ script "CW_KEYFIND" ENTER
36 36
 						ACS_NamedExecuteAlways("CW_ATTACH",0,PIST_LAZ);
37 37
 				}
38 38
 			}
39
+			if(CheckWeapon("CShotgunCMenu"))
40
+			{
41
+				if(CheckInventory("CMenuNext"))
42
+				{
43
+					if(CheckInventory("LTrig"))
44
+						ACS_NamedExecuteAlways("CW_ATTACH",0,SHOG_TRG);
45
+				}
46
+				else
47
+				{
48
+					if(CheckInventory("Laz"))
49
+						ACS_NamedExecuteAlways("CW_ATTACH",0,SHOG_LAZ);
50
+				}
51
+			}
39 52
 			delay(10);
40 53
 		}
41 54
 	break;
42 55
 	case BT_ZOOM:
43 56
 		if(CheckWeapon("CPistol"))
44 57
 			ACS_NamedExecuteAlways("CW_ATTACH",0,CM_PISTL);
58
+		if(CheckWeapon("CShotgun"))
59
+			ACS_NamedExecuteAlways("CW_ATTACH",0,CM_SHTGN);
45 60
 		
46 61
 		delay(10);
47 62
 	break;

+ 1
- 1
pk7/acs/CWLaser.h View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 script "CW_LASER" ENTER
4 4
 {
5
-	if(CheckInventory("PistolLaz") && CheckWeapon("CPistol"))
5
+	if((CheckInventory("PistolLaz") && CheckWeapon("CPistol")) || (CheckInventory("ShotgunLaz") && CheckWeapon("CShotgun")))
6 6
 	{
7 7
 		int a = GetActorAngle(0);
8 8
 		int p = GetActorPitch(0);

+ 35
- 9
pk7/acs/CWMain.c View File

@@ -1,17 +1,22 @@
1 1
 #library "CWMain"
2 2
 #include "zcommon.acs"
3 3
 
4
-#define PIST_SIL		1
5
-#define PIST_LAZ		2
6
-#define PIST_TRG		4
7
-#define CM_PISTL		8
8
-#define SHOG_SIL		16
4
+#define PIST_SIL	1
5
+#define PIST_LAZ	2
6
+#define PIST_TRG	3
7
+#define CM_PISTL	4
8
+#define SHOG_SIL	5
9
+#define SHOG_LAZ	6
10
+#define SHOG_TRG	7
11
+#define CM_SHTGN	8
9 12
 
10
-#define GV_PSTF1		1
11
-#define GV_PSTF2		2
13
+#define GV_PSTF1	1
14
+#define GV_PSTF2	2
15
+#define GV_SHTF1	3
12 16
 
13
-#define INT_MAX			0x7FFFFFFF
17
+#define INT_MAX		0x7FFFFFFF
14 18
 
19
+// All of these are for CWAttach.h
15 20
 function void SWepFunc (str arg1, str arg2, str arg3)
16 21
 {
17 22
 	if(CheckInventory(arg1))
@@ -40,7 +45,28 @@ function void SItmFunc (str arg1, str arg2)
40 45
 	}
41 46
 }
42 47
 
43
-#include "CWKeyFinder.h"	// Key press finder
48
+function void SItmFunc2 (str arg1)
49
+{
50
+	if(CheckInventory(arg1))
51
+	{
52
+		TakeInventory(arg1,1);
53
+	}
54
+	else
55
+	{
56
+		GiveInventory(arg1,1);
57
+	}
58
+}
59
+
60
+function void CWepFunc (str arg1, str arg2)
61
+{
62
+	if(CheckWeapon(arg1))
63
+	{
64
+		GiveInventory(arg2,1);
65
+		SetWeapon(arg2);
66
+	}
67
+}
68
+
69
+#include "CWKeyFinder.h"	// Key press thing
44 70
 #include "CWAttach.h"		// Attachment and detatchment
45 71
 #include "CWAtchMenu.h"		// Customization menu
46 72
 #include "CWGetVal.h"		// Value grabber

BIN
pk7/acs/CWMain.o View File


+ 72
- 5
pk7/actors/CShotgun.dec View File

@@ -39,7 +39,7 @@ actor CShotgun : CWeapon replaces Shotgun
39 39
 	// Fire //
40 40
 	Fire:
41 41
 		TNT1 A 0 A_JumpIfInventory("ShotgunSil",1,"SilFire")
42
-		SHTG A 3
42
+		SHTG A 9 A_SetTics(CallACS("CW_GETVAL",GV_PSTF1))
43 43
 		TNT1 A 0 A_AlertMonsters
44 44
 		TNT1 A 0 A_GunFlash
45 45
 		SHTG A 7 BRIGHT A_FireBullets(7,0,12,2,"BulletPuff")
@@ -51,9 +51,9 @@ actor CShotgun : CWeapon replaces Shotgun
51 51
 		SHTG A 7 A_Refire
52 52
 		goto Ready
53 53
 	SilFire:
54
-		SHTS A 3
55
-		TNT1 A 0 A_PlaySound("weapons/silpistol",1)
56
-		SHTS A 7 BRIGHT A_FireBullets(7,0,12,2,"BulletPuff")
54
+		SHTS A 9 A_SetTics(CallACS("CW_GETVAL",GV_PSTF1))
55
+		SHTS A 2 A_PlaySound("weapons/silpistol",1)
56
+		SHTS A 5 BRIGHT A_FireBullets(7,0,12,2,"BulletPuff")
57 57
 		SHTS B 5
58 58
 		SHTS C 5 A_PlaySound("weapons/shogupg",5)
59 59
 		SHTS D 4
@@ -110,4 +110,71 @@ actor CShotgunToNorm : CShotgunToSil
110 110
 		TNT1 A 0 A_TakeInventory("CShotgunToNorm")
111 111
 		stop
112 112
 	}
113
-}
113
+}
114
+
115
+actor CShotgunCMenu : Weapon
116
+{
117
+	+WEAPON.NOALERT
118
+	+WEAPON.CHEATNOTWEAPON
119
+	Tag "$CW_SHOTGN_WTAG"
120
+	States
121
+	{
122
+	// Select //
123
+	Select:
124
+		TNT1 A 0 A_GiveInventory("DNS")
125
+		TNT1 A 0 A_JumpIfInventory("ShotgunSil",1,1)
126
+		goto SelectLoop
127
+	SilSelect:
128
+		TNT1 B 0
129
+	SelectLoop:
130
+		TNT1 "#" 0 A_Raise
131
+		SHTC "#" 1 A_Raise
132
+		loop
133
+	
134
+	Deselect:
135
+		TNT1 A 0 A_GiveInventory("DNS")
136
+		TNT1 A 0 A_JumpIfInventory("ShotgunSil",1,1)
137
+		goto DeselectLoop
138
+	SilDeselect:
139
+		TNT1 B 0
140
+	DeselectLoop:
141
+		TNT1 "#" 0 A_Lower
142
+		SHTC "#" 1 A_Lower
143
+		loop
144
+	
145
+	// Ready //
146
+	Ready:
147
+		TNT1 "#" 0 A_GiveInventory("CMenu")
148
+		TNT1 "#" 0 ACS_NamedExecute("CW_MENUOPEN",0)
149
+		SHTC "#" 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_NOSWITCH)
150
+		wait
151
+	Zoom:
152
+		TNT1 "#" 0 A_TakeInventory("CMenu")
153
+		TNT1 "#" 0 ACS_NamedExecute("CW_MENUCLOSE",0)
154
+		TNT1 "#" 0 A_Lower
155
+		SHTC "#" 1 A_Lower
156
+		TNT1 "#" 0 A_Lower
157
+		SHTC "#" 1 A_Lower
158
+		TNT1 "#" 0 A_Lower
159
+		SHTC "#" 1 A_Lower
160
+		TNT1 "#" 0 A_Lower
161
+		SHTC "#" 1 A_Lower
162
+		TNT1 "#" 0 A_Lower
163
+		SHTC "#" 1 A_Lower
164
+		TNT1 "#" 0 A_SelectWeapon("CShotgun")
165
+		TNT1 "#" 0 A_TakeInventory("CShotgunCMenu")
166
+		stop
167
+	
168
+	// Fire //
169
+	Fire:
170
+		TNT1 "#" 0 A_JumpIfInventory("CMenuNext",1,"Fire2")
171
+		TNT1 "#" 0 A_GiveInventory("CMenuNext")
172
+		SHTC "#" 13 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
173
+		goto Ready
174
+	Fire2:
175
+		TNT1 "#" 0 A_TakeInventory("CMenuNext")
176
+		SHTC "#" 13 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
177
+		goto Ready
178
+	}
179
+}
180
+

Loading…
Cancel
Save