protected void processSoulMark(Char target, int chargesUsed){ if (target != Dungeon.hero && Dungeon.hero.subClass == HeroSubClass.WARLOCK && //standard 1 - 0.92^x chance, plus 7%. Starts at 15% Random.Float() > (Math.pow(0.92f, (level()*chargesUsed)+1) - 0.07f)){ SoulMark.prolong(target, SoulMark.class, SoulMark.DURATION + level()); } }
protected void processSoulMark(Char target, int chargesUsed){ if (target != Dungeon.hero && Dungeon.hero.subClass == HeroSubClass.WARLOCK && //standard 1 - 0.92^x chance, plus 7%. Starts at 15% Random.Float() > (Math.pow(0.92f, (level()*chargesUsed)+1) - 0.07f)){ SoulMark.prolong(target, SoulMark.class, SoulMark.DURATION + level()); } }
public void updateLevel() { maxCharges = Math.min( initialCharges() + level(), 10 ); curCharges = Math.min( curCharges, maxCharges ); }
public void updateLevel() { maxCharges = Math.min( initialCharges() + level(), 10 ); curCharges = Math.min( curCharges, maxCharges ); }
private Wand changeWand( Wand w ) { Wand n; do { n = (Wand)Generator.random( Generator.Category.WAND ); } while ( Challenges.isItemBlocked(n) || n.getClass() == w.getClass()); n.level( 0 ); n.upgrade( w.level() ); n.levelKnown = w.levelKnown; n.cursedKnown = w.cursedKnown; n.cursed = w.cursed; return n; }
private Wand changeWand( Wand w ) { Wand n; do { n = (Wand)Generator.random( Generator.Category.WAND ); } while ( Challenges.isItemBlocked(n) || n.getClass() == w.getClass()); n.level( 0 ); n.upgrade( w.level() ); n.levelKnown = w.levelKnown; n.cursedKnown = w.cursedKnown; n.cursed = w.cursed; return n; }
@Override public Item upgrade() { super.upgrade(); if (Random.Float() > Math.pow(0.8, level())) { cursed = false; } updateLevel(); curCharges = Math.min( curCharges + 1, maxCharges ); updateQuickslot(); return this; }
@Override public Item upgrade() { super.upgrade(); if (Random.Float() > Math.pow(0.8, level())) { cursed = false; } updateLevel(); curCharges = Math.min( curCharges + 1, maxCharges ); updateQuickslot(); return this; }
private MagesStaff changeStaff( MagesStaff staff ){ Class<?extends Wand> wandClass = staff.wandClass(); if (wandClass == null){ return null; } else { Wand n; do { n = (Wand) Generator.random(Generator.Category.WAND); } while (Challenges.isItemBlocked(n) || n.getClass() == wandClass); n.level(0); staff.imbueWand(n, null); } return staff; }
private MagesStaff changeStaff( MagesStaff staff ){ Class<?extends Wand> wandClass = staff.wandClass(); if (wandClass == null){ return null; } else { Wand n; do { n = (Wand) Generator.random(Generator.Category.WAND); } while (Challenges.isItemBlocked(n) || n.getClass() == wandClass); n.level(0); staff.imbueWand(n, null); } return staff; }
private MagesStaff changeStaff( MagesStaff staff ){ Class<?extends Wand> wandClass = staff.wandClass(); if (wandClass == null){ return null; } else { Wand n; do { n = (Wand)Generator.random(Category.WAND); } while (Challenges.isItemBlocked(n) || n.getClass() == wandClass); n.level(0); staff.imbueWand(n, null); } return staff; }
private MagesStaff changeStaff( MagesStaff staff ){ Class<?extends Wand> wandClass = staff.wandClass(); if (wandClass == null){ return null; } else { Wand n; do { n = (Wand)Generator.random(Category.WAND); } while (Challenges.isItemBlocked(n) || n.getClass() == wandClass); n.level(0); staff.imbueWand(n, null); } return staff; }
@Override public Item random() { //+0: 66.67% (2/3) //+1: 26.67% (4/15) //+2: 6.67% (1/15) int n = 0; if (Random.Int(3) == 0) { n++; if (Random.Int(5) == 0){ n++; } } level(n); //30% chance to be cursed if (Random.Float() < 0.3f) { cursed = true; } return this; }
@Override public Item random() { //+0: 66.67% (2/3) //+1: 26.67% (4/15) //+2: 6.67% (1/15) int n = 0; if (Random.Int(3) == 0) { n++; if (Random.Int(5) == 0){ n++; } } level(n); //30% chance to be cursed if (Random.Float() < 0.3f) { cursed = true; } return this; }