OpenClonk
C4ObjectCom.cpp
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 /* Lots of handler functions for object action */
19 
20 #include "C4Include.h"
21 #include "object/C4ObjectCom.h"
22 
23 #include "game/C4Physics.h"
25 #include "gui/C4GameMessage.h"
26 #include "landscape/C4Material.h"
27 #include "lib/C4Random.h"
28 #include "object/C4Command.h"
29 #include "object/C4Def.h"
30 #include "object/C4GameObjects.h"
31 #include "object/C4Object.h"
32 #include "object/C4ObjectMenu.h"
33 #include "player/C4Player.h"
34 #include "player/C4PlayerList.h"
35 #include "script/C4Effect.h"
36 
37 bool SimFlightHitsLiquid(C4Real fcx, C4Real fcy, C4Real xdir, C4Real ydir);
38 
40 {
41  return cObj->SetActionByName("Walk");
42 }
43 
45 {
46  cObj->Action.ComDir = COMD_Stop;
47  return ObjectActionWalk(cObj);
48 }
49 
50 bool ObjectActionJump(C4Object *cObj, C4Real xdir, C4Real ydir, bool fByCom)
51 {
52  // Scripted jump?
53  assert(cObj);
54  C4AulParSet pars(fixtoi(xdir, 100), fixtoi(ydir, 100), fByCom);
55  if (!!cObj->Call(PSF_OnActionJump, &pars))
56  {
57  return true;
58  }
59  // Hardcoded jump by action
60  if (!cObj->SetActionByName("Jump"))
61  {
62  return false;
63  }
64  cObj->xdir = xdir;
65  cObj->ydir = ydir;
66  cObj->Mobile = true;
67  // Unstick from ground, because jump command may be issued in an Action-callback,
68  // where attach-values have already been determined for that frame
69  cObj->Action.t_attach &= ~CNAT_Bottom;
70  return true;
71 }
72 
73 bool ObjectActionDive(C4Object *cObj, C4Real xdir, C4Real ydir)
74 {
75  if (!cObj->SetActionByName("Dive"))
76  {
77  return false;
78  }
79  cObj->xdir = xdir;
80  cObj->ydir = ydir;
81  cObj->Mobile = true;
82  // Unstick from ground, because jump command may be issued in an Action-callback,
83  // where attach-values have already been determined for that frame
84  cObj->Action.t_attach &= ~CNAT_Bottom;
85  return true;
86 }
87 
88 bool ObjectActionTumble(C4Object *cObj, int32_t dir, C4Real xdir, C4Real ydir)
89 {
90  if (!cObj->SetActionByName("Tumble"))
91  {
92  return false;
93  }
94  cObj->SetDir(dir);
95  cObj->xdir = xdir;
96  cObj->ydir = ydir;
97  return true;
98 }
99 
101 {
102  if (!cObj->SetActionByName("GetPunched"))
103  {
104  return false;
105  }
106  cObj->xdir = xdir;
107  cObj->ydir = ydir;
108  return true;
109 }
110 
112 {
113  return cObj->SetActionByName("KneelDown");
114 }
115 
116 bool ObjectActionFlat(C4Object *cObj, int32_t dir)
117 {
118  if (!cObj->SetActionByName("FlatUp"))
119  {
120  return false;
121  }
122  cObj->SetDir(dir);
123  return true;
124 }
125 
126 bool ObjectActionScale(C4Object *cObj, int32_t dir)
127 {
128  if (!cObj->SetActionByName("Scale"))
129  {
130  return false;
131  }
132  cObj->SetDir(dir);
133  return true;
134 }
135 
137 {
138  return cObj->SetActionByName("Hangle");
139 }
140 
141 bool ObjectActionThrow(C4Object *cObj, C4Object *pThing)
142 {
143  // No object specified, first from contents
144  if (!pThing)
145  {
146  pThing = cObj->Contents.GetObject();
147  }
148  // Nothing to throw
149  if (!pThing)
150  {
151  return false;
152  }
153  // TODO: Initialize force and direction AFTER action is set.
154  // Force and direction
155  C4Real pthrow = C4REAL100(cObj->GetPropertyInt(P_ThrowSpeed));
156  int32_t iDir = 1;
157  if (cObj->Action.Dir == DIR_Left)
158  {
159  iDir = -1;
160  }
161  // Set action
162  if (!cObj->SetActionByName("Throw"))
163  {
164  return false;
165  }
166  // Exit object
167  pThing->Exit(cObj->GetX(),
168  cObj->GetY() + cObj->Shape.y - 1,
169  Random(360),
170  pthrow * iDir + cObj->xdir, -pthrow + cObj->ydir, pthrow * iDir);
171  // Success
172  return true;
173 }
174 
176 {
177  if (!cObj->SetActionByName("Dig"))
178  {
179  return false;
180  }
181  cObj->Action.Data = 0; // Material Dig2Object request
182  return true;
183 }
184 
185 bool ObjectActionPush(C4Object *cObj, C4Object *target)
186 {
187  return cObj->SetActionByName("Push", target);
188 }
189 
190 static bool CornerScaleOkay(C4Object *cObj, int32_t iRangeX, int32_t iRangeY)
191 {
192  int32_t cty = cObj->GetY() - iRangeY;
193  int32_t ctx;
194  if (cObj->Action.Dir == DIR_Left)
195  {
196  ctx = cObj->GetX() - iRangeX;
197  }
198  else
199  {
200  ctx = cObj->GetX() + iRangeX;
201  }
202 
203  cObj->ContactCheck(ctx, cty); // (Resets VtxContact & t_contact)
204  return !(cObj->t_contact & CNAT_Top)
205  && !(cObj->t_contact & CNAT_Left)
206  && !(cObj->t_contact & CNAT_Right)
207  && !(cObj->t_contact & CNAT_Bottom);
208 }
209 
211 {
212  int32_t iRangeX = 1;
213  int32_t iRangeY = 1;
214  if (!CornerScaleOkay(cObj, iRangeX, iRangeY))
215  {
216  return false;
217  }
218  // Do corner scale
219  if (!cObj->SetActionByName("KneelUp"))
220  {
221  cObj->SetActionByName("Walk");
222  }
223  cObj->xdir = 0;
224  cObj->ydir = 0;
225  if (cObj->Action.Dir == DIR_Left)
226  {
227  cObj->fix_x -= itofix(iRangeX);
228  }
229  else
230  {
231  cObj->fix_x += itofix(iRangeX);
232  }
233  cObj->fix_y -= itofix(iRangeY);
234  return true;
235 }
236 
238 {
239  // Cease current action
240  cObj->SetActionByName("Idle");
241  // Action walk if possible
242  return ObjectActionStand(cObj);
243 }
244 
245 bool ObjectComGrab(C4Object *cObj, C4Object *pTarget)
246 {
247  if (!pTarget)
248  {
249  return false;
250  }
251  if (cObj->GetProcedure() != DFA_WALK)
252  {
253  return false;
254  }
255  if (!ObjectActionPush(cObj, pTarget))
256  {
257  return false;
258  }
259  cObj->Call(PSF_Grab, &C4AulParSet(pTarget, true));
260  if (pTarget->Status && cObj->Status)
261  {
262  pTarget->Call(PSF_Grabbed, &C4AulParSet(cObj, true));
263  }
264  return true;
265 }
266 
268 {
269  // Only if pushing, -> stand
270  if (cObj->GetProcedure() == DFA_PUSH)
271  {
272  C4Object *pTarget = cObj->Action.Target;
273  if (ObjectActionStand(cObj))
274  {
275  if (!cObj->CloseMenu(false))
276  {
277  return false;
278  }
279  cObj->Call(PSF_Grab, &C4AulParSet(pTarget, false));
280  // Clear action target
281  cObj->Action.Target = nullptr;
282  if (pTarget && pTarget->Status && cObj->Status)
283  {
284  pTarget->Call(PSF_Grabbed, &C4AulParSet(cObj, false));
285  }
286  return true;
287  }
288  }
289 
290  return false;
291 }
292 
293 bool ObjectComJump(C4Object *cObj) // by ObjectComUp, ExecCMDFMoveTo, FnJump
294 {
295  // Only if walking
296  if (cObj->GetProcedure() != DFA_WALK)
297  {
298  return false;
299  }
300  // Calculate direction & forces
301  C4Real TXDir = Fix0;
302  C4PropList *pActionWalk = cObj->GetAction();
303  C4Real iPhysicalWalk = C4REAL100(pActionWalk->GetPropertyInt(P_Speed)) * itofix(cObj->GetCon(), FullCon);
304  C4Real iPhysicalJump = C4REAL100(cObj->GetPropertyInt(P_JumpSpeed)) * itofix(cObj->GetCon(), FullCon);
305 
306  if (cObj->Action.ComDir == COMD_Left || cObj->Action.ComDir == COMD_UpLeft)
307  {
308  TXDir = -iPhysicalWalk;
309  }
310  else if (cObj->Action.ComDir == COMD_Right || cObj->Action.ComDir == COMD_UpRight)
311  {
312  TXDir = +iPhysicalWalk;
313  }
314  C4Real x = cObj->fix_x;
315  C4Real y = cObj->fix_y;
316  // Find bottom-most vertex, correct starting position for simulation
317  int32_t iBtmVtx = cObj->Shape.GetBottomVertex();
318  if (iBtmVtx != -1)
319  {
320  x += cObj->Shape.GetVertexX(iBtmVtx);
321  y += cObj->Shape.GetVertexY(iBtmVtx);
322  }
323  // Try dive
324  if ((cObj->Shape.ContactDensity > C4M_Liquid)
325  && SimFlightHitsLiquid(x, y, TXDir, -iPhysicalJump)
326  && ObjectActionDive(cObj, TXDir, -iPhysicalJump))
327  {
328  return true;
329  }
330  // Regular jump
331  return ObjectActionJump(cObj, TXDir, -iPhysicalJump, true);
332 }
333 
334 bool ObjectComLetGo(C4Object *cObj, int32_t xdirf)
335 {
336  // by ACTSCALE, ACTHANGLE or ExecCMDFMoveTo
337  return ObjectActionJump(cObj, itofix(xdirf), Fix0, true);
338 }
339 
340 bool ObjectComDig(C4Object *cObj) // by DFA_WALK
341 {
342  if (!ObjectActionDig(cObj))
343  {
344  GameMsgObjectError(FormatString(LoadResStr("IDS_OBJ_NODIG"), cObj->GetName()).getData(), cObj);
345  return false;
346  }
347  return true;
348 }
349 
350 bool ObjectComPut(C4Object *cObj, C4Object *pTarget, C4Object *pThing)
351 {
352  // No object specified, first from contents
353  if (!pThing)
354  {
355  pThing = cObj->Contents.GetObject();
356  }
357  // Nothing to put
358  if (!pThing)
359  {
360  return false;
361  }
362  // No target
363  if (!pTarget)
364  {
365  return false;
366  }
367  // Grabbing: check C4D_Grab_Put
368  if (pTarget != cObj->Contained
369  && !(pTarget->Def->GrabPutGet & C4D_Grab_Put))
370  {
371  // No grab put: fail
372  return false;
373  }
374  // Target no fullcon
375  if (!(pTarget->OCF & OCF_FullCon))
376  {
377  return false;
378  }
379  // Transfer thing
380  bool fRejectCollect;
381  if (!pThing->Enter(pTarget, true, true, &fRejectCollect))
382  {
383  return false;
384  }
385  // Put call to object script
386  cObj->Call(PSF_Put);
387  // Target collection call
388  pTarget->Call(PSF_Collection,&C4AulParSet(pThing, true));
389  // Success
390  return true;
391 }
392 
393 bool ObjectComThrow(C4Object *cObj, C4Object *pThing)
394 {
395  // No object specified, first from contents
396  if (!pThing)
397  {
398  pThing = cObj->Contents.GetObject();
399  }
400  // Nothing to throw
401  if (!pThing)
402  {
403  return false;
404  }
405  // Throw com
406  switch (cObj->GetProcedure())
407  {
408  case DFA_WALK:
409  return ObjectActionThrow(cObj, pThing);
410  }
411  // Failure
412  return false;
413 }
414 
415 bool ObjectComDrop(C4Object *cObj, C4Object *pThing)
416 {
417  // No object specified, first from contents
418  if (!pThing)
419  {
420  pThing = cObj->Contents.GetObject();
421  }
422  // Nothing to throw
423  if (!pThing)
424  {
425  return false;
426  }
427  // Force and direction
428  // When dropping diagonally, drop from edge of shape
429  // When doing a diagonal forward drop during flight, exit a bit closer to the Clonk to allow planned tumbling
430  // Except when hangling, so you can mine effectively form the ceiling, and when swimming because you cannot tumble then
431  C4Real pthrow = C4REAL100(cObj->GetPropertyInt(P_ThrowSpeed));
432  int32_t tdir = 0;
433  int right = 0;
434  bool isHanglingOrSwimming = false;
435  int32_t iProc = -1;
436  C4PropList* pActionDef = cObj->GetAction();
437  if (pActionDef)
438  {
439  iProc = pActionDef->GetPropertyP(P_Procedure);
440  if (iProc == DFA_HANGLE || iProc == DFA_SWIM)
441  {
442  isHanglingOrSwimming = true;
443  }
444  }
445  int32_t iOutposReduction = 1; // don't exit object too far forward during jump
446  if (iProc != DFA_SCALE) // never diagonal during scaling (can have com into wall during scaling!)
447  {
448  // Table format is OK here
449  if (ComDirLike(cObj->Action.ComDir, COMD_Left)) { tdir = -1; right = 0; if (cObj->xdir < C4REAL10(15) && !isHanglingOrSwimming) --iOutposReduction; }
450  if (ComDirLike(cObj->Action.ComDir, COMD_Right)) { tdir = +1; right = 1; if (cObj->xdir > C4REAL10(-15) && !isHanglingOrSwimming) --iOutposReduction; }
451  }
452  // Exit object
453  pThing->Exit(cObj->GetX() + (cObj->Shape.x + cObj->Shape.Wdt * right) * !!tdir * iOutposReduction,
454  cObj->GetY() + cObj->Shape.y + cObj->Shape.Hgt - (pThing->Shape.y + pThing->Shape.Hgt), 0, pthrow * tdir, Fix0, Fix0);
455  // Update OCF
456  cObj->SetOCF();
457  // Ungrab
458  ObjectComUnGrab(cObj);
459  // Done
460  return true;
461 }
462 
463 bool ObjectComPutTake(C4Object *cObj, C4Object *pTarget, C4Object *pThing) // by C4CMD_Throw
464 { // by C4CMD_Drop
465  // Valid checks
466  if (!pTarget)
467  {
468  return false;
469  }
470  // No object specified, first from contents
471  if (!pThing)
472  {
473  pThing = cObj->Contents.GetObject();
474  }
475  // Has thing, put to target
476  if (pThing)
477  {
478  return ObjectComPut(cObj, pTarget, pThing);
479  }
480  // If target is own container, activate activation menu
481  if (pTarget == cObj->Contained)
482  {
483  return ObjectComTake(cObj); // carlo
484  }
485  // Assuming target is grabbed, check for grab get
486  if (pTarget->Def->GrabPutGet & C4D_Grab_Get)
487  {
488  // Activate get menu
489  return cObj->ActivateMenu(C4MN_Get, 0, 0, 0, pTarget);
490  }
491  // Failure
492  return false;
493 }
494 
495 // carlo
496 bool ObjectComTake(C4Object *cObj) // by C4CMD_Take
497 {
498  return cObj->ActivateMenu(C4MN_Activate);
499 }
500 
501 // carlo
502 bool ObjectComTake2(C4Object *cObj) // by C4CMD_Take2
503 {
504  return cObj->ActivateMenu(C4MN_Get, 0, 0, 0, cObj->Contained);
505 }
506 
507 bool ObjectComPunch(C4Object *cObj, C4Object *pTarget, int32_t punch)
508 {
509  if (!cObj || !pTarget)
510  {
511  return false;
512  }
513  if (!punch)
514  {
515  return true;
516  }
517  bool fBlowStopped = !!pTarget->Call(PSF_QueryCatchBlow, &C4AulParSet(cObj));
518  if (fBlowStopped && punch > 1)
519  {
520  punch = punch / 2; // Half damage for caught blow, so shield+armor help in fistfight and vs monsters
521  }
522  pTarget->DoEnergy(-punch, false, C4FxCall_EngGetPunched, cObj->Controller);
523  int32_t tdir = +1;
524  if (cObj->Action.Dir == DIR_Left)
525  {
526  tdir = -1;
527  }
528  pTarget->Action.ComDir = COMD_Stop;
529  // No tumbles when blow was caught
530  if (fBlowStopped)
531  {
532  return false;
533  }
534  // Hard punch
535  if (punch >= 10 && ObjectActionTumble(pTarget, pTarget->Action.Dir, C4REAL100(150) * tdir, itofix(-2)))
536  {
537  pTarget->Call(PSF_CatchBlow, &C4AulParSet(punch, cObj));
538  return true;
539  }
540 
541  // Regular punch
542  if (ObjectActionGetPunched(pTarget, C4REAL100(250) * tdir, Fix0))
543  {
544  pTarget->Call(PSF_CatchBlow,&C4AulParSet(punch, cObj));
545  return true;
546  }
547 
548  return false;
549 }
550 
552 {
553  if (cObj->GetProcedure() == DFA_ATTACH)
554  {
555  return cObj->SetAction(nullptr);
556  }
557  return false;
558 }
559 
561 {
562  // Stand - but keep momentum to allow more dynamic digging
563  C4Real o_xdir = cObj->xdir;
564  C4Real o_ydir = cObj->ydir;
565  ObjectActionStand(cObj);
566  cObj->xdir = o_xdir;
567  cObj->ydir = o_ydir;
568  // Clear digging command
569  if (cObj->Command && cObj->Command->Command == C4CMD_Dig)
570  {
571  cObj->ClearCommand(cObj->Command);
572  }
573 }
574 
575 bool ComDirLike(int32_t iComDir, int32_t iSample)
576 {
577  if (iComDir == iSample) return true;
578  if (iComDir % 8 + 1 == iSample) return true;
579  if (iComDir == iSample % 8 + 1 ) return true;
580  return false;
581 }
582 
@ C4CMD_Dig
Definition: C4Command.h:41
const int32_t FullCon
Definition: C4Constants.h:181
const BYTE CNAT_Bottom
Definition: C4Constants.h:112
const int32_t C4M_Liquid
Definition: C4Constants.h:174
const BYTE CNAT_Right
Definition: C4Constants.h:110
const BYTE CNAT_Top
Definition: C4Constants.h:111
const uint32_t OCF_FullCon
Definition: C4Constants.h:85
const BYTE CNAT_Left
Definition: C4Constants.h:109
const int32_t C4D_Grab_Put
Definition: C4Def.h:62
const int32_t C4D_Grab_Get
Definition: C4Def.h:63
#define C4FxCall_EngGetPunched
Definition: C4Effect.h:63
void GameMsgObjectError(const char *szText, C4Object *pTarget, bool Red)
#define PSF_CatchBlow
Definition: C4GameScript.h:72
#define PSF_Put
Definition: C4GameScript.h:55
#define PSF_OnActionJump
Definition: C4GameScript.h:140
#define PSF_Grabbed
Definition: C4GameScript.h:53
#define PSF_Grab
Definition: C4GameScript.h:52
#define PSF_QueryCatchBlow
Definition: C4GameScript.h:73
#define PSF_Collection
Definition: C4GameScript.h:56
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
#define COMD_UpLeft
Definition: C4Object.h:58
#define DIR_Left
Definition: C4Object.h:41
#define COMD_UpRight
Definition: C4Object.h:52
#define COMD_Right
Definition: C4Object.h:53
#define COMD_Left
Definition: C4Object.h:57
#define COMD_Stop
Definition: C4Object.h:50
bool ObjectComThrow(C4Object *cObj, C4Object *pThing)
bool ObjectComPunch(C4Object *cObj, C4Object *pTarget, int32_t punch)
void ObjectComStopDig(C4Object *cObj)
bool ObjectComPutTake(C4Object *cObj, C4Object *pTarget, C4Object *pThing)
bool ObjectComCancelAttach(C4Object *cObj)
bool ObjectComLetGo(C4Object *cObj, int32_t xdirf)
bool ObjectActionScale(C4Object *cObj, int32_t dir)
bool ObjectComTake(C4Object *cObj)
bool ObjectActionWalk(C4Object *cObj)
Definition: C4ObjectCom.cpp:39
bool ObjectActionGetPunched(C4Object *cObj, C4Real xdir, C4Real ydir)
bool ObjectComUnGrab(C4Object *cObj)
bool ObjectActionFlat(C4Object *cObj, int32_t dir)
bool ObjectActionJump(C4Object *cObj, C4Real xdir, C4Real ydir, bool fByCom)
Definition: C4ObjectCom.cpp:50
bool ObjectActionDive(C4Object *cObj, C4Real xdir, C4Real ydir)
Definition: C4ObjectCom.cpp:73
bool ObjectActionHangle(C4Object *cObj)
bool ObjectActionPush(C4Object *cObj, C4Object *target)
bool ObjectComTake2(C4Object *cObj)
bool ObjectComGrab(C4Object *cObj, C4Object *pTarget)
bool ObjectActionThrow(C4Object *cObj, C4Object *pThing)
bool ObjectComJump(C4Object *cObj)
bool ObjectActionKneel(C4Object *cObj)
bool ObjectActionTumble(C4Object *cObj, int32_t dir, C4Real xdir, C4Real ydir)
Definition: C4ObjectCom.cpp:88
bool SimFlightHitsLiquid(C4Real fcx, C4Real fcy, C4Real xdir, C4Real ydir)
Definition: C4Movement.cpp:874
bool ComDirLike(int32_t iComDir, int32_t iSample)
bool ObjectComStop(C4Object *cObj)
bool ObjectActionStand(C4Object *cObj)
Definition: C4ObjectCom.cpp:44
bool ObjectComPut(C4Object *cObj, C4Object *pTarget, C4Object *pThing)
bool ObjectComDig(C4Object *cObj)
bool ObjectComDrop(C4Object *cObj, C4Object *pThing)
bool ObjectActionDig(C4Object *cObj)
bool ObjectActionCornerScale(C4Object *cObj)
@ C4MN_Activate
Definition: C4ObjectMenu.h:33
@ C4MN_Get
Definition: C4ObjectMenu.h:39
uint32_t Random()
Definition: C4Random.cpp:43
C4Fixed itofix(int32_t x)
Definition: C4Real.h:261
int fixtoi(const C4Fixed &x)
Definition: C4Real.h:259
const C4Real Fix0
Definition: C4Real.h:312
C4Real C4REAL100(int x)
Definition: C4Real.h:267
C4Real C4REAL10(int x)
Definition: C4Real.h:269
@ DFA_SWIM
@ DFA_HANGLE
@ DFA_WALK
@ P_Speed
@ P_JumpSpeed
@ DFA_ATTACH
@ DFA_PUSH
@ P_Procedure
@ DFA_SCALE
@ P_ThrowSpeed
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270
int32_t Data
Definition: C4Object.h:84
int32_t t_attach
Definition: C4Object.h:86
int32_t ComDir
Definition: C4Object.h:82
int32_t Dir
Definition: C4Object.h:80
C4ObjectPtr Target
Definition: C4Object.h:87
int32_t Command
Definition: C4Command.h:81
int32_t GrabPutGet
Definition: C4Def.h:124
Definition: C4Real.h:59
bool Enter(C4Object *pTarget, bool fCalls=true, bool fCopyMotion=true, bool *pfRejectCollect=nullptr)
void ClearCommand(C4Command *pUntil)
C4Real ydir
Definition: C4Object.h:124
int32_t ContactCheck(int32_t at_x, int32_t at_y, uint32_t *border_hack_contacts=nullptr, bool collide_halfvehic=false)
Definition: C4Movement.cpp:158
C4Real fix_y
Definition: C4Object.h:123
C4PropList * GetAction() const
C4Real xdir
Definition: C4Object.h:124
C4Real fix_x
Definition: C4Object.h:123
uint32_t t_contact
Definition: C4Object.h:131
bool SetActionByName(C4String *ActName, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls=SAC_StartCall|SAC_AbortCall, bool fForce=false)
int32_t GetProcedure() const
C4Command * Command
Definition: C4Object.h:165
int32_t GetX() const
Definition: C4Object.h:285
bool ActivateMenu(int32_t iMenu, int32_t iMenuSelect=0, int32_t iMenuData=0, int32_t iMenuPosition=0, C4Object *pTarget=nullptr)
int32_t Controller
Definition: C4Object.h:109
void SetDir(int32_t tdir)
uint32_t OCF
Definition: C4Object.h:132
bool Mobile
Definition: C4Object.h:126
bool CloseMenu(bool fForce)
int32_t GetY() const
Definition: C4Object.h:286
C4NotifyingObjectList Contents
Definition: C4Object.h:151
int32_t GetCon() const
Definition: C4Object.h:271
C4ObjectPtr Contained
Definition: C4Object.h:142
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)
C4Action Action
Definition: C4Object.h:145
void SetOCF()
Definition: C4ObjectOCF.cpp:30
C4Def * Def
Definition: C4Object.h:141
bool SetAction(C4PropList *Act, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls=SAC_StartCall|SAC_AbortCall, bool fForce=false)
C4Shape Shape
Definition: C4Object.h:146
void DoEnergy(int32_t iChange, bool fExact, int32_t iCause, int32_t iCausedByPlr)
Definition: C4Object.cpp:585
C4Object * GetObject(int index=0) const
int32_t GetPropertyInt(C4PropertyName k, int32_t default_val=0) const
Definition: C4PropList.cpp:855
virtual const char * GetName() const
Definition: C4PropList.cpp:618
int32_t Status
Definition: C4PropList.h:173
C4PropertyName GetPropertyP(C4PropertyName k) const
Definition: C4PropList.cpp:824
C4Value Call(C4PropertyName k, C4AulParSet *pPars=nullptr, bool fPassErrors=false)
Definition: C4PropList.h:114
int32_t y
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
int32_t Wdt
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
int32_t GetVertexY(int32_t iVertex)
Definition: C4Shape.cpp:523
int32_t GetVertexX(int32_t iVertex)
Definition: C4Shape.cpp:514
int32_t ContactDensity
Definition: C4Shape.h:47
int32_t GetBottomVertex()
Definition: C4Shape.cpp:558
const char * getData() const
Definition: StdBuf.h:442