Commit 13b1bc6daf660d2e3e5b23e998bd73c1fa6d80d8

Authored by dg
1 parent 63c64345

tweak tactical ai


git-svn-id: http://svn.net-core.org/repos/t-engine4@3339 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -167,7 +167,7 @@ function _M:checkFilter(e, filter, type)
167 167 if not filter then return true end
168 168 if filter.ignore and self:checkFilter(e, filter.ignore, type) then return false end
169 169
170   --- print("Checking filter", filter.type, filter.subtype)
  170 + forceprint("Checking filter", filter.type, filter.subtype, "::", e.type,e.subtype,e.name)
171 171 if filter.type and filter.type ~= e.type then return false end
172 172 if filter.subtype and filter.subtype ~= e.subtype then return false end
173 173 if filter.name and filter.name ~= e.name then return false end
... ...
... ... @@ -279,22 +279,22 @@ newAI("use_tactical", function(self)
279 279 if avail.attack and self.ai_target.actor then
280 280 -- Use the foe/ally ratio from the best attack talent
281 281 table.sort(avail.attack, function(a,b) return a.val > b.val end)
282   - want.attack = (avail.attack[1].nb_foes_hit or 1) - ally_compassion * (avail.attack[1].nb_allies_hit or 0) - self_compassion * (avail.attack[1].nb_self_hit or 0)
  282 + want.attack = avail.attack[1].val
283 283 end
284 284 if avail.disable and self.ai_target.actor then
285 285 -- Use the foe/ally ratio from the best disable talent
286 286 table.sort(avail.disable, function(a,b) return a.val > b.val end)
287   - want.disable = (want.attack or 0) + (avail.disable[1].nb_foes_hit or 1) - ally_compassion * (avail.disable[1].nb_allies_hit or 0) - self_compassion * (avail.disable[1].nb_self_hit or 0)
  287 + want.disable = (want.attack or 0) + avail.disable[1].val
288 288 end
289 289 if avail.attackarea and self.ai_target.actor then
290 290 -- Use the foe/ally ratio from the best attackarea talent
291 291 table.sort(avail.attackarea, function(a,b) return a.val > b.val end)
292   - want.attackarea = (want.attack or 0) + (avail.attackarea[1].nb_foes_hit or nb_foes_seen) - ally_compassion * (avail.attackarea[1].nb_allies_hit or nb_allies_seen) - self_compassion * (avail.attackarea[1].nb_self_hit or 0)
  292 + want.attackarea = avail.attackarea[1].val
293 293 end
294 294
295 295 -- Need buffs
296 296 if avail.buff and want.attack and want.attack > 0 then
297   - want.buff = math.max(0.01, want.attack - 1)
  297 + want.buff = math.max(0.01, want.attack + 0.5)
298 298 end
299 299
300 300 print("Tactical ai report for", self.name)
... ...
... ... @@ -949,7 +949,7 @@ function _M:entityFilter(zone, e, filter, type)
949 949 if not filter.ingore_material_restriction then
950 950 local min_mlvl = util.getval(zone.min_material_level)
951 951 local max_mlvl = util.getval(zone.max_material_level)
952   - if min_mlvl then
  952 + if min_mlvl and not e.material_level_min_only then
953 953 if not e.material_level then return true end
954 954 if e.material_level < min_mlvl then return false end
955 955 end
... ...
... ... @@ -478,7 +478,7 @@ function _M:generateOne(e)
478 478 end
479 479 else
480 480 m.on_added = function (self)
481   - if m.on_added_orig then m.on_added_orig(self) end
  481 + if self.on_added_orig then self.on_added_orig(self) end
482 482 game.level.arena.danger = game.level.arena.danger + self.arenaPower
483 483 end
484 484 end
... ...
... ... @@ -42,7 +42,7 @@ newEntity{
42 42 open_door = true,
43 43 resolvers.sustains_at_birth(),
44 44
45   - resolvers.inscriptions(2, "infusion"),
  45 +-- resolvers.inscriptions(2, "infusion"),
46 46
47 47 autolevel = "warrior",
48 48 ai = "dumb_talented_simple", ai_state = { ai_move="move_dmap", talent_in=3, },
... ... @@ -56,6 +56,17 @@ newEntity{
56 56 }
57 57
58 58 newEntity{ base = "BASE_NPC_ORC_GORBAT",
  59 + name = "orc TEST", color=colors.YELLOW,
  60 + desc = [[A fierce orc attuned to the wilds.]],
  61 + level_range = {30, nil}, exp_worth = 1,
  62 + rarity = 1,
  63 + ai = "tactical",
  64 + ai_state = { talent_in=1, },
  65 + rank=3,
  66 + resolvers.inscriptions(1, {"speed rune"}),
  67 +}
  68 +
  69 +newEntity{ base = "BASE_NPC_ORC_GORBAT",
59 70 name = "orc summoner", color=colors.YELLOW,
60 71 desc = [[A fierce orc attuned to the wilds.]],
61 72 level_range = {30, nil}, exp_worth = 1,
... ... @@ -110,7 +121,7 @@ newEntity{ base = "BASE_NPC_ORC_GORBAT",
110 121 resolvers.racial(),
111 122 }
112 123
113   -newEntity{ base = "BASE_NPC_ORC",
  124 +newEntity{ base = "BASE_NPC_ORC_GORBAT",
114 125 name = "orc master wyrmic", color=colors.LIGHT_STEEL_BLUE,
115 126 desc = [[A fierce soldier-orc highly trained in the discipline of dragons.]],
116 127 level_range = {30, nil}, exp_worth = 1,
... ... @@ -143,7 +154,7 @@ newEntity{ base = "BASE_NPC_ORC",
143 154 resolvers.racial(),
144 155 }
145 156
146   -newEntity{ base = "BASE_NPC_ORC",
  157 +newEntity{ base = "BASE_NPC_ORC_GORBAT",
147 158 name = "orc mage-hunter", color=colors.HONEYDEW,
148 159 desc = [[An orc clad in massive armour, magic seems to die down all around him.]],
149 160 level_range = {30, nil}, exp_worth = 1,
... ...
... ... @@ -46,6 +46,7 @@ newEntity{
46 46 fire_destroy = {{100,1}, {200,2}, {400,5}, {600,10}, {1200,20}},
47 47 desc = [[Natural infusions may be grafted onto your body, granting you an on-demand ability.]],
48 48 egos = "/data/general/objects/egos/infusions.lua", egos_chance = resolvers.mbonus(30, 5),
  49 + material_level_min_only = true,
49 50
50 51 power_source = {nature=true},
51 52 use_simple = { name="inscribe your skin with the infusion.", use = function(self, who, inven, item)
... ... @@ -68,6 +69,7 @@ newEntity{
68 69 fire_destroy = {{10,1}, {20,2}, {40,5}, {60,10}, {120,20}},
69 70 desc = [[Magical runes may be inscribed onto your body, granting you an on-demand ability.]],
70 71 egos = "/data/general/objects/egos/infusions.lua", egos_chance = resolvers.mbonus(30, 5),
  72 + material_level_min_only = true,
71 73
72 74 power_source = {arcane=true},
73 75 use_simple = { name="inscribe your skin with the rune.", use = function(self, who, inven, item)
... ... @@ -356,7 +358,7 @@ newEntity{ base = "BASE_RUNE",
356 358 dur = resolvers.mbonus_level(4, 3),
357 359 power = resolvers.mbonus_level(30, 30, function(e, v) return v * 0.3 end),
358 360 use_stat_mod = 0.3,
359   - nb_uses = resolvers.mbonus_level(7, 4),
  361 + nb_uses = 2, --resolvers.mbonus_level(7, 4),
360 362 },
361 363 inscription_talent = "RUNE:_SPEED",
362 364 }
... ...
... ... @@ -410,7 +410,7 @@ newInscription{
410 410 type = {"inscriptions/runes", 1},
411 411 points = 1,
412 412 is_spell = true,
413   - tactical = { DEFEND = 1, ESCAPE = 1 },
  413 + tactical = { DEFEND = 3, ESCAPE = 2 },
414 414 action = function(self, t)
415 415 local data = self:getInscriptionData(t.short_name)
416 416 self:setEffect(self.EFF_INVISIBILITY, data.dur, {power=data.power + data.inc_stat})
... ... @@ -434,7 +434,7 @@ newInscription{
434 434 points = 1,
435 435 is_spell = true,
436 436 no_energy = true,
437   - tactical = { BUFF = 2 },
  437 + tactical = { BUFF = 4 },
438 438 action = function(self, t)
439 439 local data = self:getInscriptionData(t.short_name)
440 440 self:setEffect(self.EFF_SPEED, data.dur, {power=(data.power + data.inc_stat) / 100})
... ...