From acc0e15dae317d47ffff8caee95620dabfc8c7d5 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Wed, 29 Feb 2012 00:56:21 +0000
Subject: [PATCH] New weapon kind: mindstars. They are raw natural gems infused
 with the power of nature, kind of like staves. They are one-handed and can be
 dual-wielded

git-svn-id: http://svn.net-core.org/repos/t-engine4@4949 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Game.lua              |   5 +-
 .../tome/data/birth/classes/wilder.lua        |   4 +-
 .../tome/data/general/objects/mindstars.lua   | 130 ++++++++++++++++++
 .../tome/data/general/objects/objects.lua     |   1 +
 .../data/zones/blighted-ruins/objects.lua     |   1 +
 game/modules/tome/resolvers.lua               |   1 +
 6 files changed, 140 insertions(+), 2 deletions(-)
 create mode 100644 game/modules/tome/data/general/objects/mindstars.lua

diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index d4b0c6ccf6..bd1ac5eb44 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -1592,7 +1592,10 @@ function _M:saveGame()
 
 		local party = self.party:cloneFull()
 		party.__te4_uuid = self:getPlayer(true).__te4_uuid
-		for m, _ in pairs(party.members) do m.fov = {actors={}, actors_dist={}} end
+		for m, _ in pairs(party.members) do
+			m.fov = {actors={}, actors_dist={}}
+			m.running_fov = nil
+		end
 		self.player:saveUUID(party)
 
 		self.party:setPlayer(oldplayer, true)
diff --git a/game/modules/tome/data/birth/classes/wilder.lua b/game/modules/tome/data/birth/classes/wilder.lua
index ede1fbf3a0..d1a1a67c4c 100644
--- a/game/modules/tome/data/birth/classes/wilder.lua
+++ b/game/modules/tome/data/birth/classes/wilder.lua
@@ -81,7 +81,9 @@ newBirthDescriptor{
 	copy = {
 		max_life = 90,
 		resolvers.equip{ id=true,
-			{type="armor", subtype="light", name="rough leather armour", autoreq=true, ego_chance=-1000}
+			{type="weapon", subtype="mindstar", name="mossy mindstar", autoreq=true, ego_chance=-1000},
+			{type="weapon", subtype="mindstar", name="mossy mindstar", autoreq=true, ego_chance=-1000},
+			{type="armor", subtype="light", name="rough leather armour", autoreq=true, ego_chance=-1000},
 		},
 	},
 }
diff --git a/game/modules/tome/data/general/objects/mindstars.lua b/game/modules/tome/data/general/objects/mindstars.lua
new file mode 100644
index 0000000000..8be411ed38
--- /dev/null
+++ b/game/modules/tome/data/general/objects/mindstars.lua
@@ -0,0 +1,130 @@
+-- ToME - Tales of Maj'Eyal
+-- Copyright (C) 2009, 2010, 2011 Nicolas Casalini
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
+--
+-- Nicolas Casalini "DarkGod"
+-- darkgod@te4.org
+
+newEntity{
+	define_as = "BASE_MINDSTAR",
+	slot = "MAINHAND", offslot = "OFFHAND",
+	type = "weapon", subtype="mindstar",
+	add_name = " (#COMBAT_DAMTYPE#)",
+	display = "!", color=colors.LIGHT_RED, image = resolvers.image_material("mindstar", "wood"),
+	moddable_tile = resolvers.moddable_tile("mindstar"),
+	randart_able = { attack=10, physical=40, spell=1, def=10, misc=10 },
+	encumber = 5,
+	rarity = 4,
+	power_source = {nature=true},
+	combat = {
+		talented = "mindstar",
+		physspeed = 1,
+		damrange = 1.1,
+		sound = {"actions/melee", pitch=0.6, vol=1.2}, sound_miss = {"actions/melee", pitch=0.6, vol=1.2},
+		damtype = resolvers.rngtable{DamageType.NATURE, DamageType.MIND},
+	},
+	desc = [[Mindstars are natural products. Natural gems covered in living matter, they are used to focus the mental powers of all nature defenders.]],
+	egos = "/data/general/objects/egos/mindstars.lua", egos_chance = { prefix=resolvers.mbonus(40, 5), suffix=resolvers.mbonus(40, 5) },
+}
+
+newEntity{ base = "BASE_MINDSTAR",
+	name = "mossy mindstar", short_name = "mossy",
+	level_range = {1, 10},
+	require = { stat = { wil=11 }, },
+	cost = 5,
+	material_level = 1,
+	combat = {
+		dam = resolvers.rngavg(2,3),
+		apr = 2,
+		physcrit = 2.5,
+		dammod = {wil=1},
+	},
+	wielder = {
+		combat_mindpower = 1,
+		combat_mindcrit = 1,
+	},
+}
+
+newEntity{ base = "BASE_MINDSTAR",
+	name = "vined mindstar", short_name = "vined",
+	level_range = {10, 20},
+	require = { stat = { wil=16 }, },
+	cost = 10,
+	material_level = 2,
+	combat = {
+		dam = resolvers.rngavg(4,6),
+		apr = 3,
+		physcrit = 3,
+		dammod = {wil=1},
+	},
+	wielder = {
+		combat_mindpower = 1,
+		combat_mindcrit = 2,
+	},
+}
+
+newEntity{ base = "BASE_MINDSTAR",
+	name = "thorny mnidstar", short_name = "thorny",
+	level_range = {20, 30},
+	require = { stat = { wil=24 }, },
+	cost = 15,
+	material_level = 3,
+	combat = {
+		dam = resolvers.rngavg(7,10),
+		apr = 4,
+		physcrit = 3.5,
+		dammod = {wil=1},
+	},
+	wielder = {
+		combat_mindpower = 2,
+		combat_mindcrit = 3,
+	},
+}
+
+newEntity{ base = "BASE_MINDSTAR",
+	name = "pulsing mindstar", short_name = "pusling",
+	level_range = {30, 40},
+	require = { stat = { wil=35 }, },
+	cost = 25,
+	material_level = 4,
+	combat = {
+		dam = resolvers.rngavg(12,14),
+		apr = 5,
+		physcrit = 4.5,
+		dammod = {wil=1},
+	},
+	wielder = {
+		combat_mindpower = 4,
+		combat_mindcrit = 4,
+	},
+}
+
+newEntity{ base = "BASE_MINDSTAR",
+	name = "living mindstar", short_name = "living",
+	level_range = {40, 50},
+	require = { stat = { wil=48 }, },
+	cost = 35,
+	material_level = 5,
+	combat = {
+		dam = resolvers.rngavg(15,18),
+		apr = 6,
+		physcrit = 5,
+		dammod = {wil=1},
+	},
+	wielder = {
+		combat_mindpower = 5,
+		combat_mindcrit = 5,
+	},
+}
diff --git a/game/modules/tome/data/general/objects/objects.lua b/game/modules/tome/data/general/objects/objects.lua
index 76d6303a74..a22994ac2e 100644
--- a/game/modules/tome/data/general/objects/objects.lua
+++ b/game/modules/tome/data/general/objects/objects.lua
@@ -41,6 +41,7 @@ loadIfNot("/data/general/objects/jewelry.lua")
 
 -- Weapons
 loadIfNot("/data/general/objects/staves.lua")
+loadIfNot("/data/general/objects/mindstars.lua")
 loadIfNot("/data/general/objects/knifes.lua")
 
 loadIfNot("/data/general/objects/whips.lua")
diff --git a/game/modules/tome/data/zones/blighted-ruins/objects.lua b/game/modules/tome/data/zones/blighted-ruins/objects.lua
index 68d121bd4a..edc9d07797 100644
--- a/game/modules/tome/data/zones/blighted-ruins/objects.lua
+++ b/game/modules/tome/data/zones/blighted-ruins/objects.lua
@@ -34,6 +34,7 @@ newEntity{ define_as = "CLOAK_DECEPTION",
 
 	wielder = {
 		combat_spellpower = 5,
+		combat_mindpower = 5,
 		combat_dam = 5,
 	},
 
diff --git a/game/modules/tome/resolvers.lua b/game/modules/tome/resolvers.lua
index 338431dbea..d0428067e2 100644
--- a/game/modules/tome/resolvers.lua
+++ b/game/modules/tome/resolvers.lua
@@ -393,6 +393,7 @@ function resolvers.calc.moddable_tile(t, e)
 	elseif slot == "bow" then r = {"%s_hand_01"}
 	elseif slot == "sling" then r = {"%s_hand_02"}
 	elseif slot == "dagger" then r = {"%s_hand_03"}
+	elseif slot == "mindstar" then r = {"%s_hand_03"}
 	elseif slot == "helm" then r = {"head_05","head_06","head_08","head_10","head_09",}
 	elseif slot == "leather_cap" then r = {"head_03"}
 	elseif slot == "mummy_wrapping" then r = {{"special/mummy_wrappings",true}}
-- 
GitLab