Rushwind13 / JMoria

My from-scratch implementation of a Roguelike game that will be an homage to IMoria
4 stars 4 forks source link

Identify spell #114

Open Rushwind13 opened 2 hours ago

Rushwind13 commented 2 hours ago

Given I have a dagger And the dagger is cursed And the dagger is unidentified When I display equipment Then the dagger is not labeled as cursed

Given I have a dagger And the dagger is cursed And I have tried to remove it When I display equipment Then the dagger is identified as cursed Then the dagger is labeled as cursed

Given I have a dagger And the dagger is cursed And the dagger is magical And I have tried to remove it When I display equipment Then the dagger is identified as cursed Then the dagger is labeled as cursed Then the dagger is not labeled as magical

Given I have a dagger And the dagger is not cursed And the dagger is magical And the dagger is unidentified When I display equipment Then the dagger is not labeled as cursed Then the dagger is not labeled as magical

Given I have a dagger And the dagger is not cursed And the dagger is magical When I read a Scroll of Identify When I display equipment Then the dagger is not labeled as cursed Then the dagger is labeled as magical

Acceptance Criteria:

Note: might need ITEM_FLAG_KNOWN or something, to be able distinguish between "not known if cursed or uncursed" vs "known to be not cursed"

Rushwind13 commented 2 hours ago

just figured out the "known cursed" thing

So the display happens when known is set, and what is displayed is the underlying item flags/values if( known(cursed) ) display(item.cursed?"cursed":"uncursed") else "" if( known(magic)) display("(+x, +y)") else ""