2020-02-07 19:47:43 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 Nuke.YKT
|
|
|
|
Copyright (C) NoOne
|
|
|
|
|
|
|
|
This file is part of NBlood.
|
|
|
|
|
|
|
|
NBlood is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// This file provides modern features for mappers.
|
|
|
|
// For full documentation please visit http://cruo.bloodgame.ru/xxsystem
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "common_game.h"
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
#include "eventq.h"
|
|
|
|
#include "qav.h"
|
|
|
|
#include "actor.h"
|
|
|
|
#include "dude.h"
|
|
|
|
#include "player.h"
|
|
|
|
|
|
|
|
BEGIN_BLD_NS
|
|
|
|
|
2020-10-11 09:52:30 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
// CONSTANTS
|
|
|
|
// additional non-thing proximity, sight and physics sprites
|
2021-07-19 21:15:26 +00:00
|
|
|
kMaxSuperXSprites = 512,
|
2020-10-11 09:52:30 +00:00
|
|
|
kMaxTrackingConditions = 64,
|
|
|
|
kMaxTracedObjects = 32, // per one tracking condition
|
|
|
|
|
|
|
|
// additional physics attributes for debris sprites
|
2021-05-03 22:22:35 +00:00
|
|
|
kPhysDebrisFloat = 0x0008, // *debris* slowly goes up and down from it's position
|
|
|
|
kPhysDebrisFly = 0x0010, // *debris* affected by negative gravity (fly instead of falling)
|
|
|
|
kPhysDebrisSwim = 0x0020, // *debris* can swim underwater (instead of drowning)
|
|
|
|
kPhysDebrisTouch = 0x0040, // *debris* can be moved via touch
|
2020-10-11 09:52:30 +00:00
|
|
|
kPhysDebrisVector = 0x0400, // *debris* can be affected by vector weapons
|
|
|
|
kPhysDebrisExplode = 0x0800, // *debris* can be affected by explosions
|
|
|
|
|
|
|
|
// *modern types only hitag*
|
|
|
|
kModernTypeFlag0 = 0x0000,
|
|
|
|
kModernTypeFlag1 = 0x0001,
|
|
|
|
kModernTypeFlag2 = 0x0002,
|
|
|
|
kModernTypeFlag3 = 0x0003,
|
|
|
|
kModernTypeFlag4 = 0x0004,
|
2021-07-19 21:15:26 +00:00
|
|
|
kModernTypeFlag8 = 0x0008,
|
|
|
|
kModernTypeFlag16 = 0x0010,
|
2020-10-11 09:52:30 +00:00
|
|
|
|
|
|
|
kMaxRandomizeRetries = 16,
|
|
|
|
kPercFull = 100,
|
|
|
|
kCondRange = 100,
|
|
|
|
};
|
2020-05-05 18:50:14 +00:00
|
|
|
|
2021-07-25 08:30:14 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
kPatrolStateSize = 42,
|
|
|
|
kPatrolAlarmSeeDist = 10000,
|
|
|
|
kPatrolAlarmHearDist = 10000,
|
|
|
|
kMaxPatrolVelocity = 500000,
|
|
|
|
kMaxPatrolCrouchVelocity = (kMaxPatrolVelocity >> 1),
|
|
|
|
kMaxPatrolSpotValue = 500,
|
|
|
|
kMinPatrolTurnDelay = 8,
|
|
|
|
kPatrolTurnDelayRange = 20,
|
|
|
|
|
|
|
|
kDudeFlagStealth = 0x0001,
|
|
|
|
kDudeFlagCrouch = 0x0002,
|
|
|
|
|
|
|
|
kSlopeDist = 0x20,
|
|
|
|
kEffectGenCallbackBase = 200,
|
|
|
|
kTriggerSpriteScreen = 0x0001,
|
|
|
|
kTriggerSpriteAim = 0x0002,
|
2021-07-26 19:52:42 +00:00
|
|
|
|
|
|
|
kMinAllowedPowerup = kPwUpFeatherFall,
|
|
|
|
kMaxAllowedPowerup = kMaxPowerUps
|
2021-07-25 08:30:14 +00:00
|
|
|
};
|
2020-05-22 16:35:25 +00:00
|
|
|
|
2020-03-01 20:36:28 +00:00
|
|
|
// modern statnums
|
2020-02-07 19:47:43 +00:00
|
|
|
enum {
|
2020-04-04 19:48:23 +00:00
|
|
|
kStatModernBase = 20,
|
2020-04-09 18:51:25 +00:00
|
|
|
kStatModernDudeTargetChanger = kStatModernBase,
|
2020-03-01 20:36:28 +00:00
|
|
|
kStatModernCondition = 21,
|
|
|
|
kStatModernEventRedirector = 22,
|
2020-04-04 19:48:23 +00:00
|
|
|
kStatModernPlayerLinker = 23,
|
2020-05-22 16:35:25 +00:00
|
|
|
kStatModernBrokenDudeLeech = 24,
|
2020-05-05 18:50:14 +00:00
|
|
|
kStatModernQavScene = 25,
|
2021-07-19 21:15:26 +00:00
|
|
|
kStatModernWindGen = 26,
|
|
|
|
kStatModernStealthRegion = 27,
|
2020-05-05 18:50:14 +00:00
|
|
|
kStatModernTmp = 39,
|
2020-04-09 18:51:25 +00:00
|
|
|
kStatModernMax = 40,
|
2020-03-01 20:36:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// modern sprite types
|
|
|
|
enum {
|
2021-07-19 21:15:26 +00:00
|
|
|
kModernStealthRegion = 16,
|
2020-02-07 19:47:43 +00:00
|
|
|
kModernCustomDudeSpawn = 24,
|
|
|
|
kModernRandomTX = 25,
|
|
|
|
kModernSequentialTX = 26,
|
|
|
|
kModernSeqSpawner = 27,
|
|
|
|
kModernObjPropertiesChanger = 28,
|
|
|
|
kModernObjPicnumChanger = 29,
|
|
|
|
kModernObjSizeChanger = 31,
|
|
|
|
kModernDudeTargetChanger = 33,
|
|
|
|
kModernSectorFXChanger = 34,
|
|
|
|
kModernObjDataChanger = 35,
|
|
|
|
kModernSpriteDamager = 36,
|
|
|
|
kModernObjDataAccumulator = 37,
|
|
|
|
kModernEffectSpawner = 38,
|
|
|
|
kModernWindGenerator = 39,
|
|
|
|
kModernRandom = 40,
|
|
|
|
kModernRandom2 = 80,
|
|
|
|
kItemShroomGrow = 129,
|
|
|
|
kItemShroomShrink = 130,
|
|
|
|
kItemModernMapLevel = 150, // once picked up, draws whole minimap
|
|
|
|
kDudeModernCustom = kDudeVanillaMax,
|
|
|
|
kDudeModernCustomBurning = 255,
|
|
|
|
kModernThingTNTProx = 433, // detects only players
|
|
|
|
kModernThingThrowableRock = 434, // does small damage if hits target
|
|
|
|
kModernThingEnemyLifeLeech = 435, // the same as normal, except it aims in specified target only
|
|
|
|
kModernPlayerControl = 500, /// WIP
|
2020-03-01 20:36:28 +00:00
|
|
|
kModernCondition = 501, /// WIP, sends command only if specified conditions == true
|
2020-03-13 20:59:13 +00:00
|
|
|
kModernConditionFalse = 502, /// WIP, sends command only if specified conditions != true
|
2021-07-19 21:15:26 +00:00
|
|
|
kModernSlopeChanger = 504,
|
2020-02-07 19:47:43 +00:00
|
|
|
kGenModernMissileUniversal = 704,
|
|
|
|
kGenModernSound = 708,
|
|
|
|
};
|
|
|
|
|
|
|
|
// type of random
|
|
|
|
enum {
|
|
|
|
kRandomizeItem = 0,
|
|
|
|
kRandomizeDude = 1,
|
|
|
|
kRandomizeTX = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
// type of object
|
|
|
|
enum {
|
|
|
|
OBJ_WALL = 0,
|
|
|
|
OBJ_SPRITE = 3,
|
|
|
|
OBJ_SECTOR = 6,
|
|
|
|
};
|
|
|
|
|
2020-03-13 20:59:13 +00:00
|
|
|
enum {
|
2021-07-19 21:15:26 +00:00
|
|
|
kCondGameBase = 0,
|
|
|
|
kCondGameMax = 50,
|
2020-03-13 20:59:13 +00:00
|
|
|
kCondMixedBase = 100,
|
2020-03-30 19:54:28 +00:00
|
|
|
kCondMixedMax = 200,
|
2020-03-13 20:59:13 +00:00
|
|
|
kCondWallBase = 200,
|
2020-03-30 19:54:28 +00:00
|
|
|
kCondWallMax = 300,
|
2020-03-13 20:59:13 +00:00
|
|
|
kCondSectorBase = 300,
|
2020-03-30 19:54:28 +00:00
|
|
|
kCondSectorMax = 400,
|
2020-05-05 18:50:14 +00:00
|
|
|
kCondPlayerBase = 400,
|
|
|
|
kCondPlayerMax = 450,
|
|
|
|
kCondDudeBase = 450,
|
2020-03-30 19:54:28 +00:00
|
|
|
kCondDudeMax = 500,
|
2020-03-13 20:59:13 +00:00
|
|
|
kCondSpriteBase = 500,
|
2020-03-30 19:54:28 +00:00
|
|
|
kCondSpriteMax = 600,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
2021-07-19 21:15:26 +00:00
|
|
|
kCondSerialSector = 100000,
|
|
|
|
kCondSerialWall = 200000,
|
|
|
|
kCondSerialSprite = 300000,
|
|
|
|
kCondSerialMax = 400000,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
kPatrolMoveForward = 0,
|
|
|
|
kPatrolMoveBackward = 1,
|
2020-03-13 20:59:13 +00:00
|
|
|
};
|
|
|
|
|
2020-02-07 19:47:43 +00:00
|
|
|
// - STRUCTS ------------------------------------------------------------------
|
|
|
|
struct SPRITEMASS { // sprite mass info for getSpriteMassBySize();
|
|
|
|
int seqId;
|
2021-11-16 17:15:56 +00:00
|
|
|
int16_t picnum; // mainly needs for moving debris
|
|
|
|
int16_t xrepeat;
|
|
|
|
int16_t yrepeat;
|
|
|
|
int16_t clipdist; // mass multiplier
|
2020-02-07 19:47:43 +00:00
|
|
|
int mass;
|
2021-11-16 17:15:56 +00:00
|
|
|
int16_t airVel; // mainly needs for moving debris
|
2020-02-07 19:47:43 +00:00
|
|
|
int fraction; // mainly needs for moving debris
|
|
|
|
};
|
|
|
|
|
|
|
|
struct QAVSCENE { // this one stores qavs anims that can be played by trigger
|
2021-08-28 08:38:36 +00:00
|
|
|
DBloodActor* initiator = nullptr; // index of sprite which triggered qav scene
|
|
|
|
QAV* qavResrc = nullptr;
|
2020-02-07 19:47:43 +00:00
|
|
|
short dummy = -1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct THINGINFO_EXTRA {
|
|
|
|
bool allowThrow; // indicates if kDudeModernCustom can throw it
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VECTORINFO_EXTRA {
|
|
|
|
int fireSound[2]; // predefined fire sounds. used by kDudeModernCustom, but can be used for something else.
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MISSILEINFO_EXTRA {
|
|
|
|
int fireSound[2]; // predefined fire sounds. used by kDudeModernCustom, but can be used for something else.
|
|
|
|
bool dmgType[kDamageMax]; // list of damages types missile can use
|
2020-03-01 20:36:28 +00:00
|
|
|
bool allowImpact; // allow to trigger object with Impact flag enabled with this missile
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DUDEINFO_EXTRA {
|
|
|
|
bool flying; // used by kModernDudeTargetChanger (ai fight)
|
|
|
|
bool melee; // used by kModernDudeTargetChanger (ai fight)
|
2020-12-06 20:56:09 +00:00
|
|
|
int idlgseqofs : 6; // used for patrol
|
|
|
|
int mvegseqofs : 6; // used for patrol
|
|
|
|
int idlwseqofs : 6; // used for patrol
|
|
|
|
int mvewseqofs : 6; // used for patrol
|
|
|
|
int idlcseqofs : 6; // used for patrol
|
|
|
|
int mvecseqofs : 6; // used for patrol
|
2021-07-19 21:15:26 +00:00
|
|
|
|
2020-02-07 19:47:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct TRPLAYERCTRL { // this one for controlling the player using triggers (movement speed, jumps and other stuff)
|
|
|
|
QAVSCENE qavScene;
|
|
|
|
};
|
|
|
|
|
2020-03-13 20:59:13 +00:00
|
|
|
struct OBJECTS_TO_TRACK {
|
2021-08-27 16:21:01 +00:00
|
|
|
uint8_t cmd;
|
2021-11-23 18:48:14 +00:00
|
|
|
EventObject obj;
|
2020-03-13 20:59:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct TRCONDITION {
|
2021-10-12 21:52:54 +00:00
|
|
|
DBloodActor* actor;
|
2021-08-27 10:55:16 +00:00
|
|
|
uint8_t length;
|
2020-03-13 20:59:13 +00:00
|
|
|
OBJECTS_TO_TRACK obj[kMaxTracedObjects];
|
|
|
|
};
|
|
|
|
|
2021-07-19 21:15:26 +00:00
|
|
|
struct PATROL_FOUND_SOUNDS {
|
|
|
|
|
|
|
|
int snd;
|
|
|
|
int max;
|
|
|
|
int cur;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CONDITION_TYPE_NAMES {
|
|
|
|
|
|
|
|
int rng1;
|
|
|
|
int rng2;
|
|
|
|
char name[32];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2020-02-07 19:47:43 +00:00
|
|
|
// - VARIABLES ------------------------------------------------------------------
|
|
|
|
extern bool gModernMap;
|
|
|
|
extern bool gTeamsSpawnUsed;
|
2020-03-01 20:36:28 +00:00
|
|
|
extern bool gEventRedirectsUsed;
|
2020-02-07 19:47:43 +00:00
|
|
|
extern ZONE gStartZoneTeam1[kMaxPlayers];
|
|
|
|
extern ZONE gStartZoneTeam2[kMaxPlayers];
|
2021-08-27 11:46:07 +00:00
|
|
|
extern const THINGINFO_EXTRA gThingInfoExtra[kThingMax];
|
|
|
|
extern const VECTORINFO_EXTRA gVectorInfoExtra[kVectorMax];
|
|
|
|
extern const MISSILEINFO_EXTRA gMissileInfoExtra[kMissileMax];
|
|
|
|
extern const DUDEINFO_EXTRA gDudeInfoExtra[kDudeMax];
|
2020-02-07 19:47:43 +00:00
|
|
|
extern TRPLAYERCTRL gPlayerCtrl[kMaxPlayers];
|
2020-03-13 20:59:13 +00:00
|
|
|
extern TRCONDITION gCondition[kMaxTrackingConditions];
|
2021-09-01 19:52:00 +00:00
|
|
|
extern DBloodActor* gProxySpritesList[kMaxSuperXSprites];
|
|
|
|
extern DBloodActor* gSightSpritesList[kMaxSuperXSprites];
|
|
|
|
extern DBloodActor* gPhysSpritesList[kMaxSuperXSprites];
|
|
|
|
extern DBloodActor* gImpactSpritesList[kMaxSuperXSprites];
|
2021-11-16 17:24:01 +00:00
|
|
|
extern int gProxySpritesCount;
|
|
|
|
extern int gSightSpritesCount;
|
|
|
|
extern int gPhysSpritesCount;
|
|
|
|
extern int gImpactSpritesCount;
|
|
|
|
extern int gTrackingCondsCount;
|
2020-12-06 20:56:09 +00:00
|
|
|
extern AISTATE genPatrolStates[kPatrolStateSize];
|
2020-02-07 19:47:43 +00:00
|
|
|
|
2021-07-19 21:15:26 +00:00
|
|
|
|
2020-02-07 19:47:43 +00:00
|
|
|
// - FUNCTIONS ------------------------------------------------------------------
|
2021-08-27 12:11:59 +00:00
|
|
|
bool nnExtEraseModernStuff(DBloodActor* actor);
|
2021-12-03 20:36:32 +00:00
|
|
|
void nnExtInitModernStuff(TArray<DBloodActor*>& actors);
|
2020-02-07 19:47:43 +00:00
|
|
|
void nnExtProcessSuperSprites(void);
|
2021-08-27 12:01:51 +00:00
|
|
|
bool nnExtIsImmune(DBloodActor* pSprite, int dmgType, int minScale = 16);
|
2020-02-07 19:47:43 +00:00
|
|
|
int nnExtRandom(int a, int b);
|
2020-03-01 20:36:28 +00:00
|
|
|
void nnExtResetGlobals();
|
2020-02-07 19:47:43 +00:00
|
|
|
// ------------------------------------------------------------------------- //
|
2021-08-27 17:12:22 +00:00
|
|
|
void sfxPlayMissileSound(DBloodActor* pSprite, int missileId);
|
|
|
|
void sfxPlayVectorSound(DBloodActor* pSprite, int vectorId);
|
2020-02-07 19:47:43 +00:00
|
|
|
// ------------------------------------------------------------------------- //
|
|
|
|
int debrisGetFreeIndex(void);
|
2021-10-12 22:46:21 +00:00
|
|
|
void debrisBubble(DBloodActor* nSprite);
|
2020-02-07 19:47:43 +00:00
|
|
|
void debrisMove(int listIndex);
|
2021-10-12 22:46:21 +00:00
|
|
|
void debrisConcuss(DBloodActor* nOwner, int listIndex, int x, int y, int z, int dmg);
|
2020-02-07 19:47:43 +00:00
|
|
|
// ------------------------------------------------------------------------- //
|
2021-08-28 07:50:01 +00:00
|
|
|
void aiSetGenIdleState(DBloodActor*);
|
2020-02-07 19:47:43 +00:00
|
|
|
|
|
|
|
// triggers related
|
|
|
|
// ------------------------------------------------------------------------- //
|
2021-10-03 12:11:07 +00:00
|
|
|
int aiFightGetTargetDist(DBloodActor* pSprite, DUDEINFO* pDudeInfo, DBloodActor* pTarget);
|
|
|
|
int aiFightGetFineTargetDist(DBloodActor* actor, DBloodActor* target);
|
2021-10-03 10:34:47 +00:00
|
|
|
bool aiFightDudeCanSeeTarget(DBloodActor* pXDude, DUDEINFO* pDudeInfo, DBloodActor* pTarget);
|
2021-10-03 12:16:22 +00:00
|
|
|
bool aiFightDudeIsAffected(DBloodActor* pXDude);
|
2021-10-03 10:34:47 +00:00
|
|
|
bool aiFightMatesHaveSameTarget(DBloodActor* leaderactor, DBloodActor* targetactor, int allow);
|
2020-02-07 19:47:43 +00:00
|
|
|
void aiFightActivateDudes(int rx);
|
|
|
|
// ------------------------------------------------------------------------- //
|
2021-11-24 00:15:11 +00:00
|
|
|
void useSlopeChanger(DBloodActor* sourceactor, int objType, sectortype* pSect, DBloodActor* objActor);
|
2021-09-02 21:52:24 +00:00
|
|
|
void damageSprites(DBloodActor* pXSource, DBloodActor* pSprite);
|
2021-08-28 22:56:14 +00:00
|
|
|
void useRandomItemGen(DBloodActor* pSource);
|
2021-08-29 06:45:14 +00:00
|
|
|
void useUniMissileGen(DBloodActor* sourceactor, DBloodActor* actor);
|
2021-08-29 06:57:23 +00:00
|
|
|
void useSoundGen(DBloodActor* sourceactor, DBloodActor* actor);
|
2021-11-23 22:26:06 +00:00
|
|
|
void useIncDecGen(DBloodActor* sourceactor, int objType, sectortype* destSect, walltype* destWall, DBloodActor* objactor);
|
2021-11-23 22:47:40 +00:00
|
|
|
void useDataChanger(DBloodActor* sourceactor, int objType, sectortype* pSector, walltype* pWall, DBloodActor* objActor);
|
2021-11-19 15:56:58 +00:00
|
|
|
void useSectorLightChanger(DBloodActor* pXSource, sectortype* pSector);
|
2021-10-13 17:17:45 +00:00
|
|
|
void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor);
|
2021-11-23 22:26:06 +00:00
|
|
|
void usePictureChanger(DBloodActor* sourceactor, int objType, sectortype*, walltype*, DBloodActor* objActor);
|
2021-10-03 12:50:55 +00:00
|
|
|
void useSequentialTx(DBloodActor* pXSource, COMMAND_ID cmd, bool setState);
|
|
|
|
void useRandomTx(DBloodActor* sourceactor, COMMAND_ID cmd, bool setState);
|
2021-10-03 12:18:47 +00:00
|
|
|
void useDudeSpawn(DBloodActor* pXSource, DBloodActor* pSprite);
|
2021-05-06 07:55:56 +00:00
|
|
|
void useCustomDudeSpawn(DBloodActor* pXSource, DBloodActor* pSprite);
|
2021-10-03 12:50:55 +00:00
|
|
|
void seqTxSendCmdAll(DBloodActor* pXSource, DBloodActor* nIndex, COMMAND_ID cmd, bool modernSend);
|
2020-02-07 19:47:43 +00:00
|
|
|
// ------------------------------------------------------------------------- //
|
2021-09-02 20:16:18 +00:00
|
|
|
void trPlayerCtrlLink(DBloodActor* pXSource, PLAYER* pPlayer, bool checkCondition);
|
2020-05-05 18:50:14 +00:00
|
|
|
void trPlayerCtrlStopScene(PLAYER* pPlayer);
|
2020-02-07 19:47:43 +00:00
|
|
|
// ------------------------------------------------------------------------- //
|
2021-11-23 19:58:30 +00:00
|
|
|
void modernTypeTrigger(int type, sectortype*sect, walltype* wal, DBloodActor* actor, const EVENT& event);
|
2021-11-24 00:49:43 +00:00
|
|
|
bool modernTypeOperateSector(sectortype* pSector, const EVENT& event);
|
2021-11-23 16:45:42 +00:00
|
|
|
bool modernTypeOperateSprite(DBloodActor*, const EVENT& event);
|
2021-11-23 22:04:21 +00:00
|
|
|
bool modernTypeOperateWall(walltype* pWall, const EVENT& event);
|
2021-08-28 16:26:24 +00:00
|
|
|
void modernTypeSendCommand(DBloodActor* nSprite, int channel, COMMAND_ID command);
|
2020-02-07 19:47:43 +00:00
|
|
|
// ------------------------------------------------------------------------- //
|
|
|
|
bool playerSizeShrink(PLAYER* pPlayer, int divider);
|
|
|
|
bool playerSizeGrow(PLAYER* pPlayer, int multiplier);
|
|
|
|
bool playerSizeReset(PLAYER* pPlayer);
|
|
|
|
void playerDeactivateShrooms(PLAYER* pPlayer);
|
|
|
|
// ------------------------------------------------------------------------- //
|
|
|
|
QAV* playerQavSceneLoad(int qavId);
|
|
|
|
void playerQavSceneProcess(PLAYER* pPlayer, QAVSCENE* pQavScene);
|
|
|
|
void playerQavScenePlay(PLAYER* pPlayer);
|
2021-08-05 02:38:26 +00:00
|
|
|
void playerQavSceneDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5);
|
2020-02-07 19:47:43 +00:00
|
|
|
void playerQavSceneReset(PLAYER* pPlayer);
|
|
|
|
// ------------------------------------------------------------------------- //
|
2021-11-24 00:05:17 +00:00
|
|
|
void callbackUniMissileBurst(DBloodActor*actor, sectortype* nSprite);
|
|
|
|
void callbackMakeMissileBlocking(DBloodActor* actor, sectortype* nSprite);
|
|
|
|
void callbackGenDudeUpdate(DBloodActor* actor, sectortype* nSprite);
|
2020-02-07 19:47:43 +00:00
|
|
|
// ------------------------------------------------------------------------- //
|
2021-11-16 17:24:01 +00:00
|
|
|
PLAYER* getPlayerById(int id);
|
2021-08-29 11:44:04 +00:00
|
|
|
bool isGrown(DBloodActor* pSprite);
|
|
|
|
bool isShrinked(DBloodActor* pSprite);
|
|
|
|
bool IsBurningDude(DBloodActor* pSprite);
|
|
|
|
bool IsKillableDude(DBloodActor* pSprite);
|
2021-10-13 17:45:48 +00:00
|
|
|
bool isActive(DBloodActor* nSprite);
|
2021-11-23 18:37:38 +00:00
|
|
|
int getDataFieldOfObject(const EventObject& eob, int dataIndex);
|
2021-11-23 22:26:06 +00:00
|
|
|
int getDataFieldOfObject(int objType, sectortype* sect, walltype* wal, DBloodActor* actor, int dataIndex);
|
2021-11-23 22:47:40 +00:00
|
|
|
bool setDataValueOfObject(int objType, sectortype* sect, walltype* wal, DBloodActor* objActor, int dataIndex, int value);
|
2021-09-05 18:10:40 +00:00
|
|
|
bool incDecGoalValueIsReached(DBloodActor* actor);
|
2021-08-27 17:12:22 +00:00
|
|
|
int getSpriteMassBySize(DBloodActor* pSprite);
|
2021-08-28 07:50:01 +00:00
|
|
|
bool ceilIsTooLow(DBloodActor* pSprite);
|
2020-02-07 19:47:43 +00:00
|
|
|
void levelEndLevelCustom(int nLevel);
|
2021-08-28 22:56:14 +00:00
|
|
|
int useCondition(DBloodActor*, const EVENT& event);
|
2020-03-30 19:54:28 +00:00
|
|
|
bool condCmp(int val, int arg1, int arg2, int comOp);
|
|
|
|
bool condCmpne(int arg1, int arg2, int comOp);
|
2021-10-13 21:58:04 +00:00
|
|
|
void condError(DBloodActor* pXCond, const char* pzFormat, ...);
|
2021-10-13 23:18:26 +00:00
|
|
|
void condUpdateObjectIndex(DBloodActor* oldplayer, DBloodActor* newplayer);
|
2021-11-23 22:26:06 +00:00
|
|
|
DBloodActor* evrListRedirectors(int objType, sectortype*, walltype*, DBloodActor* objActor, DBloodActor* pXRedir, int* tx);
|
2021-09-05 18:10:40 +00:00
|
|
|
void seqSpawnerOffSameTx(DBloodActor* actor);
|
2020-12-06 20:56:09 +00:00
|
|
|
// ------------------------------------------------------------------------- //
|
2021-08-29 13:57:42 +00:00
|
|
|
void aiPatrolSetMarker(DBloodActor* actor);
|
2021-05-03 22:03:01 +00:00
|
|
|
void aiPatrolThink(DBloodActor* actor);
|
2021-09-05 17:21:18 +00:00
|
|
|
void aiPatrolStop(DBloodActor* actor, DBloodActor* targetactor, bool alarm = false);
|
2021-08-29 15:07:09 +00:00
|
|
|
void aiPatrolAlarmFull(DBloodActor* actor, DBloodActor* targetactor, bool chain);
|
|
|
|
void aiPatrolAlarmLite(DBloodActor* actor, DBloodActor* targetactor);
|
2021-08-29 12:36:40 +00:00
|
|
|
void aiPatrolState(DBloodActor* pSprite, int state);
|
2021-05-03 22:03:01 +00:00
|
|
|
void aiPatrolMove(DBloodActor* actor);
|
2021-08-29 12:36:40 +00:00
|
|
|
DBloodActor* aiPatrolMarkerBusy(DBloodActor* except, DBloodActor* marker);
|
|
|
|
bool aiPatrolMarkerReached(DBloodActor*);
|
2021-09-04 08:53:56 +00:00
|
|
|
bool aiPatrolGetPathDir(DBloodActor* actor, DBloodActor* marker);
|
|
|
|
void aiPatrolFlagsMgr(DBloodActor* sourceactor, DBloodActor* destactor, bool copy, bool init);
|
2021-07-19 21:15:26 +00:00
|
|
|
void aiPatrolRandGoalAng(DBloodActor* actor);
|
|
|
|
void aiPatrolTurn(DBloodActor* actor);
|
|
|
|
inline int aiPatrolGetVelocity(int speed, int value) {
|
|
|
|
return (value > 0) ? ClipRange((speed / 3) + (2500 * value), 0, 0x47956) : speed;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool aiPatrolWaiting(AISTATE* pAiState) {
|
2021-07-25 05:37:50 +00:00
|
|
|
return (pAiState && pAiState->stateType >= kAiStatePatrolWaitL && pAiState->stateType <= kAiStatePatrolWaitW);
|
2021-07-19 21:15:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline bool aiPatrolMoving(AISTATE* pAiState) {
|
2021-07-25 05:37:50 +00:00
|
|
|
return (pAiState && pAiState->stateType >= kAiStatePatrolMoveL && pAiState->stateType <= kAiStatePatrolMoveW);
|
2021-07-19 21:15:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline bool aiPatrolTurning(AISTATE* pAiState) {
|
2021-07-25 05:37:50 +00:00
|
|
|
return (pAiState && pAiState->stateType >= kAiStatePatrolTurnL && pAiState->stateType <= kAiStatePatrolTurnW);
|
2021-07-19 21:15:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline bool aiInPatrolState(AISTATE* pAiState) {
|
2021-07-25 05:37:50 +00:00
|
|
|
return (pAiState && pAiState->stateType >= kAiStatePatrolBase && pAiState->stateType < kAiStatePatrolMax);
|
2021-07-19 21:15:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline bool aiInPatrolState(int nAiStateType) {
|
|
|
|
return (nAiStateType >= kAiStatePatrolBase && nAiStateType < kAiStatePatrolMax);
|
|
|
|
}
|
2020-12-06 20:56:09 +00:00
|
|
|
// ------------------------------------------------------------------------- //
|
2021-08-29 15:16:38 +00:00
|
|
|
bool readyForCrit(DBloodActor* pHunter, DBloodActor* pVictim);
|
2021-08-29 17:09:29 +00:00
|
|
|
void clampSprite(DBloodActor* actor, int which = 3);
|
2020-12-06 20:56:09 +00:00
|
|
|
#endif
|
2020-02-07 19:47:43 +00:00
|
|
|
|
2021-08-28 16:26:24 +00:00
|
|
|
inline bool valueIsBetween(int val, int min, int max)
|
|
|
|
{
|
|
|
|
return (val > min && val < max);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-02-07 19:47:43 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// This file provides modern features for mappers.
|
|
|
|
// For full documentation please visit http://cruo.bloodgame.ru/xxsystem
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
END_BLD_NS
|
2021-03-20 22:01:16 +00:00
|
|
|
|