Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Majiir committed Oct 19, 2018
2 parents cd4677d + d835cc1 commit c4cd14f
Show file tree
Hide file tree
Showing 14 changed files with 610 additions and 9 deletions.
File renamed without changes.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Subsystem is a mod loader for _Homeworld: Deserts of Kharak_. It aims to have a safe, auditable and data-oriented design.

## Disclaimer
### Disclaimer

Subsystem is currently in alpha. It may be extremely unstable, and it's not likely to provide useful debugging information. Use at your own risk, and please try to dig into logs on your own before reporting crashes or other odd behavior.

Expand Down Expand Up @@ -41,10 +41,26 @@ Note that the keys (`Entities`, `UnitAttributes`, etc) are case-sensitive.

The stats are reloaded at the beginning of every game,

## Multiplayer Notes
### Multiplayer Notes

To use this in multiplayer, all players in the game **must** have the same version of Subsystem *and* the same `patch.json` file contents. If any player has different data, the game is liable to crash with a synchronization error.

## Modifiable Attributes
### Modifiable Attributes

See https://github.com/Majiir/Subsystem/blob/master/Subsystem/UnitAttributesPatch.cs for a list of attributes that can be modified.

### Serialization Notes

* Some enums are marked with `[Flags]`. You must use a particular syntax in order to assign multiple flags. For example, to set a unit's `Class` to multiple values:

```json
...
"UnitAttributes": {
"Class": "Hover, Carrier"
}
...
```

* Non-flags enums should be set as strings. (Example: `"HackableProperties": "InstantHackable"`)

* `Fixed64` values are set as Numbers (equivalent to `double`) in JSON. This is technically a lossy conversion, but it will work well in most circumstances.
27 changes: 27 additions & 0 deletions Subsystem/AbilityAttributesPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using BBI.Game.Data;

namespace Subsystem
{
public class AbilityAttributesPatch
{
public AbilityClass? AbilityType { get; set; }
public AbilityTargetingType? TargetingType { get; set; }
public AbilityTargetAlignment? TargetAlignment { get; set; }
public UnitClass? AbilityMapTargetLayers { get; set; }
public GroundAutoTargetAlignmentType? GroundAutoTargetAlignment { get; set; }
public double? EdgeOfTargetShapeMinDistance { get; set; }

public bool? CasterMovesToTarget { get; set; }
public AbilityGroupActivationType? GroupActivationType { get; set; }
public AbilityRemovedInMode? StartsRemovedInGameMode { get; set; }
public double? CooldownTimeSecs { get; set; }
public double? WarmupTimeSecs { get; set; }
public int? SharedCooldownChannel { get; set; }
public SkipCastOnArrivalConditions? SkipCastOnArrivalConditions { get; set; }
public bool? IsToggleable { get; set; }
public bool? CastOnDeath { get; set; }

public int? Resource1Cost { get; set; }
public int? Resource2Cost { get; set; }
}
}
109 changes: 109 additions & 0 deletions Subsystem/AbilityAttributesWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
using BBI.Core;
using BBI.Core.Utility.FixedPoint;
using BBI.Game.Data;

namespace Subsystem
{
public class AbilityAttributesWrapper : NamedObjectBase, AbilityAttributes
{
public AbilityAttributesWrapper(AbilityAttributes other) : base(other.Name)
{
AbilityMapTargetLayers = other.AbilityMapTargetLayers;
AbilityType = other.AbilityType;
ActivationDependencies = other.ActivationDependencies;
AirSortie = other.AirSortie;
ApplyStatusEffect = other.ApplyStatusEffect;
Autocast = other.Autocast;
AutoToggleOffConditions = other.AutoToggleOffConditions;
CasterMovesToTarget = other.CasterMovesToTarget;
CastOnDeath = other.CastOnDeath;
ChainCasting = other.ChainCasting;
ChangeContext = other.ChangeContext;
Charges = other.Charges;
CooldownTimeSecs = other.CooldownTimeSecs;
Cost = other.Cost;
EdgeOfTargetShapeMinDistance = other.EdgeOfTargetShapeMinDistance;
GroundAutoTargetAlignment = other.GroundAutoTargetAlignment;
GroupActivationType = other.GroupActivationType;
IsToggleable = other.IsToggleable;
ModifyInventory = other.ModifyInventory;
ProduceUnit = other.ProduceUnit;
Repair = other.Repair;
ResearchDependencies = other.ResearchDependencies;
Salvage = other.Salvage;
SelfDestruct = other.SelfDestruct;
SharedCooldownChannel = other.SharedCooldownChannel;
SkipCastOnArrivalConditions = other.SkipCastOnArrivalConditions;
StartsRemovedInGameMode = other.StartsRemovedInGameMode;
TargetAlignment = other.TargetAlignment;
TargetHighlighting = other.TargetHighlighting;
TargetingType = other.TargetingType;
UseWeapon = other.UseWeapon;
WarmupTimeSecs = other.WarmupTimeSecs;
}

public AbilityClass AbilityType { get; set; }

public AbilityTargetingType TargetingType { get; set; }

public AbilityTargetAlignment TargetAlignment { get; set; }

public UnitClass AbilityMapTargetLayers { get; set; }

public GroundAutoTargetAlignmentType GroundAutoTargetAlignment { get; set; }

public Fixed64 EdgeOfTargetShapeMinDistance { get; set; }

public TargetHighlightingAttributes TargetHighlighting { get; set; }

public bool CasterMovesToTarget { get; set; }

public AbilityGroupActivationType GroupActivationType { get; set; }

public AbilityRemovedInMode StartsRemovedInGameMode { get; set; }

public Fixed64 CooldownTimeSecs { get; set; }

public Fixed64 WarmupTimeSecs { get; set; }

public int SharedCooldownChannel { get; set; }

public SkipCastOnArrivalConditions SkipCastOnArrivalConditions { get; set; }

public bool IsToggleable { get; set; }

public bool CastOnDeath { get; set; }

public CostAttributes Cost { get; set; }

public ChargeAttributes Charges { get; set; }

public AutocastAttributes Autocast { get; set; }

public ProduceUnitAttributes ProduceUnit { get; set; }

public UseWeaponAttributes UseWeapon { get; set; }

public ChangeContextAttributes ChangeContext { get; set; }

public AirSortieAttributes AirSortie { get; set; }

public SalvageAttributes Salvage { get; set; }

public ApplyStatusEffectAttributes ApplyStatusEffect { get; set; }

public RepairAttributes Repair { get; set; }

public SelfDestructAttributes SelfDestruct { get; set; }

public ModifyInventoryAttributes ModifyInventory { get; set; }

public ResearchDependenciesAttributes ResearchDependencies { get; set; }

public ActivationDependenciesAttributes ActivationDependencies { get; set; }

public AutoToggleOffConditionsAttributes AutoToggleOffConditions { get; set; }

public ChainCastingAttributes ChainCasting { get; set; }
}
}
Loading

0 comments on commit c4cd14f

Please sign in to comment.