?? magic.c
字號:
/*
* NPC spells.
*/
void spell_acid_breath( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
OBJ_DATA *obj_lose;
OBJ_DATA *obj_next;
int dam;
int hpch;
if ( number_percent( ) < 2 * level && !saves_spell( level, victim ) )
{
for ( obj_lose = ch->carrying; obj_lose != NULL; obj_lose = obj_next )
{
int iWear;
obj_next = obj_lose->next_content;
if ( number_bits( 2 ) != 0 )
continue;
switch ( obj_lose->item_type )
{
case ITEM_ARMOR:
if ( obj_lose->value[0] > 0 )
{
act( "$p is pitted and etched!",
victim, obj_lose, NULL, TO_CHAR );
if ( ( iWear = obj_lose->wear_loc ) != WEAR_NONE )
victim->armor -= apply_ac( obj_lose, iWear );
obj_lose->value[0] -= 1;
obj_lose->cost = 0;
if ( iWear != WEAR_NONE )
victim->armor += apply_ac( obj_lose, iWear );
}
break;
case ITEM_CONTAINER:
act( "$p fumes and dissolves!",
victim, obj_lose, NULL, TO_CHAR );
extract_obj( obj_lose );
break;
}
}
}
hpch = UMAX( 10, ch->hit );
dam = number_range( hpch/16+1, hpch/8 );
if ( saves_spell( level, victim ) )
dam /= 2;
damage( ch, victim, dam, sn );
return;
}
void spell_fire_breath( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
OBJ_DATA *obj_lose;
OBJ_DATA *obj_next;
int dam;
int hpch;
if ( number_percent( ) < 2 * level && !saves_spell( level, victim ) )
{
for ( obj_lose = victim->carrying; obj_lose != NULL;
obj_lose = obj_next )
{
char *msg;
obj_next = obj_lose->next_content;
if ( number_bits( 2 ) != 0 )
continue;
switch ( obj_lose->item_type )
{
default: continue;
case ITEM_CONTAINER: msg = "$p ignites and burns!"; break;
case ITEM_POTION: msg = "$p bubbles and boils!"; break;
case ITEM_SCROLL: msg = "$p crackles and burns!"; break;
case ITEM_STAFF: msg = "$p smokes and chars!"; break;
case ITEM_WAND: msg = "$p sparks and sputters!"; break;
case ITEM_FOOD: msg = "$p blackens and crisps!"; break;
case ITEM_PILL: msg = "$p melts and drips!"; break;
}
act( msg, victim, obj_lose, NULL, TO_CHAR );
extract_obj( obj_lose );
}
}
hpch = UMAX( 10, ch->hit );
dam = number_range( hpch/16+1, hpch/8 );
if ( saves_spell( level, victim ) )
dam /= 2;
damage( ch, victim, dam, sn );
return;
}
void spell_frost_breath( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
OBJ_DATA *obj_lose;
OBJ_DATA *obj_next;
int dam;
int hpch;
if ( number_percent( ) < 2 * level && !saves_spell( level, victim ) )
{
for ( obj_lose = victim->carrying; obj_lose != NULL;
obj_lose = obj_next )
{
char *msg;
obj_next = obj_lose->next_content;
if ( number_bits( 2 ) != 0 )
continue;
switch ( obj_lose->item_type )
{
default: continue;
case ITEM_CONTAINER:
case ITEM_DRINK_CON:
case ITEM_POTION: msg = "$p freezes and shatters!"; break;
}
act( msg, victim, obj_lose, NULL, TO_CHAR );
extract_obj( obj_lose );
}
}
hpch = UMAX( 10, ch->hit );
dam = number_range( hpch/16+1, hpch/8 );
if ( saves_spell( level, victim ) )
dam /= 2;
damage( ch, victim, dam, sn );
return;
}
void spell_gas_breath( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *vch;
CHAR_DATA *vch_next;
int dam;
int hpch;
for ( vch = ch->in_room->people; vch != NULL; vch = vch_next )
{
vch_next = vch->next_in_room;
if ( IS_NPC(ch) ? !IS_NPC(vch) : IS_NPC(vch) )
{
hpch = UMAX( 10, ch->hit );
dam = number_range( hpch/16+1, hpch/8 );
if ( saves_spell( level, vch ) )
dam /= 2;
damage( ch, vch, dam, sn );
}
}
return;
}
void spell_lightning_breath( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
int dam;
int hpch;
hpch = UMAX( 10, ch->hit );
dam = number_range( hpch/16+1, hpch/8 );
if ( saves_spell( level, victim ) )
dam /= 2;
damage( ch, victim, dam, sn );
return;
}
/*
* Code for Psionicist spells/skills by Thelonius
*/
void spell_adrenaline_control ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
AFFECT_DATA af;
if ( is_affected( victim, sn ) )
return;
af.type = sn;
af.duration = level - 5;
af.location = APPLY_DEX;
af.modifier = 2;
af.bitvector = 0;
affect_to_char( victim, &af );
af.location = APPLY_CON;
affect_to_char( victim, &af );
send_to_char( "You have given yourself an adrenaline rush!\n\r", ch );
act( "$n has given $mself an adrenaline rush!", ch, NULL, NULL,
TO_ROOM );
return;
}
void spell_agitation ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
static const int dam_each [ ] =
{
0,
0, 0, 0, 0, 0, 12, 15, 18, 21, 24,
24, 24, 25, 25, 26, 26, 26, 27, 27, 27,
28, 28, 28, 29, 29, 29, 30, 30, 30, 31,
31, 31, 32, 32, 32, 33, 33, 33, 34, 34,
34, 35, 35, 35, 36, 36, 36, 37, 37, 37
};
int dam;
level = UMIN( level, sizeof( dam_each ) / sizeof( dam_each[0] ) - 1 );
level = UMAX( 0, level );
dam = number_range( dam_each[level] / 2, dam_each[level] * 2 );
if ( saves_spell( level, victim ) )
dam /= 2;
damage( ch, victim, dam, sn );
return;
}
void spell_aura_sight ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
char *msg;
int ap;
ap = victim->alignment;
if ( ap > 700 ) msg = "$N has an aura as white as the driven snow.";
else if ( ap > 350 ) msg = "$N is of excellent moral character.";
else if ( ap > 100 ) msg = "$N is often kind and thoughtful.";
else if ( ap > -100 ) msg = "$N doesn't have a firm moral commitment.";
else if ( ap > -350 ) msg = "$N lies to $S friends.";
else if ( ap > -700 ) msg = "Don't bring $N home to meet your family.";
else msg = "Uh, check please!";
act( msg, ch, NULL, victim, TO_CHAR );
}
void spell_awe ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
if ( victim->fighting == ch && !saves_spell( level, victim ) )
{
stop_fighting ( victim, TRUE);
act( "$N is in AWE of you!", ch, NULL, victim, TO_CHAR );
act( "You are in AWE of $n!",ch, NULL, victim, TO_VICT );
act( "$N is in AWE of $n!", ch, NULL, victim, TO_NOTVICT );
}
return;
}
void spell_ballistic_attack ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
static const int dam_each [ ] =
{
0,
3, 4, 4, 5, 6, 6, 6, 7, 7, 7,
7, 7, 8, 8, 8, 9, 9, 9, 10, 10,
10, 11, 11, 11, 12, 12, 12, 13, 13, 13,
14, 14, 14, 15, 15, 15, 16, 16, 16, 17,
17, 17, 18, 18, 18, 19, 19, 19, 20, 20
};
int dam;
level = UMIN( level, sizeof( dam_each ) / sizeof( dam_each[0] ) - 1 );
level = UMAX( 0, level );
dam = number_range( dam_each[level] / 2, dam_each[level] * 2 );
if ( saves_spell( level, victim ) )
dam /= 2;
act( "You chuckle as a stone strikes $N.", ch, NULL, victim,
TO_CHAR );
damage( ch, victim, dam, sn);
return;
}
void spell_biofeedback ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
AFFECT_DATA af;
if ( IS_AFFECTED( victim, AFF_SANCTUARY ) )
return;
af.type = sn;
af.duration = number_fuzzy( level / 8 );
af.location = APPLY_NONE;
af.modifier = 0;
af.bitvector = AFF_SANCTUARY;
affect_to_char( victim, &af );
send_to_char( "You are surrounded by a white aura.\n\r", victim );
act( "$n is surrounded by a white aura.", victim, NULL, NULL, TO_ROOM );
return;
}
void spell_cell_adjustment ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
if ( is_affected( victim, gsn_poison ) )
{
affect_strip( victim, gsn_poison );
send_to_char( "A warm feeling runs through your body.\n\r", victim );
act( "$N looks better.", ch, NULL, victim, TO_NOTVICT );
}
if ( is_affected( victim, gsn_curse ) )
{
affect_strip( victim, gsn_curse );
send_to_char( "You feel better.\n\r", victim );
}
send_to_char( "Ok.\n\r", ch );
return;
}
void spell_combat_mind ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
AFFECT_DATA af;
if ( is_affected( victim, sn ) )
{
if ( victim == ch )
send_to_char( "You already understand battle tactics.\n\r",
victim );
else
act( "$N already understands battle tactics.",
ch, NULL, victim, TO_CHAR );
return;
}
af.type = sn;
af.duration = level + 3;
af.location = APPLY_HITROLL;
af.modifier = level / 6;
af.bitvector = 0;
affect_to_char( victim, &af );
af.location = APPLY_AC;
af.modifier = - level/2 - 5;
affect_to_char( victim, &af );
if ( victim != ch )
send_to_char( "OK.\n\r", ch );
send_to_char( "You gain a keen understanding of battle tactics.\n\r",
victim );
return;
}
void spell_complete_healing ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
victim->hit = victim->max_hit;
update_pos( victim );
if ( ch != victim )
send_to_char( "Ok.\n\r", ch );
send_to_char( "Ahhhhhh...You are completely healed!\n\r", victim );
return;
}
void spell_control_flames ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
static const int dam_each [ ] =
{
0,
0, 0, 0, 0, 0, 0, 0, 16, 20, 24,
28, 32, 35, 38, 40, 42, 44, 45, 45, 45,
46, 46, 46, 47, 47, 47, 48, 48, 48, 49,
49, 49, 50, 50, 50, 51, 51, 51, 52, 52,
52, 53, 53, 53, 54, 54, 54, 55, 55, 55
};
int dam;
if ( !get_eq_char( ch, WEAR_LIGHT ) )
{
send_to_char( "You must be carrying a light source.\n\r", ch );
return;
}
level = UMIN( level, sizeof( dam_each ) / sizeof( dam_each[0] ) - 1 );
level = UMAX( 0, level );
dam = number_range( dam_each[level] / 2, dam_each[level] * 2 );
if ( saves_spell( level, victim ) )
dam /= 2;
damage( ch, victim, dam, sn );
return;
}
void spell_create_sound ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *vch;
char buf1 [ MAX_STRING_LENGTH ];
char buf2 [ MAX_STRING_LENGTH ];
char speaker [ MAX_INPUT_LENGTH ];
target_name = one_argument( target_name, speaker );
sprintf( buf1, "%s says '%s'.\n\r", speaker, target_name );
sprintf( buf2, "Someone makes %s say '%s'.\n\r", speaker, target_name );
buf1[0] = UPPER( buf1[0] );
for ( vch = ch->in_room->people; vch; vch = vch->next_in_room )
{
if ( !is_name( speaker, vch->name ) )
send_to_char( saves_spell( level, vch ) ? buf2 : buf1, vch );
}
return;
}
void spell_death_field ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *vch;
CHAR_DATA *vch_next;
int dam;
int hpch;
if ( !IS_EVIL( ch ) )
{
send_to_char( "You are not evil enough to do that!\n\r", ch);
return;
}
send_to_char( "A black haze emanates from you!\n\r", ch );
act ( "A black haze emanates from $n!", ch, NULL, ch, TO_ROOM );
for ( vch = ch->in_room->people; vch; vch = vch_next )
{
vch_next = vch->next_in_room;
//@@@ if ( vch->deleted )
//@@@ continue;
if ( !IS_NPC( ch ) ? IS_NPC( vch ) : IS_NPC( vch ) )
{
hpch = URANGE( 10, ch->hit, 999 );
if ( !saves_spell( level, vch )
&& ( level <= vch->level + 5
&& level >= vch->level - 5 ) )
{
dam = 4; /* Enough to compensate for sanct. and prot. */
vch->hit = 1;
update_pos( vch );
send_to_char( "The haze envelops you!\n\r", vch );
act( "The haze envelops $N!", ch, NULL, vch, TO_ROOM );
}
else
dam = number_range( hpch / 16 + 1, hpch / 8 );
damage( ch, vch, dam, sn );
}
}
return;
}
void spell_detonate ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
static const int dam_each [ ] =
{
0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
80, 85, 90, 95, 100, 102, 104, 106, 108, 110,
112, 114, 116, 118, 120, 122, 124, 126, 128, 130,
132, 134, 136, 138, 140, 142, 144, 146, 148, 150
};
int dam;
level = UMIN( level, sizeof( dam_each ) / sizeof( dam_each[0] ) - 1 );
level = UMAX( 0, level );
dam = number_range( dam_each[level] / 2, dam_each[level] * 2 );
if ( saves_spell( level, victim ) )
dam /= 2;
damage( ch, victim, dam, sn );
return;
}
void spell_disintegrate ( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *vic
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -