|
|
|
@ -54,7 +54,7 @@ const float TARGET_RATE = 1/60.0; |
|
|
|
|
int MAP_WIDTH=-1; |
|
|
|
|
int MAP_HEIGHT=-1; |
|
|
|
|
Map*CURRENT_MAP=nullptr; |
|
|
|
|
Map*MAP_ONETT=nullptr; |
|
|
|
|
extern std::map<MapName::Map,Map*> MAPS; |
|
|
|
|
int GAME_STATE = GameState::EDITOR; |
|
|
|
|
vi2d SELECTED_TILE={0,0}; |
|
|
|
|
vi2d HIGHLIGHTED_TILE={0,0}; |
|
|
|
@ -158,6 +158,8 @@ int SHOP_MENU_CURSOR=0; |
|
|
|
|
Object*SHOPKEEPER_INTERACTING_WITH=nullptr; |
|
|
|
|
extern std::map<TriggerName::Trigger,std::string> TRIGGERS; |
|
|
|
|
TriggerName::Trigger SELECTED_TRIGGER; |
|
|
|
|
int TRIGGER_OFFSET=0; |
|
|
|
|
int WORLD_DISPLAY_OFFSET=0; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
[Choice1,Choice2,Choice3] |
|
|
|
@ -246,11 +248,9 @@ bool SeasonI::OnUserCreate(){ |
|
|
|
|
additionalChars[Σ]={24,0}; |
|
|
|
|
additionalChars[γ]={32,0}; |
|
|
|
|
|
|
|
|
|
MAP_ONETT=new Map("map0","map0_2","map0_3","map0_4","map0_5",SPRITES["terrainmap.png"]); |
|
|
|
|
|
|
|
|
|
CURRENT_MAP=MAP_ONETT; |
|
|
|
|
CURRENT_MAP=MAPS[MapName::ONETT]; |
|
|
|
|
//OBJ_INFO["PLAYER"]=PLAYER_ANIMATION;
|
|
|
|
|
LoadMap(MAP_ONETT); |
|
|
|
|
LoadMap(CURRENT_MAP); |
|
|
|
|
|
|
|
|
|
TestCutscene=new Cutscene({ |
|
|
|
|
액션 Fade(), |
|
|
|
@ -762,33 +762,50 @@ void SeasonI::LoadMap(Map*map) { |
|
|
|
|
} |
|
|
|
|
MAP[i].clear(); |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<MAP.size();i++) { |
|
|
|
|
for (int j=0;j<MAP[i].size();j++) { |
|
|
|
|
for (int i=0;i<MAP2.size();i++) { |
|
|
|
|
for (int j=0;j<MAP2[i].size();j++) { |
|
|
|
|
delete MAP2[i][j]; |
|
|
|
|
} |
|
|
|
|
MAP2[i].clear(); |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<MAP.size();i++) { |
|
|
|
|
for (int j=0;j<MAP[i].size();j++) { |
|
|
|
|
|
|
|
|
|
for (int i=0;i<MAP3.size();i++) { |
|
|
|
|
for (int j=0;j<MAP3[i].size();j++) { |
|
|
|
|
delete MAP3[i][j]; |
|
|
|
|
} |
|
|
|
|
MAP3[i].clear(); |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<MAP.size();i++) { |
|
|
|
|
for (int j=0;j<MAP[i].size();j++) { |
|
|
|
|
for (int i=0;i<MAP4.size();i++) { |
|
|
|
|
for (int j=0;j<MAP4[i].size();j++) { |
|
|
|
|
delete MAP4[i][j]; |
|
|
|
|
} |
|
|
|
|
MAP4[i].clear(); |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<MAP.size();i++) { |
|
|
|
|
for (int j=0;j<MAP[i].size();j++) { |
|
|
|
|
for (int i=0;i<MAP5.size();i++) { |
|
|
|
|
for (int j=0;j<MAP5[i].size();j++) { |
|
|
|
|
delete MAP5[i][j]; |
|
|
|
|
} |
|
|
|
|
MAP5[i].clear(); |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<map->encounters.size();i++) { |
|
|
|
|
for (int j=0;j<map->encounters[i]->objs.size();j++) { |
|
|
|
|
delete map->encounters[i]->objs[j]; |
|
|
|
|
} |
|
|
|
|
map->encounters[i]->objs.clear(); |
|
|
|
|
delete map->encounters[i]; |
|
|
|
|
} |
|
|
|
|
map->encounters.clear(); |
|
|
|
|
for (int i=0;i<map->triggers.size();i++) { |
|
|
|
|
delete map->triggers[i]; |
|
|
|
|
} |
|
|
|
|
map->triggers.clear(); |
|
|
|
|
MAP_WIDTH=-1; |
|
|
|
|
MAP_HEIGHT=-1; |
|
|
|
|
MAP.clear(); |
|
|
|
|
MAP2.clear(); |
|
|
|
|
MAP3.clear(); |
|
|
|
|
MAP4.clear(); |
|
|
|
|
MAP5.clear(); |
|
|
|
|
for (int i=0;i<OBJECTS.size();i++) { |
|
|
|
|
delete OBJECTS[i]; |
|
|
|
|
} |
|
|
|
@ -797,6 +814,7 @@ void SeasonI::LoadMap(Map*map) { |
|
|
|
|
PARTY_MEMBER_OBJ[i]=nullptr; |
|
|
|
|
PARTY_MEMBER_ID[i]=0; |
|
|
|
|
} |
|
|
|
|
PARTY_MEMBER_COUNT=0; |
|
|
|
|
std::string data; |
|
|
|
|
while (f.good()) { |
|
|
|
|
f>>data; |
|
|
|
@ -876,6 +894,7 @@ void SeasonI::LoadMap(Map*map) { |
|
|
|
|
MAP_HEIGHT++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
while (f2.good()) { |
|
|
|
|
f2>>data; |
|
|
|
|
std::vector<TILE*> tiles; |
|
|
|
@ -2261,6 +2280,9 @@ void SeasonI::keyUpdates() { |
|
|
|
|
EDITING_LAYER=layer::BACKGROUND; |
|
|
|
|
EnableLayer(layer::COLLISION,false); |
|
|
|
|
} |
|
|
|
|
if (GetKey(HOME).bPressed) { |
|
|
|
|
GAME_STATE=GameState::MAP_SELECT; |
|
|
|
|
} |
|
|
|
|
if (GetKey(ESCAPE).bPressed) { |
|
|
|
|
GAME_STATE=GameState::OBJ_SELECT; |
|
|
|
|
} |
|
|
|
@ -2307,6 +2329,17 @@ void SeasonI::keyUpdates() { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case GameState::MAP_SELECT:{ |
|
|
|
|
if (GetKey(ESCAPE).bPressed) { |
|
|
|
|
GAME_STATE=GameState::EDITOR; |
|
|
|
|
} |
|
|
|
|
if ((GetMouseWheel()<0||GetKey(PGDN).bHeld)&&WORLD_DISPLAY_OFFSET+(WIDTH/16)<MAPS.size()) { |
|
|
|
|
WORLD_DISPLAY_OFFSET+=WIDTH/16; |
|
|
|
|
} else |
|
|
|
|
if ((GetMouseWheel()>0||GetKey(PGUP).bHeld)&&WORLD_DISPLAY_OFFSET-(WIDTH/16)>=0) { |
|
|
|
|
WORLD_DISPLAY_OFFSET-=WIDTH/16; |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case GameState::OBJ_SELECT:{ |
|
|
|
|
if (GetKey(ESCAPE).bPressed) { |
|
|
|
|
GAME_STATE=GameState::EDITOR; |
|
|
|
@ -2318,6 +2351,28 @@ void SeasonI::keyUpdates() { |
|
|
|
|
OBJ_DISPLAY_OFFSET-=WIDTH/16; |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case GameState::ENCOUNTER_SELECT:{ |
|
|
|
|
if (GetKey(ESCAPE).bPressed) { |
|
|
|
|
GAME_STATE=GameState::EDITOR; |
|
|
|
|
} |
|
|
|
|
if ((GetMouseWheel()<0||GetKey(PGDN).bHeld)&&ENCOUNTER_OFFSET+(WIDTH/16)<OBJ_INFO.size()) { |
|
|
|
|
ENCOUNTER_OFFSET+=WIDTH/16; |
|
|
|
|
} else |
|
|
|
|
if ((GetMouseWheel()>0||GetKey(PGUP).bHeld)&&ENCOUNTER_OFFSET-(WIDTH/16)>=0) { |
|
|
|
|
ENCOUNTER_OFFSET-=WIDTH/16; |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case GameState::TRIGGER_SELECT:{ |
|
|
|
|
if (GetKey(ESCAPE).bPressed) { |
|
|
|
|
GAME_STATE=GameState::EDITOR; |
|
|
|
|
} |
|
|
|
|
if ((GetMouseWheel()<0||GetKey(PGDN).bHeld)&&TRIGGER_OFFSET+(WIDTH/16)<OBJ_INFO.size()) { |
|
|
|
|
TRIGGER_OFFSET+=WIDTH/16; |
|
|
|
|
} else |
|
|
|
|
if ((GetMouseWheel()>0||GetKey(PGUP).bHeld)&&TRIGGER_OFFSET-(WIDTH/16)>=0) { |
|
|
|
|
TRIGGER_OFFSET-=WIDTH/16; |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case GameState::OVERWORLD_EQUIP_PLAYER_MENU:{ |
|
|
|
|
if (LeftPressed()) { |
|
|
|
|
OVERWORLD_POWER_SELECTION_MEMBER--; |
|
|
|
@ -2860,7 +2915,7 @@ void SeasonI::drawGame(){ |
|
|
|
|
vd2d drawpos={0,0}; |
|
|
|
|
int counter=0; |
|
|
|
|
for (std::map<TriggerName::Trigger,std::string>::const_iterator it = TRIGGERS.cbegin();it!=TRIGGERS.cend();++it){ |
|
|
|
|
if (counter<OBJ_DISPLAY_OFFSET) { |
|
|
|
|
if (counter<TRIGGER_OFFSET) { |
|
|
|
|
counter++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
@ -2890,6 +2945,41 @@ void SeasonI::drawGame(){ |
|
|
|
|
counter++; |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case GameState::MAP_SELECT:{ |
|
|
|
|
vd2d drawpos={0,0}; |
|
|
|
|
int counter=0; |
|
|
|
|
for (std::map<MapName::Map,Map*>::const_iterator it = MAPS.cbegin();it!=MAPS.cend();++it){ |
|
|
|
|
if (counter<WORLD_DISPLAY_OFFSET) { |
|
|
|
|
counter++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (drawpos.y>HEIGHT) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
Map*map = it->second; |
|
|
|
|
if (GetMouse(0).bHeld&& |
|
|
|
|
GetMousePos().x>=drawpos.x&& |
|
|
|
|
GetMousePos().x<drawpos.x+16&& |
|
|
|
|
GetMousePos().y>=drawpos.y&& |
|
|
|
|
GetMousePos().y<drawpos.y+24) { |
|
|
|
|
CURRENT_MAP=map; |
|
|
|
|
LoadMap(CURRENT_MAP); |
|
|
|
|
EDITING_LAYER=layer::COLLISION; |
|
|
|
|
EnableLayer(layer::COLLISION,false); |
|
|
|
|
} |
|
|
|
|
FillRectDecal(drawpos,{16,24},VERY_DARK_GREY); |
|
|
|
|
DrawStringDecal({(float)(drawpos.x+2),(float)(drawpos.y)},it->second->mapname,WHITE,{(float)(12.0/GetTextSize(it->second->mapname).x),1.0}); |
|
|
|
|
if (CURRENT_MAP==it->second) { |
|
|
|
|
DrawRectDecal(drawpos,{16,24},YELLOW); |
|
|
|
|
} |
|
|
|
|
drawpos.x+=16; |
|
|
|
|
if (drawpos.x>=WIDTH) { |
|
|
|
|
drawpos.x=0; |
|
|
|
|
drawpos.y+=24; |
|
|
|
|
} |
|
|
|
|
counter++; |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
if (BATTLE_ENCOUNTER!=nullptr&&BATTLE_STATE==BattleState::TARGET_SELECT||GAME_STATE==GameState::OVERWORLD_TARGET_MENU) { |
|
|
|
|
SetDrawTarget(layer::GROUND); |
|
|
|
|