analyze and understand the pickit file

mcsego

Guest
I have an example here

[Type] == Ring && [Quality] == Rare # ([Strength] >= 12 || [Dexterity] >= 10) && [ItemGoldBonus] >= 30 && ([MaxHp] >= 20 || [HpRegen] >= 6) && [MaxMana] >= 40 && (([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15) + ([ColdResist]+[FireResist]+[LightResist]+[PoisonResist] >= 24)) == 2

how do you understand the last lines?

&& (([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15) + ([ColdResist]+[FireResist]+[LightResist]+[PoisonResist] >= 24)) == 2

what does the last mean here?
== 2
 
Solution
Yeah that expression is not very clean and makes more sense if expressed in another way.

lets break it down into the brackets:

&& (([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15) + ([ColdResist]+[FireResist]+[LightResist]+[PoisonResist] >= 24)) == 2

Expression1 # ([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15)
Expression2 # ([ColdResist]+[FireResist]+[LightResist]+[PoisonResist] >= 24)
Expression3 # (Expression1 + Expression2) == 2

if Expression1 is true it gets value of 1
if Expression2 is true it gets value of 1 as well

Expression3 gets valid only if both Expression1 AND Expression2 are valid -> then they sum up to 1+1=2.

So this ring must have both >>

([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15)
That means, Cold, Fire and Light res must be >=15 each

AND...

uebertopf

Member
Yeah that expression is not very clean and makes more sense if expressed in another way.

lets break it down into the brackets:

&& (([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15) + ([ColdResist]+[FireResist]+[LightResist]+[PoisonResist] >= 24)) == 2

Expression1 # ([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15)
Expression2 # ([ColdResist]+[FireResist]+[LightResist]+[PoisonResist] >= 24)
Expression3 # (Expression1 + Expression2) == 2

if Expression1 is true it gets value of 1
if Expression2 is true it gets value of 1 as well

Expression3 gets valid only if both Expression1 AND Expression2 are valid -> then they sum up to 1+1=2.

So this ring must have both >>

([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15)
That means, Cold, Fire and Light res must be >=15 each

AND
([ColdResist]+[FireResist]+[LightResist]+[PoisonResist] >= 24)
In Sum all res together must be >=24.
That means, Poison MAY be smaller, or even not there, because we already specified the other res as >=15 each.

This is the confusing part. If fire, light and cold each must be >=15 - Allres must be at least 45 without including poison. you could increase that value to introduce a min res for poison as well, but you could've done it before by specifying poison res.
So the socond one does make no sense at all.

To give the second expression some sense, you could amend the value from 24 to 50 for example.
That way Poison must be at least 5%. Or 55 for 10% poison.

Taking the original statement:
&& (([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15) + ([ColdResist]+[FireResist]+[LightResist]+[PoisonResist] >= 24)) == 2

You could transform it into
* minimum res for each resist defined:
&& (([ColdResist] >= 15) + ([FireResist] >= 15) + ([LightResist] >= 15) + ([PoisonResist] >= 8) == 1
* only sum of res defined:
&& ([ColdResist]+[FireResist]+[LightResist]+[PoisonResist] >= 40)
this last one allows a res to be any number, as long as the sum is >= 40.
example:
LightRes +11
FireRes +6
ColdRes+14
PoisonRes+12

hope that helps a bit to understand.
 
Solution
Top