public void onWield(Living who) {

    if (modifiers == null) return;

    Enumeration en = modifiers.elements();

    while (en.hasMoreElements()) {
      DefaultModifierImpl m = (DefaultModifierImpl) en.nextElement();
      m.setActive(true);
      who.addModifier(m);
    }
  }
Example #2
0
  public void use(SkillUsageContext suc) {
    Living who = suc.getActor();
    MObject target = suc.getTarget();
    int success = suc.getSkillSuccess();

    if (success > 0) {

      who.notice("You chant 'Noir Noir' and create a ball of darkness.");
      who.getRoom()
          .notice(who, who.getName() + " chants 'Noir Noir' and creates a ball of darkness.");

      who.addModifier(new DarknessModifier(20, who));

    } else {
      who.notice("You chant 'Noir Noir' but your spell just fizzles.");
      who.getRoom().notice(who, who.getName() + " chants 'Noir Noir'.");
    }
  }