Add Craftsmanship miracle; update production calculations and unlock logic
This commit is contained in:
18
Mods/Miracles/craftmenship.json
Normal file
18
Mods/Miracles/craftmenship.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "Craftsmanship",
|
||||||
|
"faithCost": 600,
|
||||||
|
"followersRequired": 300,
|
||||||
|
"productionRequired": 25,
|
||||||
|
"unlockedByDefault": false,
|
||||||
|
"effects": [
|
||||||
|
{
|
||||||
|
"type": "ModifyStat",
|
||||||
|
"targetStat": "ProductionPerFollower",
|
||||||
|
"op": "Add",
|
||||||
|
"value": 0.05
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "DestroySelf"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@@ -6,7 +6,7 @@
|
|||||||
"effects": [
|
"effects": [
|
||||||
{
|
{
|
||||||
"type": "UnlockMiracle",
|
"type": "UnlockMiracle",
|
||||||
"miraclesToUnlock": [ "orbital_calculations", "construct_vessel_frame", "launch_ark" ]
|
"miraclesToUnlock": ["orbital_calculations", "construct_vessel_frame"]
|
||||||
},
|
},
|
||||||
{ "type": "DestroySelf" }
|
{ "type": "DestroySelf" }
|
||||||
]
|
]
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
"gods_endurance",
|
"gods_endurance",
|
||||||
"geological_survey",
|
"geological_survey",
|
||||||
"divine_mandate",
|
"divine_mandate",
|
||||||
|
"craftsmanship",
|
||||||
"unlock_age_of_industry"
|
"unlock_age_of_industry"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@@ -17,9 +17,14 @@ public class GameLogic
|
|||||||
var faithMultiplier = state.ActiveBuffs
|
var faithMultiplier = state.ActiveBuffs
|
||||||
.Where(b => b.TargetStat == Stat.FaithPerFollower)
|
.Where(b => b.TargetStat == Stat.FaithPerFollower)
|
||||||
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
|
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
|
||||||
var productionMultiplier = state.ActiveBuffs
|
|
||||||
|
var productionFollowerMultiplier = state.ActiveBuffs
|
||||||
|
.Where(b => b.TargetStat == Stat.ProductionPerFollower)
|
||||||
|
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
|
||||||
|
var productionFlatMultiplier = state.ActiveBuffs
|
||||||
.Where(b => b.TargetStat == Stat.ProductionPerSecond)
|
.Where(b => b.TargetStat == Stat.ProductionPerSecond)
|
||||||
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
|
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
|
||||||
|
|
||||||
var followerMultiplier = state.ActiveBuffs
|
var followerMultiplier = state.ActiveBuffs
|
||||||
.Where(b => b.TargetStat == Stat.FollowersPerSecond)
|
.Where(b => b.TargetStat == Stat.FollowersPerSecond)
|
||||||
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
|
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
|
||||||
@@ -28,12 +33,16 @@ public class GameLogic
|
|||||||
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
|
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
|
||||||
|
|
||||||
var faithPerSecond = state.Get(Stat.Followers) * state.Get(Stat.FaithPerFollower) * faithMultiplier;
|
var faithPerSecond = state.Get(Stat.Followers) * state.Get(Stat.FaithPerFollower) * faithMultiplier;
|
||||||
var productionPerSecond = state.Get(Stat.ProductionPerSecond) * productionMultiplier;
|
|
||||||
|
var productionFromFollowers = state.Get(Stat.Followers) * state.Get(Stat.ProductionPerFollower) * productionFollowerMultiplier;
|
||||||
|
var productionFromIndustry = state.Get(Stat.ProductionPerSecond) * productionFlatMultiplier;
|
||||||
|
var totalProductionPerSecond = productionFromFollowers + productionFromIndustry;
|
||||||
|
|
||||||
var followersPerSecond = state.Get(Stat.FollowersPerSecond) * followerMultiplier;
|
var followersPerSecond = state.Get(Stat.FollowersPerSecond) * followerMultiplier;
|
||||||
var corruptionPerSecond = state.Get(Stat.CorruptionPerSecond) * corruptionMultiplier;
|
var corruptionPerSecond = state.Get(Stat.CorruptionPerSecond) * corruptionMultiplier;
|
||||||
|
|
||||||
state.Modify(Stat.Faith, faithPerSecond * delta);
|
state.Modify(Stat.Faith, faithPerSecond * delta);
|
||||||
state.Modify(Stat.Production, productionPerSecond * delta);
|
state.Modify(Stat.Production, totalProductionPerSecond * delta);
|
||||||
state.Modify(Stat.Corruption, corruptionPerSecond * delta);
|
state.Modify(Stat.Corruption, corruptionPerSecond * delta);
|
||||||
state.Modify(Stat.Followers, followersPerSecond * delta);
|
state.Modify(Stat.Followers, followersPerSecond * delta);
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@ public class GameState
|
|||||||
Set(Stat.ProductionPerSecond, 0.0);
|
Set(Stat.ProductionPerSecond, 0.0);
|
||||||
Set(Stat.CorruptionPerSecond, 0.01);
|
Set(Stat.CorruptionPerSecond, 0.01);
|
||||||
Set(Stat.FollowersPerSecond, 0);
|
Set(Stat.FollowersPerSecond, 0);
|
||||||
|
Set(Stat.ProductionPerFollower, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double Get(Stat stat) => _stats[stat].Value;
|
public double Get(Stat stat) => _stats[stat].Value;
|
||||||
|
@@ -14,5 +14,6 @@ public enum Stat
|
|||||||
FollowersPerSecond,
|
FollowersPerSecond,
|
||||||
|
|
||||||
// Modifying Stats
|
// Modifying Stats
|
||||||
FaithPerFollower
|
FaithPerFollower,
|
||||||
|
ProductionPerFollower,
|
||||||
}
|
}
|
Reference in New Issue
Block a user