… | |
… | |
93 | // compute the attuned/repelled bonus |
93 | // compute the attuned/repelled bonus |
94 | // attuned only increases up to 2 times the original level (i.e. bonus <= level) */ |
94 | // attuned only increases up to 2 times the original level (i.e. bonus <= level) */ |
95 | // repell has no such quarrels |
95 | // repell has no such quarrels |
96 | return (caster->path_attuned & spell->path_attuned ? min (level, +ATTUNE_REPELL) : 0) |
96 | return (caster->path_attuned & spell->path_attuned ? min (level, +ATTUNE_REPELL) : 0) |
97 | + (caster->path_repelled & spell->path_attuned ? -ATTUNE_REPELL : 0); |
97 | + (caster->path_repelled & spell->path_attuned ? -ATTUNE_REPELL : 0); |
98 | } |
|
|
99 | |
|
|
100 | /* |
|
|
101 | * This function takes a caster and spell and presents the |
|
|
102 | * effective level the caster needs to be to cast the spell. |
|
|
103 | * basically, it just adjusts the spell->level with attuned/repelled |
|
|
104 | * spellpaths. Was called path_level_mod. |
|
|
105 | * |
|
|
106 | * caster is person casting the spell. |
|
|
107 | * spell is the spell object. |
|
|
108 | * Returns modified level. |
|
|
109 | */ |
|
|
110 | int |
|
|
111 | min_casting_level (object *caster, object *spell) |
|
|
112 | { |
|
|
113 | if (caster->path_denied & spell->path_attuned) |
|
|
114 | return 500; |
|
|
115 | |
|
|
116 | return max (1, spell->level + attuned_bonus (caster, spell, spell->level)); |
|
|
117 | } |
98 | } |
118 | |
99 | |
119 | /* This function returns the effective level the spell |
100 | /* This function returns the effective level the spell |
120 | * is being cast at. |
101 | * is being cast at. |
121 | */ |
102 | */ |