Add new miracles: Divine Mandate and Prosperity Boom; update buff application logic and game state calculations

This commit is contained in:
2025-08-23 18:47:42 +02:00
parent 8ae0e7e80c
commit 0fbd49f36a
10 changed files with 76 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Linq;
using ParasiticGod.Scripts.Singletons;
namespace ParasiticGod.Scripts.Core;
@@ -12,12 +13,29 @@ public class GameLogic
{
totalMultiplier *= buff.Multiplier;
}
var faithPerSecond = state.Get(Stat.Followers) * state.Get(Stat.FaithPerFollower) * totalMultiplier;
var faithMultiplier = state.ActiveBuffs
.Where(b => b.TargetStat == Stat.FaithPerFollower)
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
var productionMultiplier = state.ActiveBuffs
.Where(b => b.TargetStat == Stat.ProductionPerSecond)
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
var followerMultiplier = state.ActiveBuffs
.Where(b => b.TargetStat == Stat.FollowersPerSecond)
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
var corruptionMultiplier = state.ActiveBuffs
.Where(b => b.TargetStat == Stat.CorruptionPerSecond)
.Aggregate(1.0f, (acc, buff) => acc * buff.Multiplier);
var faithPerSecond = state.Get(Stat.Followers) * state.Get(Stat.FaithPerFollower) * faithMultiplier;
var productionPerSecond = state.Get(Stat.ProductionPerSecond) * productionMultiplier;
var followersPerSecond = state.Get(Stat.FollowersPerSecond) * followerMultiplier;
var corruptionPerSecond = state.Get(Stat.CorruptionPerSecond) * corruptionMultiplier;
state.Modify(Stat.Faith, faithPerSecond * delta);
state.Modify(Stat.Production, state.Get(Stat.ProductionPerSecond) * delta);
state.Modify(Stat.Corruption, state.Get(Stat.CorruptionPerSecond) * delta);
state.Modify(Stat.Followers, state.Get(Stat.FollowersPerSecond) * delta);
state.Modify(Stat.Production, productionPerSecond * delta);
state.Modify(Stat.Corruption, corruptionPerSecond * delta);
state.Modify(Stat.Followers, followersPerSecond * delta);
for (var i = state.ActiveBuffs.Count - 1; i >= 0; i--)
{