MCPcopy Create free account
hub / github.com/PCGen/pcgen / setUp

Method setUp

code/src/test/pcgen/io/exporttoken/WeaponTokenTest.java:87–382  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85 private PCTemplate wpnBonusPct;
86
87 @BeforeEach
88 @Override
89 protected void setUp() throws Exception
90 {
91 super.setUp();
92 PlayerCharacter character = getCharacter();
93 LoadContext context = Globals.getContext();
94
95 //Stats
96 setPCStat(character, str, 15);
97 setPCStat(character, dex, 16);
98 setPCStat(character, intel, 17);
99 BonusObj aBonus = Bonus.newBonus(context, "COMBAT|TOHIT.Melee|STR|TYPE=Ability");
100
101 if (aBonus != null)
102 {
103 str.addToListFor(ListKey.BONUS, aBonus);
104 }
105 aBonus = Bonus.newBonus(context, "COMBAT|DAMAGE.Melee,DAMAGE.Thrown|STR");
106
107 if (aBonus != null)
108 {
109 str.addToListFor(ListKey.BONUS, aBonus);
110 }
111 aBonus = Bonus.newBonus(context, "COMBAT|DAMAGEMULT:0|0.5*(STR>=0)");
112
113 if (aBonus != null)
114 {
115 str.addToListFor(ListKey.BONUS, aBonus);
116 }
117 aBonus = Bonus.newBonus(context, "COMBAT|DAMAGEMULT:1|1");
118
119 if (aBonus != null)
120 {
121 str.addToListFor(ListKey.BONUS, aBonus);
122 }
123 aBonus = Bonus.newBonus(context, "COMBAT|DAMAGEMULT:2|1.5*(STR>=0)");
124
125 if (aBonus != null)
126 {
127 str.addToListFor(ListKey.BONUS, aBonus);
128 }
129
130 aBonus = Bonus.newBonus(context, "MODSKILLPOINTS|NUMBER|INT");
131
132 if (aBonus != null)
133 {
134 intel.addToListFor(ListKey.BONUS, aBonus);
135 }
136
137 // Race
138 Race testRace = new Race();
139 testRace.setName("TestRace");
140 testRace.put(StringKey.KEY_NAME, "KEY_TEST_RACE");
141 CDOMDirectSingleRef<SizeAdjustment> mediumRef = CDOMDirectSingleRef.getRef(medium);
142 CDOMDirectSingleRef<SizeAdjustment> largeRef = CDOMDirectSingleRef.getRef(large);
143 testRace.put(FormulaKey.SIZE, new FixedSizeFormula(mediumRef));
144 character.setRace(testRace);

Callers

nothing calls this directly

Calls 15

getContextMethod · 0.95
newBonusMethod · 0.95
getRefMethod · 0.95
setRaceMethod · 0.95
getFormulaForMethod · 0.95
getOriginalClassLevelMethod · 0.95
getReferenceContextMethod · 0.95
incrementClassLevelMethod · 0.95
calcActiveBonusesMethod · 0.95
addTypeMethod · 0.95
addEquipmentMethod · 0.95
addEquipSetMethod · 0.95

Tested by

no test coverage detected