greenpiece / androminion

Automatically exported from code.google.com/p/androminion
0 stars 0 forks source link

Haggler and potion played, potion in cost in general #235

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Play a Haggler, Play 8p, Buy a Province  --> Gain a Golem 

In general Cost implementation in code looks kinda not so nice concept. Maybe a 
cost class including potion and adding decreasing isLess etc. functions would 
probably clean up code quite much. :)

I am actually not sure if you play Haggler, 4p buy a Possession, can you still 
gain a Gold, i.e isLower(6,6p) true? :)

Original issue reported on code.google.com by ras.na...@gmail.com on 12 Jan 2012 at 8:47

GoogleCodeExporter commented 9 years ago
To answer your question, yes, you can.  Per the Alchemy rules: 

If the cost in coin of Card A is C and the cost in potions of Card A is P, then 
Card A costs more than card B iff:

(AC > BC AND AP >= BP)
OR
(AC == BC AND AP > BP)

In other words, 6p is more than 6, so you can play a Haggler, buy a Possession, 
and gain a Gold.  However, 6 is not more than 5p and 5p is not more than 6, so 
you can't buy a Golem and gain a Market, or vice versa.

This has the interesting effect of making cost comparison intransitive in 
Dominion.  So, all of the following statements are false:

Golem costs more than Market
Market costs more than Golem
Golem and Market have the same cost

Original comment by August.D...@gmail.com on 12 Jan 2012 at 9:57

GoogleCodeExporter commented 9 years ago
Fixed.
But current cost implementation is so confusable, bug or regression can often 
occur.
Should introduce class that represents cost including potion cost.

Original comment by ksuke...@gmail.com on 14 Jan 2012 at 6:20