2022-12-17 13:32:43 +01:00
|
|
|
/***
|
2013-08-30 13:34:05 -07:00
|
|
|
*
|
|
|
|
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
|
|
|
|
*
|
|
|
|
* This product contains software technology licensed from Id
|
|
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* This source code contains proprietary and confidential information of
|
|
|
|
* Valve LLC and its suppliers. Access to this code is restricted to
|
|
|
|
* persons who have executed a written SDK license with Valve. Any access,
|
|
|
|
* use or distribution of this code by or to any unlicensed person is illegal.
|
|
|
|
*
|
|
|
|
****/
|
2021-11-18 19:17:53 +01:00
|
|
|
|
|
|
|
#pragma once
|
2013-08-30 13:34:05 -07:00
|
|
|
|
|
|
|
#include "scriptevent.h"
|
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
#define SF_SCRIPT_WAITTILLSEEN 1
|
|
|
|
#define SF_SCRIPT_EXITAGITATED 2
|
|
|
|
#define SF_SCRIPT_REPEATABLE 4
|
|
|
|
#define SF_SCRIPT_LEAVECORPSE 8
|
2013-08-30 13:34:05 -07:00
|
|
|
//#define SF_SCRIPT_INTERPOLATE 16 // don't use, old bug
|
2021-11-28 16:54:48 +01:00
|
|
|
#define SF_SCRIPT_NOINTERRUPT 32
|
|
|
|
#define SF_SCRIPT_OVERRIDESTATE 64
|
|
|
|
#define SF_SCRIPT_NOSCRIPTMOVEMENT 128
|
2013-08-30 13:34:05 -07:00
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
#define SCRIPT_BREAK_CONDITIONS (bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE)
|
2013-08-30 13:34:05 -07:00
|
|
|
|
|
|
|
enum SS_INTERRUPT
|
|
|
|
{
|
|
|
|
SS_INTERRUPT_IDLE = 0,
|
|
|
|
SS_INTERRUPT_BY_NAME,
|
|
|
|
SS_INTERRUPT_AI,
|
|
|
|
};
|
|
|
|
|
|
|
|
// when a monster finishes an AI scripted sequence, we can choose
|
|
|
|
// a schedule to place them in. These defines are the aliases to
|
|
|
|
// resolve worldcraft input to real schedules (sjb)
|
2021-11-28 16:54:48 +01:00
|
|
|
#define SCRIPT_FINISHSCHED_DEFAULT 0
|
|
|
|
#define SCRIPT_FINISHSCHED_AMBUSH 1
|
2013-08-30 13:34:05 -07:00
|
|
|
|
|
|
|
class CCineMonster : public CBaseMonster
|
|
|
|
{
|
|
|
|
public:
|
2021-03-05 23:07:22 +01:00
|
|
|
void Spawn() override;
|
2021-11-28 16:54:48 +01:00
|
|
|
bool KeyValue(KeyValueData* pkvd) override;
|
|
|
|
void Use(CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value) override;
|
|
|
|
void Blocked(CBaseEntity* pOther) override;
|
|
|
|
void Touch(CBaseEntity* pOther) override;
|
2021-11-29 20:31:17 +01:00
|
|
|
int ObjectCaps() override { return (CBaseMonster::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
|
2021-03-05 23:07:22 +01:00
|
|
|
void Activate() override;
|
2013-08-30 13:34:05 -07:00
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
bool Save(CSave& save) override;
|
|
|
|
bool Restore(CRestore& restore) override;
|
|
|
|
|
|
|
|
static TYPEDESCRIPTION m_SaveData[];
|
2013-08-30 13:34:05 -07:00
|
|
|
|
2021-03-05 20:54:33 +01:00
|
|
|
// void EXPORT CineSpawnThink();
|
|
|
|
void EXPORT CineThink();
|
|
|
|
void Pain();
|
|
|
|
void Die();
|
2021-11-28 16:54:48 +01:00
|
|
|
void DelayStart(bool state);
|
2021-11-19 14:31:11 +01:00
|
|
|
bool FindEntity();
|
2021-03-05 20:54:33 +01:00
|
|
|
virtual void PossessEntity();
|
2013-08-30 13:34:05 -07:00
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
void ReleaseEntity(CBaseMonster* pEntity);
|
2021-03-05 20:54:33 +01:00
|
|
|
void CancelScript();
|
2021-11-28 16:54:48 +01:00
|
|
|
virtual bool StartSequence(CBaseMonster* pTarget, int iszSeq, bool completeOnEmpty);
|
|
|
|
virtual bool FCanOverrideState();
|
|
|
|
void SequenceDone(CBaseMonster* pMonster);
|
|
|
|
virtual void FixScriptMonsterSchedule(CBaseMonster* pMonster);
|
|
|
|
bool CanInterrupt();
|
|
|
|
void AllowInterrupt(bool fAllow);
|
|
|
|
int IgnoreConditions() override;
|
2013-08-30 13:34:05 -07:00
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
int m_iszIdle; // string index for idle animation
|
|
|
|
int m_iszPlay; // string index for scripted animation
|
|
|
|
int m_iszEntity; // entity that is wanted for this script
|
2013-08-30 13:34:05 -07:00
|
|
|
int m_fMoveTo;
|
|
|
|
int m_iFinishSchedule;
|
2021-11-28 16:54:48 +01:00
|
|
|
float m_flRadius; // range to search
|
|
|
|
float m_flRepeat; // repeat rate
|
2013-08-30 13:34:05 -07:00
|
|
|
|
|
|
|
int m_iDelay;
|
|
|
|
float m_startTime;
|
|
|
|
|
2021-11-28 16:54:48 +01:00
|
|
|
int m_saved_movetype;
|
|
|
|
int m_saved_solid;
|
2013-08-30 13:34:05 -07:00
|
|
|
int m_saved_effects;
|
2021-11-28 16:54:48 +01:00
|
|
|
// Vector m_vecOrigOrigin;
|
2021-11-19 20:40:36 +01:00
|
|
|
bool m_interruptable;
|
2013-08-30 13:34:05 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCineAI : public CCineMonster
|
|
|
|
{
|
2021-11-28 16:54:48 +01:00
|
|
|
bool StartSequence(CBaseMonster* pTarget, int iszSeq, bool completeOnEmpty) override;
|
2021-03-05 23:07:22 +01:00
|
|
|
void PossessEntity() override;
|
2021-11-28 16:54:48 +01:00
|
|
|
bool FCanOverrideState() override;
|
|
|
|
void FixScriptMonsterSchedule(CBaseMonster* pMonster) override;
|
2013-08-30 13:34:05 -07:00
|
|
|
};
|