Repository navigation
feat: mods and missions choose which ships the player can land on - #1341
Merged
Merged
Conversation
Since #1192, the player's ship could land on any carrier that ships launch from, apart from the Badanov, so a mission couldn't keep the player off a carrier or plan its own landings. A ship type's record now says which landing the type offers. The game's types keep the original's rule, the Reliant and the Yamato only, so the campaign plays as before. Mods and missions give other carriers a landing through the records, a mod's ship types and scripts. The landings move into modules of their own, as the launches did, and the Badanov's bay gets a landing that reuses the hangar bay's. Closes #758
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The player's ship now lands only on a ship that offers a landing. The game's types keep the game's rules: the Reliant and the Yamato offer theirs, and no other type offers one, so the original campaign lands as before.
ShipTypeRecord.landingholds the landing a type offers:reliant,yamato,bay,badanov, or nil for none. Load scripts change it, and a mod's[ShipType]section gives it withLanding=. Without the key, a mod's type takes its base's landing where it keeps its base's model, and none otherwise. Where a carrier's model lacks what its landing needs, such as the Reliant's launch tube or a bay's launch points, nothing lands on it and the log says so.object.landing), and choose the ship PERMISSION TO LAND asks (world.player_carrier,world.set_player_carrier).SetAIand the friendly fire's sending home.permission_to_landhook, so that a mod can answer PERMISSION TO LAND its own way.launch.badanov.gatePlace).ailand/reliant.zig,ailand/yamato.zigandailand/bay.zig, as the launches are underlaunch/, and share their common steps inailand.zig.There is no
--originalswitch: this changes how the game plays, not how it looks.A change from #1192: a hangar bay carrier such as the Victorious, and a mod's carrier with a model of its own, no longer take the player's ship by default. A mod's carrier needs
Landing=bay, or a script gives it the landing.Checked: the tests,
make check-missions, and a tick-by-tick hash of the game's state against main in missions 1, 2, 18, 20 and 30, each through a full landing (PERMISSION TO LAND pressed once the launch is over). Tried in the game with a local mod whose missions launch the player from the Badanov and the Victorious and land there.Left:
make ghidra-annotatedidn't run, since a Ghidra window holds the project. The landing's exported types change:LandStylegainsbadanovand losesnone, andLandState.stylebecomes a number.BEGIN_COMMIT_OVERRIDE
feat: mods and missions choose which ships the player can land on (#758)
feat: the player's ship can land in the Badanov's and the Krasny's bay
feat: scripts can hook PERMISSION TO LAND and choose the player's carrier
END_COMMIT_OVERRIDE
Closes #758