Bug 2680: shapeshift spell cannot be cast twice.

Add a message and don't pay for the failed spell.
This commit is contained in:
Enno Rehling 2020-07-07 19:45:41 +02:00
parent e5be92da19
commit 1eaa6a9ec4
4 changed files with 22 additions and 5 deletions

View File

@ -1299,6 +1299,14 @@
<arg name="race" type="race"/> <arg name="race" type="race"/>
</type> </type>
</message> </message>
<message name="sp_shapeshift_twice" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
<arg name="target" type="unit"/>
</type>
</message>
<message name="sp_movecastle_fail_0" section="magic"> <message name="sp_movecastle_fail_0" section="magic">
<type> <type>

View File

@ -1250,6 +1250,9 @@ msgstr "\"$unit($unit) verdient in $region($region) $int($amount) Silber durch U
msgid "error180" msgid "error180"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Der Zauber schlägt fehl.\"" msgstr "\"$unit($unit) in $region($region): '$order($command)' - Der Zauber schlägt fehl.\""
msgid "sp_shapeshift_twice"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - $unit($target) ist bereits verzaubert.\""
msgid "sp_shapeshift_fail" msgid "sp_shapeshift_fail"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - $unit($target) kann nicht $race($race,1) werden.\"" msgstr "\"$unit($unit) in $region($region): '$order($command)' - $unit($target) kann nicht $race($race,1) werden.\""

View File

@ -1253,6 +1253,9 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - The spell fails
msgid "sp_shapeshift_fail" msgid "sp_shapeshift_fail"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - $unit($target) cannot take the form of $race($race,1).\"" msgstr "\"$unit($unit) in $region($region): '$order($command)' - $unit($target) cannot take the form of $race($race,1).\""
msgid "sp_shapeshift_twice"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - $unit($target) is already under this spell.\""
msgid "error290" msgid "error290"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Eine Einheit kann nur in einem Verband Mitglied sein.\"" msgstr "\"$unit($unit) in $region($region): '$order($command)' - Eine Einheit kann nur in einem Verband Mitglied sein.\""

View File

@ -4512,13 +4512,16 @@ int sp_illusionary_shapeshift(castorder * co)
return 0; return 0;
} }
irace = u_irace(u); irace = u_irace(u);
if (irace == u_race(u)) { if (irace != u_race(u)) {
trigger *trestore = trigger_changerace(u, NULL, irace); ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order,
add_trigger(&u->attribs, "timer", trigger_timeout((int)power + 3, "sp_shapeshift_twice", "target", u));
trestore)); return 0;
u->irace = rc;
} }
add_trigger(&u->attribs, "timer", trigger_timeout((int)power + 3,
trigger_changerace(u, NULL, irace)));
u->irace = rc;
ADDMSG(&mage->faction->msgs, msg_message("shapeshift_effect", ADDMSG(&mage->faction->msgs, msg_message("shapeshift_effect",
"mage target race", mage, u, rc)); "mage target race", mage, u, rc));