feat: move hard-coded attributes to YAML patches (#63)

This allows for easier modification of how attributes are calculated, and doesn't require a new dogma-engine for any attribute change.
This commit is contained in:
Patric Stout
2024-07-06 13:57:25 +02:00
committed by GitHub
parent e93f636508
commit 82a9749ae7
40 changed files with 2486 additions and 259 deletions

View File

@@ -50,68 +50,33 @@ python -m convert <path to json>
## Patches
The EVE SDE has some quirks, that are easiest fixed in the conversion.
To process data easier, and keep data small, a few things are changed in the Protobuf variant of the SDE:
- TypeID entries are matched to a GroupID, which is matched to a Category.
- Type entries are matched to a GroupID, which is matched to a Category.
This makes finding all types of a certain category (like: all skills) time consuming.
As such, `CategoryID` is added to every TypeID entry, which is the same as the category of the group it is in.
- The effect `online` is in the category `active` (for internal EVE reasons).
But this confuses the `dogma-engine` in calculating the possible states a module can have.
As such, the category is changed to `online`.
As such, `CategoryID` is added to every Type entry, which is the same as the category of the group it is in.
- `domain` and `func` are strings, which is slow to process.
As those fields are actually enums, they are changed into an integer.
Oddly enough, `operation` is already an integer (and is an enum too).
- Afterburners and Microwarpdrive have no active effect modifier in the SDE (as they are handled specially internally in EVE).
To address this, the `moduleBonusAfterburner` and `moduleBonusMicrowarpdrive` get assigned extra modifiers:
- A modifier with the operation `add`, with on the left side `massAddition` of the item and on the right side `mass` of the ship.
- A modifier with the operation `postPercent`, with on the left side `signatureRadiusBonus` of the item and on the right side `signatureRadius` of the ship.
- A few complicated modifier to change the `maxVelocity`.
In normal math terms: `maxVelocity *= item.speedFactor * item.speedBoostFactor / ship.mass`.
The issue is that this combines attributes from the item and ship, which is normally never done like this.
As a solution, two things are changed:
- Two modifiers are added which result attribute `-7` on the ship to be the `item.speedFactor * item.speedBoostFactor` part.
- A new effect (`-1`: `applyVelocityBoost`) is added to all ships, which add two modifiers to do the rest: `/ ship.mass` and applying as `postPercent` to `maxVelocity`.
- Some Missile skills have no active effect modifier in the SDE (as they are handled specially internally in EVE).
To address this, for these skill, an extra effect is applied.
The function `OwnerRequiredSkillModifier` with a SkillID of `-1` is used to indicate the effect should be applied based on the current skill.
Similar, `selfRof` and `droneDmgBonus` have no effects applied.
These are changed in a similar way.
- Some missile attributes are applied to CharID, and not to the charge.
The new effect (`-2`: `applyMissileDamage`) is added to the character, which applies `missileDamageMultiplier` to all four damage types on all charges that need `Missile Launcher Operation` skill.
- A few attributes are added to every hull, which are calculated by the `dogma-engine`.
They carry negative IDs, to make it more visible they are calculated by the `dogma-engine`, and are not part of the EVE SDE.
- `-1`: `alignTime` - seconds needed to align for warp.
- `-2`: `scanStrength` - there are four types of scan-strengths; this is given the highest value of those four.
- `-3`: `cpuUsed` - how much CPU is in use.
- `-4`: `powerUsed` - how much Power Grid is in use.
- `-5`: `cpuUnused` - how much CPU is left unused.
- `-6`: `powerUnused` - how much Power Grid is left unused.
- `-7`: `velocityBoost` - how much (in percent) the velocity will be boosted (for AB / MWD calculations).
- `-8`: `shieldEhpMultiplier` - multiplier to convert shield HP to shield eHP.
- `-9`: `armorEhpMultiplier` - multiplier to convert armor HP to armor eHP.
- `-10`: `hullEhpMultiplier` - multiplier to convert hull HP to hull eHP.
- `-11`: `shieldEhp` - shield eHP.
- `-12`: `armorEhp` - armor eHP.
- `-13`: `hullEhp` - hull eHP.
- `-14`: `ehp` - total (shield + armor + hull) eHP.
- `-15`: `passiveShieldRecharge` - passive shield recharge (in HP/s).
- `-16`: `shieldBoostRate` - shield boost rate (in HP/s).
- `-17`: `armorRepairRate` - armor repair rate (in HP/s).
- `-18`: `hullRepairRate` - hull repair rate (in HP/s).
- `-19`: `passiveShieldRechargeEhp` - passive shield recharge (in eHP/s).
- `-20`: `shieldBoostRateEhp` - shield boost rate (in eHP/s).
- `-21`: `armorRepairRateEhp` - armor repair rate (in eHP/s).
- `-22`: `hullRepairRateEhp` - hull repair rate (in eHP/s).
- `-23`: `capacitorPeakRecharge` - peak recharge of capacitor (in GJ/s).
- `-24`: `capacitorPeakUsage` - peak usage of capacitor (in GJ/s), when all modules would activate at the same time.
- `-25`: `capacitorPeakDelta` - delta between peak recharge and usage (in GJ/s).
- `-26`: `capacitorPeakDeltaPercentage` - delta between peak recharge and usage in percentage against peak recharge.
- `-27`: `capacitorDepletesIn` - if capacitor is unstable, amount of seconds till the capacitor is drained.
- `-28`: `damageWithoutReloadDps` - the total DPS without reloading.
- `-29`: `damageWithReloadDps` - the total DPS with reloading.
- `-30`: `damageAlphaHp` - the damage done when all guns shoot at once.
- `-31`: `droneActive` - how many drones are active.
- `-32`: `droneBandwidthUsedTotal` - total bandwidth used by the active drones.
- `-33`: `droneDamageAlphaHp` - the damage done when all active drones shoot at once.
- `-34`: `droneDamageDps` - the total DPS for the active drones.
- `-35`: `droneCapacityUsed` - total dronebay capacity used.
Additionally, the EVE data has some quirks, and the EVE client tends to do some things internally.
Fixing up these things in the dogma-engine makes for a rather complicated flow, which is hard to maintain.
Instead, in the [patches](./patches/) folder there are several patches which are applied on top of the SDE, to mostly fix up these quirks and internal calculations.
These patches are all documented individually.
Although some patches fix quirks, most of them simply ensure that all clients of the dogma-engine use the same definition of the same word.
As example, calculating the `shieldBoostRate` without any of these patches is not complicated, but requires knowledge of how that value comes to be.
By pushing this into the dogma data, it means that all clients can just use `shieldBoostRate`, and all see the same value.
The complicated part of how it is built-up is already done.
One could argue that this is mis-using the dogma data and dogma-engine, but it cannot be denied it is an effective way to get the job done.
As the dogma data cannot handle all situations (and this is why some are handled by EVE client internally), there are a few additions to the dogma data:
- A `modifierInfo` with `LocationRequiredSkillModifier` or `OwnerRequiredSkillModifier` can have their `skillTypeID` set to `-1`.
This can be used on effects defined by skills, and they cause the effect to be applied for any location / owner that has that skill as required skill.
NOTE: patches might create new attributes or effects.
New attributes and effects always have a negative ID, to quickly identify that they are not part of the original SDE.
The order of these attributes can change between builds; so use their name to find their ID.
As you should with any other attribute or effect.

View File

@@ -2,6 +2,7 @@ import os
import sys
from .conversion import (
categories,
dogma_attributes,
dogma_effects,
groups,
@@ -9,6 +10,12 @@ from .conversion import (
types,
type_dogma,
)
from .patches import (
dogma_attributes as patch_dogma_attributes,
dogma_effects as patch_dogma_effects,
type_dogma as patch_type_dogma,
)
from .patches.loader import load_patches
if len(sys.argv) < 2:
@@ -20,9 +27,31 @@ path = sys.argv[1]
os.makedirs("dist/sde", exist_ok=True)
os.makedirs("dist/sde_json", exist_ok=True)
groups.convert(path)
market_groups.convert(path)
ships = types.convert(path)
type_dogma.convert(path, ships)
dogma_attributes.convert(path)
dogma_effects.convert(path)
patches = load_patches()
data = {}
gens = []
gens.append(categories.convert(path, data))
gens.append(groups.convert(path, data))
gens.append(types.convert(path, data))
gens.append(market_groups.convert(path, data))
gens.append(dogma_attributes.convert(path, data, patches))
gens.append(dogma_effects.convert(path, data, patches))
gens.append(type_dogma.convert(path, data, patches))
# First iteration updates "data" with all the name -> ID mappings.
for gen in gens:
next(gen)
# Patch all data.
patch_dogma_attributes.patch(data["dogmaAttributes"], patches["attributes"], data)
patch_dogma_effects.patch(data["dogmaEffects"], patches["effects"], data)
patch_type_dogma.patch(data["typeDogma"], patches["typeDogma"], data)
# Second iteration actually writes all the information.
for gen in gens:
try:
next(gen)
except StopIteration:
pass

View File

View File

@@ -0,0 +1,39 @@
import json
import yaml
import esf_pb2
from google.protobuf.json_format import MessageToJson
def convert(path, data):
print("Loading categories ...")
try:
with open(f"{path}/categories.yaml") as fp:
categories = yaml.load(fp, Loader=yaml.CSafeLoader)
for category in categories.values():
category["name"] = category["name"]["en"]
except FileNotFoundError:
with open(f"{path}/categories.json") as fp:
categories = json.load(fp)
categories = {int(k): v for k, v in categories.items()}
for category in categories.values():
category["name"] = category["categoryNameID"]
data["categories"] = categories
yield
print("Converting categories ...")
pb2 = esf_pb2.Categories()
for id, entry in categories.items():
pb2.entries[id].name = entry["name"]
pb2.entries[id].published = entry["published"]
with open("dist/sde/categories.pb2", "wb") as fp:
fp.write(pb2.SerializeToString())
with open("dist/sde_json/categories.json", "w") as fp:
fp.write(MessageToJson(pb2, sort_keys=True))

View File

@@ -6,8 +6,8 @@ import esf_pb2
from google.protobuf.json_format import MessageToJson
def convert(path):
print("Converting dogmaAttributes ...")
def convert(path, data, patches):
print("Loading dogmaAttributes ...")
try:
with open(f"{path}/dogmaAttributes.yaml") as fp:
@@ -17,6 +17,11 @@ def convert(path):
dogmaAttributes = json.load(fp)
dogmaAttributes = {int(k): v for k, v in dogmaAttributes.items()}
data["dogmaAttributes"] = dogmaAttributes
yield
print("Converting dogmaAttributes ...")
pb2 = esf_pb2.DogmaAttributes()
for id, entry in dogmaAttributes.items():
@@ -26,50 +31,6 @@ def convert(path):
pb2.entries[id].highIsGood = entry["highIsGood"]
pb2.entries[id].stackable = entry["stackable"]
# Entries that don't exist in the SDE, but are calculated by the library.
def add_esf_attribute(id, name, high_is_good):
pb2.entries[id].name = name
pb2.entries[id].published = True
pb2.entries[id].defaultValue = 0
pb2.entries[id].highIsGood = high_is_good
pb2.entries[id].stackable = False
add_esf_attribute(-1, "alignTime", False)
add_esf_attribute(-2, "scanStrength", True)
add_esf_attribute(-3, "cpuUsed", False)
add_esf_attribute(-4, "powerUsed", False)
add_esf_attribute(-5, "cpuUnused", True)
add_esf_attribute(-6, "powerUnused", True)
add_esf_attribute(-7, "velocityBoost", True)
add_esf_attribute(-8, "shieldEhpMultiplier", True)
add_esf_attribute(-9, "armorEhpMultiplier", True)
add_esf_attribute(-10, "hullEhpMultiplier", True)
add_esf_attribute(-11, "shieldEhp", True)
add_esf_attribute(-12, "armorEhp", True)
add_esf_attribute(-13, "hullEhp", True)
add_esf_attribute(-14, "ehp", True)
add_esf_attribute(-15, "passiveShieldRecharge", True)
add_esf_attribute(-16, "shieldBoostRate", True)
add_esf_attribute(-17, "armorRepairRate", True)
add_esf_attribute(-18, "hullRepairRate", True)
add_esf_attribute(-19, "passiveShieldRechargeEhp", True)
add_esf_attribute(-20, "shieldBoostRateEhp", True)
add_esf_attribute(-21, "armorRepairRateEhp", True)
add_esf_attribute(-22, "hullRepairRateEhp", True)
add_esf_attribute(-23, "capacitorPeakRecharge", True)
add_esf_attribute(-24, "capacitorPeakUsage", False)
add_esf_attribute(-25, "capacitorPeakDelta", True)
add_esf_attribute(-26, "capacitorPeakDeltaPercentage", True)
add_esf_attribute(-27, "capacitorDepletesIn", False)
add_esf_attribute(-28, "damageWithoutReloadDps", True)
add_esf_attribute(-29, "damageWithReloadDps", True)
add_esf_attribute(-30, "damageAlphaHp", True)
add_esf_attribute(-31, "droneActive", True)
add_esf_attribute(-32, "droneBandwidthUsedTotal", False)
add_esf_attribute(-33, "droneDamageAlphaHp", True)
add_esf_attribute(-34, "droneDamageDps", True)
add_esf_attribute(-35, "droneCapacityUsed", False)
with open("dist/sde/dogmaAttributes.pb2", "wb") as fp:
fp.write(pb2.SerializeToString())

View File

@@ -6,8 +6,8 @@ import esf_pb2
from google.protobuf.json_format import MessageToJson
def convert(path):
print("Converting dogmaEffects ...")
def convert(path, data, patches):
print("Loading dogmaEffects ...")
try:
with open(f"{path}/dogmaEffects.yaml") as fp:
@@ -17,69 +17,17 @@ def convert(path):
dogmaEffects = json.load(fp)
dogmaEffects = {int(k): v for k, v in dogmaEffects.items()}
data["dogmaEffects"] = dogmaEffects
yield
print("Converting dogmaEffects ...")
pb2 = esf_pb2.DogmaEffects()
pbmi = pb2.DogmaEffect.ModifierInfo()
def add_modifier(id, domain, func, modifiedAttributeID, operation, modifyingAttributeID, **kwargs):
pbmi = pb2.DogmaEffect.ModifierInfo()
pbmi.domain = domain
pbmi.func = func
pbmi.modifiedAttributeID = modifiedAttributeID
pbmi.modifyingAttributeID = modifyingAttributeID
pbmi.operation = operation
for key, value in kwargs.items():
setattr(pbmi, key, value)
pb2.entries[id].modifierInfo.append(pbmi)
# Add the "applyVelocityBoost" effect.
pb2.entries[-1].name = "applyVelocityBoost"
pb2.entries[-1].effectCategory = 0
pb2.entries[-1].electronicChance = 0
pb2.entries[-1].isAssistance = False
pb2.entries[-1].isOffensive = False
pb2.entries[-1].isWarpSafe = True
pb2.entries[-1].propulsionChance = 0
pb2.entries[-1].rangeChance = 0
# Final step of applying the velocity bonus.
add_modifier(-1, pbmi.Domain.itemID, pbmi.Func.ItemModifier, -7, 5, 4) # velocityBoost <postDiv> mass
add_modifier(-1, pbmi.Domain.itemID, pbmi.Func.ItemModifier, 37, 6, -7) # maxVelocity <postPercent> velocityBoost
# Add the "applyMissileDamage" effect.
pb2.entries[-2].name = "applyMissileDamage"
pb2.entries[-2].effectCategory = 0
pb2.entries[-2].electronicChance = 0
pb2.entries[-2].isAssistance = False
pb2.entries[-2].isOffensive = True
pb2.entries[-2].isWarpSafe = True
pb2.entries[-2].propulsionChance = 0
pb2.entries[-2].rangeChance = 0
add_modifier(
-2, pbmi.Domain.charID, pbmi.Func.OwnerRequiredSkillModifier, 114, 4, 212, skillTypeID=3319
) # emDamage <postMul> missileDamageMultiplier for Missile Launcher Operation skill
add_modifier(
-2, pbmi.Domain.charID, pbmi.Func.OwnerRequiredSkillModifier, 116, 4, 212, skillTypeID=3319
) # explosiveDamage <postMul> missileDamageMultiplier for Missile Launcher Operation skill
add_modifier(
-2, pbmi.Domain.charID, pbmi.Func.OwnerRequiredSkillModifier, 117, 4, 212, skillTypeID=3319
) # kineticDamage <postMul> missileDamageMultiplier for Missile Launcher Operation skill
add_modifier(
-2, pbmi.Domain.charID, pbmi.Func.OwnerRequiredSkillModifier, 118, 4, 212, skillTypeID=3319
) # thermalDamage <postMul> missileDamageMultiplier for Missile Launcher Operation skill
for id, entry in dogmaEffects.items():
pb2.entries[id].name = entry["effectName"]
# In the SDE, the "online" effect is in the "active" category.
# Internally EVE does some magic here; but in our case, it should
# always be in the "online" category. So change the effect here.
if entry["effectName"] == "online":
pb2.entries[id].effectCategory = 4
else:
pb2.entries[id].effectCategory = entry["effectCategory"]
pb2.entries[id].effectCategory = entry["effectCategory"]
pb2.entries[id].electronicChance = entry["electronicChance"]
pb2.entries[id].isAssistance = entry["isAssistance"]
pb2.entries[id].isOffensive = entry["isOffensive"]
@@ -121,6 +69,8 @@ def convert(path):
pbmi.domain = pbmi.Domain.target
case "targetID":
pbmi.domain = pbmi.Domain.targetID
case _:
raise ValueError(f"Unknown domain: {modifier_info['domain']}")
match modifier_info["func"]:
case "ItemModifier":
@@ -135,6 +85,8 @@ def convert(path):
pbmi.func = pbmi.Func.OwnerRequiredSkillModifier
case "EffectStopper":
pbmi.func = pbmi.Func.EffectStopper
case _:
raise ValueError(f"Unknown func: {modifier_info['func']}")
if "modifiedAttributeID" in modifier_info:
pbmi.modifiedAttributeID = modifier_info["modifiedAttributeID"]
@@ -149,58 +101,6 @@ def convert(path):
pb2.entries[id].modifierInfo.append(pbmi)
# In the SDE, the ABs and MWDs don't have an active modifier effect.
# Internally EVE does some magic here; but in our case, these
# modifiers can just be assigned to the effects.
if entry["effectName"] == "moduleBonusMicrowarpdrive":
add_modifier(
id, pbmi.Domain.shipID, pbmi.Func.ItemModifier, 552, 6, 554
) # signatureRadius <postPercent> signatureRadiusBonus
if entry["effectName"] == "moduleBonusAfterburner" or entry["effectName"] == "moduleBonusMicrowarpdrive":
add_modifier(id, pbmi.Domain.shipID, pbmi.Func.ItemModifier, 4, 2, 796) # mass <modAdd> massAddition
# Velocity change is calculated like this:
# velocityBoost = item.speedFactor * item.speedBoostFactor / ship.mass
# First, calculate the multiplication on the item.
add_modifier(
id, pbmi.Domain.shipID, pbmi.Func.ItemModifier, -7, -1, 567
) # velocityBoost <preAssign> speedBoostFactor
add_modifier(
id, pbmi.Domain.shipID, pbmi.Func.ItemModifier, -7, 4, 20
) # velocityBoost <postMul> speedFactor
# Next, "applyVelocityBoost" is applied on all ships which takes care of
# the final calculation (as mass is an attribute of the ship).
# missileEMDmgBonus, missileExplosiveDmgBonus, missileKineticDmgBonus, missileThermalDmgBonus don't apply
# any effect direct, but this is handled internally in EVE. For us,
# it is better to just make it an effect.
damageType = {
"missileEMDmgBonus": 114,
"missileExplosiveDmgBonus": 116,
"missileKineticDmgBonus2": 117,
"missileThermalDmgBonus": 118,
}
if entry["effectName"] in damageType.keys():
add_modifier(
id,
pbmi.Domain.charID,
pbmi.Func.OwnerRequiredSkillModifier,
damageType[entry["effectName"]],
6,
292,
skillTypeID=-1,
) # <damageType>Damage <postPercent> damageMultiplierBonus for skill in question.
if entry["effectName"] == "selfRof":
add_modifier(
id, pbmi.Domain.shipID, pbmi.Func.LocationRequiredSkillModifier, 51, 6, 293, skillTypeID=-1
) # speed <postPercent> rofBonus for skill in question.
if entry["effectName"] == "droneDmgBonus":
add_modifier(
id, pbmi.Domain.charID, pbmi.Func.OwnerRequiredSkillModifier, 64, 6, 292, skillTypeID=-1
) # damageMultiplier <postPercent> damageMultiplierBonus for skill in question.
with open("dist/sde/dogmaEffects.pb2", "wb") as fp:
fp.write(pb2.SerializeToString())

View File

@@ -6,21 +6,30 @@ import esf_pb2
from google.protobuf.json_format import MessageToJson
def convert(path):
print("Converting groups ...")
def convert(path, data):
print("Loading groups ...")
try:
with open(f"{path}/groups.yaml") as fp:
groups = yaml.load(fp, Loader=yaml.CSafeLoader)
for group in groups.values():
group["name"] = group["name"]["en"]
except FileNotFoundError:
with open(f"{path}/groups.json") as fp:
groups = json.load(fp)
groups = {int(k): v for k, v in groups.items()}
for group in groups.values():
group["name"] = group["groupNameID"]
data["groups"] = groups
yield
print("Converting groups ...")
pb2 = esf_pb2.Groups()
for id, entry in groups.items():
pb2.entries[id].name = entry["name"]["en"] if "name" in entry else entry["groupNameID"]
pb2.entries[id].name = entry["name"]
pb2.entries[id].categoryID = entry["categoryID"]
pb2.entries[id].published = entry["published"]

View File

@@ -6,8 +6,8 @@ import esf_pb2
from google.protobuf.json_format import MessageToJson
def convert(path):
print("Converting marketGroups ...")
def convert(path, data):
print("Loading marketGroups ...")
try:
with open(f"{path}/marketGroups.yaml") as fp:
@@ -17,6 +17,11 @@ def convert(path):
marketGroups = json.load(fp)
marketGroups = {int(k): v for k, v in marketGroups.items()}
data["marketGroups"] = marketGroups
yield
print("Converting marketGroups ...")
pb2 = esf_pb2.MarketGroups()
for id, entry in marketGroups.items():

View File

@@ -6,8 +6,8 @@ import esf_pb2
from google.protobuf.json_format import MessageToJson
def convert(path, ships):
print("Converting typeDogma ...")
def convert(path, data, patches):
print("Loading typeDogma ...")
try:
with open(f"{path}/typeDogma.yaml") as fp:
@@ -17,6 +17,11 @@ def convert(path, ships):
typeDogma = json.load(fp)
typeDogma = {int(k): v for k, v in typeDogma.items()}
data["typeDogma"] = typeDogma
yield
print("Converting typeDogma ...")
pb2 = esf_pb2.TypeDogma()
for id, entry in typeDogma.items():
@@ -30,16 +35,6 @@ def convert(path, ships):
pb2.entries[id].dogmaEffects.append(pbee)
if id in ships:
# Add the "applyVelocityBoost" effect for all ships.
pbee = pb2.TypeDogmaEntry.DogmaEffects(effectID=-1, isDefault=False)
pb2.entries[id].dogmaEffects.append(pbee)
if id == 1373: # 1373 - Character
# Add the "applyMissileDamage" effect for chars.
pbee = pb2.TypeDogmaEntry.DogmaEffects(effectID=-2, isDefault=False)
pb2.entries[id].dogmaEffects.append(pbee)
with open("dist/sde/typeDogma.pb2", "wb") as fp:
fp.write(pb2.SerializeToString())

View File

@@ -6,37 +6,34 @@ import esf_pb2
from google.protobuf.json_format import MessageToJson
def convert(path):
print("Converting types ...")
try:
with open(f"{path}/groups.yaml") as fp:
groups = yaml.load(fp, Loader=yaml.CSafeLoader)
except FileNotFoundError:
with open(f"{path}/groups.json") as fp:
groups = json.load(fp)
groups = {int(k): v for k, v in groups.items()}
def convert(path, data):
print("Loading types ...")
try:
with open(f"{path}/types.yaml") as fp:
types = yaml.load(fp, Loader=yaml.CSafeLoader)
for type in types.values():
type["name"] = type["name"]["en"]
except FileNotFoundError:
with open(f"{path}/types.json") as fp:
types = json.load(fp)
types = {int(k): v for k, v in types.items()}
for type in types.values():
type["name"] = type["typeNameID"]
data["types"] = types
yield
print("Converting types ...")
pb2 = esf_pb2.Types()
ships = []
for id, entry in types.items():
pb2.entries[id].name = entry["name"]["en"] if "name" in entry else entry["typeNameID"]
pb2.entries[id].name = entry["name"]
pb2.entries[id].groupID = entry["groupID"]
pb2.entries[id].categoryID = groups[entry["groupID"]]["categoryID"]
pb2.entries[id].categoryID = data["groups"][entry["groupID"]]["categoryID"]
pb2.entries[id].published = entry["published"]
if groups[entry["groupID"]]["categoryID"] == 6:
ships.append(id)
if "factionID" in entry:
pb2.entries[id].factionID = entry["factionID"]
if "marketGroupID" in entry:
@@ -57,5 +54,3 @@ def convert(path):
with open("dist/sde_json/types.json", "w") as fp:
fp.write(MessageToJson(pb2, sort_keys=True))
return ships

View File

View File

@@ -0,0 +1,17 @@
def patch(entries, patches, data):
nextAttributeID = -100 # We start some IDs away from 0, so we can have a few reserved numbers.
for patch in patches:
if patch.get("new"):
patch["name"] = patch["new"]["name"]
# Most attributes don't care what number they have; some do.
nextID = patch["new"]["id"] if "id" in patch["new"] else nextAttributeID
del patch["new"]
# Check if the name is unique.
for entry in entries.values():
if entry["name"] == patch["name"]:
raise ValueError(f"Attribute name '{patch['name']}' is not unique.")
entries[nextID] = patch
nextAttributeID -= 1

View File

@@ -0,0 +1,103 @@
effectCategoryNameToId = {
"passive": 0,
"active": 1,
"target": 2,
"area": 3,
"online": 4,
"overload": 5,
"dungeon": 6,
"system": 7,
}
effectOperationNameToId = {
"preAssign": -1,
"preMul": 0,
"preDiv": 1,
"modAdd": 2,
"modSub": 3,
"postMul": 4,
"postDiv": 5,
"postPercent": 6,
"postAssign": 7,
# 8 is not used.
# 9 is related to SkillLevel calculation, which is unused.
}
def _fixup_modifier_info(modifier, data):
if "modifiedAttribute" in modifier:
try:
modifier["modifiedAttributeID"] = [
id
for id, attribute in data["dogmaAttributes"].items()
if attribute["name"] == modifier["modifiedAttribute"]
][0]
except IndexError:
raise ValueError(f"Unknown attribute: {modifier['modifiedAttribute']}")
del modifier["modifiedAttribute"]
if "modifyingAttribute" in modifier:
try:
modifier["modifyingAttributeID"] = [
id
for id, attribute in data["dogmaAttributes"].items()
if attribute["name"] == modifier["modifyingAttribute"]
][0]
except IndexError:
raise ValueError(f"Unknown attribute: {modifier['modifyingAttribute']}")
del modifier["modifyingAttribute"]
if "skillType" in modifier:
if modifier["skillType"] == "IfSkillRequired":
modifier["skillTypeID"] = -1
else:
try:
modifier["skillTypeID"] = [
id for id, skill in data["types"].items() if skill["name"] == modifier["skillType"]
][0]
except IndexError:
raise ValueError(f"Unknown skill: {modifier['skillType']}")
del modifier["skillType"]
if "operation" in modifier:
modifier["operation"] = effectOperationNameToId[modifier["operation"]]
def patch(entries, patches, data):
nextEffectID = -1
for patch in patches:
# Lookup fields that require lookup.
if "effectCategory" in patch:
patch["effectCategory"] = effectCategoryNameToId[patch["effectCategory"]]
for modifier in patch.get("modifierInfo", []):
_fixup_modifier_info(modifier, data)
# Add new entries.
if patch.get("new"):
patch["effectName"] = patch["new"]["name"]
del patch["new"]
# Check if the name is unique.
for entry in entries.values():
if entry["effectName"] == patch["effectName"]:
raise ValueError(f"Effect name '{patch['effectName']}' is not unique.")
entries[nextEffectID] = patch
nextEffectID -= 1
# Fixup patch entries.
if patch.get("patch"):
names = [patchTarget["name"] for patchTarget in patch["patch"]]
effectIDs = [id for id, entry in entries.items() if entry["effectName"] in names]
# Append the modifierInfo.
for modifier in patch.get("modifierInfo", []):
for effectID in effectIDs:
if "modifierInfo" not in entries[effectID]:
entries[effectID]["modifierInfo"] = []
entries[effectID]["modifierInfo"].append(modifier)
del patch["patch"]
if "modifierInfo" in patch:
del patch["modifierInfo"]
# Update any remaining fields.
for effectID in effectIDs:
entries[effectID].update(patch)

27
convert/patches/loader.py Normal file
View File

@@ -0,0 +1,27 @@
import glob
import yaml
def load_patches():
effects = []
attributes = []
typeDogma = []
for patch in sorted(glob.glob("patches/*.yaml")):
with open(patch) as fp:
patch = yaml.load(fp, Loader=yaml.CSafeLoader)
for attribute in patch.get("attributes", []):
attributes.append(attribute)
for effect in patch.get("effects", []):
effects.append(effect)
for entry in patch.get("typeDogma", []):
typeDogma.append(entry)
return {
"effects": effects,
"attributes": attributes,
"typeDogma": typeDogma,
}

View File

@@ -0,0 +1,126 @@
def _fixup_attribute(attribute, data):
try:
attribute["attributeID"] = [
id for id, item in data["dogmaAttributes"].items() if item["name"] == attribute["attribute"]
][0]
except IndexError:
raise ValueError(f"Unknown attribute: {attribute['attribute']}")
del attribute["attribute"]
def _fixup_effect(effect, data):
try:
effect["effectID"] = [
id for id, item in data["dogmaEffects"].items() if item["effectName"] == effect["effect"]
][0]
except IndexError:
raise ValueError(f"Unknown attribute: {effect['effect']}")
del effect["effect"]
def patch(entries, patches, data):
for patch in patches:
# Lookup fields that require lookup.
for attribute in patch.get("dogmaAttributes", []):
_fixup_attribute(attribute, data)
for effect in patch.get("dogmaEffects", []):
_fixup_effect(effect, data)
appliedIDs = set()
# Fixup patch entries.
for patchTarget in patch.get("patch", []):
if "category" in patchTarget:
try:
categoryID = [
id for id, category in data["categories"].items() if category["name"] == patchTarget["category"]
][0]
except IndexError:
raise ValueError(f"Unknown category: {patchTarget['category']}")
groupIDs = [id for id, item in data["groups"].items() if item["categoryID"] == categoryID]
typeIDs = [id for id, item in data["types"].items() if item["groupID"] in groupIDs]
elif "type" in patchTarget:
try:
typeIDs = [id for id, item in data["types"].items() if item["name"] == patchTarget["type"]]
except IndexError:
raise ValueError(f"Unknown type: {patchTarget['type']}")
else:
raise ValueError("Unknown patch type")
# Ensure there is a dogma entry for each type.
for typeID in typeIDs:
if typeID not in entries:
entries[typeID] = {
"dogmaAttributes": [],
"dogmaEffects": [],
}
if "hasAllAttributes" in patchTarget:
for attribute in patchTarget["hasAllAttributes"]:
try:
attributeID = [
id for id, item in data["dogmaAttributes"].items() if item["name"] == attribute["name"]
][0]
except IndexError:
raise ValueError(f"Unknown attribute: {attribute['name']}")
filteredTypeIDs = []
for typeID in typeIDs:
if attributeID in [
attribute["attributeID"] for attribute in entries[typeID]["dogmaAttributes"]
]:
filteredTypeIDs.append(typeID)
typeIDs = filteredTypeIDs
if "hasAnyAttributes" in patchTarget:
filteredTypeIDs = []
for attribute in patchTarget["hasAnyAttributes"]:
try:
attributeID = [
id for id, item in data["dogmaAttributes"].items() if item["name"] == attribute["name"]
][0]
except IndexError:
raise ValueError(f"Unknown attribute: {attribute['name']}")
for typeID in typeIDs:
if attributeID in [
attribute["attributeID"] for attribute in entries[typeID]["dogmaAttributes"]
]:
filteredTypeIDs.append(typeID)
typeIDs = filteredTypeIDs
if "hasAnyEffects" in patchTarget:
filteredTypeIDs = []
for effect in patchTarget["hasAnyEffects"]:
try:
effectID = [
id for id, item in data["dogmaEffects"].items() if item["effectName"] == effect["name"]
][0]
except IndexError:
raise ValueError(f"Unknown effect: {effect['name']}")
for typeID in typeIDs:
if effectID in [effect["effectID"] for effect in entries[typeID]["dogmaEffects"]]:
filteredTypeIDs.append(typeID)
typeIDs = filteredTypeIDs
# Ensure we never apply the same effect twice on the same type.
typeIDs = list(set(typeIDs) - appliedIDs)
# Append dogmaAttributes.
for attribute in patch.get("dogmaAttributes", []):
for typeID in typeIDs:
entries[typeID]["dogmaAttributes"].append(attribute)
# Append dogmaEffects.
for effect in patch.get("dogmaEffects", []):
for typeID in typeIDs:
entries[typeID]["dogmaEffects"].append(effect)
appliedIDs.update(typeIDs)

View File

@@ -40,6 +40,15 @@ message Types {
map<int32, Type> entries = 1;
}
message Categories {
message Category {
required string name = 1;
required bool published = 2;
}
map<int32, Category> entries = 1;
}
message Groups {
message Group {
required string name = 1;

50
patches/alignTime.yaml Normal file
View File

@@ -0,0 +1,50 @@
description: |
Patch in an attribute to indicate the align time (in seconds).
attributes:
- new:
name: alignTime
published: true
# -ln(0.25) == 1.3862943611198906
defaultValue: 1.3862943611198906
highIsGood: true
stackable: true
effects:
- new:
name: alignTime
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: alignTime
modifyingAttribute: agility
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: alignTime
modifyingAttribute: mass
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: alignTime
modifyingAttribute: thousand
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: alignTime
modifyingAttribute: thousand
operation: postDiv
typeDogma:
- patch:
- category: Ship
dogmaEffects:
- effect: alignTime
isDefault: false

196
patches/capacitor.yaml Normal file
View File

@@ -0,0 +1,196 @@
description: |
Patch in an attributes to indicate several capacitor-related information.
- capacitorPeakRecharge shows in GJ/s how much recharge there would be at
the peak.
- capacitorPeakLoad shows the amount of drain (in GJ) there would be if
all modules activate at once.
- capacitorPeakDelta / capacitorPeakDeltaPercentage is the difference
between those two.
attributes:
- new:
name: capacitorPeakRecharge
published: true
# Peak Recharge is 5.0 / 2.0 * <capacitorCapacity> / <rechargeRate>
defaultValue: 2.5
highIsGood: true
stackable: true
- new:
name: capacitorPeakLoad
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: capacitorPeakDelta
id: -1
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: capacitorPeakDeltaPercentage
published: true
defaultValue: 100
highIsGood: true
stackable: true
# Not calculated via dogma, as this requires simulation. This has to be
# calculated and set by the dogma-engine.
- new:
name: capacitorDepletesIn
id: -2
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: capacitorPeakRecharge
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakRecharge
modifyingAttribute: capacitorCapacity
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakRecharge
modifyingAttribute: rechargeRate
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakRecharge
modifyingAttribute: thousand
operation: postMul
- new:
name: capacitorPeakLoadDuration
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakLoad
modifyingAttribute: capacitorNeed
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakLoad
modifyingAttribute: duration
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakLoad
modifyingAttribute: thousand
operation: postMul
- domain: shipID
func: ItemModifier
modifiedAttribute: capacitorPeakLoad
modifyingAttribute: capacitorPeakLoad
operation: modAdd
- new:
name: capacitorPeakLoadSpeed
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakLoad
modifyingAttribute: capacitorNeed
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakLoad
modifyingAttribute: speed
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakLoad
modifyingAttribute: thousand
operation: postMul
- domain: shipID
func: ItemModifier
modifiedAttribute: capacitorPeakLoad
modifyingAttribute: capacitorPeakLoad
operation: modAdd
- new:
name: capacitorPeakDelta
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakDelta
modifyingAttribute: capacitorPeakRecharge
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakDelta
modifyingAttribute: capacitorPeakLoad
operation: modSub
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakDeltaPercentage
modifyingAttribute: capacitorPeakDelta
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: capacitorPeakDeltaPercentage
modifyingAttribute: capacitorPeakRecharge
operation: postDiv
typeDogma:
- patch:
- category: Ship
dogmaEffects:
- effect: capacitorPeakRecharge
isDefault: false
- patch:
- category: Module
hasAllAttributes:
- name: capacitorNeed
# Some modules use "duration" for their cycle time.
- name: duration
dogmaEffects:
- effect: capacitorPeakLoadDuration
isDefault: false
- patch:
- category: Module
hasAllAttributes:
- name: capacitorNeed
# Other modules use "speed" for their cycle time.
- name: speed
dogmaEffects:
- effect: capacitorPeakLoadSpeed
isDefault: false
- patch:
- category: Ship
dogmaEffects:
- effect: capacitorPeakDelta
isDefault: false

60
patches/chargeAmount.yaml Normal file
View File

@@ -0,0 +1,60 @@
description: |
Patch in an attribute to indicate the amount of charges that fit in a module.
attributes:
- new:
name: chargeAmount
published: true
defaultValue: 1
highIsGood: true
stackable: true
effects:
- new:
name: chargeAmount
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: chargeAmount
modifyingAttribute: capacity
operation: preAssign
- new:
name: chargeAmountAmmo
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: otherID
func: ItemModifier
modifiedAttribute: chargeAmount
modifyingAttribute: volume
operation: postDiv
typeDogma:
- patch:
- category: Module
hasAnyAttributes:
- name: chargeGroup1
- name: chargeGroup2
- name: chargeGroup3
- name: chargeGroup4
- name: chargeGroup5
dogmaEffects:
- effect: chargeAmount
isDefault: false
- patch:
- category: Charge
dogmaEffects:
- effect: chargeAmountAmmo
isDefault: false

88
patches/cpuPower.yaml Normal file
View File

@@ -0,0 +1,88 @@
description: |
CPU / PowerGrid load is not calculated by dogma data.
This patch extends the dogma data with both attributes and effects to do
this calculation.
It reuses the existing "cpuLoad" and "powerLoad", as looking at their ID,
it is most likely the attribute that was meant to represent the used CPU
and PowerGrid.
"cpuFree" and "powerFree" show how much CPU and PowerGrid is still available.
attributes:
- new:
name: cpuFree
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: powerFree
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: cpuPowerLoad
effectCategory: online
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: shipID
func: ItemModifier
modifiedAttribute: cpuLoad
modifyingAttribute: cpu
operation: modAdd
- domain: shipID
func: ItemModifier
modifiedAttribute: powerLoad
modifyingAttribute: power
operation: modAdd
- new:
name: cpuPowerFree
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: cpuFree
modifyingAttribute: cpuOutput
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: cpuFree
modifyingAttribute: cpuLoad
operation: modSub
- domain: itemID
func: ItemModifier
modifiedAttribute: powerFree
modifyingAttribute: powerOutput
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: powerFree
modifyingAttribute: powerLoad
operation: modSub
typeDogma:
- patch:
- category: Module
dogmaEffects:
- effect: cpuPowerLoad
isDefault: false
- patch:
- category: Ship
dogmaEffects:
- effect: cpuPowerFree
isDefault: false

44
patches/damageAlpha.yaml Normal file
View File

@@ -0,0 +1,44 @@
description: |
Patch in an attribute to indicate the damage of an alpha strike. This is
when all guns fire all at once.
attributes:
- new:
name: damageAlpha
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: damageAlpha
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: shipID
func: ItemModifier
modifiedAttribute: damageAlpha
modifyingAttribute: damageVolley
operation: modAdd
typeDogma:
- patch:
- category: Module
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
- category: Module
hasAnyEffects:
- name: useMissiles
- name: turretFitted
dogmaEffects:
- effect: damageAlpha
isDefault: false

View File

@@ -0,0 +1,283 @@
description: |
Patch in an attribute to indicate the DPS (with and without reload).
attributes:
- new:
name: damagePerSecondWithoutReload
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: damagePerSecondWithReload
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: droneDamagePerSecond
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: speedOfReload
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: speedWithReload
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: damagePerSecondBasedOnSpeed
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: damagePerSecondWithoutReload
modifyingAttribute: speed
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: speedWithReload
modifyingAttribute: speed
operation: preAssign
- new:
name: damagePerSecondBasedOnDuration
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: damagePerSecondWithoutReload
modifyingAttribute: duration
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: speedWithReload
modifyingAttribute: duration
operation: preAssign
- new:
name: damagePerSecondWithoutReload
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: damagePerSecondWithoutReload
modifyingAttribute: thousand
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: damagePerSecondWithoutReload
modifyingAttribute: damageVolley
operation: postMul
- domain: shipID
func: ItemModifier
modifiedAttribute: damagePerSecondWithoutReload
modifyingAttribute: damagePerSecondWithoutReload
operation: modAdd
- new:
name: damagePerSecondWithReload
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: speedOfReload
modifyingAttribute: reloadTime
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: speedOfReload
modifyingAttribute: chargeAmount
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: speedWithReload
modifyingAttribute: speedOfReload
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: damagePerSecondWithReload
modifyingAttribute: thousand
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: damagePerSecondWithReload
modifyingAttribute: damageVolley
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: damagePerSecondWithReload
modifyingAttribute: speedWithReload
operation: postDiv
- domain: shipID
func: ItemModifier
modifiedAttribute: damagePerSecondWithReload
modifyingAttribute: damagePerSecondWithReload
operation: modAdd
- new:
name: damagePerSecondWithReloadDrone
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: shipID
func: ItemModifier
modifiedAttribute: droneDamagePerSecond
modifyingAttribute: damagePerSecondWithoutReload
operation: modAdd
- domain: shipID
func: ItemModifier
modifiedAttribute: damagePerSecondWithReload
modifyingAttribute: damagePerSecondWithoutReload
operation: modAdd
typeDogma:
- patch:
- category: Module
hasAllAttributes:
- name: speed
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
- category: Module
hasAllAttributes:
- name: speed
hasAnyEffects:
- name: useMissiles
- name: turretFitted
- category: Drone
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
dogmaEffects:
- effect: damagePerSecondBasedOnSpeed
isDefault: false
- effect: damagePerSecondWithoutReload
isDefault: false
- patch:
- category: Module
hasAllAttributes:
- name: speed
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
- category: Module
hasAllAttributes:
- name: speed
hasAnyEffects:
- name: useMissiles
- name: turretFitted
dogmaEffects:
- effect: damagePerSecondWithReload
isDefault: false
- patch:
- category: Module
hasAllAttributes:
- name: duration
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
- category: Module
hasAllAttributes:
- name: duration
hasAnyEffects:
- name: useMissiles
- name: turretFitted
dogmaEffects:
- effect: damagePerSecondBasedOnDuration
isDefault: false
- effect: damagePerSecondWithoutReload
isDefault: false
- patch:
- category: Module
hasAllAttributes:
- name: duration
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
- category: Module
hasAllAttributes:
- name: duration
hasAnyEffects:
- name: useMissiles
- name: turretFitted
dogmaEffects:
- effect: damagePerSecondWithReload
isDefault: false
- patch:
- category: Drone
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
- category: Module
hasAllAttributes:
- name: duration
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
- category: Module
hasAllAttributes:
- name: duration
hasAnyEffects:
- name: useMissiles
- name: turretFitted
dogmaEffects:
- effect: damagePerSecondWithReloadDrone
isDefault: false

View File

@@ -0,0 +1,35 @@
description: |
To calculate incoming damage, it is important to assume a type of damage you
will be receiving.
By default it is uniform: equal damage on all four resistances. But with
these attributes you can set the damage profile to be more specific.
NOTE: The total of these values should always be exactly one. If not, the
effective hitpoints will be incorrect.
attributes:
- new:
name: damageProfileEm
published: true
defaultValue: 0.25
highIsGood: true
stackable: true
- new:
name: damageProfileExplosive
published: true
defaultValue: 0.25
highIsGood: true
stackable: true
- new:
name: damageProfileKinetic
published: true
defaultValue: 0.25
highIsGood: true
stackable: true
- new:
name: damageProfileThermal
published: true
defaultValue: 0.25
highIsGood: true
stackable: true

65
patches/damageSkills.yaml Normal file
View File

@@ -0,0 +1,65 @@
description: |
Some damage skills have effects that are applied by the EVE client itself,
as they would be very complicated to define in the dogma data.
This patch uses an addition to the dogma-engine, which allows an effect of
a skill to be applied on any location / owner that has that skill listed as
"required skill".
effects:
- patch:
- name: missileEMDmgBonus
modifierInfo:
- domain: charID
func: OwnerRequiredSkillModifier
skillType: IfSkillRequired
modifiedAttribute: emDamage
modifyingAttribute: damageMultiplierBonus
operation: postPercent
- patch:
- name: missileExplosiveDmgBonus
modifierInfo:
- domain: charID
func: OwnerRequiredSkillModifier
skillType: IfSkillRequired
modifiedAttribute: explosiveDamage
modifyingAttribute: damageMultiplierBonus
operation: postPercent
- patch:
- name: missileKineticDmgBonus2
modifierInfo:
- domain: charID
func: OwnerRequiredSkillModifier
skillType: IfSkillRequired
modifiedAttribute: kineticDamage
modifyingAttribute: damageMultiplierBonus
operation: postPercent
- patch:
- name: missileThermalDmgBonus
modifierInfo:
- domain: charID
func: OwnerRequiredSkillModifier
skillType: IfSkillRequired
modifiedAttribute: thermalDamage
modifyingAttribute: damageMultiplierBonus
operation: postPercent
- patch:
- name: selfRof
modifierInfo:
- domain: shipID
func: LocationRequiredSkillModifier
skillType: IfSkillRequired
modifiedAttribute: speed
modifyingAttribute: rofBonus
operation: postPercent
- patch:
- name: droneDmgBonus
modifierInfo:
- domain: charID
func: OwnerRequiredSkillModifier
skillType: IfSkillRequired
modifiedAttribute: damageMultiplier
modifyingAttribute: damageMultiplierBonus
operation: postPercent

150
patches/damageVolley.yaml Normal file
View File

@@ -0,0 +1,150 @@
description: |
Patch in an attribute to indicate the damage a single volley of a module
will do.
attributes:
- new:
name: damageVolley
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: damageVolleyAmmo
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: otherID
func: ItemModifier
modifiedAttribute: damageVolley
modifyingAttribute: emDamage
operation: modAdd
- domain: otherID
func: ItemModifier
modifiedAttribute: damageVolley
modifyingAttribute: explosiveDamage
operation: modAdd
- domain: otherID
func: ItemModifier
modifiedAttribute: damageVolley
modifyingAttribute: kineticDamage
operation: modAdd
- domain: otherID
func: ItemModifier
modifiedAttribute: damageVolley
modifyingAttribute: thermalDamage
operation: modAdd
- new:
name: damageVolley
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: damageVolley
modifyingAttribute: emDamage
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: damageVolley
modifyingAttribute: explosiveDamage
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: damageVolley
modifyingAttribute: kineticDamage
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: damageVolley
modifyingAttribute: thermalDamage
operation: modAdd
- new:
name: damageVolleyMultiplier
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: damageVolley
modifyingAttribute: damageMultiplier
operation: postMul
typeDogma:
- patch:
- category: Charge
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
dogmaEffects:
- effect: damageVolleyAmmo
isDefault: false
- patch:
- category: Module
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
- category: Module
hasAnyEffects:
- name: useMissiles
- name: turretFitted
- category: Drone
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
dogmaEffects:
- effect: damageVolley
isDefault: false
- patch:
- category: Module
hasAllAttributes:
- name: damageMultiplier
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
- category: Module
hasAllAttributes:
- name: damageMultiplier
hasAnyEffects:
- name: useMissiles
- name: turretFitted
- category: Drone
hasAllAttributes:
- name: damageMultiplier
hasAnyAttributes:
- name: emDamage
- name: explosiveDamage
- name: kineticDamage
- name: thermalDamage
dogmaEffects:
- effect: damageVolleyMultiplier
isDefault: false

46
patches/droneActive.yaml Normal file
View File

@@ -0,0 +1,46 @@
description: |
Patch in an attribute to indicate how much drones are active and how much
bandwidth they consume.
attributes:
- new:
name: droneActive
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: droneUsage
published: true
defaultValue: 1
highIsGood: true
stackable: true
effects:
- new:
name: droneActive
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: shipID
func: ItemModifier
modifiedAttribute: droneActive
modifyingAttribute: droneUsage
operation: modAdd
- domain: shipID
func: ItemModifier
modifiedAttribute: droneBandwidthLoad
modifyingAttribute: droneBandwidthUsed
operation: modAdd
typeDogma:
- patch:
- category: Drone
dogmaEffects:
- effect: droneActive
isDefault: false

View File

@@ -0,0 +1,34 @@
description: |
Patch in an attribute to indicate the capacity of drones.
attributes:
- new:
name: droneCapacityLoad
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: droneLoad
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: shipID
func: ItemModifier
modifiedAttribute: droneCapacityLoad
modifyingAttribute: volume
operation: modAdd
typeDogma:
- patch:
- category: Drone
dogmaEffects:
- effect: droneLoad
isDefault: false

49
patches/ehp.yaml Normal file
View File

@@ -0,0 +1,49 @@
description: |
Shield, armor, and hull are presented as Hitpoints by the dogma. However, a
more realistic value to show the user is Effective Hitpoints, which takes
resistance into account.
This patch adds up the Effective Hitpoints of those three, into a single
attribute, representing the total eHP.
attributes:
- new:
name: ehp
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: ehp
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: ehp
modifyingAttribute: shieldEhp
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: ehp
modifyingAttribute: armorEhp
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: ehp
modifyingAttribute: hullEhp
operation: modAdd
typeDogma:
- patch:
- category: Ship
dogmaEffects:
- effect: ehp
isDefault: false

140
patches/ehpArmor.yaml Normal file
View File

@@ -0,0 +1,140 @@
description: |
Shield, armor, and hull are presented as Hitpoints by the dogma. However, a
more realistic value to show the user is Effective Hitpoints, which takes
resistance into account.
This patch creates a few new attributes to calculate the effective hitpoints
of armor. There are two similar patch-files that do this for the other two.
attributes:
- new:
name: armorEmDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: armorExplosiveDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: armorKineticDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: armorThermalDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: armorDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: armorEhp
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: armorEhp
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: armorEmDamageEffectiveResonance
modifyingAttribute: damageProfileEm
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: armorEmDamageEffectiveResonance
modifyingAttribute: armorEmDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: armorDamageEffectiveResonance
modifyingAttribute: armorEmDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: armorExplosiveDamageEffectiveResonance
modifyingAttribute: damageProfileExplosive
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: armorExplosiveDamageEffectiveResonance
modifyingAttribute: armorExplosiveDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: armorDamageEffectiveResonance
modifyingAttribute: armorExplosiveDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: armorKineticDamageEffectiveResonance
modifyingAttribute: damageProfileKinetic
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: armorKineticDamageEffectiveResonance
modifyingAttribute: armorKineticDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: armorDamageEffectiveResonance
modifyingAttribute: armorKineticDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: armorThermalDamageEffectiveResonance
modifyingAttribute: damageProfileThermal
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: armorThermalDamageEffectiveResonance
modifyingAttribute: armorThermalDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: armorDamageEffectiveResonance
modifyingAttribute: armorThermalDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: armorEhp
modifyingAttribute: armorHP
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: armorEhp
modifyingAttribute: armorDamageEffectiveResonance
operation: postDiv
typeDogma:
- patch:
- category: Ship
dogmaEffects:
- effect: armorEhp
isDefault: false

140
patches/ehpHull.yaml Normal file
View File

@@ -0,0 +1,140 @@
description: |
Shield, armor, and hull are presented as Hitpoints by the dogma. However, a
more realistic value to show the user is Effective Hitpoints, which takes
resistance into account.
This patch creates a few new attributes to calculate the effective hitpoints
of hull. There are two similar patch-files that do this for the other two.
attributes:
- new:
name: hullEmDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: hullExplosiveDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: hullKineticDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: hullThermalDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: hullDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: hullEhp
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: hullEhp
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: hullEmDamageEffectiveResonance
modifyingAttribute: damageProfileEm
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: hullEmDamageEffectiveResonance
modifyingAttribute: emDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: hullDamageEffectiveResonance
modifyingAttribute: hullEmDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: hullExplosiveDamageEffectiveResonance
modifyingAttribute: damageProfileExplosive
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: hullExplosiveDamageEffectiveResonance
modifyingAttribute: explosiveDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: hullDamageEffectiveResonance
modifyingAttribute: hullExplosiveDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: hullKineticDamageEffectiveResonance
modifyingAttribute: damageProfileKinetic
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: hullKineticDamageEffectiveResonance
modifyingAttribute: kineticDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: hullDamageEffectiveResonance
modifyingAttribute: hullKineticDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: hullThermalDamageEffectiveResonance
modifyingAttribute: damageProfileThermal
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: hullThermalDamageEffectiveResonance
modifyingAttribute: thermalDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: hullDamageEffectiveResonance
modifyingAttribute: hullThermalDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: hullEhp
modifyingAttribute: hp
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: hullEhp
modifyingAttribute: hullDamageEffectiveResonance
operation: postDiv
typeDogma:
- patch:
- category: Ship
dogmaEffects:
- effect: hullEhp
isDefault: false

140
patches/ehpShield.yaml Normal file
View File

@@ -0,0 +1,140 @@
description: |
Shield, armor, and hull are presented as Hitpoints by the dogma. However, a
more realistic value to show the user is Effective Hitpoints, which takes
resistance into account.
This patch creates a few new attributes to calculate the effective hitpoints
of shield. There are two similar patch-files that do this for the other two.
attributes:
- new:
name: shieldEmDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: shieldExplosiveDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: shieldKineticDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: shieldThermalDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: shieldDamageEffectiveResonance
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: shieldEhp
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: shieldEhp
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldEmDamageEffectiveResonance
modifyingAttribute: damageProfileEm
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldEmDamageEffectiveResonance
modifyingAttribute: shieldEmDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldDamageEffectiveResonance
modifyingAttribute: shieldEmDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldExplosiveDamageEffectiveResonance
modifyingAttribute: damageProfileExplosive
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldExplosiveDamageEffectiveResonance
modifyingAttribute: shieldExplosiveDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldDamageEffectiveResonance
modifyingAttribute: shieldExplosiveDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldKineticDamageEffectiveResonance
modifyingAttribute: damageProfileKinetic
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldKineticDamageEffectiveResonance
modifyingAttribute: shieldKineticDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldDamageEffectiveResonance
modifyingAttribute: shieldKineticDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldThermalDamageEffectiveResonance
modifyingAttribute: damageProfileThermal
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldThermalDamageEffectiveResonance
modifyingAttribute: shieldThermalDamageResonance
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldDamageEffectiveResonance
modifyingAttribute: shieldThermalDamageEffectiveResonance
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldEhp
modifyingAttribute: shieldCapacity
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldEhp
modifyingAttribute: shieldDamageEffectiveResonance
operation: postDiv
typeDogma:
- patch:
- category: Ship
dogmaEffects:
- effect: shieldEhp
isDefault: false

View File

@@ -0,0 +1,49 @@
description: |
Some Missile Skills have no effect in the dogma data. The EVE client normally
takes care of this outside of the dogma.
This patch adds an effect for this to the dogma, so there is no need for
special casing in the dogma-engine.
effects:
- new:
name: missileDamage
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: true
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: charID
func: OwnerRequiredSkillModifier
skillType: Missile Launcher Operation
modifiedAttribute: emDamage
modifyingAttribute: missileDamageMultiplier
operation: postMul
- domain: charID
func: OwnerRequiredSkillModifier
skillType: Missile Launcher Operation
modifiedAttribute: explosiveDamage
modifyingAttribute: missileDamageMultiplier
operation: postMul
- domain: charID
func: OwnerRequiredSkillModifier
skillType: Missile Launcher Operation
modifiedAttribute: kineticDamage
modifyingAttribute: missileDamageMultiplier
operation: postMul
- domain: charID
func: OwnerRequiredSkillModifier
skillType: Missile Launcher Operation
modifiedAttribute: thermalDamage
modifyingAttribute: missileDamageMultiplier
operation: postMul
typeDogma:
- patch:
- type: CharacterType
dogmaEffects:
- effect: missileDamage
isDefault: false

View File

@@ -0,0 +1,9 @@
description: |
The dogma data has an effect "online" that is in the "active" category. The
EVE client internally does some magic here, but in our case, it should
always be in the "online" category.
effects:
- patch:
- name: online
effectCategory: online

View File

@@ -0,0 +1,76 @@
description: |
AfterBurners and MicroWarpDrives do not have an "active" effect in the dogma
data. The EVE client normally takes care of this outside of the dogma.
This patch adds an "active" effect to the dogma, so there is no need for
special casing in the dogma-engine.
Note: the attribute "mass" is not correct in the SDE, and instead the "mass"
field of the type should be used. This patch assumes another patch fixes up
the attribute "mass", so it does correctly reflect the mass of the ship.
attributes:
- new:
name: velocityBoost
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: velocityBoost
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: velocityBoost
modifyingAttribute: mass
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: maxVelocity
modifyingAttribute: velocityBoost
operation: postPercent
- patch:
- name: moduleBonusMicrowarpdrive
modifierInfo:
- domain: shipID
func: ItemModifier
modifiedAttribute: signatureRadius
modifyingAttribute: signatureRadiusBonus
operation: postPercent
- patch:
- name: moduleBonusAfterburner
- name: moduleBonusMicrowarpdrive
modifierInfo:
- domain: shipID
func: ItemModifier
modifiedAttribute: mass
modifyingAttribute: massAddition
operation: modAdd
- domain: shipID
func: ItemModifier
modifiedAttribute: velocityBoost
modifyingAttribute: speedBoostFactor
operation: modAdd
- domain: shipID
func: ItemModifier
modifiedAttribute: velocityBoost
modifyingAttribute: speedFactor
operation: postMul
typeDogma:
- patch:
- category: Ship
dogmaEffects:
- effect: velocityBoost
isDefault: false

View File

@@ -0,0 +1,89 @@
description: |
This patch introduces attributes to calculate the armor repair rate.
It calculates this for both modules that influence the armor repair rate,
and for the ship that receives the armor repair rate.
attributes:
- new:
name: armorRepairRate
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: armorEffectiveRepairRate
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: armorRepairRate
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: armorRepairRate
modifyingAttribute: thousand
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: armorRepairRate
modifyingAttribute: armorDamageAmount
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: armorRepairRate
modifyingAttribute: duration
operation: postDiv
- domain: shipID
func: ItemModifier
modifiedAttribute: armorRepairRate
modifyingAttribute: armorRepairRate
operation: modAdd
- new:
name: armorEffectiveRepairRate
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: armorEffectiveRepairRate
modifyingAttribute: armorRepairRate
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: armorEffectiveRepairRate
modifyingAttribute: armorDamageEffectiveResonance
operation: postDiv
typeDogma:
- patch:
- category: Module
hasAllAttributes:
- name: armorDamageAmount
- name: duration
hasAnyEffects:
- name: armorRepair
dogmaEffects:
- effect: armorRepairRate
isDefault: false
- patch:
- category: Ship
dogmaEffects:
- effect: armorEffectiveRepairRate
isDefault: false

89
patches/rechargeHull.yaml Normal file
View File

@@ -0,0 +1,89 @@
description: |
This patch introduces attributes to calculate the hull repair rate.
It calculates this for both modules that influence the hull repair rate,
and for the ship that receives the hull repair rate.
attributes:
- new:
name: hullRepairRate
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: hullEffectiveRepairRate
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: hullRepairRate
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: hullRepairRate
modifyingAttribute: thousand
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: hullRepairRate
modifyingAttribute: structureDamageAmount
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: hullRepairRate
modifyingAttribute: duration
operation: postDiv
- domain: shipID
func: ItemModifier
modifiedAttribute: hullRepairRate
modifyingAttribute: hullRepairRate
operation: modAdd
- new:
name: hullEffectiveRepairRate
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: hullEffectiveRepairRate
modifyingAttribute: hullRepairRate
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: hullEffectiveRepairRate
modifyingAttribute: hullDamageEffectiveResonance
operation: postDiv
typeDogma:
- patch:
- category: Module
hasAllAttributes:
- name: structureDamageAmount
- name: duration
hasAnyEffects:
- name: structureRepair
dogmaEffects:
- effect: hullRepairRate
isDefault: false
- patch:
- category: Ship
dogmaEffects:
- effect: hullEffectiveRepairRate
isDefault: false

View File

@@ -0,0 +1,88 @@
description: |
This patch introduces attributes to calculate the shield boost rate.
It calculates this for both modules that influence the shield boost rate,
and for the ship that receives the shield boost rate.
attributes:
- new:
name: shieldBoostRate
published: true
defaultValue: 0
highIsGood: true
stackable: true
- new:
name: shieldEffectiveBoostRate
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: shieldBoostRate
effectCategory: active
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldBoostRate
modifyingAttribute: thousand
operation: preAssign
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldBoostRate
modifyingAttribute: shieldBonus
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldBoostRate
modifyingAttribute: duration
operation: postDiv
- domain: shipID
func: ItemModifier
modifiedAttribute: shieldBoostRate
modifyingAttribute: shieldBoostRate
operation: modAdd
- new:
name: shieldEffectiveBoostRate
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldEffectiveBoostRate
modifyingAttribute: shieldBoostRate
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: shieldEffectiveBoostRate
modifyingAttribute: shieldDamageEffectiveResonance
operation: postDiv
typeDogma:
- patch:
- category: Module
hasAllAttributes:
- name: shieldBonus
hasAnyEffects:
- name: shieldBoosting
dogmaEffects:
- effect: shieldBoostRate
isDefault: false
- patch:
- category: Ship
dogmaEffects:
- effect: shieldEffectiveBoostRate
isDefault: false

View File

@@ -0,0 +1,61 @@
description: |
This patch introduces attributes to calculate the passive shield recharge
rate.
attributes:
- new:
name: passiveShieldRechargeRate
published: true
defaultValue: 2500
highIsGood: true
stackable: true
- new:
name: passiveShieldEffectiveRechargeRate
published: true
defaultValue: 2500
highIsGood: true
stackable: true
effects:
- new:
name: passiveShieldRechargeRate
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: passiveShieldRechargeRate
modifyingAttribute: shieldRechargeRate
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: passiveShieldRechargeRate
modifyingAttribute: shieldCapacity
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: passiveShieldEffectiveRechargeRate
modifyingAttribute: shieldRechargeRate
operation: postDiv
- domain: itemID
func: ItemModifier
modifiedAttribute: passiveShieldEffectiveRechargeRate
modifyingAttribute: shieldCapacity
operation: postMul
- domain: itemID
func: ItemModifier
modifiedAttribute: passiveShieldEffectiveRechargeRate
modifyingAttribute: shieldDamageEffectiveResonance
operation: postDiv
typeDogma:
- patch:
- category: Ship
dogmaEffects:
- effect: passiveShieldRechargeRate
isDefault: false

55
patches/scanStrength.yaml Normal file
View File

@@ -0,0 +1,55 @@
description: |
Statistics show a single scan strength, which, depending on the race of the
ship, uses any of the four racial scan strength attributes.
However, this is often a bit annoying to do, GUI-wise. This patch introduces
a single ScanStrength attribute, which is the combination of the other four.
NOTE: normally three out of the four are zero.
attributes:
- new:
name: scanStrength
published: true
defaultValue: 0
highIsGood: true
stackable: true
effects:
- new:
name: scanStrength
effectCategory: passive
electronicChance: false
isAssistance: false
isOffensive: false
isWarpSafe: true
propulsionChance: false
rangeChance: false
modifierInfo:
- domain: itemID
func: ItemModifier
modifiedAttribute: scanStrength
modifyingAttribute: scanRadarStrength
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: scanStrength
modifyingAttribute: scanLadarStrength
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: scanStrength
modifyingAttribute: scanMagnetometricStrength
operation: modAdd
- domain: itemID
func: ItemModifier
modifiedAttribute: scanStrength
modifyingAttribute: scanGravimetricStrength
operation: modAdd
typeDogma:
- patch:
- category: Ship
dogmaEffects:
- effect: scanStrength
isDefault: false

11
patches/timing.yaml Normal file
View File

@@ -0,0 +1,11 @@
description: |
For some millisecond -> second calculations, the value "1000" is needed. This
patch introduces that value, so other patches can use it.
attributes:
- new:
name: thousand
published: true
defaultValue: 1000
highIsGood: true
stackable: true