summaryrefslogtreecommitdiff
path: root/Valheim_r202102_v0.141.2/Valheim/assembly_valheim/RuneStone.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Valheim_r202102_v0.141.2/Valheim/assembly_valheim/RuneStone.cs')
-rw-r--r--Valheim_r202102_v0.141.2/Valheim/assembly_valheim/RuneStone.cs83
1 files changed, 0 insertions, 83 deletions
diff --git a/Valheim_r202102_v0.141.2/Valheim/assembly_valheim/RuneStone.cs b/Valheim_r202102_v0.141.2/Valheim/assembly_valheim/RuneStone.cs
deleted file mode 100644
index c245a30..0000000
--- a/Valheim_r202102_v0.141.2/Valheim/assembly_valheim/RuneStone.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class RuneStone : MonoBehaviour, Hoverable, Interactable
-{
- [Serializable]
- public class RandomRuneText
- {
- public string m_topic = "";
-
- public string m_label = "";
-
- public string m_text = "";
- }
-
- public string m_name = "Rune stone";
-
- public string m_topic = "";
-
- public string m_label = "";
-
- public string m_text = "";
-
- public List<RandomRuneText> m_randomTexts;
-
- public string GetHoverText()
- {
- return Localization.instance.Localize(m_name + "\n[<color=yellow><b>$KEY_Use</b></color>] $piece_rune_read");
- }
-
- public string GetHoverName()
- {
- return m_name;
- }
-
- public bool Interact(Humanoid character, bool hold)
- {
- if (hold)
- {
- return false;
- }
- Player player = character as Player;
- RandomRuneText randomText = GetRandomText();
- if (randomText != null)
- {
- if (randomText.m_label.Length > 0)
- {
- player.AddKnownText(randomText.m_label, randomText.m_text);
- }
- TextViewer.instance.ShowText(TextViewer.Style.Rune, randomText.m_topic, randomText.m_text, autoHide: true);
- }
- else
- {
- if (m_label.Length > 0)
- {
- player.AddKnownText(m_label, m_text);
- }
- TextViewer.instance.ShowText(TextViewer.Style.Rune, m_topic, m_text, autoHide: true);
- }
- return false;
- }
-
- public bool UseItem(Humanoid user, ItemDrop.ItemData item)
- {
- return false;
- }
-
- private RandomRuneText GetRandomText()
- {
- if (m_randomTexts.Count == 0)
- {
- return null;
- }
- Vector3 position = base.transform.position;
- int seed = (int)position.x * (int)position.z;
- UnityEngine.Random.State state = UnityEngine.Random.state;
- UnityEngine.Random.InitState(seed);
- RandomRuneText result = m_randomTexts[UnityEngine.Random.Range(0, m_randomTexts.Count)];
- UnityEngine.Random.state = state;
- return result;
- }
-}