Merge branch 'main' into race-chains-and-stations
# Conflicts: # JotunnModStub/Aswid/AswidRace.cs # JotunnModStub/Factions/FactionHostilityPatch.cs # JotunnModStub/Factions/FactionMerchantCatalog.cs # JotunnModStub/Furling/FurlingPatches.cs
This commit is contained in:
commit
f60b8d8f7d
48 changed files with 1865 additions and 380 deletions
|
|
@ -102,9 +102,9 @@ namespace RacesOfValheim
|
|||
}
|
||||
|
||||
ItemDrop itemDrop = customWep.ItemPrefab.GetComponent<ItemDrop>();
|
||||
itemDrop.m_itemData.m_shared.m_maxDurability = 6f;
|
||||
itemDrop.m_itemData.m_shared.m_maxDurability = TrolConfig.LogWeaponMaxDurability.Value;
|
||||
itemDrop.m_itemData.m_shared.m_useDurability = true;
|
||||
itemDrop.m_itemData.m_shared.m_useDurabilityDrain = 1f;
|
||||
itemDrop.m_itemData.m_shared.m_useDurabilityDrain = TrolConfig.LogWeaponDurabilityDrainPerHit.Value;
|
||||
itemDrop.m_itemData.m_shared.m_destroyBroken = false;
|
||||
itemDrop.m_itemData.m_shared.m_weight = 0f;
|
||||
itemDrop.m_itemData.m_shared.m_equipDuration = 0.1f;
|
||||
|
|
@ -125,15 +125,20 @@ namespace RacesOfValheim
|
|||
|
||||
if (RaceInput.Allowed)
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.G))
|
||||
if (TrolConfig.ThrowRockKey.Value.IsDown())
|
||||
{
|
||||
TryThrowRock();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.H))
|
||||
if (TrolConfig.TrueFormKey.Value.IsDown())
|
||||
{
|
||||
TryTrueForm();
|
||||
}
|
||||
|
||||
if (TrolConfig.GrabLogKey.Value.IsDown())
|
||||
{
|
||||
TryGrabLog();
|
||||
}
|
||||
}
|
||||
|
||||
// Check log durability
|
||||
|
|
@ -180,18 +185,9 @@ namespace RacesOfValheim
|
|||
|
||||
if (Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode()))
|
||||
{
|
||||
if (BossProgressionManager.GetCurrentProgressionState() >= 7)
|
||||
{
|
||||
GameObject hoverObj = Player.m_localPlayer.GetHoverObject();
|
||||
if (hoverObj != null)
|
||||
{
|
||||
TreeLog log = hoverObj.GetComponentInParent<TreeLog>();
|
||||
if (log != null)
|
||||
{
|
||||
TrolLogWeapon.GrabLog(Player.m_localPlayer, log);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Grabbing a log now has its own key (TrolConfig.GrabLogKey, see TryGrabLog) -
|
||||
// pressing True Form again while already transformed no longer tries to grab
|
||||
// whatever you happen to be looking at.
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -209,6 +205,21 @@ namespace RacesOfValheim
|
|||
}
|
||||
}
|
||||
|
||||
private void TryGrabLog()
|
||||
{
|
||||
if (BossProgressionManager.GetCurrentProgressionState() < 7) return;
|
||||
if (!Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode())) return;
|
||||
|
||||
GameObject hoverObj = Player.m_localPlayer.GetHoverObject();
|
||||
if (hoverObj == null) return;
|
||||
|
||||
TreeLog log = hoverObj.GetComponentInParent<TreeLog>();
|
||||
if (log != null)
|
||||
{
|
||||
TrolLogWeapon.GrabLog(Player.m_localPlayer, log);
|
||||
}
|
||||
}
|
||||
|
||||
private System.Collections.IEnumerator TransformToTrueFormRoutine()
|
||||
{
|
||||
isTransforming = true;
|
||||
|
|
@ -221,7 +232,9 @@ namespace RacesOfValheim
|
|||
if (visual != null)
|
||||
{
|
||||
Vector3 startScale = visual.transform.localScale;
|
||||
float trueFormScale = BossProgressionManager.GetCurrentProgressionState() >= 7 ? 2.5f : 2.0f;
|
||||
float trueFormScale = BossProgressionManager.GetCurrentProgressionState() >= 7
|
||||
? TrolConfig.TrueFormScaleAdvanced.Value
|
||||
: TrolConfig.TrueFormScaleNormal.Value;
|
||||
Vector3 targetScale = new Vector3(trueFormScale, trueFormScale, trueFormScale);
|
||||
|
||||
while (elapsed < duration)
|
||||
|
|
@ -281,7 +294,7 @@ namespace RacesOfValheim
|
|||
private System.Collections.IEnumerator ThrowRockRoutine()
|
||||
{
|
||||
bool isTrueForm = Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode());
|
||||
float throwRockCooldown = isTrueForm ? 15f : 60f;
|
||||
float throwRockCooldown = isTrueForm ? TrolConfig.ThrowRockCooldownTrueForm.Value : TrolConfig.ThrowRockCooldown.Value;
|
||||
|
||||
var addedSE = Player.m_localPlayer.GetSEMan().AddStatusEffect("SE_TrolThrowRockCooldown".GetStableHashCode(), true);
|
||||
if (addedSE != null)
|
||||
|
|
@ -327,8 +340,8 @@ namespace RacesOfValheim
|
|||
|
||||
if (rb != null)
|
||||
{
|
||||
// 3x speed to compensate for log weight/drag
|
||||
rb.velocity = Player.m_localPlayer.GetLookDir() * 60f;
|
||||
// Compensates for log weight/drag
|
||||
rb.velocity = Player.m_localPlayer.GetLookDir() * TrolConfig.ThrowLogVelocity.Value;
|
||||
// Add some slight rotation tumbling
|
||||
rb.angularVelocity = new Vector3(10f, 5f, 0f);
|
||||
}
|
||||
|
|
@ -347,24 +360,24 @@ namespace RacesOfValheim
|
|||
if (proj != null)
|
||||
{
|
||||
HitData hitData = new HitData();
|
||||
hitData.m_damage.m_blunt = 25f; // Base troll rock
|
||||
|
||||
hitData.m_damage.m_blunt = TrolConfig.ThrowRockBaseDamage.Value;
|
||||
|
||||
if (BossProgressionManager.GetCurrentProgressionState() >= 4)
|
||||
{
|
||||
hitData.m_damage.m_blunt += 10f; // Bonemass bonus
|
||||
hitData.m_damage.m_blunt += TrolConfig.ThrowRockBonemassBonus.Value;
|
||||
}
|
||||
if (BossProgressionManager.GetCurrentProgressionState() >= 6)
|
||||
{
|
||||
hitData.m_damage.m_blunt += 5f; // Yagluth bonus
|
||||
hitData.m_damage.m_blunt += TrolConfig.ThrowRockYagluthBonus.Value;
|
||||
}
|
||||
|
||||
|
||||
if (isTrueForm)
|
||||
{
|
||||
hitData.m_damage.m_blunt += 40f; // True Form bonus
|
||||
hitData.m_damage.m_blunt += TrolConfig.ThrowRockTrueFormBonus.Value;
|
||||
}
|
||||
|
||||
hitData.SetAttacker(Player.m_localPlayer);
|
||||
proj.Setup(Player.m_localPlayer, Player.m_localPlayer.GetLookDir() * 20f, -1f, hitData, null, null);
|
||||
proj.Setup(Player.m_localPlayer, Player.m_localPlayer.GetLookDir() * TrolConfig.ThrowRockProjectileVelocity.Value, -1f, hitData, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue