Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bequeathed strategy hint

  • Loading branch information...
commit 5eea8a925f2e2cb8eca5561adea763872dd5e69c 1 parent 6ac0547
@neuront neuront authored
View
13 ext/src/skills/bequeathed_strategy.py
@@ -52,12 +52,19 @@ def _update_hint(self):
candidates = self.game_control.players_from_current()
candidates.remove(self.player)
candidates = map(lambda p: p.player_id, candidates)
- for c in self.cards:
- self.add_hint_fix_target('transfer', c, 1, candidates)
+ self.set_hint_category('methods', {
+ 'bequeathed strategy': {
+ 'require': ['fix target', 'cards'],
+ 'target count': 1,
+ 'candidates': candidates,
+ 'cards': map(lambda c: c.card_id,
+ self.cards),
+ }
+ })
self.add_quit()
def _hint_action(self, token):
- return 'transfer'
+ return 'use'
def add_to(player):
player.actions_after_damaged['character']['ability'] = bequeathed_strategy
View
36 ext/test/test_bequeathed_strategy.py
@@ -129,17 +129,13 @@
assert_eq({
'code': ret_code.OK,
- 'action': 'transfer',
- 'transfer': {
- 10: {
- 'type': 'fix target',
- 'count': 1,
- 'candidates': [players[1].player_id],
- },
- 11: {
- 'type': 'fix target',
- 'count': 1,
+ 'action': 'use',
+ 'methods': {
+ 'bequeathed strategy': {
+ 'require': ['fix target', 'cards'],
+ 'target count': 1,
'candidates': [players[1].player_id],
+ 'cards': [10, 11],
},
},
'abort': 'allow',
@@ -147,7 +143,7 @@
}, gc.hint(players[0].token))
assert_eq({
'code': ret_code.OK,
- 'action': 'transfer',
+ 'action': 'use',
'players': [players[0].player_id],
}, gc.hint(players[1].token))
@@ -181,17 +177,13 @@
assert_eq({
'code': ret_code.OK,
- 'action': 'transfer',
- 'transfer': {
- 12: {
- 'type': 'fix target',
- 'count': 1,
- 'candidates': [players[1].player_id],
- },
- 13: {
- 'type': 'fix target',
- 'count': 1,
+ 'action': 'use',
+ 'methods': {
+ 'bequeathed strategy': {
+ 'require': ['fix target', 'cards'],
+ 'target count': 1,
'candidates': [players[1].player_id],
+ 'cards': [12, 13],
},
},
'abort': 'allow',
@@ -199,7 +191,7 @@
}, gc.hint(players[0].token))
assert_eq({
'code': ret_code.OK,
- 'action': 'transfer',
+ 'action': 'use',
'players': [players[0].player_id],
}, gc.hint(players[1].token))
Please sign in to comment.
Something went wrong with that request. Please try again.