void Map::Save(TCODZip &zip) { zip.putInt(seed_); for (int32_t i = 0; i < width_ * height_; i++) { zip.putInt(tiles_[i].explored_); } }
void Aura::save(TCODZip &zip) { zip.putInt(stat); zip.putInt(totalDuration); zip.putInt(duration); zip.putInt(bonus); zip.putInt(life); }
void Healer::save(TCODZip &zip) { zip.putInt(type); zip.putFloat(amount); zip.putInt(stacks); zip.putInt(stackSize); zip.putInt(value); }
void Engine::Save() { if(player->destructible->IsDead()) { TCODSystem::deleteFile("game.sav"); } else { TCODZip zip; zip.putInt(SAVEGAME_VERSION); zip.putInt(map->width); zip.putInt(map->height); map->Save(zip); player->Save(zip); zip.putInt(allActors.size() - 2); for(Actor** it = allActors.begin(); it != allActors.end(); ++it) { if(*it != player) { (*it)->Save(zip); } } gui->Save(zip); zip.saveToFile("game.sav"); } }
void Engine::save() { if (player->destructible->isDead()) { TCODSystem::deleteFile("game.sav"); } else { TCODZip zip; //save the map first zip.putInt(map->width); zip.putInt(map->height); map->save(zip); //then the player player->save(zip); //then the stairs stairs->save(zip); //then all the other actors zip.putInt(map->actors.size()-2); for (Actor **i=map->actors.begin(); i!=map->actors.end(); i++) { if (*i!=player && *i!=stairs) { (*i)->save(zip); } } // finally the message log topGui->save(zip); zip.saveToFile("game.sav"); } }
void ConfusedMonsterAi::save(TCODZip &zip) { zip.putInt(CONFUSED_MONSTER); zip.putInt(nbTurns); oldAi->save(zip); zip.putColor(&oldColor); }
void Container::Save(TCODZip &zip) { zip.putInt(size_); zip.putInt(inventory.size()); for (Actor **it = inventory.begin(); it != inventory.end(); it++) { (*it)->Save(zip); } }
void Destructible::save(TCODZip &zip) { zip.putFloat(maxHp); zip.putFloat(hp); zip.putFloat(defense); zip.putString(corpseName); zip.putInt(maxAp); zip.putInt(ap); }
void Poison::save(TCODZip &zip) { zip.putInt(type); zip.putFloat(tick); zip.putInt(duration); zip.putInt(stacks); zip.putInt(stackSize); zip.putInt(value); }
void Confuser::save(TCODZip &zip) { zip.putInt(type); zip.putInt(nbTurns); zip.putFloat(range); zip.putInt(stacks); zip.putInt(stackSize); zip.putInt(value); }
void LightningBolt::save(TCODZip &zip) { zip.putInt(type); zip.putFloat(range); zip.putFloat(damage); zip.putInt(stacks); zip.putInt(stackSize); zip.putInt(value); }
void Map::Save(TCODZip& zip) { zip.putInt(seed); for(int i = 0; i < width * height; ++i) { zip.putInt(tiles[i].explored); } }
void Pickable::save(TCODZip &zip){ zip.putInt(selector != NULL); zip.putInt(effect != NULL); if(selector) selector->save(zip); if(effect) effect->save(zip); }
void Fireball::save(TCODZip &zip) { zip.putInt(type); zip.putFloat(range); zip.putFloat(aoe); zip.putFloat(damage); zip.putInt(stacks); zip.putInt(stackSize); zip.putInt(value); }
void clBuilding::Save(TCODZip &file) { file.putChar(CL_BUILDING); file.putInt(mytile->GetSave()->num); file.putInt(t->GetBuildingID()); file.putInt(mypic); file.putInt(data); file.putInt(mat->ID); }
void Map::save(TCODZip &zip, NodeType type){ zip.putInt(seed); for(int i = 0; i < width * height; i++){ zip.putInt(tiles[i].explored); //zip.putInt(tiles[i].walkable); //zip.putInt(tiles[i].inFOV); } zip.putInt(actors.size()); for(Actor **it = actors.begin(); it != actors.end(); it++){ (*it)->save(zip); } zip.putInt(nextLevel != NULL); zip.putInt(prevLevel != NULL); if(nextLevel && (type == ROOT || type == BELOW_ROOT)){ zip.putInt(nextLevel->width); zip.putInt(nextLevel->height); nextLevel->save(zip, BELOW_ROOT); } if(prevLevel && (type == ROOT || type == ABOVE_ROOT)){ zip.putInt(prevLevel->width); zip.putInt(prevLevel->height); prevLevel->save(zip, ABOVE_ROOT); } }
void Actor::Save(TCODZip& zip) { zip.putInt(x); zip.putInt(y); zip.putInt(code); zip.putColor(&color); zip.putString(name); zip.putInt(blocks); zip.putInt(fovOnly); zip.putInt(destructible != nullptr); zip.putInt(ai != nullptr); zip.putInt(pickable != nullptr); zip.putInt(container != nullptr); if(destructible) { destructible->Save(zip); } if(ai) { ai->Save(zip); } if(pickable) { pickable->Save(zip); } if(container) { container->Save(zip); } }
void Gui::save(TCODZip &zip) { zip.putInt(log.size()); for (Message **it = log.begin(); it != log.end(); it++) { zip.putString((*it)->text); zip.putColor(&(*it)->col); } }
void Destructible::save(TCODZip &zip) { zip.putFloat(maxHp); zip.putFloat(hp); zip.putFloat(baseDefense); zip.putFloat(totalDefense); zip.putString(corpseName); zip.putInt(xp); }
void DamagingAura::save(TCODZip &zip){ zip.putInt(stat); zip.putInt(totalDuration); zip.putInt(duration); zip.putInt(bonus); zip.putInt(life); zip.putInt(radius); zip.putInt(smart); }
void Equipment::save(TCODZip &zip) { zip.putInt(type); zip.putInt(equipped); zip.putInt(slot); zip.putInt(stacks); zip.putInt(stackSize); zip.putInt(value); zip.putInt(bonus.size()); for (int i = 0; i < bonus.size(); i++) { bonus.get(i)->save(zip); } requirement->save(zip); }
void Engine::save() { if (player->destructible->isDead() ){ TCODSystem::deleteFile("game.sav"); }else { TCODZip zip; //save the map zip.putInt(map->width); zip.putInt(map->height); map->save(zip); //then the player player->save(zip); //All the other actors zip.putInt(actors.size()-1); for (Actor **iterator=actors.begin(); iterator!=actors.end(); iterator++){ if(*iterator != player){ (*iterator)->save(zip); } } //Save the logs gui->save(zip); zip.saveToFile("game.sav"); } }
void Engine::Save(void) { if (player_->destructible_->IsDead()) { TCODSystem::deleteFile("game.sav"); } else { TCODZip zip; // save the map zip.putInt(map_->width_); zip.putInt(map_->height_); map_->Save(zip); // save the player player_->Save(zip); // then all the other actors zip.putInt(actors_.size()-1); for (Actor **it = actors_.begin(); it != actors_.end(); it++) { if (*it != player_) { (*it)->Save(zip); } } // finally the message log gui_->Save(zip); zip.saveToFile("game.sav"); } }
void Actor::Save(TCODZip &zip) { zip.putInt(x_); zip.putInt(y_); zip.putInt(ch_); zip.putColor(&col_); zip.putString(name_); zip.putInt(blocks_); zip.putInt(attacker_ != NULL); zip.putInt(destructible_ != NULL); zip.putInt(ai_ != NULL); zip.putInt(pickable_ != NULL); zip.putInt(container_ != NULL); if (attacker_ != NULL) attacker_->Save(zip); if (destructible_ != NULL) destructible_->Save(zip); if (ai_ != NULL) ai_->Save(zip); if (pickable_ != NULL) pickable_->Save(zip); if (container_ != NULL) container_->Save(zip); }
void Actor::save(TCODZip &zip) { zip.putInt(x); zip.putInt(y); zip.putInt(ch); zip.putColor(&col); zip.putString(name); zip.putInt(blocks); zip.putInt(attacker != NULL); zip.putInt(destructible != NULL); zip.putInt(ai != NULL); zip.putInt(pickable != NULL); zip.putInt(container != NULL); if (attacker) attacker->save(zip); if (destructible) destructible->save(zip); if (ai) ai->save(zip); if (pickable) pickable->save(zip); if (container) container->save(zip); }
void LightningBolt::save(TCODZip &zip) { zip.putInt(LIGHTNING_BOLT); zip.putFloat(range); zip.putFloat(damage); }
void PlayerAi::save(TCODZip &zip) { zip.putInt(PLAYER); }
void MonsterDestructible::save(TCODZip &zip) { zip.putInt(MONSTER); Destructible::save(zip); }
void PlayerDestructible::save(TCODZip &zip) { zip.putInt(PLAYER); Destructible::save(zip); }
void MonsterAi::save(TCODZip &zip) { zip.putInt(MONSTER); zip.putInt(moveCount); }