114 int32_t nx, int32_t ny, int32_t nr,
238 memset(&rc,
'\0',
sizeof(rc));
294 if (!pCont || !cobj->
Enter(pCont,
true,
false, &fRejectCollect))
300 cobj->Contained =
nullptr;
301 cobj->AssignRemoval();
382 if (takebreath > 0)
DoBreath(takebreath);
410 int32_t iNewAge = iPlayingTime / 3600 / 5;
481 if (
Alive && !fForced)
return;
522 if (!pDef)
return false;
564 if (obj->pEffects) obj->pEffects->OnObjectChangedDef(
this);
566 if (pContainer)
Enter(pContainer,
false);
577 if (!iChange)
return;
593 iChange = Clamp<int32_t>(iChange, std::numeric_limits<int32_t>::min()/scale, std::numeric_limits<int32_t>::max()/scale)*scale;
596 bool fWasZero=(
Energy==0);
635 int32_t old_con =
Con;
639 Con=std::max<int32_t>(
Con+iChange,0);
652 if (!grow_from_center)
770 Output.
AppendFormat(
" %s: Priority %d, Interval %d", pEffect->GetName(), pEffect->iPriority, pEffect->iInterval);
777 "Object"), &Output2,
"C4Object::GetDataString");
785 if (!NewName &&
Info)
846 while ((pGfxOvrl = pNextGfxOvrl))
848 pNextGfxOvrl = pGfxOvrl->
GetNext();
849 if (pGfxOvrl->GetOverlayObject() == pObj)
949 for (
int i = 1; ; i++)
964 for (
int i = 1; pCmd; i++, pCmd = pCmd->
Next)
1021 pCom->Denumerate(numbers);
1029 pGfxOvrl->DenumeratePointers();
1093 for (pCom=
Command; pCom; pCom=pNext)
1095 pNext=pCom->
Next;
delete pCom; pCom=pNext;
1141 if (
Owner == iOwner)
return true;
1143 int32_t iOldOwner=
Owner;
1156 if (!pFrom)
return false;
1159 if (pFrom ==
this)
return true;
1161 if (!pFrom->
Info)
return false;
1248 if (!
Status)
return sResult;
1253 C4Value vInfo = pEff->DoCall(
this,
PSFS_FxInfo, par[0], par[1], par[2], par[3], par[4], par[5], par[6]);
1254 if (!vInfo)
continue;
1257 DebugLogF(
"Effect %s(#%d) on object %s (#%d) returned wrong info type %d.", pEff->GetName(), pEff->Number,
GetName(),
Number, vInfo.
GetType());
1260 if (psInfo && (szEffInfo = psInfo->
GetCStr()))
1265 sResult.
Append(szEffInfo);
1280 bool fAnyPlr = (iPlayerNumber ==
NO_OWNER);
1284 if (fAnyPlr ||
Owner == iPlayerNumber)
const uint32_t OCF_Entrance
const int32_t C4D_StaticBack
C4Def * C4Id2Def(C4ID id)
#define C4FxCall_EngAsphyxiation
#define C4FxCall_RemoveDeath
#define C4FxCall_EngCorrosion
#define C4FxCall_RemoveClear
void GameMsgObject(const char *szText, C4Object *pTarget)
#define PSF_CrewSelection
#define PSF_RelaunchPlayer
#define PSF_OnCompletionChange
#define PSF_OnSynchronized
#define PSF_OnInIncendiaryMaterial
#define PSF_OnOwnerChanged
#define PSF_CalcSellValue
#define PSF_ContentsDestruction
#define PSF_ActivateEntrance
C4AulScriptEngine ScriptEngine
const int32_t C4MaxPhysical
bool GBackSemiSolid(int32_t x, int32_t y)
int32_t GBackMat(int32_t x, int32_t y)
const char * LoadResStr(const char *id)
bool DebugLogF(const char *strMessage ...)
C4MaterialMap MaterialMap
const StdMeshInstance::AttachedMesh::DenumeratorFactoryFunc C4MeshDenumeratorFactory
C4ParticleSystem Particles
int32_t ValidPlr(int32_t plr)
C4Fixed itofix(int32_t x)
void AddDbgRec(C4RecordChunkType eType, const void *pData, int iSize)
C4GameScriptHost GameScript
C4SoundInstance * StartSoundEffect(const char *szSndName, bool fLoop, int32_t iVolume, C4Object *pObj, int32_t iCustomFalloffDistance, int32_t iPitch, C4SoundModifier *modifier)
C4Value C4VInt(int32_t i)
C4Value C4VPropList(C4PropList *p)
C4Value C4VString(C4String *pStr)
StdInsertAdapt< T, I > mkInsertAdapt(T &&rObj, I &&rIns, bool fBefore=true)
StdPtrAdapt< T > mkNamingPtrAdapt(T *&rpObj, const char *szNaming)
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
#define toC4CStrBuf(rBuf)
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
StdStrBuf FormatString(const char *szFmt,...)
StdMeshInstanceAnimationNode * Animation
C4Effect * pGlobalEffects
void ClearPointers(C4Object *pObj)
int32_t IncompleteActivity
int32_t GetValue(C4Object *pInBase, int32_t iBuyPlayer)
void DoDamage(int32_t &riDamage, int32_t iDamageType, int32_t iCausePlr)
void ReAssignAllCallbackFunctions()
void Denumerate(C4ValueNumbers *) override
void ClearPointers(C4PropList *pObj)
void OnObjectChangedDef(C4PropList *pObj)
static void Execute(C4Effect **ppEffectList)
void ClearAll(int32_t iClearFlag)
void Remove(C4Object *pObj)
C4TransferZones TransferZones
void ClearPointers(C4Object *obj)
C4Value GRBroadcast(const char *function, C4AulParSet *pars=nullptr, bool pass_error=false, bool reject_test=false)
bool Remove(C4Object *game_object) override
bool Add(C4Object *game_object)
C4ObjectList InactiveObjects
C4Effect * pScenarioEffects
C4GraphicsOverlay * GetNext() const
const char * ToString() const
void AssertObjectNotInList(C4Object *pObj)
bool Enter(C4Object *pTarget, bool fCalls=true, bool fCopyMotion=true, bool *pfRejectCollect=nullptr)
C4ValueArray * GetProperties() const override
BYTE GetArea(int32_t &aX, int32_t &aY, int32_t &aWdt, int32_t &aHgt) const
C4PropList * GetAction() const
void UpdatLastEnergyLossCause(int32_t iNewCausePlr)
bool HalfVehicleSolidMask
void UpdateScriptPointers()
void UpdateFace(bool bUpdateShape, bool fTemp=false)
class C4GraphicsOverlay * pGfxOverlay
bool GrabInfo(C4Object *pFrom)
bool ActivateEntrance(int32_t by_plr, C4Object *by_obj)
int32_t GetValue(C4Object *pInBase, int32_t iForPlayer)
bool GetPropertyByS(const C4String *k, C4Value *pResult) const override
bool SetActionByName(C4String *ActName, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls=SAC_StartCall|SAC_AbortCall, bool fForce=false)
int32_t lightFadeoutRange
C4DrawTransform * pDrawTransform
bool Init(C4PropList *ndef, C4Object *pCreator, int32_t owner, C4ObjectInfo *info, int32_t nx, int32_t ny, int32_t nr, C4Real nxdir, C4Real nydir, C4Real nrdir, int32_t iController)
void SetName(const char *NewName=nullptr) override
bool IsPlayerObject(int32_t iPlayerNumber=NO_OWNER) const
StdStrBuf GetDataString()
void ClearPointers(C4Object *ptr)
class C4ObjectMenu * Menu
void SetDir(int32_t tdir)
bool SetLightRange(int32_t iToRange, int32_t iToFadeoutRange)
C4MaterialList * MaterialContents
bool CloseMenu(bool fForce)
void ClearParticleLists()
bool RemoveGraphicsOverlay(int32_t iOverlayID)
C4SolidMask * pSolidMaskData
int32_t iLastAttachMovementFrame
StdMeshInstance * pMeshInstance
void AssignDeath(bool fForced)
void DoCon(int32_t iChange, bool grow_from_center)
int32_t LastEnergyLossCausePlayer
void AssignRemoval(bool exit_contents=false)
void ClearInfo(C4ObjectInfo *pInfo)
void ClearContentsAndContained(bool fDoCalls=true)
C4NotifyingObjectList Contents
class C4ParticleList * BackParticles
void Denumerate(C4ValueNumbers *) override
bool CheckSolidMaskRect()
bool Exit(int32_t iX=0, int32_t iY=0, int32_t iR=0, C4Real iXDir=Fix0, C4Real iYDir=Fix0, C4Real iRDir=Fix0, bool fCalls=true)
bool StatusDeactivate(bool fClearPointers)
bool IsUserPlayerObject()
BYTE GetEntranceArea(int32_t &aX, int32_t &aY, int32_t &aWdt, int32_t &aHgt) const
void CompileFunc(StdCompiler *pComp, C4ValueNumbers *)
bool ChangeDef(C4ID idNew)
void DoDamage(int32_t iLevel, int32_t iCausedByPlr, int32_t iCause)
StdStrBuf GetInfoString()
void UpdateShape(bool bUpdateVertices=true)
bool SetAction(C4PropList *Act, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls=SAC_StartCall|SAC_AbortCall, bool fForce=false)
void SetPropertyByS(C4String *k, const C4Value &to) override
bool SetOwner(int32_t iOwner)
C4DefGraphics * pGraphics
C4DefGraphics * GetGraphics() const
void UpdateGraphics(bool fGraphicsChanged, bool fTemp=false)
void ResetProperty(C4String *k) override
void DoBreath(int32_t iChange)
class C4ParticleList * FrontParticles
void DoEnergy(int32_t iChange, bool fExact, int32_t iCause, int32_t iCausedByPlr)
bool DenumeratePointers()
const C4ObjectLink * GetLink(const C4Object *obj) const
virtual bool Add(C4Object *new_obj, SortType sort_type, C4ObjectList *sorted_list=nullptr)
virtual bool Remove(C4Object *obj)
int ObjectCount(C4ID id=C4ID::None) const
StdStrBuf GetNameList(C4DefList &defs) const
bool IsContained(const C4Object *obj) const
C4Object * GetObject(int index=0) const
void DenumeratePointers()
static const C4ObjectPtr Null
void ReleaseParticleList(C4ParticleList *first, C4ParticleList *second=nullptr)
const char * GetName() const
C4PlayerType GetType() const
bool MakeCrewMember(C4Object *pObj, bool fForceInfo=true, bool fDoCalls=true)
void ClearPointers(C4Object *tptr, bool fDeath)
void ClearPointers(C4Object *pObj)
C4Player * Get(int iPlayer) const
virtual void SetName(const char *NewName=nullptr)
int32_t GetPropertyInt(C4PropertyName k, int32_t default_val=0) const
int32_t GetPropertyBool(C4PropertyName n, bool default_val=false) const
virtual const char * GetName() const
virtual C4ValueArray * GetProperties() const
virtual bool GetPropertyByS(const C4String *k, C4Value *pResult) const
virtual void ResetProperty(C4String *k)
void AppendDataString(StdStrBuf *out, const char *delim, int depth=3, bool ignore_reference_parent=false) const
virtual void Denumerate(C4ValueNumbers *)
virtual C4Def const * GetDef() const
C4Value Call(C4PropertyName k, C4AulParSet *pPars=nullptr, bool fPassErrors=false)
virtual void SetPropertyByS(C4String *k, const C4Value &to)
void SetProperty(C4PropertyName k, const C4Value &to)
const char * GetName() const override
void Stretch(int32_t iCon, bool bUpdateVertices)
void Jolt(int32_t iCon, bool bUpdateVertices)
void CopyFrom(C4Shape rFrom, bool bCpyVertices, bool fCopyVerticesFromSelf)
void Rotate(C4Real Angle, bool bUpdateVertices)
const char * GetCStr() const
void ClearPointers(C4Object *pObj)
C4String * getStr() const
int32_t GetAudibility(int32_t x, int32_t y, int32_t *pan, int32_t audibility_radius=0, int32_t *out_player=nullptr)
void Value(const T &rStruct)
virtual bool FollowName(const char *szName)
void excNotFound(const char *szMessage,...)
virtual bool isDeserializer()
void SetCompletion(float completion)
AttachedMesh * GetAttachParent() const
AnimationNode * GetRootAnimationForSlot(int slot)
void ClearPointers(class C4Object *pObj)
void SetFaceOrderingForClrModulation(uint32_t clrmod)
void DenumeratePointers()
void ExecuteAnimation(float dt)
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
const char * getData() const
void AppendChar(char cChar)
void Append(const char *pnData, size_t iChars)