Skip to content

Commit

Permalink
4.5.3: Fix problems like item costs not updating from config; add hig…
Browse files Browse the repository at this point in the history
…hest upgrade to Joyce axe
  • Loading branch information
jpw1991 committed Jul 5, 2024
1 parent 89d1fb4 commit 6f53ea3
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 193 deletions.
9 changes: 8 additions & 1 deletion ChebsMythicalWeapons/ChebsMythicalWeapons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal class ChebsMythicalWeapons : BaseUnityPlugin
{
public const string PluginGuid = "com.chebgonaz.chebsmythicalweapons";
public const string PluginName = "ChebsMythicalWeapons";
public const string PluginVersion = "4.5.2";
public const string PluginVersion = "4.5.3";

private const string ConfigFileName = PluginGuid + ".cfg";
private static readonly string ConfigFileFullPath = Path.Combine(Paths.ConfigPath, ConfigFileName);
Expand Down Expand Up @@ -103,12 +103,19 @@ private void ReadConfigValues()
if (adminOrLocal) Config.Reload();
// apply new values from config to the weapons
Aegis.UpdateItemValues();
Aegis.UpdateRecipe();
ApolloBow.UpdateItemValues();
ApolloBow.UpdateRecipe();
BladeOfOlympus.UpdateItemValues();
BladeOfOlympus.UpdateRecipe();
Excalibur.UpdateItemValues();
Excalibur.UpdateRecipe();
GreatswordOfOlympus.UpdateItemValues();
GreatswordOfOlympus.UpdateRecipe();
Joyce.UpdateItemValues();
Joyce.UpdateRecipe();
SunArrow.UpdateItemValues();
SunArrow.UpdateRecipe();
// update whatever stuff the player's currently got equipped/in inventory
UpdateItemsInScene();
}
Expand Down
2 changes: 1 addition & 1 deletion ChebsMythicalWeapons/ChebsMythicalWeapons.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<Guid>e3243d22-4307-4008-ba36-9f326008cde5</Guid>

<!-- Version Information -->
<Version>4.5.2.0</Version>
<Version>4.5.3.0</Version>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>

Expand Down
22 changes: 9 additions & 13 deletions ChebsMythicalWeapons/Items/AegisItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,8 @@ public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixRe
return null;
}

var itemDataShared = customItem.ItemDrop.m_itemData.m_shared;

itemDataShared.m_maxQuality = 5;

#region ShieldSettings

itemDataShared.m_blockPower = BlockPower.Value; // block force
itemDataShared.m_blockPowerPerLevel = BlockPowerPerLevel.Value;
itemDataShared.m_deflectionForce = DeflectionForce.Value;
itemDataShared.m_deflectionForcePerLevel = DeflectionForcePerLevel.Value;

#endregion
var shared = customItem.ItemDrop.m_itemData.m_shared;
SetItemDataShared(ref shared);

return customItem;
}
Expand All @@ -124,7 +114,13 @@ public void UpdateItemValues()

var item = prefab.GetComponent<ItemDrop>();
var shared = item.m_itemData.m_shared;

SetItemDataShared(ref shared);
}

private void SetItemDataShared(ref ItemDrop.ItemData.SharedData shared)
{
shared.m_maxQuality = 5;

#region ShieldSettings

shared.m_blockPower = BlockPower.Value; // block force
Expand Down
52 changes: 20 additions & 32 deletions ChebsMythicalWeapons/Items/ApolloBowItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,26 +107,8 @@ public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixRe
return null;
}

var itemDataShared = customItem.ItemDrop.m_itemData.m_shared;

itemDataShared.m_maxQuality = 5;

#region AttackSettings

itemDataShared.m_attackForce = Knockback.Value;
itemDataShared.m_backstabBonus = BackstabBonus.Value;
itemDataShared.m_damages.m_pierce = PiercingDamage.Value;
itemDataShared.m_damages.m_fire = FireDamage.Value;
itemDataShared.m_damagesPerLevel.m_pierce = BonusPiercingDamagePerLevel.Value;
itemDataShared.m_damagesPerLevel.m_fire = BonusFireDamagePerLevel.Value;

itemDataShared.m_attack.m_projectileVel = ProjectileVelocity.Value;
itemDataShared.m_attack.m_projectileVelMin = ProjectileVelocityMin.Value;

itemDataShared.m_attack.m_projectileAccuracy = ProjectileAccuracy.Value;
itemDataShared.m_attack.m_projectileAccuracyMin = ProjectileAccuracyMin.Value;

#endregion
var shared = customItem.ItemDrop.m_itemData.m_shared;
SetItemDataShared(ref shared);

return customItem;
}
Expand All @@ -141,22 +123,28 @@ public void UpdateItemValues()
}

var item = prefab.GetComponent<ItemDrop>();
var itemDataShared = item.m_itemData.m_shared;

var shared = item.m_itemData.m_shared;
SetItemDataShared(ref shared);
}

private void SetItemDataShared(ref ItemDrop.ItemData.SharedData shared)
{
shared.m_maxQuality = 5;

#region AttackSettings

itemDataShared.m_attackForce = Knockback.Value;
itemDataShared.m_backstabBonus = BackstabBonus.Value;
itemDataShared.m_damages.m_pierce = PiercingDamage.Value;
itemDataShared.m_damages.m_fire = FireDamage.Value;
itemDataShared.m_damagesPerLevel.m_pierce = BonusPiercingDamagePerLevel.Value;
itemDataShared.m_damagesPerLevel.m_fire = BonusFireDamagePerLevel.Value;
shared.m_attackForce = Knockback.Value;
shared.m_backstabBonus = BackstabBonus.Value;
shared.m_damages.m_pierce = PiercingDamage.Value;
shared.m_damages.m_fire = FireDamage.Value;
shared.m_damagesPerLevel.m_pierce = BonusPiercingDamagePerLevel.Value;
shared.m_damagesPerLevel.m_fire = BonusFireDamagePerLevel.Value;

itemDataShared.m_attack.m_projectileVel = ProjectileVelocity.Value;
itemDataShared.m_attack.m_projectileVelMin = ProjectileVelocityMin.Value;
shared.m_attack.m_projectileVel = ProjectileVelocity.Value;
shared.m_attack.m_projectileVelMin = ProjectileVelocityMin.Value;

itemDataShared.m_attack.m_projectileAccuracy = ProjectileAccuracy.Value;
itemDataShared.m_attack.m_projectileAccuracyMin = ProjectileAccuracyMin.Value;
shared.m_attack.m_projectileAccuracy = ProjectileAccuracy.Value;
shared.m_attack.m_projectileAccuracyMin = ProjectileAccuracyMin.Value;

#endregion
}
Expand Down
53 changes: 20 additions & 33 deletions ChebsMythicalWeapons/Items/BladeOfOlympusItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,8 @@ public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixRe
return null;
}

var itemDataShared = customItem.ItemDrop.m_itemData.m_shared;

#region AttackSettings

itemDataShared.m_attackForce = Knockback.Value;
itemDataShared.m_backstabBonus = BackstabBonus.Value;
itemDataShared.m_damages.m_slash = SlashDamage.Value;
itemDataShared.m_damages.m_lightning = LightningDamage.Value;
itemDataShared.m_damagesPerLevel.m_slash = BonusSlashDamagePerLevel.Value;
itemDataShared.m_damagesPerLevel.m_lightning = BonusLightningDamagePerLevel.Value;

#endregion

#region ShieldSettings

itemDataShared.m_blockPower = BlockPower.Value; // block force
itemDataShared.m_blockPowerPerLevel = BlockPowerPerLevel.Value;
itemDataShared.m_deflectionForce = DeflectionForce.Value;
itemDataShared.m_deflectionForcePerLevel = DeflectionForcePerLevel.Value;

#endregion
var shared = customItem.ItemDrop.m_itemData.m_shared;
SetItemDataShared(ref shared);

return customItem;
}
Expand All @@ -174,25 +155,31 @@ public void UpdateItemValues()
}

var item = prefab.GetComponent<ItemDrop>();
var itemDataShared = item.m_itemData.m_shared;

var shared = item.m_itemData.m_shared;
SetItemDataShared(ref shared);
}

private void SetItemDataShared(ref ItemDrop.ItemData.SharedData shared)
{
shared.m_maxQuality = 5;

#region AttackSettings

itemDataShared.m_attackForce = Knockback.Value;
itemDataShared.m_backstabBonus = BackstabBonus.Value;
itemDataShared.m_damages.m_slash = SlashDamage.Value;
itemDataShared.m_damages.m_lightning = LightningDamage.Value;
itemDataShared.m_damagesPerLevel.m_slash = BonusSlashDamagePerLevel.Value;
itemDataShared.m_damagesPerLevel.m_lightning = BonusLightningDamagePerLevel.Value;
shared.m_attackForce = Knockback.Value;
shared.m_backstabBonus = BackstabBonus.Value;
shared.m_damages.m_slash = SlashDamage.Value;
shared.m_damages.m_lightning = LightningDamage.Value;
shared.m_damagesPerLevel.m_slash = BonusSlashDamagePerLevel.Value;
shared.m_damagesPerLevel.m_lightning = BonusLightningDamagePerLevel.Value;

#endregion

#region ShieldSettings

itemDataShared.m_blockPower = BlockPower.Value; // block force
itemDataShared.m_blockPowerPerLevel = BlockPowerPerLevel.Value;
itemDataShared.m_deflectionForce = DeflectionForce.Value;
itemDataShared.m_deflectionForcePerLevel = DeflectionForcePerLevel.Value;
shared.m_blockPower = BlockPower.Value; // block force
shared.m_blockPowerPerLevel = BlockPowerPerLevel.Value;
shared.m_deflectionForce = DeflectionForce.Value;
shared.m_deflectionForcePerLevel = DeflectionForcePerLevel.Value;

#endregion
}
Expand Down
33 changes: 9 additions & 24 deletions ChebsMythicalWeapons/Items/ExcaliburItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,29 +102,8 @@ public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixRe
return null;
}

var itemDataShared = customItem.ItemDrop.m_itemData.m_shared;

itemDataShared.m_maxQuality = 5;

#region AttackSettings

itemDataShared.m_attackForce = Knockback.Value;
itemDataShared.m_backstabBonus = BackstabBonus.Value;
itemDataShared.m_damages.m_slash = SlashDamage.Value;
itemDataShared.m_damages.m_spirit = SpiritDamage.Value;
itemDataShared.m_damagesPerLevel.m_slash = BonusSlashDamagePerLevel.Value;
itemDataShared.m_damagesPerLevel.m_spirit = BonusSpiritDamagePerLevel.Value;

#endregion

#region ShieldSettings

itemDataShared.m_blockPower = BlockPower.Value; // block force
itemDataShared.m_blockPowerPerLevel = BlockPowerPerLevel.Value;
itemDataShared.m_deflectionForce = DeflectionForce.Value;
itemDataShared.m_deflectionForcePerLevel = DeflectionForcePerLevel.Value;

#endregion
var shared = customItem.ItemDrop.m_itemData.m_shared;
SetItemDataShared(ref shared);

return customItem;
}
Expand All @@ -140,7 +119,13 @@ public void UpdateItemValues()

var item = prefab.GetComponent<ItemDrop>();
var shared = item.m_itemData.m_shared;

SetItemDataShared(ref shared);
}

private void SetItemDataShared(ref ItemDrop.ItemData.SharedData shared)
{
shared.m_maxQuality = 5;

#region AttackSettings

shared.m_attackForce = Knockback.Value;
Expand Down
55 changes: 21 additions & 34 deletions ChebsMythicalWeapons/Items/GreatswordOfOlympusItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,28 +138,9 @@ public override CustomItem GetCustomItemFromPrefab(GameObject prefab, bool fixRe
Logger.LogError($"GetCustomItemFromPrefab: {PrefabName}'s ItemPrefab is null!");
return null;
}

var itemDataShared = customItem.ItemDrop.m_itemData.m_shared;

#region AttackSettings

itemDataShared.m_attackForce = Knockback.Value;
itemDataShared.m_backstabBonus = BackstabBonus.Value;
itemDataShared.m_damages.m_slash = SlashDamage.Value;
itemDataShared.m_damages.m_lightning = LightningDamage.Value;
itemDataShared.m_damagesPerLevel.m_slash = BonusSlashDamagePerLevel.Value;
itemDataShared.m_damagesPerLevel.m_lightning = BonusLightningDamagePerLevel.Value;

#endregion

#region ShieldSettings

itemDataShared.m_blockPower = BlockPower.Value; // block force
itemDataShared.m_blockPowerPerLevel = BlockPowerPerLevel.Value;
itemDataShared.m_deflectionForce = DeflectionForce.Value;
itemDataShared.m_deflectionForcePerLevel = DeflectionForcePerLevel.Value;

#endregion

var shared = customItem.ItemDrop.m_itemData.m_shared;
SetItemDataShared(ref shared);

return customItem;
}
Expand All @@ -174,25 +155,31 @@ public void UpdateItemValues()
}

var item = prefab.GetComponent<ItemDrop>();
var itemDataShared = item.m_itemData.m_shared;

var shared = item.m_itemData.m_shared;
SetItemDataShared(ref shared);
}

private void SetItemDataShared(ref ItemDrop.ItemData.SharedData shared)
{
shared.m_maxQuality = 5;

#region AttackSettings

itemDataShared.m_attackForce = Knockback.Value;
itemDataShared.m_backstabBonus = BackstabBonus.Value;
itemDataShared.m_damages.m_slash = SlashDamage.Value;
itemDataShared.m_damages.m_lightning = LightningDamage.Value;
itemDataShared.m_damagesPerLevel.m_slash = BonusSlashDamagePerLevel.Value;
itemDataShared.m_damagesPerLevel.m_lightning = BonusLightningDamagePerLevel.Value;
shared.m_attackForce = Knockback.Value;
shared.m_backstabBonus = BackstabBonus.Value;
shared.m_damages.m_slash = SlashDamage.Value;
shared.m_damages.m_lightning = LightningDamage.Value;
shared.m_damagesPerLevel.m_slash = BonusSlashDamagePerLevel.Value;
shared.m_damagesPerLevel.m_lightning = BonusLightningDamagePerLevel.Value;

#endregion

#region ShieldSettings

itemDataShared.m_blockPower = BlockPower.Value; // block force
itemDataShared.m_blockPowerPerLevel = BlockPowerPerLevel.Value;
itemDataShared.m_deflectionForce = DeflectionForce.Value;
itemDataShared.m_deflectionForcePerLevel = DeflectionForcePerLevel.Value;
shared.m_blockPower = BlockPower.Value; // block force
shared.m_blockPowerPerLevel = BlockPowerPerLevel.Value;
shared.m_deflectionForce = DeflectionForce.Value;
shared.m_deflectionForcePerLevel = DeflectionForcePerLevel.Value;

#endregion
}
Expand Down
Loading

0 comments on commit 6f53ea3

Please sign in to comment.