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

The Slime tree is back, for antimagic users!

Antimagic users when they get a magic escort can pretend to accept to help. The ending will be different though.


git-svn-id: http://svn.net-core.org/repos/t-engine4@3033 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2b1c997c
No related branches found
No related tags found
No related merge requests found
......@@ -116,7 +116,7 @@ function _M:generateList()
local nb = 1
for i, a in ipairs(self.chat:get(self.cur_id).answers) do
if not a.cond or a.cond(self.npc, self.player) then
list[#list+1] = { name=string.char(string.byte('a')+nb-1)..") "..a[1], answer=i, color=a.color}
list[#list+1] = { name=string.char(string.byte('a')+nb-1)..") "..self.chat:replace(a[1]), answer=i, color=a.color}
list.chars[string.char(string.byte('a')+nb-1)] = #list
nb = nb + 1
end
......
......@@ -30,7 +30,7 @@ function _M:init(t, no_default)
ActorAI.init(self, t)
-- Grab default image name if none is set
if not self.image and self.name ~= "unknown actor" then self.image = "npc/"..(self.type or "unknown").."_"..(self.subtype or "unknown").."_"..(self.name or "unknown"):lower():gsub("[^a-z0-9]", "_")..".png" end
if not self.image and self.name ~= "unknown actor" then self.image = "npc/"..tostring(self.type or "unknown").."_"..tostring(self.subtype or "unknown").."_"..(self.name or "unknown"):lower():gsub("[^a-z0-9]", "_")..".png" end
end
function _M:act()
......
......@@ -24,6 +24,16 @@ newChat{ id="welcome",
text = text,
answers =
{
{"#LIGHT_GREEN#[Pretend to help but when it is time you will use a Ziguranth technique to make the portal fizzle. @npcname@ will be sent to Zigur to be 'dealt with' properly.]#WHITE#\nLead on; I will protect you.", action=function(npc, player)
player:hasQuest(npc.quest_id).to_zigur = true
npc.ai_state.tactic_leash = 100
game.party:addMember(npc, {
control="order",
type="escort",
title="Escort",
orders = {escort_portal=true, escort_rest=true},
})
end},
{"Go away; I do not help filthy arcane users!", action=function(npc, player)
npc:disappear()
npc:removed()
......
......@@ -48,6 +48,20 @@ local reward_types = {
[Stats.STAT_MAG] = 2,
[Stats.STAT_WIL] = 1,
},
antimagic = {
types = {
["wild-gift/slime"] = 0.7,
},
saves = { mind = 4 },
talents = {
[Talents.T_SLIME_SPIT] = 1,
[Talents.T_SLIME_ROOTS] = 1,
},
stats = {
[Stats.STAT_CUN] = 1,
[Stats.STAT_WIL] = 2,
},
},
},
alchemy = {
types = {
......@@ -64,6 +78,20 @@ local reward_types = {
[Stats.STAT_MAG] = 2,
[Stats.STAT_DEX] = 1,
},
antimagic = {
types = {
["wild-gift/slime"] = 0.7,
},
talents = {
[Talents.T_SLIME_SPIT] = 1,
[Talents.T_POISONOUS_SPORES] = 1,
},
saves = { spell = 4 },
stats = {
[Stats.STAT_CUN] = 1,
[Stats.STAT_DEX] = 2,
},
},
},
survival = {
types = {
......@@ -91,6 +119,20 @@ local reward_types = {
[Stats.STAT_STR] = 2,
[Stats.STAT_MAG] = 1,
},
antimagic = {
types = {
["wild-gift/slime"] = 0.7,
},
talents = {
[Talents.T_POISONOUS_SPORES] = 1,
[Talents.T_ACIDIC_SKIN] = 1,
},
saves = { spell = 4, phys = 4 },
stats = {
[Stats.STAT_CUN] = 1,
[Stats.STAT_WIL] = 2,
},
},
},
anorithil = {
types = {
......@@ -104,6 +146,20 @@ local reward_types = {
[Stats.STAT_CUN] = 2,
[Stats.STAT_MAG] = 1,
},
antimagic = {
types = {
["wild-gift/slime"] = 0.7,
},
talents = {
[Talents.T_SLIME_SPIT] = 1,
[Talents.T_ACIDIC_SKIN] = 1,
},
saves = { spell = 4, mind = 4 },
stats = {
[Stats.STAT_CUN] = 1,
[Stats.STAT_WIL] = 2,
},
},
},
exotic = {
talents = {
......@@ -123,6 +179,11 @@ local reward_types = {
},
}
local reward = reward_types[npc.reward_type]
local quest = game.player:hasQuest(npc.quest_id)
if quest.to_zigur and reward.antimagic then reward = reward.antimagic reward.is_antimagic = true end
local saves_name = { mind="mental", spell="spell", phys="physical"}
local saves_tooltips = { mind="MENTAL", spell="SPELL", phys="PHYS"}
local function generate_rewards()
local answers = {}
......@@ -145,6 +206,24 @@ local function generate_rewards()
}
end end
end
if reward.saves then
for save, v in pairs(reward.saves) do
local doit = function(npc, player)
player:attr("combat_"..save.."resist", v)
player.changed = true
player:hasQuest(npc.quest_id).reward_message = ("improved %s save by +%d"):format(saves_name[save], v)
end
answers[#answers+1] = {("[Improve %s save by +%d]"):format(saves_name[save], v),
jump="done",
action=doit,
on_select=function(npc, player)
game.tooltip_x, game.tooltip_y = 1, 1
local TooltipsData = require("mod.class.interface.TooltipsData")
game.tooltip:displayAtMap(nil, nil, game.w, game.h, TooltipsData["TOOLTIP_"..saves_tooltips[save]:upper().."_SAVE"])
end,
}
end
end
if reward.talents then
for tid, level in pairs(reward.talents) do
local t = npc:getTalentFromId(tid)
......@@ -191,7 +270,9 @@ local function generate_rewards()
end
newChat{ id="welcome",
text = [[Thank you, my friend. I do not think I would have survived without you.
text = reward.is_antimagic and [[At the last moment you invoke the power of nature, the portal fizzles and transports @npcname@ to Zigur.
You can feel Nature thanking you.]] or
[[Thank you, my friend. I do not think I would have survived without you.
Please let me reward you:]],
answers = generate_rewards(),
}
......
......@@ -118,7 +118,7 @@ newTalent{
return util.bound(5 - self:getTalentLevel(t) / 2, 2, 7)
end,
action = function(self, t)
local x, y = self:getTarget{type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)}
local tg = {type="ball", nolock=true, pass_terrain=true, nowarning=true, range=rad, radius=radius, requires_knowledge=false}
if not x then return nil end
-- Target code does not restrict the self coordinates to the range, it lets the project function do it
-- but we cant ...
......
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