void Game_Vehicle::Update() { Game_Character::Update(); Game_Character::UpdateSprite(); SyncWithPlayer(); if (type == Airship) { if (IsAscending()) { data.remaining_ascent -= 8; if (!IsAscending()) walk_animation = true; } else if (IsDescending()) { data.remaining_descent -= 8; if (!IsDescending()) { if (CanLand()) { SetLayer(RPG::EventPage::Layers_same); driving = false; data.flying = false; walk_animation = false; pattern = 1; } else { // Can't land here, ascend again data.remaining_ascent = SCREEN_TILE_WIDTH; } } } } }
void Game_Vehicle::Update(bool process_movement) { if (!process_movement) { return; } if (IsAboard()) { SyncWithPlayer(); } else { Game_Character::UpdateMovement(); } if (type == Airship) { if (IsStopping()) { if (IsAscending()) { data()->remaining_ascent = data()->remaining_ascent - 8; } else if (IsDescending()) { data()->remaining_descent = data()->remaining_descent - 8; if (!IsDescending()) { if (CanLand()) { Main_Data::game_player->UnboardingFinished(); SetFlying(false); Main_Data::game_player->SetFlying(false); } else { // Can't land here, ascend again data()->remaining_ascent = SCREEN_TILE_SIZE; } } } } } if (type == Airship) { UpdateAnimationAirship(); } else { UpdateAnimationShip(); } }
void Game_Vehicle::Refresh() { if (driving) { map_id = Game_Map::GetMapId(); SyncWithPlayer(); } else if (map_id == Game_Map::GetMapId()) MoveTo(x, y); switch (type) { case Boat: priority_type = RPG::EventPage::Layers_same; move_speed = RPG::EventPage::MoveSpeed_normal; break; case Ship: priority_type = RPG::EventPage::Layers_same; move_speed = RPG::EventPage::MoveSpeed_double; break; case Airship: priority_type = driving ? RPG::EventPage::Layers_above : RPG::EventPage::Layers_below; move_speed = RPG::EventPage::MoveSpeed_fourfold; break; } walk_anime = driving; step_anime = driving; }