void GameplayFrame::DrawGame(Core::Graphics& graphics) { PROFILE("Total Draw"); myBackground.DrawBackdrop(graphics); graphics.SetColor( RGB( 255, 255, 255)); char buf[50]; sprintf_s(buf, "%f", debugTime); graphics.DrawString(35,980, buf); graphics.DrawString(5, 980, "FPS:"); healthBar.DrawHealth(graphics); fuelGauge.DrawPlayerFuel(graphics); graphics.SetColor(RGB(51,51,51)); boundaries.Draw(graphics); { PROFILE("Draw Planets"); creator.DrawPlanets(graphics); } graphics.SetColor( RGB( 255, 255, 255)); { PROFILE("Draw Enemies"); tester.drawShips(graphics); } { PROFILE("Draw Particles"); myParticles.drawEffect(graphics); } myText.drawText(graphics); graphics.SetColor(RGB(255,255,255)); Vector2D fuel(fuelStation[1].x+(fuelStation[3].x-fuelStation[1].x)/4.5f, (fuelStation[0].y + ((fuelStation[2].y-fuelStation[0].y)/2.5f))); gameText.drawText(graphics, 4.0f, RGB(255,255,255), "Fueling", 20.0f, 5.0f, 0, fuel); gameText.drawText(graphics, 4.0f, RGB(255,255,255), "Station", 20.0f, 5.0f, 0, Vector2D(fuel.x, fuel.y + 35.0f)); myCash.DrawCash(graphics, 5.0f); healthDrop.DrawHealthPickup(graphics); graphics.SetColor( RGB(255, 255, 255)); graphics.DrawString(30, 100, "PRESS I TO OPEN/CLOSE THE LIST OF INSTRUCTIONS."); DebugFrameMemory(graphics); graphics.SetColor( RGB( 255, 100, 0)); { ranger.Draw(graphics); } //rapidFirePowerup.drawPowerup(graphics); if(alreadyKilled) { char buf[50]; sprintf_s(buf, "You survived for %i seconds!", (int)totalTime); Core::RGB textColor = RGB(255, 149, 0); gameText.drawText(graphics, 5.0f, textColor, "GAME OVER...", 30.0f, 5.0f, 0, Vector2D(250.0f, 250.0f)); gameText.drawText(graphics, 5.0f, textColor, buf, 30.0f, 5.0f, 0, Vector2D(680.0f, 250.0f)); graphics.SetColor(RGB(255,100,0)); graphics.DrawString(700, 500, "Game over, you have died and as thus you are"); graphics.DrawString(700, 520, "reading this screen. If you wish to try again"); graphics.DrawString(700, 540, "simply press the space bar to reset the game. Yep..."); graphics.DrawString(700, 560, "why are you still reading this?? I mean I"); graphics.DrawString(700, 580, "don't care but you are kind of wasting your"); graphics.DrawString(700, 600, "time at this point."); if(Core::Input::IsPressed(32)) { resetFrame(); } } if(paused && upgradesPause) { armorUpgrade.DrawUpgrade(graphics, mouse, 3.0f); healthDropUpgrade.DrawUpgrade(graphics, mouse, 3.0f); bulletsUpgrade.DrawUpgrade(graphics, mouse, 3.0f); fuelUpgrade.DrawUpgrade(graphics, mouse, 3.0f); } else if(paused && instructionsPause) { graphics.DrawString(825, 430, " (Press I to close/open the list of instructions.)"); graphics.DrawString(800, 450, " Instructions: use up, down, W or S to move the ship. A and D"); graphics.DrawString(800, 470, "or left and right to rotate the spaceship. Use the left mouse"); graphics.DrawString(800, 490, "to fire your turret. Keep in mind that only ten bullets can"); graphics.DrawString(800, 510, "be on the screen at once and that the sun in the background"); graphics.DrawString(800, 530, "is simply for ambiance."); graphics.DrawString(800, 570, " Upgrades: Use the cash that you have earned to purchase"); graphics.DrawString(800, 590, "the upgrades. To open the upgrade menu press R. You can"); graphics.DrawString(800, 610, "view individual upgrade information by hovering over the tiles."); graphics.DrawString(800, 650, "Fueling: Your fuel will slowly decrease as time goes on...because"); graphics.DrawString(800, 670, "you know.....space....well anyway drive over the aptly named"); graphics.DrawString(800, 690, "'FUELING STATION' to fuel your ship. You can't, however, fire"); graphics.DrawString(800, 710, "your turret while you are fueling, because that is illegal."); graphics.DrawString(800, 750, "Damage: When an enemy ship collides with you, you'll take"); graphics.DrawString(800, 770, "some damage. If you have the armor upgrades then your armor"); graphics.DrawString(800, 790, "will absorb the first chuncks of damage. Each ship has a"); graphics.DrawString(800, 810, "one second spawn delay from being able to damage your ship"); graphics.DrawString(800, 830, "as well as a three second delay from the game starting to"); graphics.DrawString(800, 850, "being able to damage your spacecraft."); } }
void inventory::form_from_map( map &m, const tripoint &origin, int range, bool assign_invlet, bool clear_path ) { items.clear(); for( const tripoint &p : m.points_in_radius( origin, range ) ) { // can not reach this -> can not access its contents if( clear_path ) { if( origin != p && !m.clear_path( origin, p, range, 1, 100 ) ) { continue; } } if( m.has_furn( p ) ) { const furn_t &f = m.furn( p ).obj(); const itype *type = f.crafting_pseudo_item_type(); if( type != nullptr ) { const itype *ammo = f.crafting_ammo_item_type(); item furn_item( type, calendar::turn, 0 ); furn_item.item_tags.insert( "PSEUDO" ); furn_item.charges = ammo ? count_charges_in_list( ammo, m.i_at( p ) ) : 0; add_item( furn_item ); } } if( m.accessible_items( p ) ) { for( auto &i : m.i_at( p ) ) { if( !i.made_of( LIQUID ) ) { add_item( i, false, assign_invlet ); } } } // Kludges for now! if( m.has_nearby_fire( p, 0 ) ) { item fire( "fire", 0 ); fire.charges = 1; add_item( fire ); } // Handle any water from infinite map sources. item water = m.water_from( p ); if( !water.is_null() ) { add_item( water ); } // kludge that can probably be done better to check specifically for toilet water to use in // crafting if( m.furn( p ).obj().examine == &iexamine::toilet ) { // get water charges at location auto toilet = m.i_at( p ); auto water = toilet.end(); for( auto candidate = toilet.begin(); candidate != toilet.end(); ++candidate ) { if( candidate->typeId() == "water" ) { water = candidate; break; } } if( water != toilet.end() && water->charges > 0 ) { add_item( *water ); } } // keg-kludge if( m.furn( p ).obj().examine == &iexamine::keg ) { auto liq_contained = m.i_at( p ); for( auto &i : liq_contained ) { if( i.made_of( LIQUID ) ) { add_item( i ); } } } // WARNING: The part below has a bug that's currently quite minor // When a vehicle has multiple faucets in range, available water is // multiplied by the number of faucets. // Same thing happens for all other tools and resources, but not cargo const optional_vpart_position vp = m.veh_at( p ); if( !vp ) { continue; } vehicle *const veh = &vp->vehicle(); //Adds faucet to kitchen stuff; may be horribly wrong to do such.... //ShouldBreak into own variable const cata::optional<vpart_reference> kpart = vp.part_with_feature( "KITCHEN", true ); const cata::optional<vpart_reference> faupart = vp.part_with_feature( "FAUCET", true ); const cata::optional<vpart_reference> weldpart = vp.part_with_feature( "WELDRIG", true ); const cata::optional<vpart_reference> craftpart = vp.part_with_feature( "CRAFTRIG", true ); const cata::optional<vpart_reference> forgepart = vp.part_with_feature( "FORGE", true ); const cata::optional<vpart_reference> kilnpart = vp.part_with_feature( "KILN", true ); const cata::optional<vpart_reference> chempart = vp.part_with_feature( "CHEMLAB", true ); const cata::optional<vpart_reference> cargo = vp.part_with_feature( "CARGO", true ); if( cargo ) { const auto items = veh->get_items( cargo->part_index() ); *this += std::list<item>( items.begin(), items.end() ); } if( faupart ) { for( const auto &it : veh->fuels_left() ) { item fuel( it.first, 0 ); if( fuel.made_of( LIQUID ) ) { fuel.charges = it.second; add_item( fuel ); } } } if( kpart ) { item hotplate( "hotplate", 0 ); hotplate.charges = veh->fuel_left( "battery", true ); hotplate.item_tags.insert( "PSEUDO" ); add_item( hotplate ); item pot( "pot", 0 ); pot.item_tags.insert( "PSEUDO" ); add_item( pot ); item pan( "pan", 0 ); pan.item_tags.insert( "PSEUDO" ); add_item( pan ); } if( weldpart ) { item welder( "welder", 0 ); welder.charges = veh->fuel_left( "battery", true ); welder.item_tags.insert( "PSEUDO" ); add_item( welder ); item soldering_iron( "soldering_iron", 0 ); soldering_iron.charges = veh->fuel_left( "battery", true ); soldering_iron.item_tags.insert( "PSEUDO" ); add_item( soldering_iron ); } if( craftpart ) { item vac_sealer( "vac_sealer", 0 ); vac_sealer.charges = veh->fuel_left( "battery", true ); vac_sealer.item_tags.insert( "PSEUDO" ); add_item( vac_sealer ); item dehydrator( "dehydrator", 0 ); dehydrator.charges = veh->fuel_left( "battery", true ); dehydrator.item_tags.insert( "PSEUDO" ); add_item( dehydrator ); item food_processor( "food_processor", 0 ); food_processor.charges = veh->fuel_left( "battery", true ); food_processor.item_tags.insert( "PSEUDO" ); add_item( food_processor ); item press( "press", 0 ); press.charges = veh->fuel_left( "battery", true ); press.item_tags.insert( "PSEUDO" ); add_item( press ); } if( forgepart ) { item forge( "forge", 0 ); forge.charges = veh->fuel_left( "battery", true ); forge.item_tags.insert( "PSEUDO" ); add_item( forge ); } if( kilnpart ) { item kiln( "kiln", 0 ); kiln.charges = veh->fuel_left( "battery", true ); kiln.item_tags.insert( "PSEUDO" ); add_item( kiln ); } if( chempart ) { item hotplate( "hotplate", 0 ); hotplate.charges = veh->fuel_left( "battery", true ); hotplate.item_tags.insert( "PSEUDO" ); add_item( hotplate ); item chemistry_set( "chemistry_set", 0 ); chemistry_set.charges = veh->fuel_left( "battery", true ); chemistry_set.item_tags.insert( "PSEUDO" ); add_item( chemistry_set ); } } }