Commit 8a1fd0154ed88f38963c9fec072c0591e69b8e1d

Authored by dg
1 parent a47e2534

Doomed Shadows now enter the party and will follow between levels


git-svn-id: http://svn.net-core.org/repos/t-engine4@3885 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -27,7 +27,7 @@ function _M:init(t, no_default)
27 27 mod.class.NPC.init(self, t, no_default)
28 28
29 29 -- Set correct AI
30   - if self.ai ~= "party_member" then
  30 + if self.ai ~= "party_member" and not self.no_party_ai then
31 31 self.ai_state.ai_party = self.ai
32 32 self.ai = "party_member"
33 33 end
... ...
... ... @@ -126,12 +126,6 @@ function _M:onEnterLevelEnd(zone, level)
126 126 end
127 127
128 128 function _M:onLeaveLevel(zone, level)
129   - -- clean up things that need to be removed before re-entering the level
130   - if self:isTalentActive(self.T_CALL_SHADOWS) then
131   - local t = self:getTalentFromId(self.T_CALL_SHADOWS)
132   - t.removeAllShadows(self, t)
133   - end
134   -
135 129 if self:hasEffect(self.EFF_FEED) then
136 130 self:removeEffect(self.EFF_FEED, true)
137 131 end
... ... @@ -226,7 +220,7 @@ function _M:act()
226 220 self.tempeffect_def[self.EFF_FEED].updateFeed(self, self:hasEffect(self.EFF_FEED))
227 221 elseif self:hasEffect(self.EFF_FED_UPON) then
228 222 local fed_upon_eff = self:hasEffect(self.EFF_FED_UPON)
229   -
  223 +
230 224 fed_upon_eff.src.tempeffect_def[fed_upon_eff.src.EFF_FEED].updateFeed(fed_upon_eff.src, fed_upon_eff.src:hasEffect(self.EFF_FEED))
231 225 end
232 226
... ...
... ... @@ -357,16 +357,20 @@ newTalent{
357 357 shadow:feed()
358 358 game.level.map:particleEmitter(x, y, 1, "teleport_in")
359 359
  360 + shadow.no_party_ai = true
  361 + shadow.unused_stats = 0
  362 + shadow.unused_talents = 0
  363 + shadow.unused_generics = 0
  364 + shadow.unused_talents_types = 0
  365 + shadow.no_points_on_levelup = true
  366 + if game.party:hasMember(self) then
  367 + shadow.remove_from_party_on_death = true
  368 + game.party:addMember(shadow, { control="no", type="summon", title="Summon"})
  369 + end
  370 +
360 371 game:playSoundNear(self, "talents/spell_generic")
361 372 return true
362 373 end,
363   - removeAllShadows = function(self, t)
364   - for _, e in pairs(game.level.entities) do
365   - if e.summoner and e.summoner == self and e.subtype == "shadow" then
366   - e:die()
367   - end
368   - end
369   - end,
370 374 info = function(self, t)
371 375 local maxShadows = t.getMaxShadows(self, t)
372 376 local level = t.getLevel(self, t)
... ...