Skip to content
Snippets Groups Projects
Commit 0d7b491c authored by dg's avatar dg
Browse files

Added gloves/gauntlets and egos relating to them

git-svn-id: http://svn.net-core.org/repos/t-engine4@1272 51575b47-30f0-44d4-a5cc-537603b46e54
parent f099b667
No related branches found
No related tags found
No related merge requests found
......@@ -616,11 +616,6 @@ function _M:onTakeHit(value, src)
end
end
-- Adds hate
if src and src.max_hate and src.max_hate > 0 then
src.hate = math.min(src.max_hate, src.hate + src.hate_per_kill)
end
-- Achievements
if src and src.resolveSource and src:resolveSource().player and value >= 600 then
world:gainAchievement("SIZE_MATTERS", src:resolveSource())
......@@ -710,6 +705,11 @@ function _M:die(src)
t.on_kill(src, t)
end
-- Adds hate
if src and src.max_hate and src.max_hate > 0 then
src.hate = math.min(src.max_hate, src.hate + src.hate_per_kill)
end
-- Increase vim
if src and src.attr and src:attr("vim_on_death") and not self:attr("undead") then src:incVim(src:attr("vim_on_death")) end
......@@ -1089,7 +1089,7 @@ function _M:postUseTalent(ab, ret)
if not ab.no_energy then
if ab.type[1]:find("^spell/") then
self:useEnergy(game.energy_to_act * self:combatSpellSpeed())
elseif ab.type[1]:find("^physical/") then
elseif ab.type[1]:find("^technique/") then
self:useEnergy(game.energy_to_act * self:combatSpeed())
else
self:useEnergy()
......
......@@ -295,6 +295,10 @@ function _M:getTextualDesc()
desc[#desc+1] = ("Allows you to breathe in: %s."):format(table.concat(ts, ','))
end
if w.combat_critical_power then desc[#desc+1] = ("Increases critical damage modifier: +%d%%."):format(w.combat_critical_power) end
if w.disarm_bonus then desc[#desc+1] = ("Increases trap disarming bonus: %d."):format(w.disarm_bonus) end
if w.combat_physresist then desc[#desc+1] = ("Increases physical save: %s."):format(w.combat_physresist) end
if w.combat_spellresist then desc[#desc+1] = ("Increases spell save: %s."):format(w.combat_spellresist) end
if w.combat_mentalresist then desc[#desc+1] = ("Increases mental save: %s."):format(w.combat_mentalresist) end
......
......@@ -54,7 +54,7 @@ function _M:canDisarm(x, y, who)
-- do we know how to disarm?
if who:knowTalent(who.T_TRAP_DISARM) then
local power = who:getTalentLevel(who.T_TRAP_DISARM) * who:getCun(25)
local power = who:getTalentLevel(who.T_TRAP_DISARM) * who:getCun(25) + (who:attr("disarm_bonus") or 0)
if who:checkHit(power, self.disarm_power) then
return true
end
......
......@@ -550,7 +550,7 @@ function _M:physicalCrit(dam, weapon, target)
print("[PHYS CRIT %]", chance)
if rng.percent(chance) then
dam = dam * 1.5
dam = dam * (1.5 + (self.combat_critical_power or 0))
crit = true
end
return dam, crit
......
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 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
newChat{ id="welcome",
text = [[What? Ah it is you @playername@.
I take it you are satisfied with the portal.]],
answers = {
{"Yes thank you."},
{"Whatever."},
}
}
return "welcome"
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 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
local Stats = require "engine.interface.ActorStats"
local DamageType = require "engine.DamageType"
newEntity{
name = " of disarming", suffix=true, instant_resolve=true,
level_range = {10, 50},
rarity = 5,
cost = 6,
wielder = {
disarm_bonus = resolvers.mbonus_material(25, 5, function(e, v) return v * 1.2 end),
},
}
newEntity{
name = " of criticals", suffix=true, instant_resolve=true,
level_range = {20, 50},
rarity = 9,
cost = 15,
wielder = {
combat_spellcrit = resolvers.mbonus_material(15, 5, function(e, v) return v * 1.4 end),
combat_physcrit = resolvers.mbonus_material(15, 5, function(e, v) return v * 1.4 end),
},
}
newEntity{
name = " of mighty criticals", suffix=true, instant_resolve=true,
level_range = {30, 50},
rarity = 12,
cost = 25,
wielder = {
combat_critical_power = resolvers.mbonus_material(35, 5, function(e, v) v=v/100 return v * 200, v end),
},
}
newEntity{
name = " of attack", suffix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 5,
cost = 5,
wielder = {
combat_atk = resolvers.mbonus_material(15, 10, function(e, v) return v * 1 end),
},
}
newEntity{
name = " of damage", suffix=true, instant_resolve=true,
level_range = {10, 50},
rarity = 7,
cost = 10,
wielder = {
combat_dam = resolvers.mbonus_material(15, 5, function(e, v) return v * 3 end),
},
}
newEntity{
name = "cinder ", prefix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 3,
cost = 5,
wielder = {
inc_damage={ [DamageType.FIRE] = resolvers.mbonus_material(8, 3, function(e, v) return v * 0.8 end), },
},
}
newEntity{
name = "polar ", prefix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 3,
cost = 5,
wielder = {
inc_damage={ [DamageType.COLD] = resolvers.mbonus_material(8, 3, function(e, v) return v * 0.8 end), },
},
}
newEntity{
name = "corrosive ", prefix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 3,
cost = 5,
wielder = {
inc_damage={ [DamageType.ACID] = resolvers.mbonus_material(8, 3, function(e, v) return v * 0.8 end), },
},
}
newEntity{
name = "charged ", prefix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 3,
cost = 5,
wielder = {
inc_damage={ [DamageType.LIGHTNING] = resolvers.mbonus_material(8, 3, function(e, v) return v * 0.8 end), },
},
}
newEntity{
name = "naturalist ", prefix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 3,
cost = 5,
wielder = {
inc_damage={ [DamageType.NATURE] = resolvers.mbonus_material(8, 3, function(e, v) return v * 0.8 end), },
},
}
newEntity{
name = "blighted ", prefix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 3,
cost = 5,
wielder = {
inc_damage={ [DamageType.BLIGHT] = resolvers.mbonus_material(8, 3, function(e, v) return v * 0.8 end), },
},
}
newEntity{
name = "powerful ", prefix=true, instant_resolve=true,
level_range = {1, 50},
rarity = 3,
cost = 5,
wielder = {
inc_damage={ [DamageType.PYSICAL] = resolvers.mbonus_material(8, 3, function(e, v) return v * 0.8 end), },
},
}
newEntity{
name = " of strength (#STATBONUS#)", suffix=true,
level_range = {1, 50},
rarity = 6,
cost = 4,
wielder = {
inc_stats = { [Stats.STAT_STR] = resolvers.mbonus_material(4, 2, function(e, v) return v * 3 end) },
},
}
newEntity{
name = " of dexterity (#STATBONUS#)", suffix=true,
level_range = {1, 50},
rarity = 6,
cost = 4,
wielder = {
inc_stats = { [Stats.STAT_DEX] = resolvers.mbonus_material(4, 2, function(e, v) return v * 3 end) },
},
}
newEntity{
name = " of magic (#STATBONUS#)", suffix=true,
level_range = {1, 50},
rarity = 6,
cost = 4,
wielder = {
inc_stats = { [Stats.STAT_MAG] = resolvers.mbonus_material(4, 2, function(e, v) return v * 3 end) },
},
}
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 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
local Talents = require "engine.interface.ActorTalents"
newEntity{
define_as = "BASE_GAUNTLET",
slot = "HANDS",
type = "armor", subtype="hands",
add_name = " (#ARMOR#)",
display = "[", color=colors.UMBER,
image = resolvers.image_material("gauntlets", "metal"),
require = { talent = { Talents.T_HEAVY_ARMOUR_TRAINING }, },
encumber = 1.5,
rarity = 9,
metallic = true,
desc = [[Metal gloves protecting the hands up to the middle of the lower arm.]],
egos = "/data/general/objects/egos/gloves.lua", egos_chance = { prefix=resolvers.mbonus(40, 5), suffix=resolvers.mbonus(40, 5) },
}
newEntity{ base = "BASE_GAUNTLET",
name = "iron gauntlets",
level_range = {1, 20},
cost = 5,
material_level = 1,
wielder = {
combat_armor = 1,
},
}
newEntity{ base = "BASE_GAUNTLET",
name = "dwarven-steel gauntlets",
level_range = {20, 40},
cost = 7,
material_level = 3,
wielder = {
combat_armor = 2,
},
}
newEntity{ base = "BASE_GAUNTLET",
name = "mithril gauntlets",
level_range = {40, 50},
cost = 10,
material_level = 5,
wielder = {
combat_armor = 3,
},
}
-- ToME - Tales of Middle-Earth
-- Copyright (C) 2009, 2010 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
local Talents = require "engine.interface.ActorTalents"
newEntity{
define_as = "BASE_GLOVE",
slot = "HANDS",
type = "armor", subtype="hands",
add_name = " (#ARMOR#)",
display = "[", color=colors.UMBER,
image = resolvers.image_material("gloves", "leather"),
encumber = 1,
rarity = 9,
metallic = true,
desc = [[Light gloves which do not seriously hinder finger movements, while still protecting the hands somewhat.]],
egos = "/data/general/objects/egos/gloves.lua", egos_chance = { prefix=resolvers.mbonus(40, 5), suffix=resolvers.mbonus(40, 5) },
}
newEntity{ base = "BASE_GLOVE",
name = "rough leather gloves",
level_range = {1, 20},
cost = 5,
material_level = 1,
wielder = {
combat_armor = 1,
},
}
newEntity{ base = "BASE_GLOVE",
name = "hardened leather gloves",
level_range = {20, 40},
cost = 7,
material_level = 3,
wielder = {
combat_armor = 2,
},
}
newEntity{ base = "BASE_GLOVE",
name = "drakeskin leather gloves",
level_range = {40, 50},
cost = 10,
material_level = 5,
wielder = {
combat_armor = 3,
},
}
......@@ -68,7 +68,8 @@ loadIfNot("/data/general/objects/helms.lua")
loadIfNot("/data/general/objects/wizard-hat.lua")
loadIfNot("/data/general/objects/leather-boots.lua")
loadIfNot("/data/general/objects/heavy-boots.lua")
--loadIfNot("/data/general/objects/gloves.lua")
loadIfNot("/data/general/objects/gloves.lua")
loadIfNot("/data/general/objects/gauntlets.lua")
-- Mounts
loadIfNot("/data/general/objects/mounts.lua")
......
......@@ -567,6 +567,45 @@ void setupRealtime(float freq)
}
}
void create_mode_list()
{
SDL_PixelFormat format;
SDL_Rect **modes;
int loops = 0;
int bpp = 0;
do
{
//format.BitsPerPixel seems to get zeroed out on my windows box
switch(loops)
{
case 0://32 bpp
format.BitsPerPixel = 32;
bpp = 32;
break;
case 1://24 bpp
format.BitsPerPixel = 24;
bpp = 24;
break;
case 2://16 bpp
format.BitsPerPixel = 16;
bpp = 16;
break;
}
//get available fullscreen/hardware modes
modes = SDL_ListModes(&format, SDL_FULLSCREEN);
if (modes)
{
int i;
for(i=0; modes[i]; ++i)
{
printf("Available resolutions: %dx%dx%d\n", modes[i]->w, modes[i]->h, bpp/*format.BitsPerPixel*/);
}
}
}while(++loops != 3);
// return mode_list;
}
/* general OpenGL initialization function */
int initGL()
{
......@@ -771,6 +810,8 @@ int main(int argc, char *argv[])
return -1;
}
create_mode_list();
SDL_WM_SetIcon(IMG_Load_RW(PHYSFSRWOPS_openRead("/engines/default/data/gfx/te4-icon.png"), TRUE), NULL);
// screen = SDL_SetVideoMode(WIDTH, HEIGHT, 32, SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_HWPALETTE | SDL_HWSURFACE | SDL_RESIZABLE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment