Commit 01203ecd539f50b2703da256e8e98a7c46489037

Authored by Chris Davidson
1 parent c09e52e9

Revise and add a bunch of autoequip filters

... ... @@ -90,6 +90,17 @@ newBirthDescriptor{
90 90 },
91 91 copy = {
92 92 max_life = 110,
  93 + resolvers.auto_equip_filters{
  94 + MAINHAND = {type="weapon", properties={"twohanded"}},
  95 + OFFHAND = {special=function(e, filter) -- only allow if there is already a weapon in MAINHAND
  96 + local who = filter._equipping_entity
  97 + if who then
  98 + local mh = who:getInven(who.INVEN_MAINHAND) mh = mh and mh[1]
  99 + if mh and (not mh.slot_forbid or not who:slotForbidCheck(e, who.INVEN_MAINHAND)) then return true end
  100 + end
  101 + return false
  102 + end},
  103 + },
93 104 resolvers.equipbirth{ id=true,
94 105 {type="weapon", subtype="battleaxe", name="iron battleaxe", autoreq=true, ego_chance=-1000},
95 106 {type="armor", subtype="heavy", name="iron mail armour", autoreq=true, ego_chance=-1000, ego_chance=-1000}
... ...
... ... @@ -84,14 +84,17 @@ newBirthDescriptor{
84 84 },
85 85 copy = {
86 86 resolvers.auto_equip_filters{
87   - MAINHAND = {type="weapon", special=function(e, filter) -- allow any weapon that doesn't forbid OFFHAND
88   - if e.slot_forbid == "OFFHAND" then
89   - local who = filter._equipping_entity
90   - return who and not who:slotForbidCheck(e, who.INVEN_MAINHAND)
  87 + MAINHAND = {type="weapon", not_properties={"twohanded"}, special=function(e, filter) -- Allow standard 1H strength weapons and 1H staves, not currently working with ogre
  88 + local who = filter._equipping_entity
  89 + if who and e.subtype and (e.subtype == "staff" or e.subtype == "waraxe" or e.subtype == "longsword" or e.subtype == "mace") then return true end
  90 + end},
  91 + OFFHAND = {type="weapon", not_properties={"twohanded"}, special=function(e, filter)
  92 + local who = filter._equipping_entity
  93 + if who then
  94 + local mh = who:getInven(who.INVEN_MAINHAND) mh = mh and mh[1]
  95 + if mh and (not mh.slot_forbid or not who:slotForbidCheck(e, who.INVEN_MAINHAND)) and e.subtype and (e.subtype == "staff" or e.subtype == "waraxe" or e.subtype == "longsword" or e.subtype == "mace") then return true end
91 96 end
92   - return true
93 97 end},
94   - OFFHAND = {type="weapon", not_properties={"twohanded"}}
95 98 },
96 99 resolvers.equipbirth{ id=true,
97 100 {type="weapon", subtype="waraxe", name="iron waraxe", autoreq=true, ego_chance=-1000},
... ...
... ... @@ -100,6 +100,20 @@ newBirthDescriptor{
100 100 },
101 101 copy = {
102 102 max_life = 110,
  103 + resolvers.auto_equip_filters{
  104 + MAINHAND = {type="weapon", special=function(e, filter) -- Allow standard 2H strength weapons
  105 + local who = filter._equipping_entity
  106 + if who and e.subtype and (e.subtype == "battleaxe" or e.subtype == "greatsword" or e.subtype == "greatmaul") then return true end
  107 + end},
  108 + OFFHAND = {special=function(e, filter) -- only allow if there is already a weapon in MAINHAND
  109 + local who = filter._equipping_entity
  110 + if who then
  111 + local mh = who:getInven(who.INVEN_MAINHAND) mh = mh and mh[1]
  112 + if mh and (not mh.slot_forbid or not who:slotForbidCheck(e, who.INVEN_MAINHAND)) then return true end
  113 + end
  114 + return false
  115 + end},
  116 + },
103 117 resolvers.equipbirth{ id=true,
104 118 {type="armor", subtype="cloth", name="linen robe", autoreq=true, ego_chance=-1000},
105 119 {type="weapon", subtype="greatsword", name="iron greatsword", autoreq=true, ego_chance=-1000},
... ... @@ -132,7 +146,6 @@ newBirthDescriptor{
132 146 "#GOLD#Life per level:#LIGHT_BLUE# -4 (*special*)",
133 147 },
134 148 power_source = {psionic=true},
135   --- not_on_random_boss = true,
136 149 random_rarity = 3,
137 150 stats = { str=0, wil=5, cun=4, },
138 151 birth_example_particles = {
... ... @@ -171,6 +184,10 @@ newBirthDescriptor{
171 184 },
172 185 copy = {
173 186 max_life = 90,
  187 + resolvers.auto_equip_filters{
  188 + MAINHAND = {type="weapon", subtype="mindstar"},
  189 + OFFHAND = {type="weapon", subtype="mindstar"},
  190 + },
174 191 resolvers.equipbirth{ id=true,
175 192 {type="armor", subtype="cloth", name="linen robe", autoreq=true, ego_chance=-1000},
176 193 {type="weapon", subtype="mindstar", name="mossy mindstar", autoreq=true, ego_chance=-1000},
... ...
... ... @@ -312,12 +312,22 @@ newBirthDescriptor{
312 312 },
313 313 copy = {
314 314 max_life = 100,
315   --- talent_cd_reduction={[ActorTalents.T_FLAME]=-3, [ActorTalents.T_LIGHTNING]=-3, [ActorTalents.T_EARTHEN_MISSILES]=-3, },
  315 + resolvers.auto_equip_filters{
  316 + MAINHAND = {type="weapon", properties={"twohanded"}},
  317 + OFFHAND = {special=function(e, filter) -- only allow if there is already a weapon in MAINHAND
  318 + local who = filter._equipping_entity
  319 + if who then
  320 + local mh = who:getInven(who.INVEN_MAINHAND) mh = mh and mh[1]
  321 + if mh and (not mh.slot_forbid or not who:slotForbidCheck(e, who.INVEN_MAINHAND)) then return true end
  322 + end
  323 + return false
  324 + end},
  325 + },
316 326 resolvers.equipbirth{ id=true,
317 327 {type="weapon", subtype="greatsword", name="iron greatsword", autoreq=true, ego_chance=-1000, ego_chance=-1000},
318 328 {type="armor", subtype="light", name="rough leather armour", autoreq=true, ego_chance=-1000, ego_chance=-1000},
319 329 },
320   - resolvers.inscription("RUNE:_MANASURGE", {cooldown=25, dur=10, mana=620}),
  330 + resolvers.inscription("RUNE:_MANASURGE", {cooldown=25, dur=10, mana=620}, 3),
321 331 },
322 332 copy_add = {
323 333 life_rating = 2,
... ...
... ... @@ -94,6 +94,10 @@ newBirthDescriptor{
94 94 },
95 95 copy = {
96 96 max_life = 90,
  97 + resolvers.auto_equip_filters{
  98 + MAINHAND = {type="weapon", subtype="mindstar"},
  99 + OFFHAND = {type="weapon", subtype="mindstar"},
  100 + },
97 101 resolvers.equipbirth{ id=true,
98 102 {type="weapon", subtype="mindstar", name="mossy mindstar", autoreq=true, ego_chance=-1000},
99 103 {type="weapon", subtype="mindstar", name="mossy mindstar", autoreq=true, ego_chance=-1000},
... ... @@ -153,6 +157,17 @@ newBirthDescriptor{
153 157 copy = {
154 158 drake_touched = 2,
155 159 max_life = 110,
  160 + resolvers.auto_equip_filters{ -- This could be improved to check learned trees since Wyrmics can use a lot of weapons
  161 + MAINHAND = {type="weapon", properties={"twohanded"}},
  162 + OFFHAND = {special=function(e, filter) -- only allow if there is already a weapon in MAINHAND
  163 + local who = filter._equipping_entity
  164 + if who then
  165 + local mh = who:getInven(who.INVEN_MAINHAND) mh = mh and mh[1]
  166 + if mh and (not mh.slot_forbid or not who:slotForbidCheck(e, who.INVEN_MAINHAND)) then return true end
  167 + end
  168 + return false
  169 + end},
  170 + },
156 171 resolvers.equipbirth{ id=true,
157 172 {type="weapon", subtype="battleaxe", name="iron battleaxe", autoreq=true, ego_chance=-1000},
158 173 {type="armor", subtype="heavy", name="iron mail armour", autoreq=true, ego_chance=-1000, ego_chance=-1000} },
... ...