22#ifndef BLADERUNNER_SCRIPT_AI_H
23#define BLADERUNNER_SCRIPT_AI_H
25#include "bladerunner/script/script.h"
27namespace BladeRunner {
29class 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) \
70class 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);
118DECLARE_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);
127 bool _resumeIdleAfterFramesetCompletesFlag;
135 void talkToMcCoyInCity();
136 void talkToMcCoyAtNR02();
142DECLARE_SCRIPT(Dektora)
143 bool _resumeIdleAfterFramesetCompletesFlag;
146 double comp_distance(
int actorId,
float x1,
float y1,
float z1);
154 bool _resumeIdleAfterFramesetCompletesFlag;
157DECLARE_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();
189 int _varChooseIdleAnimation;
190 int _varNumOfTimesToHoldCurrentFrame;
192 bool _resumeIdleAfterFramesetCompletesFlag;
195DECLARE_SCRIPT(Crazylegs)
196 bool _resumeIdleAfterFramesetCompletesFlag;
199DECLARE_SCRIPT(Luther)
200 bool _resumeIdleAfterFramesetCompletesFlag;
203DECLARE_SCRIPT(Grigorian)
204 int _varChooseIdleAnimation;
205 int _varNumOfTimesToHoldCurrentFrame;
208DECLARE_SCRIPT(Transient)
214DECLARE_SCRIPT(BulletBob)
215 int _varChooseIdleAnimation;
218 int _varNumOfTimesToHoldCurrentFrame;
221DECLARE_SCRIPT(Runciter)
222 int _varChooseIdleAnimation;
225 int _varNumOfTimesToHoldCurrentFrame;
229DECLARE_SCRIPT(InsectDealer)
230 bool _resumeIdleAfterFramesetCompletesFlag;
237DECLARE_SCRIPT(TyrellGuard)
239 bool _resumeIdleAfterFramesetCompletesFlag;
242DECLARE_SCRIPT(EarlyQ)
243 int _varNumOfTimesToHoldCurrentFrame;
244 int _varChooseIdleAnimation;
246 bool _resumeIdleAfterFramesetCompletesFlag;
250 int _animationLoopCounter;
251 int _animationLoopLength;
252 int _animationLoopFrameMin;
253 int _animationLoopDirection;
254 int _animationLoopFrameMax;
262 int _varNumOfTimesToHoldCurrentFrame;
265 int _varChooseIdleAnimation;
268DECLARE_SCRIPT(Marcus)
272 bool _resumeIdleAfterFramesetCompletesFlag;
275DECLARE_SCRIPT(OfficerLeary)
276 int _varChooseIdleAnimation;
277 bool _idleModeRequestedWhileInTalkingState;
280DECLARE_SCRIPT(OfficerGrayford)
281 int _varChooseIdleAnimation;
282 bool _resumeIdleAfterFramesetCompletesFlag;
283 int _varNumOfTimesToHoldCurrentFrame;
287 bool _resumeIdleAfterFramesetCompletesFlag;
288 int _varChooseIdleAnimation;
289 int _varNumOfTimesToHoldCurrentFrame;
296DECLARE_SCRIPT(DeskClerk)
297 int _varChooseIdleAnimation;
298 bool _resumeIdleAfterFramesetCompletesFlag;
299 int _varNumOfTimesToHoldCurrentFrame;
302DECLARE_SCRIPT(HowieLee)
303 int _varIdleStatesToggle;
306DECLARE_SCRIPT(FishDealer)
307 bool _resumeIdleAfterFramesetCompletesFlag;
313DECLARE_SCRIPT(Murray)
314 bool _resumeIdleAfterFramesetCompletesFlag;
317DECLARE_SCRIPT(HawkersBarkeep)
318 int _varChooseIdleAnimation;
319 int _varNumOfTimesToHoldCurrentFrame;
321 bool _resumeIdleAfterFramesetCompletesFlag;
324DECLARE_SCRIPT(Holloway)
325 bool _resumeIdleAfterFramesetCompletesFlag;
328DECLARE_SCRIPT(SergeantWalls)
331DECLARE_SCRIPT(Moraji)
333 int _varNumOfTimesToHoldCurrentFrame;
336DECLARE_SCRIPT(TheBard)
339DECLARE_SCRIPT(Photographer)
340 int _varNumOfTimesToHoldCurrentFrame;
342 bool _resumeIdleAfterFramesetCompletesFlag;
345DECLARE_SCRIPT(Dispatcher)
348DECLARE_SCRIPT(AnsweringMachine)
354DECLARE_SCRIPT(GovernorKolvig)
357DECLARE_SCRIPT(EarlyQBartender)
358 int _varChooseIdleAnimation;
360 bool _resumeIdleAfterFramesetCompletesFlag;
363DECLARE_SCRIPT(HawkersParrot)
366DECLARE_SCRIPT(TaffyPatron)
369DECLARE_SCRIPT(LockupGuard)
372DECLARE_SCRIPT(Teenager)
375DECLARE_SCRIPT(HysteriaPatron1)
378DECLARE_SCRIPT(HysteriaPatron2)
381DECLARE_SCRIPT(HysteriaPatron3)
384DECLARE_SCRIPT(ShoeshineMan)
388DECLARE_SCRIPT(Tyrell)
389 bool _resumeIdleAfterFramesetCompletesFlag;
390 int _varChooseIdleAnimation;
394 int _varNumOfTimesToHoldCurrentFrame;
395 int _varChooseIdleAnimation;
397 bool _resumeIdleAfterFramesetCompletesFlag;
403DECLARE_SCRIPT(Bryant)
409DECLARE_SCRIPT(Sebastian)
410 bool _resumeIdleAfterFramesetCompletesFlag;
413 void setMcCoyIsABladeRunner();
416DECLARE_SCRIPT(Rachael)
417 bool _resumeIdleAfterFramesetCompletesFlag;
419 void dialogue_start();
420 void dialogue_agenda1();
421 void dialogue_agenda2();
422 void dialogue_act4();
425DECLARE_SCRIPT(GeneralDoll)
426 bool _resumeIdleAfterFramesetCompletesFlag;
429DECLARE_SCRIPT(Isabella)
431 int _varNumOfTimesToHoldCurrentFrame;
432 int _varChooseIdleAnimation;
436DECLARE_SCRIPT(BlimpGuy)
439DECLARE_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);
451DECLARE_SCRIPT(MaleAnnouncer)
454DECLARE_SCRIPT(FreeSlotA)
458 float _fallHeightCurrent;
459 float _fallHeightTarget;
461 void checkIfOnBridge();
462 void goToRandomUGxx();
465DECLARE_SCRIPT(FreeSlotB)
469 void goToRandomUGxx();
472DECLARE_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);
483DECLARE_SCRIPT(GenericWalkerA)
490 bool prepareWalker();
494DECLARE_SCRIPT(GenericWalkerB)
501 bool prepareWalker();
505DECLARE_SCRIPT(GenericWalkerC)
512 bool prepareWalker();
516DECLARE_SCRIPT(Mutant1)
517 bool _resumeIdleAfterFramesetCompletesFlag;
520DECLARE_SCRIPT(Mutant2)
522 bool _resumeIdleAfterFramesetCompletesFlag;
525DECLARE_SCRIPT(Mutant3)
527 bool _resumeIdleAfterFramesetCompletesFlag;
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:31
Definition: ai_script.h:533
Definition: bladerunner.h:113