Browse Source

made the whole attachment menu more moddable, some graphical changes, maybe 1.4.2?

Alison Watson 5 years ago
parent
commit
c894722390

+ 2
- 1
CREDITS.txt View File

@@ -1,3 +1,4 @@
1 1
 Credits:
2 2
 	JoeyTD for the silencer sprites
3
-	Bloax for the pistol customization sprite
3
+	Bloax for the pistol customization sprite
4
+	Kyle873 for some ACS functions

+ 4
- 25
pk7/DECORATE.dec View File

@@ -2,10 +2,7 @@ const int GV_PSTF1 = 1;
2 2
 const int GV_PSTF2 = 2;
3 3
 const int GV_SHTF1 = 3;
4 4
 
5
-DamageType NoDam
6
-{
7
-	Factor 0
8
-}
5
+DamageType NoDam {Factor 0}
9 6
 
10 7
 actor CWeapon : Weapon
11 8
 {
@@ -24,27 +21,9 @@ actor dummy : Inventory {Inventory.MaxAmount 1}
24 21
 actor mod : dummy {Inventory.MaxAmount 2}
25 22
 
26 23
 // Attachments
27
-actor Laz : dummy
28
-{
29
-	Inventory.PickupMessage "Picked up a Laser Sight"
30
-	States
31
-	{
32
-	Spawn:
33
-		BOXX A -1
34
-		wait
35
-	}
36
-}
37
-
38
-actor LTrig : dummy
39
-{
40
-	Inventory.PickupMessage "Picked up a Light Trigger."
41
-	States
42
-	{
43
-	Spawn:
44
-		BOXX A -1
45
-		wait
46
-	}
47
-}
24
+actor atch : dummy {States {Spawn: BOXX A -1 A_RailWait wait}}
25
+actor Laz : atch {Inventory.PickupMessage "Picked up a Laser Sight"}
26
+actor LTrig : atch {Inventory.PickupMessage "Picked up a Light Trigger"}
48 27
 
49 28
 actor BlurReplacer : RandomSpawner replaces BlurSphere
50 29
 {

+ 39
- 35
pk7/acs/CWAtchMenu.h View File

@@ -2,59 +2,63 @@
2 2
 
3 3
 script "CW_MENUOPEN" (int arg1)
4 4
 {
5
+	/* id index
6
+	 * 67 - how to use text
7
+	 * 68 - selected box
8
+	 * 69 - attachment 1
9
+	 * 70 - attachment 2
10
+	 * 71 - c-menu
11
+	 */
5 12
 	SetHudSize(320,200,0);
6 13
 	SetFont("DBIGFONT");
7
-	HudMessage(s:"Reload:Attach\nFire:Switch"; HUDMSG_PLAIN,60,0,160.0,15.0,1.0,1.0);
8
-	int CMenuX;
9
-	int CMenuY;
10
-	if(CheckWeapon("CPistolCMenu"))
14
+	HudMessage(s:"Reload:Attach\nFire:Switch"; 0,67,0,160.0,15.0,1.0);
15
+	int CMenuX, CMenuY, wep1;
16
+	
17
+	switch(arg1)
11 18
 	{
19
+	case 1: // PISTOL
20
+		wep1 = 0x10;
12 21
 		CMenuX = 185.0;
13 22
 		CMenuY = 106.0;
14 23
 		if(CheckInventory("PistolLaz"))
15
-		{
16
-			SetFont("CMENULAZ");
17
-			HudMessage(s:"A"; HUDMSG_PLAIN|HUDMSG_ALPHA|HUDMSG_NOTWITHFULLMAP,70,0,CMenuX,CMenuY,1.0,1.0);
18
-		}
24
+			SprPrint("CMENULAZ", 70, CMenuX, CMenuY);
19 25
 		if(CheckInventory("PistolLTrig"))
20
-		{
21
-			SetFont("CMENUTRG");
22
-			HudMessage(s:"A"; HUDMSG_PLAIN|HUDMSG_ALPHA|HUDMSG_NOTWITHFULLMAP,69,0,CMenuX,CMenuY,1.0,1.0);
23
-		}
24
-	}
25
-	if(CheckWeapon("CShotgunCMenu"))
26
-	{
26
+			SprPrint("CMENUTRG", 69, CMenuX, CMenuY);
27
+	break;
28
+	case 2: // SHOTGUN
29
+		wep1 = 0x20;
27 30
 		CMenuX = 128.0;
28 31
 		CMenuY = 102.0;
29 32
 		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
-		}
33
+			SprPrint("CMENULAZ", 70, CMenuX, CMenuY);
34 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
-		}
35
+			SprPrint("CMENUTRG", 69, CMenuX, CMenuY);
36
+	break;
37
+	}
38
+	
39
+	switch(CheckInventory("CMenuNext") + wep1)
40
+	{
41
+	// Offsets are 7 apart
42
+	case 0x20:
43
+	case 0x10:
44
+		SprPrint("CMENU2", 68, CMenuX-1.0, CMenuY-30.0);
45
+	break;
46
+	case 0x21:
47
+	case 0x11:
48
+		SprPrint("CMENU2", 68, CMenuX-1.0, CMenuY-23.0);
49
+	break;
39 50
 	}
40
-	if(CheckInventory("CMenuNext"))
41
-		SetFont("CMENU2");
42
-	else
43
-		SetFont("CMENU1");
44 51
 	
45
-	HudMessage(s:"A"; HUDMSG_PLAIN|HUDMSG_ALPHA|HUDMSG_NOTWITHFULLMAP,71,0,CMenuX,CMenuY,1.0,1.0);
52
+	SprPrint("CMENU1", 71, CMenuX, CMenuY);
46 53
 	delay(2);
47
-	HudMessage(s:""; 0,70,0,0,0,0);
48
-	HudMessage(s:""; 0,69,0,0,0,0);
54
+	ClearMsg(70); ClearMsg(69);
49 55
 	restart;
50 56
 }
51 57
 
52
-script "CW_MENUCLOSE"(int arg1)
58
+script "CW_MENUCLOSE" (void)
53 59
 {
54 60
 	ACS_NamedTerminate("CW_MENUOPEN",0);
55
-	HudMessage(s:""; 0,71,0,0,0,0);
56
-	HudMessage(s:""; 0,70,0,0,0,0);
57
-	HudMessage(s:""; 0,69,0,0,0,0);
58
-	HudMessage(s:""; 0,60,0,0,0,0);
61
+	for(int i = 67; i < 72; i++)
62
+		ClearMsg(i);
59 63
 }
60 64
 

+ 18
- 0
pk7/acs/CWMain.c View File

@@ -66,6 +66,24 @@ function void CWepFunc (str arg1, str arg2)
66 66
 	}
67 67
 }
68 68
 
69
+// Useful functions
70
+function void SprPrint(str sprite, int id, int x, int y)
71
+{
72
+	SetFont(sprite);
73
+	HudMessage(s:"A"; HUDMSG_PLAIN, id, CR_UNTRANSLATED, x, y, 1.0);
74
+}
75
+
76
+function void SprPrintFade(str sprite, int id, int x, int y, int d, int h)
77
+{
78
+	SetFont(sprite);
79
+	HudMessage(s:"A"; HUDMSG_FADEOUT, id, CR_UNTRANSLATED, x, y, d, h);
80
+}
81
+
82
+function void ClearMsg(int id)
83
+{
84
+	HudMessage(s:""; 0,id,0,0,0,0);
85
+}
86
+
69 87
 #include "CWKeyFinder.h"	// Key press thing
70 88
 #include "CWAttach.h"		// Attachment and detatchment
71 89
 #include "CWAtchMenu.h"		// Customization menu

BIN
pk7/acs/CWMain.o View File


+ 10
- 3
pk7/actors/CPistol.dec View File

@@ -59,8 +59,15 @@ actor CPistol : CWeapon replaces Pistol
59 59
 		goto Ready
60 60
 	
61 61
 	Flash:
62
-		PISF Z 1 A_PlaySound("weapons/pistol",1)
63
-		PISF Z 3 A_Light2
62
+		TNT1 A 0 A_SetBlend("99 00 00", 0.05, 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)
64 71
 		goto LightDone
65 72
 	}
66 73
 }
@@ -140,7 +147,7 @@ actor CPistolCMenu : Weapon
140 147
 	// Ready //
141 148
 	Ready:
142 149
 		TNT1 "#" 0 A_GiveInventory("CMenu")
143
-		TNT1 "#" 0 ACS_NamedExecute("CW_MENUOPEN",0)
150
+		TNT1 "#" 0 ACS_NamedExecute("CW_MENUOPEN",0,1)
144 151
 		PISC "#" 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_NOSWITCH)
145 152
 		wait
146 153
 	Zoom:

+ 1
- 1
pk7/actors/CShotgun.dec View File

@@ -150,7 +150,7 @@ actor CShotgunCMenu : Weapon
150 150
 	// Ready //
151 151
 	Ready:
152 152
 		TNT1 "#" 0 A_GiveInventory("CMenu")
153
-		TNT1 "#" 0 ACS_NamedExecute("CW_MENUOPEN",0)
153
+		TNT1 "#" 0 ACS_NamedExecute("CW_MENUOPEN",0,2)
154 154
 		SHTC "#" 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_NOSWITCH)
155 155
 		wait
156 156
 	Zoom:

BIN
pk7/graphics/CMENU1.png View File


BIN
pk7/graphics/CMENU2.png View File


BIN
pk7/graphics/CMENU3.png View File


BIN
pk7/graphics/CMENULAZ.png View File


BIN
pk7/graphics/CMENUTRG.png View File


Loading…
Cancel
Save