public void LearnSpell(SpellBookSpell spellEntry) { if (spellEntry.Cost > Points) { return; } points -= spellEntry.Cost; var player = netTab.LastInteractedPlayer(); var playerScript = player.GetComponent <PlayerScript>(); var spell = spellEntry.Spell.AddToPlayer(playerScript); var mind = playerScript.mind; mind.AddSpell(spell); }
public void LearnSpell(SpellBookSpell spellEntry) { if (spellEntry.Cost > Points) { return; } points -= spellEntry.Cost; var player = netTab.LastInteractedPlayer().Player(); SoundManager.PlayNetworkedAtPos("Blind", player.Script.WorldPos, sourceObj: player.GameObject); Chat.AddChatMsgToChat(player, spellEntry.Incantation, ChatChannel.Local); Spell spell = spellEntry.Spell.AddToPlayer(player.Script); player.Script.mind.AddSpell(spell); }
private void LearnSpell(ConnectedPlayer player, SpellBookSpell spellEntry) { points -= spellEntry.Cost; SoundManager.PlayNetworkedAtPos(learningSound, player.Script.WorldPos, sourceObj: player.GameObject); Chat.AddChatMsgToChat(player, spellEntry.Incantation, ChatChannel.Local, Loudness.SCREAMING); Spell spellInstance = player.Script.mind.GetSpellInstance(spellEntry.Spell); if (spellInstance != null) { spellInstance.UpgradeTier(); } else { Spell spell = spellEntry.Spell.AddToPlayer(player.Script); player.Script.mind.AddSpell(spell); } }
private void SetSpellValues(SpellBookSpell spellEntry) { Spell readerSpell = bookGUI.GetReaderSpellInstance(spellEntry.Spell); if (readerSpell == null) { spellLabel.SetValueServer(spellEntry.Name); cooldownLabel.SetValueServer($"Cooldown: {spellEntry.Spell.CooldownTime}"); buttonLabel.SetValueServer("Learn"); } else { spellLabel.SetValueServer($"{spellEntry.Name} {readerSpell.CurrentTier + 1}"); cooldownLabel.SetValueServer("Cooldown: " + (readerSpell.CooldownTime - (readerSpell.CooldownTime * spellEntry.Spell.CooldownModifier)).ToString("G2")); buttonLabel.SetValueServer("Upgrade"); } noteLabel.SetValueServer( $"{(spellEntry.RequiresWizardGarb ? "Requires wizard garb" : "Can be cast without wizard garb")} {spellEntry.Note}"); }
public void LearnSpell(SpellBookSpell spellEntry) { if (spellEntry.Cost > Points) { return; } ConnectedPlayer player = GetLastReader(); int currentSpellTier = GetReaderSpellLevel(spellEntry.Spell); if (currentSpellTier < spellEntry.Spell.TierCount) { LearnSpell(player, spellEntry); } else if (spellEntry.Spell.TierCount == 1) { Chat.AddExamineMsgFromServer(player.GameObject, "You already know this spell!"); } else { Chat.AddExamineMsgFromServer(player.GameObject, "You can't upgrade this spell any further!"); } }