22 #ifndef BLADERUNNER_SCRIPT_AI_H 23 #define BLADERUNNER_SCRIPT_AI_H 25 #include "bladerunner/script/script.h" 29 class BladeRunnerEngine;
35 int _animationStateNext;
42 _animationStateNext = 0;
46 virtual void Initialize() = 0;
47 virtual bool Update() = 0;
48 virtual void TimerExpired(
int timer) = 0;
49 virtual void CompletedMovementTrack() = 0;
50 virtual void ReceivedClue(
int clueId,
int fromActorId) = 0;
51 virtual void ClickedByPlayer() = 0;
52 virtual void EnteredSet(
int setId) = 0;
53 virtual void OtherAgentEnteredThisSet(
int otherActorId) = 0;
54 virtual void OtherAgentExitedThisSet(
int otherActorId) = 0;
55 virtual void OtherAgentEnteredCombatMode(
int otherActorId,
int combatMode) = 0;
56 virtual void ShotAtAndMissed() = 0;
57 virtual bool ShotAtAndHit() = 0;
58 virtual void Retired(
int byActorId) = 0;
59 virtual int GetFriendlinessModifierIfGetsClue(
int otherActorId,
int clueId) = 0;
60 virtual bool GoalChanged(
int currentGoalNumber,
int newGoalNumber) = 0;
61 virtual bool UpdateAnimation(
int *animation,
int *frame) = 0;
62 virtual bool ChangeAnimationMode(
int mode) = 0;
63 virtual void QueryAnimationState(
int *animationState,
int *animationFrame,
int *animationStateNext,
int *animationNext) = 0;
64 virtual void SetAnimationState(
int animationState,
int animationFrame,
int animationStateNext,
int animationNext) = 0;
65 virtual bool ReachedMovementTrackWaypoint(
int waypointId) = 0;
66 virtual void FledCombat() = 0;
69 #define DECLARE_SCRIPT(name) \ 70 class AIScript##name : public AIScriptBase { \ 72 AIScript##name(BladeRunnerEngine *vm); \ 75 void TimerExpired(int timer); \ 76 void CompletedMovementTrack(); \ 77 void ReceivedClue(int clueId, int fromActorId); \ 78 void ClickedByPlayer(); \ 79 void EnteredSet(int setId); \ 80 void OtherAgentEnteredThisSet(int otherActorId); \ 81 void OtherAgentExitedThisSet(int otherActorId); \ 82 void OtherAgentEnteredCombatMode(int otherActorId, int combatMode); \ 83 void ShotAtAndMissed(); \ 84 bool ShotAtAndHit(); \ 85 void Retired(int byActorId); \ 86 int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId); \ 87 bool GoalChanged(int currentGoalNumber, int newGoalNumber); \ 88 bool UpdateAnimation(int *animation, int *frame); \ 89 bool ChangeAnimationMode(int mode); \ 90 void QueryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext); \ 91 void SetAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext); \ 92 bool ReachedMovementTrackWaypoint(int waypointId); \ 98 int _animationLoopCounter;
99 int _animationLoopLength;
100 int _animationLoopDirection;
101 int _animationLoopFrameMin;
102 int _animationLoopFrameMax;
103 int _animationStateNextSpecial;
104 int _animationNextSpecial;
106 bool _NR10SteeleShooting;
108 float _fallHeightCurrent;
109 float _fallHeightTarget;
114 void walkStairsLeft(
float stepHeight);
115 void walkStairsRight(
float stepHeight);
118 DECLARE_SCRIPT(Steele)
119 bool _resumeIdleAfterFramesetCompletesFlag;
120 int _varChooseIdleAnimation;
121 int _varNumOfTimesToHoldCurrentFrame;
123 double comp_distance(
int actorId,
float a5,
float a6,
int a1,
float a2,
float a3,
float a4);
126 DECLARE_SCRIPT(Gordo)
127 bool _resumeIdleAfterFramesetCompletesFlag;
135 void talkToMcCoyInCity();
136 void talkToMcCoyAtNR02();
142 DECLARE_SCRIPT(Dektora)
143 bool _resumeIdleAfterFramesetCompletesFlag;
146 double comp_distance(
int actorId,
float x1,
float y1,
float z1);
150 DECLARE_SCRIPT(Guzza)
154 bool _resumeIdleAfterFramesetCompletesFlag;
157 DECLARE_SCRIPT(Clovis)
158 int _varChooseIdleAnimation;
159 int _varNumOfTimesToHoldCurrentFrame;
163 bool _resumeIdleAfterFramesetCompletesFlag;
170 bool _resumeIdleAfterFramesetCompletesFlag;
172 void voightKampffTest();
179 int _varNumOfTimesToHoldCurrentFrame;
180 int _varChooseIdleAnimation;
181 bool _resumeIdleAfterFramesetCompletesFlag;
183 void dialogueWithIzo();
184 void modifyWaypoints();
187 DECLARE_SCRIPT(Sadik)
189 int _varChooseIdleAnimation;
190 int _varNumOfTimesToHoldCurrentFrame;
192 bool _resumeIdleAfterFramesetCompletesFlag;
195 DECLARE_SCRIPT(Crazylegs)
196 bool _resumeIdleAfterFramesetCompletesFlag;
199 DECLARE_SCRIPT(Luther)
200 bool _resumeIdleAfterFramesetCompletesFlag;
203 DECLARE_SCRIPT(Grigorian)
204 int _varChooseIdleAnimation;
205 int _varNumOfTimesToHoldCurrentFrame;
208 DECLARE_SCRIPT(Transient)
211 DECLARE_SCRIPT(Lance)
214 DECLARE_SCRIPT(BulletBob)
215 int _varChooseIdleAnimation;
218 int _varNumOfTimesToHoldCurrentFrame;
221 DECLARE_SCRIPT(Runciter)
222 int _varChooseIdleAnimation;
225 int _varNumOfTimesToHoldCurrentFrame;
229 DECLARE_SCRIPT(InsectDealer)
230 bool _resumeIdleAfterFramesetCompletesFlag;
237 DECLARE_SCRIPT(TyrellGuard)
239 bool _resumeIdleAfterFramesetCompletesFlag;
242 DECLARE_SCRIPT(EarlyQ)
243 int _varNumOfTimesToHoldCurrentFrame;
244 int _varChooseIdleAnimation;
246 bool _resumeIdleAfterFramesetCompletesFlag;
249 DECLARE_SCRIPT(Zuben)
250 int _animationLoopCounter;
251 int _animationLoopLength;
252 int _animationLoopFrameMin;
253 int _animationLoopDirection;
254 int _animationLoopFrameMax;
259 DECLARE_SCRIPT(Hasan)
262 int _varNumOfTimesToHoldCurrentFrame;
265 int _varChooseIdleAnimation;
268 DECLARE_SCRIPT(Marcus)
272 bool _resumeIdleAfterFramesetCompletesFlag;
275 DECLARE_SCRIPT(OfficerLeary)
276 int _varChooseIdleAnimation;
277 bool _idleModeRequestedWhileInTalkingState;
280 DECLARE_SCRIPT(OfficerGrayford)
281 int _varChooseIdleAnimation;
282 bool _resumeIdleAfterFramesetCompletesFlag;
283 int _varNumOfTimesToHoldCurrentFrame;
286 DECLARE_SCRIPT(Hanoi)
287 bool _resumeIdleAfterFramesetCompletesFlag;
288 int _varChooseIdleAnimation;
289 int _varNumOfTimesToHoldCurrentFrame;
293 DECLARE_SCRIPT(Baker)
296 DECLARE_SCRIPT(DeskClerk)
297 int _varChooseIdleAnimation;
298 bool _resumeIdleAfterFramesetCompletesFlag;
299 int _varNumOfTimesToHoldCurrentFrame;
302 DECLARE_SCRIPT(HowieLee)
303 int _varIdleStatesToggle;
306 DECLARE_SCRIPT(FishDealer)
307 bool _resumeIdleAfterFramesetCompletesFlag;
310 DECLARE_SCRIPT(Klein)
313 DECLARE_SCRIPT(Murray)
314 bool _resumeIdleAfterFramesetCompletesFlag;
317 DECLARE_SCRIPT(HawkersBarkeep)
318 int _varChooseIdleAnimation;
319 int _varNumOfTimesToHoldCurrentFrame;
321 bool _resumeIdleAfterFramesetCompletesFlag;
324 DECLARE_SCRIPT(Holloway)
325 bool _resumeIdleAfterFramesetCompletesFlag;
328 DECLARE_SCRIPT(SergeantWalls)
331 DECLARE_SCRIPT(Moraji)
333 int _varNumOfTimesToHoldCurrentFrame;
336 DECLARE_SCRIPT(TheBard)
339 DECLARE_SCRIPT(Photographer)
340 int _varNumOfTimesToHoldCurrentFrame;
342 bool _resumeIdleAfterFramesetCompletesFlag;
345 DECLARE_SCRIPT(Dispatcher)
348 DECLARE_SCRIPT(AnsweringMachine)
351 DECLARE_SCRIPT(Rajif)
354 DECLARE_SCRIPT(GovernorKolvig)
357 DECLARE_SCRIPT(EarlyQBartender)
358 int _varChooseIdleAnimation;
360 bool _resumeIdleAfterFramesetCompletesFlag;
363 DECLARE_SCRIPT(HawkersParrot)
366 DECLARE_SCRIPT(TaffyPatron)
369 DECLARE_SCRIPT(LockupGuard)
372 DECLARE_SCRIPT(Teenager)
375 DECLARE_SCRIPT(HysteriaPatron1)
378 DECLARE_SCRIPT(HysteriaPatron2)
381 DECLARE_SCRIPT(HysteriaPatron3)
384 DECLARE_SCRIPT(ShoeshineMan)
388 DECLARE_SCRIPT(Tyrell)
389 bool _resumeIdleAfterFramesetCompletesFlag;
390 int _varChooseIdleAnimation;
394 int _varNumOfTimesToHoldCurrentFrame;
395 int _varChooseIdleAnimation;
397 bool _resumeIdleAfterFramesetCompletesFlag;
403 DECLARE_SCRIPT(Bryant)
406 DECLARE_SCRIPT(Taffy)
409 DECLARE_SCRIPT(Sebastian)
410 bool _resumeIdleAfterFramesetCompletesFlag;
413 void setMcCoyIsABladeRunner();
416 DECLARE_SCRIPT(Rachael)
417 bool _resumeIdleAfterFramesetCompletesFlag;
419 void dialogue_start();
420 void dialogue_agenda1();
421 void dialogue_agenda2();
422 void dialogue_act4();
425 DECLARE_SCRIPT(GeneralDoll)
426 bool _resumeIdleAfterFramesetCompletesFlag;
429 DECLARE_SCRIPT(Isabella)
431 int _varNumOfTimesToHoldCurrentFrame;
432 int _varChooseIdleAnimation;
436 DECLARE_SCRIPT(BlimpGuy)
439 DECLARE_SCRIPT(Newscaster)
443 bool _resumeIdleAfterFramesetCompletesFlag;
444 float _mcCoyPositionX;
445 float _mcCoyPositionY;
446 float _mcCoyPositionZ;
448 float distanceTo(
int actorId,
float x,
float y,
float z);
451 DECLARE_SCRIPT(MaleAnnouncer)
454 DECLARE_SCRIPT(FreeSlotA)
458 float _fallHeightCurrent;
459 float _fallHeightTarget;
461 void checkIfOnBridge();
462 void goToRandomUGxx();
465 DECLARE_SCRIPT(FreeSlotB)
469 void goToRandomUGxx();
472 DECLARE_SCRIPT(Maggie)
473 int _varTimesToLoopWhenHappyB;
474 int _varTimesToBarkWhenHappyA;
475 int _varMaggieSoundPan;
476 int _varMaggieClickResponse;
479 int randomWaypointMA02();
480 float distanceToActor(
int actorId,
float x,
float y,
float z);
483 DECLARE_SCRIPT(GenericWalkerA)
490 bool prepareWalker();
494 DECLARE_SCRIPT(GenericWalkerB)
501 bool prepareWalker();
505 DECLARE_SCRIPT(GenericWalkerC)
512 bool prepareWalker();
516 DECLARE_SCRIPT(Mutant1)
517 bool _resumeIdleAfterFramesetCompletesFlag;
520 DECLARE_SCRIPT(Mutant2)
522 bool _resumeIdleAfterFramesetCompletesFlag;
525 DECLARE_SCRIPT(Mutant3)
527 bool _resumeIdleAfterFramesetCompletesFlag;
530 #undef DECLARE_SCRIPT 536 int _inScriptCounter;
539 bool *_actorUpdating;
544 void initialize(
int actor);
545 void update(
int actor);
546 void timerExpired(
int actor,
int timer);
547 void completedMovementTrack(
int actor);
548 void receivedClue(
int actor,
int clueId,
int fromActorId);
549 void clickedByPlayer(
int actor);
550 void enteredSet(
int actor,
int setId);
551 void otherAgentEnteredThisSet(
int actor,
int otherActorId);
552 void otherAgentExitedThisSet(
int actor,
int otherActorId);
553 void otherAgentEnteredCombatMode(
int actorId,
int otherActorId,
int combatMode);
554 void shotAtAndMissed(
int actorId);
555 bool shotAtAndHit(
int actorId);
556 void retired(
int actor,
int retiredByActorId);
557 void goalChanged(
int actor,
int currentGoalNumber,
int newGoalNumber);
558 bool reachedMovementTrackWaypoint(
int actor,
int waypointId);
559 void updateAnimation(
int actor,
int *animation,
int *frame);
560 void changeAnimationMode(
int actor,
int mode);
561 void queryAnimationState(
int actor,
int *animationState,
int *animationFrame,
int *animationStateNext,
int *animationNext);
562 void setAnimationState(
int actor,
int animationState,
int animationFrame,
int animationStateNext,
int animationNext);
563 void fledCombat(
int actor);
565 bool isInsideScript()
const {
return _inScriptCounter > 0; }
567 void callChangeAnimationMode(
int actor,
int mode) { _AIScripts[actor]->ChangeAnimationMode(mode); }
568 int callGetFriendlinessModifierIfGetsClue(
int actor,
int otherActorId,
int clueId) {
569 return _AIScripts[actor]->GetFriendlinessModifierIfGetsClue(otherActorId, clueId);
Definition: ai_script.h:533
Definition: ai_script.h:31
Definition: bladerunner.h:113