Skip to content

Commit

Permalink
Show repair and repair supply drain on individual subsystems in the d…
Browse files Browse the repository at this point in the history
…esign editor
  • Loading branch information
Skeletonxf committed May 20, 2021
1 parent c367648 commit c5b71bd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
16 changes: 16 additions & 0 deletions colonisation-expansion/data/design_stats/extra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,19 @@ SubsystemStat: ProjectedShieldRegen
Color: #00aeff

Variable: ProjShieldRegen

SubsystemStat: Repair
Name: #S_REPAIR_STAT
Description: #STT_REPAIR
Color: #89df89
Suffix: s

Variable: Repair // Script applies empire repair factor

SubsystemStat: RepairSupplyDrain
Name: #S_REPAIR_SUPPLY_COST
Description: #STT_REPAIR_SUPPLY_COST
Color: #f0ea8a
Suffix: /s

Variable: RepairSupplyCost // Script applies empire repair factor
10 changes: 8 additions & 2 deletions colonisation-expansion/scripts/gui/design_stats.as
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,13 @@ namespace design_stats {
}
}
else if(type == SVT_SubsystemVariable) {
// [[ MODIFY BASE GAME START ]]
double factor = 1.0;
if ((SubsystemVariable(var) == SV_Repair) || (SubsystemVariable(var) == SV_RepairSupplyCost)) {
factor = playerEmpire.EmpireRepairFactor;
}
if(sys !is null) {
return dsg.variable(sys, SubsystemVariable(var));
return factor * dsg.variable(sys, SubsystemVariable(var));
}
else {
double val = 0.0;
Expand All @@ -201,7 +206,8 @@ namespace design_stats {
}
}
}
return val;
return factor * val;
// [[ MODIFY BASE GAME END ]]
}
}
else if(type == SVT_ShipVariable) {
Expand Down

0 comments on commit c5b71bd

Please sign in to comment.