Skip to content
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.

Commit

Permalink
[core/god] do not stack challenge-affect-scoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexef committed Nov 23, 2011
1 parent 33c8cc9 commit fb1a408
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions wouso/core/god/god.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ def can_cast(self, spell, source, destination):
if (spell.name == 'steal') and (source == destination):
return False

if spell.name == 'challenge-affect-scoring':
existing = destination.spells.filter(spell__name='challenge-affect-scoring')
if existing.count() > 0:
# check if a spell with the same sign +/- exists
for sp in existing:
if (sp.spell.percents * spell.percents) > 0:
return False
# in order to apply this new spell, cancel existing, sign contrary, spells
existing.delete()
return True

def post_cast(self, psdue):
Expand Down

0 comments on commit fb1a408

Please sign in to comment.