summaryrefslogtreecommitdiff
path: root/src/koopatlas/pathmanager.h
blob: 3c3ae1fa76161bf819f7e958d2e50f2cfcd91c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef __KOOPATLAS_PATH_MANAGER_H
#define __KOOPATLAS_PATH_MANAGER_H

#include "koopatlas/mapdata.h"

extern "C" void *SoundRelatedClass;
extern "C" void *MapSoundPlayer(void *SoundClass, int soundID, int unk);
extern "C" bool SpawnEffect(const char*, int, Vec*, S16Vec*, Vec*);

class dWMPathManager_c {
	public:
		void setup();
		~dWMPathManager_c();
		void execute();

		bool canUseExit(dKPPath_s *path) {
			OSReport("Checking usability of path %p\n", path);
			if (path) OSReport("Availability: %d\n", path->isAvailable);
			return (path != 0) && (path->isAvailable);
		}

		void startMovementTo(dKPPath_s *path);
		void moveThroughPath();
		void activatePoint();
		void unlockAllPaths(char type);

		dKPLayer_s *pathLayer;

		bool isMoving;
		dKPNode_s *currentNode;

		HermiteKey keysX[2];
		HermiteKey keysY[3];
		float timer;
		bool isJumping;
		float moveSpeed;

		int scaleAnimProgress;
		bool isScalingUp;

		dKPPath_s *currentPath;
		bool reverseThroughPath; // direction we are going through the path

		bool mustComplainToMapCreator;

		int newlyAvailablePaths;
		int newlyAvailableNodes;

		int unlockingAlpha; // -1 if not used
		int countdownToFadeIn;
		int waitAfterUnlock;

	private:
		void unlockPaths();
		bool evaluateUnlockCondition(u8 *&in, SaveBlock *save, int stack);

		bool isEnteringLevel;
		int levelStartWait;
		dLevelInfo_c::entry_s *enteredLevel;
};

#endif