From 696575b8414441a753f63cec314952ba7b76f69f Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sun, 19 Aug 2012 23:10:04 +0000
Subject: [PATCH] Some classes are "rare" and will appear less often on rares /
 randomboss

git-svn-id: http://svn.net-core.org/repos/t-engine4@5536 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/GameState.lua                 | 2 +-
 game/modules/tome/data/birth/classes/afflicted.lua    | 1 +
 game/modules/tome/data/birth/classes/chronomancer.lua | 2 ++
 game/modules/tome/data/birth/classes/psionic.lua      | 3 ++-
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/game/modules/tome/class/GameState.lua b/game/modules/tome/class/GameState.lua
index fa734fa638..0dd8bb3c37 100644
--- a/game/modules/tome/class/GameState.lua
+++ b/game/modules/tome/class/GameState.lua
@@ -1759,7 +1759,7 @@ function _M:createRandomBoss(base, data)
 	local force_classes = data.force_classes and table.clone(data.force_classes)
 	for name, cdata in pairs(classes) do
 		if force_classes and force_classes[cdata.name] then apply_class(table.clone(cdata, true)) force_classes[cdata.name] = nil
-		elseif not cdata.not_on_random_boss and (not data.class_filter or data.class_filter(cdata))then list[#list+1] = cdata
+		elseif not cdata.not_on_random_boss and (not cdata.random_rarity or rng.chance(cdata.random_rarity)) and (not data.class_filter or data.class_filter(cdata))then list[#list+1] = cdata
 		end
 	end
 	for i = 1, data.nb_classes or 2 do
diff --git a/game/modules/tome/data/birth/classes/afflicted.lua b/game/modules/tome/data/birth/classes/afflicted.lua
index b6e7e34b24..c05abf3b61 100644
--- a/game/modules/tome/data/birth/classes/afflicted.lua
+++ b/game/modules/tome/data/birth/classes/afflicted.lua
@@ -108,6 +108,7 @@ newBirthDescriptor{
 		"#GOLD#Life per level:#LIGHT_BLUE# +0",
 	},
 	power_source = {psionic=true},
+	random_rarity = 2,
 	stats = { wil=4, cun=5, },
 	talents_types = {
 		["cursed/dark-sustenance"]={true, 0.3},
diff --git a/game/modules/tome/data/birth/classes/chronomancer.lua b/game/modules/tome/data/birth/classes/chronomancer.lua
index 1fb8903dc7..d1542da93a 100644
--- a/game/modules/tome/data/birth/classes/chronomancer.lua
+++ b/game/modules/tome/data/birth/classes/chronomancer.lua
@@ -54,6 +54,7 @@ newBirthDescriptor{
 		"#GOLD#Life per level:#LIGHT_BLUE# -4",
 	},
 	power_source = {arcane=true},
+	random_rarity = 2,
 	stats = { mag=5, wil=3, cun=1, },
 	talents_types = {
 		["chronomancy/age-manipulation"]={true, 0.3},
@@ -104,6 +105,7 @@ newBirthDescriptor{
 		"#GOLD#Life per level:#LIGHT_BLUE# +0",
 	},
 	power_source = {technique=true, arcane=true},
+	random_rarity = 2,
 	stats = { str=2, wil=2, dex=3, mag=2},
 	talents_types = {
 		["technique/archery-bow"]={true, 0},
diff --git a/game/modules/tome/data/birth/classes/psionic.lua b/game/modules/tome/data/birth/classes/psionic.lua
index 26b9b8dad8..0ee616c5f2 100644
--- a/game/modules/tome/data/birth/classes/psionic.lua
+++ b/game/modules/tome/data/birth/classes/psionic.lua
@@ -158,7 +158,7 @@ newBirthDescriptor{
 		life_rating = -4,
 	},
 }
--- Edge TODO: Unlock stuff
+
 newBirthDescriptor{
 	type = "subclass",
 	name = "Solipsist",
@@ -175,6 +175,7 @@ newBirthDescriptor{
 		"#GOLD#Life per level:#LIGHT_BLUE# -4 (*special*)",
 	},
 	power_source = {psionic=true},
+	random_rarity = 2,
 	stats = { str=0, wil=5, cun=4, },
 	birth_example_particles = {
 		function(actor)
-- 
GitLab