Ejemplo n.º 1
0
bool spell_poultice( char_data* ch, char_data* victim, void*,
  int level, int )
{
  heal_victim( ch, victim, spell_damage( SPELL_POULTICE, level ) );

  return TRUE;
}
Ejemplo n.º 2
0
bool spell_chain_lightning( char_data* ch, char_data* victim, void*,
  int level, int )
{
  room_data*  room;

  if( null_caster( ch, SPELL_CHAIN_LIGHTNING ) ) 
    return TRUE;

  room = ch->in_room;

  if( room->sector_type == SECT_UNDERWATER ) {
    water_shock( ch, SPELL_CHAIN_LIGHTNING, level );
    return TRUE;
    }
 
  for( ; victim != NULL; ) {
    damage_shock( victim, ch, spell_damage( SPELL_CHAIN_LIGHTNING, level ),
      "*The bifurcating lightning bolt" );
    if( number_range( 0, 3 ) == 0
      || ( victim = random_pers( room ) ) == ch 
      || !can_kill( ch, victim ) )
      break;
    }

  return TRUE;
}
Ejemplo n.º 3
0
bool spell_surcease( char_data* ch, char_data* victim, void*,
  int level, int )
{
  heal_victim( ch, victim, spell_damage( SPELL_SURCEASE, level ) );

  return TRUE;
}
Ejemplo n.º 4
0
bool spell_balm( char_data* ch, char_data* victim, void*,
  int level, int )
{
  heal_victim( ch, victim, spell_damage( SPELL_BALM, level ) );

  return TRUE;
}
Ejemplo n.º 5
0
void water_shock( char_data* ch, int spell, int level )
{
  char_data*  victim;

  for( int i = 0; i < *ch->array; i++ ) 
    if( ( victim = character( ch->array->list[i] ) ) != NULL
      && can_kill( ch, victim ) )
      damage_shock( victim, ch, 2*spell_damage( spell, level ),
        "*The water shock" );
    
  return;
}
Ejemplo n.º 6
0
/* Feuersturm: Betrifft sehr viele Gegner (in der Regel alle),
 * macht nur vergleichsweise geringen Schaden */
int sp_immolation(struct castorder * co)
{
    fighter * fi = co->magician.fig;
    int level = co->level;
    const spell * sp = co->sp;
    battle *b = fi->side->battle;
    troop at;
    int force, qi, killed = 0;
    const char *damage;
    quicklist *fgs, *ql;
    message *m;

    /* 2d4 HP */
    damage = spell_damage(5);
    /* Betrifft alle Gegner */
    force = 99999;

    if (!count_enemies(b, fi, FIGHT_ROW, AVOID_ROW, SELECT_ADVANCE | SELECT_FIND)) {
        message *m =
            msg_message("battle::out_of_range", "mage spell", fi->unit, sp);
        message_all(b, m);
        msg_release(m);
        return 0;
    }

    at.fighter = fi;
    at.index = 0;

    fgs = fighters(b, fi->side, FIGHT_ROW, AVOID_ROW, FS_ENEMY);
    for (qi = 0, ql = fgs; ql; ql_advance(&ql, &qi, 1)) {
        fighter *df = (fighter *)ql_get(ql, qi);
        int n = df->alive - df->removed;
        troop dt;

        dt.fighter = df;
        while (n != 0) {
            dt.index = --n;
            killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
            if (--force == 0)
                break;
        }
        if (force == 0)
            break;
    }
    ql_free(fgs);

    m =
        msg_message("battle::combatspell", "mage spell killed", fi->unit, sp,
        killed);
    message_all(b, m);
    msg_release(m);
    return level;
}
Ejemplo n.º 7
0
int sp_dragonodem(struct castorder * co)
{
    fighter * fi = co->magician.fig;
    int level = co->level;
    double power = co->force;
    const spell * sp = co->sp;
    battle *b = fi->side->battle;
    troop dt;
    troop at;
    int force, enemies;
    const char *damage;

    /* 11-26 HP */
    damage = spell_damage(4);
    /* Jungdrache 3->54, Drache 6->216, Wyrm 12->864 Treffer */
    force = lovar(get_force(power, 6));

    enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW - 1, SELECT_ADVANCE);

    if (!enemies) {
        struct message *m =
            msg_message("spell_out_of_range", "mage spell", fi->unit, sp);
        message_all(b, m);
        msg_release(m);
        return 0;
    }
    else {
        struct message *m;
        int killed = 0;

        at.fighter = fi;
        at.index = 0;

        while (force && killed < enemies) {
            dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW - 1, SELECT_ADVANCE);
            assert(dt.fighter);
            --force;
            killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
        }

        m =
            msg_message("cast_combatspell", "mage spell dead", fi->unit, sp,
            killed);
        message_all(b, m);
        msg_release(m);
    }
    return level;
}
Ejemplo n.º 8
0
bool spell_lightning_bolt( char_data* ch, char_data* victim, void*,
  int level, int )
{
  if( null_caster( ch, SPELL_LIGHTNING_BOLT ) )
    return TRUE;

  if( ch->in_room->sector_type == SECT_UNDERWATER ) {
    water_shock( ch, SPELL_LIGHTNING_BOLT, level );
    return TRUE;
    }

  damage_shock( victim, ch, spell_damage( SPELL_LIGHTNING_BOLT, level ),
    "*The brilliant bolt of lightning" );

  return TRUE;
}
Ejemplo n.º 9
0
bool spell_shock( char_data* ch, char_data* victim, void*,
  int level, int )
{
  if( null_caster( ch, SPELL_SHOCK ) )
    return TRUE;

  if( ch->in_room->sector_type == SECT_UNDERWATER ) {
    water_shock( ch, SPELL_SHOCK, level );
    return TRUE;
    }

  damage_shock( victim, ch, spell_damage( SPELL_SHOCK, level ),
    "*The blue arcs of energy", TRUE );

  return TRUE;
}
Ejemplo n.º 10
0
int sp_drainodem(fighter * fi, int level, double power, spell * sp)
{
    battle *b = fi->side->battle;
    troop dt;
    troop at;
    int force, enemies;
    int drained = 0;
    int killed = 0;
    const char *damage;
    message *m;

    /* 11-26 HP */
    damage = spell_damage(4);
    /* Jungdrache 3->54, Drache 6->216, Wyrm 12->864 Treffer */
    force = lovar(get_force(power, 6));

    enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW - 1, SELECT_ADVANCE);

    if (!enemies) {
        m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp);
        message_all(b, m);
        msg_release(m);
        return 0;
    }

    at.fighter = fi;
    at.index = 0;

    while (force && drained < enemies) {
        dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW - 1, SELECT_ADVANCE);
        assert(dt.fighter);
        if (hits(at, dt, NULL)) {
            drain_exp(dt.fighter->unit, 90);
            ++drained;
            killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
        }
        --force;
    }

    m =
        msg_message("cast_drainlife_effect", "mage spell amount", fi->unit, sp,
        drained);
    message_all(b, m);
    msg_release(m);
    return level;
}
Ejemplo n.º 11
0
/* Generischer Kampfzauber */
int damage_spell(struct castorder * co, int dmg, int strength)
{
    fighter * fi = co->magician.fig;
    int level = co->level;
    const spell * sp = co->sp;
    double power = co->force;
    battle *b = fi->side->battle;
    troop at, dt;
    message *m;
    /* Immer aus der ersten Reihe nehmen */
    int enemies, killed = 0;
    int force = lovar(get_force(power, strength));
    const char *damage = spell_damage(dmg);

    at.fighter = fi;
    at.index = 0;

    enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW - 1, SELECT_ADVANCE);
    if (enemies == 0) {
        m = msg_message("spell_out_of_range", "mage spell", fi->unit, sp);
        message_all(b, m);
        msg_release(m);
        return 0;
    }

    while (force > 0 && killed < enemies) {
        dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW - 1, SELECT_ADVANCE);
        assert(dt.fighter);
        --force;
        killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
    }

    m = msg_message("cast_combatspell", "mage spell dead",
        fi->unit, sp, killed);
    message_all(b, m);
    msg_release(m);

    return level;
}
Ejemplo n.º 12
0
/* Generischer Kampfzauber */
int sp_kampfzauber(struct castorder * co)
{
    fighter * fi = co->magician.fig;
    int level = co->level;
    double power = co->force;
    const spell * sp = co->sp;
    battle *b = fi->side->battle;
    troop at, dt;
    message *m;
    /* Immer aus der ersten Reihe nehmen */
    int force, enemies;
    int killed = 0;
    const char *damage;

    if (power <= 0)
        return 0;
    at.fighter = fi;
    at.index = 0;

    switch (sp->id) {
        /* lovar halbiert im Schnitt! */
    case SPL_FIREBALL:
        damage = spell_damage(0);
        force = lovar(get_force(power, 0));
        break;
    case SPL_HAGEL:
        damage = spell_damage(2);
        force = lovar(get_force(power, 4));
        break;
    case SPL_METEORRAIN:
        damage = spell_damage(1);
        force = lovar(get_force(power, 1));
        break;
    default:
        damage = spell_damage(10);
        force = lovar(get_force(power, 10));
    }

    enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW - 1, SELECT_ADVANCE);
    if (enemies == 0) {
        message *m =
            msg_message("battle::out_of_range", "mage spell", fi->unit, sp);
        message_all(b, m);
        msg_release(m);
        return 0;
    }

    while (force > 0 && killed < enemies) {
        dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW - 1, SELECT_ADVANCE);
        assert(dt.fighter);
        --force;
        killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
    }

    m = msg_message("battle::combatspell", "mage spell dead",
        fi->unit, sp, killed);
    message_all(b, m);
    msg_release(m);

    return level;
}