public void affectCharState(MOB affected, CharState affectableState) { super.affectCharState(affected, affectableState); if (affected.location() != null) { Room room = affected.location(); if (affected.charStats().getClassLevel(this) >= 5) { if (CMLib.flags().isInDark(room)) { affectableState.setMana(affectableState.getMana() - (affectableState.getMana() / 4)); affectableState.setMovement( affectableState.getMovement() - (affectableState.getMovement() / 4)); } else if ((room.domainType() & Room.INDOORS) == 0) switch (room.getArea().getClimateObj().weatherType(room)) { case Climate.WEATHER_BLIZZARD: case Climate.WEATHER_CLOUDY: case Climate.WEATHER_DUSTSTORM: case Climate.WEATHER_HAIL: case Climate.WEATHER_RAIN: case Climate.WEATHER_SLEET: case Climate.WEATHER_SNOW: case Climate.WEATHER_THUNDERSTORM: break; default: affectableState.setMana(affectableState.getMana() + (affectableState.getMana() / 4)); affectableState.setMovement( affectableState.getMovement() + (affectableState.getMovement() / 4)); break; } } } }
@Override public void affectCharState(MOB affected, CharState affectableState) { super.affectCharState(affected, affectableState); if (affected.location() != null) for (int i = 0; i < affected.location().numItems(); i++) { final Item I = affected.location().getItem(i); if ((I != null) && (I.ID().equals("DruidicMonument"))) affectableState.setMana(affectableState.getMana() + (affectableState.getMana() / 2)); } }
@Override public void affectCharState(MOB affected, CharState affectableState) { super.affectCharState(affected, affectableState); if (affected == null) return; final int hplevel = affectableState.getHitPoints() / affected.basePhyStats().level(); affectableState.setHitPoints( affectableState.getHitPoints() - (hplevel * (levelsDown * direction))); final int manalevel = affectableState.getMana() / affected.basePhyStats().level(); affectableState.setMana(affectableState.getMana() - (manalevel * (levelsDown * direction))); final int movelevel = affectableState.getMovement() / affected.basePhyStats().level(); affectableState.setMovement( affectableState.getMovement() - (movelevel * (levelsDown * direction))); }
public void affectCharState(MOB mob, CharState state) { super.affectCharState(mob, state); if (mob.baseCharStats().getCurrentClass().ID().equals(ID())) { Ability A = null; for (int a = 0; a < mob.numLearnedAbilities(); a++) { A = mob.fetchAbility(a); if ((A != null) && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_SPELL) && (!CMLib.ableMapper().getDefaultGain(ID(), false, A.ID()))) { int[] cost = A.usageCost(mob, true); int manaCost = cost[Ability.USAGEINDEX_MANA]; if (manaCost > 0) { if (state.getMana() < manaCost) { mob.delAbility(A); a--; } else state.setMana(state.getMana() - manaCost); } } } if (mob.curState().getMana() > state.getMana()) mob.curState().setMana(state.getMana()); } }
@Override public void affectCharState(MOB affected, CharState affectableStats) { if ((whom != null) && (song != null)) { final Hashtable<Integer, Integer> H = getSongBenefits(song); for (final Enumeration<Integer> e = H.keys(); e.hasMoreElements(); ) { final Integer I = e.nextElement(); final String[] chk = stuff[I.intValue()]; if ((chk != null) && (chk[1].startsWith("s"))) { int ticks = H.get(I).intValue(); if (ticks > 50) ticks = 50; if (ticks <= 0) ticks = 1; switch (chk[2].charAt(0)) { case 'h': affectableStats.setHunger( affectableStats.getHunger() + ticks + getXLEVELLevel(invoker())); break; case 't': affectableStats.setThirst( affectableStats.getThirst() + ticks + getXLEVELLevel(invoker())); break; case 'v': affectableStats.setMovement( affectableStats.getMovement() + ticks + getXLEVELLevel(invoker())); break; case 'm': affectableStats.setMana( affectableStats.getMana() + ticks + getXLEVELLevel(invoker())); break; case 'i': affectableStats.setHitPoints( affectableStats.getHitPoints() + ticks + getXLEVELLevel(invoker())); break; } } } } }
public void affectCharState(MOB affected, CharState affectableState) { if (affected == null) return; affectableState.setMovement(affectableState.getMovement() / 2); affectableState.setMana(affectableState.getMana() - (affectableState.getMana() / 3)); affectableState.setHitPoints(affectableState.getHitPoints() - affected.envStats().level()); }