void Cmd_Amnesia(edict_t *ent) { int radius, talentLevel, cost=AMNESIA_COST; float duration; edict_t *target = NULL; if (debuginfo->value) gi.dprintf("DEBUG: %s just called Cmd_Amnesia()\n", ent->client->pers.netname); if(ent->myskills.abilities[AMNESIA].disable) return; //Talent: Cheaper Curses if ((talentLevel = getTalentLevel(ent, TALENT_CHEAPER_CURSES)) > 0) cost *= 1.0 - 0.1 * talentLevel; if (!G_CanUseAbilities(ent, ent->myskills.abilities[AMNESIA].current_level, cost)) return; radius = SHAMAN_CURSE_RADIUS_BASE + (SHAMAN_CURSE_RADIUS_BONUS * ent->myskills.abilities[AMNESIA].current_level); duration = AMNESIA_DURATION_BASE + (AMNESIA_DURATION_BONUS * ent->myskills.abilities[AMNESIA].current_level); //Talent: Evil curse talentLevel = getTalentLevel(ent, TALENT_EVIL_CURSE); if(talentLevel > 0) duration *= 1.0 + 0.25 * talentLevel; target = curse_Attack(ent, AMNESIA, radius, duration, true); if (target != NULL) { //Finish casting the spell ent->client->ability_delay = level.time + AMNESIA_DELAY; ent->client->pers.inventory[power_cube_index] -= cost; //disable some abilities if the player was using them V_DisableAllSkills(ent); //Notify the target if ((target->client) && !(target->svflags & SVF_MONSTER)) { gi.cprintf(target, PRINT_HIGH, "YOU HAVE BEEN CURSED WITH AMNESIA!! (%0.1f seconds)\n", duration); gi.cprintf(ent, PRINT_HIGH, "Cursed %s with amnesia for %0.1f seconds.\n", target->myskills.player_name, duration); } else { gi.cprintf(ent, PRINT_HIGH, "Cursed %s with amnesia for %0.1f seconds.\n", target->classname, duration); } //Play the spell sound! gi.sound(target, CHAN_ITEM, gi.soundindex("curses/amnesia.wav"), 1, ATTN_NORM, 0); } }
void Cmd_Curse(edict_t *ent) { int range, radius, talentLevel, cost=CURSE_COST; float duration; edict_t *target = NULL; if (debuginfo->value) gi.dprintf("DEBUG: %s just called Cmd_Curse()\n", ent->client->pers.netname); //Talent: Cheaper Curses if ((talentLevel = getTalentLevel(ent, TALENT_CHEAPER_CURSES)) > 0) cost *= 1.0 - 0.1 * talentLevel; if (!V_CanUseAbilities(ent, CURSE, cost, true)) return; range = CURSE_DEFAULT_INITIAL_RANGE + CURSE_DEFAULT_ADDON_RANGE * ent->myskills.abilities[CURSE].current_level; radius = CURSE_DEFAULT_INITIAL_RADIUS + CURSE_DEFAULT_ADDON_RADIUS * ent->myskills.abilities[CURSE].current_level; duration = CURSE_DURATION_BASE + (CURSE_DURATION_BONUS * ent->myskills.abilities[CURSE].current_level); //Talent: Evil curse talentLevel = getTalentLevel(ent, TALENT_EVIL_CURSE); if(talentLevel > 0) duration *= 1.0 + 0.25 * talentLevel; if (duration < 1) duration = 1; CurseRadiusAttack(ent, CURSE, range, radius, duration, true); //Finish casting the spell //ent->client->ability_delay = level.time + CURSE_DELAY; ent->myskills.abilities[CURSE].delay = level.time + CURSE_DELAY; ent->client->pers.inventory[power_cube_index] -= cost; target = curse_Attack(ent, CURSE, radius, duration, true); //Play the spell sound! gi.sound(ent, CHAN_ITEM, gi.soundindex("curses/curse.wav"), 1, ATTN_NORM, 0); }
void Cmd_Bless(edict_t *ent) { int radius; float duration, cooldown; edict_t *target = NULL; if (debuginfo->value) gi.dprintf("DEBUG: %s just called Cmd_Bless()\n", ent->client->pers.netname); if(ent->myskills.abilities[BLESS].disable) return; //if (!G_CanUseAbilities(ent, ent->myskills.abilities[BLESS].current_level, BLESS_COST)) // return; if (!V_CanUseAbilities(ent, BLESS, BLESS_COST, true)) return; radius = SHAMAN_CURSE_RADIUS_BASE + (SHAMAN_CURSE_RADIUS_BONUS * ent->myskills.abilities[BLESS].current_level); duration = BLESS_DURATION_BASE + (BLESS_DURATION_BONUS * ent->myskills.abilities[BLESS].current_level); //Blessing self? if (Q_strcasecmp(gi.argv(1), "self") == 0) { if (HasFlag(ent)) { gi.cprintf(ent, PRINT_HIGH, "Can't use this while carrying the flag!\n"); return; } if (!curse_add(ent, ent, BLESS, 0, duration)) { gi.cprintf(ent, PRINT_HIGH, "Unable to bless self.\n"); return; } target = ent; } else { target = curse_Attack(ent, BLESS, radius, duration, false); } if (target != NULL) { que_t *slot = NULL; //Finish casting the spell ent->client->ability_delay = level.time + BLESS_DELAY; ent->client->pers.inventory[power_cube_index] -= BLESS_COST; cooldown = 2.0 * duration; if (cooldown > 10.0) cooldown = 10.0; ent->myskills.abilities[BLESS].delay = level.time + cooldown; //Change the curse think to the bless think slot = que_findtype(target->curses, NULL, BLESS); if (slot) { slot->ent->think = Bless_think; slot->ent->nextthink = level.time + FRAMETIME; } //Notify the target if (target == ent) { gi.cprintf(target, PRINT_HIGH, "YOU HAVE BEEN BLESSED FOR %0.1f seconds!!\n", duration); } else if ((target->client) && !(target->svflags & SVF_MONSTER)) { gi.cprintf(target, PRINT_HIGH, "YOU HAVE BEEN BLESSED FOR %0.1f seconds!!\n", duration); gi.cprintf(ent, PRINT_HIGH, "Blessed %s for %0.1f seconds.\n", target->myskills.player_name, duration); } else { gi.cprintf(ent, PRINT_HIGH, "Blessed %s for %0.1f seconds.\n", target->classname, duration); } //Play the spell sound! gi.sound(target, CHAN_ITEM, gi.soundindex("curses/bless.wav"), 1, ATTN_NORM, 0); } }
void Cmd_Healing(edict_t *ent) { int radius; float duration; edict_t *target = NULL; if (debuginfo->value) gi.dprintf("DEBUG: %s just called Cmd_Healing()\n", ent->client->pers.netname); if(ent->myskills.abilities[HEALING].disable) return; if (!G_CanUseAbilities(ent, ent->myskills.abilities[HEALING].current_level, HEALING_COST)) return; radius = SHAMAN_CURSE_RADIUS_BASE + (SHAMAN_CURSE_RADIUS_BONUS * ent->myskills.abilities[HEALING].current_level); duration = HEALING_DURATION_BASE + (HEALING_DURATION_BONUS * ent->myskills.abilities[HEALING].current_level); //Blessing self? if (Q_strcasecmp(gi.argv(1), "self") == 0) { if (!curse_add(ent, ent, HEALING, 0, duration)) { gi.cprintf(ent, PRINT_HIGH, "Unable to bless self.\n"); return; } target = ent; } else { target = curse_Attack(ent, HEALING, radius, duration, false); } if (target != NULL) { que_t *slot = NULL; //Finish casting the spell ent->client->ability_delay = level.time + HEALING_DELAY; ent->client->pers.inventory[power_cube_index] -= HEALING_COST; //Change the curse think to the healing think slot = que_findtype(target->curses, NULL, HEALING); if (slot) { slot->ent->think = Healing_think; slot->ent->nextthink = level.time + FRAMETIME; } //Notify the target if (target == ent) { gi.cprintf(target, PRINT_HIGH, "YOU HAVE BEEN BLESSED WITH %0.1f seconds OF HEALING!!\n", duration); } else if ((target->client) && !(target->svflags & SVF_MONSTER)) { gi.cprintf(target, PRINT_HIGH, "YOU HAVE BEEN BLESSED WITH %0.1f seconds OF HEALING!!\n", duration); gi.cprintf(ent, PRINT_HIGH, "Blessed %s with healing for %0.1f seconds.\n", target->myskills.player_name, duration); } else { gi.cprintf(ent, PRINT_HIGH, "Blessed %s with healing for %0.1f seconds.\n", target->classname, duration); } //Play the spell sound! gi.sound(target, CHAN_ITEM, gi.soundindex("curses/prayer.wav"), 1, ATTN_NORM, 0); } }
void Cmd_Deflect_f(edict_t *ent) { float duration; edict_t *target = ent; // default target is self if (!V_CanUseAbilities(ent, DEFLECT, DEFLECT_COST, true)) return; duration = DEFLECT_INITIAL_DURATION + DEFLECT_ADDON_DURATION * ent->myskills.abilities[DEFLECT].current_level; // bless the tank instead of the noclipped player if (PM_PlayerHasMonster(ent)) target = target->owner; //Blessing self? if (Q_strcasecmp(gi.argv(1), "self") == 0) { if (!curse_add(target, ent, DEFLECT, 0, duration)) { gi.cprintf(ent, PRINT_HIGH, "Unable to bless self.\n"); return; } //target = ent; } else { target = curse_Attack(ent, DEFLECT, 512.0, duration, false); } if (target != NULL) { que_t *slot = NULL; //Finish casting the spell ent->client->ability_delay = level.time + DEFLECT_DELAY; ent->client->pers.inventory[power_cube_index] -= DEFLECT_COST; // ent->myskills.abilities[DEFLECT].delay = level.time + duration + DEFLECT_DELAY; //Change the curse think to the deflect think slot = que_findtype(target->curses, NULL, DEFLECT); if (slot) { slot->ent->think = deflect_think; slot->ent->nextthink = level.time + FRAMETIME; slot->ent->random = DEFLECT_INITIAL_PROJECTILE_CHANCE+DEFLECT_ADDON_HITSCAN_CHANCE*ent->myskills.abilities[DEFLECT].current_level; if (slot->ent->random > DEFLECT_MAX_PROJECTILE_CHANCE) slot->ent->random = DEFLECT_MAX_PROJECTILE_CHANCE; } //Notify the target if (target == ent) { gi.cprintf(target, PRINT_HIGH, "You have been blessed with deflect for %0.1f seconds!\n", duration); } else if ((target->client) && !(target->svflags & SVF_MONSTER)) { gi.cprintf(target, PRINT_HIGH, "You have been blessed with deflect for %0.1f seconds!\n\n", duration); gi.cprintf(ent, PRINT_HIGH, "Blessed %s with deflect for %0.1f seconds.\n", target->myskills.player_name, duration); } else { gi.cprintf(ent, PRINT_HIGH, "Blessed %s with deflect for %0.1f seconds.\n", V_GetMonsterName(target), duration); } //Play the spell sound! gi.sound(target, CHAN_ITEM, gi.soundindex("curses/prayer.wav"), 1, ATTN_NORM, 0); } }