generated from sigonasr2/CPlusPlusProjectTemplate
Corrected ability usage
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
765725de0d
commit
ffdc088e24
@ -76,6 +76,7 @@ namespace cutscene{
|
|||||||
IN_BED,
|
IN_BED,
|
||||||
SHAKE,
|
SHAKE,
|
||||||
INVESTIGATE_X_X,
|
INVESTIGATE_X_X,
|
||||||
|
CHECK_COORDS,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,6 +107,8 @@ namespace gameflag{
|
|||||||
ANALYSIS_X_X,
|
ANALYSIS_X_X,
|
||||||
TUTORIAL1_X_X,
|
TUTORIAL1_X_X,
|
||||||
TUTORIAL2_X_X,
|
TUTORIAL2_X_X,
|
||||||
|
CHECK_ROVER,
|
||||||
|
NEXT_COORDS,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,6 +311,7 @@ class WEATHER_POWER{
|
|||||||
bool burnTrees=false; //If set to true, will trigger a burning of trees.
|
bool burnTrees=false; //If set to true, will trigger a burning of trees.
|
||||||
float treeBurnChance=1; //% chance of trees getting burned by this attack.
|
float treeBurnChance=1; //% chance of trees getting burned by this attack.
|
||||||
float treeSeedChance=0; //% chance of trees producing seeds from this attack.
|
float treeSeedChance=0; //% chance of trees producing seeds from this attack.
|
||||||
|
bool lowPriority=false; //Will always go last if set to true.
|
||||||
WEATHER_POWER(std::string name,std::string desc,Animation*icon,Animation*effect,int dmg,int dmgRoll,int range,Pixel bgcol,Pixel textcol,int effectTime,ParticleEffect*parteff) {
|
WEATHER_POWER(std::string name,std::string desc,Animation*icon,Animation*effect,int dmg,int dmgRoll,int range,Pixel bgcol,Pixel textcol,int effectTime,ParticleEffect*parteff) {
|
||||||
this->description=desc;
|
this->description=desc;
|
||||||
this->name=name;
|
this->name=name;
|
||||||
@ -824,6 +828,8 @@ public:
|
|||||||
FIRESTORM->treeBurnChance=1;
|
FIRESTORM->treeBurnChance=1;
|
||||||
FIRESTORM->burnTrees=true;
|
FIRESTORM->burnTrees=true;
|
||||||
|
|
||||||
|
LIGHT_STORM->lowPriority=true;
|
||||||
|
|
||||||
MOVESET_SPIDEY.push_back(SANDSTORM);
|
MOVESET_SPIDEY.push_back(SANDSTORM);
|
||||||
MOVESET_SPIDEY.push_back(SEED_STORM);
|
MOVESET_SPIDEY.push_back(SEED_STORM);
|
||||||
MOVESET_SPIDEY.push_back(AVALANCHE);
|
MOVESET_SPIDEY.push_back(AVALANCHE);
|
||||||
@ -1064,7 +1070,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if (IN_BATTLE_ENCOUNTER) {
|
if (IN_BATTLE_ENCOUNTER&&!messageBoxVisible) {
|
||||||
switch (BATTLE_STATE) {
|
switch (BATTLE_STATE) {
|
||||||
case battle::PLAYER_SELECTION:{
|
case battle::PLAYER_SELECTION:{
|
||||||
if (GetKey(D).bPressed||GetKey(RIGHT).bPressed||GetKey(NP6).bPressed) {
|
if (GetKey(D).bPressed||GetKey(RIGHT).bPressed||GetKey(NP6).bPressed) {
|
||||||
@ -1225,6 +1231,16 @@ public:
|
|||||||
GAME_STATE=LATER_THAT_NIGHTFADEIN;
|
GAME_STATE=LATER_THAT_NIGHTFADEIN;
|
||||||
fadeOutCompleted();
|
fadeOutCompleted();
|
||||||
}
|
}
|
||||||
|
if (GAME_FLAGS[gameflag::REST_IN_DOME]&&!GAME_FLAGS[gameflag::SLEEP]) {
|
||||||
|
GAME_FLAGS[gameflag::SLEEP]=true;
|
||||||
|
//20,2
|
||||||
|
GAME_STATE=LATER_THAT_NIGHTFADEIN;
|
||||||
|
fadeOutCompleted();
|
||||||
|
}
|
||||||
|
if (!GAME_FLAGS[gameflag::CHECK_ROVER]&&GAME_FLAGS[gameflag::TUTORIAL2_X_X]) {
|
||||||
|
GAME_FLAGS[gameflag::CHECK_ROVER]=true;
|
||||||
|
DisplayMessageBox(26);
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
case cutscene::DISPLAY_VOLCANIC_AREA:{
|
case cutscene::DISPLAY_VOLCANIC_AREA:{
|
||||||
TeleportToMapFileCoords(13,122);
|
TeleportToMapFileCoords(13,122);
|
||||||
@ -1665,12 +1681,34 @@ public:
|
|||||||
case battle::PLAYER_SELECTION:{
|
case battle::PLAYER_SELECTION:{
|
||||||
if (!GAME_FLAGS[gameflag::TUTORIAL1_X_X]&&GAME_FLAGS[gameflag::ANALYSIS_X_X]) {
|
if (!GAME_FLAGS[gameflag::TUTORIAL1_X_X]&&GAME_FLAGS[gameflag::ANALYSIS_X_X]) {
|
||||||
GAME_FLAGS[gameflag::TUTORIAL1_X_X]=true;
|
GAME_FLAGS[gameflag::TUTORIAL1_X_X]=true;
|
||||||
|
bool hasPetalStorm=false;
|
||||||
|
for (int i=0;i<availablePowers.size();i++) {
|
||||||
|
if (availablePowers[i]->name.compare("Petal Storm")==0) {
|
||||||
|
BATTLE_CARD_SELECTION=availablePowers[i];
|
||||||
|
BATTLE_CARD_SELECTION_IND=i;
|
||||||
|
hasPetalStorm=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hasPetalStorm) {
|
||||||
DisplayMessageBox(24);
|
DisplayMessageBox(24);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
if (!GAME_FLAGS[gameflag::TUTORIAL2_X_X]&&GAME_FLAGS[gameflag::TUTORIAL1_X_X]) {
|
if (!GAME_FLAGS[gameflag::TUTORIAL2_X_X]&&GAME_FLAGS[gameflag::TUTORIAL1_X_X]) {
|
||||||
GAME_FLAGS[gameflag::TUTORIAL2_X_X]=true;
|
GAME_FLAGS[gameflag::TUTORIAL2_X_X]=true;
|
||||||
|
bool hasPetalStorm=false;
|
||||||
|
for (int i=0;i<availablePowers.size();i++) {
|
||||||
|
if (availablePowers[i]->name.compare("Petal Storm")==0) {
|
||||||
|
BATTLE_CARD_SELECTION=availablePowers[i];
|
||||||
|
BATTLE_CARD_SELECTION_IND=i;
|
||||||
|
hasPetalStorm=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hasPetalStorm) {
|
||||||
DisplayMessageBox(25);
|
DisplayMessageBox(25);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
case battle::WAIT_TURN_ANIMATION:{
|
case battle::WAIT_TURN_ANIMATION:{
|
||||||
if (EFFECT_TIMER==0) {
|
if (EFFECT_TIMER==0) {
|
||||||
@ -1703,14 +1741,16 @@ public:
|
|||||||
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
|
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
|
||||||
effectRadius({(int)BATTLE_PLAYER_COORDS.x,(int)BATTLE_PLAYER_COORDS.y},ref,-healRoll,true);
|
effectRadius({(int)BATTLE_PLAYER_COORDS.x,(int)BATTLE_PLAYER_COORDS.y},ref,-healRoll,true);
|
||||||
} else {
|
} else {
|
||||||
effectRadius({CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->x+CURRENT_ENCOUNTER.x,CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->y+CURRENT_ENCOUNTER.y},ref,-healRoll,false);
|
effectRadius({CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->x+CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr->sprite->width*CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->sprScale.x/2/32,CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->y+CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr->sprite->height*CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->sprScale.y/2/32},ref,-healRoll,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (EFFECT_TIMER==30&&ref->name.compare("Seed Storm")==0) {
|
if (EFFECT_TIMER==30&&(
|
||||||
|
ref->name.compare("Seed of Life")==0||
|
||||||
|
ref->name.compare("Seed Storm")==0)) {
|
||||||
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
|
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
|
||||||
effectRadius({(int)BATTLE_PLAYER_COORDS.x,(int)BATTLE_PLAYER_COORDS.y},ref,true);
|
effectRadius({(int)BATTLE_PLAYER_COORDS.x,(int)BATTLE_PLAYER_COORDS.y},ref,true);
|
||||||
} else {
|
} else {
|
||||||
effectRadius({CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->x+CURRENT_ENCOUNTER.x,CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->y+CURRENT_ENCOUNTER.y},ref,false);
|
effectRadius({CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->x+CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr->sprite->width*CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->sprScale.x/2/32,CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->y+CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr->sprite->height*CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->sprScale.y/2/32},ref,false);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if (EFFECT_TIMER==ref->effectTime-10){
|
if (EFFECT_TIMER==ref->effectTime-10){
|
||||||
@ -1724,7 +1764,7 @@ public:
|
|||||||
if (PLAYER_SELECTED_TARGET==-2) {
|
if (PLAYER_SELECTED_TARGET==-2) {
|
||||||
effectRadius({CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY},ref,true);
|
effectRadius({CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY},ref,true);
|
||||||
} else {
|
} else {
|
||||||
effectRadius({CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->x+CURRENT_ENCOUNTER.x,CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->y+CURRENT_ENCOUNTER.y},ref,true); }
|
effectRadius({CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->x+CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->spr->sprite->width*CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->sprScale.x/2/32,CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->y+CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->spr->sprite->height*CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->sprScale.y/2/32},ref,true); }
|
||||||
} else {
|
} else {
|
||||||
effectRadius({CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY},ref,false);
|
effectRadius({CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY},ref,false);
|
||||||
if (ref==LIGHT_STORM&&CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->name.compare("X_X")==0) {
|
if (ref==LIGHT_STORM&&CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->name.compare("X_X")==0) {
|
||||||
@ -2103,6 +2143,16 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
|
case cutscene::CHECK_COORDS:{
|
||||||
|
if (!messageBoxVisible) {
|
||||||
|
if (!CUTSCENE_FLAGS[0]) {
|
||||||
|
CUTSCENE_FLAGS[0]=true;
|
||||||
|
DisplayMessageBox(28);
|
||||||
|
} else {
|
||||||
|
EndCutscene();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GAME_STATE==CUTSCENE_3&&!SOUND_IS_PLAYING) {
|
if (GAME_STATE==CUTSCENE_3&&!SOUND_IS_PLAYING) {
|
||||||
@ -2249,6 +2299,12 @@ public:
|
|||||||
if (!GAME_FLAGS[gameflag::REPAIRED_ROVER_1]&&GAME_FLAGS[gameflag::COLLECTED_SILICON_1]&&PLAYER_COORDS[0]>=31&&PLAYER_COORDS[0]<=35&&PLAYER_COORDS[1]>=33&&PLAYER_COORDS[1]<=37) {
|
if (!GAME_FLAGS[gameflag::REPAIRED_ROVER_1]&&GAME_FLAGS[gameflag::COLLECTED_SILICON_1]&&PLAYER_COORDS[0]>=31&&PLAYER_COORDS[0]<=35&&PLAYER_COORDS[1]>=33&&PLAYER_COORDS[1]<=37) {
|
||||||
GAME_FLAGS[gameflag::REPAIRED_ROVER_1]=true;
|
GAME_FLAGS[gameflag::REPAIRED_ROVER_1]=true;
|
||||||
PlayCutscene(cutscene::REPAIR_ROVER_1);
|
PlayCutscene(cutscene::REPAIR_ROVER_1);
|
||||||
|
} else
|
||||||
|
if (!GAME_FLAGS[gameflag::NEXT_COORDS]&&GAME_FLAGS[gameflag::CHECK_ROVER]&&PLAYER_COORDS[0]>=31&&PLAYER_COORDS[0]<=35&&PLAYER_COORDS[1]>=33&&PLAYER_COORDS[1]<=37) {
|
||||||
|
GAME_FLAGS[gameflag::NEXT_COORDS]=true;
|
||||||
|
DisplayMessageBox(27);
|
||||||
|
StartCutscene(cutscene::CHECK_COORDS);
|
||||||
|
CUTSCENE_OBJS[0]=CreateObject({PLAYER_COORDS[0],PLAYER_COORDS[1]},PLAYER_DECAL,playerAnim,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2814,7 +2870,8 @@ public:
|
|||||||
for (int i=0;i<CURRENT_ENCOUNTER.entities.size();i++) {
|
for (int i=0;i<CURRENT_ENCOUNTER.entities.size();i++) {
|
||||||
finalDamage=power->damage+rand()%power->damageRoll*sign(power->damage);
|
finalDamage=power->damage+rand()%power->damageRoll*sign(power->damage);
|
||||||
Entity*ent=CURRENT_ENCOUNTER.entities[i];
|
Entity*ent=CURRENT_ENCOUNTER.entities[i];
|
||||||
if (distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height/2},coords*32)<=power->range) {
|
std::cout<<"Distance is "<<distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width*ent->sprScale.x/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height*ent->sprScale.y/2},coords*32)<<"m.\n";
|
||||||
|
if (distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width*ent->sprScale.x/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height*ent->sprScale.y/2},coords*32)<=power->range) {
|
||||||
ent->hp=std::clamp(ent->hp-finalDamage,0,ent->maxhp);
|
ent->hp=std::clamp(ent->hp-finalDamage,0,ent->maxhp);
|
||||||
CreateDisplayNumber(finalDamage,ent->x+CURRENT_ENCOUNTER.x+ent->spr->sprite->width*ent->sprScale.x/2/32,ent->y+CURRENT_ENCOUNTER.y+ent->spr->sprite->height*ent->sprScale.y/2/32,frameCount);
|
CreateDisplayNumber(finalDamage,ent->x+CURRENT_ENCOUNTER.x+ent->spr->sprite->width*ent->sprScale.x/2/32,ent->y+CURRENT_ENCOUNTER.y+ent->spr->sprite->height*ent->sprScale.y/2/32,frameCount);
|
||||||
ent->damageFrame=frameCount;
|
ent->damageFrame=frameCount;
|
||||||
@ -2827,8 +2884,8 @@ public:
|
|||||||
for (int i=0;i<CURRENT_ENCOUNTER.entities.size();i++) {
|
for (int i=0;i<CURRENT_ENCOUNTER.entities.size();i++) {
|
||||||
finalDamage=power->damage+rand()%power->damageRoll*sign(power->damage);
|
finalDamage=power->damage+rand()%power->damageRoll*sign(power->damage);
|
||||||
Entity*ent=CURRENT_ENCOUNTER.entities[i];
|
Entity*ent=CURRENT_ENCOUNTER.entities[i];
|
||||||
std::cout<<"Distance was "<<distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32),(float)((ent->y+CURRENT_ENCOUNTER.y)*32)},coords*32)<<"\n";
|
//std::cout<<"Distance was "<<distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32),(float)((ent->y+CURRENT_ENCOUNTER.y)*32)},coords*32)<<"\n";
|
||||||
if (ent->hp>0&&distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height/2},coords*32)<=power->range) {
|
if (ent->hp>0&&distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width*ent->sprScale.x/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height*ent->sprScale.y/2},coords*32)<=power->range) {
|
||||||
ent->hp=std::clamp(ent->hp-finalDamage,0,ent->maxhp);
|
ent->hp=std::clamp(ent->hp-finalDamage,0,ent->maxhp);
|
||||||
CreateDisplayNumber(finalDamage,ent->x+CURRENT_ENCOUNTER.x+ent->spr->sprite->width*ent->sprScale.x/2/32,ent->y+CURRENT_ENCOUNTER.y+ent->spr->sprite->height*ent->sprScale.y/2/32,frameCount);
|
CreateDisplayNumber(finalDamage,ent->x+CURRENT_ENCOUNTER.x+ent->spr->sprite->width*ent->sprScale.x/2/32,ent->y+CURRENT_ENCOUNTER.y+ent->spr->sprite->height*ent->sprScale.y/2/32,frameCount);
|
||||||
ent->damageFrame=frameCount;
|
ent->damageFrame=frameCount;
|
||||||
@ -2911,7 +2968,7 @@ public:
|
|||||||
PLAYER_TURN_COMPLETE=true;
|
PLAYER_TURN_COMPLETE=true;
|
||||||
}
|
}
|
||||||
if (ent->hp>0&&!ent->turnComplete&&
|
if (ent->hp>0&&!ent->turnComplete&&
|
||||||
!ent->slowed&&rand()%2==0) {
|
!ent->slowed&&rand()%2==0&&!ent->selectedMove->lowPriority) {
|
||||||
turnOrder.push(i);
|
turnOrder.push(i);
|
||||||
ent->turnComplete=true;
|
ent->turnComplete=true;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@ -85,8 +85,6 @@
|
|||||||
202;33;METEORSTORM_NODE
|
202;33;METEORSTORM_NODE
|
||||||
167;44;SNOWSTORM_NODE
|
167;44;SNOWSTORM_NODE
|
||||||
20;10;HURRICANE_NODE
|
20;10;HURRICANE_NODE
|
||||||
39;38;SOLARFLARE_NODE
|
|
||||||
38;38;FIRESTORM_NODE
|
|
||||||
33;35;BROKEN_ROVER
|
33;35;BROKEN_ROVER
|
||||||
116;8;NADO
|
116;8;NADO
|
||||||
120;9;NADO
|
120;9;NADO
|
||||||
|
Loading…
x
Reference in New Issue
Block a user