servatrice/oracle
Basile Clement ef38a8bb2b
Re-add missing '/' separator in <pt> after b282df2e27 (#4747)
In b282df2e27 (#4728) the logic for
creating <pt> values was updated to avoid adding a final slash after an
existing power value and missing toughness value. This works by setting
the ptSeparator to an empty string when either the power or the
toughness is undefined. However, due to the ptSeparator variable being
scoped out of the `for` loop, this causes all remaining cards to have an
empty string as a separator, ending up with <pt> values of e.g. 21
instead of 2/1.

Moreover, the implementation from #4728 is ambiguous in the case of a
card having a toughness value but no power value: in that situation, it
creates a <pt> entry with the toughness value and no separator, which is
not a good idea since it is not possible to know if <pt>2</pt> means
power 2 and no toughness, or no power and toughness 2 (Cockatrice takes
the first interpretation).

To avoid ambiguities, the <pt> value is now one of:

 1. A regular P/T value when the card has power and toughness
 2. A simplified P value when the card has power but no toughness
 3. A simplified /T value when the card has toughness but no power
 4. Absent when the card has neither power nor toughness

Note that, as far as I can tell, Cockatrice seems to (incorrectly, IMO)
ignore the initial slash if present in Player::parsePT, and treat /T as
a power value. However that is a separate issue: this patch is concerned
with Oracle and ensuring proper values in cards.xml, not with how
Cockatrice interprets those values.
2023-02-08 19:59:14 +01:00
..
resources svg+png updates 2015-04-28 16:06:36 +02:00
src Re-add missing '/' separator in <pt> after b282df2e27 (#4747) 2023-02-08 19:59:14 +01:00
translations Translate /oracle/oracle_en@source.ts in it (#4688) 2022-10-17 16:43:31 -04:00
CMakeLists.txt remove dependency on deprecated qt5 libraries for qt6 (#4692) 2022-10-31 23:24:11 +01:00
oracle.desktop Add icon to oracle 2014-08-07 17:27:15 +02:00
oracle.qrc Add icon to oracle 2014-08-07 17:27:15 +02:00
oracle.rc Add icon to oracle 2014-08-07 17:27:15 +02:00
oracle_en@source.ts Support Qt6, Min Qt5.8, Fix Win32, Fix Servatrice 2022-05-06 17:31:08 -04:00