Skip to content

Hullmods #3285

Open
NazrinNya wants to merge 2 commits intoMonolith-Station:mainfrom
NazrinNya:dmod
Open

Hullmods #3285
NazrinNya wants to merge 2 commits intoMonolith-Station:mainfrom
NazrinNya:dmod

Conversation

@NazrinNya
Copy link
Contributor

About the PR

Adds new GridModifier System along with its own prototype and component.
Currently its capable of replacing each entity on the grid.

Why / Balance

Capabilities of generating derelict ships with bunch of damage mods, or advanced ships with good mods.

How to test

Load in
Spawn some shuttles
Apply hullmods to them using addgridmodifier

Media

Arkansaw with ReinforcedHull Hullmod
изображение

Requirements

  • I have read and am following the Pull Request and Changelog Guidelines.
  • I have added media to this PR or it does not require an ingame showcase.
  • I can confirm this PR contains no AI-generated content, and did not use any AI-generated content.

Breaking changes

Changelog

🆑

  • add: Added Hullmods, currently admin-only.

namespace Content.Server._Mono.Grid.Modifiers;

[UsedImplicitly]
public sealed partial class EntityReplace : GridModifier
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be called GridModEntityReplace

protected string _id => GetType().Name;

[DataField]
public string Comp = "Transform";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think there is some way to enforce this being a prototype name, maybe see what ComponentRegistry does

Comment on lines +41 to +49
var comp = _factory.GetComponent(modifier.Comp);
var ents = new HashSet<Entity<IComponent>>();

GetGridEntities(uid, ents, comp.GetType());

foreach (var ent in ents)
{
modifier.Modify(ent, _metaQuery.Get(ent), _xformQuery.Get(ent), EntityManager);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should ideally be handled by the grid modifier, all this system should do is call the modifier with the grid as arg
also don't use xform query or metadata query, use Transform() and MetaData()

_prototypeManager.RegisterIgnore("nukeopsRole");
_prototypeManager.RegisterIgnore("ghostRoleRaffleDecider");
_prototypeManager.RegisterIgnore("pointOfInterest"); // Frontier: worldgen-related, server-only
_prototypeManager.RegisterIgnore("gridModifier"); // mono
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just declare it in shared even if the logic is on server
also makes it easier if we want to e.g. put it in UI later

public sealed partial class ReplaceData
{
[DataField]
public EntityWhitelist? Whitelist;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do an alias getter/setter variable for Whitelist.Tags (or maybe 2 aliases, Tags if you want a list and Tag if you want one tag) so you can do tag whitelist without bloat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants