Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d584c4e
Balance WIP
LamaMega Apr 1, 2025
7f47508
Item Classes Added
LamaMega Apr 9, 2025
06dcbbc
cleaned up the base ItemStat
Hazardu Apr 10, 2025
8a05452
Stat defintions update
Hazardu Apr 12, 2025
4e67724
ItemDefinitons WIP
LamaMega Apr 12, 2025
0f24b37
Merge branch 'pr/44' into rebalance
Hazardu Apr 12, 2025
6c94b54
Stat updates continue
Hazardu Apr 12, 2025
5abcde9
Moved Item Definitions
Hazardu Apr 12, 2025
d658d4b
Update ChampionsOfForest.csproj
Hazardu Apr 12, 2025
a3e8724
Finished rewriting item stats
Hazardu Apr 13, 2025
ffb63d9
Tweaked base item and item classes
Hazardu Apr 14, 2025
fb710de
ItemFilesWIP
LamaMega Apr 16, 2025
9d6daee
HazardsRequest
LamaMega Apr 16, 2025
f165a53
Cleaning up item loot distribution and network commands
Hazardu Apr 17, 2025
fba080d
Added a new option to cotf settings
Hazardu Apr 17, 2025
b4d3b36
Updated amulets
Hazardu Apr 18, 2025
64d9828
Updated Mod Settings
Hazardu Apr 18, 2025
771f81f
WIP
LamaMega Apr 19, 2025
ea7d520
Merge branch 'rebalance'
LamaMega Apr 19, 2025
2c55c88
Fixed namespaces, changed how rarity colors are stored
Hazardu Apr 19, 2025
bb2fd73
New loot explosion physics animation
Hazardu Apr 19, 2025
24cfa9e
Added new options for damage numbers
Hazardu Apr 19, 2025
deea7fb
Removed obsolete code for black flames
Hazardu Apr 19, 2025
1f084c2
Added Settings for keeping experience after death
Hazardu Apr 19, 2025
9ee0918
Fixed syncing of new settings to clients
Hazardu Apr 19, 2025
0258862
Removed obsolete isConsumable bool from items, now added consumable i…
Hazardu Apr 19, 2025
90cddfd
Removed obsolete code
Hazardu Apr 19, 2025
b4707f6
Increased default item weight to 1000, so its possible to make rarer …
Hazardu Apr 19, 2025
96cf981
Fixed some compile errors
Hazardu Apr 19, 2025
5ea19e1
Merge branch 'rebalance'
LamaMega Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
417 changes: 218 additions & 199 deletions ChampionsOfForest.csproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Configuration/DebugFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ partial void DrawDebug()
GUI.Label(r, $"Client distance = {Vector3.Distance(rulerEnd, LocalPlayer.Transform.position)}\nLineLen = {Vector3.Distance(rulerStart, rulerEnd)}");
}
}
if (PlayerInventoryMod.EquippedModel != BaseItem.WeaponModelType.None)
if (PlayerInventoryMod.EquippedModel != BaseItem.ItemSubtype.None)
{
GUI.Label(new Rect(600, 300, 500, 30), "Offset");
GUI.Label(new Rect(600, 330, 100, 30), PlayerInventoryMod.customWeapons[PlayerInventoryMod.EquippedModel].offset.x.ToString());
Expand Down
5 changes: 3 additions & 2 deletions Configuration/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using ChampionsOfForest.Effects.Sound_Effects;
using ChampionsOfForest.Enemies.EnemyAbilities;
using ChampionsOfForest.ExpSources;
using ChampionsOfForest.Items;
using ChampionsOfForest.Localization;
using ChampionsOfForest.Player;
using ChampionsOfForest.Player.Crafting;
Expand Down Expand Up @@ -37,7 +38,7 @@ public static void Initialize()
new GameObject("NetworkManagerObj").AddComponent<Network.NetworkManager>();
GameObject go = new GameObject("Playerobj");
go.AddComponent<ModReferences>();
ItemDataBase.Initialize();
ItemDatabase.Initialize();
EnemyManager.Initialize();
Network.NetworkManager.instance.onGetMessage += Network.CommandReader.OnCommand;
ExpEvents.Initialize();
Expand Down Expand Up @@ -83,7 +84,7 @@ public static void Initialize()
Network.CommandInitializer.Init();
CustomCrafting.Init();
BuffDB.FillBuffList();
ItemDataBase.Initialize();
ItemDatabase.Initialize();
SpellDataBase.Initialize();
EnemyManager.Initialize();
Network.NetworkManager.instance.onGetMessage += Network.CommandReader.OnCommand;
Expand Down
6 changes: 3 additions & 3 deletions DedicatedServer/COTFDS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public static void ReadDediServerConfig()
var difficultyRegex = new Regex(@"(?<=Difficulty=)\d+");
var friendlyFireRegex = new Regex(@"(?<=FriendlyFire=)\d+");

ModSettings.difficulty = (ModSettings.Difficulty)(int.Parse(difficultyRegex.Match(content).Value));
ModSettings.FriendlyFire = difficultyRegex.Match(content).Value == "1";
ModSettings.DifficultyChosen = true;
//ModSettings.difficulty = (ModSettings.GameDifficulty)(int.Parse(difficultyRegex.Match(content).Value));
//ModSettings.FriendlyFire = difficultyRegex.Match(content).Value == "1";
//ModSettings.DifficultyChosen = true;
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions Effects/Berserker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public static void OnEnable()
active = true;
ModdedPlayer.Stats.allDamage.Multiply(ModdedPlayer.Stats.spell_berserkDamage);
ModdedPlayer.Stats.attackSpeed.Multiply(ModdedPlayer.Stats.spell_berserkAttackSpeed);
ModdedPlayer.Stats.movementSpeed.Multiply(ModdedPlayer.Stats.spell_berserkMovementSpeed);
ModdedPlayer.Stats.maxHealthMult.Multiply(ModdedPlayer.Stats.spell_berserkMaxHP);
ModdedPlayer.Stats.mOVEMENT_SPEED.Multiply(ModdedPlayer.Stats.spell_berserkMOVEMENT_SPEED);
ModdedPlayer.Stats.maxLifeMult.Multiply(ModdedPlayer.Stats.spell_berserkMaxHP);

ModdedPlayer.Stats.allDamageTaken.Multiply(2f);
castTimestamp = Time.time;
Expand All @@ -35,8 +35,8 @@ public static void OnDisable()
active = false;
ModdedPlayer.Stats.allDamage.Divide(ModdedPlayer.Stats.spell_berserkDamage);
ModdedPlayer.Stats.attackSpeed.Divide(ModdedPlayer.Stats.spell_berserkAttackSpeed);
ModdedPlayer.Stats.movementSpeed.Divide(ModdedPlayer.Stats.spell_berserkMovementSpeed);
ModdedPlayer.Stats.maxHealthMult.Divide(ModdedPlayer.Stats.spell_berserkMaxHP);
ModdedPlayer.Stats.mOVEMENT_SPEED.Divide(ModdedPlayer.Stats.spell_berserkMOVEMENT_SPEED);
ModdedPlayer.Stats.maxLifeMult.Divide(ModdedPlayer.Stats.spell_berserkMaxHP);
ModdedPlayer.Stats.allDamageTaken.Divide( 2f);
if (ModdedPlayer.Stats.i_setcount_BerserkSet < 2)
BuffDB.AddBuff(18, 51, LocalPlayer.Stats.Energy, 15);
Expand Down
120 changes: 59 additions & 61 deletions Effects/BlackFlame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,73 @@ public class BlackFlame : MonoBehaviour
{
public static BlackFlame instance;
public static float DmgAmp = 1;
public static float FireDamageBonus => (30 + ModdedPlayer.Stats.spellFlatDmg / ModdedPlayer.Stats.spell_blackFlameDamageScaling) * ModdedPlayer.Stats.TotalMagicDamageMultiplier * DmgAmp / 3;
public static float FireDamageBonus => (30 + ModdedPlayer.Stats.baseSpellDamage / ModdedPlayer.Stats.spell_blackFlameDamageScaling) * ModdedPlayer.Stats.TotalMagicDamageMultiplier * DmgAmp / 3;

private static Material mat1;
private static Material mat2;
public static GameObject instanceLocalPlayer;
public static Component[] particleSystems;

public static bool IsOn = false;
public static float Cost = 20;

public static bool GiveDamageBuff;
public static bool GiveAfterburn;
public const float afterburn_duration = 20f,
afterburn_debuff_amount = 1.8f,
afterburn_chance = 0.10f;

private static Dictionary<Transform, GameObject> blackFlamesClients = new Dictionary<Transform, GameObject>();



public void Start()
{
StartCoroutine(StartCoroutine());
if (instance == null)
instance = this;
}

public IEnumerator StartCoroutine()
{
yield return null;
yield return null;
while (ModReferences.rightHandTransform == null)
{
yield return null;
LocalPlayer.Inventory?.SendMessage("GetRightHand");
}
yield return null;
if (instanceLocalPlayer == null)
{
var created = Create();
instanceLocalPlayer = created.item0;
particleSystems = created.item1;
instanceLocalPlayer.transform.position = ModReferences.rightHandTransform.position;
instanceLocalPlayer.transform.rotation = ModReferences.rightHandTransform.rotation;
instanceLocalPlayer.transform.parent = ModReferences.rightHandTransform;
instanceLocalPlayer.SetActive(false);
}
}

private void Update()
{
if (IsOn)
{
if (ModdedPlayer.Stats.perk_danceOfFiregod.value)
SpellCaster.RemoveStamina(Cost * 0.75f * Math.Max(LocalPlayer.Rigidbody.velocity.magnitude, 0.5f) * Time.deltaTime);
else
SpellCaster.RemoveStamina(Cost * Time.deltaTime);
if (LocalPlayer.Stats.Stamina < 5)
{
Toggle();
}
if (GiveDamageBuff)
{
BuffDB.AddBuff(9, 44, 1.33f, 1f);
}
}
}
public static STuple<GameObject, Component[]> Create()
{
AnimationCurve sizecurve = new AnimationCurve(new Keyframe(0, 0, 5.129462f, 5.129462f), new Keyframe(0.2449522f, 1, 0, 0), new Keyframe(1, 0, -1.242162f, -1.242162f));
Expand Down Expand Up @@ -100,57 +155,6 @@ public static STuple<GameObject, Component[]> Create()
return new STuple<GameObject, Component[]>(go, comps);
}

public static bool IsOn = false;
public static float Cost = 20;

public void Start()
{
StartCoroutine(StartCoroutine());
if (instance == null)
instance = this;
}

public IEnumerator StartCoroutine()
{
yield return null;
yield return null;
while (ModReferences.rightHandTransform == null)
{
yield return null;
LocalPlayer.Inventory?.SendMessage("GetRightHand");
}
yield return null;
if (instanceLocalPlayer == null)
{
var created = Create();
instanceLocalPlayer = created.item0;
particleSystems = created.item1;
instanceLocalPlayer.transform.position = ModReferences.rightHandTransform.position;
instanceLocalPlayer.transform.rotation = ModReferences.rightHandTransform.rotation;
instanceLocalPlayer.transform.parent = ModReferences.rightHandTransform;
instanceLocalPlayer.SetActive(false);
}
}

private void Update()
{
if (IsOn)
{
if (ModdedPlayer.Stats.perk_danceOfFiregod.value)
SpellCaster.RemoveStamina(Cost * 0.75f * Math.Max(LocalPlayer.Rigidbody.velocity.magnitude,0.5f) * Time.deltaTime);
else
SpellCaster.RemoveStamina(Cost * Time.deltaTime);
if (LocalPlayer.Stats.Stamina < 5)
{
Toggle();
}
if (GiveDamageBuff)
{
BuffDB.AddBuff(9, 44, 1.33f, 1f);
}
}
}

public static void Toggle()
{
IsOn = !IsOn;
Expand Down Expand Up @@ -187,18 +191,12 @@ public static void Toggle()
}
}

private static Dictionary<Transform, GameObject> blackFlamesClients = new Dictionary<Transform, GameObject>();

public static void ToggleOtherPlayer(string playerName, bool isOn)
{
//ModAPI.Console.Write("Toggling black flames for client " + playerName + isOn);
if (!ModReferences.PlayerHands.ContainsKey(playerName))
{
ModReferences.FindHands();
}
if (ModReferences.PlayerHands.ContainsKey(playerName))
var playerState = ModReferences.PlayerStates.GetPlayerState(playerName);
if (playerState.hand != null)
{
Transform t = ModReferences.PlayerHands[playerName];
Transform t = playerState.hand;
if (blackFlamesClients.ContainsKey(t))
{
blackFlamesClients[t].SetActive(isOn);
Expand Down
14 changes: 5 additions & 9 deletions Effects/BlackHole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private IEnumerator Start()
{
AudioSource source = gameObject.AddComponent<AudioSource>();
source.clip = Res.ResourceLoader.instance.LoadedAudio[1000];
source.volume = 16;
source.volume = 5;
source.spatialBlend = 1f;
source.rolloffMode = AudioRolloffMode.Linear;
source.maxDistance = 150f;
Expand Down Expand Up @@ -203,12 +203,9 @@ private IEnumerator HitEverySecond()
}
while (FromEnemy)
{
if ((LocalPlayer.Transform.position - transform.position).sqrMagnitude < scale * 4 * scale * 4)
if ((LocalPlayer.Transform.position - transform.position).sqrMagnitude < scale * scale * 2)
{
if (Random.value <= ModdedPlayer.Stats.getHitChance)
LocalPlayer.Stats.HealthChange(-damage * ModdedPlayer.Stats.allDamageTaken * ModdedPlayer.Stats.magicDamageTaken * 0.5f);
else
COTFEvents.Instance.OnDodge.Invoke();
LocalPlayer.Stats.HealthChange(-damage * ModdedPlayer.Stats.allDamageTaken * ModdedPlayer.Stats.damageFromElites * 0.5f);
yield return new WaitForSeconds(0.5f);
}
else
Expand All @@ -224,9 +221,8 @@ private IEnumerator HitEnemies()
{
if (t.Value != null)
{
t.Value.HitMagic(damage);
yield return null;

t.Value.HitMagic(damage);
yield return null;
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions Effects/Cataclysm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static void AssignPrefabs()
}
catch (Exception e)
{
CotfUtils.Log("Assign Prefabs error " + e.Message);
Utils.Log("Assign Prefabs error " + e.Message);
}
}

Expand All @@ -50,11 +50,11 @@ public static void Create(Vector3 position, float radius, float damage, float du
c.duration = duration;
c.isFromEnemy = isFromEnemy;
c.isArcane = tornadoType == TornadoType.Arcane;
CotfUtils.Log("Created cataclysm");
Utils.Log("Created cataclysm");
}
catch (Exception e)
{
CotfUtils.Log("Creating cataclysm error " + e.Message);
Utils.Log("Creating cataclysm error " + e.Message);
}
}

Expand Down Expand Up @@ -82,12 +82,12 @@ private void Start()
particleParent = transform.GetChild(1).gameObject;
particleParent.SetActive(false);
Invoke("EnableParticles", 2);
CotfUtils.Log("start cataclysm");
Utils.Log("start cataclysm");
dmg = (int)damage;
}
catch (Exception e)
{
CotfUtils.Log("Start cataclysm error " + e.Message);
Utils.Log("Start cataclysm error " + e.Message);
}
}

Expand All @@ -98,11 +98,11 @@ private void EnableParticles()
particleParent.SetActive(true);
warmUpDone = true;
Invoke("End", duration);
CotfUtils.Log("enabled particles cataclysm");
Utils.Log("enabled particles cataclysm");
}
catch (Exception e)
{
CotfUtils.Log("Enabling particles cataclysm error " + e.Message);
Utils.Log("Enabling particles cataclysm error " + e.Message);
}
}

Expand Down Expand Up @@ -176,7 +176,7 @@ private void SendHitFromEnemy()
float sqrMagnitude = (LocalPlayer.Transform.position - transform.position).sqrMagnitude;
if (sqrMagnitude < radius * radius)
{
int dmg = (int)(damage * (1 - ModdedPlayer.Stats.magicDamageTaken));
int dmg = (int)(damage * (ModdedPlayer.Stats.damageFromElites));

if (isArcane)
{
Expand All @@ -192,7 +192,7 @@ private void SendHitFromEnemy()
BuffDB.AddBuff(2, 65, 0.7f, 6);
LocalPlayer.Stats.Burn();
}
LocalPlayer.Stats.Hit((int)(dmg * (1 - ModdedPlayer.Stats.magicDamageTaken)), false, PlayerStats.DamageType.Drowning);
LocalPlayer.Stats.Hit((int)(dmg * (ModdedPlayer.Stats.damageFromElites)), false, PlayerStats.DamageType.Drowning);
}
}

Expand All @@ -210,7 +210,7 @@ private void End()
}
catch (Exception e)
{
CotfUtils.Log("End cataclysm error " + e.Message);
Utils.Log("End cataclysm error " + e.Message);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Effects/Flare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private void Update()
{
if (Random.value <= ModdedPlayer.Stats.getHitChance)
{
LocalPlayer.Stats.HealthChange(-damageAmount * Time.deltaTime * ( ModdedPlayer.Stats.magicDamageTaken) * ModdedPlayer.Stats.allDamageTaken);
LocalPlayer.Stats.HealthChange(-damageAmount * Time.deltaTime * ( ModdedPlayer.Stats.damageFromElites) * ModdedPlayer.Stats.allDamageTaken);
BuffDB.AddBuff(1, 5, slowAmount, 20);
LocalPlayer.Stats.Burn();
}
Expand Down
4 changes: 2 additions & 2 deletions Effects/Gold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public static void Enable()
public static void Disable()
{
renderer.material = originalMaterial;
ModdedPlayer.Stats.stunImmunity.Substract(1);
ModdedPlayer.Stats.debuffResistance.Substract(1);
ModdedPlayer.Stats.stunImmunity.Sub(1);
ModdedPlayer.Stats.debuffResistance.Sub(1);

ModdedPlayer.Stats.attackSpeed .Divide( 1.2f);
if (ModdedPlayer.Stats.perk_goldenResolve)
Expand Down
2 changes: 1 addition & 1 deletion Effects/RealisticBlackHoleEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void Awake()
}
catch (System.Exception e)
{
CotfUtils.Log(e.ToString());
Utils.Log(e.ToString());
}
}

Expand Down
Loading