示例#1
0
int sp_reduceshield(struct castorder * co)
{
    fighter * fi = co->magician.fig;
    int level = co->level;
    double power = co->force;
    const spell * sp = co->sp;
    int effect;
    int duration;
    battle *b = fi->side->battle;
    message *m = msg_message("cast_spell_effect", "mage spell", fi->unit, sp);
    message_all(b, m);
    msg_release(m);

    /* jeder Schaden wird um effect% reduziert bis der Schild duration
     * Trefferpunkte aufgefangen hat */

    switch (sp->id) {
    case SPL_REDUCESHIELD:
        effect = 50;
        duration = (int)(50 * power * power);
        break;

    default:
        effect = level * 3;
        duration = (int)get_force(power, 5);
    }
    do_meffect(fi, SHIELD_REDUCE, effect, duration);
    return level;
}
示例#2
0
int sp_fumbleshield(struct castorder * co)
{
    fighter * fi = co->magician.fig;
    int level = co->level;
    const spell * sp = co->sp;
    int effect;
    int duration;
    battle *b = fi->side->battle;
    message *m = msg_message("cast_spell_effect", "mage spell", fi->unit, sp);

    message_all(b, m);
    msg_release(m);

    /* der erste Zauber schl�gt mit 100% fehl  */

    switch (sp->id) {
    case SPL_DRAIG_FUMBLESHIELD:
    case SPL_GWYRRD_FUMBLESHIELD:
    case SPL_CERDDOR_FUMBLESHIELD:
    case SPL_TYBIED_FUMBLESHIELD:
        duration = 100;
        effect = _max(1, 25 - level);
        break;

    default:
        duration = 100;
        effect = 10;
    }
    do_meffect(fi, SHIELD_BLOCK, effect, duration);
    return level;
}
示例#3
0
int sp_armorshield(struct castorder * co)
{
    fighter * fi = co->magician.fig;
    int level = co->level;
    double power = co->force;
    const spell * sp = co->sp;
    int effect;
    int duration;
    battle *b = fi->side->battle;
    message *m = msg_message("cast_spell_effect", "mage spell", fi->unit, sp);

    message_all(b, m);
    msg_release(m);

    /* gibt R�stung +effect f�r duration Treffer */

    switch (sp->id) {
    case SPL_ARMORSHIELD:
        effect = level / 3;
        duration = (int)(20 * power * power);
        break;

    default:
        effect = level / 4;
        duration = (int)(power * power);
    }
    do_meffect(fi, SHIELD_ARMOR, effect, duration);
    return level;
}
示例#4
0
int sp_fumbleshield(struct castorder * co)
{
    fighter * fi = co->magician.fig;
    int level = co->level;
    const spell * sp = co->sp;
    int effect;
    int duration;
    battle *b = fi->side->battle;
    message *m = msg_message("cast_spell_effect", "mage spell", fi->unit, sp);

    message_all(b, m);
    msg_release(m);

    /* der erste Zauber schlaegt mit 100% fehl  */
    duration = 100;
    effect = 25 - level;
    if (effect < 1) effect = 1;

    do_meffect(fi, SHIELD_BLOCK, effect, duration);
    return level;
}
示例#5
0
int armor_spell(struct castorder * co, int per_level, int time_multi)
{
    fighter * fi = co->magician.fig;
    int level = co->level;
    double power = co->force;
    const spell * sp = co->sp;
    int effect;
    int duration;
    battle *b = fi->side->battle;
    message *m = msg_message("cast_spell_effect", "mage spell", fi->unit, sp);

    message_all(b, m);
    msg_release(m);

    /* gibt Ruestung +effect fuer duration Treffer */

    effect = level / per_level;
    duration = (int)(time_multi * power * power);
    do_meffect(fi, SHIELD_ARMOR, effect, duration);
    return level;
}