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

Actor:takeHit() also returns damage actualy taken

git-svn-id: http://svn.net-core.org/repos/t-engine4@2828 51575b47-30f0-44d4-a5cc-537603b46e54
parent 3f0ddee1
No related branches found
No related tags found
No related merge requests found
......@@ -60,14 +60,16 @@ end
--- Remove some HP from an actor
-- If HP is reduced to 0 then remove from the level and call the die method.<br/>
-- When an actor dies its dead property is set to true, to wait until garbage collection deletes it
-- @return true/false if the actor died and the actual damage done
function _M:takeHit(value, src)
if self.onTakeHit then value = self:onTakeHit(value, src) end
self.life = self.life - value
self.changed = true
if self.life <= 0 then
game.logSeen(self, "#{bold}#%s killed %s!#{normal}#", src.name:capitalize(), self.name)
return self:die(src)
return self:die(src), value
end
return false, value
end
--- Called when died
......
......@@ -55,7 +55,7 @@ function _M:bumpInto(target)
end
function _M:takeHit()
return nil
return nil, 0
end
function _M:encounterAttack(target)
......
......@@ -98,7 +98,7 @@ newEntity{ base = "BASE_NPC_ORC", define_as = "ORC",
newEntity{ base = "BASE_NPC_ORC", define_as = "ORC_FIRE_WYRMIC",
name = "fiery orc wyrmic", color=colors.RED,
desc = [[A fierce soldier-orc trained in the discipline of dragons.]],
level_range = {10, nil}, exp_worth = 1,
level_range = {11, nil}, exp_worth = 1,
rarity = 6,
rank = 3,
max_life = resolvers.rngavg(100,110),
......@@ -125,7 +125,7 @@ newEntity{ base = "BASE_NPC_ORC", define_as = "ORC_FIRE_WYRMIC",
newEntity{ base = "BASE_NPC_ORC",
name = "icy orc wyrmic", color=colors.BLUE, define_as = "ORC_ICE_WYRMIC",
desc = [[A fierce soldier-orc trained in the discipline of dragons.]],
level_range = {10, nil}, exp_worth = 1,
level_range = {11, nil}, exp_worth = 1,
rarity = 6,
rank = 3,
max_life = resolvers.rngavg(100,110),
......
......@@ -20,7 +20,7 @@
load("/data/general/npcs/rodent.lua", rarity(0))
load("/data/general/npcs/vermin.lua", rarity(2))
load("/data/general/npcs/molds.lua", rarity(1))
load("/data/general/npcs/skeleton.lua", rarity(0))
load("/data/general/npcs/orc.lua", function(e) if e.level_range and e.level_range[1] == 10 then e.level_range[1] = 1 end end) -- Make orcs lower level, not a problem we have norgan to help!
load("/data/general/npcs/snake.lua", rarity(2))
load("/data/general/npcs/all.lua", rarity(4, 35))
......@@ -29,44 +29,42 @@ local Talents = require("engine.interface.ActorTalents")
newEntity{ define_as = "BROTOQ",
allow_infinite_dungeon = true,
type = "undead", subtype = "skeleton", unique = true,
name = "The Shade",
display = "s", color=colors.VIOLET,
shader = "unique_glow",
desc = [[This skeleton looks nasty. There are red flames in its empty eye sockets. It wields a nasty sword and strides toward you, throwing spells.]],
type = "humanoid", subtype = "orc", unique = true,
name = "Brotoq the Reaver",
display = "o", color=colors.VIOLET,
desc = [[A huge orc blocks your way to the Iron Council. You must pass.]],
level_range = {7, nil}, exp_worth = 2,
max_life = 150, life_rating = 15, fixed_rating = true,
max_mana = 85,
max_stamina = 85,
rank = 4,
size_category = 3,
undead = 1,
infravision = 20,
stats = { str=16, dex=12, cun=14, mag=25, con=16 },
stats = { str=20, dex=10, cun=12, mag=20, con=12 },
instakill_immune = 1,
blind_immune = 1,
bleed_immune = 1,
move_others=true,
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
equipment = resolvers.equip{ {type="weapon", subtype="staff", defined="STAFF_KOR", random_art_replace={chance=75}, autoreq=true}, {type="armor", subtype="light", autoreq=true}, },
equipment = resolvers.equip{
{type="weapon", subtype="longsword", autoreq=true},
{type="weapon", subtype="longsword", autoreq=true},
{type="armor", subtype="light", autoreq=true},
},
drops = resolvers.drops{chance=100, nb=3, {ego_chance=100} },
resolvers.talents{
[Talents.T_MANATHRUST]=4, [Talents.T_FREEZE]=4, [Talents.T_TIDAL_WAVE]=2,
[Talents.T_WEAPONS_MASTERY]=3,
[Talents.T_VIRULENT_DISEASE]=2,
[Talents.T_CORRUPTED_STRENGTH]=1,
[Talents.T_CARRIER]=1,
[Talents.T_ACID_BLOOD]=1,
[Talents.T_REND]=2,
[Talents.T_WEAPONS_MASTERY]=2,
},
resolvers.inscriptions(1, {"shielding rune", "phase door rune"}),
resolvers.inscriptions(1, {"manasurge rune"}),
inc_damage = {all=-20},
resolvers.inscriptions(1, {"wild infusion"}),
autolevel = "warriormage",
ai = "tactical", ai_state = { talent_in=3, ai_move="move_astar", },
on_die = function(self, who)
game.state:activateBackupGuardian("KOR_FURY", 5, 35, ".. yes I tell you! The old ruins of Kor'Pul are still haunted!")
game.player:resolveSource():grantQuest("start-allied")
game.player:resolveSource():setQuestStatus("start-allied", engine.Quest.COMPLETED, "kor-pul")
game.player:resolveSource():setQuestStatus("start-dwarf", engine.Quest.COMPLETED, "brotoq")
end,
}
......@@ -83,6 +81,7 @@ newEntity{ define_as = "NORGAN",
stats = { str=19, dex=10, cun=12, mag=8, con=16, wil=13 },
move_others=true,
never_anger = true,
remove_from_party_on_death = true,
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, LITE=1 },
equipment = resolvers.equip{
......
......@@ -27,6 +27,7 @@ return {
width = 50, height = 50,
-- all_remembered = true,
-- all_lited = true,
no_worldport = true,
persistent = "zone",
ambient_music = "Swashing the buck.ogg",
generator = {
......@@ -65,10 +66,15 @@ return {
}, },
},
[5] = {
generator = { map = {
class = "engine.generator.map.Static",
map = "zones/reknor-escape-last",
}, },
generator = {
map = {
class = "engine.generator.map.Static",
map = "zones/reknor-escape-last",
},
actor = {
nb_npc = {0, 0},
},
},
},
},
......@@ -91,7 +97,7 @@ return {
local norgan = game.party:findMember{type="squadmate"}
if norgan then game.player:setQuestStatus("start-dwarf", engine.Quest.COMPLETED, "norgan") end
game.player:setQuestStatus("start-dwarf", engine.Quest.COMPLETED)
if norgan then
if norgan and not norgan.dead then
local chat = require("engine.Chat").new("norgan-saved", norgan, game.player)
chat:invoke()
end
......
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