ScummVM API documentation
PlayerState_Misc.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of Penumbra Overture.
26  */
27 
28 #ifndef GAME_PLAYER_STATE_MISC_H
29 #define GAME_PLAYER_STATE_MISC_H
30 
31 #include "hpl1/engine/engine.h"
32 #include "hpl1/penumbra-overture/PlayerState.h"
33 
34 using namespace hpl;
35 
37 // NORMAL STATE
39 
41 public:
42  cPlayerState_Normal(cInit *apInit, cPlayer *apPlayer);
43 
44  void OnUpdate(float afTimeStep);
45 
46  void OnStartInteract();
47  void OnStartExamine();
48 
49  void OnStartRun();
50  void OnStopRun();
51  void OnStartCrouch();
52  void OnStopCrouch();
53 
54  void OnStartInteractMode();
55 
56  void EnterState(iPlayerState *apPrevState);
57  void LeaveState(iPlayerState *apNextState);
58 };
60 // INTERACT MODE STATE
62 
64 public:
65  cPlayerState_InteractMode(cInit *apInit, cPlayer *apPlayer);
66 
67  void OnUpdate(float afTimeStep);
68 
69  void OnStartInteract();
70  void OnStartExamine();
71 
72  bool OnAddYaw(float afVal);
73  bool OnAddPitch(float afVal);
74 
75  void OnStartInteractMode();
76 
77  void EnterState(iPlayerState *apPrevState);
78  void LeaveState(iPlayerState *apNextState);
79 
80  void OnStartCrouch();
81  void OnStopCrouch();
82 
83 private:
84  ePlayerMoveState mPrevMoveState;
85 
86  cVector2f mvLookSpeed;
87  float mfRange;
88 };
89 
91 // USE ITEM STATE
93 
95 private:
96  ePlayerMoveState mPrevMoveState;
97  ePlayerState mPrevState;
98 
99 public:
100  cPlayerState_UseItem(cInit *apInit, cPlayer *apPlayer);
101 
102  void OnUpdate(float afTimeStep);
103 
104  void OnStartInteract();
105  void OnStartExamine();
106 
107  bool OnAddYaw(float afVal);
108  bool OnAddPitch(float afVal);
109 
110  void EnterState(iPlayerState *apPrevState);
111  void LeaveState(iPlayerState *apNextState);
112 
113  void OnStartCrouch();
114  void OnStopCrouch();
115 
116  bool OnStartInventory();
117 };
118 
120 // MESSAGE STATE
122 
124 private:
125  ePlayerMoveState mPrevMoveState;
126  // ePlayerState mPrevState;
127 
128 public:
129  cPlayerState_Message(cInit *apInit, cPlayer *apPlayer);
130 
131  void OnUpdate(float afTimeStep);
132 
133  bool OnJump();
134 
135  void OnStartInteract();
136  void OnStopInteract();
137  void OnStartExamine();
138 
139  bool OnMoveForwards(float afMul, float afTimeStep);
140  bool OnMoveSideways(float afMul, float afTimeStep);
141 
142  bool OnAddYaw(float afVal);
143  bool OnAddPitch(float afVal);
144 
145  void EnterState(iPlayerState *apPrevState);
146  void LeaveState(iPlayerState *apNextState);
147 
148  bool OnStartInventory();
149  bool OnStartInventoryShortCut(int alNum);
150 };
151 
153 // CLIMB
155 class cGameLadder;
157 private:
158  int mlState;
159 
160  float mfTimeCount;
161 
162  cVector3f mvCharPosition;
163 
164  cVector3f mvGoalPos;
165  cVector3f mvGoalRot;
166 
167  cVector3f mvPosAdd;
168  cVector3f mvRotAdd;
169 
170  float mfUpSpeed;
171  float mfDownSpeed;
172 
173  float mfStepLength;
174  float mfStepCount;
175  bool mbPlayedSound;
176 
177  cVector2f mvPrevPitchLimits;
178 
179  float mfLeaveAtTopCount;
180 
181  void PlaySound(const tString &asSound);
182 
183 public:
184  cPlayerState_Climb(cInit *apInit, cPlayer *apPlayer);
185 
186  void OnUpdate(float afTimeStep);
187 
188  void EnterState(iPlayerState *apPrevState);
189  void LeaveState(iPlayerState *apNextState);
190 
191  void OnStartInteract();
192  void OnStartExamine();
193 
194  bool OnAddYaw(float afVal);
195  bool OnAddPitch(float afVal);
196 
197  bool OnMoveForwards(float afMul, float afTimeStep);
198  bool OnMoveSideways(float afMul, float afTimeStep);
199 
200  void OnStartCrouch();
201  void OnStopCrouch();
202 
203  bool OnJump();
204 
205  bool OnStartInventory();
206 
207  cGameLadder *mpLadder;
208  cVector3f mvStartPosition;
209 };
210 
211 #endif // GAME_PLAYER_STATE_MISC_H
Definition: AI.h:36
Definition: PlayerState_Misc.h:123
Definition: str.h:59
Definition: PlayerState.h:45
Definition: Player.h:145
Definition: PlayerState_Misc.h:63
Definition: PlayerState_Misc.h:40
Definition: PlayerState_Misc.h:94
Definition: PlayerState_Misc.h:156
Definition: GameLadder.h:53
Definition: Init.h:70