1 /*
2 #include "actor.h"
3 #include "m_random.h"
4 #include "a_action.h"
5 #include "p_local.h"
6 #include "p_enemy.h"
7 #include "s_sound.h"
8 #include "a_strifeglobal.h"
9 #include "doomdata.h"
10 #include "thingdef/thingdef.h"
11 #include "doomstat.h"
12 */
13 
14 //============================================================================
15 //
16 // A_HideDecepticon
17 //
18 // Hide the Acolyte-to-be							->
19 // Hide the guy transforming into an Acolyte		->
20 // Hide the transformer								->
21 // Transformers are Autobots and Decepticons, and
22 // Decepticons are the bad guys, so...				->
23 //
24 // Hide the Decepticon!
25 //
26 //============================================================================
27 
DEFINE_ACTION_FUNCTION(AActor,A_HideDecepticon)28 DEFINE_ACTION_FUNCTION(AActor, A_HideDecepticon)
29 {
30 	EV_DoDoor (DDoor::doorClose, NULL, self, 999, 8*FRACUNIT, 0, 0, 0);
31 	if (self->target != NULL && self->target->player != NULL)
32 	{
33 		P_NoiseAlert (self->target, self);
34 	}
35 }
36 
37 //============================================================================
38 //
39 // A_AcolyteDie
40 //
41 //============================================================================
42 
DEFINE_ACTION_FUNCTION(AActor,A_AcolyteDie)43 DEFINE_ACTION_FUNCTION(AActor, A_AcolyteDie)
44 {
45 	int i;
46 
47 	// [RH] Disable translucency here.
48 	self->RenderStyle = STYLE_Normal;
49 
50 	// Only the Blue Acolyte does extra stuff on death.
51 	if (self->GetClass()->TypeName != NAME_AcolyteBlue)
52 		return;
53 
54 	// Make sure somebody is still alive
55 	for (i = 0; i < MAXPLAYERS; ++i)
56 	{
57 		if (playeringame[i] && players[i].health > 0)
58 			break;
59 	}
60 	if (i == MAXPLAYERS)
61 		return;
62 
63 	// Make sure all the other blue acolytes are dead.
64 	TThinkerIterator<AActor> iterator(NAME_AcolyteBlue);
65 	AActor *other;
66 
67 	while ( (other = iterator.Next ()) )
68 	{
69 		if (other != self && other->health > 0)
70 		{ // Found a living one
71 			return;
72 		}
73 	}
74 
75 	players[i].mo->GiveInventoryType (QuestItemClasses[6]);
76 	players[i].SetLogNumber (14);
77 	S_StopSound (CHAN_VOICE);
78 	S_Sound (CHAN_VOICE, "svox/voc14", 1, ATTN_NORM);
79 }
80 
81 //============================================================================
82 //
83 // A_BeShadowyFoe
84 //
85 //============================================================================
86 
DEFINE_ACTION_FUNCTION(AActor,A_BeShadowyFoe)87 DEFINE_ACTION_FUNCTION(AActor, A_BeShadowyFoe)
88 {
89 	self->RenderStyle = STYLE_Translucent;
90 	self->alpha = HR_SHADOW;
91 	self->flags &= ~MF_FRIENDLY;
92 }
93 
94 //============================================================================
95 //
96 // A_AcolyteBits
97 //
98 //============================================================================
99 
DEFINE_ACTION_FUNCTION(AActor,A_AcolyteBits)100 DEFINE_ACTION_FUNCTION(AActor, A_AcolyteBits)
101 {
102 	if (self->SpawnFlags & MTF_SHADOW)
103 	{
104 		CALL_ACTION(A_BeShadowyFoe, self);
105 	}
106 	if (self->SpawnFlags & MTF_ALTSHADOW)
107 	{
108 		//self->flags |= MF_STRIFEx8000000;
109 		if (self->flags & MF_SHADOW)
110 		{
111 			// I dunno.
112 		}
113 		else
114 		{
115 			self->RenderStyle.BlendOp = STYLEOP_None;
116 		}
117 	}
118 }
119