New armor type (needs strings, etc) for E3

This commit is contained in:
Enno Rehling 2010-01-16 20:40:38 +00:00
parent be015da263
commit eb1f5a41d1
4 changed files with 18 additions and 5 deletions

View File

@ -966,6 +966,7 @@ plan_monsters(void)
}
if (skill_enabled[SK_PERCEPTION]) {
/* Monster bekommen jede Runde ein paar Tage Wahrnehmung dazu */
/* TODO: this only works for playerrace */
produceexp(u, SK_PERCEPTION, u->number);
}

11
src/res/armor/scale.xml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<resource name="scale">
<item weight="400" score="150">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="armorer" minskill="4" reqsize="1">
<modifier function="mod_dwarves_only"/>
<requirement type="iron" quantity="2"/>
</construction>
<armor ac="3" penalty="0.15" projectile="0.10" magres="0.0"/>
</item>
</resource>

View File

@ -7,5 +7,6 @@
<xi:include href="../armor/rustychainmail-2.xml"/>
<xi:include href="../armor/rustyshield-2.xml"/>
<xi:include href="../armor/shield-2.xml"/>
<xi:include href="../armor/scale.xml"/>
<xi:include href="../armor/towershield.xml"/>
</resources>

View File

@ -1,5 +1,5 @@
-- when appending to this, make sure the item has a canuse-function!
local goblin_denied = " plate lance mallornlance greatbow axe greatsword halberd rustyaxe rustyhalberd towershield "
local goblin_denied = " plate lance mallornlance greatbow axe greatsword halberd rustyaxe rustyhalberd towershield scale "
function item_canuse(u, iname)
local race = u.race
if race=="goblin" then
@ -11,6 +11,10 @@ function item_canuse(u, iname)
-- only dwarves and halflings allowed to use towershield
return race=="dwarf" or race=="halfling"
end
if iname=="scale" then
-- only dwarves and halflings can use scale
return race=="dwarf" or race=="halfling"
end
if iname=="towershield" then
-- only dwarves allowed to use towershield
return race=="dwarf"
@ -19,10 +23,6 @@ function item_canuse(u, iname)
-- only elves use greatbow
return race=="elf"
end
if iname=="plate" then
-- goblins cannot use plate
return race~="goblin"
end
return true
end