raze/source/games/blood/src/nnexts.h

446 lines
18 KiB
C
Raw Normal View History

//-------------------------------------------------------------------------
/*
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
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
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,
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
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,
};
- Don't change statnum of thing converted to debris back to thing on impact trigger when firing with vector weapon. - Change damage scale and min firedist for Custom Dude. - Remove unnecessary checks in callback of tracking condition. - Fix picWidth() function. - Better initialization of modern stuff. - kModernSeqSpawner: disable all other spawners with same TX ID when enabling current. - Fix: sceneQav was not playing if resurrected with COUSTEAU cheat. - kModernPictureChanger: remove kModernFlag01 feature (deprecated). - kModernSectorFXChanger: add flags to control where exactly light effect should appear. - kModernCondition: - add delay before sending command if condition is true. - take in account state, so kCmdState and kCmdNotState is useful. - fix wrong comparison result in some conditions. - add new various conditions. - kModernPlayerControl: - fix start / stop playing qav scene when triggered with event command converted to sprite command. - add a way to resurrect / heal player. - add event commands to toggle inventory item status via trigger. - fix that Remote and Proximity detonators cannot be given. - add clear all screen effects option. - proper percents for changing movement / jumping. - kModernRandomTX, kModernSequentialTX: change event redirection mode activation from kModernTypeFlag02 to kCmdLink. - kModernSpriteDamager: treat damage value as percents by default, take in account god mode. - kModernEffectGen: fix wrong cstat for effects. - kModernPropertiesChanger: proper underwater status for sectors and players or enemies in it. - Players: assign or update current player's sprite index for all conditions. # Conflicts: # source/blood/src/nnexts.cpp
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,
kMinAllowedPowerup = kPwUpFeatherFall,
kMaxAllowedPowerup = kMaxPowerUps
2021-07-25 08:30:14 +00:00
};
2020-05-22 16:35:25 +00:00
// modern statnums
enum {
kStatModernBase = 20,
kStatModernDudeTargetChanger = kStatModernBase,
kStatModernCondition = 21,
kStatModernEventRedirector = 22,
kStatModernPlayerLinker = 23,
2020-05-22 16:35:25 +00:00
kStatModernBrokenDudeLeech = 24,
- Don't change statnum of thing converted to debris back to thing on impact trigger when firing with vector weapon. - Change damage scale and min firedist for Custom Dude. - Remove unnecessary checks in callback of tracking condition. - Fix picWidth() function. - Better initialization of modern stuff. - kModernSeqSpawner: disable all other spawners with same TX ID when enabling current. - Fix: sceneQav was not playing if resurrected with COUSTEAU cheat. - kModernPictureChanger: remove kModernFlag01 feature (deprecated). - kModernSectorFXChanger: add flags to control where exactly light effect should appear. - kModernCondition: - add delay before sending command if condition is true. - take in account state, so kCmdState and kCmdNotState is useful. - fix wrong comparison result in some conditions. - add new various conditions. - kModernPlayerControl: - fix start / stop playing qav scene when triggered with event command converted to sprite command. - add a way to resurrect / heal player. - add event commands to toggle inventory item status via trigger. - fix that Remote and Proximity detonators cannot be given. - add clear all screen effects option. - proper percents for changing movement / jumping. - kModernRandomTX, kModernSequentialTX: change event redirection mode activation from kModernTypeFlag02 to kCmdLink. - kModernSpriteDamager: treat damage value as percents by default, take in account god mode. - kModernEffectGen: fix wrong cstat for effects. - kModernPropertiesChanger: proper underwater status for sectors and players or enemies in it. - Players: assign or update current player's sprite index for all conditions. # Conflicts: # source/blood/src/nnexts.cpp
2020-05-05 18:50:14 +00:00
kStatModernQavScene = 25,
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
kStatModernWindGen = 26,
kStatModernStealthRegion = 27,
- Don't change statnum of thing converted to debris back to thing on impact trigger when firing with vector weapon. - Change damage scale and min firedist for Custom Dude. - Remove unnecessary checks in callback of tracking condition. - Fix picWidth() function. - Better initialization of modern stuff. - kModernSeqSpawner: disable all other spawners with same TX ID when enabling current. - Fix: sceneQav was not playing if resurrected with COUSTEAU cheat. - kModernPictureChanger: remove kModernFlag01 feature (deprecated). - kModernSectorFXChanger: add flags to control where exactly light effect should appear. - kModernCondition: - add delay before sending command if condition is true. - take in account state, so kCmdState and kCmdNotState is useful. - fix wrong comparison result in some conditions. - add new various conditions. - kModernPlayerControl: - fix start / stop playing qav scene when triggered with event command converted to sprite command. - add a way to resurrect / heal player. - add event commands to toggle inventory item status via trigger. - fix that Remote and Proximity detonators cannot be given. - add clear all screen effects option. - proper percents for changing movement / jumping. - kModernRandomTX, kModernSequentialTX: change event redirection mode activation from kModernTypeFlag02 to kCmdLink. - kModernSpriteDamager: treat damage value as percents by default, take in account god mode. - kModernEffectGen: fix wrong cstat for effects. - kModernPropertiesChanger: proper underwater status for sectors and players or enemies in it. - Players: assign or update current player's sprite index for all conditions. # Conflicts: # source/blood/src/nnexts.cpp
2020-05-05 18:50:14 +00:00
kStatModernTmp = 39,
kStatModernMax = 40,
};
// modern sprite types
enum {
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
kModernStealthRegion = 16,
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
kModernCondition = 501, /// WIP, sends command only if specified conditions == true
kModernConditionFalse = 502, /// WIP, sends command only if specified conditions != true
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
kModernSlopeChanger = 504,
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,
};
enum {
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
kCondGameBase = 0,
kCondGameMax = 50,
kCondMixedBase = 100,
kCondMixedMax = 200,
kCondWallBase = 200,
kCondWallMax = 300,
kCondSectorBase = 300,
kCondSectorMax = 400,
- Don't change statnum of thing converted to debris back to thing on impact trigger when firing with vector weapon. - Change damage scale and min firedist for Custom Dude. - Remove unnecessary checks in callback of tracking condition. - Fix picWidth() function. - Better initialization of modern stuff. - kModernSeqSpawner: disable all other spawners with same TX ID when enabling current. - Fix: sceneQav was not playing if resurrected with COUSTEAU cheat. - kModernPictureChanger: remove kModernFlag01 feature (deprecated). - kModernSectorFXChanger: add flags to control where exactly light effect should appear. - kModernCondition: - add delay before sending command if condition is true. - take in account state, so kCmdState and kCmdNotState is useful. - fix wrong comparison result in some conditions. - add new various conditions. - kModernPlayerControl: - fix start / stop playing qav scene when triggered with event command converted to sprite command. - add a way to resurrect / heal player. - add event commands to toggle inventory item status via trigger. - fix that Remote and Proximity detonators cannot be given. - add clear all screen effects option. - proper percents for changing movement / jumping. - kModernRandomTX, kModernSequentialTX: change event redirection mode activation from kModernTypeFlag02 to kCmdLink. - kModernSpriteDamager: treat damage value as percents by default, take in account god mode. - kModernEffectGen: fix wrong cstat for effects. - kModernPropertiesChanger: proper underwater status for sectors and players or enemies in it. - Players: assign or update current player's sprite index for all conditions. # Conflicts: # source/blood/src/nnexts.cpp
2020-05-05 18:50:14 +00:00
kCondPlayerBase = 400,
kCondPlayerMax = 450,
kCondDudeBase = 450,
kCondDudeMax = 500,
kCondSpriteBase = 500,
kCondSpriteMax = 600,
};
enum {
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
kCondSerialSector = 100000,
kCondSerialWall = 200000,
kCondSerialSprite = 300000,
kCondSerialMax = 400000,
};
enum {
kPatrolMoveForward = 0,
kPatrolMoveBackward = 1,
};
// - STRUCTS ------------------------------------------------------------------
struct SPRITEMASS { // sprite mass info for getSpriteMassBySize();
int seqId;
short picnum; // mainly needs for moving debris
short xrepeat;
short yrepeat;
short clipdist; // mass multiplier
int mass;
short airVel; // mainly needs for moving debris
int fraction; // mainly needs for moving debris
};
struct QAVSCENE { // this one stores qavs anims that can be played by trigger
DBloodActor* initiator = nullptr; // index of sprite which triggered qav scene
QAV* qavResrc = nullptr;
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
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
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
};
struct TRPLAYERCTRL { // this one for controlling the player using triggers (movement speed, jumps and other stuff)
QAVSCENE qavScene;
};
struct OBJECTS_TO_TRACK {
int8_t type;
uint8_t cmd;
unsigned int index_;
DBloodActor* actor;
};
struct TRCONDITION {
DBloodActor* actor;
uint8_t length;
OBJECTS_TO_TRACK obj[kMaxTracedObjects];
};
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
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];
};
// - VARIABLES ------------------------------------------------------------------
extern bool gModernMap;
extern bool gTeamsSpawnUsed;
extern bool gEventRedirectsUsed;
extern ZONE gStartZoneTeam1[kMaxPlayers];
extern ZONE gStartZoneTeam2[kMaxPlayers];
extern const THINGINFO_EXTRA gThingInfoExtra[kThingMax];
extern const VECTORINFO_EXTRA gVectorInfoExtra[kVectorMax];
extern const MISSILEINFO_EXTRA gMissileInfoExtra[kMissileMax];
extern const DUDEINFO_EXTRA gDudeInfoExtra[kDudeMax];
extern TRPLAYERCTRL gPlayerCtrl[kMaxPlayers];
extern TRCONDITION gCondition[kMaxTrackingConditions];
extern DBloodActor* gProxySpritesList[kMaxSuperXSprites];
extern DBloodActor* gSightSpritesList[kMaxSuperXSprites];
extern DBloodActor* gPhysSpritesList[kMaxSuperXSprites];
extern DBloodActor* gImpactSpritesList[kMaxSuperXSprites];
extern short gProxySpritesCount;
extern short gSightSpritesCount;
extern short gPhysSpritesCount;
extern short gImpactSpritesCount;
extern short gTrackingCondsCount;
2020-12-06 20:56:09 +00:00
extern AISTATE genPatrolStates[kPatrolStateSize];
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
// - INLINES -------------------------------------------------------------------
inline bool xsprIsFine(spritetype* pSpr) {
return (pSpr && xspriRangeIsFine(pSpr->extra) && !(pSpr->flags & kHitagFree) && !(pSpr->flags & kHitagRespawn));
}
// - FUNCTIONS ------------------------------------------------------------------
2021-08-27 12:11:59 +00:00
bool nnExtEraseModernStuff(DBloodActor* actor);
void nnExtInitModernStuff(bool bSaveLoad);
void nnExtProcessSuperSprites(void);
2021-08-27 12:01:51 +00:00
bool nnExtIsImmune(DBloodActor* pSprite, int dmgType, int minScale = 16);
int nnExtRandom(int a, int b);
void nnExtResetGlobals();
void nnExtTriggerObject(int objType, int objIndex, int command);
// ------------------------------------------------------------------------- //
2021-08-27 17:12:22 +00:00
void sfxPlayMissileSound(DBloodActor* pSprite, int missileId);
void sfxPlayVectorSound(DBloodActor* pSprite, int vectorId);
// ------------------------------------------------------------------------- //
int debrisGetFreeIndex(void);
2021-10-12 22:46:21 +00:00
void debrisBubble(DBloodActor* nSprite);
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);
// ------------------------------------------------------------------------- //
2021-08-28 07:50:01 +00:00
void aiSetGenIdleState(DBloodActor*);
// 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);
bool aiFightDudeIsAffected(DBloodActor* pXDude);
2021-10-03 10:34:47 +00:00
bool aiFightMatesHaveSameTarget(DBloodActor* leaderactor, DBloodActor* targetactor, int allow);
void aiFightActivateDudes(int rx);
// ------------------------------------------------------------------------- //
2020-12-06 20:56:09 +00:00
void useSlopeChanger(XSPRITE* pXSource, int objType, int objIndex);
2021-09-02 21:52:24 +00:00
void damageSprites(DBloodActor* pXSource, DBloodActor* pSprite);
void useRandomItemGen(spritetype* pSource, XSPRITE* pXSource);
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
void useUniMissileGen(XSPRITE* pXSource, spritetype* pSprite);
2020-12-06 20:56:09 +00:00
void useSoundGen(XSPRITE* pXSource, spritetype* pSprite);
void useIncDecGen(XSPRITE* pXSource, short objType, int objIndex);
void useDataChanger(XSPRITE* pXSource, int objType, int objIndex);
void useSectorLigthChanger(XSPRITE* pXSource, XSECTOR* pXSector);
void useTargetChanger(XSPRITE* pXSource, spritetype* pSprite);
void usePictureChanger(XSPRITE* pXSource, int objType, int objIndex);
void useSequentialTx(XSPRITE* pXSource, COMMAND_ID cmd, bool setState);
void useRandomTx(XSPRITE* pXSource, COMMAND_ID cmd, bool setState);
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
void useDudeSpawn(XSPRITE* pXSource, spritetype* pSprite);
void useCustomDudeSpawn(DBloodActor* pXSource, DBloodActor* pSprite);
bool txIsRanged(XSPRITE* pXSource);
void seqTxSendCmdAll(XSPRITE* pXSource, int nIndex, COMMAND_ID cmd, bool modernSend);
// ------------------------------------------------------------------------- //
2021-09-02 20:16:18 +00:00
void trPlayerCtrlLink(DBloodActor* pXSource, PLAYER* pPlayer, bool checkCondition);
- Don't change statnum of thing converted to debris back to thing on impact trigger when firing with vector weapon. - Change damage scale and min firedist for Custom Dude. - Remove unnecessary checks in callback of tracking condition. - Fix picWidth() function. - Better initialization of modern stuff. - kModernSeqSpawner: disable all other spawners with same TX ID when enabling current. - Fix: sceneQav was not playing if resurrected with COUSTEAU cheat. - kModernPictureChanger: remove kModernFlag01 feature (deprecated). - kModernSectorFXChanger: add flags to control where exactly light effect should appear. - kModernCondition: - add delay before sending command if condition is true. - take in account state, so kCmdState and kCmdNotState is useful. - fix wrong comparison result in some conditions. - add new various conditions. - kModernPlayerControl: - fix start / stop playing qav scene when triggered with event command converted to sprite command. - add a way to resurrect / heal player. - add event commands to toggle inventory item status via trigger. - fix that Remote and Proximity detonators cannot be given. - add clear all screen effects option. - proper percents for changing movement / jumping. - kModernRandomTX, kModernSequentialTX: change event redirection mode activation from kModernTypeFlag02 to kCmdLink. - kModernSpriteDamager: treat damage value as percents by default, take in account god mode. - kModernEffectGen: fix wrong cstat for effects. - kModernPropertiesChanger: proper underwater status for sectors and players or enemies in it. - Players: assign or update current player's sprite index for all conditions. # Conflicts: # source/blood/src/nnexts.cpp
2020-05-05 18:50:14 +00:00
void trPlayerCtrlStopScene(PLAYER* pPlayer);
// ------------------------------------------------------------------------- //
2021-10-03 10:29:05 +00:00
void modernTypeTrigger(int type, int nDest, DBloodActor* actor, const EVENT& event);
2021-09-03 19:23:22 +00:00
bool modernTypeOperateSector(int nSector, sectortype* pSector, XSECTOR* pXSector, const EVENT& event);
bool modernTypeOperateSprite(int nSprite, spritetype* pSprite, XSPRITE* pXSprite, EVENT event);
bool modernTypeOperateWall(int nWall, walltype* pWall, XWALL* pXWall, EVENT event);
2021-08-28 16:26:24 +00:00
void modernTypeSendCommand(DBloodActor* nSprite, int channel, COMMAND_ID command);
// ------------------------------------------------------------------------- //
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);
void playerQavSceneDraw(PLAYER* pPlayer, int a2, double a3, double a4, int a5);
void playerQavSceneReset(PLAYER* pPlayer);
// ------------------------------------------------------------------------- //
2021-09-01 19:54:23 +00:00
void callbackUniMissileBurst(DBloodActor*actor, int nSprite);
void callbackMakeMissileBlocking(DBloodActor* actor, int nSprite);
void callbackGenDudeUpdate(DBloodActor* actor, int nSprite);
// ------------------------------------------------------------------------- //
PLAYER* getPlayerById(short id);
bool isGrown(spritetype* pSprite);
bool isShrinked(spritetype* pSprite);
bool IsBurningDude(spritetype* pSprite);
bool IsKillableDude(spritetype* pSprite);
bool isActive(int nSprite);
int getDataFieldOfObject(int objType, int objIndex, DBloodActor* objActor, int dataIndex);
bool setDataValueOfObject(int objType, int objIndex, int dataIndex, int value);
bool incDecGoalValueIsReached(XSPRITE* pXSprite);
2021-08-27 17:12:22 +00:00
int getSpriteMassBySize(DBloodActor* pSprite);
2021-08-28 07:50:01 +00:00
bool ceilIsTooLow(DBloodActor* pSprite);
void levelEndLevelCustom(int nLevel);
- Don't change statnum of thing converted to debris back to thing on impact trigger when firing with vector weapon. - Change damage scale and min firedist for Custom Dude. - Remove unnecessary checks in callback of tracking condition. - Fix picWidth() function. - Better initialization of modern stuff. - kModernSeqSpawner: disable all other spawners with same TX ID when enabling current. - Fix: sceneQav was not playing if resurrected with COUSTEAU cheat. - kModernPictureChanger: remove kModernFlag01 feature (deprecated). - kModernSectorFXChanger: add flags to control where exactly light effect should appear. - kModernCondition: - add delay before sending command if condition is true. - take in account state, so kCmdState and kCmdNotState is useful. - fix wrong comparison result in some conditions. - add new various conditions. - kModernPlayerControl: - fix start / stop playing qav scene when triggered with event command converted to sprite command. - add a way to resurrect / heal player. - add event commands to toggle inventory item status via trigger. - fix that Remote and Proximity detonators cannot be given. - add clear all screen effects option. - proper percents for changing movement / jumping. - kModernRandomTX, kModernSequentialTX: change event redirection mode activation from kModernTypeFlag02 to kCmdLink. - kModernSpriteDamager: treat damage value as percents by default, take in account god mode. - kModernEffectGen: fix wrong cstat for effects. - kModernPropertiesChanger: proper underwater status for sectors and players or enemies in it. - Players: assign or update current player's sprite index for all conditions. # Conflicts: # source/blood/src/nnexts.cpp
2020-05-05 18:50:14 +00:00
int useCondition(spritetype* pSource, XSPRITE* pXSource, EVENT event);
bool condPush(XSPRITE* pXSprite, int objType, int objIndex);
bool condRestore(XSPRITE* pXSprite);
bool condCmp(int val, int arg1, int arg2, int comOp);
bool condCmpne(int arg1, int arg2, int comOp);
- Don't change statnum of thing converted to debris back to thing on impact trigger when firing with vector weapon. - Change damage scale and min firedist for Custom Dude. - Remove unnecessary checks in callback of tracking condition. - Fix picWidth() function. - Better initialization of modern stuff. - kModernSeqSpawner: disable all other spawners with same TX ID when enabling current. - Fix: sceneQav was not playing if resurrected with COUSTEAU cheat. - kModernPictureChanger: remove kModernFlag01 feature (deprecated). - kModernSectorFXChanger: add flags to control where exactly light effect should appear. - kModernCondition: - add delay before sending command if condition is true. - take in account state, so kCmdState and kCmdNotState is useful. - fix wrong comparison result in some conditions. - add new various conditions. - kModernPlayerControl: - fix start / stop playing qav scene when triggered with event command converted to sprite command. - add a way to resurrect / heal player. - add event commands to toggle inventory item status via trigger. - fix that Remote and Proximity detonators cannot be given. - add clear all screen effects option. - proper percents for changing movement / jumping. - kModernRandomTX, kModernSequentialTX: change event redirection mode activation from kModernTypeFlag02 to kCmdLink. - kModernSpriteDamager: treat damage value as percents by default, take in account god mode. - kModernEffectGen: fix wrong cstat for effects. - kModernPropertiesChanger: proper underwater status for sectors and players or enemies in it. - Players: assign or update current player's sprite index for all conditions. # Conflicts: # source/blood/src/nnexts.cpp
2020-05-05 18:50:14 +00:00
void condError(XSPRITE* pXCond, const char* pzFormat, ...);
bool condCheckMixed(XSPRITE* pXCond, EVENT event, int cmpOp, bool PUSH);
bool condCheckSector(XSPRITE* pXCond, int cmpOp, bool PUSH);
bool condCheckWall(XSPRITE* pXCond, int cmpOp, bool PUSH);
bool condCheckSprite(XSPRITE* pXCond, int cmpOp, bool PUSH);
bool condCheckPlayer(XSPRITE* pXCond, int cmpOp, bool PUSH);
bool condCheckDude(XSPRITE* pXCond, int cmpOp, bool PUSH);
void condUpdateObjectIndex(int objType, int oldIndex, int newIndex);
XSPRITE* evrListRedirectors(int objType, int objXIndex, XSPRITE* pXRedir, int* tx);
int listTx(XSPRITE* pXRedir, int tx);
- Don't change statnum of thing converted to debris back to thing on impact trigger when firing with vector weapon. - Change damage scale and min firedist for Custom Dude. - Remove unnecessary checks in callback of tracking condition. - Fix picWidth() function. - Better initialization of modern stuff. - kModernSeqSpawner: disable all other spawners with same TX ID when enabling current. - Fix: sceneQav was not playing if resurrected with COUSTEAU cheat. - kModernPictureChanger: remove kModernFlag01 feature (deprecated). - kModernSectorFXChanger: add flags to control where exactly light effect should appear. - kModernCondition: - add delay before sending command if condition is true. - take in account state, so kCmdState and kCmdNotState is useful. - fix wrong comparison result in some conditions. - add new various conditions. - kModernPlayerControl: - fix start / stop playing qav scene when triggered with event command converted to sprite command. - add a way to resurrect / heal player. - add event commands to toggle inventory item status via trigger. - fix that Remote and Proximity detonators cannot be given. - add clear all screen effects option. - proper percents for changing movement / jumping. - kModernRandomTX, kModernSequentialTX: change event redirection mode activation from kModernTypeFlag02 to kCmdLink. - kModernSpriteDamager: treat damage value as percents by default, take in account god mode. - kModernEffectGen: fix wrong cstat for effects. - kModernPropertiesChanger: proper underwater status for sectors and players or enemies in it. - Players: assign or update current player's sprite index for all conditions. # Conflicts: # source/blood/src/nnexts.cpp
2020-05-05 18:50:14 +00:00
void seqSpawnerOffSameTx(XSPRITE* pXSource);
2020-12-06 20:56:09 +00:00
// ------------------------------------------------------------------------- //
void aiPatrolSetMarker(spritetype* pSprite, XSPRITE* pXSprite);
void aiPatrolThink(DBloodActor* actor);
2020-12-06 20:56:09 +00:00
void aiPatrolStop(spritetype* pSprite, int target, bool alarm = false);
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
void aiPatrolAlarmFull(spritetype* pSprite, XSPRITE* pXTarget, bool chain);
void aiPatrolAlarmLite(spritetype* pSprite, XSPRITE* pXTarget);
2020-12-06 20:56:09 +00:00
void aiPatrolState(spritetype* pSprite, int state);
void aiPatrolMove(DBloodActor* actor);
2020-12-06 20:56:09 +00:00
int aiPatrolMarkerBusy(int nExcept, int nMarker);
bool aiPatrolMarkerReached(spritetype* pSprite, XSPRITE* pXSprite);
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
bool aiPatrolGetPathDir(XSPRITE* pXSprite, XSPRITE* pXMarker);
void aiPatrolFlagsMgr(spritetype* pSource, XSPRITE* pXSource, spritetype* pDest, XSPRITE* pXDest, bool copy, bool init);
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) {
return (pAiState && pAiState->stateType >= kAiStatePatrolWaitL && pAiState->stateType <= kAiStatePatrolWaitW);
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
}
inline bool aiPatrolMoving(AISTATE* pAiState) {
return (pAiState && pAiState->stateType >= kAiStatePatrolMoveL && pAiState->stateType <= kAiStatePatrolMoveW);
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
}
inline bool aiPatrolTurning(AISTATE* pAiState) {
return (pAiState && pAiState->stateType >= kAiStatePatrolTurnL && pAiState->stateType <= kAiStatePatrolTurnW);
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
}
inline bool aiInPatrolState(AISTATE* pAiState) {
return (pAiState && pAiState->stateType >= kAiStatePatrolBase && pAiState->stateType < kAiStatePatrolMax);
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
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
// ------------------------------------------------------------------------- //
bool readyForCrit(spritetype* pHunter, spritetype* pVictim);
int sectorInMotion(int nSector);
Increase kMaxSuperXSprites from 128 to 512. Fix mirror (ROR) intialization so it won't crash if more than 1024 sectors used. Fix random item generator so items that inherits TX ID won't send command at respawn. Fix for things (400 - 433) that affected by modern physics so it won't return to vanilla physics after getting damage. Fix kTeleportTarget so teleported sprites won't stuck in floors or ceilings. Corpses won't gib as gargoyles anymore (gModernMap). kModernCondition: - remove bool comparison (condCmpb). - remove no extra comparison (condCmpne). - remove "else if" search at level start. - add global (game) conditions type. - add more conditions. - make error report a bit more informative. Add more options and damage effects for kModernSpriteDamager. Add more options for kModernMissileGen and allow to spawn projectile on TX ID sprites location. Add more options and vertical wind processing for kModernWindGen. Add more options and effects for kModernEffectGen. Allow kMarkerDudeSpawn to spawn enemies on TX ID sprites location (gModernMap). Allow kModernCustomDudeSpawn to spawn dude on TX ID sprites location. Add Screen and Aim trigger flags for sprites that can be triggered with Sight (gModernMap). Patrolling enemies: - add turn AI state. - add "return back" option for path markers. - add "turning while waiting" option for markers. - make enemies to hear some sounds assuming that player generates and hears it too. - add kModernStealthRegion type to affect current spot progress velocity. - replace AI's CanMove and aiChooseDirection to a better versions. - make flying enemies to not spin around the marker. - treat Phantasm as flying enemy! - allow to continue patrol when falling in water. Fix compile warnings Various minor fixes / cleanup.
2021-07-19 21:15:26 +00:00
void clampSprite(spritetype* pSprite, int which = 0x03);
2020-12-06 20:56:09 +00:00
#endif
2021-08-28 16:26:24 +00:00
inline bool valueIsBetween(int val, int min, int max)
{
return (val > min && val < max);
}
////////////////////////////////////////////////////////////////////////
// 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