-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFunctions.cpp
101 lines (87 loc) · 2.51 KB
/
Functions.cpp
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "Functions.h"
#include "Original.h"
#include <iostream>
// Load resources in this function. Called only once when the game loads.
void __stdcall GameLoaded(LawnApp* App)
{
}
// Called when a new plant is added to the game.
void __stdcall PlantAdded(Plant* aPlant)
{
auto Lawn = aPlant->mLawn;
auto App = aPlant->mApp;
}
// Called when a plant is updating (once per frame per plant, iterating through all the plants on the board).
void __stdcall PlantUpdating(Plant* aPlant)
{
auto Lawn = aPlant->mLawn;
auto App = aPlant->mApp;
Original::PlantUpdate(aPlant);
}
// Called when a plant is being drawn on the screen.
void __stdcall PlantDrawing(Plant* aPlant, Sexy::Graphics* G)
{
auto Lawn = aPlant->mLawn;
auto App = aPlant->mApp;
Original::PlantDraw(aPlant, G);
}
// Called when a plant is shooting and should create its projectiles.
void __stdcall PlantShooting(Plant* aPlant, Zombie* Target, int Lane, bool IsSecondary)
{
auto Lawn = aPlant->mLawn;
auto App = aPlant->mApp;
Original::PlantShoot(aPlant, Target, Lane, IsSecondary);
}
// Called when a zombie spawns.
void __stdcall ZombieAdded(Zombie* aZombie)
{
auto Lawn = aZombie->mLawn;
auto App = aZombie->mApp;
}
// Called when a zombie is updating.
void __stdcall ZombieUpdating(Zombie* aZombie)
{
auto Lawn = aZombie->mLawn;
auto App = aZombie->mApp;
Original::ZombieUpdate(aZombie);
}
// Called whena zombie is being drawn.
void __stdcall ZombieDrawing(Zombie* aZombie, Sexy::Graphics* G)
{
auto App = aZombie->mApp;
Original::ZombieDraw(aZombie, G);
}
// Called when a zombie bites a plant.
void __stdcall ZombieEating(Zombie* aZombie, Plant* BittenPlant)
{
auto Lawn = aZombie->mLawn;
auto App = aZombie->mApp;
Original::BitePlant(aZombie, BittenPlant);
}
// Called when a new projectile is created.
void __stdcall ProjectileAdded(Projectile* aProj)
{
auto Lawn = aProj->mLawn;
auto App = aProj->mApp;
}
// Called when a projectile is updating
void __stdcall ProjectileUpdating(Projectile* aProj)
{
auto Lawn = aProj->mLawn;
auto App = aProj->mApp;
Original::ProjectileUpdate(aProj);
}
// Called when a projectile is colliding with a zombie. Zombie could be NULL if it hit the roof.
void __stdcall ProjectileColliding(Projectile* aProj, Zombie* aZombie)
{
auto Lawn = aProj->mLawn;
auto App = aProj->mApp;
Original::ProjectileCollide(aProj, aZombie);
}
// Called when a projectile is being drawn.
void __stdcall ProjectileDrawing(Projectile* aProj, Sexy::Graphics* G)
{
auto Lawn = aProj->mLawn;
auto App = aProj->mApp;
Original::ProjectileDraw(aProj, G);
}