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

Method applyBonus

code/src/java/pcgen/core/analysis/BonusAddition.java:46–55  ·  view source on GitHub ↗

Apply the bonus to a character. The bonus can optionally only be added once no matter how many associated choices this object has. This is normally used where a bonus is added for each associated choice. @param bonusString The unparsed bonus to be added. @param chooseString Th

(String bonusString, String chooseString, PlayerCharacter aPC, CDOMObject target)

Source from the content-addressed store, hash-verified

44 * The character to apply thr bonus to.
45 */
46 public static void applyBonus(String bonusString, String chooseString, PlayerCharacter aPC, CDOMObject target)
47 {
48 bonusString = makeBonusString(bonusString, chooseString, aPC);
49
50 final BonusObj aBonus = Bonus.newBonus(Globals.getContext(), bonusString);
51 if (aBonus != null)
52 {
53 aPC.addSaveableBonus(aBonus, target);
54 }
55 }
56
57 /**
58 * Remove the bonus from this objects list of bonuses.

Callers 3

testAssociatedBonusMethod · 0.95
applyChoiceMethod · 0.95

Calls 4

makeBonusStringMethod · 0.95
newBonusMethod · 0.95
getContextMethod · 0.95
addSaveableBonusMethod · 0.80

Tested by 1

testAssociatedBonusMethod · 0.76