OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Object.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 /* That which fills the world with life */
19 
20 #ifndef INC_C4Object
21 #define INC_C4Object
22 
23 #include "game/C4GameScript.h"
24 #include "graphics/C4Facet.h"
25 #include "object/C4Id.h"
26 #include "object/C4ObjectPtr.h"
27 #include "object/C4Sector.h"
28 #include "object/C4Shape.h"
29 #include "script/C4PropList.h"
30 #include "script/C4Value.h"
31 
32 /* Object status */
33 
34 #define C4OS_DELETED 0
35 #define C4OS_NORMAL 1
36 #define C4OS_INACTIVE 2
37 
38 /* Action.Dir is the direction the object is actually facing. */
39 
40 #define DIR_None 0
41 #define DIR_Left 0
42 #define DIR_Right 1
43 
44 /* Action.ComDir tells an active object which way it ought to be going.
45  If you set the ComDir to COMD_Stop, the object won't sit still immediately
46  but will try to slow down according to it's current Action. ComDir values
47  circle clockwise from COMD_Up 1 through COMD_UpLeft 8. */
48 
49 #define COMD_None -1
50 #define COMD_Stop 0
51 #define COMD_Up 1
52 #define COMD_UpRight 2
53 #define COMD_Right 3
54 #define COMD_DownRight 4
55 #define COMD_Down 5
56 #define COMD_DownLeft 6
57 #define COMD_Left 7
58 #define COMD_UpLeft 8
59 
60 /* Visibility values tell conditions for an object's visibility */
61 
62 #define VIS_All 0
63 #define VIS_None 1
64 #define VIS_Owner 2
65 #define VIS_Allies 4
66 #define VIS_Enemies 8
67 #define VIS_Select 16
68 #define VIS_God 32
69 #define VIS_LayerToggle 64
70 #define VIS_OverlayOnly 128
71 #define VIS_Editor 256
72 
73 
74 class C4Action
75 {
76 public:
77  C4Action();
78  ~C4Action();
79 public:
80  int32_t Dir;
81  int32_t DrawDir; // NoSave // - needs to be calculated for old-style objects.txt anyway
82  int32_t ComDir;
83  int32_t Time;
84  int32_t Data;
85  int32_t Phase,PhaseDelay;
86  int32_t t_attach; // SyncClearance-NoSave //
88  C4Facet Facet; // NoSave //
89  int32_t FacetX,FacetY; // NoSave //
91 public:
92  void Default();
93  void CompileFunc(StdCompiler *pComp);
94 
95  // BRIDGE procedure: data mask
96  void SetBridgeData(int32_t iBridgeTime, bool fMoveClonk, bool fWall, int32_t iBridgeMaterial);
97  void GetBridgeData(int32_t &riBridgeTime, bool &rfMoveClonk, bool &rfWall, int32_t &riBridgeMaterial);
98 };
99 
101 {
102 private:
103  void UpdateInMat();
104  void Splash();
105 public:
106  C4Object();
107  ~C4Object() override;
109  int32_t RemovalDelay; // NoSave //
110  int32_t Owner;
111  int32_t Controller;
112  int32_t LastEnergyLossCausePlayer; // last player that caused an energy loss to this Clonk (used to trace kills when player tumbles off a cliff, etc.)
113  int32_t Category;
114  int32_t old_x, old_y; C4LArea Area; // position as currently seen by Game.Objecets.Sectors. UpdatePos to sync.
115  int32_t Mass, OwnMass;
116  int32_t Damage;
117  int32_t Energy;
118  int32_t Breath;
119  int32_t InMat; // SyncClearance-NoSave //
120  uint32_t Color;
121  int32_t Audible, AudiblePan, AudiblePlayer; // NoSave //
122  int32_t lightRange;
124  uint32_t lightColor;
125  C4Real fix_x,fix_y,fix_r; // SyncClearance-Fix //
127  int32_t iLastAttachMovementFrame; // last frame in which Attach-movement by a SolidMask was done
128  bool Mobile;
129  bool Unsorted; // NoSave //
130  bool Initializing; // NoSave //
131  bool InLiquid;
133  uint32_t t_contact; // SyncClearance-NoSave //
134  uint32_t OCF;
135  uint32_t Marker; // state var used by Objects::CrossCheck and C4FindObject - NoSave
137  C4DrawTransform *pDrawTransform; // assigned drawing transformation
138 
139  // Menu
140  class C4ObjectMenu *Menu; // SyncClearance-NoSave //
141 
142  C4Facet TopFace; // NoSave //
146 
149  bool fOwnVertices; // if set, vertices aren't restored from def but from end of own vtx list
153  C4MaterialList *MaterialContents; // SyncClearance-NoSave //
154  C4DefGraphics *pGraphics; // currently set object graphics
155  StdMeshInstance* pMeshInstance; // Instance for mesh-type objects
156  C4Effect *pEffects; // linked list of effects
157  // particle lists that are bound to this object (either in front of behind it)
159  void ClearParticleLists();
160 
161  uint32_t ColorMod; // color by which the object-drawing is modulated
162  uint32_t BlitMode; // extra blitting flags (like additive, ClrMod2, etc.)
163  bool CrewDisabled; // CrewMember-functionality currently disabled
164 
165  // Commands
167 
169 
170  class C4GraphicsOverlay *pGfxOverlay; // singly linked list of overlay graphics
171 protected:
172  bool OnFire;
173  int32_t Con;
174  int32_t Plane;
175  bool Alive;
177 public:
178  void Resort();
179  void SetPlane(int32_t z) { if (z) Plane = z; Resort(); }
180  int32_t GetPlane() const { return Plane; }
181  int32_t GetSolidMaskPlane() const;
182  void SetCommand(int32_t iCommand, C4Object *pTarget, C4Value iTx, int32_t iTy=0, C4Object *pTarget2=nullptr, bool fControl=false, C4Value iData=C4VNull, int32_t iRetries=0, C4String *szText=nullptr);
183  void SetCommand(int32_t iCommand, C4Object *pTarget=nullptr, int32_t iTx=0, int32_t iTy=0, C4Object *pTarget2=nullptr, bool fControl=false, C4Value iData=C4VNull, int32_t iRetries=0, C4String *szText=nullptr)
184  { SetCommand(iCommand, pTarget, C4VInt(iTx), iTy, pTarget2, fControl, iData, iRetries, szText); }
185  bool AddCommand(int32_t iCommand, C4Object *pTarget, C4Value iTx, int32_t iTy=0, int32_t iUpdateInterval=0, C4Object *pTarget2=nullptr, bool fInitEvaluation=true, C4Value iData=C4VNull, bool fAppend=false, int32_t iRetries=0, C4String *szText=nullptr, int32_t iBaseMode=0);
186  bool AddCommand(int32_t iCommand, C4Object *pTarget=nullptr, int32_t iTx=0, int32_t iTy=0, int32_t iUpdateInterval=0, C4Object *pTarget2=nullptr, bool fInitEvaluation=true, C4Value iData=C4VNull, bool fAppend=false, int32_t iRetries=0, C4String *szText=nullptr, int32_t iBaseMode=0)
187  { return AddCommand(iCommand, pTarget, C4VInt(iTx), iTy, iUpdateInterval, pTarget2, fInitEvaluation, iData, fAppend, iRetries, szText, iBaseMode); }
188  C4Command *FindCommand(int32_t iCommandType) const; // find a command of the given type
189  void ClearCommand(C4Command *pUntil);
190  void ClearCommands();
191  void DrawSelectMark(C4TargetFacet &cgo) const;
192  void UpdateActionFace();
193  void SyncClearance();
194  void SetSolidMask(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iTX, int32_t iTY);
195  void SetHalfVehicleSolidMask(bool set);
196  bool CheckSolidMaskRect(); // clip bounds of SolidMask in graphics - return whether the solidmask still exists
197  bool MenuCommand(const char *szCommand);
198 
199  void Clear();
200  void ClearInfo(C4ObjectInfo *pInfo);
201  bool AssignInfo();
202  bool ValidateOwner();
203  bool AssignLightRange();
204  void DrawPicture(C4Facet &cgo, bool fSelected=false, C4DrawTransform* transform=nullptr);
205  void Picture2Facet(C4FacetSurface &cgo); // set picture to facet, or create facet in current size and draw if specific states are being needed
206  void Default();
207  bool Init(C4PropList *ndef, C4Object *pCreator,
208  int32_t owner, C4ObjectInfo *info,
209  int32_t nx, int32_t ny, int32_t nr,
210  C4Real nxdir, C4Real nydir, C4Real nrdir, int32_t iController);
211  void CompileFunc(StdCompiler *pComp, C4ValueNumbers *);
212  void Denumerate(C4ValueNumbers *) override;
213  void DrawLine(C4TargetFacet &cgo, int32_t at_player);
214  bool SetPhase(int32_t iPhase);
215  void AssignRemoval(bool fExitContents=false);
217  void Draw(C4TargetFacet &cgo, int32_t iByPlayer = -1, DrawMode eDrawMode=ODM_Normal, float offX=0, float offY=0);
218  void DrawTopFace(C4TargetFacet &cgo, int32_t iByPlayer = -1, DrawMode eDrawMode=ODM_Normal, float offX=0, float offY=0);
219  void DrawActionFace(C4TargetFacet &cgo, float offX, float offY) const;
220  void DrawFace(C4TargetFacet &cgo, float offX, float offY, int32_t iPhaseX=0, int32_t iPhaseY=0) const;
221  void DrawFaceImpl(C4TargetFacet &cgo, bool action, float fx, float fy, float fwdt, float fhgt, float tx, float ty, float twdt, float thgt, C4DrawTransform* transform) const;
222  void Execute();
223  void ClearPointers(C4Object *ptr);
224  bool ExecMovement();
225  void ExecAction();
226  bool ExecLife();
227  bool ExecuteCommand();
228  void AssignDeath(bool fForced); // assigns death - if forced, it's killed even if an effect stopped this
229  void ContactAction();
230  void NoAttachAction();
231  void DoMovement();
232  void Stabilize();
233  void SetOCF();
234  void UpdateOCF(); // Update fluctuant OCF
235  void UpdateShape(bool bUpdateVertices=true);
236  void UpdatePos(); // pos/shape changed
237  void UpdateSolidMask(bool fRestoreAttachedObjects);
238  void UpdateMass();
239  bool ChangeDef(C4ID idNew);
240  void UpdateFace(bool bUpdateShape, bool fTemp=false);
241  void UpdateGraphics(bool fGraphicsChanged, bool fTemp=false); // recreates solidmasks (if fGraphicsChanged), validates Color
242  void UpdateFlipDir(); // applies new flipdir to draw transform matrix; creates/deletes it if necessary
243  bool At(int32_t ctx, int32_t cty) const;
244  bool At(int32_t ctx, int32_t cty, DWORD &ocf) const;
245  void GetOCFForPos(int32_t ctx, int32_t cty, DWORD &ocf) const;
246  bool CloseMenu(bool fForce);
247  bool ActivateMenu(int32_t iMenu, int32_t iMenuSelect=0, int32_t iMenuData=0, int32_t iMenuPosition=0, C4Object *pTarget=nullptr);
248  int32_t ContactCheck(int32_t atx, int32_t aty, uint32_t *border_hack_contacts=nullptr, bool collide_halfvehic=false);
249  bool Contact(int32_t cnat);
250  void StopAndContact(C4Real & ctco, C4Real limit, C4Real & speed, int32_t cnat);
251  enum { SAC_StartCall = 1, SAC_EndCall = 2, SAC_AbortCall = 4 };
252  C4PropList* GetAction() const;
253  bool SetAction(C4PropList * Act, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls = SAC_StartCall | SAC_AbortCall, bool fForce = false);
254  bool SetActionByName(C4String * ActName, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls = SAC_StartCall | SAC_AbortCall, bool fForce = false);
255  bool SetActionByName(const char * szActName, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls = SAC_StartCall | SAC_AbortCall, bool fForce = false);
256  void SetDir(int32_t tdir);
257  void SetCategory(int32_t Category) { this->Category = Category; Resort(); SetOCF(); }
258  int32_t GetProcedure() const;
259  bool Enter(C4Object *pTarget, bool fCalls=true, bool fCopyMotion=true, bool *pfRejectCollect=nullptr);
260  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);
261  void CopyMotion(C4Object *from);
262  void ForcePosition(C4Real tx, C4Real ty);
263  void MovePosition(int32_t dx, int32_t dy);
264  void MovePosition(C4Real dx, C4Real dy);
265  void DoMotion(int32_t mx, int32_t my);
266  bool ActivateEntrance(int32_t by_plr, C4Object *by_obj);
267  void DoDamage(int32_t iLevel, int32_t iCausedByPlr, int32_t iCause);
268  void DoEnergy(int32_t iChange, bool fExact, int32_t iCause, int32_t iCausedByPlr);
269  void UpdatLastEnergyLossCause(int32_t iNewCausePlr);
270  void DoBreath(int32_t iChange);
271  void DoCon(int32_t iChange, bool grow_from_center);
272  int32_t GetCon() const { return Con; }
273  void DoExperience(int32_t change);
274  bool Promote(int32_t torank, bool exception, bool fForceRankName);
275  bool Push(C4Real txdir, C4Real dforce, bool fStraighten);
276  bool Lift(C4Real tydir, C4Real dforce);
277  void Fling(C4Real txdir, C4Real tydir, bool fAddSpeed); // set/add given speed to current, setting jump/tumble-actions
279  bool CreateContentsByList(C4IDList &idlist);
280  BYTE GetArea(int32_t &aX, int32_t &aY, int32_t &aWdt, int32_t &aHgt) const;
281  inline int32_t addtop() const { return std::max<int32_t>(18-Shape.Hgt,0); } // Minimum top action size for build check
282  inline int32_t Left() const { return GetX()+Shape.x; } // left border of shape
283  inline int32_t Top() const { return GetY()+Shape.y-addtop(); } // top border of shape (+build-top)
284  inline int32_t Width() const { return Shape.Wdt; } // width of shape
285  inline int32_t Height() const { return Shape.Hgt+addtop(); } // height of shape (+build-top)
286  inline int32_t GetX() const { return fixtoi(fix_x); }
287  inline int32_t GetY() const { return fixtoi(fix_y); }
288  inline int32_t GetR() const { return fixtoi(fix_r); }
289  inline C4Real GetFixedX() const { return fix_x; }
290  inline C4Real GetFixedY() const { return fix_y; }
291  inline C4Real GetFixedR() const { return fix_r; }
292  BYTE GetEntranceArea(int32_t &aX, int32_t &aY, int32_t &aWdt, int32_t &aHgt) const;
293  BYTE GetMomentum(C4Real &rxdir, C4Real &rydir) const;
294  C4Real GetSpeed() const;
296  void SetName (const char *NewName = nullptr) override;
297  int32_t GetValue(C4Object *pInBase, int32_t iForPlayer);
298  bool SetOwner(int32_t iOwner);
299  bool SetLightRange(int32_t iToRange, int32_t iToFadeoutRange);
300  uint32_t GetLightColor() const { return lightColor; }
301  bool SetLightColor(uint32_t iValue);
302  void SetOnFire(bool OnFire) override { this->OnFire = OnFire; SetOCF(); }
303  bool GetOnFire() const { return OnFire; }
304  void SetAlive(bool Alive) { this->Alive = Alive; SetOCF(); }
305  bool GetAlive() const { return Alive; }
306  void UpdateLight();
307  void SetAudibilityAt(C4TargetFacet &cgo, int32_t iX, int32_t iY, int32_t player);
308  bool IsVisible(int32_t iForPlr, bool fAsOverlay) const; // return whether an object is visible for the given player
309  void SetRotation(int32_t nr);
310  void PrepareDrawing() const; // set blit modulation and/or additive blitting
311  void FinishedDrawing() const; // reset any modulation
312  void DrawSolidMask(C4TargetFacet &cgo) const; // draw topface image only
313  bool Collect(C4Object *pObj); // add object to contents if it can be carried - no OCF and range checks are done!
314  bool GrabInfo(C4Object *pFrom); // grab info object from other object
315  bool ShiftContents(bool fShiftBack, bool fDoCalls); // rotate through contents
316  void DirectComContents(C4Object *pTarget, bool fDoCalls); // direct com: scroll contents to given ID
317  void GetParallaxity(int32_t *parX, int32_t *parY) const;
318  bool GetDrawPosition(const C4TargetFacet & cgo, float & resultx, float & resulty, float & resultzoom) const; // converts the object's position into screen coordinates
319  bool GetDrawPosition(const C4TargetFacet & cgo, float x, float y, float zoom, float & resultx, float & resulty, float & resultzoom) const; // converts object coordinates into screen coordinates
320  bool IsInLiquidCheck() const; // returns whether the Clonk is within liquid material
321  void UpdateInLiquid(); // makes splash when a liquid is entered
322  void GrabContents(C4Object *pFrom); // grab all contents that don't reject it
323  bool GetDragImage(C4Object **drag_object, C4Def **drag_id) const; // return true if object is draggable; assign drag_object/drag_id to gfx to be used for dragging
324  int32_t AddObjectAndContentsToArray(C4ValueArray *target_array, int32_t index=0); // add self, contents and child contents count recursively to value array. Return index after last added item.
325 
326 protected:
327  void SideBounds(C4Real &ctcox); // apply bounds at side; regarding bourder bound and pLayer
328  void VerticalBounds(C4Real &ctcoy); // apply bounds at top and bottom; regarding border bound and pLayer
329 
330 public:
331  void BoundsCheck(C4Real &ctcox, C4Real &ctcoy) // do bound checks, correcting target positions as necessary and doing contact-calls
332  { SideBounds(ctcox); VerticalBounds(ctcoy); }
333 
334  bool DoSelect(); // cursor callback if not disabled
335  void UnSelect(); // unselect callback
336  void GetViewPos(float &riX, float &riY, float tx, float ty, const C4Facet &fctViewport) const;
337  void GetViewPosPar(float &riX, float &riY, float tx, float ty, const C4Facet &fctViewport) const; // get position this object is seen at, calculating parallaxity
338  bool PutAwayUnusedObject(C4Object *pToMakeRoomForObject); // either directly put the least-needed object away, or add a command to do it - return whether successful
339 
340  C4DefGraphics *GetGraphics() const { return pGraphics; } // return current object graphics
341  bool SetGraphics(const char *szGraphicsName=nullptr, C4Def *pSourceDef=nullptr); // set used graphics for object; if szGraphicsName or *szGraphicsName are nullptr, the default graphics of the given def are used; pSourceDef defaults to own def
342  bool SetGraphics(C4DefGraphics *pNewGfx, bool fUpdateData); // set used graphics for object
343 
344  class C4GraphicsOverlay *GetGraphicsOverlay(int32_t iForID) const; // get specified gfx overlay
345  class C4GraphicsOverlay *GetGraphicsOverlay(int32_t iForID, bool fCreate); // get specified gfx overlay; create if not existant and specified
346  bool RemoveGraphicsOverlay(int32_t iOverlayID); // remove specified overlay from the overlay list; return if found
347  bool HasGraphicsOverlayRecursion(const C4Object *pCheckObj) const; // returns whether, at any overlay recursion depth, the given object appears as an MODE_Object-overlay
348  void UpdateScriptPointers(); // update ptrs to C4AulScript *
349 
350  bool StatusActivate(); // put into active list
351  bool StatusDeactivate(bool fClearPointers); // put into inactive list
352 
353  void ClearContentsAndContained(bool fDoCalls=true); // exit from container and eject contents (doing calbacks)
354 
355  bool AdjustWalkRotation(int32_t iRangeX, int32_t iRangeY, int32_t iSpeed);
356 
357  StdStrBuf GetInfoString(); // return def desc plus effects
358 
359  bool CanConcatPictureWith(C4Object *pOtherObject) const; // return whether this object should be grouped with the other in activation lists, contents list, etc.
360 
361  bool IsMoveableBySolidMask(int ComparisonPlane) const;
362 
363  // This function is used for:
364  // -Objects to be removed when a player is removed
365  // -Objects that are not to be saved in "SaveScenario"-mode
366  bool IsPlayerObject(int32_t iPlayerNumber=NO_OWNER) const;// true for any object that belongs to any player (NO_OWNER) or a specified player
367 
368  // This function is used for:
369  // -Objects that are not to be saved in "SaveScenario"-mode
370  bool IsUserPlayerObject();// true for any object that belongs to any player (NO_OWNER) or a specified player
371 
372  // overloaded from C4PropList
373  C4Object * GetObject() override { return this; }
374  C4Object const * GetObject() const override { return this; }
375  void SetPropertyByS(C4String * k, const C4Value & to) override;
376  void ResetProperty(C4String * k) override;
377  bool GetPropertyByS(const C4String *k, C4Value *pResult) const override;
378  C4ValueArray * GetProperties() const override;
379 };
380 
381 #endif
int32_t Height() const
Definition: C4Object.h:285
int32_t GetY() const
Definition: C4Object.h:287
bool DoSelect()
Definition: C4Object.cpp:4310
int32_t ContactCheck(int32_t atx, int32_t aty, uint32_t *border_hack_contacts=nullptr, bool collide_halfvehic=false)
Definition: C4Movement.cpp:136
bool SetLightColor(uint32_t iValue)
Definition: C4Object.cpp:4018
C4Real GetFixedY() const
Definition: C4Object.h:290
void GrabContents(C4Object *pFrom)
Definition: C4Object.cpp:4742
int32_t Left() const
Definition: C4Object.h:282
void SetCommand(int32_t iCommand, C4Object *pTarget=nullptr, int32_t iTx=0, int32_t iTy=0, C4Object *pTarget2=nullptr, bool fControl=false, C4Value iData=C4VNull, int32_t iRetries=0, C4String *szText=nullptr)
Definition: C4Object.h:183
C4DrawTransform * pDrawTransform
Definition: C4Object.h:137
C4LArea Area
Definition: C4Object.h:114
void SetAlive(bool Alive)
Definition: C4Object.h:304
bool Enter(C4Object *pTarget, bool fCalls=true, bool fCopyMotion=true, bool *pfRejectCollect=nullptr)
Definition: C4Object.cpp:1261
#define z
C4Object const * GetObject() const override
Definition: C4Object.h:374
C4ID id
Definition: C4Object.h:108
void MovePosition(int32_t dx, int32_t dy)
Definition: C4Movement.cpp:522
void ForcePosition(C4Real tx, C4Real ty)
Definition: C4Movement.cpp:515
int32_t GetCon() const
Definition: C4Object.h:272
void SetHalfVehicleSolidMask(bool set)
Definition: C4Object.cpp:2469
int32_t Time
Definition: C4Object.h:83
BYTE GetMomentum(C4Real &rxdir, C4Real &rydir) const
Definition: C4Object.cpp:1610
BYTE GetEntranceArea(int32_t &aX, int32_t &aY, int32_t &aWdt, int32_t &aHgt) const
Definition: C4Object.cpp:1589
void FinishedDrawing() const
Definition: C4Object.cpp:4126
void GetViewPos(float &riX, float &riY, float tx, float ty, const C4Facet &fctViewport) const
Definition: C4Object.cpp:4326
void SetDir(int32_t tdir)
Definition: C4Object.cpp:2841
int32_t GetValue(C4Object *pInBase, int32_t iForPlayer)
Definition: C4Object.cpp:1688
bool StatusDeactivate(bool fClearPointers)
Definition: C4Object.cpp:4550
bool Alive
Definition: C4Object.h:175
bool GetDragImage(C4Object **drag_object, C4Def **drag_id) const
Definition: C4Object.cpp:4284
int32_t Mass
Definition: C4Object.h:115
void Draw(C4TargetFacet &cgo, int32_t iByPlayer=-1, DrawMode eDrawMode=ODM_Normal, float offX=0, float offY=0)
Definition: C4Object.cpp:1786
~C4Object() override
Definition: C4Object.cpp:235
void CompileFunc(StdCompiler *pComp, C4ValueNumbers *)
Definition: C4Object.cpp:2159
C4Rect PictureRect
Definition: C4Object.h:151
bool CreateContentsByList(C4IDList &idlist)
Definition: C4Object.cpp:1445
void DrawPicture(C4Facet &cgo, bool fSelected=false, C4DrawTransform *transform=nullptr)
Definition: C4Object.cpp:2337
void Denumerate(C4ValueNumbers *) override
Definition: C4Object.cpp:2309
bool MenuCommand(const char *szCommand)
Definition: C4Object.cpp:2452
void SetAudibilityAt(C4TargetFacet &cgo, int32_t iX, int32_t iY, int32_t player)
Definition: C4Object.cpp:4034
bool SetGraphics(const char *szGraphicsName=nullptr, C4Def *pSourceDef=nullptr)
Definition: C4Object.cpp:4447
void DrawSelectMark(C4TargetFacet &cgo) const
Definition: C4Object.cpp:2511
void AssignDeath(bool fForced)
Definition: C4Object.cpp:990
bool Push(C4Real txdir, C4Real dforce, bool fStraighten)
Definition: C4Object.cpp:1360
C4MaterialList * MaterialContents
Definition: C4Object.h:153
void DoBreath(int32_t iChange)
Definition: C4Object.cpp:1144
uint32_t Marker
Definition: C4Object.h:135
C4PropList * GetAction() const
Definition: C4Object.cpp:2675
C4Command * Command
Definition: C4Object.h:166
int32_t OwnMass
Definition: C4Object.h:115
C4Real rdir
Definition: C4Object.h:126
C4Value C4VInt(int32_t i)
Definition: C4Value.h:242
bool SetActionByName(C4String *ActName, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls=SAC_StartCall|SAC_AbortCall, bool fForce=false)
Definition: C4Object.cpp:2815
bool ShiftContents(bool fShiftBack, bool fDoCalls)
Definition: C4Object.cpp:4220
int32_t old_y
Definition: C4Object.h:114
bool AddCommand(int32_t iCommand, C4Object *pTarget, C4Value iTx, int32_t iTy=0, int32_t iUpdateInterval=0, C4Object *pTarget2=nullptr, bool fInitEvaluation=true, C4Value iData=C4VNull, bool fAppend=false, int32_t iRetries=0, C4String *szText=nullptr, int32_t iBaseMode=0)
Definition: C4Object.cpp:2563
void UpdateInLiquid()
Definition: C4Object.cpp:4695
class C4ParticleList * BackParticles
Definition: C4Object.h:158
bool GetPropertyByS(const C4String *k, C4Value *pResult) const override
Definition: C4Object.cpp:4874
bool AddCommand(int32_t iCommand, C4Object *pTarget=nullptr, int32_t iTx=0, int32_t iTy=0, int32_t iUpdateInterval=0, C4Object *pTarget2=nullptr, bool fInitEvaluation=true, C4Value iData=C4VNull, bool fAppend=false, int32_t iRetries=0, C4String *szText=nullptr, int32_t iBaseMode=0)
Definition: C4Object.h:186
Definition: C4Rect.h:27
int32_t GetPlane() const
Definition: C4Object.h:180
uint8_t BYTE
bool OnFire
Definition: C4Object.h:172
void UpdateOCF()
Definition: C4Object.cpp:759
void DrawTopFace(C4TargetFacet &cgo, int32_t iByPlayer=-1, DrawMode eDrawMode=ODM_Normal, float offX=0, float offY=0)
Definition: C4Object.cpp:2046
int32_t Breath
Definition: C4Object.h:118
void Clear()
Definition: C4Object.cpp:2433
int32_t InMat
Definition: C4Object.h:119
int32_t RemovalDelay
Definition: C4Object.h:109
void DirectComContents(C4Object *pTarget, bool fDoCalls)
Definition: C4Object.cpp:4244
void UpdatLastEnergyLossCause(int32_t iNewCausePlr)
Definition: C4Object.cpp:1133
C4ObjectPtr Target2
Definition: C4Object.h:87
bool ValidateOwner()
Definition: C4Object.cpp:2377
void ClearCommand(C4Command *pUntil)
Definition: C4Object.cpp:2546
C4ObjectPtr Layer
Definition: C4Object.h:136
void ResetProperty(C4String *k) override
Definition: C4Object.cpp:4860
void SetSolidMask(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, int32_t iTX, int32_t iTY)
Definition: C4Object.cpp:2459
void ClearParticleLists()
Definition: C4Object.cpp:245
bool Promote(int32_t torank, bool exception, bool fForceRankName)
Definition: C4Object.cpp:1713
void UpdateGraphics(bool fGraphicsChanged, bool fTemp=false)
Definition: C4Object.cpp:405
int32_t old_x
Definition: C4Object.h:114
StdMeshInstanceAnimationNode * Animation
Definition: C4Object.h:90
C4Real GetSpeed() const
Definition: C4Object.cpp:1618
bool AssignLightRange()
Definition: C4Object.cpp:2417
C4ObjectInfo * Info
Definition: C4Object.h:145
C4Object * GetObject() override
Definition: C4Object.h:373
Definition: C4Real.h:58
void UpdateScriptPointers()
Definition: C4Object.cpp:4804
bool Mobile
Definition: C4Object.h:128
int32_t Energy
Definition: C4Object.h:117
int32_t lightFadeoutRange
Definition: C4Object.h:123
void UpdatePos()
Definition: C4Object.cpp:371
int32_t AudiblePlayer
Definition: C4Object.h:121
int32_t Wdt
Definition: C4Rect.h:30
bool Lift(C4Real tydir, C4Real dforce)
Definition: C4Object.cpp:1410
bool InLiquid
Definition: C4Object.h:131
C4Action()
Definition: C4Action.cpp:23
void SetPlane(int32_t z)
Definition: C4Object.h:179
class C4ObjectMenu * Menu
Definition: C4Object.h:140
void ExecAction()
Definition: C4Object.cpp:3265
bool At(int32_t ctx, int32_t cty) const
Definition: C4Object.cpp:951
bool CloseMenu(bool fForce)
Definition: C4Object.cpp:1571
void SideBounds(C4Real &ctcox)
Definition: C4Movement.cpp:156
C4NotifyingObjectList Contents
Definition: C4Object.h:152
void ClearContentsAndContained(bool fDoCalls=true)
Definition: C4Object.cpp:4576
int32_t Plane
Definition: C4Object.h:174
void Default()
Definition: C4Object.cpp:91
C4Def * Def
Definition: C4Object.h:143
int32_t t_attach
Definition: C4Object.h:86
bool StatusActivate()
Definition: C4Object.cpp:4534
bool CrewDisabled
Definition: C4Object.h:163
void UpdateShape(bool bUpdateVertices=true)
Definition: C4Object.cpp:344
C4ValueArray * GetProperties() const override
Definition: C4Object.cpp:4886
C4Real GetFixedR() const
Definition: C4Object.h:291
int32_t y
Definition: C4Rect.h:30
bool IsUserPlayerObject()
Definition: C4Object.cpp:4834
void UpdateActionFace()
Definition: C4Object.cpp:2796
uint32_t t_contact
Definition: C4Object.h:133
StdStrBuf GetDataString()
Definition: C4Object.cpp:1626
bool GetOnFire() const
Definition: C4Object.h:303
int32_t GetR() const
Definition: C4Object.h:288
int32_t AudiblePan
Definition: C4Object.h:121
void GetOCFForPos(int32_t ctx, int32_t cty, DWORD &ocf) const
Definition: C4Object.cpp:974
int32_t lightRange
Definition: C4Object.h:122
int32_t Top() const
Definition: C4Object.h:283
void UpdateFlipDir()
Definition: C4Object.cpp:442
void DoMovement()
Definition: C4Movement.cpp:202
void ContactAction()
Definition: C4Object.cpp:2918
C4DefGraphics * GetGraphics() const
Definition: C4Object.h:340
int32_t PhaseDelay
Definition: C4Object.h:85
void Default()
Definition: C4Action.cpp:30
void DrawLine(C4TargetFacet &cgo, int32_t at_player)
Definition: C4Object.cpp:2118
void NoAttachAction()
Definition: C4Object.cpp:2883
int32_t Con
Definition: C4Object.h:173
int32_t Owner
Definition: C4Object.h:110
bool SetAction(C4PropList *Act, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls=SAC_StartCall|SAC_AbortCall, bool fForce=false)
Definition: C4Object.cpp:2682
C4Real GetFixedX() const
Definition: C4Object.h:289
bool PutAwayUnusedObject(C4Object *pToMakeRoomForObject)
Definition: C4Object.cpp:4406
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)
Definition: C4Object.cpp:1225
C4Object()
Definition: C4Object.cpp:85
bool ExecLife()
Definition: C4Object.cpp:838
void SyncClearance()
Definition: C4Object.cpp:2492
uint32_t Color
Definition: C4Object.h:120
int32_t GetX() const
Definition: C4Object.h:286
bool EntranceStatus
Definition: C4Object.h:132
void AssignRemoval(bool fExitContents=false)
Definition: C4Object.cpp:254
Definition: C4Def.h:98
const int NO_OWNER
Definition: C4Constants.h:137
void DrawFace(C4TargetFacet &cgo, float offX, float offY, int32_t iPhaseX=0, int32_t iPhaseY=0) const
Definition: C4Object.cpp:529
C4DefGraphics * pGraphics
Definition: C4Object.h:154
void DrawActionFace(C4TargetFacet &cgo, float offX, float offY) const
Definition: C4Object.cpp:576
bool SetOwner(int32_t iOwner)
Definition: C4Object.cpp:3981
void DrawSolidMask(C4TargetFacet &cgo) const
Definition: C4Object.cpp:4134
bool IsMoveableBySolidMask(int ComparisonPlane) const
Definition: C4Object.cpp:4795
void DrawFaceImpl(C4TargetFacet &cgo, bool action, float fx, float fy, float fwdt, float fhgt, float tx, float ty, float twdt, float thgt, C4DrawTransform *transform) const
Definition: C4Object.cpp:479
void UpdateMass()
Definition: C4Object.cpp:640
bool CheckSolidMaskRect()
Definition: C4Object.cpp:2475
void SetCommand(int32_t iCommand, C4Object *pTarget, C4Value iTx, int32_t iTy=0, C4Object *pTarget2=nullptr, bool fControl=false, C4Value iData=C4VNull, int32_t iRetries=0, C4String *szText=nullptr)
Definition: C4Object.cpp:2596
bool Collect(C4Object *pObj)
Definition: C4Object.cpp:4168
Definition: C4Id.h:25
void PrepareDrawing() const
Definition: C4Object.cpp:4118
void BoundsCheck(C4Real &ctcox, C4Real &ctcoy)
Definition: C4Object.h:331
int32_t Damage
Definition: C4Object.h:116
void UpdateFace(bool bUpdateShape, bool fTemp=false)
Definition: C4Object.cpp:379
bool IsInLiquidCheck() const
Definition: C4Object.cpp:4102
bool Unsorted
Definition: C4Object.h:129
int32_t Category
Definition: C4Object.h:113
void VerticalBounds(C4Real &ctcoy)
Definition: C4Movement.cpp:179
void DoCon(int32_t iChange, bool grow_from_center)
Definition: C4Object.cpp:1153
void ClearPointers(C4Object *ptr)
Definition: C4Object.cpp:1736
void CopyMotion(C4Object *from)
Definition: C4Movement.cpp:503
int32_t Width() const
Definition: C4Object.h:284
void SetOnFire(bool OnFire) override
Definition: C4Object.h:302
void ClearCommands()
Definition: C4Object.cpp:2532
bool GetAlive() const
Definition: C4Object.h:305
int32_t x
Definition: C4Rect.h:30
bool ExecMovement()
Definition: C4Movement.cpp:538
class C4GraphicsOverlay * pGfxOverlay
Definition: C4Object.h:170
const C4Value C4VNull
Definition: C4Value.cpp:30
C4ObjectPtr Target
Definition: C4Object.h:87
void Resort()
Definition: C4Object.cpp:2667
C4Object * CreateContents(C4PropList *)
Definition: C4Object.cpp:1437
uint32_t GetLightColor() const
Definition: C4Object.h:300
int32_t Data
Definition: C4Object.h:84
void UnSelect()
Definition: C4Object.cpp:4320
C4Real fix_r
Definition: C4Object.h:125
int32_t Phase
Definition: C4Object.h:85
C4Real fix_x
Definition: C4Object.h:125
StdCopyStrBuf nInfo
Definition: C4Object.h:168
StdStrBuf GetInfoString()
Definition: C4Object.cpp:4714
bool AdjustWalkRotation(int32_t iRangeX, int32_t iRangeY, int32_t iSpeed)
Definition: C4Object.cpp:4587
void DoExperience(int32_t change)
Definition: C4Object.cpp:1211
uint32_t ColorMod
Definition: C4Object.h:161
void GetParallaxity(int32_t *parX, int32_t *parY) const
Definition: C4Object.cpp:4267
C4Facet Facet
Definition: C4Object.h:88
void CompileFunc(StdCompiler *pComp)
Definition: C4Action.cpp:45
int32_t Dir
Definition: C4Object.h:80
void SetName(const char *NewName=nullptr) override
Definition: C4Object.cpp:1680
bool SetLightRange(int32_t iToRange, int32_t iToFadeoutRange)
Definition: C4Object.cpp:4006
BYTE GetArea(int32_t &aX, int32_t &aY, int32_t &aWdt, int32_t &aHgt) const
Definition: C4Object.cpp:1581
int32_t GetProcedure() const
Definition: C4Object.cpp:2861
bool ActivateMenu(int32_t iMenu, int32_t iMenuSelect=0, int32_t iMenuData=0, int32_t iMenuPosition=0, C4Object *pTarget=nullptr)
Definition: C4Object.cpp:1477
void DoEnergy(int32_t iChange, bool fExact, int32_t iCause, int32_t iCausedByPlr)
Definition: C4Object.cpp:1107
void UpdateLight()
Definition: C4Object.cpp:4029
bool IsPlayerObject(int32_t iPlayerNumber=NO_OWNER) const
Definition: C4Object.cpp:4810
int32_t GetSolidMaskPlane() const
Definition: C4Object.cpp:4896
void Picture2Facet(C4FacetSurface &cgo)
Definition: C4Object.cpp:2343
bool GrabInfo(C4Object *pFrom)
Definition: C4Object.cpp:4188
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)
Definition: C4Object.cpp:152
int32_t iLastAttachMovementFrame
Definition: C4Object.h:127
void Stabilize()
Definition: C4Movement.cpp:474
bool AssignInfo()
Definition: C4Object.cpp:2387
bool CanConcatPictureWith(C4Object *pOtherObject) const
Definition: C4Object.cpp:4752
int32_t FacetY
Definition: C4Object.h:89
int32_t AddObjectAndContentsToArray(C4ValueArray *target_array, int32_t index=0)
Definition: C4Object.cpp:4299
void GetViewPosPar(float &riX, float &riY, float tx, float ty, const C4Facet &fctViewport) const
Definition: C4Object.cpp:4387
uint32_t BlitMode
Definition: C4Object.h:162
class C4ParticleList * FrontParticles
Definition: C4Object.h:158
void SetPropertyByS(C4String *k, const C4Value &to) override
Definition: C4Object.cpp:4845
void SetRotation(int32_t nr)
Definition: C4Object.cpp:4107
C4Effect * pEffects
Definition: C4Object.h:156
C4Real fix_y
Definition: C4Object.h:125
void SetOCF()
Definition: C4Object.cpp:668
C4ObjectPtr Contained
Definition: C4Object.h:144
bool ChangeDef(C4ID idNew)
Definition: C4Object.cpp:1041
int32_t DrawDir
Definition: C4Object.h:81
class C4GraphicsOverlay * GetGraphicsOverlay(int32_t iForID) const
Definition: C4Object.cpp:4474
int32_t Hgt
Definition: C4Rect.h:30
int32_t FacetX
Definition: C4Object.h:89
void SetCategory(int32_t Category)
Definition: C4Object.h:257
C4Action Action
Definition: C4Object.h:147
C4Shape Shape
Definition: C4Object.h:148
C4Command * FindCommand(int32_t iCommandType) const
Definition: C4Object.cpp:2645
int32_t Audible
Definition: C4Object.h:121
uint32_t OCF
Definition: C4Object.h:134
bool RemoveGraphicsOverlay(int32_t iOverlayID)
Definition: C4Object.cpp:4502
void SetBridgeData(int32_t iBridgeTime, bool fMoveClonk, bool fWall, int32_t iBridgeMaterial)
Definition: C4Object.cpp:64
void UpdateSolidMask(bool fRestoreAttachedObjects)
Definition: C4Object.cpp:4142
void Fling(C4Real txdir, C4Real tydir, bool fAddSpeed)
Definition: C4Object.cpp:1337
uint32_t DWORD
C4TargetRect SolidMask
Definition: C4Object.h:150
C4SolidMask * pSolidMaskData
Definition: C4Object.h:176
int fixtoi(const C4Fixed &x)
Definition: C4Real.h:259
bool fOwnVertices
Definition: C4Object.h:149
C4Real xdir
Definition: C4Object.h:126
int32_t Controller
Definition: C4Object.h:111
StdMeshInstance * pMeshInstance
Definition: C4Object.h:155
void StopAndContact(C4Real &ctco, C4Real limit, C4Real &speed, int32_t cnat)
Definition: C4Movement.cpp:129
C4Real ydir
Definition: C4Object.h:126
int32_t addtop() const
Definition: C4Object.h:281
bool ActivateEntrance(int32_t by_plr, C4Object *by_obj)
Definition: C4Object.cpp:1349
void ClearInfo(C4ObjectInfo *pInfo)
Definition: C4Object.cpp:2425
bool IsVisible(int32_t iForPlr, bool fAsOverlay) const
Definition: C4Object.cpp:4048
int32_t LastEnergyLossCausePlayer
Definition: C4Object.h:112
uint32_t lightColor
Definition: C4Object.h:124
bool HasGraphicsOverlayRecursion(const C4Object *pCheckObj) const
Definition: C4Object.cpp:4521
void DoMotion(int32_t mx, int32_t my)
Definition: C4Movement.cpp:123
void DoDamage(int32_t iLevel, int32_t iCausedByPlr, int32_t iCause)
Definition: C4Object.cpp:1093
bool ExecuteCommand()
Definition: C4Object.cpp:2654
int32_t ComDir
Definition: C4Object.h:82
bool Contact(int32_t cnat)
Definition: C4Movement.cpp:114
void Execute()
Definition: C4Object.cpp:911
const C4Real Fix0
Definition: C4Real.h:312
void GetBridgeData(int32_t &riBridgeTime, bool &rfMoveClonk, bool &rfWall, int32_t &riBridgeMaterial)
Definition: C4Object.cpp:74
C4Facet TopFace
Definition: C4Object.h:142
bool SetPhase(int32_t iPhase)
Definition: C4Object.cpp:1776
bool GetDrawPosition(const C4TargetFacet &cgo, float &resultx, float &resulty, float &resultzoom) const
Definition: C4Object.cpp:4331
bool Initializing
Definition: C4Object.h:130