Sci-Fi Expansion Pack
Extending a mod without touching it
The Sci-Fi Expansion Pack adds an energy shield, a gravity field and more to M.A.W.S. – as a separate add-on that only uses modded class and a few hooks the base mod exposes.



Systems
Energy shield
A damage filter inside the walker's own damage model, a local bubble effect, beam weapons that stop at the bubble.
Gravity field
Lift everything around the walker, hold it in the air, slam it down - server phases, owner physics.
How an add-on hooks in
The base mod exposes a small extension singleton with empty virtual methods. The add-on mods that class and
overrides only what it needs. Without the add-on, the base mod runs its defaults – no checks, no
#ifdef, no load-order tricks.
// --- base mod
class MyWalker_Extension
{
protected static ref MyWalker_Extension s_Instance;
static MyWalker_Extension Get()
{
if (!s_Instance)
s_Instance = new MyWalker_Extension(); // with an add-on loaded this creates the MODDED class
return s_Instance;
}
//! Damage that reaches the zones after armour. Return what is left.
float FilterWalkerDamage(MyWalker_DamageModel model, float damage, BaseDamageContext ctx)
{
return damage;
}
}
// --- add-on
modded class MyWalker_Extension
{
override float FilterWalkerDamage(MyWalker_DamageModel model, float damage, BaseDamageContext ctx)
{
damage = super.FilterWalkerDamage(model, damage, ctx);
return model.MyShield_Absorb(damage, ctx);
}
}
modded class replaces the class everywhere, including new calls inside the base mod. That is why a plain singleton is enough as an extension point.State lives where it already replicates
New replicated state is added to components that already exist on the walker (damage model, module manager) via
modded class with extra [RplProp] fields. No new components in the base prefab, no prefab edits
in the add-on.