Skip to content

Commit

Permalink
Merge branch 'endless-sky:master' into experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
Zitchas authored May 12, 2024
2 parents 6a595bc + bc058c0 commit bd661f3
Show file tree
Hide file tree
Showing 22 changed files with 193 additions and 61 deletions.
2 changes: 2 additions & 0 deletions data/_ui/interfaces.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ color "escort split fuel" .35 .31 .215 0.

color "flagship highlight" .5 .8 .2 0.

color "cloak highlight" .45 0. 0. .65

color "drag select" .2 1. 0. 0.

# Colors used for drawing mission or job pointers on the map,
Expand Down
3 changes: 3 additions & 0 deletions data/_ui/tooltips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,9 @@ tip "Ship outlines in shops"
tip "Ship outlines in HUD"
`Controls the display of your flagship and target ship icons in the HUD. When fancy, applies a sobel filter to the sprites. (This can result in high GPU load for some ships on very old or low performance computers.) When fast, just uses the ship's sprite.`

tip "Cloaked ship outlines"
`Controls the display of cloaked escorts. When fancy, causes the ship to become transparent and applies a red outline. When fast, simply shifts the ship to being red.`

tip "Show status overlays"
`Display status overlays over top of all ships when in flight. Status overlays display a ship's shields and hull. If the damaged option is chosen, overlays only appear on ships that have taken damage.`

Expand Down
6 changes: 6 additions & 0 deletions data/human/deep missions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,9 @@ mission "Deep: Interrogation"
attributes "spaceport"
to offer
has "Deep Archaeology 5: done"
or
not "chosen sides"
has "main plot completed"

on offer
log `Was interrogated by the Deep for helping Albert Foster. The Deep now knows that Albert Foster thinks that there is an artificial singularity on Midgard.`
Expand Down Expand Up @@ -1711,6 +1714,9 @@ mission "Deep: Remnant: Continue Research"
to offer
has "event: deep: remnant: rest period"
has "deep: did reveal remnant"
# If the player received subsequent missions prior to the addition of this one in v0.9.15, do not offer this one.
not "Deep: Remnant: Engines: offered"

on offer
conversation
`You receive a message from Ivan, the Deep scientist who you helped to discover the Remnant in the Ember Waste. "Captain <last>, it's been so long. The Deep has finally finished reviewing our research in the Ember Waste, and we've been approved for further funding! Please meet us on <destination> if you wish to assist us again. Your help would be appreciated, but we will make progress even if you're unable to help."`
Expand Down
8 changes: 8 additions & 0 deletions data/human/fleets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,8 @@ fleet "Small Core Pirates"
"Headhunter"
variant 1
"Headhunter (Particle)"
variant 1
"Headhunter (Tractor Beam)"
variant 1
"Quicksilver" 2
variant 1
Expand Down Expand Up @@ -2335,12 +2337,16 @@ fleet "Large Core Pirates"
"Splinter (Laser)" 2
variant 1
"Splinter (Proton)" 2
variant 1
"Splinter (Tractor Beam)"
variant 2
"Falcon"
variant 1
"Falcon (Heavy)"
variant 1
"Falcon (Laser)"
variant 1
"Falcon (Tractor Beam)"
variant 2
"Firebird"
variant 2
Expand All @@ -2359,6 +2365,8 @@ fleet "Large Core Pirates"
"Protector (Laser)"
variant 1
"Protector (Proton)"
variant 1
"Protector (Tractor Beam)"
variant 1
"Protector"

Expand Down
86 changes: 86 additions & 0 deletions data/human/variants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,28 @@ ship "Falcon" "Falcon (Laser Chaser)"
"Heavy Laser" 4
"Armageddon Core"

ship "Falcon" "Falcon (Tractor Beam)"
outfits
"Proton Gun" 4
"Quad Blaster Turret" 2
"Heavy Anti-Missile Turret"
"Tractor Beam"
"Breeder Reactor"
"LP144a Battery Pack"
"D67-TM Shield Generator"
"Cargo Expansion"
"Laser Rifle" 21
"Impala Plasma Thruster"
"Orca Plasma Steering"
"Hyperdrive"
gun "Proton Gun"
gun "Proton Gun"
gun "Proton Gun"
gun "Proton Gun"
turret "Heavy Anti-Missile Turret"
turret "Tractor Beam"
turret "Quad Blaster Turret"
turret "Quad Blaster Turret"

ship "Falcon" "Falcon (Javelin)"
outfits
Expand Down Expand Up @@ -2352,6 +2374,22 @@ ship "Headhunter" "Headhunter (Strike)"
"Hyperdrive"


ship "Headhunter" "Headhunter (Tractor Beam)"
outfits
"Twin Modified Blaster" 2
"Meteor Missile Pod" 2
"Meteor Missile" 29
"Meteor Missile Box"
"Tractor Beam"
"RT-I Radiothermal"
"LP072a Battery Pack"
"D23-QP Shield Generator"
"Cargo Expansion"
"Greyhound Plasma Thruster"
"Greyhound Plasma Steering"
"Hyperdrive"



ship "Heavy Shuttle" "Heavy Shuttle (Armed)"
outfits
Expand Down Expand Up @@ -3092,6 +3130,33 @@ ship "Protector" "Protector (Quad Blaster)"
"Hyperdrive"


ship "Protector" "Protector (Tractor Beam)"
outfits
"Torpedo Launcher"
"Torpedo" 30
"Quad Blaster Turret" 4
"Anti-Missile Turret" 2
"Tractor Beam" 2
"Fusion Reactor"
"D94-YV Shield Generator"
"D67-TM Shield Generator"
"Water Coolant System"
"Large Radar Jammer"
"Cargo Expansion" 2
"Laser Rifle" 21
"Impala Plasma Thruster"
"Greyhound Plasma Steering"
"Hyperdrive"
turret "Tractor Beam"
turret "Quad Blaster Turret"
turret "Anti-Missile Turret"
turret "Quad Blaster Turret"
turret "Quad Blaster Turret"
turret "Anti-Missile Turret"
turret "Quad Blaster Turret"
turret "Tractor Beam"



ship "Quicksilver" "Quicksilver (Mark II)"
outfits
Expand Down Expand Up @@ -3415,6 +3480,27 @@ ship "Splinter" "Splinter (Proton)"
turret "Proton Turret"
turret "Anti-Missile Turret"
turret "Proton Turret"


ship "Splinter" "Splinter (Tractor Beam)"
outfits
outfits
"Twin Modified Blaster" 2
"Proton Turret" 2
"Tractor Beam"
"Water Coolant System"
"Fission Reactor"
"LP036a Battery Pack"
"D94-YV Shield Generator"
"Small Radar Jammer"
"Cargo Expansion"
"Laser Rifle" 3
"X3700 Ion Thruster"
"Impala Plasma Steering"
"Hyperdrive"
turret "Proton Turret"
turret "Tractor Beam"
turret "Proton Turret"


# Used in the Hai Reveal campaign by a special Syndicated Security team. Should not be used before.
Expand Down
2 changes: 1 addition & 1 deletion source/AI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3878,7 +3878,7 @@ void AI::MovePlayer(Ship &ship, Command &activeCommands)
for(const Mission &mission : player.Missions())
{
// Don't include invisible and failed missions in the check.
if(!mission.IsVisible() || mission.HasFailed(player))
if(!mission.IsVisible() || mission.IsFailed(player))
continue;

// If the accessible destination of a mission is in this system, and you've been
Expand Down
6 changes: 3 additions & 3 deletions source/CargoHold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ int64_t CargoHold::Value(const System *system) const
// be charged for any illegal outfits plus the sum of the fines for all
// missions. If the returned value is negative, you are carrying something so
// bad that it warrants a death sentence.
int CargoHold::IllegalCargoFine(const Government *government) const
int CargoHold::IllegalCargoFine(const Government *government, const PlayerInfo &player) const
{
int totalFine = 0;
// Carrying an illegal outfit is only half as bad as having it equipped.
Expand Down Expand Up @@ -613,7 +613,7 @@ int CargoHold::IllegalCargoFine(const Government *government) const
int fine = it.first->IllegalCargoFine();
if(fine < 0)
return fine;
if(!it.first->IsFailed())
if(!it.first->IsFailed(player))
totalFine += fine;
}

Expand All @@ -622,7 +622,7 @@ int CargoHold::IllegalCargoFine(const Government *government) const
int fine = it.first->IllegalCargoFine();
if(fine < 0)
return fine;
if(!it.first->IsFailed())
if(!it.first->IsFailed(player))
totalFine += fine;
}

Expand Down
3 changes: 2 additions & 1 deletion source/CargoHold.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class DataWriter;
class Government;
class Mission;
class Outfit;
class PlayerInfo;
class System;


Expand Down Expand Up @@ -109,7 +110,7 @@ class CargoHold {
// be charged for any illegal outfits plus the sum of the fines for all
// missions. If the returned value is negative, you are carrying something so
// bad that it warrants a death sentence.
int IllegalCargoFine(const Government *government) const;
int IllegalCargoFine(const Government *government, const PlayerInfo &player) const;

// Returns the amount tons of illegal cargo.
int IllegalCargoAmount() const;
Expand Down
4 changes: 2 additions & 2 deletions source/DrawList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ bool DrawList::AddUnblurred(const Body &body)



bool DrawList::AddSwizzled(const Body &body, int swizzle)
bool DrawList::AddSwizzled(const Body &body, int swizzle, double cloak)
{
Point position = body.Position() - center;
Point blur = body.Velocity() - centerVelocity;
if(Cull(body, position, blur))
return false;

Push(body, position, blur, 0., swizzle);
Push(body, position, blur, cloak, swizzle);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion source/DrawList.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DrawList {
// Add an object that should not be drawn with motion blur.
bool AddUnblurred(const Body &body);
// Add an object using a specific swizzle (rather than its own).
bool AddSwizzled(const Body &body, int swizzle);
bool AddSwizzled(const Body &body, int swizzle, double cloak = 0.);

// Draw all the items in this list.
void Draw() const;
Expand Down
59 changes: 35 additions & 24 deletions source/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,15 +602,24 @@ void Engine::Step(bool isActive)
}
}

// Draw a highlight to distinguish the flagship from other ships.
outlines.clear();
const Color &cloakColor = *GameData::Colors().Get("cloak highlight");
if(Preferences::Has("Cloaked ship outlines"))
for(const auto &ship : player.Ships())
{
if(ship->IsParked() || ship->GetSystem() != player.GetSystem() || ship->Cloaking() == 0.)
continue;

outlines.emplace_back(ship->GetSprite(), (ship->Position() - center) * zoom, ship->Unit() * zoom,
ship->GetFrame(), Color::Multiply(ship->Cloaking(), cloakColor));
}

// Add the flagship outline last to distinguish the flagship from other ships.
if(flagship && !flagship->IsDestroyed() && Preferences::Has("Highlight player's flagship"))
{
highlightSprite = flagship->GetSprite();
highlightUnit = flagship->Unit() * zoom;
highlightFrame = flagship->GetFrame();
outlines.emplace_back(flagship->GetSprite(), (flagship->Position() - center) * zoom, flagship->Unit() * zoom,
flagship->GetFrame(), *GameData::Colors().Get("flagship highlight"));
}
else
highlightSprite = nullptr;

// Any of the player's ships that are in system are assumed to have
// landed along with the player.
Expand Down Expand Up @@ -1206,13 +1215,10 @@ void Engine::Draw() const
for(const AlertLabel &label : missileLabels)
label.Draw();

// Draw the flagship highlight, if any.
if(highlightSprite)
for(const auto &outline : outlines)
{
Point size(highlightSprite->Width(), highlightSprite->Height());
const Color &color = *colors.Get("flagship highlight");
// The flagship is always in the dead center of the screen.
OutlineShader::Draw(highlightSprite, Point(), size, color, highlightUnit, highlightFrame);
Point size(outline.sprite->Width(), outline.sprite->Height());
OutlineShader::Draw(outline.sprite, outline.position, size, outline.color, outline.unit, outline.frame);
}
// Draw flagship velocity indicator
const shared_ptr<Ship> flagship = player.FlagshipPtr();
Expand Down Expand Up @@ -2664,13 +2670,14 @@ void Engine::DrawShipSprites(const Ship &ship)
bool hasFighters = ship.PositionFighters();
double cloak = ship.Cloaking();
bool drawCloaked = (cloak && ship.IsYours());
bool fancyCloak = Preferences::Has("Cloaked ship outlines");
auto &itemsToDraw = draw[currentCalcBuffer];
auto drawObject = [&itemsToDraw, cloak, drawCloaked](const Body &body) -> void
auto drawObject = [&itemsToDraw, cloak, drawCloaked, fancyCloak](const Body &body) -> void
{
// Draw cloaked/cloaking sprites swizzled red, and overlay this solid
// sprite with an increasingly transparent "regular" sprite.
// Draw cloaked/cloaking sprites swizzled red or transparent (depending on whether we are using fancy
// cloaking effects), and overlay this solid sprite with an increasingly transparent "regular" sprite.
if(drawCloaked)
itemsToDraw.AddSwizzled(body, 27);
itemsToDraw.AddSwizzled(body, fancyCloak ? 9 : 27, fancyCloak ? 0.5 : 0.25);
itemsToDraw.Add(body, cloak);
};

Expand Down Expand Up @@ -2843,27 +2850,27 @@ void Engine::CreateStatusOverlays()

for(const auto &it : ships)
{
if(!it->GetGovernment() || it->GetSystem() != currentSystem ||
it->IsCloaked())
if(!it->GetGovernment() || it->GetSystem() != currentSystem || (!it->IsYours() && it->Cloaking() == 1.))
continue;
// Don't show status for dead ships.
if(it->IsDestroyed())
continue;

if(it == flagship)
EmplaceStatusOverlay(it, overlaySettings[Preferences::OverlayType::FLAGSHIP], 0);
EmplaceStatusOverlay(it, overlaySettings[Preferences::OverlayType::FLAGSHIP], 0, it->Cloaking());
else if(it->GetGovernment()->IsEnemy())
EmplaceStatusOverlay(it, overlaySettings[Preferences::OverlayType::ENEMY], 2);
EmplaceStatusOverlay(it, overlaySettings[Preferences::OverlayType::ENEMY], 2, it->Cloaking());
else if(it->IsYours() || it->GetPersonality().IsEscort())
EmplaceStatusOverlay(it, overlaySettings[Preferences::OverlayType::ESCORT], 1);
EmplaceStatusOverlay(it, overlaySettings[Preferences::OverlayType::ESCORT], 1, it->Cloaking());
else
EmplaceStatusOverlay(it, overlaySettings[Preferences::OverlayType::NEUTRAL], 3);
EmplaceStatusOverlay(it, overlaySettings[Preferences::OverlayType::NEUTRAL], 3, it->Cloaking());
}
}



void Engine::EmplaceStatusOverlay(const shared_ptr<Ship> &it, Preferences::OverlayState overlaySetting, int type)
void Engine::EmplaceStatusOverlay(const shared_ptr<Ship> &it, Preferences::OverlayState overlaySetting,
int type, double cloak)
{
if(overlaySetting == Preferences::OverlayState::OFF)
return;
Expand All @@ -2886,6 +2893,10 @@ void Engine::EmplaceStatusOverlay(const shared_ptr<Ship> &it, Preferences::Overl
else
alpha = 0.f;
}

if(it->IsYours())
cloak *= 0.6;

statuses.emplace_back(it->Position() - center, it->Shields(), it->Hull(),
min(it->Hull(), it->DisabledHull()), max(20., width * .5), type, alpha);
min(it->Hull(), it->DisabledHull()), max(20., width * .5), type, alpha * (1. - cloak));
}
Loading

0 comments on commit bd661f3

Please sign in to comment.