generated from sigonasr2/CPlusPlusProjectTemplate
Setup rolling counter stuff
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
b80eb56837
commit
a02db5c33f
Binary file not shown.
@ -5,6 +5,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "../Seasons-Of-Loneliness"
|
"path": "../Seasons-Of-Loneliness"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../EarthboundBattleSim"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
|
BIN
assets/rollingcounter.png
Normal file
BIN
assets/rollingcounter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 710 B |
67
main.cpp
67
main.cpp
@ -19,6 +19,11 @@
|
|||||||
#define TILEMAP_EDITOR_DRAW_MULT 0.4375
|
#define TILEMAP_EDITOR_DRAW_MULT 0.4375
|
||||||
#define TILEMAP_EDITOR_TILESIZE (32*TILEMAP_EDITOR_DRAW_MULT)
|
#define TILEMAP_EDITOR_TILESIZE (32*TILEMAP_EDITOR_DRAW_MULT)
|
||||||
#define PARTY_TRAIL_LENGTH 48
|
#define PARTY_TRAIL_LENGTH 48
|
||||||
|
#define CAMERA_WAIT_TIME 60
|
||||||
|
|
||||||
|
#define ㅎ
|
||||||
|
#define ㅍ
|
||||||
|
#define 아
|
||||||
|
|
||||||
#define AddAsyncCutsceneAction(AsyncClass) \
|
#define AddAsyncCutsceneAction(AsyncClass) \
|
||||||
if (!((AsyncClass*)CurrentCutscene->GetAction())->InQueue()) { \
|
if (!((AsyncClass*)CurrentCutscene->GetAction())->InQueue()) { \
|
||||||
@ -261,6 +266,9 @@ class Entity{
|
|||||||
int HP=0;
|
int HP=0;
|
||||||
int targetHP=0;
|
int targetHP=0;
|
||||||
int maxHP=0;
|
int maxHP=0;
|
||||||
|
int PP=0;
|
||||||
|
int targetPP=0;
|
||||||
|
int maxPP=0;
|
||||||
std::array<int,4>resistances={0,0,0,0};
|
std::array<int,4>resistances={0,0,0,0};
|
||||||
int speed=0;
|
int speed=0;
|
||||||
int baseAtk=0;
|
int baseAtk=0;
|
||||||
@ -271,23 +279,17 @@ class Entity{
|
|||||||
Object* obj;
|
Object* obj;
|
||||||
std::vector<Battle::Move*> moveSet;
|
std::vector<Battle::Move*> moveSet;
|
||||||
//Used for initializing players.
|
//Used for initializing players.
|
||||||
Entity(int HP,int maxHP,int baseAtk,std::array<int,4>resistances,int speed,std::vector<Battle::Move*>moveSet,int damageReduction=0,bool smart=false,bool dumb=false) {
|
Entity(int HP,int maxHP,int PP,int maxPP,int baseAtk,std::array<int,4>resistances,int speed,std::vector<Battle::Move*>moveSet,int damageReduction=0,bool smart=false,bool dumb=false) {
|
||||||
Entity(nullptr,HP,maxHP,baseAtk,resistances,speed,moveSet,damageReduction,smart,dumb);
|
Entity(nullptr,HP,maxHP,PP,maxPP,baseAtk,resistances,speed,moveSet,damageReduction,smart,dumb);
|
||||||
}
|
}
|
||||||
//Use this for initializing enemies as it lets you specify an object.
|
//Use this for initializing enemies as it lets you specify an object.
|
||||||
Entity(Object*obj,int HP,int maxHP,int baseAtk,std::array<int,4>resistances,int speed,std::vector<Battle::Move*>moveSet,int damageReduction=0,bool smart=false,bool dumb=false) {
|
Entity(Object*obj,int HP,int maxHP,int PP,int maxPP,int baseAtk,std::array<int,4>resistances,int speed,std::vector<Battle::Move*>moveSet,int damageReduction=0,bool smart=false,bool dumb=false)
|
||||||
this->obj=obj;
|
:obj(obj),HP(HP),maxHP(maxHP),PP(PP),maxPP(maxPP),baseAtk(baseAtk),speed(speed),moveSet(moveSet),damageReduction(damageReduction),smart(smart),dumb(dumb){
|
||||||
this->HP=this->targetHP=HP;
|
|
||||||
this->maxHP=maxHP;
|
|
||||||
for (int i=0;i<4;i++) {
|
for (int i=0;i<4;i++) {
|
||||||
this->resistances[i]=resistances[i];
|
this->resistances[i]=resistances[i];
|
||||||
}
|
}
|
||||||
this->speed=speed;
|
this->targetHP=HP;
|
||||||
this->moveSet=moveSet;
|
this->targetPP=PP;
|
||||||
this->smart=smart;
|
|
||||||
this->dumb=dumb;
|
|
||||||
this->baseAtk=baseAtk;
|
|
||||||
this->damageReduction=damageReduction;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -384,6 +386,9 @@ public:
|
|||||||
Encounter*EDITING_ENCOUNTER=nullptr;
|
Encounter*EDITING_ENCOUNTER=nullptr;
|
||||||
Encounter*BATTLE_ENCOUNTER=nullptr;
|
Encounter*BATTLE_ENCOUNTER=nullptr;
|
||||||
int BATTLE_STATE=BattleState::MOVE_CAMERA;
|
int BATTLE_STATE=BattleState::MOVE_CAMERA;
|
||||||
|
int CAMERA_WAIT_TIMER=0;
|
||||||
|
int player_rollhp_counter[4][3] = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}};
|
||||||
|
int player_rollpp_counter[4][3] = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}};
|
||||||
|
|
||||||
|
|
||||||
bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things.
|
bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things.
|
||||||
@ -523,10 +528,24 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
|||||||
if (BATTLE_ENCOUNTER!=nullptr) {
|
if (BATTLE_ENCOUNTER!=nullptr) {
|
||||||
switch (BATTLE_STATE) {
|
switch (BATTLE_STATE) {
|
||||||
case BattleState::MOVE_CAMERA:{
|
case BattleState::MOVE_CAMERA:{
|
||||||
MoveCameraTowardsPoint(BATTLE_ENCOUNTER->pos,PriorityDirection::BOTH,BATTLE_CAMERA_MOVESPD);
|
bool allDone=true;
|
||||||
for (int i=0;i<PARTY_MEMBER_COUNT;i++) {
|
if (!MoveCameraTowardsPoint(BATTLE_ENCOUNTER->pos,PriorityDirection::BOTH,BATTLE_CAMERA_MOVESPD)) {
|
||||||
MoveObjectTowardsPoint(PARTY_MEMBER_OBJ[i],BATTLE_ENCOUNTER->playerPos[i]+BATTLE_ENCOUNTER->pos,PriorityDirection::BOTH,BATTLE_CAMERA_MOVESPD);
|
allDone=false;
|
||||||
}
|
}
|
||||||
|
for (int i=0;i<PARTY_MEMBER_COUNT;i++) {
|
||||||
|
if (!MoveObjectTowardsPoint(PARTY_MEMBER_OBJ[i],BATTLE_ENCOUNTER->playerPos[i]+BATTLE_ENCOUNTER->pos,PriorityDirection::BOTH,BATTLE_CAMERA_MOVESPD)) {
|
||||||
|
allDone=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (allDone) {
|
||||||
|
CAMERA_WAIT_TIMER++;
|
||||||
|
if (CAMERA_WAIT_TIMER>=CAMERA_WAIT_TIME) {
|
||||||
|
BATTLE_STATE=BattleState::WAIT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case BattleState::WAIT:{
|
||||||
|
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1429,7 +1448,7 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
|||||||
|
|
||||||
void SetupPartyMemberStats() {
|
void SetupPartyMemberStats() {
|
||||||
for (int i=0;i<7;i++) {
|
for (int i=0;i<7;i++) {
|
||||||
PARTY_MEMBER_STATS[i]=new Entity(120,120,8,{0,0,0,0},4,{MOVELIST[BattleMoveName::TESTMOVE1]});
|
PARTY_MEMBER_STATS[i]=new Entity(120,120,30,30,8,{0,0,0,0},4,{MOVELIST[BattleMoveName::TESTMOVE1]});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1620,21 +1639,21 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
|||||||
std::vector<Entity*>{
|
std::vector<Entity*>{
|
||||||
new Entity(new Object(
|
new Entity(new Object(
|
||||||
NPC1_4,"Test Obj",{+20,+48},ANIMATIONS["player.png"]),
|
NPC1_4,"Test Obj",{+20,+48},ANIMATIONS["player.png"]),
|
||||||
70,70,14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
}),
|
||||||
new Entity(new Object(
|
new Entity(new Object(
|
||||||
NPC1_4,"Test Obj 2",{+40,+64},ANIMATIONS["player.png"]),
|
NPC1_4,"Test Obj 2",{+40,+64},ANIMATIONS["player.png"]),
|
||||||
70,70,14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
}),
|
||||||
new Entity(new Object(
|
new Entity(new Object(
|
||||||
NPC1_4,"Test Obj 3",{+60,+24},ANIMATIONS["player.png"]),
|
NPC1_4,"Test Obj 3",{+60,+24},ANIMATIONS["player.png"]),
|
||||||
70,70,14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
@ -1645,21 +1664,21 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
|||||||
std::vector<Entity*>{
|
std::vector<Entity*>{
|
||||||
new Entity(new Object(
|
new Entity(new Object(
|
||||||
NPC1_4,"Test Obj",{20,48},ANIMATIONS["player.png"],{2,2},GREEN),
|
NPC1_4,"Test Obj",{20,48},ANIMATIONS["player.png"],{2,2},GREEN),
|
||||||
70,70,14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
}),
|
||||||
new Entity(new Object(
|
new Entity(new Object(
|
||||||
NPC1_4,"Test Obj 2",{40,64},ANIMATIONS["player.png"],{2,2},GREEN),
|
NPC1_4,"Test Obj 2",{40,64},ANIMATIONS["player.png"],{2,2},GREEN),
|
||||||
70,70,14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
}),
|
||||||
new Entity(new Object(
|
new Entity(new Object(
|
||||||
NPC1_4,"Test Obj 3",{60,24},ANIMATIONS["player.png"],{2,2},GREEN),
|
NPC1_4,"Test Obj 3",{60,24},ANIMATIONS["player.png"],{2,2},GREEN),
|
||||||
70,70,14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
@ -1670,7 +1689,7 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
|||||||
std::vector<Entity*>{
|
std::vector<Entity*>{
|
||||||
new Entity(new Object(
|
new Entity(new Object(
|
||||||
NPC1_4,"Test Obj",{20,48},ANIMATIONS["player.png"],{1,1},MAGENTA),
|
NPC1_4,"Test Obj",{20,48},ANIMATIONS["player.png"],{1,1},MAGENTA),
|
||||||
70,70,14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
@ -1898,7 +1917,7 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
|||||||
for (int i=0;i<ENCOUNTER_LIST[id]->objs.size();i++) {
|
for (int i=0;i<ENCOUNTER_LIST[id]->objs.size();i++) {
|
||||||
Entity*ent=ENCOUNTER_LIST[id]->objs[i];
|
Entity*ent=ENCOUNTER_LIST[id]->objs[i];
|
||||||
Object*newObj=new Object(ent->obj->id,ent->obj->name,ent->obj->GetPos(),ent->obj->spr,ent->obj->GetScale(),ent->obj->color,ent->obj->animationSpd,ent->obj->temp);
|
Object*newObj=new Object(ent->obj->id,ent->obj->name,ent->obj->GetPos(),ent->obj->spr,ent->obj->GetScale(),ent->obj->color,ent->obj->animationSpd,ent->obj->temp);
|
||||||
ents.push_back(new Entity(newObj,ent->HP,ent->maxHP,ent->baseAtk,ent->resistances,ent->speed,ent->moveSet,ent->damageReduction,ent->smart,ent->dumb));
|
ents.push_back(new Entity(newObj,ent->HP,ent->maxHP,ent->PP,ent->maxPP,ent->baseAtk,ent->resistances,ent->speed,ent->moveSet,ent->damageReduction,ent->smart,ent->dumb));
|
||||||
}
|
}
|
||||||
Encounter*data=new Encounter(id,pos,ENCOUNTER_LIST[id]->playerPos,ents,chance);
|
Encounter*data=new Encounter(id,pos,ENCOUNTER_LIST[id]->playerPos,ents,chance);
|
||||||
data->chance=chance;
|
data->chance=chance;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user