generated from sigonasr2/CPlusPlusProjectTemplate
Encounter battle moveover
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
9fb2646864
commit
f8c2e5b061
@ -195,7 +195,7 @@ public:
|
||||
std::map<std::string,ObjectLoadInfo*> BASE_OBJECTS;
|
||||
std::vector<Encounter> ENCOUNTERS;
|
||||
Encounter ENCOUNTER_SPIDEY_1;
|
||||
Encounter*CURRENT_ENCOUNTER;
|
||||
Encounter CURRENT_ENCOUNTER;
|
||||
|
||||
bool OnUserCreate() override
|
||||
{
|
||||
@ -509,7 +509,7 @@ public:
|
||||
}
|
||||
|
||||
for (int i=0;i<OBJECTS.size();i++) {
|
||||
Object obj = OBJECTS.at(i);
|
||||
Object obj = OBJECTS[i];
|
||||
if (obj.name.compare("HAILSTORM_NODE")==0&&collidesWithPlayer(obj)) {
|
||||
int amountGained=rand()%4+2;
|
||||
WEATHER_POWERS[HAILSTORM]+=amountGained;
|
||||
@ -548,10 +548,10 @@ public:
|
||||
|
||||
if (!IN_BATTLE_ENCOUNTER&&MAP_NAME.compare("assets/maps/map1")==0) {
|
||||
for (int i=0;i<ENCOUNTERS.size();i++) {
|
||||
Encounter enc = ENCOUNTERS.at(i);
|
||||
Encounter enc = ENCOUNTERS[i];
|
||||
if (collidesWithPlayer(enc)) {
|
||||
IN_BATTLE_ENCOUNTER=true;
|
||||
CURRENT_ENCOUNTER=&enc;
|
||||
CURRENT_ENCOUNTER=enc;
|
||||
BATTLE_ENTRY_TIMER=0;
|
||||
}
|
||||
}
|
||||
@ -560,8 +560,8 @@ public:
|
||||
if (IN_BATTLE_ENCOUNTER) {
|
||||
BATTLE_ENTRY_TIMER++;
|
||||
if (BATTLE_ENTRY_TIMER>45) {
|
||||
int TARGET_COORDS_X=CURRENT_ENCOUNTER->x+WIDTH/32/2;
|
||||
int TARGET_COORDS_Y=CURRENT_ENCOUNTER->y+HEIGHT/32/2;
|
||||
int TARGET_COORDS_X=CURRENT_ENCOUNTER.x+WIDTH/32/2;
|
||||
int TARGET_COORDS_Y=CURRENT_ENCOUNTER.y+HEIGHT/32/2;
|
||||
if (PLAYER_COORDS[0]!=TARGET_COORDS_X) {
|
||||
if (PLAYER_COORDS[0]<TARGET_COORDS_X) {
|
||||
PLAYER_COORDS[0]+=BATTLE_CAMERA_SCROLL_SPD;
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user