1
0

FIX: Protego working while it was supposed to fail

This commit is contained in:
Kwarde 2024-01-16 16:14:54 +01:00
parent 4a01544ebf
commit 66ef9b3570

View File

@ -126,16 +126,16 @@ class Player:
elif not spell_succes: elif not spell_succes:
print("- {name}: (nothing, still stunned)".format(name=self.name)) print("- {name}: (nothing, still stunned)".format(name=self.name))
elif self.active_spell is spell_impendimenta: elif self.active_spell is spell_impendimenta:
if opponent.active_spell is not spell_protego: if opponent.active_spell is spell_protego and opponent.active_spell_succes:
print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} blocks the attack!".format(name=self.name, name_o=opponent.name, spell=spell_name))
else:
print("- {name} casts {spell} on {name_o}. {name_o} is slowed and their next offensive move will have a 33% slower spell speed!".format(name=self.name, name_o=opponent.name, spell=spell_name)) print("- {name} casts {spell} on {name_o}. {name_o} is slowed and their next offensive move will have a 33% slower spell speed!".format(name=self.name, name_o=opponent.name, spell=spell_name))
opponent.decreased_spell_speed = True opponent.decreased_spell_speed = True
else:
print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} blocks the attack!".format(name=self.name, name_o=opponent.name, spell=spell_name))
elif self.active_spell is spell_lumos_solem: elif self.active_spell is spell_lumos_solem:
# Light still goes through the shield, therefor always succeed blinding attempts # Light still goes through the shield, therefor always succeed blinding attempts
print("- {name} casts {spell} on {name_o}. {name_o} is blinded and their next offensive move will have 33% less damage!".format(name=self.name, name_o=opponent.name, spell=spell_name)) print("- {name} casts {spell} on {name_o}. {name_o} is blinded and their next offensive move will have 33% less damage!".format(name=self.name, name_o=opponent.name, spell=spell_name))
opponent.decreased_spell_damage = True opponent.decreased_spell_damage = True
elif self.active_spell is spell_protego: elif self.active_spell is spell_protego and self.active_spell_succes:
print("- {name} casts {spell}".format(name=self.name, spell=spell_name)) print("- {name} casts {spell}".format(name=self.name, spell=spell_name))
else: else:
print("<!> [debug]{name} casted SPELL_TYPE_DEFENSE {spell}. Behaviour unscripted!".format(name=self.name, spell=spell_name)) print("<!> [debug]{name} casted SPELL_TYPE_DEFENSE {spell}. Behaviour unscripted!".format(name=self.name, spell=spell_name))
@ -161,20 +161,20 @@ class Player:
else: else:
if self.active_spell is spell_mimblewimble: if self.active_spell is spell_mimblewimble:
if opponent.active_spell is not spell_protego: if opponent.active_spell is spell_protego and opponent.active_spell_succes:
print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} blocks the attack!".format(name=self.name, spell=spell_name, name_o=opponent.name))
else:
print("- {name} casts {spell} on {name_o}. {name_o}'s tongue is tied in a knot. That's annoying! {name_o} is silenced for 1 (more) move".format(name=self.name, spell=spell_name, name_o=opponent.name)) print("- {name} casts {spell} on {name_o}. {name_o}'s tongue is tied in a knot. That's annoying! {name_o} is silenced for 1 (more) move".format(name=self.name, spell=spell_name, name_o=opponent.name))
opponent.add_stunned_rounds(-self.active_spell.damage) opponent.add_stunned_rounds(-self.active_spell.damage)
else:
print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} blocks the attack!".format(name=self.name, spell=spell_name, name_o=opponent.name))
elif self.active_spell is spell_silencio: elif self.active_spell is spell_silencio:
if opponent.active_spell is not spell_protego: if opponent.active_spell is spell_protego and opponent.active_spell_succes:
print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} blocks the attack!".format(name=self.name, spell=spell_name, name_o=opponent.name))
else:
if opponent.stunned_rounds == 0: if opponent.stunned_rounds == 0:
print("- {name} casts {spell} on {name_o}. SUCCES! {name_o} is silenced for 3 (more) moves".format(name=self.name, spell=spell_name, name_o=opponent.name)) print("- {name} casts {spell} on {name_o}. SUCCES! {name_o} is silenced for 3 (more) moves".format(name=self.name, spell=spell_name, name_o=opponent.name))
opponent.add_stunned_rounds(-self.active_spell.damage) opponent.add_stunned_rounds(-self.active_spell.damage)
else: else:
print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} is already silenced!".format(name=self.name, spell=spell_name, name_o=opponent.name)) print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} is already silenced!".format(name=self.name, spell=spell_name, name_o=opponent.name))
else:
print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} blocks the attack!".format(name=self.name, spell=spell_name, name_o=opponent.name))
else: else:
damage_penalty = self.active_spell_levenshtein_distance * 15 damage_penalty = self.active_spell_levenshtein_distance * 15
if damage_penalty != 0: print("<!> {name} was unclear in their pronunciation and receives a damage penalty of {damage_penalty}".format(name=self.name, damage_penalty=damage_penalty)) if damage_penalty != 0: print("<!> {name} was unclear in their pronunciation and receives a damage penalty of {damage_penalty}".format(name=self.name, damage_penalty=damage_penalty))
@ -188,7 +188,7 @@ class Player:
total_damage = self.active_spell.damage * self.wand.damage * damage_modifier - damage_penalty total_damage = self.active_spell.damage * self.wand.damage * damage_modifier - damage_penalty
if total_damage < 0: total_damage = 0 if total_damage < 0: total_damage = 0
if opponent.active_spell is spell_protego: if opponent.active_spell is spell_protego and opponent.active_spell_succes:
print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} blocks the attack!".format(name=self.name, spell=spell_name, name_o=opponent.name)) print("- {name} casts {spell} on {name_o}. FAILURE! {name_o} blocks the attack!".format(name=self.name, spell=spell_name, name_o=opponent.name))
else: else:
print("- {name} casts {spell} on {name_o} causing {dmg} damage!".format(name=self.name, spell=spell_name, name_o=opponent.name, dmg=total_damage)) print("- {name} casts {spell} on {name_o} causing {dmg} damage!".format(name=self.name, spell=spell_name, name_o=opponent.name, dmg=total_damage))