OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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  if (!cObj->SetActionByName("Walk")) return false;
42  return true;
43 }
44 
46 {
47  cObj->Action.ComDir=COMD_Stop;
48  if (!ObjectActionWalk(cObj)) return false;
49  return true;
50 }
51 
52 bool ObjectActionJump(C4Object *cObj, C4Real xdir, C4Real ydir, bool fByCom)
53 {
54  // scripted jump?
55  assert(cObj);
56  C4AulParSet pars(fixtoi(xdir, 100), fixtoi(ydir, 100), fByCom);
57  if (!!cObj->Call(PSF_OnActionJump, &pars)) return true;
58  // hardcoded jump by action
59  if (!cObj->SetActionByName("Jump")) return false;
60  cObj->xdir=xdir; cObj->ydir=ydir;
61  cObj->Mobile=true;
62  // unstick from ground, because jump command may be issued in an Action-callback,
63  // where attach-values have already been determined for that frame
64  cObj->Action.t_attach&=~CNAT_Bottom;
65  return true;
66 }
67 
68 bool ObjectActionDive(C4Object *cObj, C4Real xdir, C4Real ydir)
69 {
70  if (!cObj->SetActionByName("Dive")) return false;
71  cObj->xdir=xdir; cObj->ydir=ydir;
72  cObj->Mobile=true;
73  // unstick from ground, because jump command may be issued in an Action-callback,
74  // where attach-values have already been determined for that frame
75  cObj->Action.t_attach&=~CNAT_Bottom;
76  return true;
77 }
78 
79 bool ObjectActionTumble(C4Object *cObj, int32_t dir, C4Real xdir, C4Real ydir)
80 {
81  if (!cObj->SetActionByName("Tumble")) return false;
82  cObj->SetDir(dir);
83  cObj->xdir=xdir; cObj->ydir=ydir;
84  return true;
85 }
86 
88 {
89  if (!cObj->SetActionByName("GetPunched")) return false;
90  cObj->xdir=xdir; cObj->ydir=ydir;
91  return true;
92 }
93 
95 {
96  if (!cObj->SetActionByName("KneelDown")) return false;
97  return true;
98 }
99 
100 bool ObjectActionFlat(C4Object *cObj, int32_t dir)
101 {
102  if (!cObj->SetActionByName("FlatUp")) return false;
103  cObj->SetDir(dir);
104  return true;
105 }
106 
107 bool ObjectActionScale(C4Object *cObj, int32_t dir)
108 {
109  if (!cObj->SetActionByName("Scale")) return false;
110  cObj->SetDir(dir);
111  return true;
112 }
113 
115 {
116  if (!cObj->SetActionByName("Hangle")) return false;
117  return true;
118 }
119 
120 bool ObjectActionThrow(C4Object *cObj, C4Object *pThing)
121 {
122  // No object specified, first from contents
123  if (!pThing) pThing = cObj->Contents.GetObject();
124  // Nothing to throw
125  if (!pThing) return false;
126  // Force and direction
128  int32_t iDir=1; if (cObj->Action.Dir==DIR_Left) iDir=-1;
129  // Set action
130  if (!cObj->SetActionByName("Throw")) return false;
131  // Exit object
132  pThing->Exit(cObj->GetX(),
133  cObj->GetY()+cObj->Shape.y-1,
134  Random(360),
135  pthrow*iDir+cObj->xdir,-pthrow+cObj->ydir,pthrow*iDir);
136  // Success
137  return true;
138 }
139 
141 {
142  if (!cObj->SetActionByName("Dig")) return false;
143  cObj->Action.Data=0; // Material Dig2Object request
144  return true;
145 }
146 
147 bool ObjectActionPush(C4Object *cObj, C4Object *target)
148 {
149  return cObj->SetActionByName("Push",target);
150 }
151 
152 static bool CornerScaleOkay(C4Object *cObj, int32_t iRangeX, int32_t iRangeY)
153 {
154  int32_t ctx,cty;
155  cty=cObj->GetY()-iRangeY;
156  if (cObj->Action.Dir==DIR_Left) ctx=cObj->GetX()-iRangeX;
157  else ctx=cObj->GetX()+iRangeX;
158  cObj->ContactCheck(ctx,cty); // (resets VtxContact & t_contact)
159  if (!(cObj->t_contact & CNAT_Top))
160  if (!(cObj->t_contact & CNAT_Left))
161  if (!(cObj->t_contact & CNAT_Right))
162  if (!(cObj->t_contact & CNAT_Bottom))
163  return true;
164  return false;
165 }
166 
168 {
169  int32_t iRangeX = 1, iRangeY = 1;
170  if (!CornerScaleOkay(cObj,iRangeX,iRangeY)) return false;
171  // Do corner scale
172  if (!cObj->SetActionByName("KneelUp"))
173  cObj->SetActionByName("Walk");
174  cObj->xdir=cObj->ydir=0;
175  if (cObj->Action.Dir==DIR_Left) cObj->fix_x-=itofix(iRangeX);
176  else cObj->fix_x+=itofix(iRangeX);
177  cObj->fix_y-=itofix(iRangeY);
178  return true;
179 }
180 
182 {
183  // Cease current action
184  cObj->SetActionByName("Idle");
185  // Action walk if possible
186  return ObjectActionStand(cObj);
187 }
188 
189 bool ObjectComGrab(C4Object *cObj, C4Object *pTarget)
190 {
191  if (!pTarget) return false;
192  if (cObj->GetProcedure()!=DFA_WALK) return false;
193  if (!ObjectActionPush(cObj,pTarget)) return false;
194  cObj->Call(PSF_Grab, &C4AulParSet(pTarget, true));
195  if (pTarget->Status && cObj->Status)
196  pTarget->Call(PSF_Grabbed, &C4AulParSet(cObj, true));
197  return true;
198 }
199 
201 {
202  // Only if pushing, -> stand
203  if (cObj->GetProcedure() == DFA_PUSH)
204  {
205  C4Object *pTarget = cObj->Action.Target;
206  if (ObjectActionStand(cObj))
207  {
208  if (!cObj->CloseMenu(false)) return false;
209  cObj->Call(PSF_Grab, &C4AulParSet(pTarget, false));
210  // clear action target
211  cObj->Action.Target = nullptr;
212  if (pTarget && pTarget->Status && cObj->Status)
213  {
214  pTarget->Call(PSF_Grabbed, &C4AulParSet(cObj, false));
215  }
216  return true;
217  }
218  }
219 
220  return false;
221 }
222 
223 bool ObjectComJump(C4Object *cObj) // by ObjectComUp, ExecCMDFMoveTo, FnJump
224 {
225  // Only if walking
226  if (cObj->GetProcedure()!=DFA_WALK) return false;
227  // Calculate direction & forces
228  C4Real TXDir=Fix0;
229  C4PropList *pActionWalk = cObj->GetAction();
230  C4Real iPhysicalWalk = C4REAL100(pActionWalk->GetPropertyInt(P_Speed)) * itofix(cObj->GetCon(), FullCon);
231  C4Real iPhysicalJump = C4REAL100(cObj->GetPropertyInt(P_JumpSpeed)) * itofix(cObj->GetCon(), FullCon);
232 
233  if (cObj->Action.ComDir==COMD_Left || cObj->Action.ComDir==COMD_UpLeft) TXDir=-iPhysicalWalk;
234  else if (cObj->Action.ComDir==COMD_Right || cObj->Action.ComDir==COMD_UpRight) TXDir=+iPhysicalWalk;
235  C4Real x = cObj->fix_x, y = cObj->fix_y;
236  // find bottom-most vertex, correct starting position for simulation
237  int32_t iBtmVtx = cObj->Shape.GetBottomVertex();
238  if (iBtmVtx != -1) { x += cObj->Shape.GetVertexX(iBtmVtx); y += cObj->Shape.GetVertexY(iBtmVtx); }
239  // Try dive
240  if (cObj->Shape.ContactDensity > C4M_Liquid)
241  if (SimFlightHitsLiquid(x,y,TXDir,-iPhysicalJump))
242  if (ObjectActionDive(cObj,TXDir,-iPhysicalJump))
243  return true;
244  // Regular jump
245  return ObjectActionJump(cObj,TXDir,-iPhysicalJump,true);
246 }
247 
248 bool ObjectComLetGo(C4Object *cObj, int32_t xdirf)
249 { // by ACTSCALE, ACTHANGLE or ExecCMDFMoveTo
250  return ObjectActionJump(cObj,itofix(xdirf),Fix0,true);
251 }
252 
253 bool ObjectComDig(C4Object *cObj) // by DFA_WALK
254 {
255  if (!ObjectActionDig(cObj))
256  {
257  GameMsgObjectError(FormatString(LoadResStr("IDS_OBJ_NODIG"),cObj->GetName()).getData(),cObj);
258  return false;
259  }
260  return true;
261 }
262 
263 bool ObjectComPut(C4Object *cObj, C4Object *pTarget, C4Object *pThing)
264 {
265  // No object specified, first from contents
266  if (!pThing) pThing = cObj->Contents.GetObject();
267  // Nothing to put
268  if (!pThing) return false;
269  // No target
270  if (!pTarget) return false;
271  // Grabbing: check C4D_Grab_Put
272  if (pTarget!=cObj->Contained)
273  if (!(pTarget->Def->GrabPutGet & C4D_Grab_Put))
274  {
275  // No grab put: fail
276  return false;
277  }
278  // Target no fullcon
279  if (!(pTarget->OCF & OCF_FullCon)) return false;
280  // Transfer thing
281  bool fRejectCollect;
282  if (!pThing->Enter(pTarget, true, true, &fRejectCollect)) return false;
283  // Put call to object script
284  cObj->Call(PSF_Put);
285  // Target collection call
286  pTarget->Call(PSF_Collection,&C4AulParSet(pThing, true));
287  // Success
288  return true;
289 }
290 
291 bool ObjectComThrow(C4Object *cObj, C4Object *pThing)
292 {
293  // No object specified, first from contents
294  if (!pThing) pThing = cObj->Contents.GetObject();
295  // Nothing to throw
296  if (!pThing) return false;
297  // Throw com
298  switch (cObj->GetProcedure())
299  {
300  case DFA_WALK: return ObjectActionThrow(cObj,pThing);
301  }
302  // Failure
303  return false;
304 }
305 
306 bool ObjectComDrop(C4Object *cObj, C4Object *pThing)
307 {
308  // No object specified, first from contents
309  if (!pThing) pThing = cObj->Contents.GetObject();
310  // Nothing to throw
311  if (!pThing) return false;
312  // Force and direction
313  // When dropping diagonally, drop from edge of shape
314  // When doing a diagonal forward drop during flight, exit a bit closer to the Clonk to allow planned tumbling
315  // Except when hangling, so you can mine effectively form the ceiling, and when swimming because you cannot tumble then
317  int32_t tdir=0; int right=0;
318  bool isHanglingOrSwimming = false;
319  int32_t iProc = -1;
320  C4PropList* pActionDef = cObj->GetAction();
321  if (pActionDef)
322  {
323  iProc = pActionDef->GetPropertyP(P_Procedure);
324  if (iProc == DFA_HANGLE || iProc == DFA_SWIM) isHanglingOrSwimming = true;
325  }
326  int32_t iOutposReduction = 1; // don't exit object too far forward during jump
327  if (iProc != DFA_SCALE) // never diagonal during scaling (can have com into wall during scaling!)
328  {
329  if (ComDirLike(cObj->Action.ComDir, COMD_Left)) { tdir=-1; right = 0; if (cObj->xdir < C4REAL10(15) && !isHanglingOrSwimming) --iOutposReduction; }
330  if (ComDirLike(cObj->Action.ComDir, COMD_Right)) { tdir=+1; right = 1; if (cObj->xdir > C4REAL10(-15) && !isHanglingOrSwimming) --iOutposReduction; }
331  }
332  // Exit object
333  pThing->Exit(cObj->GetX() + (cObj->Shape.x + cObj->Shape.Wdt * right) * !!tdir * iOutposReduction,
334  cObj->GetY()+cObj->Shape.y+cObj->Shape.Hgt-(pThing->Shape.y+pThing->Shape.Hgt),0,pthrow*tdir,Fix0,Fix0);
335  // Update OCF
336  cObj->SetOCF();
337  // Ungrab
338  ObjectComUnGrab(cObj);
339  // Done
340  return true;
341 }
342 
343 bool ObjectComPutTake(C4Object *cObj, C4Object *pTarget, C4Object *pThing) // by C4CMD_Throw
344 { // by C4CMD_Drop
345  // Valid checks
346  if (!pTarget) return false;
347  // No object specified, first from contents
348  if (!pThing) pThing = cObj->Contents.GetObject();
349  // Has thing, put to target
350  if (pThing)
351  return ObjectComPut(cObj,pTarget,pThing);
352  // If target is own container, activate activation menu
353  if (pTarget==cObj->Contained)
354  return ObjectComTake(cObj); // carlo
355  // Assuming target is grabbed, check for grab get
356  if (pTarget->Def->GrabPutGet & C4D_Grab_Get)
357  {
358  // Activate get menu
359  return cObj->ActivateMenu(C4MN_Get,0,0,0,pTarget);
360  }
361  // Failure
362  return false;
363 }
364 
365 // carlo
366 bool ObjectComTake(C4Object *cObj) // by C4CMD_Take
367 {
368  return cObj->ActivateMenu(C4MN_Activate);
369 }
370 
371 // carlo
372 bool ObjectComTake2(C4Object *cObj) // by C4CMD_Take2
373 {
374  return cObj->ActivateMenu(C4MN_Get,0,0,0,cObj->Contained);
375 }
376 
377 bool ObjectComPunch(C4Object *cObj, C4Object *pTarget, int32_t punch)
378 {
379  if (!cObj || !pTarget) return false;
380  if (!punch) return true;
381  bool fBlowStopped = !!pTarget->Call(PSF_QueryCatchBlow,&C4AulParSet(cObj));
382  if (fBlowStopped && punch>1) punch=punch/2; // half damage for caught blow, so shield+armor help in fistfight and vs monsters
383  pTarget->DoEnergy(-punch, false, C4FxCall_EngGetPunched, cObj->Controller);
384  int32_t tdir=+1; if (cObj->Action.Dir==DIR_Left) tdir=-1;
385  pTarget->Action.ComDir=COMD_Stop;
386  // No tumbles when blow was caught
387  if (fBlowStopped) return false;
388  // Hard punch
389  if (punch>=10)
390  if (ObjectActionTumble(pTarget,pTarget->Action.Dir,C4REAL100(150)*tdir,itofix(-2)))
391  {
392  pTarget->Call(PSF_CatchBlow,&C4AulParSet(punch, cObj));
393  return true;
394  }
395 
396  // Regular punch
397  if (ObjectActionGetPunched(pTarget,C4REAL100(250)*tdir,Fix0))
398  {
399  pTarget->Call(PSF_CatchBlow,&C4AulParSet(punch, cObj));
400  return true;
401  }
402 
403  return false;
404 }
405 
407 {
408  if (cObj->GetProcedure()==DFA_ATTACH)
409  return cObj->SetAction(nullptr);
410  return false;
411 }
412 
414 {
415  // Stand - but keep momentum to allow more dyanamic digging
416  C4Real o_xdir = cObj->xdir, o_ydir = cObj->ydir;
417  ObjectActionStand(cObj);
418  cObj->xdir = o_xdir; cObj->ydir = o_ydir;
419  // Clear digging command
420  if (cObj->Command)
421  if (cObj->Command->Command == C4CMD_Dig)
422  cObj->ClearCommand(cObj->Command);
423 }
424 
425 bool ComDirLike(int32_t iComDir, int32_t iSample)
426 {
427  if (iComDir == iSample) return true;
428  if (iComDir % 8 + 1 == iSample) return true;
429  if (iComDir == iSample % 8 + 1 ) return true;
430  return false;
431 }
432 
C4PropertyName GetPropertyP(C4PropertyName k) const
Definition: C4PropList.cpp:855
int32_t GetY() const
Definition: C4Object.h:287
int32_t ContactCheck(int32_t atx, int32_t aty, uint32_t *border_hack_contacts=nullptr, bool collide_halfvehic=false)
Definition: C4Movement.cpp:136
bool ObjectComGrab(C4Object *cObj, C4Object *pTarget)
bool ObjectComUnGrab(C4Object *cObj)
#define COMD_UpRight
Definition: C4Object.h:52
bool Enter(C4Object *pTarget, bool fCalls=true, bool fCopyMotion=true, bool *pfRejectCollect=nullptr)
Definition: C4Object.cpp:1260
int32_t GetCon() const
Definition: C4Object.h:272
#define PSF_Grabbed
Definition: C4GameScript.h:53
uint32_t Random()
Definition: C4Random.cpp:43
bool ObjectActionKneel(C4Object *cObj)
Definition: C4ObjectCom.cpp:94
bool ObjectComCancelAttach(C4Object *cObj)
void SetDir(int32_t tdir)
Definition: C4Object.cpp:2840
#define PSF_CatchBlow
Definition: C4GameScript.h:72
C4PropList * GetAction() const
Definition: C4Object.cpp:2674
C4Command * Command
Definition: C4Object.h:166
int32_t ContactDensity
Definition: C4Shape.h:47
bool SetActionByName(C4String *ActName, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls=SAC_StartCall|SAC_AbortCall, bool fForce=false)
Definition: C4Object.cpp:2814
bool ObjectComPutTake(C4Object *cObj, C4Object *pTarget, C4Object *pThing)
C4Real C4REAL100(int x)
Definition: C4Real.h:267
int32_t GetBottomVertex()
Definition: C4Shape.cpp:457
void GameMsgObjectError(const char *szText, C4Object *pTarget, bool Red)
void ClearCommand(C4Command *pUntil)
Definition: C4Object.cpp:2545
const int32_t C4D_Grab_Get
Definition: C4Def.h:63
const uint32_t OCF_FullCon
Definition: C4Constants.h:85
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
int32_t GetVertexX(int32_t iVertex)
Definition: C4Shape.cpp:422
Definition: C4Real.h:58
bool Mobile
Definition: C4Object.h:128
const int32_t FullCon
Definition: C4Constants.h:181
bool ObjectComStop(C4Object *cObj)
bool ObjectComPut(C4Object *cObj, C4Object *pTarget, C4Object *pThing)
int32_t Wdt
Definition: C4Rect.h:30
bool ObjectActionWalk(C4Object *cObj)
Definition: C4ObjectCom.cpp:39
bool CloseMenu(bool fForce)
Definition: C4Object.cpp:1570
const int32_t C4D_Grab_Put
Definition: C4Def.h:62
C4NotifyingObjectList Contents
Definition: C4Object.h:152
C4Def * Def
Definition: C4Object.h:143
bool ObjectActionPush(C4Object *cObj, C4Object *target)
int32_t t_attach
Definition: C4Object.h:86
C4Real C4REAL10(int x)
Definition: C4Real.h:269
#define DIR_Left
Definition: C4Object.h:41
int32_t y
Definition: C4Rect.h:30
uint32_t t_contact
Definition: C4Object.h:133
bool ObjectComDrop(C4Object *cObj, C4Object *pThing)
bool ObjectComPunch(C4Object *cObj, C4Object *pTarget, int32_t punch)
#define PSF_OnActionJump
Definition: C4GameScript.h:140
virtual const char * GetName() const
Definition: C4PropList.cpp:649
int32_t Command
Definition: C4Command.h:81
bool ObjectComJump(C4Object *cObj)
bool SetAction(C4PropList *Act, C4Object *pTarget=nullptr, C4Object *pTarget2=nullptr, int32_t iCalls=SAC_StartCall|SAC_AbortCall, bool fForce=false)
Definition: C4Object.cpp:2681
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:1224
bool ComDirLike(int32_t iComDir, int32_t iSample)
int32_t GetX() const
Definition: C4Object.h:286
C4Fixed itofix(int32_t x)
Definition: C4Real.h:261
bool ObjectComThrow(C4Object *cObj, C4Object *pThing)
C4Object * GetObject(int Index=0) const
int32_t Status
Definition: C4PropList.h:168
#define PSF_Grab
Definition: C4GameScript.h:52
bool ObjectActionCornerScale(C4Object *cObj)
#define COMD_Right
Definition: C4Object.h:53
#define COMD_Stop
Definition: C4Object.h:50
bool ObjectActionStand(C4Object *cObj)
Definition: C4ObjectCom.cpp:45
int32_t x
Definition: C4Rect.h:30
C4ObjectPtr Target
Definition: C4Object.h:87
int32_t Data
Definition: C4Object.h:84
C4Real fix_x
Definition: C4Object.h:125
const BYTE CNAT_Top
Definition: C4Constants.h:111
bool ObjectActionThrow(C4Object *cObj, C4Object *pThing)
#define COMD_Left
Definition: C4Object.h:57
bool ObjectActionScale(C4Object *cObj, int32_t dir)
const BYTE CNAT_Right
Definition: C4Constants.h:110
int32_t Dir
Definition: C4Object.h:80
bool ObjectComTake(C4Object *cObj)
void ObjectComStopDig(C4Object *cObj)
#define C4FxCall_EngGetPunched
Definition: C4Effect.h:63
int32_t GetProcedure() const
Definition: C4Object.cpp:2860
bool ActivateMenu(int32_t iMenu, int32_t iMenuSelect=0, int32_t iMenuData=0, int32_t iMenuPosition=0, C4Object *pTarget=nullptr)
Definition: C4Object.cpp:1476
void DoEnergy(int32_t iChange, bool fExact, int32_t iCause, int32_t iCausedByPlr)
Definition: C4Object.cpp:1106
#define PSF_QueryCatchBlow
Definition: C4GameScript.h:73
int32_t GrabPutGet
Definition: C4Def.h:124
bool ObjectActionDig(C4Object *cObj)
#define PSF_Collection
Definition: C4GameScript.h:56
int32_t GetPropertyInt(C4PropertyName k, int32_t default_val=0) const
Definition: C4PropList.cpp:886
C4Real fix_y
Definition: C4Object.h:125
int32_t GetVertexY(int32_t iVertex)
Definition: C4Shape.cpp:428
void SetOCF()
Definition: C4Object.cpp:667
C4ObjectPtr Contained
Definition: C4Object.h:144
bool ObjectComDig(C4Object *cObj)
int32_t Hgt
Definition: C4Rect.h:30
bool ObjectActionFlat(C4Object *cObj, int32_t dir)
C4Action Action
Definition: C4Object.h:147
C4Shape Shape
Definition: C4Object.h:148
const int32_t C4M_Liquid
Definition: C4Constants.h:174
uint32_t OCF
Definition: C4Object.h:134
bool SimFlightHitsLiquid(C4Real fcx, C4Real fcy, C4Real xdir, C4Real ydir)
Definition: C4Movement.cpp:656
bool ObjectComTake2(C4Object *cObj)
bool ObjectActionDive(C4Object *cObj, C4Real xdir, C4Real ydir)
Definition: C4ObjectCom.cpp:68
bool ObjectActionHangle(C4Object *cObj)
bool ObjectActionTumble(C4Object *cObj, int32_t dir, C4Real xdir, C4Real ydir)
Definition: C4ObjectCom.cpp:79
int fixtoi(const C4Fixed &x)
Definition: C4Real.h:259
C4Real xdir
Definition: C4Object.h:126
int32_t Controller
Definition: C4Object.h:111
bool ObjectComLetGo(C4Object *cObj, int32_t xdirf)
#define PSF_Put
Definition: C4GameScript.h:55
const BYTE CNAT_Left
Definition: C4Constants.h:109
const BYTE CNAT_Bottom
Definition: C4Constants.h:112
C4Real ydir
Definition: C4Object.h:126
bool ObjectActionJump(C4Object *cObj, C4Real xdir, C4Real ydir, bool fByCom)
Definition: C4ObjectCom.cpp:52
bool ObjectActionGetPunched(C4Object *cObj, C4Real xdir, C4Real ydir)
Definition: C4ObjectCom.cpp:87
#define COMD_UpLeft
Definition: C4Object.h:58
int32_t ComDir
Definition: C4Object.h:82
const C4Real Fix0
Definition: C4Real.h:312
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270
C4Value Call(C4PropertyName k, C4AulParSet *pPars=nullptr, bool fPassErrors=false)
Definition: C4PropList.h:110