convert line ends
[canaan.git] / prj / cam / src / shock / shkaicmd.cpp
blob4c77f2aa2cf8478f3448fb345faf251316a514df
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 ///////////////////////////////////////////////////////////////////////////////
7 // $Header: r:/t2repos/thief2/src/shock/shkaicmd.cpp,v 1.1 1999/06/18 22:07:20 JON Exp $
8 //
9 //
12 #include <shkaicmd.h>
14 #include <lg.h>
15 #include <appagg.h>
17 #include <aiapisnd.h>
18 #include <aidebug.h>
19 #include <aigoal.h>
20 #include <aisndtyp.h>
22 #include <creatext.h>
24 // Must be last header
25 #include <dbmem.h>
27 ///////////////////////////////////////////////////////////////////////////////
29 // CLASS: cAICameraDeath
32 STDMETHODIMP_(const char *) cAICameraDeath::GetName()
34 return "CameraDeath";
37 //////////////////////////////////////
39 STDMETHODIMP_(void) cAICameraDeath::Init()
41 // Intentially not calling base -- want no goals or notifications by default
42 SetNotifications(kAICN_Death);
44 m_dying = FALSE;
47 //////////////////////////////////////
49 STDMETHODIMP_(void) cAICameraDeath::OnDeath(const sDamageMsg * pMsg)
51 // Halt all current sounds
52 if (m_pAI->AccessSoundEnactor())
53 m_pAI->AccessSoundEnactor()->HaltCurrent();
55 m_dying = TRUE;
56 SignalGoal();
58 AIWatch(Death, m_pAI->GetObjID(), "camera death");
61 //////////////////////////////////////
63 STDMETHODIMP cAICameraDeath::SuggestGoal(cAIGoal * pPrevious, cAIGoal ** ppGoal)
65 if (!m_dying)
67 *ppGoal = NULL;
68 return S_FALSE;
71 *ppGoal = new cAIDieGoal(this);
72 (*ppGoal)->priority= kAIP_VeryHigh;
74 SignalAction();
76 return S_OK;
79 ///////////////////////////////////////
81 STDMETHODIMP cAICameraDeath::SuggestActions(cAIGoal * pGoal, const cAIActions & previous, cAIActions * pNew)
83 m_pAI->Kill();
85 return S_OK;