Skip to content

Commit

Permalink
fix #49
Browse files Browse the repository at this point in the history
  • Loading branch information
Zireael07 committed Sep 16, 2013
1 parent 5fda86a commit 008f8df
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 7 deletions.
190 changes: 189 additions & 1 deletion class/Player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ local Dialog = require "engine.Dialog"
local DeathDialog = require "mod.dialogs.DeathDialog"
local Astar = require"engine.Astar"
local DirectPath = require "engine.DirectPath"
local NameGenerator = require "engine.NameGenerator"

--- Defines the player
-- It is a normal actor, with some redefined methods to handle user interaction.<br/>
Expand Down Expand Up @@ -57,7 +58,9 @@ function _M:init(t, no_default)
self.lite = 0 --stealth test
self.ecl = 1

self.descriptor = {}

self.descriptor = self.descriptor or {}
self.race = self.descriptor.race
self.classes = self.classes or {}
self.max_level = 50
self.max_exp = self.exp
Expand All @@ -70,8 +73,193 @@ end
function _M:onBirth()
self:levelClass(self.descriptor.class)
self:resetToFull()
self:randomName()
end

function _M:randomName()
local random_name = {
human_male = {
syllablesStart ="Aeron, Courynn, Daelric, Dorn, Helm, Lynneth, Rowan, Sealmyd, Borivik, Fyodor, Vladislak, Khalid, Rasheed, Zasheir, Zasheira",
syllablesEnd ="Dulsaer, Jacerryl, Telstaer, Uthelienn, Pashar, Aporos, Nathos, Zora, Amblecrown, Duskman, Dundragon, Evenwood, Greycastle, Tallstag",
rules = "$s $e",
},
human_female = {
syllablesStart ="Ariadne, Courynna, Daelra, Lynneth, Sealmyd, Smylla, Wydda, Fyevarra, Immith, Shevarra, Tammith, Katernin, Mara, Natali, Zofia, Jaheira, Zasheira",
syllablesEnd ="Dulsaer, Jacerryl, Telstaer, Uthelienn, Pashar, Aporos, Nathos, Zora, Amblecrown, Duskman, Dundragon, Evenwood, Greycastle, Tallstag",
rules = "$s $e",
},
halfelf_male = {
syllablesStart ="Aeron, Courynn, Daelric, Dorn, Evendur, Helm, Lynneth, Rowan, Sealmyd, Khalid, Zasheir",
syllablesEnd ="Dulsaer, Jacerryl, Telstaer, Uthelienn, Pashar, Aporos, Nathos, Zora, Amblecrown, Duskman, Dundragon, Evenwood, Greycastle, Tallstag, Moonblade, Moonflower, Eveningstar",
rules = "$s$e",
},

halfelf_female = {
syllablesStart ="Ariadne, Courynna, Lynneth, Rowan, Sealmyd, Shandri, Smylla, Wydda, Fyevarra, Immith, Shevarra, Tammith, Katernin, Mara, Natali, Zofia, Jaheira",
syllablesEnd ="Dulsaer, Jacerryl, Telstaer, Uthelienn, Pashar, Aporos, Nathos, Zora, Amblecrown, Duskman, Dundragon, Evenwood, Greycastle, Tallstag, Moonblade, Moonflower, Eveningstar",
rules = "$s$e",
},

elf_male = {
syllablesStart ="Aravilar, Faelar, Saevel, Rhistel",
syllablesMiddle = "Moon, Evening",
syllablesEnd ="flower, blade, star, fall",
rules = "$s $m$e",
},

elf_female = {
syllablesStart ="Hacathra, Imizael, Talindra, Vestele",
syllablesMiddle = "Moon, Evening",
syllablesEnd ="flower, blade, star, fall",
rules = "$s $m$e",
},

halforc_male = {
syllablesStart ="Durth, Fang, Gothog, Harl, Orrusk, Orik, Thog",
syllablesEnd ="Horthor, Lammar, Turnskull, Ulkrunnar, Zorgar",
rules = "$s $e",
},

halforc_female = {
syllablesStart ="Orvaega, Duvaega, Varra",
syllablesEnd ="Horthor, Lammar, Turnskull, Ulkrunnar, Zorgar",
rules = "$s $e",
},

dwarf_male = {
syllablesStart ="Dorn, Khondar, Thorik",
syllablesMiddle = "Blade, Crown, Skull, Stone, Battle, Gold",
syllablesEnd ="bite, shield, dark",
rules = "$s $m$e",
},

dwarf_female = {
syllablesStart ="Belmara, Dorna",
syllablesMiddle = "Blade, Crown, Skull, Stone, Battle, Gold",
syllablesEnd ="bite, shield, dark",
rules = "$s $m$e",
},

drow_male = {
syllablesStart ="Alak, Drizzt, Ilmryn, Khalazza, Merinid, Mourn, Nym, Pharaun, Rizzen, Solaufein, Tebryn, Zaknafein",
syllablesMiddle = "",
syllablesEnd ="Abaeir, Baenre, Coloara, Glannath, Hune, Illistyn, Khalazza, Pharn, Seerear, Vrinn, Xiltyn",
rules = "$s $m$e",
},

drow_female = {
syllablesStart ="Akordia, Chalithra, Chalinthra, Eclavdra, Nedylene, Qilue, SiNafay",
syllablesMiddle = "",
syllablesEnd ="Abaeir, Baenre, Coloara, Glannath, Hune, Illistyn, Khalazza, Pharn, Seerear, Vrinn, Xiltyn",
rules = "$s $m$e",
},

duergar_male = {
syllablesStart = "Thorik, Dorn",
syllablesMiddle = "Blade, Crown, Skull, Stone, Battle, Dark",
syllablesEnd = "bite, shield, dark",
rules = "$s $m$e",
},

duergar_female = {
syllablesStart = "Belmara, Dorna",
syllablesMiddle = "Blade, Crown, Skull, Stone, Battle, Dark",
syllablesEnd = "bite, shield, dark",
rules = "$s $m$e",
},

gnome_male = {
syllablesStart = "Colmarr, Falrinn, Halbrinn",
syllablesMiddle = "Black, Great, Riven, White",
syllablesEnd = "orm, rock, stone, horn",
rules = "$s $m$e",
},
gnome_female = {
syllablesStart = "Eliss, Lissa, Meree, Nathee",
syllablesMiddle = "Black, Great, Riven, White",
syllablesEnd = "orm, rock, stone, horn",
rules = "$s $m$e",
}
}

--if self.descriptor.race then
if self.descriptor.race == "Human" then
if self.descriptor.sex == "Female" then
local ng = NameGenerator.new(random_name.human_female)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME")
else local ng = NameGenerator.new(random_name.human_male)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME") end
elseif self.descriptor.race == "Half-Elf" then
if self.descriptor.sex == "Female" then
local ng = NameGenerator.new(random_name.halfelf_female)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME")
else
local ng = NameGenerator.new(random_name.halfelf_male)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME") end
elseif self.descriptor.race == "Elf" then
if self.descriptor.sex == "Female" then
local ng = NameGenerator.new(random_name.elf_female)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME")
else
local ng = NameGenerator.new(random_name.elf_male)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME") end
elseif self.descriptor.race == "Half-Orc" then
if self.descriptor.sex == "Female" then
local ng = NameGenerator.new(random_name.halforc_female)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME")
else
local ng = NameGenerator.new(random_name.halforc_male)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME") end
elseif self.descriptor.race == "Dwarf" then
if self.descriptor.sex == "Female" then
local ng = NameGenerator.new(random_name.dwarf_female)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME")
else
local ng = NameGenerator.new(random_name.dwarf_male)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME") end
elseif self.descriptor.race == "Drow" then
if self.descriptor.sex == "Female" then
local ng = NameGenerator.new(random_name.drow_female)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME")
else
local ng = NameGenerator.new(random_name.drow_male)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME") end
elseif self.descriptor.race == "Duergar" then
if self.descriptor.sex == "Female" then
local ng = NameGenerator.new(random_name.duergar_female)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME")
else
local ng = NameGenerator.new(random_name.duergar_male)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME") end
elseif self.descriptor.race == "Deep gnome" then
if self.descriptor.sex == "Female" then
local ng = NameGenerator.new(random_name.gnome_female)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME")
else
local ng = NameGenerator.new(random_name.gnome_male)
self:setName(ng:generate())
print("GENERATING A RANDOM NAME") end
end
--end

end


function _M:getExpChart(level)
if not level or level < 1 then return 0 end
local ecl = self:attr("ecl")
Expand Down
11 changes: 5 additions & 6 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicolas Casalini
-- Veins of the Earth
-- Copyright (C) 2013 Zireael
--
-- 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
Expand All @@ -13,22 +13,21 @@
--
-- 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

name = "VotE"
long_name = "The Veins of the Earth"
short_name = "veins"
author = { "Zireael", "x" }
homepage = "https://github.com/Zireael07/The-Veins-of-the-Earth"
version = {0,0,8}
version = {0,0,12}
engine = {1,0,4,"te4"}
description = [[
In DarkGod's words, "a fantasy d20-themed dungeon crawler".
]]
starter = "mod.load"

no_get_name = true

show_only_on_cheat = false -- Example modules are not shown to normal players

score_formatters = {
Expand Down

0 comments on commit 008f8df

Please sign in to comment.