Hide or spawn items depending on game state of player #44

Closed
opened 2016-11-09 09:54:23 +01:00 by nik · 3 comments
nik commented 2016-11-09 09:54:23 +01:00 (Migrated from edugit.org)

We should provide functionality for…

  • hiding items on the map if owned_max is reached
  • spawning items only if the player has a specified attribute set. This should be defined by a dictionary names spawn_player_attributes in the item implementation in the game

Implementation details:

Make isonmap (in GameObject) a property method instead of a column. Make it return True in GameObject, and override it in Item. In Item, make it…

  • return False if the item is held by a player,
  • return False if owned_max is reached for the current player,
  • return True otherwise

Do not forget to add the new isonmap to include_methods of the API endpoint.

This is for the first task item; the second one needs to be drafted.

We should provide functionality for… - [x] hiding items on the map if owned_max is reached - [ ] spawning items only if the player has a specified attribute set. This should be defined by a dictionary names spawn_player_attributes in the item implementation in the game Implementation details: Make isonmap (in GameObject) a property method instead of a column. Make it return True in GameObject, and override it in Item. In Item, make it… - return False if the item is held by a player, - return False if owned_max is reached for the current player, - return True otherwise Do not forget to add the new isonmap to include_methods of the API endpoint. This is for the first task item; the second one needs to be drafted.
nik commented 2016-11-23 23:19:41 +01:00 (Migrated from edugit.org)

@Creeparo, can you please do the first task item, as layed out above, this week, please? (Please create a new branch from current master.)

@Creeparo, can you please do the first task item, as layed out above, this week, please? (Please create a new branch from current master.)
nik commented 2016-11-29 16:39:28 +01:00 (Migrated from edugit.org)

The code is completely broken. It is trying to access some non-existing attributes of the Player object when it should be looking inside the attributes dictionary of the player, and that if branch thing that passes on most of them looks strange.

Please explain how you tested the code.

The code is completely broken. It is trying to access some non-existing attributes of the Player object when it should be looking inside the attributes dictionary of the player, and that if branch thing that passes on most of them looks strange. Please explain how you tested the code.
nik commented 2016-11-30 10:25:10 +01:00 (Migrated from edugit.org)

I think we forgot something…

Think of this case:

An item of type Foo can be held three times. It spawns at every tree. Once the player collects three Foos, all items of that type will be hidden.

While that's technically ok, it will look strange.

We should add support for the following variable:

  • show_if_owned_max

If it is not set, the isonmap code should assume False.

I think we forgot something… Think of this case: An item of type Foo can be held three times. It spawns at every tree. Once the player collects three Foos, all items of that type will be hidden. While that's technically ok, it will look strange. We should add support for the following variable: * show_if_owned_max If it is not set, the isonmap code should assume False.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nik/veripeditus-server#44
No description provided.