Transformation sequence added

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 0dfd03138b
commit 14df119887
  1. 72
      SeasonsOfLoneliness.cpp
  2. BIN
      Seasons_of_Loneliness

@ -100,6 +100,8 @@ namespace cutscene{
LAUNCHPAD_PREPARE,
READY_TO_BOARD,
INTRUDERS_DETECTED,
A_A_ENCOUNTER,
A_A_TRANSFORM
};
}
@ -146,6 +148,7 @@ namespace gameflag{
COLLECTED_ITEMS_IN_DOME,
BOARDED_ROCKET,
INTRUDER_DETECTED,
DEFEATED_Y_Y,
};
}
@ -655,6 +658,8 @@ public:
bool BATTLE_DROUGHT_ACTIVE=false;
bool ROCKET_BOARD_OPTION=false;
int LOCKED_IN_DELAY=0;
Pixel SHIP_COLOR=WHITE;
vf2d BOSS_SIZE={1,1};
Map*MAP_1=new Map("map1");
Map*MAP_2=new Map("map2");
@ -2347,6 +2352,7 @@ public:
}
if (allDead) {
bool snakeFight=false;
bool YYFight=false;
if (!GAME_FLAGS[gameflag::LITTLESNAKES_KILLED]) {
for (int i=0;i<CURRENT_ENCOUNTER.entities.size();i++) {
if (CURRENT_ENCOUNTER.entities[i]->name.compare("Sidewinder")==0) {
@ -2363,6 +2369,20 @@ public:
break;
}
}
if (!GAME_FLAGS[gameflag::DEFEATED_Y_Y]) {
for (int i=0;i<CURRENT_ENCOUNTER.entities.size();i++) {
if (CURRENT_ENCOUNTER.entities[i]->name.compare("Y.Y")==0) {
YYFight=true;
break;
}
}
if (YYFight) {
GAME_FLAGS[gameflag::DEFEATED_Y_Y]=true;
DisplayMessageBox(58);
StartCutscene(cutscene::A_A_ENCOUNTER);
SHIP_COLOR=Pixel(89, 55, 36,255);
}
}
IN_BATTLE_ENCOUNTER=false;
ENCOUNTERS.erase(ENCOUNTERS.begin()+CURRENT_ENCOUNTER_IND);
resetBattleState();
@ -2867,13 +2887,58 @@ public:
DisplayMessageBox(57);
CUTSCENE_FLAGS[4]=true;
} else {
printf("In here.(1)");
updatePlayerState();
ENCOUNTERS.push_back(ENCOUNTER_Y_Y);
printf("In here.(2)");
EndCutscene();
printf("In here.(3)");
ENCOUNTERS.push_back(ENCOUNTER_Y_Y);
printf("In here.(4)");
}
}
}
}break;
case cutscene::A_A_ENCOUNTER:{
if (!messageBoxVisible) {
if (!CUTSCENE_FLAGS[0]) {
CUTSCENE_FLAGS[0]=true;
DisplayMessageBox(59);
CUTSCENE_TIMER=0;
} else
if (!CUTSCENE_FLAGS[1]&&CUTSCENE_TIMER>90) {
CUTSCENE_FLAGS[1]=true;
DisplayMessageBox(60);
} else
if (!CUTSCENE_FLAGS[2]) {
CUTSCENE_FLAGS[2]=true;
DisplayMessageBox(61);
} else {
PlayCutscene(cutscene::A_A_TRANSFORM);
}
}
}break;
case cutscene::A_A_TRANSFORM:{
if (CUTSCENE_TIMER<60) {
//89, 55, 36
SHIP_COLOR=Pixel(
std::clamp(89+(0.5*cos(M_PI/60*CUTSCENE_TIMER-M_PI)+0.5)*255,0.0,255.0),
std::clamp(55+(0.5*cos(M_PI/60*CUTSCENE_TIMER-M_PI)+0.5)*255,0.0,255.0),
std::clamp(36+(0.5*cos(M_PI/60*CUTSCENE_TIMER-M_PI)+0.5)*255,0.0,255.0),
255
);
} else
if (!CUTSCENE_FLAGS[0]) {
CUTSCENE_FLAGS[0]=true;
TIMER=0;
} else
if (!CUTSCENE_FLAGS[1]&&TIMER<240) {
BOSS_SIZE={
std::clamp(TIMER/240.0+1,1.0,2.0),
std::clamp(TIMER/240.0+1,1.0,2.0)
};
SHIP_COLOR=Pixel(255,255,255,(1-(TIMER/240.0))*255);
}
}break;
}
if (GAME_STATE==CUTSCENE_3&&!SOUND_IS_PLAYING) {
@ -3193,7 +3258,10 @@ public:
Clear(BLACK);
DrawStars();
if (!IN_BATTLE_ENCOUNTER) {
DrawDecal({WIDTH/2-32,HEIGHT/2-32},Y_Y_DECAL);
if (CURRENT_CUTSCENE==cutscene::A_A_TRANSFORM) {
DrawDecal({WIDTH/2-32*BOSS_SIZE.x,HEIGHT/2-32*BOSS_SIZE.y},A_A_DECAL,BOSS_SIZE,Pixel(SHIP_COLOR.r,SHIP_COLOR.g,SHIP_COLOR.b,255-SHIP_COLOR.a));
}
DrawDecal({WIDTH/2-32*BOSS_SIZE.x,HEIGHT/2-32*BOSS_SIZE.y},Y_Y_DECAL,BOSS_SIZE,SHIP_COLOR);
}
DrawGameWorld();
SetDrawTarget(2);

Binary file not shown.
Loading…
Cancel
Save