コード例 #1
0
ファイル: testPostPercent.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     srcAttr = self.ch.attribute(attributeId=2)
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = srcAttr.id
     modifier.operator = Operator.postPercent
     modifier.targetAttributeId = self.tgtAttr.id
     modifier.location = Location.ship
     modifier.filterType = FilterType.all_
     modifier.filterValue = None
     effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     effect.modifiers = (modifier,)
     self.influenceSource1 = IndependentItem(self.ch.type_(typeId=1, effects=(effect,), attributes={srcAttr.id: 20}))
     self.influenceSource2 = IndependentItem(self.ch.type_(typeId=2, effects=(effect,), attributes={srcAttr.id: 50}))
     self.influenceSource3 = IndependentItem(self.ch.type_(typeId=3, effects=(effect,), attributes={srcAttr.id: -90}))
     self.influenceSource4 = IndependentItem(self.ch.type_(typeId=4, effects=(effect,), attributes={srcAttr.id: -25}))
     self.influenceSource5 = IndependentItem(self.ch.type_(typeId=5, effects=(effect,), attributes={srcAttr.id: 400}))
     self.influenceTarget = ShipItem(self.ch.type_(typeId=6, attributes={self.tgtAttr.id: 100}))
     self.fit.items.add(self.influenceSource1)
     self.fit.items.add(self.influenceSource2)
     self.fit.items.add(self.influenceSource3)
     self.fit.items.add(self.influenceSource4)
     self.fit.items.add(self.influenceSource5)
     self.fit.items.add(self.influenceTarget)
コード例 #2
0
ファイル: testOther.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     srcAttr = self.ch.attribute(attributeId=2)
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = srcAttr.id
     modifier.operator = Operator.postPercent
     modifier.targetAttributeId = self.tgtAttr.id
     modifier.location = Location.other
     modifier.filterType = None
     modifier.filterValue = None
     effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     effect.modifiers = (modifier, )
     # We added target attribute to influence source for testSelf;
     # currently, eos cannot calculate attributes which are originally
     # missing on item
     self.influenceSource = ItemWithOther(
         self.ch.type_(typeId=1,
                       effects=(effect, ),
                       attributes={
                           self.tgtAttr.id: 100,
                           srcAttr.id: 20
                       }))
     self.fit.items.add(self.influenceSource)
コード例 #3
0
ファイル: testPreAssign.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     srcAttr = self.ch.attribute(attributeId=2)
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = srcAttr.id
     modifier.operator = Operator.preAssignment
     modifier.targetAttributeId = self.tgtAttr.id
     modifier.location = Location.ship
     modifier.filterType = FilterType.all_
     modifier.filterValue = None
     effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     effect.modifiers = (modifier, )
     self.influenceSource1 = IndependentItem(
         self.ch.type_(typeId=1,
                       effects=(effect, ),
                       attributes={srcAttr.id: 10}))
     self.influenceSource2 = IndependentItem(
         self.ch.type_(typeId=2,
                       effects=(effect, ),
                       attributes={srcAttr.id: -20}))
     self.influenceSource3 = IndependentItem(
         self.ch.type_(typeId=3,
                       effects=(effect, ),
                       attributes={srcAttr.id: 53}))
     self.influenceTarget = ShipItem(
         self.ch.type_(typeId=4, attributes={self.tgtAttr.id: 100}))
     self.fit.items.add(self.influenceSource1)
     self.fit.items.add(self.influenceSource2)
     self.fit.items.add(self.influenceSource3)
     self.fit.items.add(self.influenceTarget)
コード例 #4
0
ファイル: testState.py プロジェクト: haart/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1, stackable=1)
     srcAttr1 = self.ch.attribute(attributeId=2)
     srcAttr2 = self.ch.attribute(attributeId=3)
     srcAttr3 = self.ch.attribute(attributeId=4)
     srcAttr4 = self.ch.attribute(attributeId=5)
     modifierOff = Modifier()
     modifierOff.state = State.offline
     modifierOff.context = Context.local
     modifierOff.sourceAttributeId = srcAttr1.id
     modifierOff.operator = Operator.postMul
     modifierOff.targetAttributeId = self.tgtAttr.id
     modifierOff.location = Location.self_
     modifierOff.filterType = None
     modifierOff.filterValue = None
     modifierOn = Modifier()
     modifierOn.state = State.online
     modifierOn.context = Context.local
     modifierOn.sourceAttributeId = srcAttr2.id
     modifierOn.operator = Operator.postMul
     modifierOn.targetAttributeId = self.tgtAttr.id
     modifierOn.location = Location.self_
     modifierOn.filterType = None
     modifierOn.filterValue = None
     modifierAct = Modifier()
     modifierAct.state = State.active
     modifierAct.context = Context.local
     modifierAct.sourceAttributeId = srcAttr3.id
     modifierAct.operator = Operator.postMul
     modifierAct.targetAttributeId = self.tgtAttr.id
     modifierAct.location = Location.self_
     modifierAct.filterType = None
     modifierAct.filterValue = None
     modifierOver = Modifier()
     modifierOver.state = State.overload
     modifierOver.context = Context.local
     modifierOver.sourceAttributeId = srcAttr4.id
     modifierOver.operator = Operator.postMul
     modifierOver.targetAttributeId = self.tgtAttr.id
     modifierOver.location = Location.self_
     modifierOver.filterType = None
     modifierOver.filterValue = None
     # Overload category will make sure that holder can enter all states
     effect = self.ch.effect(effectId=1, categoryId=EffectCategory.overload)
     effect.modifiers = (modifierOff, modifierOn, modifierAct, modifierOver)
     self.holder = IndependentItem(
         self.ch.type_(
             typeId=1,
             effects=(effect,),
             attributes={
                 self.tgtAttr.id: 100,
                 srcAttr1.id: 1.1,
                 srcAttr2.id: 1.3,
                 srcAttr3.id: 1.5,
                 srcAttr4.id: 1.7,
             },
         )
     )
コード例 #5
0
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.attr1 = self.ch.attribute(attributeId=1)
     self.attr2 = self.ch.attribute(attributeId=2)
     self.attr3 = self.ch.attribute(attributeId=3)
     self.holder = IndependentItem(self.ch.type_(typeId=1, attributes={self.attr1.id: 5, self.attr2.id: 10}))
     self.fit.items.add(self.holder)
     self.holder.attributes._MutableAttributeMap__modifiedAttributes = {self.attr2.id: 20, self.attr3.id: 40}
コード例 #6
0
ファイル: testState.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1, stackable=1)
     srcAttr1 = self.ch.attribute(attributeId=2)
     srcAttr2 = self.ch.attribute(attributeId=3)
     srcAttr3 = self.ch.attribute(attributeId=4)
     srcAttr4 = self.ch.attribute(attributeId=5)
     modifierOff = Modifier()
     modifierOff.state = State.offline
     modifierOff.context = Context.local
     modifierOff.sourceAttributeId = srcAttr1.id
     modifierOff.operator = Operator.postMul
     modifierOff.targetAttributeId = self.tgtAttr.id
     modifierOff.location = Location.self_
     modifierOff.filterType = None
     modifierOff.filterValue = None
     modifierOn = Modifier()
     modifierOn.state = State.online
     modifierOn.context = Context.local
     modifierOn.sourceAttributeId = srcAttr2.id
     modifierOn.operator = Operator.postMul
     modifierOn.targetAttributeId = self.tgtAttr.id
     modifierOn.location = Location.self_
     modifierOn.filterType = None
     modifierOn.filterValue = None
     modifierAct = Modifier()
     modifierAct.state = State.active
     modifierAct.context = Context.local
     modifierAct.sourceAttributeId = srcAttr3.id
     modifierAct.operator = Operator.postMul
     modifierAct.targetAttributeId = self.tgtAttr.id
     modifierAct.location = Location.self_
     modifierAct.filterType = None
     modifierAct.filterValue = None
     modifierOver = Modifier()
     modifierOver.state = State.overload
     modifierOver.context = Context.local
     modifierOver.sourceAttributeId = srcAttr4.id
     modifierOver.operator = Operator.postMul
     modifierOver.targetAttributeId = self.tgtAttr.id
     modifierOver.location = Location.self_
     modifierOver.filterType = None
     modifierOver.filterValue = None
     # Overload category will make sure that holder can enter all states
     effect = self.ch.effect(effectId=1, categoryId=EffectCategory.overload)
     effect.modifiers = (modifierOff, modifierOn, modifierAct, modifierOver)
     self.holder = IndependentItem(
         self.ch.type_(typeId=1,
                       effects=(effect, ),
                       attributes={
                           self.tgtAttr.id: 100,
                           srcAttr1.id: 1.1,
                           srcAttr2.id: 1.3,
                           srcAttr3.id: 1.5,
                           srcAttr4.id: 1.7
                       }))
コード例 #7
0
ファイル: testUnknown.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     self.srcAttr = self.ch.attribute(attributeId=2)
     self.invalidModifier = invalidModifier = Modifier()
     invalidModifier.state = State.offline
     invalidModifier.context = Context.local
     invalidModifier.sourceAttributeId = self.srcAttr.id
     invalidModifier.operator = Operator.postPercent
     invalidModifier.targetAttributeId = self.tgtAttr.id
     invalidModifier.location = 1972
     invalidModifier.filterType = FilterType.all_
     invalidModifier.filterValue = None
     self.effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
コード例 #8
0
ファイル: testCategory.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1, stackable=0)
     self.srcAttr = self.ch.attribute(attributeId=2)
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = self.srcAttr.id
     modifier.operator = Operator.postPercent
     modifier.targetAttributeId = self.tgtAttr.id
     modifier.location = Location.ship
     modifier.filterType = FilterType.all_
     modifier.filterValue = None
     self.effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     self.effect.modifiers = (modifier,)
コード例 #9
0
ファイル: testUnknown.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     self.srcAttr = self.ch.attribute(attributeId=2)
     self.invalidModifier = invalidModifier = Modifier()
     invalidModifier.state = State.offline
     invalidModifier.context = Context.local
     invalidModifier.sourceAttributeId = self.srcAttr.id
     invalidModifier.operator = Operator.postPercent
     invalidModifier.targetAttributeId = self.tgtAttr.id
     invalidModifier.location = 1972
     invalidModifier.filterType = None
     invalidModifier.filterValue = None
     self.effect = self.ch.effect(effectId=1,
                                  categoryId=EffectCategory.passive)
コード例 #10
0
ファイル: testSelf.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     self.srcAttr = self.ch.attribute(attributeId=2)
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = self.srcAttr.id
     modifier.operator = Operator.postPercent
     modifier.targetAttributeId = self.tgtAttr.id
     modifier.location = Location.self_
     modifier.filterType = None
     modifier.filterValue = None
     self.effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     self.effect.modifiers = (modifier,)
コード例 #11
0
ファイル: testSelf.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     srcAttr = self.ch.attribute(attributeId=2)
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = srcAttr.id
     modifier.operator = Operator.postPercent
     modifier.targetAttributeId = self.tgtAttr.id
     modifier.location = Location.self_
     modifier.filterType = FilterType.all_
     modifier.filterValue = None
     effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     effect.modifiers = (modifier,)
     self.influenceSource = IndependentItem(self.ch.type_(typeId=1061, effects=(effect,), attributes={srcAttr.id: 20}))
コード例 #12
0
ファイル: testCharacter.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     srcAttr = self.ch.attribute(attributeId=2)
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = srcAttr.id
     modifier.operator = Operator.postPercent
     modifier.targetAttributeId = self.tgtAttr.id
     modifier.location = Location.character
     modifier.filterType = None
     modifier.filterValue = None
     effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     effect.modifiers = (modifier,)
     self.influenceSource = IndependentItem(self.ch.type_(typeId=11, effects=(effect,), attributes={srcAttr.id: 20}))
     self.fit.items.add(self.influenceSource)
コード例 #13
0
ファイル: testCap.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.cappedAttr = self.ch.attribute(attributeId=1, maxAttributeId=2)
     self.cappingAttr = self.ch.attribute(attributeId=2, defaultValue=5)
     self.sourceAttr = self.ch.attribute(attributeId=3)
     # Just to make sure cap is applied to final value, not
     # base, make some basic modification modifier
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = self.sourceAttr.id
     modifier.operator = Operator.postMul
     modifier.targetAttributeId = self.cappedAttr.id
     modifier.location = Location.self_
     modifier.filterType = None
     modifier.filterValue = None
     self.effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     self.effect.modifiers = (modifier,)
コード例 #14
0
ファイル: testCharacter.py プロジェクト: NiGhTTraX/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     srcAttr = self.ch.attribute(attributeId=2)
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = srcAttr.id
     modifier.operator = Operator.postPercent
     modifier.targetAttributeId = self.tgtAttr.id
     modifier.location = Location.character
     modifier.filterType = FilterType.all_
     modifier.filterValue = None
     effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     effect.modifiers = (modifier,)
     # It doesn't matter holder of which type we're using,
     # the only thing which matters is its position in fit
     self.influenceSource = IndependentItem(self.ch.type_(typeId=1, effects=(effect,), attributes={srcAttr.id: 20}))
     self.fit.items.add(self.influenceSource)
コード例 #15
0
ファイル: testOther.py プロジェクト: bastianh/Eos
 def setUp(self):
     AttrCalcTestCase.setUp(self)
     self.tgtAttr = self.ch.attribute(attributeId=1)
     srcAttr = self.ch.attribute(attributeId=2)
     modifier = Modifier()
     modifier.state = State.offline
     modifier.context = Context.local
     modifier.sourceAttributeId = srcAttr.id
     modifier.operator = Operator.postPercent
     modifier.targetAttributeId = self.tgtAttr.id
     modifier.location = Location.other
     modifier.filterType = None
     modifier.filterValue = None
     effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
     effect.modifiers = (modifier,)
     # We added target attribute to influence source for testSelf;
     # currently, eos cannot calculate attributes which are originally
     # missing on item
     self.influenceSource = ItemWithOther(self.ch.type_(typeId=1, effects=(effect,), attributes={self.tgtAttr.id: 100, srcAttr.id: 20}))
     self.fit.items.add(self.influenceSource)